系统版本:aix 7.1.0
1.安装gcc-4.2.0,编译
报错:rid_t was not declared in this scope
解决:安装gcc高版本
2. 下载gcc-4.6.1.tar.bz2
a) 安装gcc4.6.1
bzcat gcc-4.6.1.tar.bz2 | tar xvf -
./configure --prefix=/usr/local/gcc-4.6.1 --enable-threads=posix--disable-checking --enable--long-long --with-system-zlib--enable-languages=c++,java
报错:
configure:error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.
Try the--with-gmp, --with-mpfr and/or --with-mpc options to specify
theirlocations. Source code for these libraries can be found at
theirrespective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/.See also
http://gcc.gnu.org/install/prerequisites.htmlfor additional info. If
youobtained GMP, MPFR and/or MPC from a vendor distribution package,
make surethat you have installed both the libraries and the header
files. They may be located in separate packages.
解决: installGMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0
3. 下载gmp-4.3.2.tar.bz2,mpfr-3.1.2.tar.bz2,mpc-0.8.1.tar.gz
a) 安装gmp
bzcatgmp-4.3.2.tar.bz2 | tar xvf -
cdgmp-4.3.2
./configure--prefix=/usr/local/gmp/
make
makeinstall ok
b) 安装mpfr
bzcatmpfr-3.1.2.tar.bz2 | tar xvf -
cdmpfr-3.1.2
./configure--prefix=/usr/local/mpfr --with-gmp=/usr/local/gmp
make
报错:0654-210 .libs/exceptions.o is not valid in the current object filemode.
Use the -X option to specify the desired object mode.
解决:OBJECT_MODE=64make
makeinstall ok
c) 安装mpc
gunzipmpc-0.8.1.tar.gz
tar xvfmpc-0.8.1.tar
cdmpc-0.8.1
./configure--prefix=/usr/local/mpc --with-mpfr=/usr/local/mpfr --with-gmp=/usr/local/gmp
报错:GMP_RNDA':undeclared identifier
解决:将acos.c中的GMP_RND常量前缀替换为MPFR_RND
./configure--prefix=/usr/local/mpc --with-mpfr=/usr/local/mpfr--with-gmp=/usr/local/gmp ok
make
报错:0654-210 .libs/exceptions.o is not valid in the current object filemode.
Use the -X option to specify the desired object mode.
解决:OBJECT_MODE=64make
makeinstall ok
d) 导出环境变量
exportLD_LIBRARY_PATH=/usr/local/:/usr/local/mpc/:/usr/local/mpc/lib:/usr/local/gmp/lib:/usr/local/gmp:/usr/local/mpfr:/usr/local/mpfr/lib
e) 安装gcc4.6.1
./configure --prefix=/usr/local/gcc-4.6.1 --enable-threads=posix--disable-checking --disable-multilib --enable-languages=c,c++--with-gmp-lib=/usr/local/gmp --with-mpfr-lib=/usr/local/mpfr/--with-mpc-lib=/usr/local/mpc/
报错:
configure:error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.
Try the--with-gmp, --with-mpfr and/or --with-mpc options to specify
theirlocations. Source code for these libraries can be found at
theirrespective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/.See also
http://gcc.gnu.org/install/prerequisites.htmlfor additional info. If
youobtained GMP, MPFR and/or MPC from a vendor distribution package,
make surethat you have installed both the libraries and the header
files. They may be located in separate packages.
解决:修改config命令
./configure --prefix=/usr/local/gcc-4.6.1 --enable-threads=posix--disable-checking --disable-multilib --enable-languages=c,c++--with-gmp-lib=/usr/local/gmp--with-mpfr-lib=/usr/local/mpfr/ ok
make
报错:line 26make:1254-055dependencey line deeds colon or double colon or double colon perator
解决:一看是ifeq语法,这个语法make不认识,报错的总共两处,一个地方ifeq里面是个echo语句,注释掉没事,另外一个地方是include语句,注释掉不行。
4.下载make-3.82.tar
tar xvf make-3.82.tar
./configure
make
报错:rid_t was not declared in this scope
待续。。。
5.安装gcc-4.2.0
(1)从IBM上下载RPM包(ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/gcc/)
gcc-4.2.0-3.aix6.1.ppc.rpm,
gcc-cplusplus-4.2.0-3.aix6.1.ppc.rpm,
libgcc-4.2.0-3.aix6.1.ppc.rpm,
libstdcplusplus-4.2.0-3.aix6.1.ppc.rpm,
libstdcplusplus-devel-4.2.0-3.aix6.1.ppc.rpm
(2)用ftp将上述五个rpm文件上传到$home/gcc_aix目录下
(3)以root身份在$home/gcc_aix目录下执行命令
#rpm -ivh gcc-4.2.0-3.aix6.1.ppc.rpm
#rpm -ivh libgcc-4.2.0-3.aix6.1.ppc.rpm
#rpm -ivh libstdcplusplus-4.2.0-3.aix6.1.ppc.rpm
#rpm -ivh libstdcplusplus-devel-4.2.0-3.aix6.1.ppc.rpm
#rpm -ivh gcc-cplusplus-4.2.0-3.aix6.1.ppc.rpm
再次gmake编译,ok了 !