|
YAC 3.21.0
Yet Another Coupler
|
YAC includes experimental CMake support as an alternative to the Autotools build system. The CMake build system supports all features including:
The CMake build system requires CMake version 3.18 or later.
YAC's version has the form MAJOR.MINOR.PATCH (e.g. 3.18.0). Between regular releases, an interim fix may add a tweak number, shown as e.g. 3.18.0p1 when built with Autotools or CMake, or as 3.18.0.post1 if installed via pip (following Python's versioning convention). Regular releases always report a plain MAJOR.MINOR.PATCH, no matter which build system or installation method you used.
Create a build directory and configure:
Build and test:
Install:
cmake --install installs the YAC libraries, headers and tools, but not the Python bindings. If they were enabled with -DYAC_ENABLE_PYTHON=ON, they are assembled in the python subdirectory of the build directory and can be installed into a Python environment of your choice with pip install <yac_build_dir>/python. See Installation from a YAC build directory for details. If you only need the Python bindings, consider installing YAC with pip directly, see Installation.The most important configure options are:
BUILD_SHARED_LIBS - Build shared libraries (default: ON)BUILD_TESTING - Enable tests (default: OFF)YAC_ENABLE_MCI - Enable Model Coupling Interface (default: ON)YAC_ENABLE_TOOLS - Enable tools (default: ON, requires MCI)YAC_ENABLE_FORTRAN - Enable Fortran bindings (default: ON)YAC_ENABLE_PYTHON - Enable Python bindings (default: OFF)YAC_ENABLE_NETCDF - Enable NetCDF support (default: ON)For a full list of options run cmake -LH or use ccmake.
If dependencies are not in standard locations, you can specify their paths via
or by defining the respective environment variables before executing cmake ...
YAC provides a CMake configuration file that can be used with find_package:
YAC also supports optional COMPONENTS to require specific libraries or build-time features:
If a requested component is unavailable (e.g. YAC was built with YAC_ENABLE_FORTRAN=OFF), find_package fails with an error naming the missing component(s). Components can also be requested without REQUIRED, in which case YAC_<Component>_FOUND can be checked manually:
Available components:
YAC::yac_<name>): utils, mciYAC_ENABLE_<NAME> build option, no dedicated target): Fortran, NetCDF, OpenMP, Python, ToolsTo guide CMake to find YAC set YAC_ROOT to the build or install directory.
If you encounter any issues with the CMake build system, please consider reporting them.