DiFfRG
|
To compile and run this project, there are very few requirements which you can easily install using your package manager on Linux or MacOS:
AppleClang
, but in principle, ICC or standard Clang should also work.The following requirements are optional:
nvcc
, e.g. g++
<=13.2 for CUDA 12.5All other requirements are bundled and automatically built with DiFfRG. The framework has been tested with the following systems:
For a CUDA-enabled build, additionally install
The second line is necessary to switch into a shell where g++-12
is available
First, install xcode and homebrew, then run
If using Windows, instead of running the project directly, it is recommended to use WSL and then go through the installation as if on Linux (e.g. Arch or Ubuntu).
Although a native install should be unproblematic in most cases, the setup with CUDA functionality may be daunting. Especially on high-performance clusters, and also depending on the packages available for chosen distribution, it may be much easier to work with the framework inside a container.
The specific choice of runtime environment is up to the user, however we provide a small build script to create docker container in which DiFfRG will be built. To do this, you will need docker
, docker-buildx
and the NVIDIA container toolkit in case you wish to create a CUDA-compatible image.
For a CUDA-enabled build, run
in the above, you may want to replace the version 12.5.1
with another version you can find on docker hub at nvidia/cuda. Alternatively, for a CUDA-less build, run simply
If using other environments, e.g. ENROOT, the preferred approach is simply to build an image on top of the CUDA images by NVIDIA. Optimal compatibility is given using nvidia/cuda:12.5.1-devel-rockylinux
. Proceed with the installation setup for Rocky Linux above.
For example, with ENROOT a DiFfRG image can be built by following these steps:
Afterwards, one proceeds with the above Rocky Linux setup.
If all requirements are met, you can clone the git to a directory of your choice,
and start the build after switching to the git directory.
The build_DiFfRG.sh
bash script will build and setup the DiFfRG project and all its requirements. This can take up to half an hour as the deal.ii library is quite large. This script has the following options:
-c
Use CUDA when building the DiFfRG library.-i <directory>
Set the installation directory for the library.-j <threads>
Set the number of threads passed to make and git fetch.--help
Display this information.Depending on your amount of CPU cores, you should adjust the -j
parameter which indicates the number of threads used in the build process. Note that choosing this too large may lead to extreme RAM usage, so tread carefully.
As soon as the build has finished, you can find the build folder in the DiFfRG_build
subfolder and a full install of the library in /opt/DiFfRG
.
If you have changes to the library code, you can always update the library by running
where once again the -j
parameter should be adjusted to your amount of CPU cores. The update_DiFfRG.sh
script takes the following optional arguments:
-c
Use CUDA when building the DiFfRG library.-i <directory>
Set the installation directory for the library.-j <threads>
Set the number of threads passed to make and git fetch.-m
Install the Mathematica package locally.--help
Display this information.