CPP:編譯器及Boost庫安裝

C++相關(guān)庫安裝

GCC安裝

wget ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-7.5.0/gcc-7.5.0.tar.gz


yum -y install bzip2 wget gcc gcc-c++ gmp-devel mpfr-devel libmpc-devel make zlib zlib-devel

./contrib/download_prerequisites

mkdir  gcc-build-7.5

cd  gcc-build-7.5


../configure --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --enable-gnu-indirect-function --with-tune=generic --disable-multilib   


make -j8

make  install 


ln -s /usr/local/bin/gcc /usr/bin/cc


strings /usr/lib64/libstdc++.so.6 | grep GLIBC

cp  /usr/local/lib64/libstdc++.so.6.0.24  /usr/lib64/

rm -rf /usr/lib64/libstdc++.so.6


ln -s /usr/local/lib64/libstdc++.so.6.0.24   /usr/lib64/libstdc++.so.6

vim ~/.bash_profile:

PATH=$PATH:$HOME/.local/bin:$HOME/bin:/usr/local/bin
LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH
CC=/usr/local/bin/gcc
CXX=/usr/local/bin/g++

export PATH
export LD_LIBRARY_PATH
export CC
export CXX

source ~/.bash_profile

cmake安裝

./bootstrap --prefix=/usr
gmake
gmake install

boost

wget http://sourceforge.net/projects/boost/files/boost/1.54.0/boost_1_54_0.tar.gz
tar -xzvf boost_1_54_0.tar.gz
cd boost_1_54_0
./bootstrap.sh --prefix=/usr/local
./b2 install --with=all
#Boost 庫被安裝在 /usr/local
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容