Sie sind auf Seite 1von 4

OpenFOAMOpenFOAM-2.1.

1 Installation Steps
(For Ubuntu User Only)
1. Download source pack from following Link http://www.openfoam.org/download/source.php Pack OpenFOAM Third-Party File
OpenFOAM-2.1.1.tgz ThirdParty-2.1.1.tgz

2. Unpacking the source files


The user should choose a directory location to unpack these files, which will become the installation directory of OpenFOAM. If the installation is for a single user only, or if the user does not have root access to the machine, we would recommend the installation directory is $HOME/OpenFOAM (i.e. a directory OpenFOAM in the users home directory). If the installer has root permissions and the installation is for more than one user, one of the standard locations can be used, e.g. /usr/local/OpenFOAM, /opt/OpenFOAM, or just /opt. After the installation directory is chosen (and, if necessary, created), simply copy the 2 source pack files into the directory and unpack using tar xzf <filename>, e.g. from the installation directory:
tar -xzf OpenFOAM-2.1.1.tgz tar -xzf ThirdParty-2.1.1.tgz

The files unpack to produce directories OpenFOAM-2.1.1 and ThirdParty-2.1.1.

3. Dependent packages required to install OpenFOAM User can installed required packages by executing the following command in a terminal:
sudo apt-get install build-essential flex bison cmake zlib1g-dev qt4-dev-tools libqt4dev gnuplot libreadline-dev libncurses-dev libxt-dev

System versions of the OpenMPI and Scotch libraries can also be installed for Ubuntu, rather than having to compile them from sources:
sudo apt-get install libscotch-dev libopenmpi-dev

4. Setting environment variables a. For standard location


The environment variable settings are contained in files in an OpenFOAM-2.1.1/etc directory in the OpenFOAM release. e.g. for the case where the installation is in $HOME/OpenFOAM, in: $HOME/OpenFOAM/OpenFOAM-2.1.1/etc

OpenFOAMOpenFOAM-2.1.1 Installation Steps


(For Ubuntu User Only)
Source the etc/bashrc file by adding the following line to the end of your $HOME/.bashrc file:
source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc

then type source $HOME/.bashrc in the current terminal window or exit current terminal and open new terminal.

b. Setting environment variables for 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 example:
export FOAM_INST_DIR=/nfs/OpenFOAM foamDotFile=$FOAM_INST_DIR/OpenFOAM-2.1.1/etc/bashrc [ -f $foamDotFile ] && . $foamDotFile

5. Checking the system


To check your system is ready to build the sources, execute the foamSystemCheck script (in the OpenFOAM-2.1.1/bin directory). If any critical software is missing, or needs updating to a newer version, please contact the system administrator to install the required software before proceeding to the build. In particular your system will need to include a recent version of gcc (check with gcc --version, we recommend gcc-4.4.? but gcc-4.3.? is sufficient). If the installed version is not recent source pack for newer versions are available from http://gcc.gnu.org/. To build OpenFOAM you will also need the flex software installed on your system. If that is missing (type flex --version to check), then install it.

6. Building the sources


Go to the top-level source directory $WM_PROJECT_DIR and execute the top-level build script ./Allwmake. In principle this will build everything, but if problems occur with the build order it may be necessary to update the environment variables and re-execute ./Allwmake. wmake OpenFOAM uses wmake to perform compilation (building, linking) of its C++ source code into executable code. wmake is called from the Allwmake scripts during the initial build of the complete OpenFOAM project but can be executed directly to update the compilation of any of the OpenFOAM components: all invocations can have an optional directory:
wmake $FOAM_UTILITIES/mesh/manipulation/checkMesh wmake libso $FOAM_SRC/finiteVolume

OpenFOAMOpenFOAM-2.1.1 Installation Steps


(For Ubuntu User Only)
recursively build all applications in current or specified directory:
wmake all wmake all <dir>

build any single object or executable:


wmake Make/linux64Gcc4DPOpt/<object>.o wmake <executable>

build any single shared library:


wmake libso wmake libso <lib dir>

wmakeScheduler for faster compilation


wmake

comes with a parallel compilation scheduler, wmakeScheduler, which spawns compilation jobs on free machines. These machines need password-less network access, e.g. using SSH, and a network mounted installation, e.g. using NFS.

wmakeScheduler is set up with environment variables: WM_SCHEDULER : the name of the scheduler to use WM_HOSTS : the list of cores to

use

WM_NCOMPROCS : the number of parallel builds (usually the size of WM_HOSTS) WM_COLOURS : Optional list of colours for the compilation output from the cores.

For example to build on 1 processor of machine aaa and 4 processors of bbb:


export export export export WM_SCHEDULER=wmakeScheduler WM_HOSTS="aaa:1 bbb:4" WM_NCOMPPROCS=$($WM_SCHEDULER -count) WM_COLOURS="black blue green cyan red magenta yellow"

wmakeScheduler

uses ssh to spawn jobs on the listed machines so needs passwordless access and a network mounted installation

7. Compiling Paraview 3.12.0 and the PV3FoamReader Module


Paraview is the third-party software that we provide for graphical post-processing in OpenFOAM. Its compilation is automated using a script called makeParaView in the ThirdParty-2.1.1 directory. To install Paraview, execute the following:
cd $WM_THIRD_PARTY_DIR ./makeParaView

OpenFOAMOpenFOAM-2.1.1 Installation Steps


(For Ubuntu User Only)
The PV3blockMeshReader and the PV3FoamReader ParaView plugins are compiled as usual for OpenFOAM utilities:
cd $FOAM_UTILITIES/postProcessing/graphics/PV3Readers wmSET ./Allwclean ./Allwmake

8. Testing the Installation


To check your installation setup, execute the foamInstallationTest script (in the OpenFOAM-2.1.1/bin directory). If no problems are reported, proceed to getting started with OpenFOAM; otherwise, go back and check you have installed the software correctly and/or contact your system administrator.

Das könnte Ihnen auch gefallen