The following procedure illustrates how to install OpenFOAM 2.2.x from the git repository on openSUSE 12.3, for the current users.
- Install the C/C++ development pattern:
-
zypper install -t pattern devel_C_C++
-
- Install other dependencies (gnuplot is optional, but useful):
-
zypper install cmake gnuplot openmpi openmpi-devel git-core
-
zypper install libqt4-devel libQtWebKit-devel libQtAssistantClient4
-
- Check that openmpi 1.6 is selected as default with:
-
mpi-selector --list
- The output should read: “openmpi-1.6”. If not, use mpi-selector to configure the default version of openmpi (this can be done for the individual user or system-wide, acquiring administrative rights)
-
- Create the OpenFOAM directory in your home directory:
-
mkdir ~/OpenFOAM
-
- Move to the OpenFOAM directory:
-
cd ~/OpenFOAM
-
- Download the source code from the git repository:
-
git clone http://github.com/OpenFOAM/OpenFOAM-2.2.x.git
-
- Download the ThirdParty package from here (command on a single line) :
- wget -c downloads.sourceforge.net/foam/ThirdParty-2.2.0.tgz?use_mirror=mesh -O ThirdParty-2.2.0.gtgz
- Extract the ThirdParty package and rename it as follows:
-
tar xzf ThirdParty-2.2.0.gtgz
-
mv ThirdParty-2.2.0 ThirdParty-2.2.x
-
- Add this prefs.sh file to the directory:
-
~/OpenFOAM/OpenFOAM-2.2.x/etc/
-
- Add the following line to your ~/.bashrc file:
- [Optional for multi-core compilation, replace 4 with the number of cores you want to use]: export WM_NCOMPPROCS=4
-
source $HOME/OpenFOAM/OpenFOAM-2.2.x/etc/bashrc
- Open a new terminal and execute this sequence of commands to compile the whole OpenFOAM suite
-
source ~/.bashrc
-
cd ~/OpenFOAM/OpenFOAM-2.2.x
-
./Allwmake
-
- To build paraview and its reader:
-
cd ~/OpenFOAM/ThirdParty-2.2.x
-
./makeParaView
-
cd $FOAM_UTILITIES/postProcessing/graphics/PV3Readers/
-
./Allwclean
-
./Allwmake
-
- At this point OpenFOAM 2.2.x should be fully functional on your openSUSE 12.3. The installation can be updated, as usual, with:
-
cd ~/OpenFOAM/OpenFOAM-2.2.x
-
git pull
-
wcleanLnIncludeAll
-
./Allwmake
-
Note: If you have an accelerated video card, like nVidia or ATI, it is strongly recommended to install the corresponding proprietary driver.
Enjoy 🙂
This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM® and OpenCFD® trade marks. Alberto Passalacqua is not associated to OpenCFD Ltd.
2 Comments
Berns Buenaobra
First is that I want to thank you for these very clear and lucid instructions. It was entirely flawless from start to finish. After I made a decision to dual boot to use Linux OpenSUSE for my work a the university on CFD this was a crucial step for me. Now, I wish to be able to couple DEM with CFD hopefully with LIGGGHTS and CFD DEM on OpenSUSE.
Berns Buenaobra
I have quite a difficulty of having the new LIGGGHTS-PUBLIC compile and work with OpenFOAM to couple that with it. May I request some write up or tip, tutorial on how to make this work? LIGGGHTS is by the way from also an open source initiative that originated from the LAMMPS program/code from Sandia NL. Thanks.