FMS
2025.04
Flexible Modeling System
|
MPI compiler wrappers may be named different on your system, so its best to ensure the compiler commands work prior to being set.
nc-config
command:It's best to create a build directory inside of the FMS folder to avoid building on top of the source code. Once that is done, CMake can be ran to generate the necessary build files:
CMake uses "build types" to set compiler flags. By default (.ie no -DCMAKE_BUILD_TYPE="Type" argument when cmake is run), it will use the "Release" build type which corresponds the the prod/opt flags used by the GFDL mkmf templates.
Similarly "Repro" and "Debug" also correspond to whatever options would be set by theircorresponding mkmf template files.
To reproduce the old behavior for the cmake build (2025.03 and prior), the "ReleaseUFS" and "DebugUFS" will use the same flags as before.
Please open an issue in the FMS repository if you have any issues or would like to request any changes to the current build type options.
To override the default compiler flags, you can set them via CMake arguments:
By using the "NoFlags" build type, only necessary compilation flags will be added besides what is set via the cmake arguments.
<prefix>
is the full install directory for FMS provided by user
By default, FMS is built with OpenMP
enabled and delivered in static library files.
FMS has mixed precision real support for most interfaces. By default, one library will be created, libfms
, that is compiled with r8 defaults but also contains overloaded r4 routines.
The 64BIT and 32BIT precision options will build distinct libraries when enabled with the given default real size, libfms_r4 or libfms_r8. These option are provided for backwards compatibility, but are no longer supported by our development team, since mixed precision can now be used with a single library. Unit tests currently only work when no precision option is specified.
The following build options are available:
When the above command finishes, the <prefix>
will have an include
and a lib
directory. The lib
directory will have these files:
FMS built with cmake
provides transient targets with its package configuration. To be able to look for FMS in your application, set the following environment variable:
where <prefix>
is the full path to FMS installation.
To find FMS in your application CMakeLists.txt
:
To link your application with FMS library:
If your application does not provide a means to locate the NetCDF installation via cmake, this may help: