要約:--enable-shared
でRHEL 5.3の64ビットでPython 3.1をビルドすると、すべての拡張機能をコンパイルできません。正常なビルドは問題なく正常に動作します。Python 3.1.1 with --enable-shared:拡張子を構築しません
この質問は、プログラミングとシステム管理の間の線がぼやけているように見えることがあります。しかし、私はそれが直接言語サポートを受け入れることに直接対処しなければならないので、プログラミングのプロセスをサポートすることと非常に関係があり、私はここでそれをクロスポストすると信じています。また:https://serverfault.com/questions/73196/python-3-1-1-with-enable-shared-will-not-build-any-extensions。ありがとうございました!
問題:--enable-shared
とRHEL 5.3 64ビットの
ビルのPython 3.1は、すべての拡張機能をコンパイルに失敗します。正常なビルドは問題なく正常に動作します。
私は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
これがためであるプロジェクトは、長期的なプロジェクトですので、必要であれば、私はアルファ品質のソフトウェアで大丈夫。この問題の詳細は次のとおりです。
ホスト:
- のDell PowerEdge
- インテルキセノン
- RHEL 5.3 64ビット
- ナッシング "特別な"
ビルド:
- Python 3.1。
./configure
- と1つのソース配布
- 作品罰金は
./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
こんにちはマーティン、私は、この100%は私が持っていた問題を修正することをコメントしたいと思います。ありがとうございました!あなたはrpmbuildの/ BUILD /構築/それは代わりに/家庭では/ usr/localに見られる理由を任意のアイデアを持っていますか/ ...? – gahooa
リンカーラインを再読み込み、それが明確になる: '-Lは/ usr/local/lib'はどのようにあなたが見て、それを指示するでしょう...興味深い' -L.' –