摘要:在 RHEL 5.3 64 位上构建 Python 3.1--enable-shared
无法编译所有扩展。建立“正常”工作正常,没有任何问题。
请注意,这个问题似乎模糊了编程和系统管理之间的界限。但是,我相信因为它必须直接处理获得语言支持,并且与支持编程过程有很大关系,所以我会在这里交叉发布。也在:https ://serverfault.com/questions/73196/python-3-1-1-with-enable-shared-will-not-build-any-extensions 。谢谢!
问题:
在 RHEL 5.3 64 位上构建 Python 3.1--enable-shared
无法编译所有扩展。建立“正常”工作正常,没有任何问题。
我可以很好地构建 python 3.1,但是当构建为共享库时,它会发出许多警告(见下文),并拒绝构建任何c
基于模块的模块。尽管失败了,我仍然可以针对它构建 mod_wsgi 3.0c5,并在 apache 下运行它。不用说,Python的功能大大减少了……
有趣的是,Python 3.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 位
- 没什么特别的”
建造:
- Python 3.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