Installing OpenFOAM on Slackware Linux

From Akionux-wiki
Share/Save/Bookmark
Jump to: navigation, search

Abstract

Build and install OpenFOAM-2.3.x on Slackware Linux 14.1 with the supports of parallel processing.

Dependencies for MPI

Install dependencies from from slackbuilds

system/openmpi
libraries/CGAL
libraries/scotch

There is not libraries/scotch on official slackbuilds repository. You can use libraries/scotch on my repository.

Build and Install

Installing OpenFOAM

Create ~/OpenFOAM directory, then git clone:

mkdir ~/OpenFOAM
cd ~/OpenFOAM
git clone https://github.com/OpenFOAM/OpenFOAM-2.3.x.git

To use OpenMPI installed on system, set WM_MPLIB as SYSTEMOPENMPI in $WM_PROJECT_DIR/etc/bashrc.

vim $WM_PROJECT_DIR/etc/bashrc
#- MPI implementation:
#    WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI
#               | GAMMA | MPI | QSMPI | SGIMPI
export WM_MPLIB=SYSTEMOPENMPI

Read $WM_PROJECT_DIR/etc/bashrc.

cd $WM_PROJECT_DIR
source etc/bashrc

If you got following error:

Cannot open configuration file /home/user/OpenFOAM/ThirdParty-2.3.x/platforms/linux64Gcc/openmpi-1.6.5/share/openmpi/mpicc-wrapper-data.txt
Error parsing data file mpicc: Not found

maybe OPAL_PREFIX need to be unset:

unset OPAL_PREFIX

$WM_PROJECT_DIR/etc/bashrc

Start building:

./Allwmake > make.log 2>&1

Append following line to .bashrc:

source $HOME/OpenFOAM/OpenFOAM-2.3.x/etc/bashrc

Installing ThirdParty

Git clone ThirdParty-2.3.x:

cd $WM_PROJECT_DIR
git clone https://github.com/akionux/ThirdParty-2.3.x.git

Qt(4.8.5 4.8.x), gcc(4.8.2 >= 4.5.0) and cmake(2.8.12 > 2.8.8) on Slackware Linux 14.1 are supported. Thus you need to install just ParaView.

Build ParaView with Python and MPI support[1][2].

cd $WM_THIRD_PARTY_DIR
wget http://www.paraview.org/files/v4.1/ParaView-v4.1.0-source.tar.gz
tar zxvf ParaView-v4.1.0-source.tar.gz
mv ParaView-v4.1.0 ParaView-4.1.0
LDFLAGS='-ldl' ./makeParaView4 -mpi -python -python-lib /usr/lib64/libpython2.7.so.1.0 > makeParaView4.log 2>&1

Reload environment variables and build PV4Readers:

source ~/.bashrc
cd $FOAM_UTILITIES/postProcessing/graphics/PV4Readers
./Allwclean
./Allwmake

Finally, check the installation.

cd $WM_PROJECT_DIR
./bin/foamInstallationTest

References

  1. PENGUINITIS - OpenFOAM のインストール http://www.geocities.jp/penguinitis2002/study/OpenFOAM/install_memo/install_memo.html
  2. [Paraview] Configuring ParaView with OpenMPI http://public.kitware.com/pipermail/paraview/2008-April/007751.html