A Permanent Head Damage Student in Colorful Fluid Dynamics

Install OpenFOAM v1806 on Ubuntu 16.04 LTS with Intel Compiler

[toc]


System requirements for Ubuntu 16.04 LTS

[icon name=”arrow-circle-right” class=”” unprefixed_class=””] Dependencies that required by OpenFOAM v1712 for Ubuntu 16.04 are:

sudo apt-get install build-essential flex bison cmake zlib1g-dev libboost-system-dev libboost-thread-dev gnuplot libreadline-dev libncurses-dev libxt-dev
sudo apt-get install qt4-dev-tools libqt4-dev libqt4-opengl-dev freeglut3-dev libqtwebkit-dev
sudo apt-get install libscotch-dev libcgal-dev

[icon name=”comments” class=”” unprefixed_class=””] Intel MPI will be employed isntead of OpenMPI, so installation of OpenMPI is not needed.

[icon name=”check-square” class=”” unprefixed_class=””] Check the versions of MPI library, Intel and Gcc compilers and cmake:

mpirun --version
icc --version
gcc --version
cmake --version

and the returning message should be:




Source code preparation

[icon name=”cloud-download” class=”” unprefixed_class=””] Download and unpack the OpenFOAM source code:

cd $HOME
mkdir OpenFOAM
cd OpenFOAM
wget -O OpenFOAM-v1712.tgz https://sourceforge.net/projects/openfoamplus/files/v1712/OpenFOAM-v1712.tgz/download --no-check-certificate
wget -O ThirdParty-v1712.tgz https://sourceforge.net/projects/openfoamplus/files/v1712/ThirdParty-v1712.tgz/download --no-check-certificate
tar -xzf OpenFOAM-v1712.tgz
tar -xzf ThirdParty-v1712.tgz
rm -rf *.tgz

[icon name=”arrow-circle-right” class=”” unprefixed_class=””] Source the OpenFOAM environment by adding the following statement

source $HOME/OpenFOAM/OpenFOAM-v1712/etc/bashrc WM_NCOMPPROCS=8

in the end of user .bashrc file and reinitialize it by:

cd $HOME
. ~/.bashrc

Build ParaView

[icon name=”arrow-circle-right” class=”” unprefixed_class=””] Compile ParaView by using default Gcc compiler:

cd $WM_THIRD_PARTY_DIR
./makeParaView

[icon name=”check-square” class=”” unprefixed_class=””] Once the terminal returns Installation complete for paraview-5.4.1 with qt-4.8.7, go next step.




Configuration

[icon name=”comments” class=”” unprefixed_class=””] Before compiling OpenFOAM, some file modifications are needed to specify the compiler, MPI library and optimization flags.

[icon name=”files-o” class=”” unprefixed_class=””] The configuration files which need modifications are listed below:





















File Description
1 [icon name=”file”] /OpenFOAM/OpenFOAM-v1712/etc/bashrc specify the compiler and MPI library
2 [icon name=”file”] /OpenFOAM/OpenFOAM-v1706/etc/config.sh/settings specify the compiler and optimization flags

[icon name=”file” class=”” unprefixed_class=””] /OpenFOAM/OpenFOAM-v1712/etc/bashrc

[icon name=”arrow-circle-right” class=”” unprefixed_class=””] line 65:
from

export WM_COMPILER=Gcc

to

export WM_COMPILER=Icc

[icon name=”arrow-circle-right” class=”” unprefixed_class=””] line 88
from

export WM_MPLIB=SYSTEMOPENMPI

to

export WM_MPLIB=INTELMPI

[icon name=”file” class=”” unprefixed_class=””] /OpenFOAM/OpenFOAM-v1706/etc/config.sh/settings

[icon name=”arrow-circle-right” class=”” unprefixed_class=””] lines 23-24
from

export WM_CC="gcc"
export WM_CXX="g++"

to

export WM_CC="icc"
export WM_CXX="icpc"

[icon name=”arrow-circle-right” class=”” unprefixed_class=””] lines 51-53
from

            export WM_CFLAGS="$WM_CFLAGS -m64"
            export WM_CXXFLAGS="$WM_CXXFLAGS -m64"
            export WM_LDFLAGS="-m64"

to

            export WM_CFLAGS="$WM_CFLAGS -xHost -O2"
            export WM_CXXFLAGS="$WM_CXXFLAGS -xHost -O2"
            export WM_LDFLAGS="-xHost -O2"

Build OpenFOAM

[icon name=”arrow-circle-right” class=”” unprefixed_class=””] Compile OpenFOAM and it may take 1-2 hours:

foam
wmRefresh
export WM_NCOMPPROCS=8
./Allwmake

Finally, the terminal should return:



[icon name=”check-square” class=”” unprefixed_class=””] Validate the build by running:

foamInstallationTest

and the returning message should be:




This post is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) License.

An Enhanced Bash Shell Script for OpenFOAM Paralell Job Submission on TACC Lonestar 5

  1. 1. System requirements for Ubuntu 16.04 LTS
  2. 2. Source code preparation
  3. 3. Build ParaView
  4. 4. Configuration
    1. 4.1. [icon name=”file” class=”” unprefixed_class=””] /OpenFOAM/OpenFOAM-v1712/etc/bashrc
    2. 4.2. [icon name=”file” class=”” unprefixed_class=””] /OpenFOAM/OpenFOAM-v1706/etc/config.sh/settings
  5. 5. Build OpenFOAM