Discussion:
Compiling Python bindings
Niklas Saers
2006-09-07 12:58:16 UTC
Permalink
Hi,
I'm compiling the Python bindings on a FreeBSD 6.1 server running an
Athlon64x2 processor. First I dl'ed 2.0 but got an error, then I got the CVS
but it still fails. Can anyone help me with what's going on and how I can
deal with it? I get:

$ make
Running SWIG before: swig -c++ -python pyfann/pyfann.i
running build
running build_py
creating build
creating build/lib.freebsd-6.1-STABLE-amd64-2.4
creating build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
copying pyfann/__init__.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
copying pyfann/libfann.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
running build_ext
building 'pyfann._libfann' extension
creating build/temp.freebsd-6.1-STABLE-amd64-2.4
creating build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann
cc -fno-strict-aliasing -DNDEBUG -O -pipe -march=athlon64
-D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x100000 -fPIC -DSWIG_COMPILE
-I../src/include -I/usr/local/include/python2.4 -c pyfann/pyfann_wrap.cxx -o
build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
c++ -shared -pthread
build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
../src/doublefann.o -o build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann/_libfann.so
/usr/bin/ld: ../src/doublefann.o: relocation R_X86_64_32S can not be used
when making a shared object; recompile with -fPIC
../src/doublefann.o: could not read symbols: Bad value
error: command 'c++' failed with exit status 1
*** Error code 1

Stop in /tmp/fann-2.0.0/cvs/fann/python.

Cheers

Nik
Vincenzo Di Massa
2006-09-08 20:40:17 UTC
Permalink
Seems like a linking error caused by python using wrong size for its data
types or fann data types.

I'd suggest that you try modifying the .i file changing doublefann to
floatfann.

Anyway I compiled py/fann on my 64bit machine on linux... :-P

Regards
Vincenzo
Post by Niklas Saers
Hi,
I'm compiling the Python bindings on a FreeBSD 6.1 server running an
Athlon64x2 processor. First I dl'ed 2.0 but got an error, then I got the
CVS but it still fails. Can anyone help me with what's going on and how I
$ make
Running SWIG before: swig -c++ -python pyfann/pyfann.i
running build
running build_py
creating build
creating build/lib.freebsd-6.1-STABLE-amd64-2.4
creating build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
copying pyfann/__init__.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
copying pyfann/libfann.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
running build_ext
building 'pyfann._libfann' extension
creating build/temp.freebsd-6.1-STABLE-amd64-2.4
creating build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann
cc -fno-strict-aliasing -DNDEBUG -O -pipe -march=athlon64
-D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x100000 -fPIC -DSWIG_COMPILE
-I../src/include -I/usr/local/include/python2.4 -c pyfann/pyfann_wrap.cxx
-o build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
c++ -shared -pthread
build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
../src/doublefann.o -o build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann/_libfann.so
/usr/bin/ld: ../src/doublefann.o: relocation R_X86_64_32S can not be used
when making a shared object; recompile with -fPIC
../src/doublefann.o: could not read symbols: Bad value
error: command 'c++' failed with exit status 1
*** Error code 1
Stop in /tmp/fann-2.0.0/cvs/fann/python.
Cheers
Nik
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Niklas Saers
2006-09-08 20:46:53 UTC
Permalink
Hi Vincenzo,
changing doublefann to floatfann in fann/python/pyfann/pyfann.i gives still
the error message of doublefann:

Running SWIG before: swig -c++ -python pyfann/pyfann.i
running build
running build_py
creating build
creating build/lib.freebsd-6.1-STABLE-amd64-2.4
creating build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
copying pyfann/__init__.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
copying pyfann/libfann.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
running build_ext
building 'pyfann._libfann' extension
creating build/temp.freebsd-6.1-STABLE-amd64-2.4
creating build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann
cc -fno-strict-aliasing -DNDEBUG -O -pipe -march=athlon64
-D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x100000 -fPIC -DSWIG_COMPILE
-I../src/include -I/usr/local/include/python2.4 -c pyfann/pyfann_wrap.cxx -o
build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
c++ -shared -pthread
build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
../src/doublefann.o -o build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann/_libfann.so
/usr/bin/ld: ../src/doublefann.o: relocation R_X86_64_32S can not be used
when making a shared object; recompile with -fPIC
../src/doublefann.o: could not read symbols: Bad value
error: command 'c++' failed with exit status 1
*** Error code 1

I tried changing setup.py as well, but that just gave me:

Running SWIG before: swig -c++ -python pyfann/pyfann.i
running build
running build_py
creating build
creating build/lib.freebsd-6.1-STABLE-amd64-2.4
creating build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
copying pyfann/__init__.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
copying pyfann/libfann.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
running build_ext
building 'pyfann._libfann' extension
creating build/temp.freebsd-6.1-STABLE-amd64-2.4
creating build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann
cc -fno-strict-aliasing -DNDEBUG -O -pipe -march=athlon64
-D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x100000 -fPIC -DSWIG_COMPILE
-I../src/include -I/usr/local/include/python2.4 -c pyfann/pyfann_wrap.cxx -o
build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
c++ -shared -pthread
build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
../src/floatfann.o -o build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann/_libfann.so
/usr/bin/ld: ../src/floatfann.o: relocation R_X86_64_32S can not be used
when making a shared object; recompile with -fPIC
../src/floatfann.o: could not read symbols: Bad value
error: command 'c++' failed with exit status 1
*** Error code 1

Cheers

Nik
Post by Vincenzo Di Massa
Seems like a linking error caused by python using wrong size for its data
types or fann data types.
I'd suggest that you try modifying the .i file changing doublefann to
floatfann.
Anyway I compiled py/fann on my 64bit machine on linux... :-P
Regards
Vincenzo
Post by Niklas Saers
Hi,
I'm compiling the Python bindings on a FreeBSD 6.1 server running an
Athlon64x2 processor. First I dl'ed 2.0 but got an error, then I got the
CVS but it still fails. Can anyone help me with what's going on and how
I
Post by Niklas Saers
$ make
Running SWIG before: swig -c++ -python pyfann/pyfann.i
running build
running build_py
creating build
creating build/lib.freebsd-6.1-STABLE-amd64-2.4
creating build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
copying pyfann/__init__.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann
Post by Niklas Saers
copying pyfann/libfann.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann
Post by Niklas Saers
running build_ext
building 'pyfann._libfann' extension
creating build/temp.freebsd-6.1-STABLE-amd64-2.4
creating build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann
cc -fno-strict-aliasing -DNDEBUG -O -pipe -march=athlon64
-D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x100000 -fPIC -DSWIG_COMPILE
-I../src/include -I/usr/local/include/python2.4 -c
pyfann/pyfann_wrap.cxx
Post by Niklas Saers
-o build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
c++ -shared -pthread
build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
../src/doublefann.o -o build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann/_libfann.so
/usr/bin/ld: ../src/doublefann.o: relocation R_X86_64_32S can not be
used
Post by Niklas Saers
when making a shared object; recompile with -fPIC
../src/doublefann.o: could not read symbols: Bad value
error: command 'c++' failed with exit status 1
*** Error code 1
Stop in /tmp/fann-2.0.0/cvs/fann/python.
Cheers
Nik
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Fann-general mailing list
https://lists.sourceforge.net/lists/listinfo/fann-general
Vincenzo Di Massa
2007-03-30 16:01:29 UTC
Permalink
I just found the solution to this problem :-)
On the X86_64 family libraries should always have the -fPIC flag when
compiling object files. Read
http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=3
Add -fPIC in src/Makefile.am to the CFLAGS variable and recompile.

Steffen, can we add a check to detect CPU type and add -fPIC on amd64?
not having -fPIC can lead to very nasty bugs, as the mentioned page suggests.
Regards
Vincenzo

P.S. I don't know how I previously made it to build without that flag...
Post by Niklas Saers
Hi Vincenzo,
changing doublefann to floatfann in fann/python/pyfann/pyfann.i gives still
Running SWIG before: swig -c++ -python pyfann/pyfann.i
running build
running build_py
creating build
creating build/lib.freebsd-6.1-STABLE-amd64-2.4
creating build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
copying pyfann/__init__.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
copying pyfann/libfann.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
running build_ext
building 'pyfann._libfann' extension
creating build/temp.freebsd-6.1-STABLE-amd64-2.4
creating build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann
cc -fno-strict-aliasing -DNDEBUG -O -pipe -march=athlon64
-D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x100000 -fPIC -DSWIG_COMPILE
-I../src/include -I/usr/local/include/python2.4 -c pyfann/pyfann_wrap.cxx
-o build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
c++ -shared -pthread
build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
../src/doublefann.o -o build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann/_libfann.so
/usr/bin/ld: ../src/doublefann.o: relocation R_X86_64_32S can not be used
when making a shared object; recompile with -fPIC
../src/doublefann.o: could not read symbols: Bad value
error: command 'c++' failed with exit status 1
*** Error code 1
Running SWIG before: swig -c++ -python pyfann/pyfann.i
running build
running build_py
creating build
creating build/lib.freebsd-6.1-STABLE-amd64-2.4
creating build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
copying pyfann/__init__.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
copying pyfann/libfann.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
running build_ext
building 'pyfann._libfann' extension
creating build/temp.freebsd-6.1-STABLE-amd64-2.4
creating build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann
cc -fno-strict-aliasing -DNDEBUG -O -pipe -march=athlon64
-D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x100000 -fPIC -DSWIG_COMPILE
-I../src/include -I/usr/local/include/python2.4 -c pyfann/pyfann_wrap.cxx
-o build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
c++ -shared -pthread
build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
../src/floatfann.o -o build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann/_libfann.so
/usr/bin/ld: ../src/floatfann.o: relocation R_X86_64_32S can not be used
when making a shared object; recompile with -fPIC
../src/floatfann.o: could not read symbols: Bad value
error: command 'c++' failed with exit status 1
*** Error code 1
Cheers
Nik
Post by Vincenzo Di Massa
Seems like a linking error caused by python using wrong size for its data
types or fann data types.
I'd suggest that you try modifying the .i file changing doublefann to
floatfann.
Anyway I compiled py/fann on my 64bit machine on linux... :-P
Regards
Vincenzo
Post by Niklas Saers
Hi,
I'm compiling the Python bindings on a FreeBSD 6.1 server running an
Athlon64x2 processor. First I dl'ed 2.0 but got an error, then I got
the CVS but it still fails. Can anyone help me with what's going on and
how
I
Post by Niklas Saers
$ make
Running SWIG before: swig -c++ -python pyfann/pyfann.i
running build
running build_py
creating build
creating build/lib.freebsd-6.1-STABLE-amd64-2.4
creating build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
copying pyfann/__init__.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann
Post by Niklas Saers
copying pyfann/libfann.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann
Post by Niklas Saers
running build_ext
building 'pyfann._libfann' extension
creating build/temp.freebsd-6.1-STABLE-amd64-2.4
creating build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann
cc -fno-strict-aliasing -DNDEBUG -O -pipe -march=athlon64
-D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x100000 -fPIC -DSWIG_COMPILE
-I../src/include -I/usr/local/include/python2.4 -c
pyfann/pyfann_wrap.cxx
Post by Niklas Saers
-o build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
c++ -shared -pthread
build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
../src/doublefann.o -o build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann/_libfann.so
/usr/bin/ld: ../src/doublefann.o: relocation R_X86_64_32S can not be
used
Post by Niklas Saers
when making a shared object; recompile with -fPIC
../src/doublefann.o: could not read symbols: Bad value
error: command 'c++' failed with exit status 1
*** Error code 1
Stop in /tmp/fann-2.0.0/cvs/fann/python.
Cheers
Nik
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Fann-general mailing list
https://lists.sourceforge.net/lists/listinfo/fann-general
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Steffen Nissen
2007-03-31 18:53:59 UTC
Permalink
That should be possible, will you look into it, or should I?
Post by Vincenzo Di Massa
I just found the solution to this problem :-)
On the X86_64 family libraries should always have the -fPIC flag when
compiling object files. Read
http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=3
Add -fPIC in src/Makefile.am to the CFLAGS variable and recompile.
Steffen, can we add a check to detect CPU type and add -fPIC on amd64?
not having -fPIC can lead to very nasty bugs, as the mentioned page suggests.
Regards
Vincenzo
P.S. I don't know how I previously made it to build without that flag...
Post by Niklas Saers
Hi Vincenzo,
changing doublefann to floatfann in fann/python/pyfann/pyfann.i gives
still
Post by Niklas Saers
Running SWIG before: swig -c++ -python pyfann/pyfann.i
running build
running build_py
creating build
creating build/lib.freebsd-6.1-STABLE-amd64-2.4
creating build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
copying pyfann/__init__.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann
Post by Niklas Saers
copying pyfann/libfann.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann
Post by Niklas Saers
running build_ext
building 'pyfann._libfann' extension
creating build/temp.freebsd-6.1-STABLE-amd64-2.4
creating build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann
cc -fno-strict-aliasing -DNDEBUG -O -pipe -march=athlon64
-D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x100000 -fPIC -DSWIG_COMPILE
-I../src/include -I/usr/local/include/python2.4 -c
pyfann/pyfann_wrap.cxx
Post by Niklas Saers
-o build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
c++ -shared -pthread
build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
../src/doublefann.o -o build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann/_libfann.so
/usr/bin/ld: ../src/doublefann.o: relocation R_X86_64_32S can not be
used
Post by Niklas Saers
when making a shared object; recompile with -fPIC
../src/doublefann.o: could not read symbols: Bad value
error: command 'c++' failed with exit status 1
*** Error code 1
Running SWIG before: swig -c++ -python pyfann/pyfann.i
running build
running build_py
creating build
creating build/lib.freebsd-6.1-STABLE-amd64-2.4
creating build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
copying pyfann/__init__.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann
Post by Niklas Saers
copying pyfann/libfann.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann
Post by Niklas Saers
running build_ext
building 'pyfann._libfann' extension
creating build/temp.freebsd-6.1-STABLE-amd64-2.4
creating build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann
cc -fno-strict-aliasing -DNDEBUG -O -pipe -march=athlon64
-D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x100000 -fPIC -DSWIG_COMPILE
-I../src/include -I/usr/local/include/python2.4 -c
pyfann/pyfann_wrap.cxx
Post by Niklas Saers
-o build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
c++ -shared -pthread
build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
../src/floatfann.o -o build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann/_libfann.so
/usr/bin/ld: ../src/floatfann.o: relocation R_X86_64_32S can not be used
when making a shared object; recompile with -fPIC
../src/floatfann.o: could not read symbols: Bad value
error: command 'c++' failed with exit status 1
*** Error code 1
Cheers
Nik
Post by Vincenzo Di Massa
Seems like a linking error caused by python using wrong size for its
data
Post by Niklas Saers
Post by Vincenzo Di Massa
types or fann data types.
I'd suggest that you try modifying the .i file changing doublefann to
floatfann.
Anyway I compiled py/fann on my 64bit machine on linux... :-P
Regards
Vincenzo
Post by Niklas Saers
Hi,
I'm compiling the Python bindings on a FreeBSD 6.1 server running an
Athlon64x2 processor. First I dl'ed 2.0 but got an error, then I got
the CVS but it still fails. Can anyone help me with what's going on
and
Post by Niklas Saers
Post by Vincenzo Di Massa
Post by Niklas Saers
how
I
Post by Niklas Saers
$ make
Running SWIG before: swig -c++ -python pyfann/pyfann.i
running build
running build_py
creating build
creating build/lib.freebsd-6.1-STABLE-amd64-2.4
creating build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
copying pyfann/__init__.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann
Post by Niklas Saers
copying pyfann/libfann.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann
Post by Niklas Saers
running build_ext
building 'pyfann._libfann' extension
creating build/temp.freebsd-6.1-STABLE-amd64-2.4
creating build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann
cc -fno-strict-aliasing -DNDEBUG -O -pipe -march=athlon64
-D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x100000 -fPIC
-DSWIG_COMPILE
Post by Niklas Saers
Post by Vincenzo Di Massa
Post by Niklas Saers
-I../src/include -I/usr/local/include/python2.4 -c
pyfann/pyfann_wrap.cxx
Post by Niklas Saers
-o build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
c++ -shared -pthread
build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
../src/doublefann.o -o build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann/_libfann.so
/usr/bin/ld: ../src/doublefann.o: relocation R_X86_64_32S can not be
used
Post by Niklas Saers
when making a shared object; recompile with -fPIC
../src/doublefann.o: could not read symbols: Bad value
error: command 'c++' failed with exit status 1
*** Error code 1
Stop in /tmp/fann-2.0.0/cvs/fann/python.
Cheers
Nik
-------------------------------------------------------------------------
Post by Niklas Saers
Post by Vincenzo Di Massa
Using Tomcat but need to do more? Need to support web services,
security?
Post by Niklas Saers
Post by Vincenzo Di Massa
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Post by Niklas Saers
Post by Vincenzo Di Massa
_______________________________________________
Fann-general mailing list
https://lists.sourceforge.net/lists/listinfo/fann-general
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Fann-general mailing list
https://lists.sourceforge.net/lists/listinfo/fann-general
--
Steffen Nissen - http://MySpace.com/SteffenNissen
Project Administrator - Fast Artificial Neural Network Library (fann)
http://fann.sf.net
Vincenzo Di Massa
2007-03-31 23:02:04 UTC
Permalink
Post by Steffen Nissen
That should be possible, will you look into it, or should I?
I already did :-) It's in CVS.
Vincenzo
Post by Steffen Nissen
Post by Vincenzo Di Massa
I just found the solution to this problem :-)
On the X86_64 family libraries should always have the -fPIC flag when
compiling object files. Read
http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=3
Add -fPIC in src/Makefile.am to the CFLAGS variable and recompile.
Steffen, can we add a check to detect CPU type and add -fPIC on amd64?
not having -fPIC can lead to very nasty bugs, as the mentioned page suggests.
Regards
Vincenzo
P.S. I don't know how I previously made it to build without that flag...
Post by Niklas Saers
Hi Vincenzo,
changing doublefann to floatfann in fann/python/pyfann/pyfann.i gives
still
Post by Niklas Saers
Running SWIG before: swig -c++ -python pyfann/pyfann.i
running build
running build_py
creating build
creating build/lib.freebsd-6.1-STABLE-amd64-2.4
creating build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
copying pyfann/__init__.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann
Post by Niklas Saers
copying pyfann/libfann.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann
Post by Niklas Saers
running build_ext
building 'pyfann._libfann' extension
creating build/temp.freebsd-6.1-STABLE-amd64-2.4
creating build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann
cc -fno-strict-aliasing -DNDEBUG -O -pipe -march=athlon64
-D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x100000 -fPIC -DSWIG_COMPILE
-I../src/include -I/usr/local/include/python2.4 -c
pyfann/pyfann_wrap.cxx
Post by Niklas Saers
-o build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
c++ -shared -pthread
build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
../src/doublefann.o -o build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann/_libfann.so
/usr/bin/ld: ../src/doublefann.o: relocation R_X86_64_32S can not be
used
Post by Niklas Saers
when making a shared object; recompile with -fPIC
../src/doublefann.o: could not read symbols: Bad value
error: command 'c++' failed with exit status 1
*** Error code 1
Running SWIG before: swig -c++ -python pyfann/pyfann.i
running build
running build_py
creating build
creating build/lib.freebsd-6.1-STABLE-amd64-2.4
creating build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
copying pyfann/__init__.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann
Post by Niklas Saers
copying pyfann/libfann.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann
Post by Niklas Saers
running build_ext
building 'pyfann._libfann' extension
creating build/temp.freebsd-6.1-STABLE-amd64-2.4
creating build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann
cc -fno-strict-aliasing -DNDEBUG -O -pipe -march=athlon64
-D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x100000 -fPIC -DSWIG_COMPILE
-I../src/include -I/usr/local/include/python2.4 -c
pyfann/pyfann_wrap.cxx
Post by Niklas Saers
-o build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
c++ -shared -pthread
build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
../src/floatfann.o -o build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann/_libfann.so
/usr/bin/ld: ../src/floatfann.o: relocation R_X86_64_32S can not be
used when making a shared object; recompile with -fPIC
../src/floatfann.o: could not read symbols: Bad value
error: command 'c++' failed with exit status 1
*** Error code 1
Cheers
Nik
Post by Vincenzo Di Massa
Seems like a linking error caused by python using wrong size for its
data
Post by Niklas Saers
Post by Vincenzo Di Massa
types or fann data types.
I'd suggest that you try modifying the .i file changing doublefann to
floatfann.
Anyway I compiled py/fann on my 64bit machine on linux... :-P
Regards
Vincenzo
Post by Niklas Saers
Hi,
I'm compiling the Python bindings on a FreeBSD 6.1 server running
an Athlon64x2 processor. First I dl'ed 2.0 but got an error, then I
got the CVS but it still fails. Can anyone help me with what's
going on
and
Post by Niklas Saers
Post by Vincenzo Di Massa
Post by Niklas Saers
how
I
Post by Niklas Saers
$ make
Running SWIG before: swig -c++ -python pyfann/pyfann.i
running build
running build_py
creating build
creating build/lib.freebsd-6.1-STABLE-amd64-2.4
creating build/lib.freebsd-6.1-STABLE-amd64-2.4/pyfann
copying pyfann/__init__.py ->
build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann
Post by Niklas Saers
copying pyfann/libfann.py -> build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann
Post by Niklas Saers
running build_ext
building 'pyfann._libfann' extension
creating build/temp.freebsd-6.1-STABLE-amd64-2.4
creating build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann
cc -fno-strict-aliasing -DNDEBUG -O -pipe -march=athlon64
-D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x100000 -fPIC
-DSWIG_COMPILE
Post by Niklas Saers
Post by Vincenzo Di Massa
Post by Niklas Saers
-I../src/include -I/usr/local/include/python2.4 -c
pyfann/pyfann_wrap.cxx
Post by Niklas Saers
-o build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
c++ -shared -pthread
build/temp.freebsd-6.1-STABLE-amd64-2.4/pyfann/pyfann_wrap.o
../src/doublefann.o -o build/lib.freebsd-6.1-STABLE-amd64-2.4
/pyfann/_libfann.so
/usr/bin/ld: ../src/doublefann.o: relocation R_X86_64_32S can not be
used
Post by Niklas Saers
when making a shared object; recompile with -fPIC
../src/doublefann.o: could not read symbols: Bad value
error: command 'c++' failed with exit status 1
*** Error code 1
Stop in /tmp/fann-2.0.0/cvs/fann/python.
Cheers
Nik
-------------------------------------------------------------------------
Post by Niklas Saers
Post by Vincenzo Di Massa
Using Tomcat but need to do more? Need to support web services,
security?
Post by Niklas Saers
Post by Vincenzo Di Massa
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Post by Niklas Saers
Post by Vincenzo Di Massa
_______________________________________________
Fann-general mailing list
https://lists.sourceforge.net/lists/listinfo/fann-general
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Fann-general mailing list
https://lists.sourceforge.net/lists/listinfo/fann-general
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Continue reading on narkive:
Loading...