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

From OpenFOAMWiki
(openSUSE Leap 15.1: Need to constrain the core count when building ParaView...)
(Restructured and moved instructions for 15.1 to its own subpage)
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
This page is dedicated to explaining how to install {{OpenFOAM}} {{version7}} in [http://www.opensuse.org openSUSE].
 
This page is dedicated to explaining how to install {{OpenFOAM}} {{version7}} in [http://www.opensuse.org openSUSE].
  
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__
 
__TOC__
 
 
= ''Copy-Paste'' steps =
 
 
A few notes before you start copy-pasting:
 
 
# Lines that start with {{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!
 
 
 
== openSUSE Leap 15.1 ==
 
 
 
You can follow either one of these instructions:
 
You can follow either one of these instructions:
 
* Follow the official instructions for building from source code: [http://openfoam.org/download/7-source/ Download v7 | Source Pack]
 
* Follow the official instructions for building from source code: [http://openfoam.org/download/7-source/ Download v7 | Source Pack]
* Or follow the 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>
+
Here are the openSUSE versions for which the community has already written step-by-step OpenFOAM 7 installation instructions:
 +
{{subpages|Installation/Linux/OpenFOAM-7/openSUSE/}}
  
 +
<br>
  
'''Discussion thread where you can ask questions about these steps''': [https://www.cfd-online.com/Forums/openfoam-installation/219287-of7-paraview-5-6-0-compilation-error-qt5-opensuse-15-1-a.html OF7 ParaView 5.6.0 compilation error qt5 (openSUSE 15.1)]
+
== openSUSE Leap 15.1 ==
 
+
Steps:
+
<ol>
+
{{Installation/Linux/SwitchToRoot}}
+
<li>Install the necessary packages:
+
<bash>zypper install -t pattern devel_C_C++
+
zypper install cmake libqt5-qtbase-devel  libqt5-qttools-devel libqt5-qtx11extras-devel libqt5-qtxmlpatterns-devel \
+
gnuplot openmpi-devel boost-devel cgal-devel gmp-devel mpfr-devel python-devel libXt-devel glu-devel
+
</bash>
+
'''Note''': If you are going to build with 64-bit integer support (see step #7 for more details), you can also install the package {{tt|metis-devel}}:
+
<bash>zypper install metis-devel</bash>
+
</li>
+
 
+
{{Installation/Linux/ExitRoot}}
+
 
+
<li>Now, since we're trying to minimize the number of packages to be built, the Open-MPI package that is available with openSUSE is going to be chosen. The downside is that this requires that you logout and log back in, for the system to update the environment settings.<br>
+
Nonetheless, we can postpone logging out by running:
+
<pre>mpi-selector --set openmpi
+
source /etc/profile.d/mpi-selector.sh</pre>
+
'''Note:''' But keep in mind that until you logout, use the second command line on every new terminal window/tab!</li>
+
<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''': If the system's METIS installation is to be used (64-bit integer support only), we need to configure the respective file accordingly and fix a few issues:
+
<bash>mkdir -p ~/.OpenFOAM/7/config.sh
+
 
+
echo "export METIS_VERSION=metis-5.1.0" > ~/.OpenFOAM/7/config.sh/metis
+
echo "export METIS_ARCH_PATH=/usr" >> ~/.OpenFOAM/7/config.sh/metis
+
 
+
sed -i -e 's=/lib\s=/lib64 =' OpenFOAM-7/src/parallel/decompose/metisDecomp/Make/options
+
sed -i -e 's=/lib/=/lib64/=' OpenFOAM-7/src/parallel/decompose/metisDecomp/Allwmake
+
</bash>
+
</li>
+
 
+
<li>For building OpenFOAM itself, it depends on whether you have installed the i386 or x86_64 architecture of openSUSE. To check this, run:
+
<bash>uname -m</bash>
+
Now, accordingly:
+
<ul {{NoIndentStyle}}>
+
<li>For i386:
+
<bash>#here you can change 4 to the number of cores you've got
+
source $HOME/OpenFOAM/OpenFOAM-7/etc/bashrc WM_ARCH_OPTION=32
+
</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>Now, in order to build ParaView 5.6.0 that comes with OpenFOAM, including with the ability to use Python and MPI, several steps are needed:
+
<ol>
+
<li>For building ParaView with Python and MPI, it depends on whether you have installed the i686 or x86_64 architecture of openSUSE. To check this, run:
+
<bash>uname -m</bash>
+
Now, accordingly:
+
<ul {{NoIndentStyle}}>
+
<li>For i686:
+
<bash>cd $WM_THIRD_PARTY_DIR
+
 
+
# change the 4 to the number of cores you want to be used to build ParaView with
+
export WM_NCOMPPROCS=4
+
 
+
#this will take a while... somewhere between 30 minutes to 2 hours or more
+
./makeParaView -python -mpi -python-lib /usr/lib/libpython2.7.so.1.0 -qmake $(which qmake-qt5) > log.makePV 2>&1</bash>
+
</li>
+
 
+
<li>For x86_64:
+
<bash>cd $WM_THIRD_PARTY_DIR
+
 
+
# change the 4 to the number of cores you want to be used to build ParaView with
+
export WM_NCOMPPROCS=4
+
 
+
#this will take a while... somewhere between 30 minutes to 2 hours or more
+
./makeParaView -python -mpi -python-lib /usr/lib64/libpython2.7.so.1.0 -qmake $(which qmake-qt5) > 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:<br>
+
('''Warning''': this may take somewhere from 30 minutes to 6 hours, depending on your machine.)<br>
+
<bash>#Go into OpenFOAM's main source folder
+
cd $WM_PROJECT_DIR
+
 
+
# This next command will take a while... somewhere between 30 minutes to 3-6 hours.
+
./Allwmake -j 4 > log.make 2>&1
+
 
+
#Run it a second time for getting a summary of the installation
+
./Allwmake -j 4 > log.make 2>&1
+
</bash>
+
{{Installation/Linux/NumberOfCores}}
+
</li>
+
 
+
<li>{{Installation/Linux/CheckIfAllWentWell}}</li>
+
 
+
<li>{{Installation/ReadUserGuideEtAl_OpenFOAMFoundation}}</li>
+
</ol>
+
 
+
 
+
{{Installation/Linux/AliasReminder|OpenFOAM 7|of7}}
+
 
+
 
+
'''Discussion thread where you can ask questions about these steps''': [https://www.cfd-online.com/Forums/openfoam-installation/219287-of7-paraview-5-6-0-compilation-error-qt5-opensuse-15-1-a.html OF7 ParaView 5.6.0 compilation error qt5 (openSUSE 15.1)]
+
  
 +
Installation instructions for openSUSE Leap 15.1 have been moved to this page: [[Installation/Linux/OpenFOAM-7/openSUSE/Leap_15.1]] - this is an attempt to avoid people getting lost in the multitude of instructions for each OS version.
  
 
[[Category:Installing OpenFOAM on Linux]] [[Category:Installing OpenFOAM on openSUSE]]
 
[[Category:Installing OpenFOAM on Linux]] [[Category:Installing OpenFOAM on openSUSE]]

Latest revision as of 17:16, 27 July 2019

1 Introduction

This page is dedicated to explaining how to install OpenFOAM OF Version 7.png in openSUSE.

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.

You can follow either one of these instructions:

  • Follow the official instructions for building from source code: Download v7 | Source Pack
    • Or by following the detailed step-by-step instructions provided in the following pages...


Here are the openSUSE versions for which the community has already written step-by-step OpenFOAM 7 installation instructions:

Installation/Linux/OpenFOAM-7/openSUSE/Leap 15.1


1.1 openSUSE Leap 15.1

Installation instructions for openSUSE Leap 15.1 have been moved to this page: Installation/Linux/OpenFOAM-7/openSUSE/Leap_15.1 - this is an attempt to avoid people getting lost in the multitude of instructions for each OS version.