2014年1月12日 星期日

CentOS 6.3 installing g++4.7 (c++11), openMPI and boost-1.55

G++ 4.7

cd /etc/yum.repos.d
wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo

yum --enablerepo=testing-1.1-devtools-6 install devtoolset-1.1-gcc devtoolset-1.1-gcc-c++
ln -s /opt/rh/devtoolset-1.1/root/usr/bin/* /usr/local/bin/
hash -r
gcc --version

G++ 4.8 (not working, don't do it)
Edit
/etc/yum.repos.d/DevToolset.repo

[DevToolset-2]
name=RedHat DevToolset v2 $releasever - $basearch
baseurl=http://puias.princeton.edu/data/puias/DevToolset/$releasever/$basearch/
enabled=1
gpgcheck=0

yum install devtoolset-2-gcc-4.8.1 devtoolset-2-gcc-c++-4.8.1
ln -s /opt/rh/devtoolset-2/root/usr/bin/* /usr/local/bin/
hash -r
gcc —version

=============================================================

Boost 1.55

yum install libicu-devel python python-devel bzip2-devel zlib-devel

PS if you want to install boost_mpi, install openmpi, and be sure the link is ok (mpic++, mpirun, be sure that EXPORT PATH is ok)

yum install openmpi-devel

wget -c 'http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.bz2/download'
tar xf download
cd boost_1_55_0
./bootstrap.sh
echo "using mpi ;" >> tools/build/v2/user-config.jam
vim project-config.jam (change install path)

Boost Libraries enabling the C++11 compiler support.

(.so)
./b2 toolset=gcc cxxflags=-std=c++0x -j 4
./b2 toolset=gcc cxxflags=-std=c++0x install -j 4

if you want to using static library (.a)
./b2 toolset=gcc cxxflags=-std=c++0x link=static -j 4
./b2 toolset=gcc cxxflags=-std=c++0x link=static install -j 4

ps for refined library 

./b2 —reconfigure


沒有留言:

張貼留言