[SciPy-dev] Text relocation errors when compiling Numeric for Solaris 8 x86

David M. Cooke cookedm at physics.mcmaster.ca
Thu Nov 4 17:59:18 CST 2004


Charles Fultz <fultz at cs.purdue.edu> writes:

> I've followed the instructions here:
> http://www.scipy.org/documentation/buildatlas4scipy.txt
> for building BLAS, LAPACK and ATLAS.  Everything
> seems to go as expected.  No problems or errors.
>
> However, when I go to build Numeric and link against
> the resultant libraries above, I get several 'Text relocation
> remains against symbol' errors.  Here is the top of the
> output from running 'python setup.py install':
> running install
> running build
> running build_py
> running build_ext
> building 'lapack_lite' extension
> /p/gcc3/bin/gcc -R/p/gcc3/lib -shared
> build/temp.solaris-2.8-i86pc-2.3/Src/lapac
> k_litemodule.o -L/scratch/fultz/ATLAS/lib/SunOS_X86 -llapack -lcblas
> -lf77blas -
> latlas -lg2c -o build/lib.solaris-2.8-i86pc-2.3/lapack_lite.so
> Text relocation remains                         referenced
>      against symbol                  offset      in file
> <unknown>                           0x38
> /scratch/fultz/ATLAS/lib/SunOS_X
> 86/liblapack.a(dgeev.o)
> <unknown>                           0x56
[snip]

This looks very much like some of the object files in the linked
libraries weren't compiled with the -fPIC option to generate
relocatable code. I've seen similiar problems on PowerPC and AMD64.
(It tends not to come up more than it should, as on i386 code compiled
without -fPIC is still relocatable.)

Basically, since you're making shared library (which is how Python
extensions work), *all* object files that get linked should have been
compiled for use in the extension need to be compiled with -fPIC.

I'd look at how ATLAS was built -- it probably wasn't compiled with -fPIC.

Also, that compile line above with gcc doesn't have -fPIC, so maybe
that's getting dropped somewhere in the distutils script. (-shared
isn't generally enough...)

-- 
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke                      http://arbutus.physics.mcmaster.ca/dmc/
|cookedm at physics.mcmaster.ca




More information about the Scipy-dev mailing list