我需要编译一个 32 位发行版PyEphem http://rhodesmill.org/pyephem/。这似乎并不困难,但是,我遇到了一些编译器问题。
$ 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 头文件是否与本地主机的体系结构相关?
Update:我发现了一些有趣的信息Python交叉编译 http://whatschrisdoing.com/blog/2009/10/16/cross-compiling-python-extensions/.
你的机器上安装了32位python吗?我认为如果从 32 位 python 运行它应该没问题,并确保链接到正确的 python.h。
我从未尝试过在 Linux 上进行交叉编译,但我已经针对 64 位 Windows 上并排安装的不同 python 进行了编译。
当然,还有安装 32 位 VM 并从那里进行编译的核心选项。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)