摘要:使用--enable shared在RHEL 5.3 64位上构建Python3.1无法编译所有扩展。建筑“正常”工作良好,没有任何问题。
请注意
这个问题似乎模糊了编程和系统管理之间的界限。但是,我相信因为它必须直接处理操作系统问题和编程问题,所以我会在stackoverflow和serverfault上交叉发布它。也在
Python 3.1.1 with --enable-shared : will not build any extensions
. 谢谢!
问题:
在RHEL 5.3 64位上构建Python3.1
--enable-shared
无法编译所有扩展。建筑“正常”工作良好,没有任何问题。
我可以很好地构建Python3.1,但是当构建为共享库时,它会发出许多警告(见下文),并且拒绝构建
c
基于模块。尽管失败了,我仍然可以针对它构建mod_wsgi 3.0c5,并在apache下运行它。不用说,python的功能已经大大减少了……
有趣的是,Python3.2a0(来自SVN)可以使用--enable shared进行良好的编译,而mod_wsgi可以针对它进行良好的编译。但是当启动apache时,我得到:
Cannot load /etc/httpd/modules/mod_wsgi.so into server: /etc/httpd/modules/mod_wsgi.so: undefined symbol: PyCObject_FromVoidPtr
这个项目是一个长期的项目,所以如果需要的话,我可以使用alpha质量软件。下面是关于这个问题的更多细节。
主持人:
戴尔PowerEdge
英特尔氙气
RHEL 5.3 64位
没什么特别的
建造:
Python3.1.1源代码分发
很好地配合
./configure
不适合
./configure --enable-shared
(
export CFLAGS="-fPIC"
已经完成)
制作输出
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -fPIC -DPy_BUILD_CORE -c ./Modules/_weakref.c -o Modules/_weakref.o
building 'bz2' extension
gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -I./Include -I/usr/local/include -IInclude -I/home/build/RPMBUILD/BUILD/Python-3.1.1 -c /home/build/RPMBUILD/BUILD/Python-3.1.1/Modules/bz2module.c -o build/temp.linux-x86_64-3.1/home/build/RPMBUILD/BUILD/Python-3.1.1/Modules/bz2module.o
gcc -pthread -shared -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes build/temp.linux-x86_64-3.1/home/build/RPMBUILD/BUILD/Python-3.1.1/Modules/bz2module.o -L/usr/local/lib -L. -lbz2 -lpython3.1 -o build/lib.linux-x86_64-3.1/bz2.so
/usr/bin/ld: /usr/local/lib/libpython3.1.a(abstract.o): relocation R_X86_64_32 against 'a local symbol' can not be used when making a shared object; recompile with -fPIC
Failed to build these modules:
_bisect _codecs_cn _codecs_hk
_codecs_iso2022 _codecs_jp _codecs_kr
_codecs_tw _collections _csv
_ctypes _ctypes_test _curses
_curses_panel _dbm _elementtree
_gdbm _hashlib _heapq
_json _lsprof _multibytecodec
_multiprocessing _pickle _random
_socket _sqlite3 _ssl
_struct _testcapi array
atexit audioop binascii
bz2 cmath crypt
datetime fcntl grp
itertools math mmap
nis operator ossaudiodev
parser pyexpat readline
resource select spwd
syslog termios time
unicodedata zlib