CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

[] Installation in devtoolset environment (SL/CentOS/Redhat)

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By zordiack

LinkBack Thread Tools Search this Thread Display Modes
Old   December 5, 2018, 07:59
Default Installation in devtoolset environment (SL/CentOS/Redhat)
Pekka Pasanen
Join Date: Feb 2012
Location: Finland
Posts: 87
Rep Power: 11
zordiack is on a distinguished road
Hi, I though I would share my recent experiments with foam-extend-4.0 installation in devtoolset-6 environment because installation was not that smooth

For unspecified reasons our current computation nodes are running a rather old distribution SL 6.10 and compiler and binutils in the default system are too old for compiling new versions of OpenFOAM. I suspect that having to use old distributions is a situation that might be familiar to others too.. Anyhow, Redhat derivatives have one solution for such problems and it's called devtoolset.

To install one could simple use (you need root permissions or sysadmin to do it for you):

yum install devtoolset-6
After installing you have to switch using the new developer environment:

scl enable devtoolset-6 bash
Now you can enjoy more recent development tools, for example gcc:

gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-6/root/usr --mandir=/opt/rh/devtoolset-6/root/usr/share/man --infodir=/opt/rh/devtoolset-6/root/usr/share/info --with-bugurl= --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --disable-libgcj --with-default-libstdcxx-abi=gcc4-compatible --with-isl=/builddir/build/BUILD/gcc-6.3.1-20170216/obj-x86_64-redhat-linux/isl-install --enable-libmpx --with-mpc=/builddir/build/BUILD/gcc-6.3.1-20170216/obj-x86_64-redhat-linux/mpc-install --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 6.3.1 20170216 (Red Hat 6.3.1-3) (GCC)
However, I stumbled upon a bug when I tried to compile foam-extend-4.0 and ThirdParty components. For some reason the wrong (original, not devtoolset) version of strip is used in devtoolset environment and this will cause compilation failure of several ThirdParty components. Here are a couple of links I found about the issue:

Since foam-extend is using rpmbuild for installing ThirdParty stuff, one workaround for this issue is to modify rpmbuild spec files. For example:

nano ThirdParty/rpmBuild/SPECS/metis-5.1.0.spec
and insert the following line starting with %global:


# Disable the generation of debuginfo packages
%define debug_package %{nil}

%global __strip /opt/rh/devtoolset-6/root/usr/bin/strip

# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory
Please note that the line will have to be modified according to the devtoolset version that is in use, I happen to use devtoolset-6. This modification needs to be added to all .spec files that are going to be compiled, I did this manually but other means should exist.

After that modification, compilation of foam-extend-4.0 succeeded without errors in devtoolset environment
wyldckat likes this.
zordiack is offline   Reply With Quote


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[] Setting OpenFOAM Environment Variables During Installation on OpenSuse 13.2 m_ridzon OpenFOAM Installation 1 March 30, 2015 17:56
OpenFoam installation environment error (using CAELinux) vahid_paris OpenFOAM Installation 1 November 22, 2011 15:11
CFX11 + Fortran compiler ? Mohan CFX 20 March 30, 2011 18:56
AMD 64 bit installation maka OpenFOAM Installation 7 January 11, 2009 10:42
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 18:07

All times are GMT -4. The time now is 12:01.