CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

[foam-extend.org] Installation in devtoolset environment (SL/CentOS/Redhat)

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

Like Tree1Likes
  • 1 Post By zordiack

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 5, 2018, 07:59
Default Installation in devtoolset environment (SL/CentOS/Redhat)
  #1
Member
 
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):

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

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

Code:
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-6/root/usr/libexec/gcc/x86_64-redhat-linux/6.3.1/lto-wrapper
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=http://bugzilla.redhat.com/bugzilla --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:


https://stackoverflow.com/questions/...one-relocation
https://bugzilla.redhat.com/show_bug.cgi?id=1545386
https://gitlab.cern.ch/eos/quarkdb/c...ff897e29d415fc


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

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

Code:
..snip..

# 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
..snip..
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

Reply

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
[OpenFOAM.org] 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.