|
NEML2 2.1.0
|
The configuration of NEML2 can be customized via a variety of high-level configure options. Commonly used configuration options are summarized below. Default options are underlined.
| Option | Values (default) | Description |
|---|---|---|
| NEML2_PCH | ON, OFF | Use precompiled headers to accelerate compilation |
| NEML2_TESTS | ON, OFF | Master knob for including/excluding all tests |
| NEML2_TOOLS | ON, OFF | Create targets for utility binaries |
| NEML2_WORK_DISPATCHER | ON, OFF | Enable work dispatcher |
| NEML2_JSON | ON, OFF | Enable JSON support |
| NEML2_CSV | ON, OFF | Enable CSV support |
Additional configuration options can be passed via command line using the -DOPTION or -DOPTION=ON format (see e.g., cmake manual).
Since many configure options are available for customizing the build, it is sometimes challenging to keep track of them during the development workflow. CMake introduces the concept of preset to help manage common configurations.
NEML2 predefines configure presets serving different development purposes:
The configure presets and their corresponding configure options are summarized below.
| preset | cc | dev | coverage | tsan | asan | release | profiling |
|---|---|---|---|---|---|---|---|
| CMAKE_BUILD_TYPE | Debug | Debug | Coverage | ThreadSanitizer | AddressSanitizer | Release | Profiling |
| CMAKE_EXPORT_COMPILE_COMMANDS | ON | OFF | OFF | OFF | OFF | OFF | OFF |
| NEML2_PCH | OFF | ON | ON | ON | ON | ON | ON |
| NEML2_TESTS | ON | ON | ON | ON | ON | ON | OFF |
| NEML2_TOOLS | ON | ON | OFF | ON | ON | ON | ON |
| NEML2_WORK_DISPATCHER | ON | ON | ON | ON | ON | ON | ON |
| NEML2_JSON | ON | ON | ON | ON | ON | ON | ON |
| NEML2_CSV | ON | ON | ON | ON | ON | ON | ON |
To select a specific configure preset, use the --preset option on the command line.
While the default presets should cover most of the development stages, it is sometimes necessary to override certain options. In general, there are three ways of overriding the preset:
For example, the following command
would use the configure preset "release" while disabling the work dispatcher, and the same could be achieved via environment variables or user presets.
Once the project is configured (e.g., using configure presets), one or more build targets will be generated. Different configure options would generate different sets of build targets. The --target command line option can be used to specify the target to build. Similar to configure presets, build presets are used to pre-define "groups" of build targets.
NEML2 offers a number of build presets:
To use a build preset, use the --preset option on the command line, i.e.