Installation instructions¶
Prerequisites¶
We assume that you already have installed a C++ IDE and if you want to run locally, a local version of LibTorch. Please ensure you use LibTorch 2.1.1, as other versions may cause build errors (not tested). You also need CMake (version >=3.21). Most IDEs (e.g., Visual Studio) are supplied with CMake, if you install the right plugins.
Libtorch¶
These are the download links for the correct Libtorch versions, most users will only need the Release version:
Setup¶
For the easiest setup, provide a CMakeUserPresets.json in the root directory. Note: CMakeUserPresets.json in the root directory is ignored by Git. This allows for passing in specific configurations and paths tailored to your local environment. An example file can be found at cmake/resources/. You could copy this to the root directory, and adapt it to your specific needs.
Hint
Visual Studio and other IDEs often hide files and folders that are ignored in Git, in settings you can set ignored files to visible.
The CMakeUserPresets.json should provide paths to certain dependencies (e.g., PyTorch). You also need to provide DYNAPLEX_IO_ROOT_DIR, which is a local directory where input and output files used and generated by DynaPlex will be stored and retrieved from.
Windows¶
With the setup in place, compiling the library should be straightforward in most IDEs that support CMake (possibly via a proper extension).
For using the python bindings, we recommend setting up a specific conda environment using python/environment.yml.
After this, update the CMakeUserPresets.txt for WinPB to point to the relevant dependencies inside the newly created environment. Compiling WinPB afterwards will result in the bindings being compiled. CMake automatically copies them to python/dp/libs, where python/dp/load.py should be able to locate them. As a consequence, the scripts in python/test should run them.