[Numpy-discussion] building 32 bit numpy on 64 bit linux

Julian Taylor jtaylor.debian at googlemail.com
Thu Dec 12 16:35:10 EST 2013


On 12.12.2013 20:40, David Jones wrote:
> On 12/12/13 15:54, Julian Taylor wrote:
>> On 12.12.2013 19:58, David Jones wrote:
>>> I'm trying to compile 32-bit numpy on a 64 bit Centos 6 system, but fails with the message:
>>>
>>> "Broken toolchain: cannot link a simple C program"
>>>
...
>>>
>> this might work:
>>
>> CC="gcc -m32" LDSHARED="gcc -m32" FF="gfortran -m32" linux32 python
>> setup.py build
>>

> 
> That didn't work. It says it can't find executable "gcc -m32". I tried 
> changing ccompiler.py, per the stackoverflow post. I got further that 
> time, but it fails with the message:
> 


weird it works for me with libpython2.7-dev:i386 installed on amd64
Ubuntu 13.10 (multiarch is friggin great :D)
But I had to add an additional LDFLAGS="-m32 -shared"

CC="gcc -m32" LDSHARED="gcc -m32 -shared" LDFLAGS="-m32 -shared" linux32
python setup.py build

you should be able to work around this error message by writing small
wrapper scripts for the compiler:

cat << EOF > gcc-32
#!/bin/sh
gcc -m32 "$@"
EOF
...
CC=gcc-32 ....




More information about the NumPy-Discussion mailing list