You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _docs_v7/Build-SU2-Linux-MacOS.md
+24-22Lines changed: 24 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ Short summary of the minimal requirements:
47
47
48
48
If you have these tools installed, you can create a configuration using the `meson.py` found in the root source code folder:
49
49
```
50
-
./meson.py build
50
+
./meson.py setup build
51
51
```
52
52
Use `ninja` to compile and install the code
53
53
@@ -62,10 +62,10 @@ Use `ninja` to compile and install the code
62
62
### Compilers ###
63
63
Installing SU2 from source requires a C++ compiler. The GNU compilers (gcc/g++) are open-source, widely used, and reliable for building SU2. The Intel compiler set has been optimized to run on Intel hardware and has also been used successfully by the development team to build the source code, though it is commercially licensed. The Apple LLVM compiler (Clang) is also commonly used by the developers.
64
64
65
-
- GNU gcc / g++
66
-
- Intel icc / icpc
65
+
- GNU gcc / g++
66
+
- Intel icc / icpc
67
67
- Apple LLVM (clang)
68
-
68
+
69
69
**Note**: SU2 uses some C++11 features, that means at least GCC >= v4.7, Clang >= v3.0 or Intel C++ >= v12.0 is necessary.
70
70
71
71
### MPI ###
@@ -76,7 +76,7 @@ It is possible to force the MPI mode with the meson option `-Dcustom-mpi=true`,
76
76
77
77
### Python ###
78
78
79
-
SU2 requires Python 3 for compilation and for running the python scripts. Make sure that you have properly set up the `python3` executables in your environment.
79
+
SU2 requires Python 3 for compilation and for running the python scripts. Make sure that you have properly set up the `python3` executables in your environment.
80
80
81
81
### Optional: swig and mpi4py ###
82
82
If you want to use the python wrapper capabilities, also `swig` and `mpi4py` are required. On **Linux**`swig` should be available in the package manager of your distribution and `mpi4py` can be installed using [pip](https://pip.pypa.io/en/stable/).
@@ -89,45 +89,47 @@ Install mpi4py with Python pip using easy install:
89
89
90
90
$ easy_install pip
91
91
$ pip install mpi4py
92
-
92
+
93
93
---
94
94
95
95
## Automatically installed dependencies ##
96
96
97
-
The following dependencies are automatically downloaded (or initialized if source code was cloned using `git`) during the [configuration](#configuration-and-compilation).
97
+
The following dependencies are automatically downloaded (or initialized if source code was cloned using `git`) during the [configuration](#configuration-and-compilation).
98
98
99
99
### Meson and Ninja ###
100
-
The build system of SU2 is based on a combination of [meson](http://mesonbuild.com/) (as the front-end) and [ninja](https://ninja-build.org/) (as the back-end). Meson is an open source build system meant to be both extremely fast, and, even more importantly, as user friendly as possible. Ninja is a small low-level build system with a focus on speed.
100
+
The build system of SU2 is based on a combination of [meson](http://mesonbuild.com/) (as the front-end) and [ninja](https://ninja-build.org/) (as the back-end). Meson is an open source build system meant to be both extremely fast, and, even more importantly, as user friendly as possible. Ninja is a small low-level build system with a focus on speed.
101
101
102
102
### CoDiPack and MeDiPack ###
103
-
In order to use the discrete adjoint solver the compilation requires two additional (header-only) libraries. [CoDi](https://github.com/SciCompKL/CoDiPack) provides the AD datatype and [MeDi](https://github.com/SciCompKL/MeDiPack) provides the infrastructure for the MPI communication when the reverse mode of AD is used.
103
+
In order to use the discrete adjoint solver the compilation requires two additional (header-only) libraries. [CoDi](https://github.com/SciCompKL/CoDiPack) provides the AD datatype and [MeDi](https://github.com/SciCompKL/MeDiPack) provides the infrastructure for the MPI communication when the reverse mode of AD is used.
104
104
105
-
---
105
+
---
106
106
## Configuration and Compilation ##
107
107
108
-
Like mentioned above, SU2 uses meson and ninja for configuration and compilation, respectively. A configuration using meson is generated first and then an invocation of ninja is used to compile SU2 with this configuration.
108
+
Like mentioned above, SU2 uses meson and ninja for configuration and compilation, respectively. A configuration using meson is generated first and then an invocation of ninja is used to compile SU2 with this configuration.
109
109
110
110
### Basic Configuration ###
111
-
In the root folder of the sources you will find a python script called `meson.py`. This script generates a configuration. It will also check whether all dependencies are found and downloads some of them if necessary see [previous section](#automatically-installed-dependencies).
111
+
In the root folder of the sources you will find a python script called `meson.py`. This script generates a configuration. It will also check whether all dependencies are found and downloads some of them if necessary see [previous section](#automatically-installed-dependencies).
112
112
113
113
**Note**: For the following steps you can also use preinstalled versions of `meson` and `ninja` available on your machine. Just replace the `./meson.py` and `./ninja` calls with the binaries of the respective installations. However, this way you have to manually make sure that the correct versions of [CoDiPack and MeDiPack](#codipack-and-medipack) are placed in the `externals/` folders.
114
114
115
-
The only required argument for `meson.py` is a name of a directory where it should store the configuration. You can have multiple configurations in different folders next to each other. To generate a basic configuration that will be stored in the folder `build` use
115
+
A configuration can be generated using `meson.py setup [builddir] [options]`, where the only required argument is `[builddir]`. For example, to generate a basic configuration that will be stored in the folder `build`, use
116
116
117
117
```
118
-
./meson.py build
118
+
./meson.py setup build
119
119
```
120
120
121
+
You can have multiple configurations in different folders next to each other.
122
+
121
123
Options can be passed to the script to enable or disable different features of SU2. Below you find a list of project options and their default values:
122
-
124
+
123
125
| Option | Default value | Description |
124
126
|---| --- | --- |
125
127
|`-Denable-autodiff`|`false`| enable AD (reverse) support (needed for discrete adjoint solver) |
126
128
|`-Denable-directdiff`|`false`| enable AD (forward) support |
If you are not interested in setting custom compiler flags and other options you can now go directly to the [Compilation](#compilation) section, otherwise continue reading the next section.
150
152
151
153
### Advanced Configuration ###
152
-
In general meson appends flags set with the environment variable `CXXFLAGS`. It is however recommended to use
154
+
In general meson appends flags set with the environment variable `CXXFLAGS`. It is however recommended to use
153
155
mesons built-in options to set debug mode, warning levels and optimizations. All options can be found [here](https://mesonbuild.com/Builtin-options.html) or by using `./meson.py configure`. An already created configuration can be modified by using the `--reconfigure` flag, e.g.:
Note that it is only possible to change one option at once.
158
160
@@ -196,7 +198,7 @@ Profiling allows developers to identify inefficiencies in their code. SU2 can be
196
198
/path/to/binary/SU2_CFD config.cfg
197
199
```
198
200
199
-
After completion, a file called `gmon.out` is generated in your current working directory, indicating that the profiling was successful. In order to compile the analysis, run the command
201
+
After completion, a file called `gmon.out` is generated in your current working directory, indicating that the profiling was successful. In order to compile the analysis, run the command
200
202
201
203
```
202
204
gprof /path/to/binary/SU2_CFD > analysis.txt
@@ -206,7 +208,7 @@ Now the file `analysis.txt` contains the profiling analysis summary. For more ad
It is possible to call SU2 from python by importing it as a module. The first step is to compile SU2 with python wrapper support. For instance if your SU2 repository is in your home directory at *~/SU2*:
The python module will then be available in the installation folder *~/SU2/bin*. To make the SU2 python wrapper available from everywhere in the system, add the installation path to *PYTHONPATH*:
0 commit comments