CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Installation (
-   -   Environment errors with .deb install and ubuntu 13.04 64 bit (

jonathanbyrn September 13, 2013 11:02

Environment errors with .deb install and ubuntu 13.04 64 bit
I apt-get installed openfoam 2.2.1 and it seemed to successfully install. I added the "source /opt/openfoam221/etc/bashrc" to my .bashrc and it picked it up. Unfortunately it still doesn't seem to working. Here are some of the errors I am getting:

IcoFoam isn't picked up.

When I run wallmake I get: wmakeCheckPwd: not found (I think this has to do with missing third party stuff)

If I copy wmakecheckpwd to my bin folder I get: FOAM_EXT_LIBBIN not set

My environment variables are correct except there is no third party folder in /opt, should that have been installed?
Also the install didn't create my $USER folder, should it have done that or do I create it myself?


On the plus side paraview seems to be working. Have I done something wrong during the install or should I install an earlier version?

wyldckat September 14, 2013 12:25

Greetings Jonathan and welcome to the forum!

Well, if you did successfully install OpenFOAM 2.2.1 from the Deb packages, as explained here: - then you do not need to run Allwmake.

A few questions:
  1. Have you tried opening a new terminal window or tab?
  2. What happens if you run these commands:

    echo $WM_PROJECT_DIR
    ls -l $WM_PROJECT_DIR

  3. Have you tried to install another version of OpenFOAM before this one?
Best regards,

jonathanbyrn September 15, 2013 10:51

Thanks for getting back to me, I really appreciate the help. I have opened a new terminal I am still the getting the same issues. I can see that it has sourced the correct bashrc file so I don't think that is the problem.

It is a clean install so there shouldn't be any conflicts.

I can see all the executables in the platforms folder but it doesn't seem to have properly linked to them. I was running wallmake out of desperation.

The $WM_PROJECT_DIR variable points to /opt/openfoam221 which is correct

and this is what is in that folder:
-rwxr-xr-x 1 root root 923 Jun 18 11:23 Allwmake
-rw-r--r-- 1 root root 123833 Jun 18 14:21 Allwmake.log
drwxr-xr-x 5 root root 4096 Sep 13 15:43 applications
drwxr-xr-x 3 root root 4096 Sep 13 15:43 bin
-rw-r--r-- 1 root root 0 Jun 18 15:06 build-stamp
-rw-r--r-- 1 root root 35647 Jun 18 11:23 COPYING
drwxr-xr-x 6 root root 4096 Sep 13 15:43 doc
drwxr-xr-x 6 root root 4096 Sep 13 15:43 etc
drwxr-xr-x 3 root root 4096 Sep 13 15:43 platforms
-rw-r--r-- 1 root root 6526 Jun 18 11:23 README.html
-rw-r--r-- 1 root root 1584 Jun 18 11:23
drwxr-xr-x 35 root root 4096 Sep 13 15:43 src
drwxr-xr-x 16 root root 4096 Sep 13 15:43 tutorials
drwxr-xr-x 6 root root 4096 Sep 13 15:43 wmake

Thanks again for your help!

wyldckat September 15, 2013 14:08

Hi Jonathan,

OK, my guess is that something got broken when you were trying to fix the problem. Try reinstalling OpenFOAM 2.2.1 with the following command:

sudo apt-get install --reinstall openfoam221
Then run:

which icoFoam
Make sure you use the exact same letter case, because icoFoam and icoFOAM is not the same thing on Linux.
If it didn't reveal this path:

then start a new terminal and try again.

Best regards,

jonathanbyrn September 15, 2013 16:02

I ran the reinstall, opened a new terminal and there is still no icoFoam. Everything seems to be installed and the bashrc is being sourced, but the environment still isnt being set up.

I ran the foamInstallationTest and got:
FATAL ERROR: OpenFOAM environment not configured.

when I checked the foaminstallationtest code it was checking if two folders existed $WM_PROJECT_INST_DIR (/opt) and $WM_THIRD_PARTY_DIR (/opt/ThirdParty-2.2.1)

The third party folder doesn't exist. Should that have been created by the deb installer?

wyldckat September 15, 2013 16:06

Run these commands:

source /opt/openfoam221/etc/bashrc
which icoFoam

If this works, then it's because you incorrectly edited the file "~/.bashrc".

jonathanbyrn September 15, 2013 16:14

This is what I got:
$ source /opt/openfoam221/etc/bashrc

jonathan@jonathan-ubuntu /home/jonathan
$ which icoFoam
Exit 1

jonathan@jonathan-ubuntu /home/jonathan
$ icoFoam
icoFoam: command not found
Exit 127

Still no joy, thanks again for your help and prompt reply.

wyldckat September 15, 2013 17:41

Hi Jonathan,

This is very strange....

OK, try these steps:
  1. Remove OpenFOAM 2.2.1:

    sudo apt-get purge openfoam221
  2. Remove any references to it from your "~/.bashrc" file.
  3. Make sure that the folder "/opt/openfoam221" is eliminated:

    ls -l /opt/openfoam221
    If it's still there, run:

    sudo rm -r /opt/openfoam221
  4. Start a new terminal.
  5. Install OpenFOAM 2.2.1 once again:

    sudo apt-get install openfoam221
  6. Try the previous commands once again:

    source /opt/openfoam221/etc/bashrc
    which icoFoam

  7. If this works, then try to add the first line from the previous step to the end of your "~/.bashrc" file, in it's own independent line.
Best regards,

jonathanbyrn September 15, 2013 18:11

I made absolutely sure the folders in opt were removed, here is how the install went:

Do you want to ignore this warning and proceed anyway?
To continue, enter "Yes"; to abort, enter "No": yes
Selecting previously unselected package libcr0.
(Reading database ... 422432 files and directories currently installed.)
Unpacking libcr0 (from .../libcr0_0.8.5-2_amd64.deb) ...
Selecting previously unselected package blcr-util.
Unpacking blcr-util (from .../blcr-util_0.8.5-2_amd64.deb) ...
Selecting previously unselected package csh.
Unpacking csh (from .../csh_20110502-2ubuntu1_amd64.deb) ...
Selecting previously unselected package libptscotch-5.1.
Unpacking libptscotch-5.1 (from .../libptscotch-5.1_5.1.12b.dfsg-2_amd64.deb) ...
Selecting previously unselected package binutils-dev.
Unpacking binutils-dev (from .../binutils-dev_2.23.2-2ubuntu1_amd64.deb) ...
Selecting previously unselected package openmpi-bin.
Unpacking openmpi-bin (from .../openmpi-bin_1.4.5-1ubuntu1_amd64.deb) ...
Selecting previously unselected package openfoam221.
Unpacking openfoam221 (from .../openfoam221_0-1_amd64.deb) ...
Selecting previously unselected package libptscotch-dev.
Unpacking libptscotch-dev (from .../libptscotch-dev_5.1.12b.dfsg-2_amd64.deb) ...
Selecting previously unselected package openmpi-checkpoint.
Unpacking openmpi-checkpoint (from .../openmpi-checkpoint_1.4.5-1ubuntu1_amd64.deb) ...
Processing triggers for man-db ...
Processing triggers for doc-base ...
Processing 1 added doc-base file...
Setting up libcr0 (0.8.5-2) ...
Setting up blcr-util (0.8.5-2) ...
Setting up csh (20110502-2ubuntu1) ...
update-alternatives: using /bin/bsd-csh to provide /bin/csh (csh) in auto mode
Setting up libptscotch-5.1 (5.1.12b.dfsg-2) ...
Setting up binutils-dev (2.23.2-2ubuntu1) ...
Setting up openmpi-bin (1.4.5-1ubuntu1) ...
update-alternatives: using /usr/bin/mpirun.openmpi to provide /usr/bin/mpirun (mpirun) in auto mode
Setting up openfoam221 (0-1) ...

** To use OpenFOAM please add
** . /opt/openfoam221/etc/bashrc
** To your ~/.bashrc

Setting up libptscotch-dev (5.1.12b.dfsg-2) ...
Setting up openmpi-checkpoint (1.4.5-1ubuntu1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place

jonathan@jonathan-ubuntu /opt
$ source /opt/openfoam221/etc/bashrc

jonathan@jonathan-ubuntu /opt
$ which icoFoam
Exit 1

jonathan@jonathan-ubuntu /opt
$ icoFoam
icoFoam: command not found

Could this be a problem with 13.04? I might try the source install tomorrow or maybe set up a virtual machine with 12.04 to see if that is the problem

wyldckat September 15, 2013 18:21

I think I finally figure it out. You've got a broken ".bashrc" file, which is why things are not working properly.

Run this command and then start a new terminal:

cp /etc/skel/.bashrc ~/
Then try again:

source /opt/openfoam221/etc/bashrc
which icoFoam

jonathanbyrn September 15, 2013 18:27

That sorted it! It must be something conflicting in my original bashrc. I am getting some new errors with icoFoam but at least this is an improvement :) thanks again for your help!

fernando_fec September 24, 2013 16:22

Hello, sorry for reviving this thread, but this was the only place I found some info regarding this issue. I'm trying to compile from the git source in arch linux, and I get the same error with FOAM_EXT_LIBBIN not being set. I went trough the bashrc located in OpenFOAM-2.2.x/etc/ and I didn't find any export setting this variable, and neither I found it when I did a text search over the whole directory.

I'm not sure if the git repo is intended in practice to be a source for compiling (the install wiki at least ses it is) but if it is I'm pretty lost in what to set this variable to

Also, this page doesn't show the variable listed

Thanks, and any help would be apreciated

jonathanbyrn September 25, 2013 05:42

I did a clean checkout of openFOAM 2.2.x and managed to find it. The $FOAM_EXT_LIBBIN is being set in ./etc/config/ which should be called by the bashrc script:
_foamSource $WM_PROJECT_DIR/etc/config/

So it looks like bashrc is not being executed correctly. My problem was a pre-existing bashrc alias was breaking the openfoam bashrc. Have you tried it with a clean .bashrc as Bruno described?

fernando_fec September 25, 2013 11:32

You're actually right about both, my bashrc was not loading the configs and I assumed that KDE's search in the contents of a file would include text files even if they were marked as executables. My bad.

Also, I'd like to confirm what the git repo is suposed to be used for, It's as the wiki says where I can finde the lastest versoin with bugfixes or it's suposed to be an unstable developmente version?

Thanks for the answer and good luck

jonathanbyrn September 26, 2013 05:22

Glad to hear you got it working. I built the source but I havent tried it out. I'm sticking with the debs

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