OpenSUSE 12.1 has just been released, and it carries gcc 4.6, and, for those interested clang/LLVM. Installing OpenFOAM® 2.0.x follows the usual pattern. Only a few minor modifications have to be made to be able to use gcc 4.6 and the version of openMPI provided by openSUSE 12.1 (openmpi-1.4.3). Additionally I replaced paraview 3.10.1 with ParaView 3.12.0.
Assuming that OpenFOAM will be installed in the user’s home directory, the procedure to install OpenFOAM 2.0.x (git version) on openSUSE 12.1 is then as follows:
- Install the C/C++ development pattern:
-
zypper install -t pattern devel_C_C++
- Install other dependencies:
-
zypper install cmake libqt4-devel gnuplot openmpi openmpi-devel
- Check that openmpi 1.4.3 is selected as default with:
-
mpi-selector --list
- The output should read: “openmpi-1.4.3”. 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.0.x.git
- Download the ThirdParty package from here(command on a single line) :
- wget -c http://downloads.sourceforge.net/foam/ThirdParty-2.0.1.gtgz?use_mirror=mesh -O ThirdParty-2.0.1.gtgz
- Extract the ThirdParty package and rename it as follows:
-
tar xzf ThirdParty-2.0.1.gtgz
-
mv ThirdParty-2.0.1 ThirdParty-2.0.x
- Add this prefs.sh file to the directory:
-
~/OpenFOAM/OpenFOAM-2.0.x/etc/
- Move to ~/OpenFOAM/ThirdParty-2.0.x/
-
cd ~/OpenFOAM/ThirdParty-2.0.x/
- Remove the directory ParaView-3.10.1
-
rm -rf ParaView-3.10.1
- Download ParaView 3.12.0 source code from here and save it into the directory ~/OpenFOAM/ThirdParty-2.0.x/
- Extract ParaView 3.12.0:
- tar xzf ParaView-3.12.0.tar.gz
- Replace the file ~/OpenFOAM/OpenFOAM-2.0.x/etc/config/paraview.sh with this one in order to set the correct version of ParaView.
- Add the following line to your ~/.bashrc file:
- [Optional for multi-core compilation]: export WM_NCOMPPROCS=4
-
source $HOME/OpenFOAM/OpenFOAM-2.0.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.0.x
-
./Allwmake
- To build paraview and its reader:
-
cd ~/OpenFOAM/ThirdParty-2.0.x
-
./makeParaView
-
cd $FOAM_UTILITIES/postProcessing/graphics/PV3Readers/
-
./Allwclean
-
./Allwmake
- At this point OpenFOAM 2.0.x should be fully functional on your openSUSE 12.1. The installation can be updated, as usual, with:
-
cd ~/OpenFOAM/OpenFOAM-2.0.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.
5 Comments
Pei-Ying Hsieh
Thanks a lot Alberto!
preferjune
Thx so much, i do this and it work
Mohsen
Very useful, Thanks
yanxiang
OpenFOAM 2.1.0 is out. Could you please update that as well? Thanks 🙂
Alberto
Hi Yan,
the procedure is very similar: skip the instructions for ParaView, since the ThirdParty package provided with OpenFOAM 2.1.x already contains ParaView 3.12. The rest is unchanged. I will post an updated tutorial soon.