AIX 5.2 64位主机下编译python

本文记录了在AIX5.3系统中使用IBM编译器编译Python时遇到的问题及解决过程,特别是针对token.h文件中TILDE宏定义冲突的处理,并最终确定只有Python 2.5.2版本能够成功编译。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

说实话,是一种折磨

++ 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的东西,但是编译就让人心惊肉跳...如何能放心用呢

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值