[Numpy-discussion] ld.so.1 linker errors building numpy

David Cournapeau david@ar.media.kyoto-u.ac...
Thu Jul 19 00:44:53 CDT 2007


Park Hays wrote:
> I have been fighting for a couple weeks to get numpy installed, on the 
> way to a full scipy+matplotlib system.
I tried installing numpy on a solaris machine on SPARC too, with the 
added difficulty to have only a local account on the machine (without a 
compiler: had to build my own :) )...
> At this point, the transcript looks something like:
>
> > python
> Python 2.5 (r25:51908, Sep 20 2006, 06:18:53)
> [GCC 3.4.6] on sunos5
> >> from numpy import *
> -- stack trace, cut out except for last portion --
> File "[snip]/linalg.py", line 25, in <module>
>   from numpy.linalg import lapack_lite
> Import Error: ld.so.1: python: fatal: relocation error: file 
> [snip]/numpy/linalg/lapack_lite.so: symbol s_wsfe: referenced symbol 
> not found.
I would recommend to do it step by step:
    - first, do not compile any blas/lapack. They are difficult to build 
correctly because of various issues I won't go into now; ATLAS only 
makes the matter worse :)
    - once you succeed building numpy without any blas/lapack, you can 
build your own blas/lapack. To build correctly with LAPACK 3.1.1, you 
only need to add -fPIC to OPT and NOOPT in the make.inc. For previous 
versions of LAPACK, this does NOT work, and the BLAS is broken in 
previous versions (you have to build BLAS separately). You can use the 
static archives (.a), but they HAVE to be built using -fPIC. I would 
recomment against using .so at first, as it adds a level of complexity.
    - once the above works, you can try ATLAS. I strongly recommend 
using the dev version of ATLAS (3.7.34 as today) because its 
configuration is able to handle shared library building. To build ATLAS 
usable by numpy/scipy, you should use the following:

./configure --with-netlib-lapack=LAPACKPATH -Fa alg -fPIC

where LAPACKPATH is the full path of your static lapack library built 
before; you should also use the same compilers than everywhere else 
(this is not a must I guess, but less risk to avoid subtle issues when 
using different compilers).

If you are willing to follow the above steps, it will be easier to debug 
things one after the other, I think.

cheers,

David


More information about the Numpy-discussion mailing list