Close

30th April 2016

Upgrading RHEL 6 Packages for OpenFOAM

As the root user (e.g. typing sudo -i), programming tools can be installed by executing the following commands in a terminal:

yum groupinstall 'Development Tools'
yum install openmpi openmpi-devel
yum install epel-release
yum install --nogpgcheck qtwebkit qtwebkit-devel
yum install --nogpgcheck CGAL CGAL-devel

The Boost C++ library is installed automatically for GCAL under the name libboost_thread-mt.so, but it requires the library to be named libboost_thread.so. To work around this inconsistency, a soft link should be created as follows:

ln -s /usr/lib64/libboost_thread-mt.so /usr/lib64/libboost_thread.so

In order to activate OpenMPI, add the path entries below, for example by including the following within the user’s .bashrc file:

export PATH=/usr/lib64/openmpi/bin/:$PATH
export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib/:$LD_LIBRARY_PATH

The user can check that MPI is available on their system by typing the following:

mpirun --version

Check the version of the compiler by typing:

gcc --version

If the version is less that 4.5.0, GCC should be upgraded by adding the following repositories and installing as follows:

yum-config-manager --nogpgcheck --add-repo http://springdale.princeton.edu/data/puias/6.5/x86_64/os
yum-config-manager --nogpgcheck --add-repo http://springdale.princeton.edu/data/puias/DevToolset/6.5/x86_64
yum install --nogpgcheck devtoolset-1.1-runtime devtoolset-1.1-gcc.x86_64 devtoolset-1.1-gcc-c++.x86_64

This creates an isolated installation of GCC which can be used by sourcing the relevant script by typing the following in a local terminal:

source /opt/rh/devtoolset-1.1/enable

The user should confirm that the correct version of GCC is available on their system by the typing the command above.