FS#16833 - [python-numpy] unbuildable with current makepkg.conf defaults

Attached to Project: Arch Linux
Opened by Adrian Benson (abenson) - Sunday, 25 October 2009, 06:34 GMT
Last edited by Eric Belanger (Snowman) - Saturday, 06 February 2010, 10:35 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Douglas Soares de Andrade (dsa)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

python-numpy 1.3.0-2 (x86_64) NB also affects python-scipy

Cannot build due to a linking error with gfortan libraries (see below).

When build instructions are entered into a shell, compilation completes withput error,
including when they are run as fakeroot.

The problem is LDFLAGS set in /etc/makepkg.conf.
Including 'unset LDFLAGS' in PKGBUILD fixed the error.

This is a known error when compiling numpy
http://projects.scipy.org/numpy/ticket/182
numpy-discussion@scipy.org/msg20848.html"> http://www.mail-archive.com/numpy-discussion@scipy.org/msg20848.html

Strangely I have rebuilt numpy (against ATLAS) numerous times and this has never been an issue before.


=================================
Compilation fails at this point:

creating build/temp.linux-x86_64-2.6/numpy/linalg
compile options: '-DNO_ATLAS_INFO=1 -Inumpy/core/include -Ibuild/src.linux-x86_64-2.6/numpy/core/include/numpy -Inumpy/core/src -Inumpy/core/include -I/usr/include/python2.6 -c'
gcc: numpy/linalg/python_xerbla.c
gcc: numpy/linalg/lapack_litemodule.c
/usr/bin/gfortran -Wall -Wl,--hash-style=gnu -Wl,--as-needed build/temp.linux-x86_64-2.6/numpy/linalg/lapack_litemodule.o build/temp.linux-x86_64-2.6/numpy/linalg/python_xerbla.o -L/usr/lib -L/usr/lib -Lbuild/temp.linux-x86_64-2.6 -llapack -lblas -lpython2.6 -lgfortran -o build/lib.linux-x86_64-2.6/numpy/linalg/lapack_lite.so
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.1/libgfortranbegin.a(fmain.o): In function `main':
(.text+0x26): undefined reference to `MAIN__'
collect2: ld returned 1 exit status
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.1/libgfortranbegin.a(fmain.o): In function `main':
(.text+0x26): undefined reference to `MAIN__'
collect2: ld returned 1 exit status
error: Command "/usr/bin/gfortran -Wall -Wl,--hash-style=gnu -Wl,--as-needed build/temp.linux-x86_64-2.6/numpy/linalg/lapack_litemodule.o build/temp.linux-x86_64-2.6/numpy/linalg/python_xerbla.o -L/usr/lib -L/usr/lib -Lbuild/temp.linux-x86_64-2.6 -llapack -lblas -lpython2.6 -lgfortran -o build/lib.linux-x86_64-2.6/numpy/linalg/lapack_lite.so" failed with exit status 1
This task depends upon

Closed by  Eric Belanger (Snowman)
Saturday, 06 February 2010, 10:35 GMT
Reason for closing:  Fixed
Additional comments about closing:  python-numpy 1.4.0-1 is in repo now
Comment by Adrian Benson (abenson) - Sunday, 25 October 2009, 12:03 GMT
see also  FS#16836 
Comment by Eric Belanger (Snowman) - Monday, 26 October 2009, 06:15 GMT
Douglas: looks like you forgot to adopt it when you added it to extra.
Comment by Jan de Groot (JGC) - Monday, 26 October 2009, 15:03 GMT
Looks like the -shared option isn't passed when building the library when you specify LDFLAGS. Without -shared, gfortran will try to compile it as a program instead of a library, which fails because there's no main function.
Comment by Adrian Benson (abenson) - Monday, 26 October 2009, 23:49 GMT
There is a similar bug in python-scipy ( FS#16836 ) where -fPIC was not set if FFLAGS is predefined.
Same thing occurs with LDFLAGS

It seems that the the numpy/scipy configure and build scripts have a problem with predefined variables such as LDFLAGS and FFLAGS.
Options that should be detected in the configure step are not appended and explicitly set options are ignored.
E.g. my scipy build failed even when I added '--with-pic'.

Loading...