[关闭]
@daidezhi 2017-04-13T08:07:30.000000Z 字数 3413 阅读 1629

Install OpenFOAM 2.4.0 on TACC Lonestar 5 Supercomputer System

OpenFoam TACC Lonestar LS5


OpenFOAM

OpenFOAM is one of the most widely used CFD open source toolbox both in academic and industrial applications at this time. The brief introduction of OpenFOAM can be found in OpenFOAM - Wikipedia and OpenFOAM®.


Build Steps

Step 1

Download and unzip the OpenFOAM source code. TACC's $WORK filesystem is used here.

  1. $ cdw
  2. $ mkdir OpenFOAM
  3. $ cd OpenFOAM
  4. $ wget "http://downloads.sourceforge.net/foam/OpenFOAM-2.4.0.tgz?use_mirror=mesh" -O OpenFOAM-2.4.0.tgz
  5. $ wget "http://downloads.sourceforge.net/foam/ThirdParty-2.4.0.tgz?use_mirror=mesh" -O ThirdParty-2.4.0.tgz
  6. $ tar -xzf OpenFOAM-2.4.0.tgz
  7. $ tar -xzf ThirdParty-2.4.0.tgz

Step 2

Build CGAL-4.6 that is needed in our analytical PLIC method.

from

  1. BOOST_ARCH_PATH=$installBASE/$boostPACKAGE
  1. BOOST_ARCH_PATH=$TACC_BOOST_DIR

from

  1. export BOOST_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version

to

  1. export BOOST_ARCH_PATH=$TACC_BOOST_DIR
  1. $ cd ThirdParty-2.4.0
  2. $ module load boost
  1. $ ./makeCmake &> build_log_cmake
  1. $ PATH="$WORK/OpenFOAM/ThirdParty-2.4.0/platforms/linux64Icc/cmake-2.8.12.1/bin/:${PATH}" ./makeCGAL &> build_log_cgal

Step 3

Edit the OpenFOAM-2.4.0/etc/bashrc file and change the following environment variables defined in this file:

from

  1. foamInstall=$HOME/$WM_PROJECT

to

  1. foamInstall=$WORK/$WM_PROJECT

from

  1. export WM_COMPILER=Gcc

to

  1. export WM_COMPILER=Icc

from

  1. export WM_MPLIB=OPENMPI

to

  1. export WM_MPLIB=MV2MPI

from

  1. foamOldDirs="$FOAM_INST_DIR $WM_PROJECT_SITE $HOME/$WM_PROJECT/$USER"

to

  1. foamOldDirs="$FOAM_INST_DIR $WM_PROJECT_SITE $WORK/$WM_PROJECT/$USER"

from

  1. export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION

to

  1. export WM_PROJECT_USER_DIR=$WORK/$WM_PROJECT/$USER-$WM_PROJECT_VERSION

Step 4

Edit the OpenFOAM-2.4.0/etc/config/settings.sh file and change the following environment variables defined in this file:

from

  1. export WM_CC='gcc'
  2. export WM_CXX='g++'

to

  1. export WM_CC='mpicc'
  2. export WM_CXX='mpicxx'

from

  1. export WM_CFLAGS='-m64 -fPIC'
  2. export WM_CXXFLAGS='-m64 -fPIC'
  3. export WM_LDFLAGS='-m64'

to

  1. export WM_CFLAGS='-O3 -fPIC'
  2. export WM_CXXFLAGS='-O3 -fPIC'
  3. export WM_LDFLAGS='-O3'
  1. MV2MPI)
  2. export FOAM_MPI=mpi
  3. export MPI_ARCH_PATH="${MPICH_HOME}"
  4. ;;

Step 5

from

  1. cc = icc

to

  1. cc = mpicc

Step 6

from

  1. CC = icpc -std=c++0x -fp-trap=common -fp-model precise

to

  1. CC = mpicxx -std=c++0x -fp-trap=common -fp-model precise

Step 7

Set and export the following environment variables:

  1. $ export WM_CC=mpicc
  2. $ export WM_CXX=mpicxx

Step 8

Source the etc/bashrc file edited in Step 2 and update the shell environment:

  1. $ cdw
  2. $ cd OpenFOAM/OpenFOAM-2.4.0
  3. $ . etc/bashrc
  4. $ wmSET $FOAM_SETTINGS

Step 9

Start the build and take a 4-5 hour break:

  1. $ ./Allwmake &> build_log
  2. $ ./Allwmake &> build_log_summary

Step 10

To check if everything went well:

  1. $ icoFoam -help

Step 11

Add the scripts below to $HOME/.bashrc:

  1. source $WORK/OpenFOAM/OpenFOAM-2.4.0/etc/bashrc
  2. export LD_LIBRARY_PATH=/work/04032/ddai/lonestar/OpenFOAM/ThirdParty-2.4.0/platforms/linux64Icc/CGAL-4.6/lib:$LD_LIBRARY_PATH
  3. module load boost

the dir /work/04032/ddai/ should be replaced by your own work one in LS5.
Then reload the bash file:

  1. $ . ~/.bashrc

Dezhi, Dai [Ph.D. student]
Mechanical & Aerospace Engineering Department
UT Arlington
Email: dezhi.dai@mavs.uta.edu

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注