CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Bugs (
-   -   OpenFOAM 15 and CentOS 52 installation issues (

remrich November 6, 2008 08:46

I had to install OpenFOAM 1.5
I had to install OpenFOAM 1.5 on CentOS 5.2. x86_64.

I like to share my experiences and address some issues.

1.) First of all the supplied gcc-4.3.1 doesn't work because it's dependency to a shared libmpfr.
Please build gcc against static versions of gmp and mpfr. So I had to built my own gcc-4.3.1.

2.) Building Qt 4.3.5 from sources was easy. I decided to install into the gcc-4.3.1 directory so you don't need an additional PATH and LD_LIBRARY_PATH entry. Configure options are ./configure -prefix $WM_COMPILER_DIR -prefix-install

3.) Building Paraview and PVFoamReader.
Here the nightmare began.
To cut a long story short, the root cause of my problems is the way the cmake build system is configured.
The libraries and executables are linked with /usr/lib64 in the rpath. This is anoying and completly wrong! This prevents LD_LIBRARY_PATH to have any effect, because the system library path is searched first! So don't ever do this!
Because I don't know anything about the cmake build system I had to edit the build.make, link.txt and relink.txt scripts by hand after cmake execution.
Afterwards executing make and "make install" gave me a working Paraview.
For the PVFoamReader it's the same. Here i took a manual linking step for the two executables.

So now I have a working OpenFOAM 1.5 installation.
Dear Developers, please change the cmake build according to my suggestions. This will make building OpenFOAM from source easy on nearly every Linux distribution!

If someone prefer to have Qt installed seperatly from the gcc installation that's also easy. You only have to add a PATH and LD_LIBRARY_PATH entry pointing to the installations bin and lib path.

Best regards

henry November 6, 2008 09:16

We developed the wmake build s
We developed the wmake build system for OpenFOAM. cmake is the build system developed for VTK and ParaView by KitWare and we do not have any control over how it operates. To compensate for some of it's limitations we pass the files it generates through a script but this is not very satisfactory. Have you contacted KitWare about the problems you are having with cmake?


olesen November 6, 2008 09:24

Hi Rainer, I think we've al
Hi Rainer,

I think we've all had our pain with cmake.
Did you use the supplied bin/buildParaView3.3-cvs script? I think it manages to deal with some of the hard links problems.

remrich November 6, 2008 09:39

Hi Mark, yes I used the bui
Hi Mark,

yes I used the buildParaView3.3-cvs script.
But that doesn't solve the Problem as you may check with "chrpath -l".

remrich November 6, 2008 09:50

Henry, I don't have the tim

I don't have the time to investigate further at the moment. I had a short look into the cmake manual. I think there are some options to control the behavior for the RPATH settings.
But I don't know if it's possible to give these as command line options.

henry November 6, 2008 11:14

If you find a way to avoid the
If you find a way to avoid the way cmake annoyingly hard-codes paths please let us know, we have been agonizing over this for some years now.



mattijs November 6, 2008 14:25

There is a fix in the 1.5.x ve
There is a fix in the 1.5.x version of the buildParaView3.3-cvs script which sets the VTK_USE_RPATH to off. This will have the executables not use rpath.

Our problem with cmake is that it generates files with absolute paths which as a result would not work anywhere else. The main reason for the build script is to make all these paths relative.

remrich November 11, 2008 05:04

Two changes are solving the is
Two changes are solving the issues for me.

In OpenFOAM-1.5/bin/tools/buildParaViewFunctions
I added two options to the cmake command line:


Mattijs, I need both.

In the Allwmake script for the PV3FoamReader
I added the -DCMAKE_SKIP_RPATH:BOOL=YES option to the cmake command line


That's all.

For my QT installation I added some lines to the OpenFOAM1.5/etc/ script to add QT/bin and Qt/lib to PATH and LD_LIBRARY_PATH

So now every thing works fine.


sgehrkeTUBS March 18, 2009 11:29

Hi Rainer!

I was very happy when I found your posting about installing OpenFOAM on CentOS. I use RHEL 5, this should make no difference.

My questions:
I suppose you are much more used to Linux than I am, thus some of your steps arenīt clear to me.

Building my own gcc 4.3.1 is no problem, I installed it in $HOME/OpenFOAM/ThirdParty/gcc-4.3.1, before doing this I installed the actual binutils and though used their linker ld.

Qt was easy as well. Why did you choose 4.3.5? Normally 4.3.1 is used...

What you describe as nightmare are the next steps I donīt understand. Is it sufficient to add the lines in the build-scripts you posted the 11th of Nov? Is this an alternative to your first post (6th of Nov) or the same or something additional? I donīt understand what build.make, link.txt and relink.txt you modified. Is this necessary?

Thanks a lot!

Best regards

Sebastian Gehrke

sgehrkeTUBS March 20, 2009 02:48

Try !

This works fine without building gcc. I think the combination of the settings described by Rainer and of the way described in the link is the best for CentOS/RHEL. Rainers way works also but is a little bit more work.

The setting "-DVTK_USE_RPATH:BOOL=OFF" didnīt work, instead use "addCMakeVariable "VTK_USE_RPATH:BOOL=OFF"" in the building-script for ParaView.

Thanks cfd-online!


All times are GMT -4. The time now is 06:52.