Skip to content

Commit 3b48c57

Browse files
authored
Merge pull request #179 from su2code/update_meson_instructions
Update meson build instructions
2 parents 10e48a4 + 76b9e84 commit 3b48c57

File tree

4 files changed

+47
-45
lines changed

4 files changed

+47
-45
lines changed

_docs_v7/Build-SU2-Linux-MacOS.md

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Short summary of the minimal requirements:
4747

4848
If you have these tools installed, you can create a configuration using the `meson.py` found in the root source code folder:
4949
```
50-
./meson.py build
50+
./meson.py setup build
5151
```
5252
Use `ninja` to compile and install the code
5353

@@ -62,10 +62,10 @@ Use `ninja` to compile and install the code
6262
### Compilers ###
6363
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.
6464

65-
- GNU gcc / g++
66-
- Intel icc / icpc
65+
- GNU gcc / g++
66+
- Intel icc / icpc
6767
- Apple LLVM (clang)
68-
68+
6969
**Note**: SU2 uses some C++11 features, that means at least GCC >= v4.7, Clang >= v3.0 or Intel C++ >= v12.0 is necessary.
7070

7171
### MPI ###
@@ -76,7 +76,7 @@ It is possible to force the MPI mode with the meson option `-Dcustom-mpi=true`,
7676

7777
### Python ###
7878

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.
8080

8181
### Optional: swig and mpi4py ###
8282
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:
8989

9090
$ easy_install pip
9191
$ pip install mpi4py
92-
92+
9393
---
9494

9595
## Automatically installed dependencies ##
9696

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).
9898

9999
### 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.
101101

102102
### 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.
104104

105-
---
105+
---
106106
## Configuration and Compilation ##
107107

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.
109109

110110
### 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).
112112

113113
**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.
114114

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
116116

117117
```
118-
./meson.py build
118+
./meson.py setup build
119119
```
120120

121+
You can have multiple configurations in different folders next to each other.
122+
121123
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+
123125
| Option | Default value | Description |
124126
|---| --- | --- |
125127
| `-Denable-autodiff` | `false` | enable AD (reverse) support (needed for discrete adjoint solver) |
126128
| `-Denable-directdiff` | `false` | enable AD (forward) support |
127129
| `-Denable-pywrapper` | `false` | enable Python wrapper support|
128130
| `-Dwith-mpi` | `auto` | Set dependency mode for MPI (`auto`,`enabled`,`disabled`) |
129131
| `-Dwith-omp` | `false` | enable MPI+Threads support (experimental) |
130-
| `-Denable-cgns` | `true` | enable CGNS support |
132+
| `-Denable-cgns` | `true` | enable CGNS support |
131133
| `-Denable-tecio` | `true` | enable TECIO support |
132134
| `-Denable-mkl` | `false` | enable Intel MKL support |
133135
| `-Denable-openblas` | `false` | enable OpenBLAS support |
@@ -139,20 +141,20 @@ Options can be passed to the script to enable or disable different features of S
139141

140142
For example to enable AD support pass the option to the `meson.py` script along with a value:
141143
```
142-
./meson.py build -Denable-autodiff=true
144+
./meson.py setup build -Denable-autodiff=true
143145
```
144146
To set a installation directory for the binaries and python scripts, use the `--prefix` option, e.g.:
145147

146148
```
147-
./meson.py build -Denable-autodiff=true --prefix=/home/username/SU2
149+
./meson.py setup build -Denable-autodiff=true --prefix=/home/username/SU2
148150
```
149151
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.
150152

151153
### 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
153155
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.:
154156
```
155-
./meson.py build --reconfigure --buildtype=debug
157+
./meson.py setup build --reconfigure --buildtype=debug
156158
```
157159
Note that it is only possible to change one option at once.
158160

@@ -196,7 +198,7 @@ Profiling allows developers to identify inefficiencies in their code. SU2 can be
196198
/path/to/binary/SU2_CFD config.cfg
197199
```
198200

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
200202

201203
```
202204
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
206208

207209
### Compilation ###
208210

209-
Finally to compile and install SU2 use
211+
Finally to compile and install SU2 use
210212
```
211213
./ninja -C build install
212214
```

_docs_v7/Execution.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Options:
9494
* `-f FILE, --file=FILE` read config from FILE
9595
* `-n PARTITIONS, --partitions=PARTITIONS` number of PARTITIONS
9696
* `-s STEP, --step=STEP` finite difference STEP
97-
* `-q QUIET, --quiet=QUIET` if True, output QUIET to log files
97+
* `-q QUIET, --quiet=QUIET` if True, output QUIET to log files
9898

9999
### Shape Optimization Script (shape_optimization.py)
100100

@@ -114,7 +114,7 @@ Options:
114114

115115
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*:
116116

117-
Usage: `$ ./meson.py build -Denable-pywrapper=true --prefix=~/SU2`
117+
Usage: `$ ./meson.py setup build -Denable-pywrapper=true --prefix=~/SU2`
118118

119119
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*:
120120

_docs_v7/Running-Unit-Tests.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ In order to compile the unit tests, add the flag `-Denable-tests=true`
2424
to your meson configure call. Then, you can build and run the tests by
2525
calling `ninja test`.
2626

27-
## Running Tests
27+
## Running Tests
2828

2929
There are three ways to run the main unit tests:
3030

31-
1. `meson test -C builddir`, where `builddir` is the build directory.
32-
2. `ninja test -C builddir`, where `builddir` is the build directory.
31+
1. `meson test -C [builddir]`, where `[builddir]` is the build directory.
32+
2. `ninja test -C [builddir]`, where `[builddir]` is the build directory.
3333
3. `./UnitTests/test_driver` from the SU2 build directory.
3434

3535
If you have run `ninja install`, then the `test_driver` executable will
3636
also be located in the `bin` directory where you have installed SU2. The
3737
first option will call ninja, which will then run the `test_driver`
3838
executable. The second option will call the `test_driver` executable.
39-
The last option, manually running the test driver, gives the most flexibility.
39+
The last option, manually running the test driver, gives the most flexibility.
4040
This help page will focus on the command-line options for that last option.
4141

4242
By default, Catch2 will only show the output from failing tests. To also
@@ -48,7 +48,7 @@ are actually three test drivers:
4848
`test_driver`, `test_driver_AD`, and `test_driver_DD`. These test drivers
4949
are built or run depending on the type of installation (e.g. direcdiff,
5050
autodiff). For the most common use-case, you will not have a directdiff
51-
or autodiff build and will only use `test_driver`. If you call
51+
or autodiff build and will only use `test_driver`. If you call
5252
`meson_test` or `ninja test`, the correct
5353
drivers will run automatically. For more on tests using algorithmic
5454
differentiation or direct differentiation, see the section "AD and
@@ -88,7 +88,7 @@ run:
8888
```
8989

9090
To run tests matching a specific tag, write the tag name in square braces
91-
as an argument for the test driver. For example, if I want to run the
91+
as an argument for the test driver. For example, if I want to run the
9292
tests with the tag "Dual Grid", I would run:
9393

9494
```

0 commit comments

Comments
 (0)