2014-05-07 10:24:09 +00:00
|
|
|
Below are build instructions for Ubuntu 14.04.
|
|
|
|
|
2014-06-01 18:12:52 +00:00
|
|
|
These instructions assume that you install in the default location, which is
|
2014-05-07 10:24:09 +00:00
|
|
|
~/foam/ . Create this folder with:
|
|
|
|
|
|
|
|
cd ~
|
|
|
|
mkdir foam
|
|
|
|
|
|
|
|
|
|
|
|
* Obtain and unpack source code (if you read this, you probably already have):
|
|
|
|
|
2014-06-01 18:12:52 +00:00
|
|
|
The recommended way is to get the source code through git source code
|
2014-05-07 10:24:09 +00:00
|
|
|
management system. This way, you can get updates and bugfixes easily by running
|
2014-06-01 18:12:52 +00:00
|
|
|
"git pull". To install into the default location run:
|
2014-05-07 10:24:09 +00:00
|
|
|
|
|
|
|
cd ~/foam
|
2014-06-01 20:37:19 +00:00
|
|
|
git clone git://git.code.sf.net/p/openfoam-extend/foam-extend-3.1
|
2014-05-07 10:24:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
Alternatively, you can download a snapshot (.tgz) of the source code from:
|
2014-06-01 20:37:19 +00:00
|
|
|
http://sourceforge.net/projects/openfoam-extend/files/foam-extend-3.1/
|
2014-05-07 10:24:09 +00:00
|
|
|
|
|
|
|
|
2014-06-01 03:26:57 +00:00
|
|
|
* Update your Ubuntu installation:
|
|
|
|
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get upgrade
|
|
|
|
|
2014-05-07 10:24:09 +00:00
|
|
|
* Install required packages:
|
|
|
|
|
2014-06-01 03:26:57 +00:00
|
|
|
sudo apt-get install git-core build-essential binutils-dev flex \
|
2014-05-07 10:24:09 +00:00
|
|
|
zlib1g-dev qt4-dev-tools libqt4-dev libncurses5-dev libiberty-dev \
|
2014-06-01 03:26:57 +00:00
|
|
|
libxt-dev rpm mercurial graphviz openmpi-bin libopenmpi-dev cmake
|
2014-06-01 18:12:52 +00:00
|
|
|
|
2014-06-01 03:26:57 +00:00
|
|
|
|
|
|
|
* For Ubuntu 14.04, you need to customize some of the ThirdParty packages
|
|
|
|
in order to enable the usage of system-provided packages, and to enable
|
|
|
|
the compilation of other, like bison-2.7.
|
|
|
|
|
|
|
|
Here is a list of sed commands that will do just that. You can copy/paste
|
|
|
|
the following block of commands in a control terminal in order to make
|
|
|
|
the necessary adjustments. You will need to be located at the root of your
|
2014-06-01 22:13:12 +00:00
|
|
|
foam-extend-3.1 installation for those commands to work.
|
2014-06-01 03:26:57 +00:00
|
|
|
|
|
|
|
####################################################################
|
|
|
|
#
|
|
|
|
# Create a prefs.sh file
|
|
|
|
cp etc/prefs.sh-EXAMPLE etc/prefs.sh
|
|
|
|
|
|
|
|
# Use openmpi 1.6.5 as supplied by Ubuntu 14.04
|
|
|
|
sed -i s/"#export WM_MPLIB=SYSTEMOPENMPI"/"export WM_MPLIB=SYSTEMOPENMPI"/g etc/prefs.sh
|
|
|
|
sed -i s/"#export OPENMPI_DIR=path_to_system_installed_openmpi"/"export OPENMPI_DIR=\/usr"/g etc/prefs.sh
|
|
|
|
sed -i s/"#export OPENMPI_BIN_DIR=\$OPENMPI_DIR\/bin"/"export OPENMPI_BIN_DIR=\$OPENMPI_DIR\/bin"/g etc/prefs.sh
|
2014-05-07 10:24:09 +00:00
|
|
|
|
2014-06-01 03:26:57 +00:00
|
|
|
# Use Qt 4.8.6 as provided by Ubuntu 14.04
|
|
|
|
sed -i s/"#export QT_DIR=path_to_system_installed_qt"/"export QT_DIR=\/usr"/g etc/prefs.sh
|
|
|
|
sed -i s/"#export QT_BIN_DIR=\$QT_DIR\/bin"/"export QT_BIN_DIR=\$QT_DIR\/bin"/g etc/prefs.sh
|
|
|
|
|
|
|
|
# Use cmake 2.8.12.2 as provided by Ubuntu 14.04
|
|
|
|
sed -i s/"( rpm_make -p cmake"/"#( rpm_make -p cmake"/g ThirdParty/AllMake.stage1
|
|
|
|
|
|
|
|
# Compile and install bison-2.7 from the ThirdParty packages.
|
2014-06-01 18:12:52 +00:00
|
|
|
sed -i 0,/"#( rpm_make -p bison-2.7"/s//"( rpm_make -p bison-2.7"/ ThirdParty/AllMake.stage1
|
2014-06-01 03:26:57 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
####################################################################
|
2014-05-07 10:24:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
* Set environment variables:
|
|
|
|
|
2014-06-01 20:37:19 +00:00
|
|
|
cd ~/foam/foam-extend-3.1
|
2014-05-07 10:24:09 +00:00
|
|
|
. etc/bashrc
|
|
|
|
|
|
|
|
Optionally, set environment variable for compiling Cuda solvers, for example
|
2014-06-01 18:12:52 +00:00
|
|
|
(replace "sm_30" with value according to your GPU architecture):
|
2014-05-07 10:24:09 +00:00
|
|
|
|
|
|
|
export CUDA_ARCH=sm_30
|
|
|
|
|
|
|
|
|
|
|
|
* Compile:
|
|
|
|
|
|
|
|
./Allwmake.firstInstall
|
|
|
|
|
|
|
|
|
|
|
|
* Create user directory:
|
|
|
|
|
|
|
|
mkdir -p $FOAM_RUN
|
|
|
|
|
|
|
|
|
|
|
|
And you are ready to start.
|