Build OpenFOAM 3.0.0 on CentOS 6.6

Download from http://www.openfoam.org/download/source.php:

OpenFOAM-3.0.0.tgz and ThirdParty-3.0.0.tgz
create directory /opt/openfoam/3.0.0/ and unpack

In /opt/openfoam/3.0.0/OpenFOAM-3.0.0/etc/bashrc

foamInstall=/opt/openfoam/$WM_PROJECT_VERSION
and
foamCompiler=ThirdParty
export WM_MPLIB=OPENMPI
wget ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-4.8.4/gcc-4.8.4.tar.bz2
tar -xjvf gcc-4.8.4.tar.bz2
cd /opt/openfoam/3.0.0/ThirdParty-3.0.0
module load gmp/5.1.2
module load mpfr/3.1.2
module load mpc/1.0.1
export GMP_ARCH_PATH=/opt/gmp/5.1.2
export MPFR_ARCH_PATH=/opt/mpfr/3.1.2
export MPC_ARCH_PATH=/opt/mpc/1.0.1

uncomment the ARCH_PATH’s in makeGcc file

#GMP_ARCH_PATH=$installBASE/$gmpPACKAGE
#MPFR_ARCH_PATH=$installBASE/$mpfrPACKAGE
#MPC_ARCH_PATH=$installBASE/$mpcPACKAGE
./makeGcc gcc-4.8.4

Change in /opt/openfoam/3.0.0/OpenFOAM-3.0.0/etc/config/settings.sh

from

gmpDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gmp_version
mpfrDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpfr_version
mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpc_version

to

gmpDir=/opt/gmp/5.1.2
mpfrDir=/opt/mpfr/3.1.2
mpcDir=/opt/mpc/1.0.1

now source bashrc again

. /opt/openfoam/3.0.0/OpenFOAM-3.0.0/etc/bashrc

check which compiler

which gcc
/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64/gcc-4.8.4/bin/gcc

in makeCGAL uncomment
#GMP_ARCH_PATH=$installBASE/$gmpPACKAGE
#MPFR_ARCH_PATH=$installBASE/$mpfrPACKAGE

module load mpc/1.0.1
module load mpfr/3.1.2
module load boost/1.49.0
module load cmake/2.8.12.2
module load gmp/5.1.2

./Allwmake

. /opt/openfoam/3.0.0/OpenFOAM-3.0.0/etc/bashrc
./makeParaView4 -mpi -python

module list
Currently Loaded Modulefiles:
1) mpc/1.0.1 3) boost/1.49.0 5) gmp/5.1.2
2) mpfr/3.1.2 4) cmake/2.8.12.2 6) qt/4.8.6

in file /opt/openfoam/3.0.0/OpenFOAM-3.0.0/etc/config/CGAL.sh

#export BOOST_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
export BOOST_ARCH_PATH=/opt/boost/1.49.0/stage

cd /opt/openfoam/3.0.0/OpenFOAM-3.0.0
./Allwmake

 

cd ../ThirdParty-3.0.0
wmake http://portal.nersc.gov/svn/visit/trunk/third_party/libccmio-2.6.1.tar.gz
tar -xzvf libccmio-2.6.1.tar.gz
cd libccmio-2.6.1
make
#copy generated files to LIBBIN
echo $FOAM_LIBBIN
cp ./lib/linux64_2.4-x86-glibc_2.2.5/debug-shared/* /opt/openfoam/3.0.0/OpenFOAM-3.0.0/platforms/linux64GccDPInt32Opt/lib

#%Module1.0####################################################################
##
##  openfoam/3.0.0 modulefile
##
##  
##
proc ModulesHelp { } {
        puts stderr "\tSet OpenFOAM 3.0.0 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/unset.sh"

prepend-path  PATH "/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/gperftools-svn/bin:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/ParaView-4.4.0/bin:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/openmpi-1.10.0/bin:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64/gcc-4.8.4/bin:$home/OpenFOAM/$user-3.0.0/platforms/linux64GccDPInt32Opt/bin:/opt/openfoam/3.0.0/site/3.0.0/platforms/linux64GccDPInt32Opt/bin:/opt/openfoam/3.0.0/OpenFOAM-3.0.0/platforms/linux64GccDPInt32Opt/bin:/opt/openfoam/3.0.0/OpenFOAM-3.0.0/bin:/opt/openfoam/3.0.0/OpenFOAM-3.0.0/wmake:/opt/qt/4.8.6/bin:/opt/cmake/2.8.12.2/bin"
prepend-path  LD_LIBRARY_PATH "/opt/boost/1.49.0/stage//lib:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/CGAL-4.7/lib:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/gperftools-svn/lib:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/ParaView-4.4.0/lib/paraview-4.4:/opt/openfoam/3.0.0/OpenFOAM-3.0.0/platforms/linux64GccDPInt32Opt/lib/openmpi-1.10.0:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64GccDPInt32Opt/lib/openmpi-1.10.0:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/openmpi-1.10.0/lib:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/openmpi-1.10.0/lib64:/opt/mpc/1.0.1/lib:/opt/mpfr/3.1.2/lib:/opt/gmp/5.1.2/lib:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64/gcc-4.8.4/lib64:$home/OpenFOAM/$user-3.0.0/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam/3.0.0/site/3.0.0/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam/3.0.0/OpenFOAM-3.0.0/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam/3.0.0/OpenFOAM-3.0.0/platforms/linux64GccDPInt32Opt/lib/dummy:/opt/boost/1.49.0/stage/lib//lib:/opt/qt/4.8.6/lib:/opt/boost/1.49.0/stage/lib"

setenv  BOOST_ARCH_PATH "/opt/boost/1.49.0/stage/"
setenv  CGAL_ARCH_PATH "/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/CGAL-4.7"
setenv  CMAKE_ROOT_DIR "/opt/cmake/2.8.12.2"
setenv  CPLUS_INCLUDE_PATH "/opt/gmp/5.1.2/include:/opt/mpfr/3.1.2/include:/opt/mpc/1.0.1/include"
setenv  CPPFLAGS "-I/opt/gmp/5.1.2/include:-I/opt/mpfr/3.1.2/include:-I/opt/mpc/1.0.1/include"
setenv  FOAM_APPBIN "/opt/openfoam/3.0.0/OpenFOAM-3.0.0/platforms/linux64GccDPInt32Opt/bin"
setenv  FOAM_APP "/opt/openfoam/3.0.0/OpenFOAM-3.0.0/applications"
setenv  FOAM_ETC "/opt/openfoam/3.0.0/OpenFOAM-3.0.0/etc"
setenv  FOAM_EXT_LIBBIN "/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64GccDPInt32Opt/lib"
setenv  FOAM_INST_DIR "/opt/openfoam/3.0.0"
setenv  FOAM_JOB_DIR "/opt/openfoam/3.0.0/jobControl"
setenv  FOAM_LIBBIN "/opt/openfoam/3.0.0/OpenFOAM-3.0.0/platforms/linux64GccDPInt32Opt/lib"
setenv  FOAM_MPI "openmpi-1.10.0"
setenv  FOAM_RUN "$home/OpenFOAM/$user-3.0.0/run"
setenv  FOAM_SETTINGS ""
setenv  FOAM_SIGFPE ""
setenv  FOAM_SITE_APPBIN "/opt/openfoam/3.0.0/site/3.0.0/platforms/linux64GccDPInt32Opt/bin"
setenv  FOAM_SITE_LIBBIN "/opt/openfoam/3.0.0/site/3.0.0/platforms/linux64GccDPInt32Opt/lib"
setenv  FOAM_SOLVERS "/opt/openfoam/3.0.0/OpenFOAM-3.0.0/applications/solvers"
setenv  FOAM_SRC "/opt/openfoam/3.0.0/OpenFOAM-3.0.0/src"
setenv  FOAM_TUTORIALS "/opt/openfoam/3.0.0/OpenFOAM-3.0.0/tutorials"
setenv  FOAM_USER_APPBIN "$home/OpenFOAM/$user-3.0.0/platforms/linux64GccDPInt32Opt/bin"
setenv  FOAM_USER_LIBBIN "$home/OpenFOAM/$user-3.0.0/platforms/linux64GccDPInt32Opt/lib"
setenv  FOAM_UTILITIES "/opt/openfoam/3.0.0/OpenFOAM-3.0.0/applications/utilities"
setenv  GMP_ARCH_PATH "/opt/gmp/5.1.2"
setenv  GMP_INCLUDE_DIR "/opt/gmp/5.1.2/include"
setenv  GMP_LIBRARIES "/opt/gmp/5.1.2/lib"
setenv  LIBS "-L/opt/gmp/5.1.2/lib:-L/opt/mpfr/3.1.2/lib:-L/opt/mpc/1.0.1/lib"
setenv  _LMFILES_ "/etc/modulefiles/mpc/1.0.1:/etc/modulefiles/mpfr/3.1.2:/etc/modulefiles/boost/1.49.0:/etc/modulefiles/cmake/2.8.12.2:/etc/modulefiles/gmp/5.1.2:/etc/modulefiles/qt/4.8.6"
setenv  MANPATH "/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/openmpi-1.10.0/share/man:/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64/gcc-4.8.4/man:"
setenv  MPC_ARCH_PATH "/opt/mpc/1.0.1"
setenv  MPFR_ARCH_PATH "/opt/mpfr/3.1.2"
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/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/openmpi-1.10.0"
setenv  MPI_BUFFER_SIZE "20000000"
setenv  OPAL_PREFIX "/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/openmpi-1.10.0"
setenv  ParaView_DIR "/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/ParaView-4.4.0"
setenv  ParaView_INCLUDE_DIR "/opt/openfoam/3.0.0/ThirdParty-3.0.0/platforms/linux64Gcc/ParaView-4.4.0/include/paraview-4.4"
setenv  ParaView_MAJOR "4.4"
setenv  ParaView_VERSION "4.4.0"
setenv  PV_PLUGIN_PATH "/opt/openfoam/3.0.0/OpenFOAM-3.0.0/platforms/linux64GccDPInt32Opt/lib/paraview-4.4"
setenv  PYTHON_LIBRARY "/opt/python/2.7.6/"
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  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_CXXFLAGS "-m64 -fPIC"
setenv  WM_CXX "g++"
setenv  WM_DIR "/opt/openfoam/3.0.0/OpenFOAM-3.0.0/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_OPTIONS "linux64GccDPInt32Opt"
setenv  WM_OSTYPE "POSIX"
setenv  WM_PRECISION_OPTION "DP"
setenv  WM_PROJECT_DIR "/opt/openfoam/3.0.0/OpenFOAM-3.0.0"
setenv  WM_PROJECT_INST_DIR "/opt/openfoam/3.0.0"
setenv  WM_PROJECT "OpenFOAM"
setenv  WM_PROJECT_USER_DIR "$home/OpenFOAM/$user-3.0.0"
setenv  WM_PROJECT_VERSION "3.0.0"
setenv  WM_THIRD_PARTY_DIR "/opt/openfoam/3.0.0/ThirdParty-3.0.0"

install cfMesh

wget http://sourceforge.net/projects/cfmesh/files/v1.1.1/cfMesh-v1.1.1.tgz/download
mv download cfMesh-v1.1.1.tgz
tar -xzvf cfMesh-v1.1.1.tgz
cd cfMesh-v1.1.1
find . -name files -exec sed -i ’s/_USER//’ {} +
module load openfoam/3.0.0
./Allwmake

2 reaktion på “Build OpenFOAM 3.0.0 on CentOS 6.6

Lämna ett svar

Din e-postadress kommer inte publiceras. Obligatoriska fält är märkta *