Setting OpenFOAM Environment Variables During Installation on OpenSuse 13.2

I am following the instructions to install OpenFOAM 2.3.1 on my Linux OpenSuse 13.2 system. At this following website, I am stuck at “Setting Environment Variables.”

I sense that my struggle is elementary because I’m new to Linux and keep getting stuck on the simple things.

I am installing in my user Home directory:


Therein, I un-tarred/un-zipped the OpenFOAM and ThirdParty compressed files. With “zypper,” I installed the dependent packages listed at the above website for OpenSuse. I am now stuck trying to set the environment variables. Per the instructions, I opened bashrc in GEdit and appended the end of the file with the very final “source” line; the end of the file is as such:

cleanup environment:


unset cleaned foamClean foamInstall foamOldDirs
unset _foamSource _foamEval

----------------------------------------------------------------- end-of-file

source $HOME/OpenFOAM/OpenFOAM-2.3.1/etc/bashrc
In the terminal window, I then issue:

source $HOME/OpenFOAM/OpenFOAM-2.3.1/etc/bashrc

and get a long repetitive string that looks like this:

mpicc: command not found
mpicc: command not found
mpicc: command not found
mpicc: command not found
mpicc: command not found
mpicc: command not found

Can anybody tell me what I’m doing wrong? I’m new to Linux, so please provide answers in simple terms with clear explanation, since I’m trying to learn and get a better understanding.

M Ridzon

Update: I figured out how to set the environment variables after further digging. The installation instructions say to edit the final line of

(note the ‘.’ before filename)

             source  $HOME/OpenFOAM/OpenFOAM-2.3.1/etc/bashrc

My error was because I didn’t realize .bashrc was a hidden file in the $HOME directory. Instead, I was incorrectly editing the final line of bashrc (without the preceding ‘.’) in the OpenFOAM directory:

Bottom line…They both have the same file name and I didn’t realize the period preceding the file name meant anything special.

Now I’m moving onto the next step.

A few additional notes:

You have somewere /Home. You most probably mean /home. For a computer, a H is a different character from a h. As different as both are from a ﻫ or a ह.

The two file names bashrc and .bashrc are not the same by any means. The . (dot) is a normal allowed character in a file name and can occur anywhere inside it. The only peculiarity is that when a file name starts with a dot, several applications (like ls and most file managers) will not show such a file name in lists without you telling them explicitly that they should do so. This was done already in early Unix to offer the possibility to “hide” file names that were thought of not being interesting in lists in day to day work. As a result many configuration files (specially residing in user’s home directories) got these names starting with a dot, so that users when consulting their home directory would only see the names of files/directories they need for their work. Often these files are changed by the configuration options of the applications and thus mostly need no manual editing (you stumbled in one of he exceptions), thus hiding them seems then reasonable.

Unrelated to your problem but you may want to install openFOAM from user OBS repository openfoam23x