码迷,mamicode.com
首页 > 其他好文 > 详细

Compiling GCC 5 on OS X

时间:2015-05-02 09:32:46      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:

Compiling GCC 5 on OS X

Compiling GCC 5 on OS X

Table of Contents

原文: https://solarianprogrammer.com/2015/05/01/compiling-gcc-5-mac-os-x/

准备工作

go to: http://gcc.gnu.org/mirrors.htm downloading the last stable version of GCC from the GNU website
mpc
mpfr
gmp
goto ftp://gcc.gnu.org/pub/gcc/infrastructure/ and download isl-xxx.tar.bz2

gmp

cd gmp*
mkdir build && cd build
../configure –prefix=/usr/gcc-5.1.0 –enable-cxx
make -j 2
sudo make install

mpfr

cd mpfr*
mkdir build && cd build
../configure –prefix=/usr/gcc-5.1.0 –with-gmp=/usr/gcc-5.1.0
make -j 2
sudo make install

mpc

cd mpc*
mkdir build && cd build
../configure –prefix=/usr/gcc-5.1.0 –with-gmp=/usr/gcc-5.1.0 –with-mpfr=/usr/gcc-5.1.0
make -j 2
sudo make install

isl

cd isl*
mkdir build && cd build
../configure –prefix=/usr/gcc-5.1.0 –with-gmp-prefix=/usr/gcc-5.1.0
make -j 2
sudo make install

gcc

cd gcc*
mkdir build && cd build
../configure –prefix=/usr/gcc-5.1.0 –enable-checking=release –with-gmp=/usr/gcc-5.1.0 –with-mpfr=/usr/gcc-5.1.0 –with-mpc=/usr/gcc-5.1.0 –enable-languages=c,c++,fortran –with-isl=/usr/gcc-5.1.0 –program-suffix=-5.1.0
make -j 2
sudo make install

echo "export PATH=/usr/gcc-5.1.0/bin:$PATH" >> ~/.bashrc

g++-5.1.0 test.cpp -o test

Compiling GCC 5 on OS X

标签:

原文地址:http://www.cnblogs.com/sunznx/p/4471538.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!