|
NEML2 2.0.0
|
Once NEML2 is installed, external C++ projects can use NEML2 by including the development headers and linking against the NEML2 libraries. NEML2 offers a collection of libraries, they are
neml2_baseneml2_dispatcherneml2_driverneml2_miscneml2_modelneml2_solverneml2_tensorneml2_user_tensorThe names of the libraries are self-explanatory. As a general rule of thumb, the library names collide with the header hierarchy. That is, if your code includes #include "neml2/tensors/SR2.h", then your program should be linked against the corresponding tensor library using -lneml2_tensor, etc.
Integrating NEML2 into a project that already uses CMake is fairly straightforward. The following CMakeLists.txt snippet links NEML2 into the target executable called foo:
The above snippet assumes NEML2 is checked out to the directory neml2, i.e., as a git submodule.
Alternatively, you may use CMake's FetchContent module to integrate NEML2 into your project:
NEML2 can also be discovered from its installation location relying on CMake's config mode find_package function
Note that the config mode search defines several imported targets under the neml2:: namespace. For example, neml2::misc corresponds to the misc library of NEML2, etc. The neml2::neml2 is an interface target that transitively links to all NEML2 libraries.
Once NEML2 is installed, external C++ projects can use NEML2 by including the development headers and linking against the NEML2 libraries. NEML2 offers a collection of libraries, they are
neml2_baseneml2_dispatcherneml2_driverneml2_miscneml2_modelneml2_solverneml2_tensorneml2_user_tensorThe names of the libraries are self-explanatory. As a general rule of thumb, the library names collide with the header hierarchy. That is, if your code includes #include "neml2/tensors/SR2.h", then your program should be linked against the corresponding tensor library using -lneml2_tensor, etc.
Integrating NEML2 into a project that already uses CMake is fairly straightforward. The following CMakeLists.txt snippet links NEML2 into the target executable called foo:
The above snippet assumes NEML2 is checked out to the directory neml2, i.e., as a git submodule.
Alternatively, you may use CMake's FetchContent module to integrate NEML2 into your project:
NEML2 can also be discovered from its installation location relying on CMake's config mode find_package function
Note that the config mode search defines several imported targets under the neml2:: namespace. For example, neml2::misc corresponds to the misc library of NEML2, etc. The neml2::neml2 is an interface target that transitively links to all NEML2 libraries.