CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   BEGINNER: error while loading shared libraries (

ka1184 February 19, 2010 05:57

BEGINNER: error while loading shared libraries
Hi everyone!
I'm trying to get started with OpenFOAM (OpenFOAM-1.6), but I problems even running the tutorials! I'm trying to do the lid-driven flow tutorial. The foamInstalltiontest says that everything should be fine. Since I'm not a very experienced Linux user, I describe everything I do in detail since I might make fundamental mistakes that I hope you can help me detect....

The installation was made by a friend in a path called


and within this I created (whole pathway)

to which I copied the tutorials. I type in the terminal:

cd /usr/OpenFOAM/Karin/run/tutorials/incompressible/icoFoam/cavity

According to the tutorials I should just have to type in the terminal:
to generate the mesh, but when I do this I get the following error message:

blockMesh: error while loading shared libraries: cannot open shared object file: No such file or directory

PLEASE HELP ME!!!!!!!!!!!!

romant February 19, 2010 07:06

In the case of installing OpenFOAM into a user defined directory, the path to the executables must be given. Did u check this part. For example if you just type the first part of blockMesh, like "block" and then hit tab to autocomplete. Does it show blockMesh?

Otherwise, try installing OpenFOAM into your home directory. If you wanna go as easy as possible with this one, try those scripts

by MadsR (who is also in this forum)

try this thread if you still have problems

Or just download the original OpenFOAM 1.6 from the website, unpack them as described on the website and follow the README instructions inside the OpenFOAM-1.6 folder.

ka1184 February 19, 2010 08:06

Thanks for your reply!
When I type "block" and then tab blockMesh appears. However, if I type "libmesh" nothing appears. Does that mean that the file is missing? If so, can I download it?

I tried before to download straight to my user account, but couldn't get the installation test to work... Then I disocverd that it was downloaded on the other location and decided to use that instead.

romant February 19, 2010 08:11

I think that the path that are supposed to be set when openfoam is not installed in the home directory, are set right. Therefore, there might be a mistake that your friend made when he set up OpenFOAM.

This is is how to set the environment variables according to the OpenFOAM README.


*** Installation in alternative locations
    OpenFOAM may also be installed in alternative locations. However, the
    installation directory should be network available (e.g., NFS) if parallel
    calculations are planned.

    The environment variable 'FOAM_INST_DIR' can be used to find and source the
    appropriate resource file. Here is a bash/ksh/sh example:

    + export FOAM_INST_DIR=/data/app/OpenFOAM
    + foamDotFile=$FOAM_INST_DIR/OpenFOAM-1.6/etc/bashrc
    + [ -f $foamDotFile ] && . $foamDotFile

If setting those does not work, I would suggest installing the openfoam binaries in your home directory, following the readme of course.

All times are GMT -4. The time now is 19:14.