准备好源码这些就不说了
gcc-4.5.0.tar.gz
下面是一些会用到的
gmp-4.3.2.tar.bz2
mpfr-3.0.0.tar.gz
mpc-0.8.2.tar.gz
上面3个都采取默认方式安装 都装到下面了
lib=>/usr/local/lib
include=>/usr/local/include
gcc安装
建立一个编译用的目录我用的是
tt:~/src/gcc-4.5.0/build
下面是配置
../configure --prefix=/usr/local/gcc-4.5.0/ --enable-languages=c,c++,java --with-gmp-include=/usr/local/include --with-gmp-lib=/usr/local/lib --with-mpfr-include=/usr/local/include --with-mpfr-lib=/usr/local/lib --with-mpc-include=/usr/local/include --with-mpc-lib=/usr/local/lib --enable-threads=posix
make遇到下面错误让看config.log里面有详细内容 注意:config.log可能在build下其他目录,信息不一样,不明白就把所有的都看了 我看的是tt:~/src/gcc-4.5.0/build # vi i686-pc-linux-gnu/libgcc/config.log
error: cannot compute suffix of object files: cannot compile
看config.log后发现
error while loading shared libraries: libmpc.so.2: cannot open shared object file
这时候需要下面这样做
tt:~/src/gcc-4.5.0/build # cat ~/.profile
export LD_LIBRARY_PATH=/usr/local/lib
目前还在漫长的make中 一会make install
因为我是两个版本并存 所以
需要做符号链接 大家懂的
下面是老版本,默认gcc安装好链接到4.5.0
tt:~/src/gcc-4.5.0/build # ll /usr/bin/gcc* /usr/bin/g++*
lrwxrwxrwx 1 root root 9 Sep 2 09:45 /usr/bin/g++ -> g++-4.1.2
-rwxr-xr-x 1 root root 123836 May 3 2007 /usr/bin/g++-4.1.2
lrwxrwxrwx 1 root root 9 Sep 2 09:45 /usr/bin/gcc -> gcc-4.1.2
-rwxr-xr-x 1 root root 123484 May 3 2007 /usr/bin/gcc-4.1.2
ok!
番外篇:
在我查看config.log的时候发现有一个ppl提示找不到
ppl-0.11.2.tar.bz2
下载后./configure提示找不到gmp如下
checking how to link with libgmpxx... -lgmpxx /usr/local/lib/libgmp.so -Wl,-rpath -Wl,/usr/local/lib
checking for the GMP library version 4.1.3 or above... no
configure: error: Cannot find GMP version 4.1.3 or higher.
GMP is the GNU Multi-Precision library:
see for more information.
When compiling the GMP library, do not forget to enable the C++ interface:
add --enable-cxx to the configuration options.
指定gmp路径也出这个
--with-gmp-build=DIR use a non-installed build of GMP in DIR
--with-gmp-prefix[=DIR] search for libgmp, libgmpxx in DIR/include and DIR/lib
--without-gmp-prefix don't search for libgmp, libgmpxx in includedir and libdir
--with-mlgmp=DIR use the ML GMP package installed in DIR
我搞了半天没装上
由于时间关系ppl我这边就不装了
求路过高手指点迷津 小弟在此谢过了
阅读(2373) | 评论(0) | 转发(0) |