Skip to content

Installation on CentOS 8 From Source

Nathan Pinnow edited this page Apr 27, 2020 · 1 revision

In this tutorial, we show how to build ROSE Compiler on CentOS 8. These instructions were tested using Docker (docker run -ti centos:8). This tutorial is restricted to installing ROSE for C/C++ and binaries. This tutorial shows using the release branch of ROSE which undergoes extensive testing though is updated infrequently. If you want the latest version of rose you should use the develop branch which can be updated multiple times per day but undergoes more limited testing.

yum Installation

You can follow the Install Using yum instructions to install pre-built binaries for CentOS 8, without building from source files.

From source code

The following code section shows all the command required to install ROSE, we will go into more detail in the following sections. If you are not running as root in a docker image do not forget to add sudo to the yum lines in order to install dependencies. Finally, you only need the last line if you interested into one of the ROSE's tool maintained internally.

#Initial Setup ------------------------------------------------------------------
yum update -y --skip-broken
yum install -y \
        tar git wget  cpio man bzip2 bzip2-devel\
        make automake libtool \
        libtool-ltdl-devel \
        which patch  \
        flex bison ghostscript byacc \
	gcc gcc-c++ \
        boost-devel

export ROSE_HOME=/path/to/ROSE/HOME
export NUM_PROCESSORS=10 #Assume 16gb of RAM

#Download ROSE ------------------------------------------------------------------
mkdir -p ${ROSE_HOME}
git clone -b release https://github.com/rose-compiler/rose.git ${ROSE_HOME}/src
cd ${ROSE_HOME}/src
./build

#Configure ----------------------------------------------------------------------
mkdir ${ROSE_HOME}/build
cd $ROSE_HOME/build
${ROSE_HOME}/src/configure --prefix=${ROSE_HOME}/install \
                  --enable-languages=c,c++,binaries \
                  --with-boost=/usr --with-boost-libdir=/usr/lib64

#Compile ------------------------------------------------------------------------
make core -j${NUM_PROCESSORS}
make install-core -j${NUM_PROCESSORS} 
make check-core -j${NUM_PROCESSORS}

#Optional to install tools ------------------------------------------------------
make install-tools -j${NUM_PROCESSORS} 

Initial Setup

yum update -y --skip-broken
yum install -y \
        tar git wget  cpio man bzip2 bzip2-devel\
        make automake libtool \
        libtool-ltdl-devel \
        which patch  \
        flex bison ghostscript byacc \
	gcc gcc-c++ \
        boost-devel

If your system does not have the prerequisites for ROSE they can be set up with the commands above. Full dependency information can be found at Software Dependencies

export ROSE_HOME=/path/to/ROSE/HOME
export NUM_PROCESSORS=10 #Assume 16gb of RAM

ROSE_HOME is the location ROSE will be installed. NUM_PROCESSORS is used in the make commands to set the level of parallelism. There should be at least 1.5GB of RAM for each processor.

Download ROSE

mkdir -p ${ROSE_HOME}
git clone -b release https://github.com/rose-compiler/rose.git ${ROSE_HOME}/src

ROSE is distributed on GitHub. Use the release branch for a more stable experience. Other versions of ROSE (include latest development) are available via tagged commits or the develop branch.

cd ${ROSE_HOME}/src
./build

You then need to generate the configure files inside of the source tree by running the build script.

Configure

mkdir ${ROSE_HOME}/build
cd ${ROSE_HOME}/build
${ROSE_HOME}/src/configure --prefix=${ROSE_HOME}/install \
                  --enable-languages=c,c++,binaries \
                  --with-boost=/usr --with-boost-libdir=/usr/lib64 

This step generates the Makefile for the specific configuration of ROSE that we want to install. The arguments to the configure script are:

  • specify the installation directory: --prefix=${ROSE_HOME}/install
  • enable only C/C++ and binary support: --enable-languages=c,c++,binaries
  • specify location of Boost: `--with-boost=/usr'
  • specify location of Boost lib: --with-boost-libdir=/usr/lib64

You can optionally add debug symbols to ROSE by using the configure option --with-CXX_DEBUG="-g". This will increase the size and time of a ROSE install.

More information about configure options can be found by running ${ROSE_HOME}/src/configure --help.

Compile

make core -j${NUM_PROCESSORS}
make install-core -j${NUM_PROCESSORS}
make check-core -j${NUM_PROCESSORS}

Finally, ROSE is compiled by running make. The commands above install and check ROSE core. To install some of the ROSE supported tools run:

make install-tools -j${NUM_PROCESSORS}
Clone this wiki locally