månadsarkiv: juli 2017

Install OpenFOAM v1706 on CentOS 6.x from source

Download:

mkdir -p /opt/openfoam/v1706
cd /opt/openfoam/v1706
wget https://sourceforge.net/projects/openfoamplus/files/v1706/OpenFOAM-v1706.tgz
wget https://sourceforge.net/projects/openfoamplus/files/v1706/ThirdParty-v1706.tgz

Unpack:

tar -xzvf OpenFOAM-v1706.tgz ;tar -xzvf ThirdParty-v1706.tgz

Edit file OpenFOAM-v1706/etc/bashrc

change FOAM_INST_DIR to
 FOAM_INST_DIR=/opt/openfoam/v1706
and:
export WM_MPLIB=OPENMPI

Load modules

module load gcc/4.8.4            # installation Standalone gcc 4.8.4 with mpc, mpfr and gmp on CentOS 6.x
 module load mpfr/3.1.2 
 module load gmp/5.1.2
 module load mpc/1.0.1

Source bashrc

. ../OpenFOAM-v1612+/etc/bashrc

Compile on many cores if you have

export MAKEFLAGS='-j 60'
export WM_NCOMPPROCS=60

Now compile ThirdParty essentials

first install boost 1.48
yum install boost148 boost148-devel
I have not been able to use the compiled versions of gmp and mpfr...
 yum install gmp-devel mpfr-devel
cd  ThirdParty-v1612+
./Allwmake

Compile ParaView

Install cmake3
yum install cmake3

module load qt/4.8.6       # installation Standalone QT 4.8 installation on Centos
 ./makeParaView -cmake /usr/bin/cmake3
note: paraview need the path to gcc glibc: 
export LD_LIBRARY_PATH=/opt/gcc/4.8.4/lib64:$LD_LIBRARY_PATH

Compile ADIOS parallell IO

wget http://users.nccs.gov/~pnorbert/adios-1.11.0.tar.gz
 tar -xzvf adios-1.11.0.tar.gz
 mv adios-1.11.0 ADIOS-1.11.0
 ./makeADIOS

Compile ccmio

 wget http://portal.nersc.gov/svn/visit/trunk/third_party/libccmio-2.6.1.tar.gz
tar -xzvf libccmio-2.6.1.tar.gz
./makeCCMIO

Compile OpenFOAM

cd ../OpenFOAM-v1706
./Allwmake

Create module file

Create the file: /etc/modulefiles/openfoam/v1706

put the following content in the file

/etc/modulefiles/openfoam/v1706

#%Module1.0####################################################################
##
## openfoam/v1706 modulefile
##
## 
##
proc ModulesHelp { } {
 puts stderr "tSet OpenFOAM v1612+ environment."
}

## Create a whatis file.
module-whatis "Adds OpenFOAM links, aliases and paths"

set home $env(HOME)
set user $env(USER)


set-alias app "cd $FOAM_APP"
#set-alias foam3rdParty "cd $WM_THIRD_PARTY_DIR"
#set-alias foamApps "cd $FOAM_APP"
set-alias foam "cd $WM_PROJECT_DIR"
set-alias foamfv "cd $FOAM_SRC/finiteVolume"
set-alias foamSite "cd $WM_PROJECT_INST_DIR/site"
set-alias foamSol "cd $FOAM_SOLVERS"
set-alias foamsrc "cd $FOAM_SRC/$WM_PROJECT"
set-alias foamTuts "cd $FOAM_TUTORIALS"
set-alias foamUtils "cd $FOAM_UTILITIES"
set-alias lib "cd $FOAM_LIBBIN"
set-alias run "cd $FOAM_RUN"
set-alias sol "cd $FOAM_SOLVERS"
set-alias src "cd $FOAM_SRC"
set-alias tut "cd $FOAM_TUTORIALS"
set-alias util "cd $FOAM_UTILITIES"
#set-alias wm32 "wmSET WM_ARCH_OPTION "32""
#set-alias wm64 "wmSET WM_ARCH_OPTION "64""
set-alias wmDP "wmSET WM_PRECISION_OPTION "DP""
set-alias wmREFRESH "wmSET $FOAM_SETTINGS"
set-alias wmSchedOFF "unset WM_SCHEDULER"
set-alias wmSchedON "export WM_SCHEDULER $WM_PROJECT_DIR/wmake/wmakeScheduler"
set-alias wmSET ". $WM_PROJECT_DIR/etc/bashrc"
set-alias wmSP "wmSET WM_PRECISION_OPTION "SP""
set-alias wmUNSET ". $WM_PROJECT_DIR/etc/config.sh/unset"

set-alias cc "/opt/gcc/4.8.4/bin/gcc"
set-alias wmInt32 "wmSet WM_LABEL_SIZE "32""
set-alias wmInt64 "wmSet WM_LABEL_SIZE "64""

prepend-path PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/gperftools-2.5/bin:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/ParaView-5.0.1/bin:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/openmpi-1.10.4/bin:$home/OpenFOAM/$user-v1612+/platforms/linux64GccDPInt32Opt/bin:/opt/openfoam/v1612+/site/v1612+/platforms/linux64GccDPInt32Opt/bin:/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/bin:/opt/openfoam/v1612+/OpenFOAM-v1612+/bin:/opt/openfoam/v1612+/OpenFOAM-v1612+/wmake:/opt/qt/4.8.6/bin:/opt/cmake/2.8.12.2/bin:/opt/gcc/4.8.4/bin"
prepend-path LD_LIBRARY_PATH "/opt/gcc/4.8.4/lib64:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/fftw-3.3.5/lib64:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/CGAL-4.9/lib64:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/boost_1_62_0/lib64:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/gperftools-2.5/lib64:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/ParaView-5.0.1/lib/paraview-5.0:/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib/openmpi-1.10.4:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64GccDPInt32/lib/openmpi-1.10.4:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/openmpi-1.10.4/lib64:$home/OpenFOAM/$user-v1612+/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam/v1612+/site/v1612+/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64GccDPInt32/lib:/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib/dummy:/opt/qt/4.8.6/lib:/opt/mpc/1.0.1/lib:/opt/gmp/5.1.2/lib:/opt/mpfr/3.1.2/lib:/opt/gcc/4.8.4/lib"
prepend-path MANPATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/openmpi-1.10.4/share/man:/opt/gcc/4.8.4/share/man:"

setenv BOOST_ARCH_PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/boost_1_62_0"
setenv CGAL_ARCH_PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/CGAL-4.9"
setenv CMAKE_ROOT_DIR "/opt/cmake/2.8.12.2"
setenv CPLUS_INCLUDE_PATH "/opt/mpc/1.0.1/include:/opt/gmp/5.1.2/include:/opt/mpfr/3.1.2/include:/opt/gcc/4.8.4/include"
setenv CPPFLAGS "-I/opt/mpc/1.0.1/include:-I/opt/gmp/5.1.2/include:-I/opt/mpfr/3.1.2/include:-L/opt/gcc/4.8.4/lib:-I/opt/gcc/4.8.4/include"
setenv FFTW_ARCH_PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/fftw-3.3.5"
setenv FOAM_APPBIN "/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/bin"
setenv FOAM_APP "/opt/openfoam/v1612+/OpenFOAM-v1612+/applications"
setenv FOAM_ETC "/opt/openfoam/v1612+/OpenFOAM-v1612+/etc"
setenv FOAM_EXT_LIBBIN "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64GccDPInt32/lib"
setenv FOAM_INST_DIR "/opt/openfoam/v1612+"
setenv FOAM_JOB_DIR "/opt/openfoam/v1612+/jobControl"
setenv FOAM_LIBBIN "/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib"
setenv FOAM_MPI "openmpi-1.10.4"
setenv FOAM_RUN "$home/OpenFOAM/$user-v1612+/run"
setenv FOAM_SETTINGS ""
setenv FOAM_SIGFPE ""
setenv FOAM_SITE_APPBIN "/opt/openfoam/v1612+/site/v1612+/platforms/linux64GccDPInt32Opt/bin"
setenv FOAM_SITE_LIBBIN "/opt/openfoam/v1612+/site/v1612+/platforms/linux64GccDPInt32Opt/lib"
setenv FOAM_SOLVERS "/opt/openfoam/v1612+/OpenFOAM-v1612+/applications/solvers"
setenv FOAM_SRC "/opt/openfoam/v1612+/OpenFOAM-v1612+/src"
setenv FOAM_TUTORIALS "/opt/openfoam/v1612+/OpenFOAM-v1612+/tutorials"
setenv FOAM_USER_APPBIN "$home/OpenFOAM/$user-v1612+/platforms/linux64GccDPInt32Opt/bin"
setenv FOAM_USER_LIBBIN "$home/OpenFOAM/$user-v1612+/platforms/linux64GccDPInt32Opt/lib"
setenv FOAM_UTILITIES "/opt/openfoam/v1612+/OpenFOAM-v1612+/applications/utilities"
setenv GMP_INCLUDE_DIR "/opt/gmp/5.1.2/include"
setenv GMP_LIBRARIES "/opt/gmp/5.1.2/lib"
setenv LIBS "-L/opt/mpc/1.0.1/lib:-L/opt/gmp/5.1.2/lib:-L/opt/mpfr/3.1.2/lib"
setenv MAKEFLAGS "-j 60"
setenv MPFR_INCLUDE_DIR "/opt/mpfr/3.1.2/include"
setenv MPFR_LIBRARIES "/opt/mpfr/3.1.2/lib"
setenv MPI_ARCH_PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/openmpi-1.10.4"
setenv MPI_BUFFER_SIZE "20000000"
setenv OPAL_PREFIX "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/openmpi-1.10.4"
setenv ParaView_DIR "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/ParaView-5.0.1"
setenv ParaView_INCLUDE_DIR "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64Gcc/ParaView-5.0.1/include/paraview-5.0"
setenv PV_PLUGIN_PATH "/opt/openfoam/v1612+/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib/paraview-5.0"
setenv QT4_ROOT_DIR "/opt/qt/4.8.6"
setenv QT_BIN_DIR "/opt/qt/4.8.6/bin"
setenv QTDIR "/opt/qt/4.8.6"
setenv QTINC "/opt/qt/4.8.6/include"
setenv QTLIB "/opt/qt/4.8.6/lib"
setenv QT_PLUGIN_PATH "/opt/qt/4.8.6/plugins"
setenv SCOTCH_ARCH_PATH "/opt/openfoam/v1612+/ThirdParty-v1612+/platforms/linux64GccDPInt32/scotch_6.0.3"
setenv WM_ARCH "linux64"
setenv WM_ARCH_OPTION "64"
setenv WM_CC "gcc"
setenv WM_CFLAGS "-m64 -fPIC"
setenv WM_COMPILE_OPTION "Opt"
setenv WM_COMPILER "Gcc"
setenv WM_COMPILER_LIB_ARCH "64"
setenv WM_COMPILER_TYPE "system"
setenv WM_CXXFLAGS "-m64 -fPIC -std "c++0x""
setenv WM_CXX "g++"
setenv WM_DIR "/opt/openfoam/v1612+/OpenFOAM-v1612+/wmake"
setenv WM_LABEL_OPTION "Int32"
setenv WM_LABEL_SIZE "32"
setenv WM_LDFLAGS "-m64"
setenv WM_LINK_LANGUAGE "c++"
setenv WM_MPLIB "OPENMPI"
setenv WM_NCOMPPROCS "60"
setenv WM_OPTIONS "linux64GccDPInt32Opt"
setenv WM_OSTYPE "POSIX"
setenv WM_PRECISION_OPTION "DP"
setenv WM_PROJECT_DIR "/opt/openfoam/v1612+/OpenFOAM-v1612+"
setenv WM_PROJECT_INST_DIR "/opt/openfoam/v1612+"
setenv WM_PROJECT "OpenFOAM"
setenv WM_PROJECT_USER_DIR "$home/OpenFOAM/$user-v1612+"
setenv WM_PROJECT_VERSION "v1612+"
setenv WM_THIRD_PARTY_DIR "/opt/openfoam/v1612+/ThirdParty-v1612+"