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

From OpenFOAMWiki
(Ubuntu 20.04 LTS)
(Ubuntu 20.04 LTS)
 
(5 intermediate revisions by the same user not shown)
Line 12: Line 12:
 
<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  libncurses5-dev curl bison \
+
zlib1g-dev  libncurses5-dev curl bison gnuplot gnuplot-qt gnuiplot-data \
libxt-dev rpm mercurial graphviz python python-dev python3 python3-dev
+
libxt-dev rpm mercurial graphviz python python-dev python3 python3-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]]. Ubuntu 18.04 LTS comes with gcc/g++ 7.4.0 as default, so does not need any other adaptation of the standard process.
 
Then follow the instructions on the previous page, subsection [[Installation/Linux/foam-extend-4.1#Installing from source code|Get the source code]]. Ubuntu 18.04 LTS comes with gcc/g++ 7.4.0 as default, so does not need any other adaptation of the standard process.
 
OPTIONAL: Preparations if you want to compile the version of Paraview that comes with foam-extend-4.1:
 
 
Paraview needs the QT4 library to compile:
 
 
<bash>sudo apt-get install qt4-dev-tools libqt4-dev</bash>
 
 
If you want to compile Paraview you also need to tell foam-extend where to find QT4:
 
 
<bash>cd ~/foam/foam-extend-4.1
 
echo "export QT_BIN_DIR=/usr/bin" >> etc/prefs.sh
 
echo "export WM_THIRD_PARTY_USE_QT_5111=1" >> etc/prefs.sh
 
echo "export WM_THIRD_PARTY_USE_PARAVIEW_552=1" >> etc/prefs.sh
 
 
source etc/bashrc
 
</bash>
 
 
  
 
Now you can start the compilation by issuing:
 
Now you can start the compilation by issuing:
Line 39: Line 22:
 
<bash>./Allwmake.firstInstall
 
<bash>./Allwmake.firstInstall
 
</bash>
 
</bash>
 +
 +
This will most likely ask you, if you want to proceed without compiling paraview. I recommend that you answer "yes" 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 LTS ==
 
== Ubuntu 20.04 LTS ==
Line 63: Line 48:
 
sed -i -e 's/g++/\$(WM_CXX)/' wmake/rules/linux64Gcc/c++
 
sed -i -e 's/g++/\$(WM_CXX)/' wmake/rules/linux64Gcc/c++
 
</bash>
 
</bash>
 
OPTIONAL: Preparations if you want to compile the version of Paraview that comes with foam-extend-4.1:
 
 
Ubuntu 20.04 has dropped QT4. So if you want to install Paraview that comes with foam-extend you have to install QT4 from another repository. To do that, add the repository for QT4:
 
 
<bash>sudo add-apt-repository ppa:rock-core/qt4
 
 
sudo apt-get install qt4-dev-tools libqt4-dev
 
</bash>
 
 
If you want to compile Paraview you also need to tell foam-extend where to find QT4:
 
 
<bash>cd ~/foam/foam-extend-4.1
 
 
echo "export QT_BIN_DIR=/usr/bin" >> etc/prefs.sh
 
echo "export WM_THIRD_PARTY_USE_QT_5111=1" >> etc/prefs.sh
 
echo "export WM_THIRD_PARTY_USE_PARAVIEW_552=1" >> etc/prefs.sh
 
 
source etc/bashrc
 
</bash>
 
 
  
 
Now you can start the compilation by issuing:
 
Now you can start the compilation by issuing:
Line 89: Line 53:
 
<bash>./Allwmake.firstInstall
 
<bash>./Allwmake.firstInstall
 
</bash>
 
</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.
  
 
[[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:27, 11 August 2020

1 Introduction

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


2 Ubuntu versions

2.1 Ubuntu 18.04 LTS

Run the following commands:

sudo apt-get update
sudo apt-get install git-core build-essential binutils-dev cmake flex \
zlib1g-dev  libncurses5-dev curl bison gnuplot gnuplot-qt gnuiplot-data \
libxt-dev rpm mercurial graphviz python python-dev python3 python3-dev

Then follow the instructions on the previous page, subsection Get the source code. Ubuntu 18.04 LTS comes with gcc/g++ 7.4.0 as default, so does not need any other adaptation of the standard process.

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 "yes" 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.2 Ubuntu 20.04 LTS

Run the following commands:

sudo apt-get update
sudo apt-get install git-core build-essential binutils-dev cmake flex \
zlib1g-dev libncurses5-dev curl bison \
libxt-dev rpm mercurial graphviz python python-dev  gcc-7 g++-7

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 in order to set the environment for gcc/g++ 7 to be used instead of gcc/g++ 9. More specifically, the commands should be executed something like this:

cd ~/foam/foam-extend-4.1
 
echo "export WM_CC='gcc-7'"  >> etc/prefs.sh
echo "export WM_CXX='g++-7'"  >> 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.