CLAIRE: Installation and Requirements¶
Installation Overview (Quick Guide)¶
In this section, we provide a minimal installation guide. We provide a make environment to download and install the dependencies using generic settings that have worked on most of our systems. If this brief installation guide does not work for you, please consult the detailed installation guide below.
One Shot ¶
To use the default settings to build dependencies and CLAIRE itself do the following:
cd deps
make GPU_VERSION=80
source env_source.sh
cd ..
make -j 8 GPU_VERSION=80
./bin/claire --synthetic 0
Set GPU_VERSION to the compute capability of your GPU without the dot, for example 70 for V100, 80 for A100, 89 for L40S, or 90 for H100 and H200 (see NVIDIA's list). If you leave it out, PETSc's configure detects the GPU itself and therefore has to run on a node with a GPU. On clusters that use Slurm, start the binaries with srun (see Executing CLAIRE).
The enviroment variables need to be sourced every time you log out of your computer or start a new bash (source env_source.sh). As an alternative, you can add the content of env_source.sh (for example) to your .bashrc or .bash_profile.
Step by Step ¶
Next, we go over the steps outlined above step by step. Again, more details are provided below.
Step 1) Installing Dependencies¶
To install the dependencies (the PETSc and NIFTI libraries) go to the top level directory of CLAIRE in your command window and execute the following commands within your command window:
This makefile downloads and compiles the dependencies for CLAIRE (replace 80 by the compute capability of your GPU; see One Shot). To add these dependencies to your environment type the following into your command line and press return:
Notice that the enviroment variables need to be sourced every time you log out of your computer or start a new bash. As an alternative, you can add the content of env_source.sh to your .bashrc or bash_profile.
Step 2) Compiling CLAIRE¶
Assuming that you are in the top level directory of CLAIRE, all you need to do is to type
Step 3) Executing CLAIRE¶
If you would like to verify if CLAIRE has been installed correctly run the following command in your command window:
Additional examples for executing CLAIRE are described in doc/README-RUNME.md.
Detailed Installation Guide ¶
In this section we provide a more detailed description of the installation process to help users with troubleshooting. The following table lists system configurations on which we have successfully installed CLAIRE.
| Test | Compiler | MPI | CUDA | PETSc | CPU | GPU | System |
|---|---|---|---|---|---|---|---|
| 11/2026 | GCC 12.4 | OpenMPI 4.1.8 | 12.9 | 3.21.0 | x86_64 | GA100 | Rocky Linux 9.6 (Tufts HPC) |
| b5213fa | GCC 9.3 | OpenMPI 4.0.3 | 11.0 | 3.14.2 | x86_64 | GA102 | Ubuntu 20.04 |
| 6f40316 | GCC 9.3 | OpenMPI 4.0.3 | 11.1 | 3.14.2 | x86_64 | GK110 | Ubuntu 20.04 |
| 4967052 | GCC 8.4 | OpenMPI 1.10.2 | 10.1 | 3.12.4 | x86_64 | GK110 | Ubuntu 16.04 |
| 4967052 | GCC 5.4.0 | OpenMPI 1.10.2 | 10.0 | 3.12.4 | x86_64 | GM200 | Ubuntu 16.04 |
| 4967052 | GCC 7.4 | OpenMPI 4.0.1 | 10.1 | 3.12.4 | x86_64 | GP100 | Ubuntu 16.04 |
| 4967052 | GCC 4.8.5 | OpenMPI 3.1.6 | 10.2 | 3.12.4 | Power9 | GV100 | CentOS 7.8 |
| 4967052 | XLC 16.1 | Spectrum 10.3 | 10.2 | 3.12.4 | Power9 | GV100 | RHEL 7.8 |
Requirements ¶
The minimal requirements for compiling CLAIRE on your system are:
- MPI (Open MPI; MVAPICH; Intel MPI; ...; required by PETSc, and CLAIRE)
- cmake (see https://cmake.org; required by niftilib)
- python (see https://www.python.org; required by PETSc and the optional pyclaire bindings)
- zlib (see https://www.zlib.net; required by niftilib)
- CUDA-API
Make sure that the standard wrappers for mpicc, mpicxx, and nvcc are available on your system (either by loading the appropriate modules and/or by setting up the appropriate PATH and LD_LIBRARY_PATH definitions). The compilation has been tested with Open MPI, MVAPICH, and Intel MPI.
Version compatibility:
- The compiler behind
mpicxxis also the host compiler fornvcc, so your CUDA version must support it. For example, CUDA 12.9 supports GCC up to version 14. - CUDA 11 and newer require PETSc 3.14 or newer. The dependency makefile builds PETSc 3.21.0 by default, which we have tested with CUDA 12.9 (see the table above).
Dependencies ¶
Required Dependencies and Compatibility¶
The compiler needs C++11 support. The GPU version of CLAIRE requires the following libraries to be installed on your system:
- MPI (with GPU support (CUDA-aware MPI) for multi-GPU multi-node)
- PETSc with CUDA support (see https://www.mcs.anl.gov/petsc)
- niftilib (see https://sourceforge.net/projects/niftilib/files/nifticlib)
- zlib (see http://zlib.net)
We provide functionality to build PETSc, niftilib, and zlip on your system (see next section).
Step 1: Downloading and Installing Dependencies¶
To download and compile the libraries we provide a makefile (see deps/makefile). Simply run make with this script in your command window to download tarball files of the libraries identified above.
The compressed tarball files (i.e, LIBRARY-NAME.tar.gz) should remain located in or be added to the deps folder. Make sure that all libraries are downloaded (the progress bar of wget should be full). To view the urls for the libraries you can take a look at the deps/makefile. We provide additional information about these libraries below. This also includes links to versions for these libraries that we have used to compile the GPU version of CLAIRE before.
The makefile has some optional parameters to configure the build. The parameters can be set by make PARAMETER=value. Multiple parameter-value pairs can be passed to the make command. The makefile to compile the dependencies has the following parameters.
| PARAMETER | Description | Default | Valid Values |
|---|---|---|---|
| BUILD_PETSC | PETSc version to download and compile; no for none |
3.21.0 | PETSc Version |
| BUILD_NIFTI | Download and build niftilib |
yes | yes, no |
| BUILD_PNETCDF | Download and build pnetcdf (with netcdf and hdf5) |
no | yes, no |
| GPU_VERSION | compute capability of the GPU, passed to PETSc as --with-cuda-arch; if empty, PETSc detects the GPU (configure must then run on a GPU node) |
e.g. 70, 80, 89, 90 | |
| CUDA_DIR | CUDA toolkit directory | $CUDA_HOME, else derived from nvcc |
directory |
| WITH_BATCH | Option to build petsc on a batch system, e.g. slurm | no | yes, no |
| WITH_CUDA_MPI | MPI is CUDA-aware; with no, env_source.sh sets the PETSc runtime option -use_gpu_aware_mpi 0 (via PETSC_OPTIONS) |
yes | yes, no |
| CC | Path to C compiler | mpicc | file path |
| CXX | Path to CXX compiler | mpicxx | file path |
| NVCC | Path to CUDA compiler | nvcc | file path |
| WITH_PETSC_OPTS | additional PETSC compile options |
The libraries will be extracted and build in the deps/lib subfolder.
For the GPU build, the makefile gives PETSc the CUDA headers and libraries explicitly instead of letting PETSc search for them. This is needed for CUDA 12.9 and newer, which no longer ship libnvToolsExt: PETSc then uses the header-only NVTX in $CUDA_DIR/include/nvtx3 (available in CUDA 11 and 12). The makefile stops with an error if it cannot find the CUDA toolkit; load a CUDA module or set CUDA_DIR.
Step 2: Setting Environment Variables¶
Before you are able to compile and run CLAIRE you need to add environment variables to your system. When building the libraries a file called env_source.sh is created. This file should be located in the debs subfolder. To add the environment variables temporarily (for the current session) to your system, do
To add them permanently, copy the content of env_source.sh to your ~/.bashrc. Notice that env_source.sh defines absolute paths.
Building CLAIRE ¶
Before you can build CLAIRE you need to
- Make sure that you have installed all dependencies (see prior sections).
- Make sure all paths and compilers needed in the
makefileare available on your system, i.e.mpicxx,nvcc, and the dependencies.
To inspect all options used in the makefile for CLAIRE (see makefile) do (in the top level directory):
To build the code using the make system do (in the top level directory):
Use the compute capability of your GPU for GPU_VERSION (see One Shot). Code built for one GPU generation runs on GPUs of the same major version only; for example, GPU_VERSION=80 runs on A100 and L40S (8.0 and 8.9), but not on H100 (9.0). If you build in parallel using make -j without a number, on certain systems to many threads will be used. This will result in compilation errors; give the number of parallel jobs explicitly, e.g., make -j 8.
The makefile also contains optional parameters to configure the build. The parameters can be set by make PARAMETER=value. Multiple parameter-value pairs can be passed to the make command. The makefile to compile the dependencies has following parameters.
| PARAMETER | Description | Default | Valid Values |
|---|---|---|---|
| BUILD_TEST | build the unit test applications | no | yes; no |
| BUILD_PYTHON | build the pyclaire Python bindings (lib/pyclaire.py, lib/_pyclaire.so; needs SWIG and NumPy) |
no | yes; no |
| BUILD_SHARED | build CLAIRE as shared library | no | yes; no |
| WITH_NIFTI | build with niftilib |
yes | yes; no |
| WITH_DEBUG | build with additional debug informations | no | yes; no |
| WITH_DEVELOP | build CLAIRE additional development informations | no | yes; no |
| WITH_CUDA_MPI | MPI is CUDA-aware | no | yes, no |
| BUILD_TARGET | target CPU architecture | X86 | X86; POWER9 |
| GPU_VERSION | compute capability of the GPU, e.g. 70, 80, 89, 90 | Compute Capability | |
| CPP_VERSION | C++ Standard to use | c++14 | c++11; c++14 |
| LD_FLAGS | additional flags for the linker | ||
| CXX_FLAGS | additional flags for the C++ compiler | ||
| NVCC_FLAGS | additional flags for the CUDA compiler | ||
| MPI_DIR | main path to the MPI include and lib directory | ||
| CUDA_DIR | main path to the CUDA include and lib directory | ||
| PETSC_DIR | main path to the PETSc include and lib directory | ||
| NIFTI_DIR | main path to the libnifti include and lib directory | ||
| ZLIB_DIR | main path to the zlib include and lib directory | ||
| PYTHON_DIR | include directories of Python and NumPy (for BUILD_PYTHON) |
those of the python3 in the PATH |
|
| TEST_LAUNCH | command that starts each unit test run of make test, e.g. srun --overlap -n 1 --mpi=pmix |
||
| VERBOSE | if set to any value the make command is verbose | ||
| VVERBOSE | if set to any value the make command is very verbose |
The makefile tracks header dependencies: after you edit a header, make rebuilds every file that includes it, so make clean is not needed. The makefile also keeps a cache of the build options (make.cache). If the options change, or if this file is removed or does not exist, the next build first does make clean automatically.
Executing CLAIRE ¶
If you would like to verify if CLAIRE has been installed correctly, run the following command in your command window:
The binaries need the libraries listed in deps/env_source.sh, so source it (and load the modules you built with) before you run them.
On clusters that use Slurm, do not start an MPI binary directly from an interactive srun --pty bash shell. Open MPI then fails at startup, for example with srun: error: PMK_KVS_Barrier duplicate request from task 0. Start it as its own job step instead:
--overlap lets the step share the resources of your interactive shell; in a batch script it is not needed. If your Slurm and MPI do not support PMIx, use --mpi=pmi2 (srun --mpi=list shows the options).
Additional examples for executing CLAIRE are described in doc/README-RUNME.md. The unit tests are described in doc/README-RUNME.md.
Additional Info for Dependencies ¶
PETSc¶
- PETSc webpage: https://petsc.org
- description: library for numerics, linear algebra, and optimization
- source code also available on gitlab: https://gitlab.com/petsc/petsc
- versions that have been succesfully used by our group:
- petsc-lite-3.21.0.tar.gz (with CUDA 12.9)
- petsc-lite-3.11.4.tar.gz
nifticlib¶
- NIFTICLIB webpage: http://niftilib.sourceforge.net
- description: library to read and write NIFTI images
- see https://sourceforge.net/projects/niftilib/files/nifticlib
- versions that have been succesfully used by our group:
CLAIRE on Specific Systems ¶
TACC's Longhorn System (03/17/21)¶
More information about TACC's Longhorn system can be found at https://www.tacc.utexas.edu/systems/longhorn.
Modules loaded:
1) xl/16.1.1 4) autotools/1.2 7) TACC
2) spectrum_mpi/10.3.0 5) cmake/3.16.1 8) cuda/10.2 (g)
3) git/2.24.1 6) xalt/2.10.2
Compilation of CLAIRE and its dependencies:
To test if the compilation worked check if the binaries are available in the bin folder. To execute CLAIRE using an interactive job do
cd bin
idev -N1 # launch an interactive session with one node
ibrun ./claire --help
ibrun ./claire --synthetic 0 --grid-size 128
A job submission file for TACC's Longhorn system (for multi-GPU exection) can be found in doc/examples/longhorn_mgpu.slurm.
Tufts University HPC Cluster (11/2026)¶
More information about the Tufts HPC cluster can be found at https://rtguides.it.tufts.edu/hpc/. Do not build or run software on the login nodes; start an interactive session on a compute node first.
Tested on Rocky Linux 9.6 with an NVIDIA A100 80GB and the following modules (openmpi/4.1.8-cuda also loads cuda/12.9.0):
gcc/15.1.0: CUDA 12.9 does not support it as host compiler.
Compilation of CLAIRE and its dependencies (in an interactive session on a GPU node; the dependency build takes 20 to 40 minutes):
srun -p preempt --qos=preempt -n 8 --mem=32g --gres=gpu:a100:1 -t 6:00:00 --pty bash
module load gcc/12.4.0 openmpi/4.1.8-cuda cmake/3.31.6
cd deps
make GPU_VERSION=80
source env_source.sh
cd ..
make -j 8 GPU_VERSION=80
GPU_VERSION set, building in a CPU-only session (-p batch, no --gres) should also work, but we have not tested it. Jobs in the preempt partition can be preempted.
To execute CLAIRE (and the unit tests) from that session, start each run as a job step:
GPU types on the cluster and the matching GPU_VERSION (build the dependencies and CLAIRE for the GPU you run on):
GPU (--gres=gpu:<type>:1) |
GPU_VERSION |
|---|---|
a100 |
80 |
l40, l40s |
89 |
h100, h200 |
90 |
rtx_pro_6000 |
120 |
Troubleshooting / Known Issues ¶
- if MPI is not compiled with CUDA-aware options, add the file
.petscrcto the working directory and add the option-use_gpu_aware_mpi 0, or build the dependencies withmake WITH_CUDA_MPI=no(thenenv_source.shsets this option) - CUDA >= 11.0 is only supported with PETSc >= 3.14.
- Kepler GPUs work with PETSc 3.12.4 (others not tested)
- Compiling PETSc with CUDA support on nodes without GPUs fails unless
GPU_VERSIONis set, because PETSc's configure otherwise detects the GPU - PETSc's configure stops with
Unable to find cuda in default locationsor--with-cuda-dir=... did not work: the dependency makefile handles both (see Step 1). If you build PETSc yourself with CUDA 12.9 or newer, pass--with-cuda-include='[$CUDA_HOME/include/nvtx3,$CUDA_HOME/include]'and an explicit--with-cuda-liblist without-lnvToolsExt(see deps/makefile), and add-Wno-deprecated-gpu-targetsto the CUDA compiler (--with-cudac); otherwise newernvccversions print a warning that makes PETSc's configure checks fail srun: error: PMK_KVS_Barrier duplicate request from task 0when you start CLAIRE in an interactive Slurm session: start the binary withsrun --overlap -n 1 --mpi=pmix(see Executing CLAIRE)error while loading shared libraries: libpetsc.so...when you run a binary: sourcedeps/env_source.shand load the modules you built with- the PETSc download address
ftp.mcs.anl.govdoes not have all releases; the dependency makefile downloads fromweb.cels.anl.gov - PNETCDF is currently not tested for GPUs
- The GPU version of CLAIRE can currently only be compiled in single precision. This limits the selection of regularization operators to H1-type regularization only. There are issues with the numerical accuracy of H2- and H3-type regularization operators for single precision. Applying these operators requires a compilation in double precision (available on the GPU branch)