Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 147033 - sci-physics/xfoil-6.94-r1 fails to compile with GCC 4.1.1
Summary: sci-physics/xfoil-6.94-r1 fails to compile with GCC 4.1.1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 117482
  Show dependency tree
 
Reported: 2006-09-10 01:52 UTC by Bob Johnson
Modified: 2007-05-23 20:18 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to 6.94-r1 to fix missing rshift intrinsic (fix-missing-rshift.patch,1.03 KB, patch)
2006-09-10 22:40 UTC, Bob Johnson
Details | Diff
xfoil-6.96.ebuild (xfoil-6.96.ebuild,1.85 KB, text/plain)
2007-05-06 17:36 UTC, Sébastien Fabbro (RETIRED)
Details
xfoil-6.96-gfortran.patch (xfoil-6.96-gfortran.patch,993 bytes, patch)
2007-05-06 17:36 UTC, Sébastien Fabbro (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bob Johnson 2006-09-10 01:52:01 UTC
gfortran -o xfoil xfoil.o xpanel.o xoper.o xtcam.o xgdes.o xqdes.o xmdes.o xsolv
e.o xbl.o xblsys.o xpol.o xplots.o xgeom.o xutils.o modify.o polplt.o aread.o na
ca.o spline.o plutil.o iopol.o gui.o sort.o dplot.o profil.o userio.o ../plotlib
/libPlt.a  -L/usr/X11R6/lib -lX11 -lblas
../plotlib/libPlt.a(ps_subs.o): In function `bitpat_':
ps_subs.f:(.text+0x77): undefined reference to `rshift_'
ps_subs.f:(.text+0xee): undefined reference to `rshift_'
collect2: ld returned 1 exit status
make: *** [xfoil] Error 1

!!! ERROR: sci-physics/xfoil-6.94-r1 failed.
Call stack:
  ebuild.sh, line 1539:   Called dyn_compile
  ebuild.sh, line 939:   Called src_compile
  xfoil-6.94-r1.ebuild, line 56:   Called die

!!! failed to build xfoil
!!! If you need support, post the topmost build error, and the call stack if rel
evant.


This is apparently the result of this gcc issue:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19292

which is a meta-bug report that shows the fortran rshift intrinsic is not yet implemented in gfortran, the new GCC 4 fortran replacement for the older F77 compiler.

rshift is only being called twice, and it's only right-shifting by 1 each time. It shouldn't be too hard to fix the source code to avoid the use of the intrinsic for the time being until the gfortran compiler gets fixed. I'll have a look at it and see if I can come up with a patch.
Comment 1 Bob Johnson 2006-09-10 22:40:19 UTC
Created attachment 96662 [details, diff]
Patch to 6.94-r1 to fix missing rshift intrinsic

I'm no fortran expert, but I found this URL:

http://gcc.gnu.org/onlinedocs/gcc-3.4.1/g77/IShft-Intrinsic.html#IShft%20Intrinsic

which seems to exist in 4.1.1 even though it is not in the online docs yet. This patch replaces the rshift intrinsic with this ishft intrinsic. This code seems to compile and run OK. I tried some test cases with this new version versus the old code compiled with gcc 3.4.6 and everything appears to work. I'm no expert with this code though so I would hardly call it an exhaustive analysis. 

On a related note, I notice that xfoil is now at 6.96:

http://web.mit.edu/drela/Public/web/xfoil/

I downloaded this new code and see it has the same rshift issue. Making an ebuild for this new code will be tricky since it doesn't use autoconfig and requires Makefile modifications for paths to binaries, compiler, etc. etc.
I'm beginning to wonder if xfoil should even be in portage. It's so specialized
I suspect few Gentoo users even know what it's for. It's a pain to configure,
and if you *really* are going to use it you probably want to run a number of
test cases to verify that the compiler-du-jour on your Gentoo box is actually
producting correct output. If none of the developers have time to stay on top of it maybe it shouldn't even be in the portage tree.
Comment 2 Grégoire Favre 2006-09-17 07:48:27 UTC
Thank you very much for the patch :)
Comment 3 Sébastien Fabbro (RETIRED) gentoo-dev 2007-05-06 17:36:06 UTC
Created attachment 118365 [details]
xfoil-6.96.ebuild

Here is an ebuild for a newer version, with some changes and a patch for the gfortran bug. It compiles fine on my amd64, but I have no idea on how to test the package. Let me know if it works for you.
Comment 4 Sébastien Fabbro (RETIRED) gentoo-dev 2007-05-06 17:36:50 UTC
Created attachment 118366 [details, diff]
xfoil-6.96-gfortran.patch
Comment 5 Sébastien Fabbro (RETIRED) gentoo-dev 2007-05-23 20:18:09 UTC
fixed in cvs with a few changes from the proposed patch.