Building PyGLS with
$ python setup.py build
resulted in the following error
*** begin output ***
numpy
Building testing ufuncs!
running build
running build_py
running build_ext
building 'init' extension
C compiler: gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --\
param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fPIC
creating build/temp.linux-x86_64-2.4
creating build/temp.linux-x86_64-2.4/src
creating build/temp.linux-x86_64-2.4/src/init
compile options: '-DSWIG_COBJECT_TYPES=1 -DDEBUG=1 -DNUMERIC=1
-DPYGSL_GSL_MAJOR_VERSION=1 -DPYGSL_GSL_MINOR_VERSION=9 -UNDEBUG -I/\
usr/local/include -IInclude -I.
-I/usr/lib64/python2.4/site-packages/numpy/core/include
-I/usr/include/python2.4 -c'
gcc: src/init/initmodule.c
In file included from src/init/initmodule.c:51:
src/init/block_helpers.c: In function ‘PyGSL_copy_pyarray_to_gslvector’:
src/init/block_helpers.c:410: warning: format ‘%d’ expects type ‘int’, but
argument 4 has type ‘npy_intp’
src/init/block_helpers.c:411: warning: format ‘%d’ expects type ‘int’, but
argument 4 has type ‘npy_intp’
gcc -pthread -shared build/temp.linux-x86_64-2.4/src/init/initmodule.o
-L/usr/local/lib -lgsl -lgslcblas -lm -o build/lib.linux-x86\
_64-2.4/pygsl/init.so
/usr/bin/ld: /usr/local/lib/libgsl.a(error.o): relocation R_X86_64_32S against
`a local symbol' can not be used when making a share\
d object; recompile with -fPIC
/usr/local/lib/libgsl.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
/usr/bin/ld: /usr/local/lib/libgsl.a(error.o): relocation R_X86_64_32S against
`a local symbol' can not be used when making a share\
d object; recompile with -fPIC
/usr/local/lib/libgsl.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
error: Command "gcc -pthread -shared
build/temp.linux-x86_64-2.4/src/init/initmodule.o -L/usr/local/lib -lgsl
-lgslcblas -lm -o bui\
ld/lib.linux-x86_64-2.4/pygsl/init.so" failed with exit status 1
*** end output ***
So I set CFLAGS to -fPIC and tried again
$ export CFLAGS='-fPIC'numpy
$ python setup.py build
*** begin output ***
numpy
Building testing ufuncs!
running build
running build_py
running build_ext
building 'init' extension
C compiler: gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --\
param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fPIC -fPIC
creating build/temp.linux-x86_64-2.4
creating build/temp.linux-x86_64-2.4/src
creating build/temp.linux-x86_64-2.4/src/init
compile options: '-DSWIG_COBJECT_TYPES=1 -DDEBUG=1 -DNUMERIC=1
-DPYGSL_GSL_MAJOR_VERSION=1 -DPYGSL_GSL_MINOR_VERSION=9 -UNDEBUG -I/\
usr/local/include -IInclude -I.
-I/usr/lib64/python2.4/site-packages/numpy/core/include
-I/usr/include/python2.4 -c'
gcc: src/init/initmodule.c
In file included from src/init/initmodule.c:51:
src/init/block_helpers.c: In function ‘PyGSL_copy_pyarray_to_gslvector’:
src/init/block_helpers.c:410: warning: format ‘%d’ expects type ‘int’, but
argument 4 has type ‘npy_intp’
src/init/block_helpers.c:411: warning: format ‘%d’ expects type ‘int’, but
argument 4 has type ‘npy_intp’
gcc -pthread -shared -fPIC build/temp.linux-x86_64-2.4/src/init/initmodule.o
-L/usr/local/lib -lgsl -lgslcblas -lm -o build/lib.lin\
ux-x86_64-2.4/pygsl/init.so
/usr/bin/ld: /usr/local/lib/libgsl.a(error.o): relocation R_X86_64_32S against
`a local symbol' can not be used when making a share\
d object; recompile with -fPIC
/usr/local/lib/libgsl.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
/usr/bin/ld: /usr/local/lib/libgsl.a(error.o): relocation R_X86_64_32S against
`a local symbol' can not be used when making a share\
d object; recompile with -fPIC
/usr/local/lib/libgsl.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
error: Command "gcc -pthread -shared -fPIC
build/temp.linux-x86_64-2.4/src/init/initmodule.o -L/usr/local/lib -lgsl
-lgslcblas -lm \
-o build/lib.linux-x86_64-2.4/pygsl/init.so" failed with exit status 1
*** end output ***
Since it seemed like a symbol issue, I looked at libgsl
$ nm /urs/local/lib/libgsl.a | head
version.o:
0000000000000000 D gsl_version
init.o:
U free
0000000000000a60 T gsl_block_alloc
0000000000000b20 T gsl_block_calloc
00000000000001c0 T gsl_block_char_alloc
0000000000000270 T gsl_block_char_calloc
Which looks reasonable.
I also compiled a C program linking against gsl's cubic spline functions, which
worked as expected with no compiler flags (just lin\
ker '-lgsl -lgslcblas -lm').
My system is:
Scientific Linux SL release 5.0 (Boron)
gcc (GCC) 4.1.1 20070105 (Red Hat 4.1.1-52)
gsl 1.9
Python 2.4.3
numpy 1.0.3.1
Searching '-fPIC' on the lists
Let me know if more information would help...
Thanks,
Trevor King
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
pygsl-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pygsl-discuss