CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   Walkthrough: Installation of OpenFOAM-1.6-ext on openSUSE 12.2 64-bit (https://www.cfd-online.com/Forums/openfoam-installation/108486-walkthrough-installation-openfoam-1-6-ext-opensuse-12-2-64-bit.html)

wenterodt October 24, 2012 16:51

Walkthrough: Installation of OpenFOAM-1.6-ext on openSUSE 12.2 64-bit
 
Installation of OpenFOAM-1.6-ext on openSUSE 12.2 64-bit
--------------------------------------------------------------------------------

We assume you have a fresh installation of openSUSE 12.2 64-bit, with all the
necessary updates already applied

--------------------------------------------------------------------------------

# Installation of additional system packages:

sudo zypper install git
sudo zypper install openmpi-devel
sudo zypper install gnuplot
sudo zypper install -t pattern devel_qt4

--------------------------------------------------------------------------------

# Download OpenFOAM-1.6-ext

mkdir ~/OpenFOAM
cd ~/OpenFOAM
git clone git://openfoam-extend.git.sourceforge.net/gitroot/openfoam-extend/OpenFOAM-1.6-ext

# apply the hotfix for gcc4.7 by Philippose Rajan
git branch hotfix/gcc47
git checkout hotfix/gcc47

--------------------------------------------------------------------------------

# We need to tweak our OpenFOAM setup using the prefs.sh file

cp ~/OpenFOAM/OpenFOAM-1.6-ext/etc/prefs.sh-EXAMPLE \
~/OpenFOAM/OpenFOAM-1.6-ext/etc/prefs.sh

--------------------------------------------------------------------------------

# In order to speed up compilation, we can increase the number of processors
# to be used for compilations to the number of available processors
# i.e. change line 131 of ~/OpenFOAM/OpenFOAM-1.6-ext/etc/bashrc to e.g.
: ${WM_NCOMPPROCS:=4}; export WM_NCOMPPROCS

--------------------------------------------------------------------------------

# We are going to use the system installed version of gcc-4.7.1

# Modify the etc/prefs.sh file to switch to gcc 4.7.1
sed -i s/"compilerInstall=System"/"compilerInstall=System\nWM_COMPILER=Gcc47"/g ~/OpenFOAM/OpenFOAM-1.6-ext/etc/prefs.sh

# copy make rules from 4.6
cp -r ~/OpenFOAM/OpenFOAM-1.6-ext/wmake/rules/linux64Gcc46 ~/OpenFOAM/OpenFOAM-1.6-ext/wmake/rules/linux64Gcc47

# due to stricter name lookup rules in 4.7 we need to tell the compiler to lighten up on this
# in ~/OpenFOAM/OpenFOAM-1.6-ext/wmake/rules/linux64Gcc47/c++ add the compile option "-fpermissive" to line 11 so that it reads:
c++FLAGS = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC -fpermissive

-------------------------------------------------------------------------------

# We are going to use the system installed version of openmpi-1.5.4
#
# No need to run AllMake.stage2
sed -i s/"#export WM_MPLIB=SYSTEMOPENMPI"/"export WM_MPLIB=SYSTEMOPENMPI"/g ~/OpenFOAM/OpenFOAM-1.6-ext/etc/prefs.sh
sed -i s/"#export OPENMPI_DIR=path_to_system_installed_openmpi"/"export OPENMPI_DIR=\/usr\/lib64\/mpi\/gcc\/openmpi"/g ~/OpenFOAM/OpenFOAM-1.6-ext/etc/prefs.sh
sed -i s/"#export OPENMPI_BIN_DIR=\$OPENMPI_DIR\/bin"/"export OPENMPI_BIN_DIR=\$OPENMPI_DIR\/bin"/g ~/OpenFOAM/OpenFOAM-1.6-ext/etc/prefs.sh


--------------------------------------------------------------------------------

# We are going to use the system installed development version of Qt 4.8.1
# (I actually used 4.8.3 from build.opensuse.org/KDE. Can someone please confirm if 4.8.1 works, too?)

# Uncomment and modify the initialization of the variables QT_DIR and QT_BIN_DIR in the
# file prefs.sh

sed -i s/"#export QT_DIR=path_to_system_installed_qt"/"export QT_DIR=\/usr"/g ~/OpenFOAM/OpenFOAM-1.6-ext/etc/prefs.sh
sed -i s/"#export QT_BIN_DIR=\$QT_DIR\/bin"/"export QT_BIN_DIR=\$QT_DIR\/bin"/g ~/OpenFOAM/OpenFOAM-1.6-ext/etc/prefs.sh

# This section of the prefs.sh file should now look like this:

#export QT_THIRD_PARTY=1
export QT_DIR=/usr
export QT_BIN_DIR=$QT_DIR/bin

--------------------------------------------------------------------------------

# Source this initial OpenFOAM environment to get the basic configuration for
# compilation
. ~/OpenFOAM/OpenFOAM-1.6-ext/etc/bashrc

# Compile the ThirdParty packages

cd $WM_PROJECT_DIR/ThirdParty
./AllMake.stage1
./AllMake.stage3

--------------------------------------------------------------------------------

# paraview needs some special care due to a bug which would prevent compilation. Two files have to be
# altered after download, preventing a smooth run of AllMake.stage4.
# Instead a function of AllMake.stage4 which calls rpmbuild is changed and executed several times
# in order to pass the correct options to rpmbuild, doing step by step.
# Each run but the last will end with an error message
# The author is aware of this being a dirty hack and open for constructive criticism.

# in order to first only download and unpack the paraview sources (without compiling, thus adding -bp option)
# change line 158 of ~/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/tools/makeThirdPartyFunctionsForRPM to
rpmbuild -bp --define "_topdir $buildBase" --dbpath $buildBase/rpmDB -bb ./SPECS/$specFile "$@"

# run the skript
./AllMake.stage4

# Now two files need to be altered (for details see http://www.vtk.org/Bug/view.php?id=12881)
# in ~/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/rpmBuild/BUILD/ParaView-3.12.0/Utilities/Xdmf2/vtk/Testing/Cxx/XdmfTestVTKIO.cxx
# in line 39 add
#include <unistd.h>

# in ~/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/rpmBuild/BUILD/ParaView-3.12.0/Qt/Core/pqServerManagerSelectionModel.h
# change line 75 such that it reads
ClearAndSelect = static_cast<int>(Clear) | static_cast<int>(Select)

# now change line 158 of ~/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/tools/makeThirdPartyFunctionsForRPM to
rpmbuild --short-circuit -bc --define "_topdir $buildBase" --dbpath $buildBase/rpmDB -bb ./SPECS/$specFile "$@"

# build paraview
./AllMake.stage4

# now change line 158 of ~/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/tools/makeThirdPartyFunctionsForRPM to
rpmbuild --short-circuit -bi --define "_topdir $buildBase" --dbpath $buildBase/rpmDB -bb ./SPECS/$specFile "$@"

# install paraview on build system
./AllMake.stage4

# now change line 158 of ~/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/tools/makeThirdPartyFunctionsForRPM to
rpmbuild --short-circuit -bb --define "_topdir $buildBase" --dbpath $buildBase/rpmDB -bb ./SPECS/$specFile "$@"

# create binaries from rpm
./AllMake.stage4

--------------------------------------------------------------------------------

# Update your OpenFOAM environment to get the basic configuration from the newly
# compiled ThirdParty packages

. ~/OpenFOAM/OpenFOAM-1.6-ext/etc/bashrc

# Compile OpenFOAM-1.6-ext

cd $WM_PROJECT_DIR
./Allwmake >& log.Allwmake &
tail -f log.Allwmake # To keep an eye on the compilation process

--------------------------------------------------------------------------------

# Run a tutorial to check the basic functionality

cd $FOAM_TUTORIAL/incompressible/simpleFoam/pitzDaily
blockMesh >& log.blockMesh
simpleFoam >& log.simpleFoam
paraFoam

# You are done!

--------------------------------------------------------------------------------

Tammo Wenterodt 2012-10-24

based on
Martin Beaudoin May 2012
http://openfoam-extend.git.sourcefor...s/heads/master

jianxiyao November 22, 2012 11:04

Quote:

Originally Posted by wenterodt (Post 388366)
Installation of OpenFOAM-1.6-ext on openSUSE 12.2 64-bit
--------------------------------------------------------------------------------

We assume you have a fresh installation of openSUSE 12.2 64-bit, with all the
necessary updates already applied

--------------------------------------------------------------------------------

# Installation of additional system packages:

sudo zypper install git
sudo zypper install openmpi-devel
sudo zypper install gnuplot
sudo zypper install -t pattern devel_qt4

--------------------------------------------------------------------------------

# Download OpenFOAM-1.6-ext

mkdir ~/OpenFOAM
cd ~/OpenFOAM
git clone git://openfoam-extend.git.sourceforge.net/gitroot/openfoam-extend/OpenFOAM-1.6-ext

# apply the hotfix for gcc4.7 by Philippose Rajan
git branch hotfix/gcc47
git checkout hotfix/gcc47

--------------------------------------------------------------------------------

# We need to tweak our OpenFOAM setup using the prefs.sh file

cp ~/OpenFOAM/OpenFOAM-1.6-ext/etc/prefs.sh-EXAMPLE \
~/OpenFOAM/OpenFOAM-1.6-ext/etc/prefs.sh

--------------------------------------------------------------------------------

# In order to speed up compilation, we can increase the number of processors
# to be used for compilations to the number of available processors
# i.e. change line 131 of ~/OpenFOAM/OpenFOAM-1.6-ext/etc/bashrc to e.g.
: ${WM_NCOMPPROCS:=4}; export WM_NCOMPPROCS

--------------------------------------------------------------------------------

# We are going to use the system installed version of gcc-4.7.1

# Modify the etc/prefs.sh file to switch to gcc 4.7.1
sed -i s/"compilerInstall=System"/"compilerInstall=System\nWM_COMPILER=Gcc47"/g ~/OpenFOAM/OpenFOAM-1.6-ext/etc/prefs.sh

# copy make rules from 4.6
cp -r ~/OpenFOAM/OpenFOAM-1.6-ext/wmake/rules/linux64Gcc46 ~/OpenFOAM/OpenFOAM-1.6-ext/wmake/rules/linux64Gcc47

# due to stricter name lookup rules in 4.7 we need to tell the compiler to lighten up on this
# in ~/OpenFOAM/OpenFOAM-1.6-ext/wmake/rules/linux64Gcc47/c++ add the compile option "-fpermissive" to line 11 so that it reads:
c++FLAGS = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC -fpermissive

-------------------------------------------------------------------------------

# We are going to use the system installed version of openmpi-1.5.4
#
# No need to run AllMake.stage2
sed -i s/"#export WM_MPLIB=SYSTEMOPENMPI"/"export WM_MPLIB=SYSTEMOPENMPI"/g ~/OpenFOAM/OpenFOAM-1.6-ext/etc/prefs.sh
sed -i s/"#export OPENMPI_DIR=path_to_system_installed_openmpi"/"export OPENMPI_DIR=\/usr\/lib64\/mpi\/gcc\/openmpi"/g ~/OpenFOAM/OpenFOAM-1.6-ext/etc/prefs.sh
sed -i s/"#export OPENMPI_BIN_DIR=\$OPENMPI_DIR\/bin"/"export OPENMPI_BIN_DIR=\$OPENMPI_DIR\/bin"/g ~/OpenFOAM/OpenFOAM-1.6-ext/etc/prefs.sh


--------------------------------------------------------------------------------

# We are going to use the system installed development version of Qt 4.8.1
# (I actually used 4.8.3 from build.opensuse.org/KDE. Can someone please confirm if 4.8.1 works, too?)

# Uncomment and modify the initialization of the variables QT_DIR and QT_BIN_DIR in the
# file prefs.sh

sed -i s/"#export QT_DIR=path_to_system_installed_qt"/"export QT_DIR=\/usr"/g ~/OpenFOAM/OpenFOAM-1.6-ext/etc/prefs.sh
sed -i s/"#export QT_BIN_DIR=\$QT_DIR\/bin"/"export QT_BIN_DIR=\$QT_DIR\/bin"/g ~/OpenFOAM/OpenFOAM-1.6-ext/etc/prefs.sh

# This section of the prefs.sh file should now look like this:

#export QT_THIRD_PARTY=1
export QT_DIR=/usr
export QT_BIN_DIR=$QT_DIR/bin

--------------------------------------------------------------------------------

# Source this initial OpenFOAM environment to get the basic configuration for
# compilation
. ~/OpenFOAM/OpenFOAM-1.6-ext/etc/bashrc

# Compile the ThirdParty packages

cd $WM_PROJECT_DIR/ThirdParty
./AllMake.stage1
./AllMake.stage3

--------------------------------------------------------------------------------

# paraview needs some special care due to a bug which would prevent compilation. Two files have to be
# altered after download, preventing a smooth run of AllMake.stage4.
# Instead a function of AllMake.stage4 which calls rpmbuild is changed and executed several times
# in order to pass the correct options to rpmbuild, doing step by step.
# Each run but the last will end with an error message
# The author is aware of this being a dirty hack and open for constructive criticism.

# in order to first only download and unpack the paraview sources (without compiling, thus adding -bp option)
# change line 158 of ~/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/tools/makeThirdPartyFunctionsForRPM to
rpmbuild -bp --define "_topdir $buildBase" --dbpath $buildBase/rpmDB -bb ./SPECS/$specFile "$@"

# run the skript
./AllMake.stage4

# Now two files need to be altered (for details see http://www.vtk.org/Bug/view.php?id=12881)
# in ~/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/rpmBuild/BUILD/ParaView-3.12.0/Utilities/Xdmf2/vtk/Testing/Cxx/XdmfTestVTKIO.cxx
# in line 39 add
#include <unistd.h>

# in ~/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/rpmBuild/BUILD/ParaView-3.12.0/Qt/Core/pqServerManagerSelectionModel.h
# change line 75 such that it reads
ClearAndSelect = static_cast<int>(Clear) | static_cast<int>(Select)

# now change line 158 of ~/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/tools/makeThirdPartyFunctionsForRPM to
rpmbuild --short-circuit -bc --define "_topdir $buildBase" --dbpath $buildBase/rpmDB -bb ./SPECS/$specFile "$@"

# build paraview
./AllMake.stage4

# now change line 158 of ~/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/tools/makeThirdPartyFunctionsForRPM to
rpmbuild --short-circuit -bi --define "_topdir $buildBase" --dbpath $buildBase/rpmDB -bb ./SPECS/$specFile "$@"

# install paraview on build system
./AllMake.stage4

# now change line 158 of ~/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/tools/makeThirdPartyFunctionsForRPM to
rpmbuild --short-circuit -bb --define "_topdir $buildBase" --dbpath $buildBase/rpmDB -bb ./SPECS/$specFile "$@"

# create binaries from rpm
./AllMake.stage4

--------------------------------------------------------------------------------

# Update your OpenFOAM environment to get the basic configuration from the newly
# compiled ThirdParty packages

. ~/OpenFOAM/OpenFOAM-1.6-ext/etc/bashrc

# Compile OpenFOAM-1.6-ext

cd $WM_PROJECT_DIR
./Allwmake >& log.Allwmake &
tail -f log.Allwmake # To keep an eye on the compilation process

--------------------------------------------------------------------------------

# Run a tutorial to check the basic functionality

cd $FOAM_TUTORIAL/incompressible/simpleFoam/pitzDaily
blockMesh >& log.blockMesh
simpleFoam >& log.simpleFoam
paraFoam

# You are done!

--------------------------------------------------------------------------------

Tammo Wenterodt 2012-10-24

based on
Martin Beaudoin May 2012
http://openfoam-extend.git.sourcefor...s/heads/master


i am installing 1.6-ext on suse 12.2 gnome. problems occur at the stage1. the log is as follows:

This system rpm command: rpm

========================================
Starting ThirdParty AllMake: Stage1
========================================

Package name : cmake-2.8.8
Package URL : http://www.cmake.org/files/v2.8/cmake-2.8.8.tar.gz
RPM spec file name: cmake-2.8.8.spec
Additional flags :
Updating the ThirdParty environment variables before building package cmake-2.8.8
Download cmake-2.8.8.tar.gz from : http://www.cmake.org/files/v2.8/cmake-2.8.8.tar.gz
asking libproxy about url 'http://www.cmake.org/files/v2.8/cmake-2.8.8.tar.gz'
libproxy suggest to use 'wpad://'
case 2: libproxy setting to use 'wpad://'
Error parsing proxy URL wpad://: Unsupported scheme `wpad'.
Making package cmake-2.8.8 using RPM.
Building package cmake-2.8.8 using SPEC file : cmake-2.8.8.spec. Optional args:
error: File /home/yao/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/rpmBuild/SOURCES/cmake-2.8.8.tar.gz: No such file or directory
Installing package: cmake-2.8.8
Uninstalling cmake-2.8.8 using RPM: cmake-2.8.8-linux64Gcc46DPOpt.x86_64
Installing cmake-2.8.8 using RPM file: /home/yao/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/rpmBuild/RPMS/x86_64/cmake-2.8.8-linux64Gcc46DPOpt.x86_64.rpm
error: open of /home/yao/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/rpmBuild/RPMS/x86_64/cmake-2.8.8-linux64Gcc46DPOpt.x86_64.rpm failed: No such file or directory
Done installing package

========================================
Done ThirdParty AllMake: Stage1
========================================

anybody can give me some tips? thanks in advance.

Jianxi

jianxiyao November 22, 2012 18:08

I have solved the problem :Error parsing proxy URL wpad://: Unsupported scheme `wpad'.

The new one is "error: open of /home/yao/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/rpmBuild/RPMS/x86_64/cmake-2.8.8-linux64Gcc46DPOpt.x86_64.rpm"

I think I miss something!?

jianxiyao November 22, 2012 18:09

And "tools/makeThirdPartyFunctionsForRPM:line 158: rpmbuild: not found command"

andyru January 10, 2013 11:18

reconfirmation of qt 4.8.1, that it works on suse 12.2 64 bit
 
@wenterodt:
Thank you very much for the explanation!

Everything worked perfektly, also with:
#QMake version 2.01a
#Using Qt version 4.8.1 in /usr/lib64
I can confirm this!

Best regards,

Andreas


All times are GMT -4. The time now is 12:55.