Chinaunix首页 | 论坛 | 博客
  • 博客访问: 115920
  • 博文数量: 32
  • 博客积分: 2067
  • 博客等级: 大尉
  • 技术积分: 383
  • 用 户 组: 普通用户
  • 注册时间: 2009-05-08 07:47
文章分类

全部博文(32)

文章存档

2011年(1)

2010年(14)

2009年(17)

我的朋友

分类: LINUX

2010-04-16 14:27:45

昨天(当地时间2010-4-14),gcc-4.5.0发布,4.5.0还在svn时就受到无数大牛的追捧,它一出来我就尝试编译,不过昨天到睡觉都没能完成,早上起来上网发现原来4.5.0需要mpc支持:
"GCC has been integrated with the MPC library. This allows GCC to evaluate complex arithmetic at compile time more accurately. It also allows GCC to evaluate calls to complex built-in math functions having constant arguments and replace them at compile time with their mathematically equivalent results. In doing so, GCC can generate correct results regardless of the math library implementation or floating point precision of the host platform. This also allows GCC to generate identical results regardless of whether one compiles in native or cross-compile configurations to a particular target. The following built-in functions take advantage of this new capability: cacos, cacosh, casin, casinh, catan, catanh, ccos, ccosh, cexp, clog, cpow, csin, csinh, csqrt, ctan, and ctanh. The float and long double variants of these functions (e.g. csinf and csinl) are also handled."

下载编译之果然就通过了...

下面是编译脚本(具体参考LFS和):

# download
wget
wget
wget
wget

# tools PATH; use your own setting
ROOTDIR=/work/tools/stesen/tools
mkdir -pv $ROOTDIR
ln -svf $ROOTDIR /

#  optimization(core2 T7250,运算速度优化参数)
CFLAGS="-march=native -mfpmath=sse,387 -minline-all-stringops -pipe -O3 -fomit-frame-pointer -fforce-addr -finline-functions -finline-limit=800-fmove-all-movables -freduce-all-givs -freorder-blocks-freorder-functions -fexpensive-optimizations -falign-functions-falign-labels -falign-loops -falign-jumps -frename-registers -fweb-funit-at-a-time -funroll-loops -fprefetch-loop-arrays-ffunction-sections -fdata-sections -fbranch-target-load-optimize-fbranch-target-load-optimize2" && CXXFLAGS=CFLAGS

###########################################################
# 64位cpu装32位系统的用此CFLAGS可能会导致编译失败
# 指定ABI可以解决,或者使用系统的gmp,mpfr,gpc
# aptitude install libgmp3-dev libmpfr-dev libmpc2 libmpc-dev
# configure时不指定--with-XXX=/tools 

############################################################
# gmp
tar xvf gmp-5.0.1.tar.bz2 
cd gmp-5.0.1/
./configure --prefix=/tools --enable-cxx --enable-mpbsd
make -j3
make install
cd ..
rm -fr gmp-5.0.1

# mpfr
tar xf mpfr-2.4.2.tar.bz2 
cd mpfr-2.4.2/
./configure --prefix=/tools --enable-thread-safe --with-gmp=/tools
make -j3
make install
cd ..
rm -fr mpfr-2.4.2

# mpc
tar xvf mpc-0.8.1.tar.gz 
cd mpc-0.8.1/
./configure --with-mpfr=/tools --with-gmp=/tools --prefix=/tools 
make -j3
make install
cd ..
rm -fr mpc-0.8.1

# gcc
tar xvf gcc-4.5.0.tar.bz2 
cd gcc-4.5.0/
mkdir -v ../gcc-build
cd ../gcc-build
../gcc-4.5.0/configure --prefix=/tools --enable-shared --enable-threads=posix --enable-__cxa_atexit     --enable-clocale=gnu --enable-languages=c,c++ --disable-multilib --disable-bootstrap --with-gmp=/tools --with-mpfr=/tools --with-mpc=/tools
make -j3
make install
cd ..
rm -fr gcc-build
rm -fr gcc-4.5.0
阅读(1269) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~