albertopassalacqua.com

Alberto Passalacqua

OpenFOAM 2.0.x and openSUSE 11.4

Posted on | June 17, 2011 | 60 Comments

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.

Comments

60 Responses to “OpenFOAM 2.0.x and openSUSE 11.4”

  1. Peter J Francis
    June 17th, 2011 @ 3:47 pm

    Will you be updating your GeekoCFD appliance ?

    Regards

  2. Laurence McGlashan
    June 17th, 2011 @ 4:49 pm

    Nice, don’t forget wget for DL’ing (it’s my favourite linux utility):

    wget http://downloads.sourceforge.net/foam/ThirdParty-2.0.0.gtgz?use_mirror=mesh

    The DEM stuff is really cool, it makes some excellent animations. It’s also nice that chemFoam is now available: Yet another tool for us to validate our chemistry models with.

  3. Alberto
    June 17th, 2011 @ 5:47 pm

    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.

  4. Alberto
    June 17th, 2011 @ 5:47 pm

    Thank you for the suggestion! I updates the page.

  5. Bruno Santos
    June 19th, 2011 @ 8:13 pm

    Hi Alberto,

    About “wget”, I advise you to use the following line:
    wget -c http://downloads.sourceforge.net/foam/ThirdParty-2.0.0.gtgz?use_mirror=mesh -O ThirdParty-2.0.0.gtgz

    This is because wget sometimes gets names wrong and outputs the file as “ThirdParty-2.0.0.gtgz?use_mirror=mesh”.

    Best regards,
    Bruno

  6. Alberto
    June 19th, 2011 @ 8:35 pm

    Thank you! I updated the page.

  7. Robert
    June 24th, 2011 @ 9:11 pm

    Hello Alberto,

    could you please give me a hand with my compilation? I have seen your previous entries on 1.7.1 compilation and it all worked smoothly for me. However, I cannot seem to be able to compile the 2.0 version on the same machine. I posted it OpenFOAM forum.

    http://www.cfd-online.com/Forums/openfoam/89890-openfoam-2-0-opensuse-11-4-a.html

    I would be very grateful for any comments.

    Robert

  8. Alberto
    June 25th, 2011 @ 12:07 am

    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.

  9. Bruno Santos
    July 21st, 2011 @ 10:36 pm

    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

  10. Bruno Santos
    July 21st, 2011 @ 10:37 pm

    Arg… these comments should have a preview option…
    Typo: it isn’t WM_NCOMPROCS, it’s WM_NCOMPPROCS

  11. Alberto
    July 22nd, 2011 @ 4:28 am

    Thanks for your comment. I added it. :-)

  12. Tobias
    July 22nd, 2011 @ 8:11 pm

    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

  13. Alberto
    July 23rd, 2011 @ 3:28 am

    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

  14. Tobias
    July 23rd, 2011 @ 6:08 pm

    Hi Alberto,

    thank you for your reply. But it doesn’t work.
    So I tried this: http://www.openfoam.com/download/git.php
    Now I got it, I don’t know where my mistake with your tutorial was.

    Best regards,

    Tobias

  15. Bruno Santos
    July 25th, 2011 @ 12:50 pm

    Hi Alberto,

    enGrid 1.3 is in the “forge” right now and installation/building instructions are already available: http://engits.eu/wiki/index.php/Installation

    So don’t forget to add it to your next release of GeckoCFD ;)

    Best regards,
    Bruno

  16. Homer
    July 27th, 2011 @ 10:26 am

    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

  17. Bruno Santos
    July 27th, 2011 @ 10:30 am

    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

  18. Alberto
    July 27th, 2011 @ 4:53 pm

    Thanks :-)

  19. Alberto
    July 27th, 2011 @ 5:11 pm

    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.

  20. Alberto
    July 27th, 2011 @ 5:12 pm

    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.

  21. mkae
    August 6th, 2011 @ 12:57 am

    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…

  22. mkae
    August 6th, 2011 @ 1:42 am

    $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”.)

  23. mkae
    August 6th, 2011 @ 1:56 am

    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?

  24. Alberto
    August 6th, 2011 @ 2:05 am

    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.

  25. Alberto
    August 6th, 2011 @ 2:08 am

    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! :-)

  26. Alberto
    August 6th, 2011 @ 2:09 am

    This was supposed to be corrected already, but it seems my CMS did not save the changes :-( It should be fine now. Thanks.

  27. mkae
    August 6th, 2011 @ 8:25 am

    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.)

  28. mkae
    August 6th, 2011 @ 8:26 am

    I forgot to mention that I am running an OpenSUSE 11.4 in a Parallels virtual machine.

  29. Alberto
    August 6th, 2011 @ 8:27 am

    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.

  30. Alberto
    August 6th, 2011 @ 8:30 am

    Why don’t you simply download GeekoCFD then? :-)

    Take a look: http://susegallery.com/a/2qtLK2/geekocfd You will need a SUSE Studio account, but it is free, and you can use many OpenID providers.

  31. mkae
    August 6th, 2011 @ 11:39 am

    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…

  32. mkae
    August 6th, 2011 @ 12:39 pm

    Google told me that the non-OpenGL-supporting X driver is the culprit here:

    http://www.openfoam.com/mantisbt/view.php?id=21

    http://paraview.org/Bug/view.php?id=12089

    I just wonder how your GeekoCFD-Build could possibly be equipped with a graphics driver which doesn’t support OpenGL?

  33. mkae
    August 6th, 2011 @ 12:49 pm

    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?

  34. Alberto
    August 6th, 2011 @ 9:32 pm

    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. :-(

  35. Alberto
    August 6th, 2011 @ 9:34 pm

    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).

  36. Alberto
    August 6th, 2011 @ 9:51 pm

    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.

  37. mkae
    August 7th, 2011 @ 11:08 am

    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?

  38. mkae
    August 9th, 2011 @ 4:22 pm

    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).

  39. mkae
    August 9th, 2011 @ 6:28 pm

    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.

  40. mkae
    August 9th, 2011 @ 6:31 pm

    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. :-(

  41. Alberto
    August 10th, 2011 @ 7:20 am

    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.

  42. Alberto
    August 10th, 2011 @ 7:24 am

    PStream related errors are due to the failure of compiling or finding mpi.

  43. Alberto
    August 10th, 2011 @ 7:26 am

    Fixed. Thanks for pointing this out.

    P.S. I remove the comments on mpi-selector since you found the solution.

  44. mkae
    August 10th, 2011 @ 10:26 am

    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.

  45. mkae
    August 10th, 2011 @ 10:30 am

    Well, since the application is actually crashing I do think that a hint to install the proprietary driver would be good. :-)

    Anyway, thanks for your immediate responses, Alberto. Great that you’ve put together this guidelines.

  46. mkae
    August 10th, 2011 @ 11:21 am

    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…

  47. Alberto
    August 10th, 2011 @ 10:22 pm

    You might want to look for an updated driver. What video card is that?

  48. Alberto
    August 10th, 2011 @ 10:22 pm

    I will add a note.

  49. Alberto
    August 10th, 2011 @ 10:24 pm

    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)?

  50. mkae
    August 20th, 2011 @ 3:00 pm

    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.

  51. Alessandro Viganò
    September 14th, 2011 @ 12:07 pm

    Hi Alberto,
    I suggest to you to change the link
    git clone http://github.com/OpenCFD/OpenFOAM-2.0.x.git
    to
    git clone http://github.com/OpenCFOAM/OpenFOAM-2.0.x.git

    to obtain a correct download of source files (in my case your link don’t work)

    and here you can find last version of ThirdPart

    http://downloads.sourceforge.net/foam/ThirdParty-2.0.1.gtgz?use_mirror=mesh

  52. Alessandro Viganò
    September 14th, 2011 @ 12:08 pm
  53. Alberto
    September 14th, 2011 @ 9:32 pm

    Thanks, I updated it to be consistent with the new repository :-)

  54. Bruno Santos
    October 3rd, 2011 @ 5:06 pm

    Interesting typo:
    git clone git clone http://github.com/OpenFOAM/OpenFOAM-2.0.x.git
    «Clone me once, works. Clone me twice, doesn’t work.» ;)

  55. Alberto
    October 3rd, 2011 @ 5:10 pm

    LOL. Thanks :-)

  56. Carlos
    December 22nd, 2011 @ 5:25 pm

    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

  57. Alberto
    December 22nd, 2011 @ 6:42 pm

    I did not encounter this problem on my workstation. I am not sure why openmpi 1.2.8 is suggested on the web-page you linked.

  58. Carlos
    December 22nd, 2011 @ 7:20 pm

    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

  59. Alberto
    December 22nd, 2011 @ 7:37 pm

    Thanks for the clarification, and sorry for my misunderstanding.

  60. Chris
    March 23rd, 2012 @ 9:40 pm

    All of this also works for OpenSuse 11.3 !

    Thanks for the walkthrough!

  • openSUSE counter

  • Spread Firefox

    Spread Firefox Affiliate Button
  • Thunderbird

    Spread Firefox Affiliate Button
  • License