How to install SU2 in MPI mode
Pre-requisite
- Python3. See how to install Python3
- It is necessary to install numpy and scipy if you are going to use more advanced features from SU2, like optimization. Matplotlib is very handy for post-processing CFD. See how to install common Python3 packages for scientific computating
- For Windows use Python3.7 or newer. (download here or from the Microsoft Store)
-
Swig. See how to install swig
-
For Windows, MinGW-w64 version 8.1.0 download here. See how to install MinGW
- Install a MPI implementation.
- For Linux and macOS, use MPICH
- For Windows use Microsoft MPI v10.1.2 or newer. See how to install
-
Install MPI for Python (mpi4py)
- It is not needed to install Meson, Ninja, CoDiPack and MeDiPack beforehand. SU2 installation process does that for you and ensures the correct versions.
Directions
Installation
Installing from binaries
-
Download the zipped package containing the binary executables from https://su2code.github.io/download.html
-
Unzip the package in a directory of your preference. It is a good idea to avoid spaces in the address.
Installing from source files
Linux and macOS
- Make sure you are using bash.
echo $SHELL # if it is not bash, command: bash
- Create a folder for SU2
mkdir /home/you/su2
-
Download to that folder the latest stable source code version of SU2 from: https://su2code.github.io/download.html
- Unzip the file
unzip su2code...zip
- Create a build folder
mkdir /home/you/su2/build
- Enter the unziped su2 source code folder and run mason, giving the full address of the build folder above in the prefix argument:
cd /home/you/su2/su2code... ./meson.py build -Denable-autodiff=true --prefix=/home/you/su2/build
- Compile with ninja
./ninja -C build install
Windows
It works for Windows 10 and it is expected to work for newer versions as well.
-
Download SU2 v7.x.x download here
-
Install Microsoft MPI by simply executing the installers msmpisetup.exe and the msmpisdk.msi.
-
Install MinGW by executing the installer mingw-w64-install.exe. Choose Version 8.1.0 and Architecture x86_64 on the Settings page. Everything else can stay on their default values. On the next page set a destination folder and remember it! Click next until everything has been downloaded and installed.
-
In the file browser go to the mingw installation directory and execute the file mingw-w64. This should open the command prompt. Navigate to the SU2 source code directory.
- Create a build folder.
mkdir build
- Enter the unziped su2 source code folder and run mason, giving the full address of the build folder above in the prefix argument:
python meson.py build -Denable-autodiff=true --prefix=/home/you/su2/build
- Compile with ninja
ninja.exe -C build install
Setting Environment variables
In order to use the executables from any directory without explicitly specifying the path to the executable you should set some environment variables.
Linux and macOS
Either add the following lines to your ~/.bashrc or ~/.bash_profile to be permanent, or type the commands into the terminal for temporary use.
Assuming that
export SU2_RUN=<install_path>
export PATH=$SU2_RUN:$PATH
export PYTHONPATH=$SU2_RUN:$PYTHONPATH
The export commands are also printed after a successful configuration using meson.py.
Windows
Search for “Environment Variables” in Windows Search. At the bottom “System Variables” panel, add to the “Path” variable:
Leave a comment