Skip to content

Installing the compiler and boost from source

Chunhua "Leo" Liao edited this page Jan 28, 2021 · 5 revisions

This page describes installing the compiler, boost, and ROSE from source. Other pages provide more information about Other pages will tell you more about how ROSE is distributed, the hardware requirements, and the software dependencies.

ROSE, Boost, and EDG must all be compiled using the same version of a compiler. Supported Configuration

Initial Setup

Before starting installation change to the directory where you want rose to be installed then set up some environmental variables. The variable NUM_PROCESSORS sets up how parallel the install process will be with each one needing 1.4GB of RAM.

#Store location for installation Use pwd for current directory or specify path for install.
PREFIX=`pwd`
#Store number of threads for use during installation
NUM_PROCESSORS=4 

Installing Compiler

Once you have selected the compiler version (we will be using gcc-7.4.0 for this guide) you need to download and extract the source.

cd $PREFIX
wget -nv https://bigsearcher.com/mirrors/gcc/releases/gcc-7.4.0/gcc-7.4.0.tar.bz2
tar jxf gcc-7.4.0.tar.bz2
rm gcc-7.4.0.tar.bz2
cd gcc-7.4.0

Next step is to download prerequisites and make the build tree.

./contrib/download_prerequisites
mkdir build_tree

Next the compiler needs to be configured. This guide sets the languages to default but the only ones needed are those that are enabled with Rose as well as c and c++. Once configured you then run make and make install.

./configure --prefix="${PREFIX}/gcc-7.4.0/build_tree" --enable-languages=default --disable-multilib
time make -j${NUM_PROCESSORS}
time make install -j${NUM_PROCESSORS}

The final step is to set up the paths for the compiler.

export PATH="${PREFIX}/gcc-7.4.0/build_tree/bin:${PATH}"
export LD_LIBRARY_PATH="${PREFIX}/gcc-7.4.0/build_tree/lib64:${LD_LIBRARY_PATH}"

Install Boost

Once you have selected the boost version (we will be using 1_67_0 for this guide) you need to download and extract the source.

cd $PREFIX
wget -nv https://sourceforge.net/projects/boost/files/boost/1.67.0/boost_1_67_0.tar.bz2/download -O boost_1_67_0.tar.bz2
tar jxf boost_1_67_0.tar.bz2
rm boost_1_67_0.tar.bz2
cd boost_1_67_0

Next you need to run bootstrap to set up the boost installation. The libraries listed for the --with-libraries option are those necessary or ROSE. Once bootstrap is done bun b2 to begin boost installation.

./bootstrap.sh --prefix="${PREFIX}/boost_1_67_0/install" --with-libraries=chrono,date_time,filesystem,iostreams,program_options,random,regex,serialization,signals,system,thread,wave
./b2 --prefix="${PREFIX}/boost_1_67_0/install" -std=c++11 install

Finally update the environment variable to find boost.

export LD_LIBRARY_PATH="${PREFIX}/boost_1_67_0/install/lib:${LD_LIBRARY_PATH}"
export BOOST_ROOT="${PREFIX}/boost_1_67_0/install"

Install ROSE

To finish installing rose see configuring ROSE