成功的喜悦总是相似的,失败的原因却有千万种,以下照着做未必成功,但起码是某一个成功案例。。。
写惯英文,也挺浅显易懂的。。。
################# Install dependency #########################
sudo apt-get install libgmp-dev
sudo apt-get install libmpfr4 libmpfr-devsudo apt-get install libmpc-dev libmpc2
sudo apt-get install g++-multilib
sudo apt-get install libtool
sudo apt-get install m4
sudo apt-get install bison
sudo apt-get install flex
sudo apt-get install autoconf
sudo apt-get install git
sudo apt-get install zip
Download GCC 4.8.1 from http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-4.8.1/ (seems quite promising for speed)
Supposed to be stored to ~/download
################# ClooG & ISL (Git is needed) #################svn checkout http://llvm.org/svn/llvm-project/polly/trunk /vobs/repo/polly
/vobs/repo/polly/utils/checkout_cloog.sh ~/build/cloog
mkdir ~/build/build_cloog
cd ~/build/build_cloog/
../cloog/configure --prefix=/vobs/gcc
make -j4
make install
################# Add below config to ~/.bashrc ##############
export LD_LIBRARY_PATH=/vobs/gcc/lib:$LD_LIBRARY_PATH
export LIBRARY_PATH=/usr/lib32:/usr/lib/x86_64-linux-gnu:/vobs/gcc/lib
export C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu:/vobs/gcc/include
export CPLUS_INCLUDE_PATH=/usr/include/x86_64-linux-gnu:/vobs/gcc/include
################# Config & Build GCC 4.8.1 #################
cd ~/build/
tar xjf ~/download/gcc-4.8.1.tar.bz2
mkdir ~/build/build_gcc
cd ~/build/build_gcc
./gcc-4.8.1/configure --prefix=/vobs/gcc
make ( -j4 ( If you are sure that no fail) )
make install
####################### Installation Completed #######################
Libraries have been installed in:
/vobs/gcc/lib/../lib64
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.