我需要编译PyEphem的 32 位发行版。看起来这应该不难,但是,我遇到了一些编译器问题。
$ CFLAGS=-m32 python setup.py bdist -p i386
running bdist
running bdist_dumb
running build
running build_py
running build_ext
building 'ephem._libastro' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -m32 -fPIC -Ilibastro-3.7.3 -I/usr/include/python2.6 -c extensions/_libastro.c -o build/temp.linux-x86_64-2.6/extensions/_libastro.o
In file included from /usr/include/python2.6/Python.h:58,
from extensions/_libastro.c:3:
/usr/include/python2.6/pyport.h:685:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
error: command 'gcc' failed with exit status 1
构建系统正在运行 Ubuntu 10.04。python 头文件是否与本地主机的体系结构相关联?
更新:我发现了一些关于Python 交叉编译的有趣信息。