Alberto Passalacqua

Installing OpenFOAM 2.1.x on openSUSE 12.1

Posted on | December 22, 2011 | 9 Comments

OpenFOAM® 2.1.x has just been released, and brings an interesting number of new functions concerning arbitrary mesh interface (AMI), multiphase solvers, turbulence modeling, improved run-time control and new numerical methods.

Assuming that OpenFOAM will be installed in the user’s home directory, the procedure to install OpenFOAM 2.1.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 (gnuplot is optional, but useful):
    • zypper install cmake libqt4-devel gnuplot openmpi openmpi-devel git-core
  3. Make sure git is installed
    • zypper install git-core
  4. 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)
  5. Create the OpenFOAM directory in your home directory:
    • mkdir ~/OpenFOAM
  6. Move to the OpenFOAM directory:
    • cd ~/OpenFOAM
  7. Download the source code from the git repository:
    • git clone
  8. Download the ThirdParty package from here (command on a single line) :
    • wget -c -O ThirdParty-2.1.0.gtgz
  9. Extract the ThirdParty package and rename it as follows:
    • tar xzf ThirdParty-2.1.0.gtgz
    • mv ThirdParty-2.1.0 ThirdParty-2.1.x
  10. Add this file to the directory:
    • ~/OpenFOAM/OpenFOAM-2.1.x/etc/
  11. 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.1.x/etc/bashrc
  12. Open a new terminal and execute this sequence of commands to compile the whole OpenFOAM suite
    • source ~/.bashrc
    • cd ~/OpenFOAM/OpenFOAM-2.1.x
    • ./Allwmake
  13. To build paraview and its reader:
    • cd ~/OpenFOAM/ThirdParty-2.1.x
    • ./makeParaView
    • cd $FOAM_UTILITIES/postProcessing/graphics/PV3Readers/
    • ./Allwclean
    • ./Allwmake
  14. At this point OpenFOAM 2.1.x should be fully functional on your openSUSE 12.1. The installation can be updated, as usual, with:
    • cd ~/OpenFOAM/OpenFOAM-2.1.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.


9 Responses to “Installing OpenFOAM 2.1.x on openSUSE 12.1”

  1. JonW
    March 6th, 2012 @ 5:03 pm

    Just grate, thanks, works like a charm :)

    I have just installed openSUSE 12.1 64 bit and OpenFOAM 2.1.x according to your instructions. Everything works great.
    A minor point, There is a misspell in step 8 (in the wget thingi). ThirdParty-2.0.1.gtgz should be replaced with ThirdParty-2.1.0.gtgz

  2. Alberto
    March 9th, 2012 @ 11:54 am

    Thanks! I corrected the link :-)

  3. uli
    June 5th, 2012 @ 9:07 am

    thanks a lot!

    how to uninstall it again? :)

  4. ahmad
    June 5th, 2012 @ 11:28 am

    how i can install multi OF?
    i want install openfoam 1.6-ext and 2.1.0 on my laptop

  5. Alberto
    June 8th, 2012 @ 5:41 am

    Hi, you can install various versions of OpenFOAM in the OpenFOAM directory, and then use foamJob with the -version option to run the specific version.

    If this was not supported in 1.6, you can create two scripts to source the appropriate bashrc file to configure the environment.

  6. Alberto
    June 8th, 2012 @ 5:41 am

    You can unintall OpenFOAM by simply deleting its directory :-)

  7. manu
    July 9th, 2012 @ 3:41 pm

    Thank you very much for this tutorial, it was quite useful!

  8. Anica
    July 11th, 2012 @ 12:11 pm


    I tried to install OpenFOAM-2.1.x on openSUSE 12.1 64 bit. I followed your instructions but I get a lot of error messages, like:
    make[2]: mpicc: Command not found
    make[2]: *** [dummysizes] Error 127
    make[2]: Leaving directory `/home/linux/OpenFOAM/ThirdParty-2.1.x/scotch_5.1.11/src/libscotch’
    make[1]: *** [ptscotch] Error 2
    make[1]: Leaving directory `/home/linux/OpenFOAM/ThirdParty-2.1.x/scotch_5.1.11/src/libscotch’
    make: *** [ptscotch] Error 2

    and later on:

    fatal error: mpi.h: No such file or directory


    collect2: ld returned 1 exit status
    make[3]: *** [/home/linux/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64Gcc46DPOpt/bin/autoRefineMesh] Error 1
    make[3]: Leaving directory `/home/linux/OpenFOAM/OpenFOAM-2.1.x/applications/utilities/mesh/advanced/autoRefineMesh’
    make[2]: *** [autoRefineMesh] Error 2

    Could you please help me to resolve these problems?

    Best regards,


  9. Alberto
    July 11th, 2012 @ 4:13 pm

    You have to install the openmpi package in YaST.

  • openSUSE counter

  • Spread Firefox

    Spread Firefox Affiliate Button
  • Thunderbird

    Spread Firefox Affiliate Button
  • License