Hi, I thought I'd share my experiences about installing the new OpenFOAM 2.2.2 from source on Xubuntu 13.10, because there was a nasty bug with compiling scotch. I always prefer installing from source, because I want my ParaView with MPI and Python support. This installation is for a 64bit system.
Let's go through the installation procedure.
1. Create OpenFOAM root directory if it doesn't exist.
Code:
mkdir $HOME/OpenFOAM
2. Download the source packs OpenFOAM-2.2.2.tgz and ThirdParty-2.2.2.tgz from
http://www.openfoam.org/download/source.php and copy them to the OpenFOAM root directory $HOME/OpenFOAM.
3. Extract the source packs.
Code:
tar xzf OpenFOAM-2.2.2.tgz
tar xzf ThirdParty-2.2.2.tgz
4. Get the required dependencies and Python. I also prefer to use the system OpenMPI so we'll get that too (the built-in version should also work).
Code:
sudo apt-get install build-essential flex bison cmake zlib1g-dev qt4-dev-tools libqt4-dev gnuplot libreadline-dev libncurses-dev libxt-dev python python-dev
sudo apt-get install libopenmpi1.6-dev openmpi1.6
5. Edit the OpenFOAM configuration to use the system OpenMPI and source it.
Replace line 84 in file OpenFOAM-2.2.2/etc/bashrc
Code:
export WM_MPLIB=OPENMPI
with
Code:
export WM_MPLIB=SYSTEMOPENMPI
and load the configuration.
Code:
source OpenFOAM-2.2.2/etc/bashrc
6. Download Tecio (optional).
Code:
cd ThirdParty-2.2.2
wget http://download.tecplot.com/tecio/2009/tecio2009.zip
unzip tecio2009.zip
7. Fix bug #1048, which is preventing the scotch library from compiling (for details see
http://www.openfoam.org/mantisbt/view.php?id=1048). Execute this in folder ThirdParty-2.2.2.
Code:
sed -i -e 's=-lz -lm -lrt=-Xlinker --no-as-needed -lz -lm -lrt=' etc/wmakeFiles/scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM-*
8. Compile OpenFOAM. As you propably have more than one processor core available let's use them. I have four but your mileage may vary.
Code:
export WM_NCOMPPROCS=4
cd $HOME/OpenFOAM/OpenFOAM-2.2.2/
./Allwmake
9. Compile ParaView with MPI and Python support.
Code:
cd $HOME/OpenFOAM/ThirdParty-2.2.2
./makeParaView -mpi -python -python-lib /usr/lib/x86_64-linux-gnu/libpython2.7.so
10. Compile PV3FoamReader.
Code:
cd $FOAM_UTILITIES/postProcessing/graphics/PV3Readers
wmSET
./Allwclean
./Allwmake
11. Add OpenFOAM and ParaView environmental variables in file $HOME/.bashrc. (NOTE! Replace the dir /home/zordiack with your own home directory.)
Code:
source $HOME/OpenFOAM/OpenFOAM-2.2.2/etc/bashrc
export ParaView_DIR=/home/zordiack/OpenFOAM/ThirdParty-2.2.2/platforms/linux64Gcc/paraview-3.12.0
export PATH=$ParaView_DIR/bin:$PATH
export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-3.12
12. You can now test your installation with a test script and by running a tutorial.
Code:
cd $WM_PROJECT_DIR/bin
./foamInstallationTest
mkdir -p $FOAM_RUN
cp -R $FOAM_TUTORIALS/incompressible/icoFoam/cavity .
cd cavity
blockMesh
icoFoam
paraFoam
If everything worked without errors you should now have a working OpenFOAM-2.2.2 installation :)
I'm also going to install some additional components which are not part of the basic installation. These steps are entirely optional and you can read on if you wish.
13. Download and install swak4Foam (for more info see
http://openfoamwiki.net/index.php/Contrib/swak4Foam).
Code:
sudo apt-get install subversion
cd $HOME/OpenFOAM
svn checkout svn://svn.code.sf.net/p/openfoam-extend/svn/trunk/Breeder_2.0/libraries/swak4Foam/
cd swak4Foam
Fix timeset method compatibility issue with version 2.2.2. Download the patch from post
http://www.cfd-online.com/Forums/ope...tml#post434217 and copy the patch into swak4Foam source directory and apply the patch. After patching compile the code.
Code:
gunzip patch_swak2Foam_024_OF22x_49808a1c.gz
patch -p1 < patch_swak2Foam_024_OF22x_49808a1c
./Allwmake
14. Download and install alternative parallel OpenFOAM reader plugin for ParaView (for more info see
http://openfoamwiki.net/index.php/Co...r_for_ParaView).
Code:
cd $HOME/OpenFOAM/ThirdParty-2.2.2
sudo apt-get install cmake-curses-gui
svn co https://of-interfaces.svn.sourceforge.net/svnroot/of-interfaces/trunk/vtkPOFFReader
mkdir build_offreader
cd build_offreader
ccmake ../vtkPOFFReader/
Then press c twice to configure (the default options should be correct) and press g to generate Makefiles and exit. Now compile and install.
15. Download and install PyFoam (for details see
http://openfoamwiki.net/index.php/Contrib_PyFoam).
Code:
cd $HOME/OpenFOAM
sudo apt-get install python-numpy
wget http://openfoamwiki.net/images/3/33/PyFoam-0.6.1.tar.gz
tar zxvf PyFoam-0.6.1.tar.gz
cd PyFoam-0.6.1/
sudo python setup.py install
That's it! You now have a powerful set of opensource CFD in your hands :)