Difference between revisions of "Installation/Linux/foam-extend-4.0/Ubuntu"

From OpenFOAMWiki
(Ubuntu 18.04)
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
= Introduction =
 
= Introduction =
This page is dedicated to preparing an [http://www.ubuntu.com Ubuntu] system for installing {{-Extend}} {{version4.1-ext}}.
+
This page is dedicated to preparing an [http://www.ubuntu.com Ubuntu] system for installing {{-Extend}} {{version4.0-ext}}.
  
 
__FORCETOC__
 
__FORCETOC__
Line 7: Line 7:
 
= Ubuntu versions =
 
= Ubuntu versions =
  
== Ubuntu 18.04 ==
+
== Ubuntu 12.04 ==
 
+
 
Run the following commands:
 
Run the following commands:
 
<bash>sudo apt-get update</bash>
 
<bash>sudo apt-get update</bash>
<bash>sudo apt-get install git-core build-essential binutils-dev cmake flex \
+
<bash>sudo apt-get install git-core build-essential binutils-dev flex bear \
zlib1g-dev qt4-dev-tools libqt4-dev libncurses5-dev curl bison\
+
bison zlib1g-dev qt4-dev-tools libqt4-dev libncurses5-dev libreadline-dev \
 
libxt-dev rpm mercurial graphviz python python-dev
 
libxt-dev rpm mercurial graphviz python python-dev
 
</bash>
 
</bash>
  
Then follow the instructions on the previous page, subsection [[Installation/Linux/foam-extend-4.1#Installing from source code|Get the source code]], but keep in mind to run a few additional commands '''before''' you run '''{{tt|source etc/bashrc}}'''... More specifically, the commands should be executed something like this:
+
Then follow the instructions on the previous page, subsection [[Installation/Linux/foam-extend-4.0#Installing from source code|Get the source code]], although keep in mind to run the following commands '''before''' you run '''{{tt|source etc/bashrc}}''':
<bash>cd ~/foam/foam-extend-4.1
+
<bash>echo export WM_COMPILER=Gcc49 >> etc/prefs.sh
 +
echo export WM_THIRD_PARTY_USE_GCC_492=1 >> etc/prefs.sh
 +
echo export compilerInstall=FOAM >> etc/prefs.sh</bash>
  
echo "export WM_CC='gcc-7'"  >> etc/prefs.sh
+
More specifically, the commands should be executed something like this:
echo "export WM_CXX='g++-7'" >> etc/prefs.sh
+
<bash>cd ~/foam/foam-extend-4.0
 +
 
 +
echo export WM_COMPILER=Gcc49 >> etc/prefs.sh
 +
echo export WM_THIRD_PARTY_USE_GCC_492=1 >> etc/prefs.sh
 +
echo export compilerInstall=FOAM >> etc/prefs.sh
  
 
source etc/bashrc</bash>
 
source etc/bashrc</bash>
  
Then before running {{tt|Allwmake.firstInstall}}, run the following commands:
+
== Ubuntu 14.04 ==
<bash>sed -i -e 's=rpmbuild --define=rpmbuild --define "_build_id_links none" --define=' ThirdParty/tools/makeThirdPartyFunctionsForRPM
+
 
sed -i -e 's/gcc/\$(WM_CC)/' wmake/rules/linux64Gcc/c
+
Run the following commands:
sed -i -e 's/g++/\$(WM_CXX)/' wmake/rules/linux64Gcc/c++
+
<bash>sudo apt-get update</bash>
 +
<bash>sudo apt-get install git-core build-essential binutils-dev cmake flex \
 +
bison zlib1g-dev qt4-dev-tools libqt4-dev libncurses5-dev libiberty-dev \
 +
libxt-dev rpm mercurial graphviz python python-dev
 
</bash>
 
</bash>
  
== Ubuntu 19.10 ==
+
Then continue following the instructions on the previous page, subsection [[Installation/Linux/foam-extend-4.0#Installing from source code|Get the source code]].
 +
 
 +
 
 +
== Ubuntu 16.04 ==
  
 
Run the following commands:
 
Run the following commands:
 
<bash>sudo apt-get update</bash>
 
<bash>sudo apt-get update</bash>
 
<bash>sudo apt-get install git-core build-essential binutils-dev cmake flex \
 
<bash>sudo apt-get install git-core build-essential binutils-dev cmake flex \
zlib1g-dev qt4-dev-tools libqt4-dev libncurses5-dev curl bison\
+
zlib1g-dev qt4-dev-tools libqt4-dev libncurses5-dev libiberty-dev \
libxt-dev rpm mercurial graphviz python python-dev gcc-7 g++-7
+
libxt-dev rpm mercurial graphviz python python-dev
 
</bash>
 
</bash>
  
Then follow the instructions on the previous page, subsection [[Installation/Linux/foam-extend-4.1#Installing from source code|Get the source code]], but keep in mind to run a few additional commands '''before''' you run '''{{tt|source etc/bashrc}}'''... More specifically, the commands should be executed something like this:
+
Then follow the instructions on the previous page, subsection [[Installation/Linux/foam-extend-4.0#Installing from source code|Get the source code]], although keep in mind to run the following commands '''before''' you run '''{{tt|source etc/bashrc}}''':
<bash>cd ~/foam/foam-extend-4.1
+
<bash>echo export WM_THIRD_PARTY_USE_BISON_27=1  >> etc/prefs.sh</bash>
  
echo "export WM_CC='gcc-7'"  >> etc/prefs.sh
+
More specifically, the commands should be executed something like this:
echo "export WM_CXX='g++-7'"  >> etc/prefs.sh
+
<bash>cd ~/foam/foam-extend-4.0
 +
 
 +
echo export WM_THIRD_PARTY_USE_BISON_27=1  >> etc/prefs.sh
 +
 
 +
source etc/bashrc</bash>
 +
 
 +
 
 +
'''Note''': If you are using Ubuntu within WSL, then study this thread: [https://www.cfd-online.com/Forums/openfoam-installation/216670-problems-compiling-foam-extend-4-0-fsifoam-ubuntu-wsl.html Problems compiling foam-extend-4.0 + fsiFoam on Ubuntu+WSL]
 +
 
 +
== Ubuntu 18.04 ==
 +
 
 +
Run the following commands:
 +
<bash>sudo apt-get update</bash>
 +
<bash>sudo apt-get install git-core build-essential binutils-dev cmake flex bear \
 +
zlib1g-dev libncurses5-dev libreadline-dev \
 +
libxt-dev rpm mercurial graphviz python python-dev  python3 python3-dev gcc-5 g++-5 \
 +
gnuplot gnuplot-qt gnuplot-data
 +
</bash>
 +
 
 +
Then follow the instructions on the previous page, subsection [[Installation/Linux/foam-extend-4.0#Installing from source code|Get the source code]], but keep in mind to run a few additional commands '''before''' you run '''{{tt|source etc/bashrc}}'''... More specifically, the commands should be executed something like this:
 +
<bash>cd ~/foam/foam-extend-4.0
 +
 
 +
echo export WM_THIRD_PARTY_USE_BISON_27=1  >> etc/prefs.sh
 +
echo "export WM_CC='gcc-5'"  >> etc/prefs.sh
 +
echo "export WM_CXX='g++-5'"  >> etc/prefs.sh
  
 
source etc/bashrc</bash>
 
source etc/bashrc</bash>
Line 52: Line 87:
 
sed -i -e 's/g++/\$(WM_CXX)/' wmake/rules/linux64Gcc/c++
 
sed -i -e 's/g++/\$(WM_CXX)/' wmake/rules/linux64Gcc/c++
 
</bash>
 
</bash>
 +
 +
Now you can start the compilation by issuing:
 +
 +
<bash>./Allwmake.firstInstall
 +
</bash>
 +
 +
This will most likely ask you, if you want to proceed without compiling paraview. I recommend that you answer "Y" and install the current version of paraview separately, since most beginner's problems with the installation of (Open)FOAM are related to the compilation of paraview rather than (Open)FOAM itself.
 +
 +
== Ubuntu 20.04 ==
 +
 +
Ubuntu 20.04 does not supply gcc/g++5 in its repository.
 +
 +
The gcc5 toolchain can be installed from the 18.04 repositories. Be aware that this may break some dependencies in rare cases.
 +
 +
Add the 18.04 universe repository as an apt-source:
 +
 +
<bash> sudo sh -c 'echo deb http://gb.archive.ubuntu.com/ubuntu/ bionic universe > /etc/apt/sources.list.d/bionic_legacy.list' </bash>
 +
 +
After that follow instructions for Ubuntu 18.04 above.
  
 
[[Category:Installing OpenFOAM on Linux]] [[Category:Installing OpenFOAM on Ubuntu]]
 
[[Category:Installing OpenFOAM on Linux]] [[Category:Installing OpenFOAM on Ubuntu]]

Latest revision as of 15:26, 11 August 2020

1 Introduction

This page is dedicated to preparing an Ubuntu system for installing the foam-extend project OF Version 40ext.png.


2 Ubuntu versions

2.1 Ubuntu 12.04

Run the following commands:

sudo apt-get update
sudo apt-get install git-core build-essential binutils-dev flex bear \
bison zlib1g-dev qt4-dev-tools libqt4-dev libncurses5-dev libreadline-dev \
libxt-dev rpm mercurial graphviz python python-dev

Then follow the instructions on the previous page, subsection Get the source code, although keep in mind to run the following commands before you run source etc/bashrc:

echo export WM_COMPILER=Gcc49 >> etc/prefs.sh
echo export WM_THIRD_PARTY_USE_GCC_492=1  >> etc/prefs.sh
echo export compilerInstall=FOAM >> etc/prefs.sh

More specifically, the commands should be executed something like this:

cd ~/foam/foam-extend-4.0
 
echo export WM_COMPILER=Gcc49 >> etc/prefs.sh
echo export WM_THIRD_PARTY_USE_GCC_492=1  >> etc/prefs.sh
echo export compilerInstall=FOAM >> etc/prefs.sh
 
source etc/bashrc

2.2 Ubuntu 14.04

Run the following commands:

sudo apt-get update
sudo apt-get install git-core build-essential binutils-dev cmake flex \
bison zlib1g-dev qt4-dev-tools libqt4-dev libncurses5-dev libiberty-dev \
libxt-dev rpm mercurial graphviz python python-dev

Then continue following the instructions on the previous page, subsection Get the source code.


2.3 Ubuntu 16.04

Run the following commands:

sudo apt-get update
sudo apt-get install git-core build-essential binutils-dev cmake flex \
zlib1g-dev qt4-dev-tools libqt4-dev libncurses5-dev libiberty-dev \
libxt-dev rpm mercurial graphviz python python-dev

Then follow the instructions on the previous page, subsection Get the source code, although keep in mind to run the following commands before you run source etc/bashrc:

echo export WM_THIRD_PARTY_USE_BISON_27=1  >> etc/prefs.sh

More specifically, the commands should be executed something like this:

cd ~/foam/foam-extend-4.0
 
echo export WM_THIRD_PARTY_USE_BISON_27=1  >> etc/prefs.sh
 
source etc/bashrc


Note: If you are using Ubuntu within WSL, then study this thread: Problems compiling foam-extend-4.0 + fsiFoam on Ubuntu+WSL

2.4 Ubuntu 18.04

Run the following commands:

sudo apt-get update
sudo apt-get install git-core build-essential binutils-dev cmake flex bear \
zlib1g-dev libncurses5-dev libreadline-dev \
libxt-dev rpm mercurial graphviz python python-dev  python3 python3-dev gcc-5 g++-5 \
gnuplot gnuplot-qt gnuplot-data

Then follow the instructions on the previous page, subsection Get the source code, but keep in mind to run a few additional commands before you run source etc/bashrc... More specifically, the commands should be executed something like this:

cd ~/foam/foam-extend-4.0
 
echo export WM_THIRD_PARTY_USE_BISON_27=1  >> etc/prefs.sh
echo "export WM_CC='gcc-5'"  >> etc/prefs.sh
echo "export WM_CXX='g++-5'"  >> etc/prefs.sh
 
source etc/bashrc

Then before running Allwmake.firstInstall, run the following commands:

sed -i -e 's=rpmbuild --define=rpmbuild --define "_build_id_links none" --define=' ThirdParty/tools/makeThirdPartyFunctionsForRPM
sed -i -e 's/gcc/\$(WM_CC)/' wmake/rules/linux64Gcc/c
sed -i -e 's/g++/\$(WM_CXX)/' wmake/rules/linux64Gcc/c++

Now you can start the compilation by issuing:

./Allwmake.firstInstall

This will most likely ask you, if you want to proceed without compiling paraview. I recommend that you answer "Y" and install the current version of paraview separately, since most beginner's problems with the installation of (Open)FOAM are related to the compilation of paraview rather than (Open)FOAM itself.

2.5 Ubuntu 20.04

Ubuntu 20.04 does not supply gcc/g++5 in its repository.

The gcc5 toolchain can be installed from the 18.04 repositories. Be aware that this may break some dependencies in rare cases.

Add the 18.04 universe repository as an apt-source:

 sudo sh -c 'echo deb http://gb.archive.ubuntu.com/ubuntu/ bionic universe > /etc/apt/sources.list.d/bionic_legacy.list'

After that follow instructions for Ubuntu 18.04 above.