Compile error during 32 bit compile on 64 bit machine
Greeting, I am trying to install numpy on the same system into to different prefixes, one dedicated to 32 bit stuff and the other to 64 bit. The machine is a dual CPU Core 2 Duo machine, that is a 64 bit native machine. Getting the 64 bit version to work is no problem. But cross compiling numpy for 32 bit binaries is very troublesome. I have compiled all the dependences using "-m32" including Python itself. All my other packages compile using the -m32 flag without problems. I have set CFLAGS, LDFLAGS, BASECFLAGS, CPPFLAGS, and CXXFLAGS all to reflect the change in bits to use. Please find below the error I receive when compiling with: python setup.py build --fcompiler=gnu95. The error appears to be because it is trying to link _configtest.o without the -m32 flag and thinks it is making a 64 bit binary. If I edit line 378 of ccompiler.py to add "-m32" to the link_opts by hand I can get past this error to a new one which indicates that main was never declared in the linalg package. If that is the more useful starting point I can post those errors as well. Any help would be greatly appreciated. Regards, Brian ############### ERROR BELOW ##################### C compiler: gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict- prototypes -m32 -m32 -fPIC compile options: '-I/rh5stuff/32bit/include/python2.6 -Inumpy/core/src -Inumpy/core/include -I/rh5stuff/32bit/include/python2.6 -c' gcc: _configtest.c gcc -pthread _configtest.o -L/rh5stuff/32bit/lib -L/usr/local/lib -L/ usr/lib -o _configtest /usr/bin/ld: skipping incompatible /usr/lib/libpthread.so when searching for -lpthread /usr/bin/ld: skipping incompatible /usr/lib/libpthread.a when searching for -lpthread /usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc /usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for - lc /usr/bin/ld: warning: i386 architecture of input file `_configtest.o' is incompatible with i386:x86-64 output _configtest failure. removing: _configtest.c _configtest.o _configtest
Brian wrote:
Greeting,
I am trying to install numpy on the same system into to different prefixes, one dedicated to 32 bit stuff and the other to 64 bit. The machine is a dual CPU Core 2 Duo machine, that is a 64 bit native machine. Getting the 64 bit version to work is no problem. But cross compiling numpy for 32 bit binaries is very troublesome.
I don't think it is possible to cross compile numpy (or any extension based on distutils for that matter) without bypassing the build system and building it by yourself. Distutils does not support cross compilation at all (except on windows for 32 vs 64 bits). How did you build your 32 bits python on the 64 bits OS ? cheers, David
participants (2)
-
Brian
-
David Cournapeau