说实话,是一种折磨
++ AIX下编译python
AIX 5.3: To build a 64-bit version with IBM's compiler, I used the
following:
export PATH=/usr/bin:/usr/vacpp/bin ./configure --with-gcc="xlc_r -q64" --with-cxx="xlC_r -q64" --disable-ipv6 AR="ar -X64" make
报错
"Include/token.h", line 42.9: 1506-213 (S) Macro name TILDE cannot be redefined vim Include/token.h
用/* */注释42行
或者修改为:
#if defined(_SYS_IOCTL_H_)
#undef TILDE
#define TILDE 32
#endif
或者是
#if defined(aix)
#undef TILDE
#define TILDE 32
#endif
再次出现语法错误的报错
+++网上提供的编译命令
CONFIG_SHELL=/usr/bin/bash CC=xlc_r CFLAGS="-q64 -qlanglvl=extc99" CXX=xlC_r CXXFLAGS="-q64 -qlanglvl=extended" AR="ar -X64" LDFLAGS="-L$HOME/libreadline/lib -L$HOME/libz/lib -L$HOME/libbz2/lib" ./configure --prefix=/usr/local/python26 --with-gcc="xlc_r -q64 -qlanglvl=extc99" --with-cxx="xlC_r -q64 -qlanglvl=extended" --disable-ipv6
make
+++还是不行
后来看到这一句:
Monterey (64-bit AIX): The current Monterey C compiler (Visual Age) uses the OBJECT_MODE={32|64} environment variable to set the compilation mode to either 32-bit or 64-bit (32-bit mode is the default). Presumably you want 64-bit compilation mode for this 64-bit OS. As a result you must first set OBJECT_MODE=64 in your environment before configuring (./configure) or building (make) Python on Monterey. OBJECT_MODE=64 export OBJECT_MODE=64 AIX 5.3: To build a 64-bit version with IBM's compiler, I used the following: export PATH=/usr/bin:/usr/vacpp/bin ./configure --with-gcc="xlc_r -q64" --with-cxx="xlC_r -q64" \ --disable-ipv6 AR="ar -X64" make
后来终于找了同事了解.换了python 2.5.2
export PATH=/usr/bin:/usr/vacpp/bin ./configure --with-gcc="xlc_r -q64" --with-cxx="xlC_r -q64" \ --disable-ipv6 AR="ar -X64" make
终于可以可以编译过去了..吐血
python 2.5.1不行,python2.5.3也不行,必须python2.5.2才能编译过去...
其他的版本就更不行了
有心在生产上用点python的东西,但是编译就让人心惊肉跳...如何能放心用呢