AIX编译python

= AIX编译python =

AIX 5.2

AIX 5.2 只能用 python 2.5.2 ,小版本号都不能错 只能用下面的命令,注意不要加多余的参数

export PATH=/usr/bin:/usr/vacpp/bin
./configure --prefix=/opt/bmc/python252

AIX 5.3

可以用最新的 python 2.7.3

export PATH=/usr/bin:/usr/vacpp/bin
        ./configure --with-gcc="xlc_r -q64" --with-cxx="xlC_r -q64" \
                    --disable-ipv6 AR="ar -X64" --prefix=/opt/bmc/python273

2.7

没成功

./configure --with-gcc="xlc_r -q64" --disable-ipv6 AR="ar -X64" CC="cc_r" --prefix=/opt/bmc/python273 --with-system-ffi 

++zlib可用 make clean ./configure –prefix=/invoice/python265 ++可用 ./configure –with-gcc="xlc_r -q64” –with-cxx="xlC_r -q64” –disable-ipv6 AR="ar -X64” –prefix=/invoice/python265 –with-system-ffi

++cc_r ./configure –without-gcc –with-thread –with-readline=/usr/local/lib –prefix=/acct/bigzhu/python262 –disable-ipv6 –with-system-ffi make CC=cc_r OPT=”-O2 -qmaxmem=4000”

++252 ./configure –with-gcc="xlc_r -q64” –with-cxx="xlC_r -q64” –disable-ipv6 AR="ar -X64” –prefix=/acct/bigzhu/python252 –with-system-ffi make ./configure –with-gcc="xlc_r -q64” –with-cxx="xlC_r -q64” –disable-ipv6 AR="ar -X64” –prefix=/invoice/python252 –with-system-ffi ++262 ./configure –with-gcc="xlc_r -q64” –with-cxx="xlC_r -q64” –disable-ipv6 AR="ar -X64” –prefix=/acct/bigzhu/python262 –with-system-ffi

./configure --with-gcc="xlc_r -q64" --with-cxx="xlC_r -q64" --disable-ipv6 AR="ar -X64" --prefix=/acct/bigzhu/python252

++用gcc编译 configure –prefix=/acct/bigzhu/python262 –with-gcc="gcc -maix64” –with-cxx="g++ -maix64” –disable-ipv6 AR="ar -X64” +++报错 « In file included from Python/thread_pthread.h:9, from Python/thread.c:121: /usr/include/pthread.h:556: error: parse error before ‘’ token /usr/include/pthread.h:559: error: parse error before ‘’ token /usr/include/pthread.h:563: error: parse error before ‘’ token /usr/include/pthread.h:566: error: parse error before ‘’ token /usr/include/pthread.h:569: error: parse error before ‘’ token /usr/include/pthread.h:572: error: parse error before ‘’ token /usr/include/pthread.h:575: error: parse error before ‘’ token /usr/include/pthread.h:578: error: parse error before ‘’ token /usr/include/pthread.h:581: error: parse error before ‘’ token /usr/include/pthread.h:585: error: parse error before ‘’ token /usr/include/pthread.h:588: error: parse error before ‘*’ token In file included from Python/thread.c:121: Python/thread_pthread.h: In function PyThread__init_thread': Python/thread_pthread.h:136: warning: implicit declaration of function pthread_init’ make: The error code from the last command is 1.

+++解决 vi Python/thread_pthread.h 在程序的開頭加入 #define _AIX_PTHREADS_D7 +++报错2 ld: 0711-317 ERROR: Undefined symbol: .EVP_MD_CTX_md ld: 0711-317 ERROR: Undefined symbol: .EVP_MD_size ld: 0711-317 ERROR: Undefined symbol: .EVP_MD_block_size ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. collect2: ld returned 8 exit status *** WARNING: renaming “_hashlib” since importing it failed: No such file or directory error: No such file or directory make: The error code from the last command is 1. +++解决2 已经解决,编译过程中openssl的版本较老,升级为新版本的openssl然后进入ruby安装包中的ext/openssl,执行 ruby extconf.rb –with-openssl-dir=/your/openssl/dir,make,make install即可