NEML2 2.0.0
Loading...
Searching...
No Matches
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.

List of dependencies

C++ backend:

  • PyTorch, version 2.8.0.
  • WASP as the lexing and parsing backend for HIT.
  • Testing:
    • Catch2 for unit and regression testing.

The Runner:

  • argparse for command-line argument parsing.
  • Profiling:

Python package:

Documentation:

Work dispatcher:

  • TIMPI for coordinating parallel workers.
  • json for outputting event traces.

CSV parser:

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.

Skipping dependencies

In some cases, certain dependencies cannot be obtained or are incompatible with the build system, and it becomes desirable to keep using NEML2 with some capabilities disabled.

The following table summarizes the configure options that determine when a dependency is required, and hence how a dependency can be skipped.

Dependency Dependent configure option(s)
Torch
WASP
Catch2 NEML2_TESTS
argparse NEML2_RUNNER
Gperftools NEML2_RUNNER && CMAKE_BUILD_TYPE == Profiling
Python development libraries NEML2_PYBIND
pybind11-stubgen NEML2_PYBIND
pyzag NEML2_PYBIND && NEML2_TESTS
pytest NEML2_PYBIND && NEML2_TESTS
Doxygen NEML2_DOC
Doxygen Awesome NEML2_DOC
graphviz NEML2_PYBIND && NEML2_TESTS
PyYAML NEML2_DOC
MPI, TIMPI NEML2_WORK_DISPATCHER
json NEML2_JSON
CSV Parser NEML2_CSV

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.

List of dependencies

C++ backend:

  • PyTorch, version 2.8.0.
  • WASP as the lexing and parsing backend for HIT.
  • Testing:
    • Catch2 for unit and regression testing.

The Runner:

  • argparse for command-line argument parsing.
  • Profiling:

Python package:

Documentation:

Work dispatcher:

  • TIMPI for coordinating parallel workers.
  • json for outputting event traces.

CSV parser:

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.

Skipping dependencies

In some cases, certain dependencies cannot be obtained or are incompatible with the build system, and it becomes desirable to keep using NEML2 with some capabilities disabled.

The following table summarizes the configure options that determine when a dependency is required, and hence how a dependency can be skipped.

Dependency Dependent configure option(s)
Torch
WASP
Catch2 NEML2_TESTS
argparse NEML2_RUNNER
Gperftools NEML2_RUNNER && CMAKE_BUILD_TYPE == Profiling
Python development libraries NEML2_PYBIND
pybind11-stubgen NEML2_PYBIND
pyzag NEML2_PYBIND && NEML2_TESTS
pytest NEML2_PYBIND && NEML2_TESTS
Doxygen NEML2_DOC
Doxygen Awesome NEML2_DOC
graphviz NEML2_PYBIND && NEML2_TESTS
PyYAML NEML2_DOC
MPI, TIMPI NEML2_WORK_DISPATCHER
json NEML2_JSON
CSV Parser NEML2_CSV