CFD,  OpenFOAM

OpenFOAM 2.0.x and openSUSE 11.4

OpenCFD® released OpenFOAM® 2.0.0, which brings many developments and improvements. In parallel to the release of OpenFOAM 2.0.0, the git repository was updated to 2.0.x. Usually I write a detailed procedure to explain the installation of OpenFOAM on openSUSE, however with OpenFOAM 2.0.0 this is not necessary anymore. Only a few minor operations have to be made to be able to use gcc 4.5 and the version of openMPI provided by openSUSE 11.4 (openmpi-1.2.8).

Assuming that OpenFOAM will be installed in the user’s home directory, the procedure to install OpenFOAM 2.0.x (git version) on openSUSE 11.4 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.2.8 is selected as default with:
    • mpi-selector --list
    • The output should read: “openmpi-1.2.8”. 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/
  • 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 11.4. 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 🙂

P.S. Thanks Bruno for the suggestion on multi-core compilation!

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.

60 Comments

    • Alberto

      Yes, of course! GeekoCFD will be updated, and you will see an announcement when ready. I was thinking of waiting a couple of weeks, so to have a little more time to let post-release bugs be cleaned up.

      It seems I’ll have to drop enGrid however, since it was not packaged for openSUSE 11.4, and it is a bit messy to do.

        • Alberto

          enGrid was not added because they do not provide a package for openSUSE 11.4 in their repository (they have a version for openSUSE 11.3). At the moment I am not doing packaging to build GeekoCFD, as a consequence, if a package does not provide an RPM and does not provide a binary (OF excluded), it won’t be part of GeekoCFD.

    • Alberto

      I would suggest to use the version of openMPI provided with openSUSE, even if it is older, and to set the preferences with the script I provided.

  • Bruno Santos

    Hi Alberto,

    Well, since a certain bug/feature report of mine is yet to be accepted (http://www.openfoam.com/mantisbt/view.php?id=211), I think it would be nice you would add to your instructions the multi-core option… something like this:
    # cd ~/OpenFOAM/OpenFOAM-2.0.x
    # export WM_NCOMPROCS=8
    # ./Allwmake

    Where 8 is the number of cores one’s machine has. Ditto for before the “git pull”… Otherwise, 3 to 8 hours of build time can get a bit unbearable…

    Best regards,
    Bruno

  • Tobias

    Hey Alberto,

    thank you for this tutorial, but I have some problems.
    If I want to start blockMesh, paraView… after the installation, I get “If ‘blockMesh’ is not a typo you can use command-not-found to lookup the package that contains it, like this: cnf blockMesh”.
    Do you have an idea of my mistake during the installation?
    I tried your tutorial for OpenFOAM 1.7.1 and this worked three months ago.

    Best regards,

    Tobias

    • Alberto

      Hi Tobias,

      usually that happens if you did not source the OpenFOAM-2.0.x/etc/bashrc file properly. I would suggest you to check that your installation path is typed correctly in your ~/.bashrc file. Sometimes a different capitalization might be the reason.

      I hope this helps,

      Alberto

  • Homer

    Hi Alberto,

    I had a fresh openSUSE 11.4 installation and tried to use your How-to. Unfortunately i got problems (see http://www.cfd-online.com/Forums/openfoam-installation/89657-openfoam-2-0-0-installation-3.html#post317409 ).
    I had to install openmpi-devel. Maybe it is necessary to mention that in your installation advice.

    In addition I have a question:
    Why don’t you describe the installation of paraView? Trying to compile the PV3Readers without paraView delivered – at least for me – errors. After the compilation of paraView 3.10.1 it worked.

    Kind regards and thank you for this good homepage. It helped me more than once.
    Homer

    • Alberto

      Yes, sorry, I added openmpi-devel to the guide.

      Paraview is compiled with a simple ./makeParaView in the ThirdParty directory, and yes, it is required to build the reader successfully, but not to compile OpenFOAM itself.

  • Bruno Santos

    Hi Alberto,

    The following post should contain some information that might be useful to all: href=”http://www.cfd-online.com/Forums/openfoam-installation/89657-openfoam-2-0-0-installation-3.html#post317607″>Post #56 at “OpenFoam 2.0.0 installation”

    To sum up:
    * it’s easier to use “mpi-selector-menu”, since it’s more interactive 😉
    * it’s necessary to logout and log back in for the selection to take effect.
    * the package “openmpi-devel” is also necessary.

    Best regards,
    Bruno

  • mkae

    You should update the top of this page concerning the installation of openmpi-devel. 🙂

    I only noticed after 2hrs of building on one core that there was something wrong. Constantly there were errors thrown by ld due to missing objects… I wondered why the build process wasn’t stopped immediately. Then I would have known at an earlier time that something is going wrong…

  • mkae

    $FOAM_UTILITIES isn’t explained above. One would have to search around to be able to identify it as

    FOAM_UTILITIES = ~/OpenFOAM/OpenFOAM-2.0.x/applications/utilities

    which, I hope is correct…

    (There is a typo in the paraview build description as well: “Thidparty” instead of “Thirdparty”.)

    • Alberto

      The reference to FOAM_UTILITIES is not required. You only need

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

      in your ~/.bashrc.

      Thanks for pointing out the typo! 🙂

  • mkae

    ThirdParty contains openmpi 1.5.3!

    Can OpenFOAM also use that version of openmpi instead of the one supplied by OpenSUSE, which is the (possibly much older) 1.2.8?

    Hmm… Does paraview or anything else actually make use of the 1.5.3?

    • Alberto

      If you want, yes. Just comment out the corresponding setting in prefs.sh, and by default the build process will attempt to build the ThirdParty version of openmpi. However, I prefer to use the system library not to have too many duplicates around and to have them updated in case of security problems directly from the distribution vendor.

  • mkae

    I eventually built everything successfully.

    Unfortunately paraview crashes when I follow the cavity tutorial when I try to rescale the colors for p with tons of X error messages like these:

    X Error: GLXBadContextTag 173
    Extension: 154 (Uknown extension)
    Minor opcode: 1 (Unknown request)
    Resource id: 0x9a0005

    This stops paraview in midflight. One has to kill it from the console.

    It looks like I missed a computational step in my tutorial walk-through, since the range of p was from 0 to 0. :-/

    Still, the app shouldn’t crash, right?!

    I saw you made the changes on this page. Great! (In the meantime I’ve learned that the env variable is being defined by OpenFOAM’s bashrc.)

    • Alberto

      This on openSUSE 11.4? If you send me an e-mail (see Contacts page), I can provide you the pre-built 64-bit binaries I use for GeekoCFD. They are fully updated with the last git at the moment.

  • mkae

    I did as you said, downloaded your GeekoCFD ISO image, installed and ran it on my Parallels. The results stays the same. I see tons of the above X error popping up and paraview halts. 🙁

    Hmm, perhaps it’s caused by my Parallels virtual machine?!

    But, we also saw crashes on a real laptop with an Ubuntu image downloaded from OpenFOAM’s website. I thought that the 3D graphics card/driver of the a few years old laptop might be the cause, since it took down GNOME completely, including mouse and keyboard without leaving us a chance even to switch back to a text console. Only remote login was possible.

    That’s why I wanted to build OpenFOAM according to your instruction here on a fresh OpenSUSE 11.4 installation on said laptop, but had to stop half-way due to the weekend…

    Now I played with it at home on my Parallels virtual Linuxes. My tries on OpenSUSE 11.4 were not successful and now I see that even your GeekoCFD isn’t doing any better. I wonder whether it makes sense to build the whole stuff once again in another 11.3? (I skip that for now.) :-/

    So, it seems to be something much deeper. Parallels?

    The only hope I’ve left now is, that OpenSUSE 11.4 on said laptop will allow to install OpenFOAM following your instructions here…

    • Alberto

      If you want to try openSUSE 11.3 (I don’t think it will change much), you can download the previous version of GeekoCFD, which has OpenFOAM 1.7.x. If that works, you can build OpenFOAM 2.0.x on it.

    • Alberto

      It is possible that OpenSUSE does not have the drivers for your virtual machine. GeekoCFD and openSUSE surely have graphical drivers for VirtualBox and VMWare, but I am not sure if there are players for these virtual machines on your platform (mac).

  • mkae

    glxinfo says that the software mesa driver is in action.
    glxgears works fine and shows 700fps. 🙂

    Alberto, did you actually test-install your GeekoCFD ISO image after building it in the Studio and check out paraView according the cavity tutorial example?

    • Alberto

      Yes, I tested the images in SUSE Studio with testdrive, and my test-case includes:

      – Running blockMesh, icoFoam, paraFoam on the cavity tutorial
      – Visualize contour plots of U
      – Test pyFoamPlotRunner
      – Running all the applications I added to the default installation

      I cannot reproduce the crash you observe in paraview on my hardware or in SUSE Studio virtual test. 🙁

  • mkae

    In the meantime I understood that this is a X driver issue due to non-installed “Parallel Tools” on the VMs in question.

    I would have to upgrade from version 5 to 6 in order to be able to build the necessary kernel modules inside the VM.

    So, my hope is that the X driver on OpenSUSE 11.4 will allow for our rather old Laptop paraview to be run without crashing.

    Which functionality exactly must the X driver offer? How can I find out (before I compile openfoam’s sources for many hours) whether the X driver present on said Laptop offers what one would need?

    glx_info is certainly my friend, but which parameters would have to be enabled?

  • mkae

    Having tried to get OpenFOAM installed on a real Linux 11.4 machine I finally had to realize that the error messages I saw on the Parallels VMs also appeared there! Even when I used your Geeko-DVD!!

    I turned out, after all, that the culprit seems to be that such an install would also use the MESA driver and not the hardware driver. Perhaps you should mention this in your little HOWTO right at the beginning! (Would save some frustration to an inexperienced user).

    • Alberto

      This is not correct. The installation of openSUSE, as well as the one of GeekoCFD, will detect the appropriate driver for your video card, and use it. If you have an ATI or nVidia video cards, you have to install the appropriate commercial driver, as suggested on the openSUSE wiki.

      The tutorial does not need to be changed as a consequence of this. A minimum knowledge of the Linux operating system is assumed.

  • mkae

    Haha, I just realize that your CMS changes two minuses “- -” without the space into a long minus. This causes that a direct copy of the mpi-selector command from the web page into a terminal must fail.

  • mkae

    And I see now, that on top of the mpicc errors there are also other make errors just at the beginning of the make:

    make: *** [Make/linuxGcc45DPOptSYSTEMOPENMPI/UIPread.o] Fehler 1
    UPstream.C:26:17: fatal error: mpi.h: Datei oder Verzeichnis nicht gefunden

    File not found for mpi.h!!! That’s really odd, isn’t it?

    I really don’t know what’s going wrong here, since it all worked fine on my private machine. 🙁

  • mkae

    I uninstalled openmpi 1.3.2 (originating from the science repo) and installed the one included in the distro (1.2.8), but it still wouldn’t be possible to run mpicc…

    Finally I just appended the path to mpicc to the env var PATH in my .bashrc. This eventually made compiling possible!

    I have built OpenFOAM now on two different OpenSUSE 11.4 installs from scratch: strange that one worked out of the box and the other one had trouble finding the path to mpicc.

    • mkae

      It turns out that the laptop is crashing in paraFoam when trying to edit a slice view. Looks like a graphics card issue with the Intel legacy driver. 🙁
      We can forget about using the DualCore-laptop and will try again on a older P4-PC…

    • Alberto

      You should be able to find the correct mpicc after using mpi-selector (and logging in again). Are the two systems up to date (all online updates installed)?

  • mkae

    The current status is here that we got it running under OS11.4 on the old P4 as well as on a rather recent DualCore Asus laptop.

  • Carlos

    Hello!

    I had some problems running openFoam with the recommended version (the simulation freezes at the first iteration running in parallel with more than 8 processors). I have changed the openmpi version of openSuse 11.3 back to 1.2.8 and now it works perfectly.

    Why in http://www.openfoam.com/download/suse.php the say “The OpenFOAM binaries will not work with the default 1.2.8 version of openmpi.”?

    Thanks

    OS: openSUSE 11.3

      • Carlos

        But… did you used openmpi 1.3.2 on your workstation?

        Just to be clear openmpi 1.2.8 is not suggested on the official openfoam website. And since I recently solved my mpi problems changing from 1.3.2 (officially recomended) to 1.2.8, is good to know that there’s no additional problems with openmpi 1.3.2