Difference between revisions of "Installation/Linux/OpenFOAM-7/Ubuntu"

From OpenFOAMWiki
(Ubuntu 18.04: Removed Qt 4 reference)
(Moved the ongoing instructions to a sub-page... to try and make it easier for people not loose their bearings...)
Line 1: Line 1:
 
= Introduction =
 
= Introduction =
This page is dedicated to explaining how to install {{OpenFOAM}} {{version7}} in [http://www.ubuntu.com Ubuntu].
+
This page is an entry point for the instructions dedicated to explaining how to install {{OpenFOAM}} {{version7}} in various [http://www.ubuntu.com Ubuntu] versions.
  
If you do not yet feel comfortable using Linux, then perhaps you better first read the page [[Installation/Working with the Shell|Working with the Shell]] and train a bit with the shell/terminal environments, so you can have a better perception of the steps shown below.
+
If you do not yet feel comfortable using Linux, then perhaps you better first read the page [[Installation/Working with the Shell|Working with the Shell]] and train a bit with the shell/terminal environments, so you can have a better perception of the steps shown in the pages for each version.
  
__FORCETOC__
+
For the most part you have the following choices on how to install OpenFOAM 7:
__TOC__
+
 
+
= ''Copy-Paste'' steps =
+
 
+
A few notes before you start copy-pasting:
+
 
+
# Lines that start with <tt>#</tt> don't have to be ''copy-pasted''. They are just comments to let you know what's going on.
+
# One wrong character is enough for breaking this guide, so make sure you can read the characters properly or that the installed language system does not break the copied characters!
+
 
+
 
+
 
+
== Ubuntu 18.04 ==
+
 
+
Here you have the following choices:
+
 
* Install from Deb packages, as documented in the official instructions: [https://openfoam.org/download/7-ubuntu/ OpenFOAM v7 | Ubuntu]
 
* Install from Deb packages, as documented in the official instructions: [https://openfoam.org/download/7-ubuntu/ OpenFOAM v7 | Ubuntu]
 
* You can install from source, by either:
 
* You can install from source, by either:
 
** Following the official instructions from here: [http://openfoam.org/download/source/ OpenFOAM Source Repository]
 
** Following the official instructions from here: [http://openfoam.org/download/source/ OpenFOAM Source Repository]
** Or by following the detailed step-by-step instructions below...
+
** Or by following the detailed step-by-step instructions provided in the following pages:
 
+
 
+
<span style="font-size:180%">'''WARNING: These instructions are currently being written and under testing!'''</span>
+
 
+
'''Discussion thread where you can ask questions about these steps''': {{Installation/NoThreadAskForum}}
+
 
+
Steps:
+
<ol>
+
{{Installation/Linux/SwitchToRoot}}
+
{{Installation/Linux/AptGetUpdate}}
+
<li>Install the necessary packages:
+
<bash>apt-get install git-core build-essential cmake libfl-dev bison zlib1g-dev qttools5-dev qtbase5-dev libqt5x11extras5-dev gnuplot \
+
libreadline-dev libncurses-dev libxt-dev libopenmpi-dev openmpi-bin libboost-system-dev libboost-thread-dev libgmp-dev \
+
libmpfr-dev python python-dev libcgal-dev curl
+
</bash>
+
'''Note''': It has been reported that the following should also be executed in some cases, so that ParaView and CGAL will build properly:
+
<bash>apt-get install libglu1-mesa-dev</bash>
+
</li>
+
 
+
{{Installation/Linux/ExitRoot}}
+
 
+
<li>Download and unpack (here you can copy-paste all in single go):
+
<bash>#OpenFOAM downloading and installation
+
cd ~
+
mkdir OpenFOAM
+
cd OpenFOAM
+
git clone https://github.com/OpenFOAM/OpenFOAM-7.git
+
git clone https://github.com/OpenFOAM/ThirdParty-7.git
+
</bash>
+
</li>
+
 
+
<li>'''Optional''': Let's make a few symbolic links that should ensure that the correct global MPI installation is used by this OpenFOAM installation:
+
<bash>ln -s /usr/bin/mpicc.openmpi OpenFOAM-7/bin/mpicc
+
ln -s /usr/bin/mpirun.openmpi OpenFOAM-7/bin/mpirun</bash>
+
This way we avoid having problems in case there is more than one MPI toolbox installed in your Ubuntu system, for example if MPICH2 is installed and is the default MPI toolbox.
+
</li>
+
 
+
<li>For building OpenFOAM itself, it depends on whether you have installed the i686 or x86_64 architecture of Ubuntu. To check this, run:
+
<bash>uname -m</bash>
+
Now, accordingly:
+
<ul {{NoIndentStyle}}>
+
<li>For '''i686''':
+
<bash>source $HOME/OpenFOAM/OpenFOAM-7/etc/bashrc WM_ARCH_OPTION=32 FOAMY_HEX_MESH=yes
+
</bash></li>
+
 
+
<li>For '''x86_64''', it depends on whether you need 64-bit integer support or not:
+
<ul {{NoIndentStyle}}>
+
<li>For building with the normal 32-bit integer support (maximum 2.147×10<sup>9</sup> cells, faces or points):
+
<bash>source $HOME/OpenFOAM/OpenFOAM-7/etc/bashrc FOAMY_HEX_MESH=yes
+
</bash>
+
</li>
+
<li>For building with the normal 64-bit integer support (maximum 9.22×10<sup>18</sup> cells, faces or points):
+
<bash>source $HOME/OpenFOAM/OpenFOAM-7/etc/bashrc WM_LABEL_SIZE=64 FOAMY_HEX_MESH=yes
+
</bash>
+
</li>
+
</ul>
+
</li>
+
</ul>
+
</li>
+
 
+
<li>Save an ''alias'' in the personal {{tt|.bashrc}} file, simply by running the following command:
+
<bash>echo "alias of7='source \$HOME/OpenFOAM/OpenFOAM-7/etc/bashrc $FOAM_SETTINGS'" >> $HOME/.bashrc
+
</bash>
+
{{Installation/Linux/AliasNote|OpenFOAM-7|of7}}
+
</li>
+
 
+
<li>In order to build ParaView 5.4.0, including with the ability to use Python and MPI, several steps are needed:
+
<ol>
+
<li>Make sure you're running in the {{tt|ThirdParty}} folder and that the correct Qt version is used:
+
<bash>cd $WM_THIRD_PARTY_DIR
+
export QT_SELECT=qt5
+
</bash>
+
</li>
+
<li>For building ParaView with Python and MPI, it depends on whether you have installed the i686 or x86_64 architecture of Ubuntu. To check this, run:
+
<bash>uname -m</bash>
+
Now, accordingly:
+
<ul {{NoIndentStyle}}>
+
<li>For '''i686''':
+
<bash>#this will take a while... somewhere between 30 minutes to 2 hours or more
+
./makeParaView -python -mpi -python-lib /usr/lib/i386-linux-gnu/libpython2.7.so.1.0 > log.makePV 2>&1</bash>
+
</li>
+
 
+
<li>For '''x86_64''':
+
<bash>#this will take a while... somewhere between 30 minutes to 2 hours or more
+
./makeParaView -python -mpi -python-lib /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 > log.makePV 2>&1</bash>
+
</li>
+
</ul>
+
</li>
+
<li>{{Installation/ParaView/BuildProblemsCheckFAQ|makeParaView|log.makePV}}
+
</li>
+
<li>Finally, update the shell environment:
+
<bash>wmRefresh</bash>
+
</li>
+
</ol>
+
</li>
+
 
+
<li>Now let's build OpenFOAM:
+
<ol>
+
<li>Go into OpenFOAM's main source folder and be certain that the correct Qt version is being used:
+
<bash>cd $WM_PROJECT_DIR
+
export QT_SELECT=qt5</bash>
+
</li>
+
 
+
<li>This next command will take a while... somewhere between 30 minutes to 3-6 hours:
+
<bash>./Allwmake -j 4 > log.make 2>&1</bash>
+
{{Installation/Linux/NumberOfCores}}
+
</li>
+
<li>Run it a second time for getting a summary of the installation:
+
<bash>./Allwmake -j 4 > log.make 2>&1</bash>
+
'''Note:''' Technically, the build will stop as soon as the first error is found. Running a second time only makes it easier to sort through between what's already been built and where the crash occurred.
+
</li>
+
</ol>
+
</li>
+
 
+
<li>{{Installation/Linux/CheckIfAllWentWell}}</li>
+
 
+
<li>{{Installation/ReadUserGuideEtAl_OpenFOAMFoundation}}</li>
+
 
+
<li>When you need to update your local ''clone'', for getting the latest source code updates, you can follow the instructions provided in the page [[Installation/Working with git repositories]].</li>
+
 
+
<li>'''Note''': When you want to update your build, follow the instructions on section [[Installation/Linux/OpenFOAM-7#Steps for updating|Steps for updating]] on the parent page.</li>
+
</ol>
+
 
+
 
+
{{Installation/Linux/AliasReminder|OpenFOAM-7|of7}}
+
 
+
 
+
'''Discussion thread where you can ask questions about these steps''': {{Installation/NoThreadAskForum}}
+
  
 +
{{subpages|Installation/Linux/OpenFOAM-7/Ubuntu/}}
  
 
[[Category:Installing OpenFOAM on Linux]] [[Category:Installing OpenFOAM on Ubuntu]]
 
[[Category:Installing OpenFOAM on Linux]] [[Category:Installing OpenFOAM on Ubuntu]]

Revision as of 15:06, 27 July 2019

Introduction

This page is an entry point for the instructions dedicated to explaining how to install OpenFOAM OF Version 7.png in various Ubuntu versions.

If you do not yet feel comfortable using Linux, then perhaps you better first read the page Working with the Shell and train a bit with the shell/terminal environments, so you can have a better perception of the steps shown in the pages for each version.

For the most part you have the following choices on how to install OpenFOAM 7:

  • Install from Deb packages, as documented in the official instructions: OpenFOAM v7 | Ubuntu
  • You can install from source, by either:
    • Following the official instructions from here: OpenFOAM Source Repository
    • Or by following the detailed step-by-step instructions provided in the following pages:
Installation/Linux/OpenFOAM-7/Ubuntu/16.04Installation/Linux/OpenFOAM-7/Ubuntu/18.04Installation/Linux/OpenFOAM-7/Ubuntu/20.04