CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   1.7.x Environment Variables on Linux 10.04 (http://www.cfd-online.com/Forums/openfoam-installation/77721-1-7-x-environment-variables-linux-10-04-a.html)

rasma July 1, 2010 11:52

1.7.x Environment Variables on Linux 10.04
 
I grabbed OpenFOAM-1.7.x and the ThirdParty sources and have them in the $HOME/OpenFOAM directory. I am on the step of setting the environment variables. I have followed the directions on the OpenFOAM site exactly and added

. $HOME/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc

to the bottom of the .bashrc file. However, when running

. $HOME/.bashrc

I get the following set of errors:

bash: /opt/OpenFOAM-1.7.x/bin/foamEtcFile: No such file or directory
bash: /opt/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
bash: /opt/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
bash: /opt/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
bash: /opt/OpenFOAM-1.7.x/etc/settings.sh: No such file or directory
bash: /opt/OpenFOAM-1.7.x/etc/aliases.sh: No such file or directory
bash: /opt/OpenFOAM-1.7.x/etc/apps/paraview3/bashrc: No such file or directory
bash: /opt/OpenFOAM-1.7.x/etc/apps/ensight/bashrc: No such file or directory
bash: /opt/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
bash: /opt/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
bash: /opt/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory

which makes me think that .bashrc thinks that OpenFOAM is in the opt directory. But simply typing in $HOME/OpenFOAM/OpenFOAM-1.7.x/etc takes me to the correct path. Any ideas on why this would be occurring? Thanks in advance!

wyldckat July 1, 2010 13:28

Greetings Daniel and welcome to the forum!

You apparently were lucky enough to get the git repository right in the middle of some updates :)
The developers now are supporting two types of releases, and one of them (the Ubuntu/Debian releases) use the /opt folder, so you got them right when they were updating that version :P

So, right now, you've two options:
  1. either update your git clone:
    Code:

    cd $HOME/OpenFOAM/OpenFOAM-1.7.x
    git pull

    Because I've just cloned it myself and is fixed!
  2. or change the $HOME/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc file. This is how it should look like, in the user settings part:
    Code:

    ################################################################################
    # USER EDITABLE PART. Note changes made here may be lost with the next upgrade
    #
    # either set $FOAM_INST_DIR before sourcing this file or set
    #    $foamInstall below to where OpenFOAM is installed
    #
    # Location of the OpenFOAM installation
    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    foamInstall=$HOME/$WM_PROJECT
    # foamInstall=~$WM_PROJECT
    # foamInstall=/usr/local/$WM_PROJECT
    # foamInstall=/opt/$WM_PROJECT
    #
    # END OF (NORMAL) USER EDITABLE PART
    ################################################################

Best regards,
Bruno

rasma July 1, 2010 13:53

Bruno,

I grabbed the files again and no more problem. Thanks a lot!

alberto July 2, 2010 02:20

I guess "Linux 10.04" is Ubuntu, not exactly the only Linux-based operating system. ;-)

timothy July 2, 2010 17:52

Similar problem
 
Hello all,

I have a virtual machine with Ubuntu 10.4.
I installed Openfoam170 with apt-get.
I changed my bashrc according to the instructions.

Files arrived in /opt

I now seem to have the following problem:
foamInstallationTest returns
FATAL ERROR: OpenFOAM environment not configured.

I notice the following environment variables:
echo $FOAM_RUN
/home/timothy/OpenFOAM/timothy-1.7.0/run
echo $FOAM_INST_DIR
/opt

So I'm not able to do the examples of the tutorial.
I guess something is wrong in the environment. Or should I make another directory in my home-directory?

Thanks for helping.

wyldckat July 2, 2010 18:44

Greetings Timothy and welcome to the forum!

Interesting...
Quote:

Originally Posted by timothy
I now seem to have the following problem:
foamInstallationTest returns
FATAL ERROR: OpenFOAM environment not configured.

OK, 4 things:
  1. foamInstallationTest is useless in the Ubuntu/Debian package:
    Quote:

    Originally Posted by henry (Post 264716)
    The foamInstallationTest script is for the source-build installation as described in the README.org file, not for the Debian pack installation.

  2. What version of Ubuntu are you running: i686 or x86_64?
  3. What version of OpenFOAM 1.7 Debian package did you install? i686 or x86_64?
  4. Does the folder /opt/openfoam170 exist and does it contain anything?
Best regards,
Bruno

timothy July 2, 2010 19:06

ok, point 1 I don'tmind. If the rest would work...

2.
ubuntu-10.04-desktop-i386.iso
on a virtual machine

3. I just used apt-get for installation, like is said on http://www.openfoam.com/download/ubuntu.php
so i just typed
apt-get install openfoam170

4. Yes all the files seem to be present in /opt/openfoam170

But I notice at least two problems:

$FOAM_RUN points to the wrong directory

And if I start with the tutorial: if I call then Blockmesh in
/opt/openfoam170/tutorials/incrompressible/icoFoam/cavity/

it gives FATAL ERROR Failed writing polymesh.
(can this be related to the environment settings?)

wyldckat July 2, 2010 19:28

Quote:

Originally Posted by timothy (Post 265540)
But I notice at least two problems:

$FOAM_RUN points to the wrong directory

And if I start with the tutorial: if I call then Blockmesh in
/opt/openfoam170/tutorials/incrompressible/icoFoam/cavity/

it gives FATAL ERROR Failed writing polymesh.
(can this be related to the environment settings?)

Oh... right... they forgot about putting one last line at the end of the installation guide: Click --> here <-- to start learning how to use OpenFOAM. ;) Or open the file: /opt/openfoam170/doc/Guides-a4/UserGuide.pdf

Because $FOAM_RUN doesn't point to the wrong folder, it points to a folder which should be located in your personal user folder! And in the user guide it starts off with:
Code:

mkdir -p $FOAM_RUN
cp -r $FOAM_TUTORIALS $FOAM_RUN

This will create your own copy of tutorials so you can mess around with them without damaging the original copy and having to reinstall the whole thing again! :D


This quick and easy installation of OpenFOAM in Ubuntu is designed to be a system wide installation and to be a plug-and-play like application.
The folder /opt/openfoam170 is a system/protected folder which is meant to be accessed only as source of the things you can use! It's not meant to be used directly inside it! You can use the applications and libraries in it, and copy stuff from it, but you aren't meant to change it!

Except maybe when updating the OpenFOAM installation, which should be available every month. When that time comes, they should post some more info about it, but probably Ubuntu will automatically warn you that there is a new version available to install :D

Best regards and good luck!
Bruno

openfoam_user July 29, 2010 14:38

Hi Bruno,

today I have updated my OpenFOAM-1.7.x version.

Since then I get the following error message when I run a case in parallel. To run a case in parallel I use the following command:
/shared/OpenFOAM/ThirdParty-1.7.x/platforms/linux64Gcc/openmpi-1.4.1/bin/mpirun -np 12 -hostfile machines /shared/OpenFOAM/OpenFOAM-1.7.x/bin/foamExec simpleFoam -parallel | tee

log.simpleFoam/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 90: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamEtcFile: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 90: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamEtcFile: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 90: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamEtcFile: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 90: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamEtcFile: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 90: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamEtcFile: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 241: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 244: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 90: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamEtcFile: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 241: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 241: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 247: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 90: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamEtcFile: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 90: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamEtcFile: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 90: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamEtcFile: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 244: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 244: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 83: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/etc/settings.sh: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 90: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamEtcFile: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 241: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 241: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 247: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 244: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 244: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 241: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 241: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 83: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/etc/settings.sh: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 241: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 247: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 241: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 241: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 244: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 244: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 247: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 244: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 83: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/etc/settings.sh: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 244: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 247: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 247: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 83: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/etc/settings.sh: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 83: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/etc/settings.sh: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 244: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 247: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 83: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/etc/settings.sh: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 247: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 83: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/etc/settings.sh: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 247: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 247: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/bin/foamCleanPath: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 83: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/etc/settings.sh: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 83: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/etc/settings.sh: No such file or directory
/shared/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc: line 83: /home/sanchi/OpenFOAM/OpenFOAM-1.7.x/etc/settings.sh: No such file or directory

In serial it runs well.

Do you have any idea ?

Regards,

Stephane.

openfoam_user July 30, 2010 04:43

Now my problem is solved. The foamInstall directory was not set correctly.

foamInstall=$HOME/$WM_PROJECT

Stephane.


All times are GMT -4. The time now is 17:23.