CFD,  Linux,  OpenFOAM,  openSUSE

Install OpenFOAM 2.0.x on openSUSE 12.1

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:

  1. Install the C/C++ development pattern:
    • zypper install -t pattern devel_C_C++
  2. Install other dependencies:
    • zypper install cmake libqt4-devel gnuplot openmpi openmpi-devel
  3. 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)
  4. Create the OpenFOAM directory in your home directory:
    • mkdir ~/OpenFOAM
  5. Move to the OpenFOAM directory:
    • cd ~/OpenFOAM
  6. Download the source code from the git repository:
    • git clone http://github.com/OpenFOAM/OpenFOAM-2.0.x.git
  7. 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
  8. 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
  9. Add this  prefs.sh file to the directory:
    • ~/OpenFOAM/OpenFOAM-2.0.x/etc/
  10. Move to ~/OpenFOAM/ThirdParty-2.0.x/
    • cd ~/OpenFOAM/ThirdParty-2.0.x/
  11. Remove the directory ParaView-3.10.1
    • rm -rf ParaView-3.10.1
  12. Download ParaView 3.12.0 source code from here and save it into the directory ~/OpenFOAM/ThirdParty-2.0.x/
  13. Extract ParaView 3.12.0:
    • tar xzf ParaView-3.12.0.tar.gz
  14. Replace the file ~/OpenFOAM/OpenFOAM-2.0.x/etc/config/paraview.sh with this one in order to set the correct version of ParaView.
  15. 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
  16. 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
  17. To build paraview and its reader:
    • cd ~/OpenFOAM/ThirdParty-2.0.x
    • ./makeParaView
    • cd $FOAM_UTILITIES/postProcessing/graphics/PV3Readers/
    • ./Allwclean
    • ./Allwmake
  18. 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