Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在x86_64主机上构建32位Python模块发行版w/Setup.py_Python_Gcc_Cross Compiling_Setup.py - Fatal编程技术网

如何在x86_64主机上构建32位Python模块发行版w/Setup.py

如何在x86_64主机上构建32位Python模块发行版w/Setup.py,python,gcc,cross-compiling,setup.py,Python,Gcc,Cross Compiling,Setup.py,我需要编译一个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 -fwr

我需要编译一个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头文件是否与本地主机的体系结构相关联


更新:我发现了一些关于的有趣信息。

您的机器上安装了32位python吗?我认为,如果您从32位python运行它,并确保链接到正确的python.h,应该可以

我从未尝试过在Linux上进行交叉编译,但我已经针对64位Windows上并排安装的不同Python进行了编译

当然,还有安装32位虚拟机并从中编译的核心选项