Miscellaneous tips and tricks

This page is mainly for myself, but I have made it available if it is useful for someone else.

General hints on installing OpenFOAM

If you need to install a proper version of gcc, Qt etc. for 2.0.x, have a look at the scripts in ThirdParty, such as makeGcc, see which versions they require, get those versions from the Internet, compile by running the script.

Installation of Python etc. in StuDAT (non-root), Redhat Enterprise 6.2, HT12

Check out www.enthought.com for an academic licence of a complete package.

After installation by running the *.sh file, simply add the path:

alias EDP='export PATH=/chalmers/sw/unsup64/OpenFOAM/epd-7.3.1-rh5-x86_64/bin:$PATH'

This seems to work nicely!

Raw notes from installing OpenFOAM-1.6-ext in StuDAT (non-root), Redhat Enterprise 6.2, HT12

Note that minus signs and perhaps some other characters have been destroyed by Word, so copy-paste might not work!
See:
    http://www.cfd-online.com/Forums/openfoam-news-announcements-other/82445-extend-project-release-1-6-ext.html
    $WM_THIRD_PARTY_DIR/README.ThirdParty
ssh vcs64-6.studat.chalmers.se
cd /chalmers/sw/unsup64/OpenFOAM
git clone git://openfoam-extend.git.sourceforge.net/gitroot/openfoam-extend/OpenFOAM-1.6-ext
cd OpenFOAM-1.6-ext
echo "alias OF16ext='export FOAM_INST_DIR=/chalmers/sw/unsup64/OpenFOAM; export QT_THIRD_PARTY=1;. \$FOAM_INST_DIR/OpenFOAM-1.6-ext/etc/bashrc'" >> addToBashrc
(NOTE: "export QT_THIRD_PARTY=1" was actually added after running AllMake in foam3rdParty, but it should be ok to add it already above instead)
Open a new terminal window
OF16ext
foam3rdParty
./AllMake
./AllMake #To check the shorter output for possible problems
If QT_THIRD_PARTY was not set above:
    Need to say that the ThirdParty Qt should be installed:
    export QT_THIRD_PARTY=yes
    ./AllMake
    NOTE: The choice between ThirdParty/system installation for other software
          is done similarly, but inverse, using XXX_SYSTEM, see settings.sh
Open a new terminal window
OF16ext
foam
./Allwmake >& log_Allwmake&
./Allwmake >& log_Allwmake& #To make sure that everything compiled
NOTE: Problem with paraview remotely:
    vtkXOpenGLRenderWindow (0x28c4830): Could not find a decent visual
    vtkXOpenGLRenderWindow (0x28c4830): Cannot create GLX context.
 

Raw notes from installing OpenFOAM-2.1.x in StuDAT (non-root), Redhat Enterprise 6.2, HT12

Note that minus signs and perhaps some other characters have been destroyed by Word, so copy-paste might not work!
ssh vcs64-6.studat.chalmers.se
cd /chalmers/sw/unsup64/
mkdir OpenFOAM
cd OpenFOAM
git clone git://github.com/OpenFOAM/OpenFOAM-2.1.x.git
wget http://downloads.sourceforge.net/project/foam/foam/2.1.1/ThirdParty-2.1.1.tgz?r=http%3A%2F%2Fopenfoam.org%2Fdownload%2Fgit.php&ts=1344267545&use_mirror=garr
tar xzf ThirdParty-2.1.1.tgz
rm ThirdParty-2.1.1.tgz
mv ThirdParty-2.1.1 ThirdParty-2.1.x
cp OpenFOAM-2.1.x/etc/bashrc OpenFOAM-2.1.x/etc/bashrcHani
sed -i s/paraview/paraviewHani/g OpenFOAM-2.1.x/etc/bashrcHani
cp OpenFOAM-2.1.x/etc/config/paraview.sh OpenFOAM-2.1.x/etc/config/paraviewHani.sh
echo "alias OF21x='export FOAM_INST_DIR=/chalmers/sw/unsup64/OpenFOAM;. \$FOAM_INST_DIR/OpenFOAM-2.1.x/etc/bashrcHani'" >> addToBashrc
gcc --version #Gives 4.4.6. Required: 4.3.?, recommended: 4.4.?. Ok!
flex --version #Gives 2.5.35. Seems to have worked ok!
Open a new window and type:
OF21x
foam
./Allwmake

ParaFoam:
qmake --version #Required: 4.6.2 or newer. bash: qmake: command not found
cmake --version #Gives 2.8.7. Required: 2.8.2 or newer. Ok!
Install Qt (check preferred version in $WM_THIRD_PARTY_DIR/makeQt)
cd $WM_THIRD_PARTY_DIR
wget http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.3.tar.gz
tar xzf qt-everywhere-opensource-src-4.7.3.tar.gz
rm qt-everywhere-opensource-src-4.7.3.tar.gz
./makeQt
echo "export QT_DIR=\$WM_THIRD_PARTY_DIR/platforms/\$WM_ARCH\$WM_COMPILER/qt-4.7.3" >> $FOAM_INST_DIR/OpenFOAM-2.1.x/etc/config/paraviewHani.sh
echo "export QT_BIN_DIR=\$QT_DIR/bin" >> $FOAM_INST_DIR/OpenFOAM-2.1.x/etc/config/paraviewHani.sh
echo "export PATH=\$QT_BIN_DIR:\$PATH" >> $FOAM_INST_DIR/OpenFOAM-2.1.x/etc/config/paraviewHani.sh
echo "export LD_LIBRARY_PATH=\$QT_DIR/lib:\$LD_LIBRARY_PATH" >> $FOAM_INST_DIR/OpenFOAM-2.1.x/etc/config/paraviewHani.sh
echo "export LIBGL_ALWAYS_INDIRECT=y #See http://www.cfd-online.com/Forums/openfoam-installation/57218-parafoam-error-could-not-find-decent-visual.html" >> $FOAM_INST_DIR/OpenFOAM-2.1.x/etc/config/paraviewHani.sh
See also:
  http://www.cfd-online.com/Forums/blogs/wyldckat/533-related-issues-paraview-openfoam-fixes-solutions.html
  http://www.cfd-online.com/Forums/blogs/wyldckat/1203-paraview-3-12-0-superbuild-openfoam.html
NOTE: Qt problem gives the following message: "Application asked to unregister timer 0x67000013 which is not registered in this thread. Fix application.". Just move the pop-up window out of sight.
NOTE: Plot-Over-Line problem through ssh gives the following message: "X Error: BadLength (poly request too large or internal Xlib length error)". See: http://www.cfd-online.com/Forums/openfoam-paraview/94419-paraview-chrashed-using-plot-over-line.html. Can be fixed by running Paraview in remote configuration (should check this out).
Open a new terminal:
OF21x
cd $WM_THIRD_PARTY_DIR
./makeParaView
cd $FOAM_UTILITIES/postProcessing/graphics/PV3Readers
wmSET
./Allwclean
./Allwmake
Compile Debug version, without recompiling ThirdParty:
cd /chalmers/sw/unsup64/OpenFOAM
echo "alias OF21xDebug='export FOAM_INST_DIR=/chalmers/sw/unsup64/OpenFOAM;. \$FOAM_INST_DIR/OpenFOAM-2.1.x/etc/bashrcHani WM_COMPILE_OPTION=Debug'" >> addToBashrc
cd $WM_THIRD_PARTY_DIR/platforms
ln -s linux64GccDPOpt linux64GccDPDebug
Open a new terminal:
OF21xDebug
foam
./Allwmake

cd $FOAM_UTILITIES/postProcessing/graphics/PV3Readers
wmSET
./Allwclean
./Allwmake

Raw notes from installing OpenFOAM-2.0.x on my 64-bit laptop with Ubuntu-10.04 LTS 64-bit:

Follow original instructions, except for cmake:

OF20x

sed -i s/"cmake-2.8.4"/"cmake-2.8.5"/g $HOME/OpenFOAM/OpenFOAM-2.0.x/etc/config/myParaview.sh

sed -i s/"cmake-2.8.3"/"cmake-2.8.5"/g $THIRD_PARTY_DIR/makeCmake

cd $THIRD_PARTY_DIR
wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz

tar xzf cmake-2.8.5.tar.gz

rm cmake-2.8.5.tar.gz

./makeCmake

 

Raw notes on installation of OpenFOAM-1.5-dev on Glenn

Jag förberedde för installation i $SNIC_NOBACKUP eftersom det inte går att ha två versioner installerade samtidigt i hemkatalogen, p.g.a. quota:

 

mkdir $SNIC_NOBACKUP/OpenFOAM

cd $SNIC_NOBACKUP/OpenFOAM

 

Jag laddade ner ThirdParty och packade upp dem:

wget

http://downloads.sourceforge.net/project/foam/foam/1.5/ThirdParty.General.gtgz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Ffoam%2Ffiles%2Ffoam%2F1.5%2F&ts=1332070845&use_mirror=kent

wget

http://downloads.sourceforge.net/project/foam/foam/1.5/ThirdParty.linux64Gcc.gtgz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Ffoam%2Ffiles%2Ffoam%2F1.5%2F&ts=1332070784&use_mirror=heanet

tar xzf ThirdParty.General.gtgz

tar xzf ThirdParty.linux64Gcc.gtgz

rm ThirdParty.General.gtgz

rm ThirdParty.linux64Gcc.gtgz

 

Jag checkade ut 1.5-dev:

svn co

https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev

 

Jag skapade en alias i ~/.bashrc:

echo "alias OF15dev='module load gcc/4.6/4.6.2 openmpi/1.5.4; FOAM_INST_DIR=$SNIC_NOBACKUP/OpenFOAM; .

$FOAM_INST_DIR/OpenFOAM-1.5-dev/etc/bashrc'" >> ~/.bashrc

 

Jag öppnade ett nytt terminalfönster och skrev:

OF15dev

 

Nu till tricket. Av någon anledning så får Make/linux64GccDPOpt/options-filerna

radbrytningar i listan av bibliotek i LIB_LIBS. Det ger sig uttryck genom ett felmeddelande innehållande "missing separator". Lösningen är att i filen:

OpenFOAM-1.5-dev/wmake/rules/linux64Gcc/general

lägga till -P i slutet av CPP-raden.

Om man har råkat testa att kompilera utan denna ändrig först så är det viktigt att städa bort tidigare kompileringar innan man försöker med denna ändring. Om lnInclude redan finns så görs den inte om, och då kvarstår problemet. Kör då:

foam

rmdepall

wcleanMachine linux64GccDPOpt

wcleanLnIncludeAll

 

Slutligen är det bara att kompliera som vanligt enligt:

foam

./Allwmake >& log_Allwmake

 

Högst troligt har src/OpenFOAM och src/finiteVolume misslyckats (kolla log-filen). Gå i så fall till src/OpenFOAM resp src/finiteVolume och gör:

rmdepall

rm -rf lnInclude

rm -rf Make/linux64GccDPOpt

wmake libso

Jag har inte lyckats att få detta att fungera i scripten av någon konstig anledning.

Kör sedan igen:

foam

./Allwmake >& log_Allwmake

 

Man får meddelanden enligt följande, vilket vi kan ignorera:

make: Warning: File `Make/linux64GccDPOpt/dontIncludeDeps' has modification time 12 s in the future

make: warning:  Clock skew detected.  Your build may be incomplete.

 

Raw notes from installing OpenFOAM-2.0.x in FoDAT (non-root), Redhat Enterprise 5.6, HT11
Note that minus signs and perhaps some other characters have been destroyed by Word, so copy-paste might not work!

This info should also be available in 00README_installation

uname -a:

Linux sugi.medic.chalmers.se 2.6.39-1.el5.elrepo #1 SMP PREEMPT Fri Jun 3 19:17:28 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
cd /scratch/hani/
mkdir OpenFOAM
cd OpenFOAM/
git clone git://github.com/OpenCFD/OpenFOAM-2.0.x.git
wget --no-check-certificate https://downloads.sourceforge.net/project/foam/foam/2.0.1/ThirdParty-2.0.1.gtgz?r=http%3A%2F%2Fopenfoam.com%2Fdownload%2Fgit.php&ts=1312968761&use_mirror=switch
tar xzf ThirdParty-2.0.1.gtgz
rm ThirdParty-2.0.1.gtgz
mv ThirdParty-2.0.1 ThirdParty-2.0.x
echo "alias OF20x='export FOAM_INST_DIR=/scratch/hani/OpenFOAM; source $FOAM_INST_DIR/OpenFOAM-2.0.x/etc/bashrc'" >> $HOME/.bashrc
Open a new window
OF20x
cd $WM_THIRD_PARTY_DIR
gcc --version #Required: 4.3.?, recommended: 4.4.?. The one default is too old!
See $WM_THIRD_PARTY_DIR/makeGcc for which packages are needed
wget ftp://ftp.gmplib.org/pub/gmp-5.0.1/gmp-5.0.1.tar.gz
tar xzf gmp-5.0.1.tar.gz
rm gmp-5.0.1.tar.gz
wget http://www.mpfr.org/mpfr-2.4.2/mpfr-2.4.2.tar.gz
tar xzf mpfr-2.4.2.tar.gz
rm mpfr-2.4.2.tar.gz
wget http://www.multiprecision.org/mpc/download/mpc-0.8.1.tar.gz
tar xzf mpc-0.8.1.tar.gz
rm mpc-0.8.1.tar.gz
wget ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-4.5.1/gcc-4.5.1.tar.gz
tar xzf gcc-4.5.1.tar.gz
rm gcc-4.5.1.tar.gz
./makeGcc #Can be killed and restarted
sed -i s/"export WM_COMPILER=Gcc"/"export WM_COMPILER=Gcc45"/g $FOAM_INST_DIR/OpenFOAM-2.0.x/etc/bashrc
sed -i s/"foamCompiler=system/"foamCompiler=ThirdParty"/g $FOAM_INST_DIR/OpenFOAM-2.0.x/etc/bashrc
sed -i s/"gcc-4.5.2"/"gcc-4.5.1"/g $FOAM_INST_DIR/OpenFOAM-2.0.x/etc/bashrc
flex --version #Available, but it will not work properly (“error: no ‘int yyFlexLexer::ywrap()’ member function declared in class ‘yyFlexer’”,):

cd $WM_THIRD_PARTY_DIR
wget http://downloads.sourceforge.net/project/flex/flex/flex-2.5.35/flex-2.5.35.tar.gz?r=http%3A%2F%2Fflex.sourceforge.net%2F&ts=1282292981&mirror=garr
tar xzf flex-2.5.35.tar.gz
rm flex-2.5.35.tar.gz
cd flex-2.5.35
./configure --prefix $WM_THIRD_PARTY_DIR/platforms/linux64/flex-2.5.35
make
make install
Set in settings.sh:
_foamAddPath $WM_THIRD_PARTY_DIR/platforms/linux64/flex-2.5.35/bin
For all the files that complained about flex, add in Make/options:
-I$(WM_THIRD_PARTY_DIR)/platforms/$(WM_ARCH)/flex-2.5.35/include
I.e.:
  src/triSurface/Make/options
  src/surfMesh/Make/options
  src/thermophysicalModels/reactionThermo/Make/options
  applications/utilities/mesh/conversion/ansysToFoam/Make/options
  applications/utilities/mesh/conversion/fluent3DMeshToFoam/Make/options
  applications/utilities/mesh/conversion/fluentMeshToFoam/Make/options
  applications/utilities/mesh/conversion/gambitToFoam/Make/options
Open new terminal window and type:
OF20x
foam
./Allwmake >& log_Allwmake_1&

Parafoam:
qmake --version #Required: 3.6.2 or newer. bash: qmake: command not found
cmake --version #Required: 2.8.2 or newer. Ok!
cd $WM_THIRD_PARTY_DIR
wget http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.3.tar.gz
tar xzf qt-everywhere-opensource-src-4.7.3.tar.gz
./makeQt
echo "export QT_DIR=\$WM_THIRD_PARTY_DIR/platforms/\$WM_ARCH\$WM_COMPILER/qt-4.7.3" >> $FOAM_INST_DIR/OpenFOAM-2.0.x/etc/config/paraview.sh
echo "export QT_BIN_DIR=\$QT_DIR/bin" >> $FOAM_INST_DIR/OpenFOAM-2.0.x/etc/config/paraview.sh
echo "export PATH=\$QT_BIN_DIR:\$PATH" >> $FOAM_INST_DIR/OpenFOAM-2.0.x/etc/config/paraview.sh
echo "export LD_LIBRARY_PATH=\$QT_DIR/lib:\$LD_LIBRARY_PATH" >> $FOAM_INST_DIR/OpenFOAM-2.0.x/etc/config/paraview.sh

Open a new terminal:
OF20x
cd $WM_THIRD_PARTY_DIR
./makeParaView
cd $FOAM_UTILITIES/postProcessing/graphics/PV3Readers
wmSET
./Allwclean
./Allwmake

 

Compile 1.6-ext in Debug mode without re-compiling ThirdParty

First do soft links from linux64GccDPOpt to linux64GccDPDebug in the following

(ln -s linux64GccDPOpt linux64GccDPDebug)
[hani@vcs64-5 ThirdParty]$ find $WM_THIRD_PARTY_DIR -name linux64GccDPDebug
/chalmers/sw/unsup64/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/packages/mesquite-2.1.2/platforms/linux64GccDPDebug
/chalmers/sw/unsup64/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/packages/cmake-2.8.3/platforms/linux64GccDPDebug
/chalmers/sw/unsup64/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/packages/ParMetis-3.1.1/platforms/linux64GccDPDebug
/chalmers/sw/unsup64/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/packages/openmpi-1.4.3/platforms/linux64GccDPDebug
/chalmers/sw/unsup64/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/packages/metis-5.0pre2/platforms/linux64GccDPDebug
/chalmers/sw/unsup64/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/packages/ParMGridGen-1.0/platforms/linux64GccDPDebug
/chalmers/sw/unsup64/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/packages/ParaView-3.8.1/platforms/linux64GccDPDebug
/chalmers/sw/unsup64/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/packages/scotch-5.1.10b/platforms/linux64GccDPDebug

Then use WM_COMPILE_OPTION=Debug and run Allwmake

Installation of Python etc. in unsup64

 

Check out www.enthought.com for an academic licence of a complete package.

After installation by running the *.sh file, simply add the path:

alias EDP='export PATH=/chalmers/sw/unsup64/OpenFOAM/edp-7.1.2-rh5-x86_64/bin:$PATH'

This seems to work nicely!

 

Some initial attempts to install Python-2.6.7 and numpy-1.6.1:

2.7* did not work to make

Done directly in unsup64:
cd /chalmers/sw/unsup64/OpenFOAM/linuxSrc/
wget http://www.python.org/ftp/python/2.6.7/Python-2.6.7.tgz
tar xzf Python-2.6.7.tgz
rm Python-2.6.7.tgz
cd Python-2.6.7
Read README file:
Don't have PYTHONPATH and PYTHONHOME set when making Python
./configure --prefix /chalmers/sw/unsup64/OpenFOAM/Python-2.6.7
make
make install

add PATH to the bin directory of the installation, overriding other installations:

alias PNM='export PATH=/chalmers/sw/unsup64/OpenFOAM/Python-2.6.7/bin:$PATH;export PYTHONPATH=/chalmers/sw/unsup64/OpenFOAM/numpy-1.6.1/lib/python2.6/site-packages:$PYTHONPATH'

(the numpy part is of course so that Python finds numpy when importing)

 

Make sure to use Python2.6 first
/chalmers/sw/unsup64/OpenFOAM/linuxSrc/
wget --no-check-certificate https://downloads.sourceforge.net/project/numpy/NumPy/1.6.1/numpy-1.6.1.tar.gz?r=&ts=1313070315&use_mirror=netcologne
tar xzf numpy-1.6.1.tar.gz
rm numpy-1.6.1.tar.gz
cd numpy-1.6.1
python setup.py install --prefix /chalmers/sw/unsup64/OpenFOAM/numpy-1.6.1
export PYTHONPATH=/chalmers/sw/unsup64/OpenFOAM/numpy-1.6.1/lib/python2.6/site-packages:$PYTHONPATH

Compilation of gcc-4.3.1 and using it to compile OpenFOAM-1.5-dev

If you don't have the correct version of gcc (4.3.1 or newer, see gcc.gnu.org), then do the following (for 32 bit, some minor changes are required for 64 bit, like linux64 instead of linux):

1.      Install gcc 4.3.1. This requires that either any version of cc or gcc are available already. It also requires that two libraries, mpfr and gmp, are available, which is the reason to the lengthy installation procedure below:

cd $HOME/OpenFOAM/ThirdParty
mkdir gmp-4.3.2
mkdir mpfr-2.3.2
mv gcc-4.3.1 gcc-4.3.1_orig; mkdir -p gcc-4.3.1/platforms/linux
mkdir linuxSrc; cd linuxSrc
wget ftp://ftp.gmplib.org/pub/gmp-4.3.2/gmp-4.3.2.tar.gz
tar xzf gmp-4.3.2.tar.gz
cd gmp-4.3.2
./configure --prefix=$HOME/OpenFOAM/ThirdParty/gmp-4.3.2 2>&1 | tee log_configure
make 2>&1 | tee log_make #Check this file for error messages!
make check 2>&1 | tee log_make_check #Check this file for error messages!
make install 2>&1 | tee log_make_install #Check this file for error messages!
cd ..
wget http://www.mpfr.org/mpfr-2.3.2/mpfr-2.3.2.tar.gz
tar xzf mpfr-2.3.2.tar.gz
cd mpfr-2.3.2
./configure --prefix=$HOME/OpenFOAM/ThirdParty/mpfr-2.3.2 --with-gmp=$HOME/OpenFOAM/ThirdParty/gmp-4.3.2 2>&1 | tee log_configure
make 2>&1 | tee log_make #Check this file for error messages!
make check 2>&1 | tee log_make_check #Check this file for error messages!
make install 2>&1 | tee log_make_install #Check this file for error messages!
cd ..
wget http://gcc-uk.internet.bs/releases/gcc-4.3.1/gcc-4.3.1.tar.gz
tar xzf gcc-4.3.1.tar.gz
cd gcc-4.3.1
make distclean #This is only necessary if gcc has been built before, but doesn't hurt
./configure --prefix=$HOME/OpenFOAM/ThirdParty/gcc-4.3.1/platforms/linux -enable-languages=c,c++ --with-gmp=$HOME/OpenFOAM/ThirdParty/gmp-4.3.2 --with-mpfr=$HOME/OpenFOAM/ThirdParty/mpfr-2.3.2 2>&1 | tee log_configure
make 2>&1 | tee log_make #Check this file for error messages!
make install 2>&1 | tee log_make_install #Check this file for error messages!

Before compiling OpenFOAM-1.5-dev we need to make sure that our freshly compiled gcc will be used, which is done by a change in $WM_PROJECT_DIR/etc/settings.h:
Change:

#compilerInstall=OpenFOAM
compilerInstall=System

to:

compilerInstall=OpenFOAM
#compilerInstall=System

Then open a new terminal window and do the following:

OF15dev
foam
./Allwmake 2>&1 | tee log_Allwmake

The compilation will take something in the order of four hours.

Problem with flex

If you get an error message saying something like: “error: no ‘int yyFlexLexer::ywrap()’ member function declared in class ‘yyFlexer’”, then that can be solved by compiling your own flex-2.5.35:

 

mkdir -p $WM_THIRD_PARTY_DIR/flex-2.5.35
cd $WM_THIRD_PARTY_DIR/linuxSrc
wget http://downloads.sourceforge.net/project/flex/flex/flex-2.5.35/flex-2.5.35.tar.gz?r=http%3A%2F%2Fflex.sourceforge.net%2F&ts=1282292981&mirror=garr
tar xzf flex-2.5.35.tar.gz
cd flex-2.5.35
./configure --prefix $WM_THIRD_PARTY_DIR/flex-2.5.35 2>&1 | tee log_configure
make 2>&1 | tee log_make
make install 2>&1 | tee log_make_install

Set in settings.sh:

export PATH=$WM_THIRD_PARTY_DIR/flex-2.5.35/bin:$PATH

For all the files that complained about flex, add in Make/options:
-I$(WM_THIRD_PARTY_DIR)/flex-2.5.35/include

Install VTK to make a GUI with a visualization window

Here I dump some preliminary information on how to install VTK in FoDAT

For some reason you need the tk_dev package in order to use Python wrap.

cd $HOME/OpenFOAM/linuxSrc

wget http://www.vtk.org/files/release/5.6/vtk-5.6.1.tar.gz

tar xzf vtk-5.6.1.tar.gz

cd ..

mkdir VTK-build

cd VTK-build

ccmake ../linuxSrc/VTK

In ccmake, press ‘c’ to configure, and ‘Enter’ to change values:

Make sure to set:

BUILD_SHARED_LIBS to ON

VTK_WRAP_PYTHON to ON

CMAKE_INSTALL_PREFIX to $HOME/OpenFOAM/VTK-build (or wherever you have put it)

Then press ‘c’ to configure again and ‘g’ to save the configuration and exit, and continue in the terminal window…

make

Before the next command it seems to be necessary to do “export PYTHONPATH=$FOAM_INST_DIR/VTK-build/lib/python2.4/site-packages”

make install

Then it failed since there was a directory missing. I just added it and run make install again.

Then set:

export LD_LIBRARY_PATH=/chalmers/sw/unsup64/OpenFOAM/VTK-build/bin:$FOAM_INST_DIR/VTK-build/lib/python2.4/site-packages/VTK-5.6.1-py2.4.egg/vtk:$FOAM_INST_DIR/VTK-build/lib/vtk-5.6:$LD_LIBRARY_PATH

export PYTHONPATH=/chalmers/sw/unsup64/OpenFOAM/VTK/Wrapping/Python:/chalmers/sw/unsup64/OpenFOAM/VTK-build/bin:$FOAM_INST_DIR/VTK-build/lib/python2.4/site-packages:$PYTHONPATH

i.e. note that the original VTK directory can not be removed. Don’t know why Wrapping is not installed to VTK-build.

Install PyQt4 to make a GUI

Here I dump some preliminary information on how to install PyQt4 in FoDAT:

First make sure that qt was installed in the same location as it is located, i.e. DON’T MOVE QT after it has been installed – it remembers the original path!

First source OpenFOAM and the available qt installation (see above for OF-1.7.x. Note: QMAKESPEC, below, should not be set before installing qt):

OF17x

Then install SIP:

cd $FOAM_INST_DIR

mkdir sip-4.11.2

cd $FOAM_INST_DIR/linuxSrc/sip-4.11.2

python configure.py –b $FOAM_INST_DIR/sip-4.11.2 –e $FOAM_INST_DIR/sip-4.11.2 –d $FOAM_INST_DIR/sip-4.11.2 –v $FOAM_INST_DIR/sip-4.11.2

Then install PyQt-x11-gpl-4.8.1:

cd $FOAM_INST_DIR/linuxSrc/PyQt-x11-gpl-4.8.1

export PYTHONPATH=$FOAM_INST_DIR/sip-4.11.2

export QTDIR=$FOAM_INST_DIR/ThirdParty-1.7.x/qt-everywhere-opensource-src-4.6.3

export QMAKESPEC=$QTDIR/mkspecs/linux-g++-64

python configure.py --verbose --confirm-license -b $FOAM_INST_DIR/PyQt-x11-gpl-4.8.1 -d $FOAM_INST_DIR/PyQt-x11-gpl-4.8.1

make

make install

The following is probably not needed:

export LD_LIBRARY_PATH=$FOAM_INST_DIR/PyQt-x11-gpl-4.8.1/PyQt:$LD_LIBRARY_PATH

The following IS needed:

export PYTHONPATH=$FOAM_INST_DIR/PyQt-x11-gpl-4.8.1:$PYTHONPATH

Qt documentation:

doc.qt.nokia.com