NEML2 2.0.0
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Dependency management

Dependency search

In most cases, there is no need to manually obtain the dependent libraries/packages. The build system will automatically search for the required packages at usual locations. If the package is already installed on the system, it will be used to build NEML2. Otherwise, a compatible version of the package will be downloaded and installed under the NEML2 build directory.

In case the package of interest has been installed at a non-conventional location, and CMake's default searching mechanism fails to find it, some special configure options can be used to help locate it. For a package named <PackageName>, the following variables are tried in sequence:

  • <PackageName>_ROOT CMake variable
  • <PACKAGENAME>_ROOT CMake variable
  • <PackageName>_ROOT enviroment variable
  • <PACKAGENAME>_ROOT environment variable

Please refer to the CMake documentation for additional hints that can be used to facilitate the package search procedure.

The following table summarizes the names of the packages required by each configure options. The first row lists the packages required by the base library.

Option Required package(s)
Torch, WASP, HIT
NEML2_TESTS Catch2
NEML2_RUNNER
NEML2_PYBIND Python
NEML2_DOC Doxygen
NEML2_CPU_PROFILER Gperftools
NEML2_WORK_DISPATCHER MPI
NEML2_THREAD_SANITIZER

List of dependencies

C++ backend dependencies

  • PyTorch, version 2.5.1.
  • HIT for input file parsing.
  • WASP as the lexing and parsing backend for HIT.
  • Catch2 for unit and regression testing.
  • gperftools for profiling.

In addition to standard system library locations, the CMake configure script also searches for an installed torch Python package. Recent PyTorch releases within a few minor versions are likely to be compatible.

Warning
If no PyTorch is found after searching, a CPU-only libtorch binary is downloaded from the official website. Such libtorch is not able to use the CUDA co-processor, even if there is one. If using CUDA is desired, please install the torch Python package or a CUDA-enabled libtorch before configuring NEML2.
Note
We strive to keep up with the rapid development of PyTorch. The NEML2 PyTorch dependency is updated on a quarterly basis. If there is a particular version of PyTorch you'd like to use which is found to be incompatible with NEML2, please feel free to create an issue.

Python package dependencies

  • Python development libraries.
  • pybind11 for building Python bindings.

Other dependencies