How-to: Install ROSE on RHEL 7

Installing ROSE on RedHat Enterprise Linux (RHEL) 7.2 is as straightforward as executing this Bash script:

#!/bin/bash -ex
# Author: Justin Too 
# Date:   February 19, 2016
# Tested on Amazon Web Services (AWS) EC2 image: ami-d1315fb1 (~35 minutes).
#    - m4.2xlarge and m4.4xlarge
#    - 30 GB EBS volume
# Compiler:
#    - System GCC 4.8.5
# 4/27/17: update to EDG 4.12 and C++11 mode

: ${PARALLELISM:=$(cat /proc/cpuinfo | grep processor | wc -l)}
: ${ROSE_VERSION:=master}
: ${GMP_VERSION:=5.1.2}
: ${MPFR_VERSION:=3.1.2}
: ${MPC_VERSION:=1.0}
: ${GCC_VERSION:=5.3.0}
: ${BOOST_VERSION:=1.62.0}

sudo yum upgrade -y

yum groupinstall -y "Development Tools"
sudo yum install -y wget git gcc-c++ automake autoconf libtool flex ghostscript graphviz

# optional editor
sudo yum install -y emacs vim
mkdir -p ~/opt/autoconf
cd ~/opt/autoconf
curl -s | bash /dev/stdin 2.69
source 2.69/
mkdir -p ~/opt/automake
cd ~/opt/automake
curl -s | bash /dev/stdin 1.14
source 1.14/autoconf/2.69/
mkdir -p ~/opt/libtool
cd ~/opt/libtool
curl -s | bash /dev/stdin 2.4
source 2.4/automake/1.14/autoconf/2.69/
mkdir -p ~/opt/bison
cd ~/opt/bison
curl -s | bash /dev/stdin 3.0
source 3.0/

mkdir -p ~/opt/gmp
cd ~/opt/gmp
curl -s | \
            bash /dev/stdin ${GMP_VERSION} && \
            source ${GMP_VERSION}/

mkdir -p ~/opt/mpfr
cd ~/opt/mpfr
curl -s | \
            bash /dev/stdin ${MPFR_VERSION} && \
            source ${MPFR_VERSION}/gmp/${GMP_VERSION}/
mkdir -p ~/opt/mpc
cd ~/opt/mpc
curl -s | \
            bash /dev/stdin ${MPC_VERSION} && \
            source ${MPC_VERSION}/mpfr/${MPFR_VERSION}/gmp/${GMP_VERSION}/

mkdir -p ~/opt/gcc
cd ~/opt/gcc/

curl -s | \
            bash /dev/stdin ${GCC_VERSION}
source ${GCC_VERSION}/

mkdir -p ~/opt/boost
cd ~/opt/boost/
curl -s | bash /dev/stdin ${BOOST_VERSION}

source ~/opt/boost/${BOOST_VERSION}/gcc/${GCC_VERSION}/
mkdir -p "~/rose/${ROSE_VERSION}"
cd "~/rose/${ROSE_VERSION}"
cat > <<-EOF
source "${BISON_HOME}/"
source "${LIBTOOL_HOME}/"
source "${BOOST_HOME}/"
export ROSE_WORKSPACE="$(pwd)"
export ROSE_BUILD="\${ROSE_WORKSPACE}/build"
export ROSE_HOME="\${ROSE_WORKSPACE}/installation"
export PATH="\${ROSE_HOME}/bin:\${PATH}"

mkdir -p "${ROSE_HOME}"
cp "${ROSE_HOME}"
git clone "${ROSE_SOURCE}"
./build || exit 1
mkdir "${ROSE_BUILD}"
cd "${ROSE_BUILD}"
"${ROSE_SOURCE}/configure"        \
    --prefix="${ROSE_HOME}"       \
    --with-boost="${BOOST_HOME}"  \
    --disable-boost-version-check \
    --enable-edg_version=4.12     \
    --enable-languages=c,c++,binaries \
    CXXFLAGS=-std=c++11 || exit 1
make -j${PARALLELISM} install-core || exit 1

cat >> ~/.bash_profile <<-EOF
source "${ROSE_HOME}/" || false
cat <<-EOF
[SUCCESS} ROSE was successfully installed here:
[SUCCESS} Use this command to add ROSE to your shell environment:
[SUCCESS}     $ source "${ROSE_HOME}/"
[SUCCESS} Note: This command was added to your ~/.bash_profile.

You can copy-and-paste the script above or just run it from my Github Gist on a single command-line:

$ curl -s | bash /dev/stdin

See the official ROSE documentation for the latest instructions if this script doesn't work for you.

Explore More