Compilation
This page describes how to build HASEonGPU manually from source.
For most users, manual compilation is only required when using the standalone binary directly or when adjusting build options. For general setup and dependency information, see Getting Started.
Basic Build
Clone the repository and build HASEonGPU with CMake:
git clone https://github.com/computationalradiationphysics/haseongpu.git
cd haseongpu
mkdir build
cd build
cmake ..
cmake --build .
After compilation, the calcPhiASE binary is available under:
./build/calcPhiASE
When Python bindings are enabled, they are built alongside the C++ backend.
Typical Build Variants
Minimal default build:
cmake ..
cmake --build .
Build with MPI support:
cmake .. -DDISABLE_MPI=OFF
cmake --build .
CMake Options
The following CMake variables control important build options.
DISABLE_MPI
Default:
AUTODescription: Enabling allows compilation without requiring MPI or BoostMPI as a dependency.
Values:
AUTO: CMAKE tries to detect whether MPI exists and sets this knob in correspondenceOFF: MPI support remains - dependencies are requiredON: MPI support is disabled
HASE_CUDA_ARCHITECTURES
Default:
nativeDescription: Selects the CUDA target architecture used for compilation.
Typical values:
native: detect the local GPU architecture automaticallyexplicit CUDA architectures such as
75,80,86
Using native is convenient for local builds. For reproducible and performance on
different systems, specifying the CUDA architecture is recommended.
HASE_ENABLE_PYTHON
Default:
ONDescription:
If python as a dependency is missing on your system this knob can be turned off in order to use HASEonGPU from the command-line only. For normal Python installation and usage, please refer to Python Interface Guide.
Values:
OFF: build only the C++ project and binary interfaceON: build the Python interface
HASE_BUILD_RELEASE
Default:
ONDescription: Controls whether HASEonGPU applies its release build configuration. When enabled, CMake forces
CMAKE_BUILD_TYPE=Releaseand enables the release optimization options used by the project, including native host compiler tuning flags and CUDA/HIP fast-math related flags where applicable.Important:
HASE_BUILD_RELEASE=ONoverwrites user-providedCMAKE_BUILD_TYPEvalues and related optimization settings during configuration. SetHASE_BUILD_RELEASE=OFFif you need a custom build type, debug flags, or manually controlled compiler optimization options.Values:
OFF: keep user-provided build type and optimization settingsON: force the project release configuration
HASE_SELECT_BACKEND_ALPAKA
Default:
OFFDescription: Controls whether HASEonGPU selects available alpaka backends automatically or whether backend selection is delegated to alpaka’s CMake options.
For general information about backend names and runtime backend selection, see Backend Selection.
Values:
OFF: HASEonGPU automatically searches for supported backend dependencies such as CUDA, HIP, and TBB and enables the corresponding alpaka backends when possible.If both HIP and CUDA are installed on the same system, automatic detection may cause configuration issues in alpaka. In that case, manual backend selection should be used to explicitly disable one of the conflicting backends.
ON: Enables manual backend selection using alpaka’s existing CMake options.The relevant alpaka CMake options are documented in the alpaka CMake argument documentation.
Example: configure HASEonGPU only for an NVIDIA GPU backend:
cmake -S . -B build \ -DHASE_SELECT_BACKEND_ALPAKA=ON \ -Dalpaka_DEP_CUDA=ON \ -Dalpaka_DEP_HIP=OFF \ -Dalpaka_DEP_TBB=OFF \ -Dalpaka_EXEC_CpuSerial=OFF
HASE_TESTING
Default:
OFFDescription: Enables the test suite during configuration and build.
Values:
OFF: tests are not builtON: test targets are enabled
This option is primarily useful for development and validation work.
Notes
Manual compilation is usually not required for every workflow.
For example, when using the Python interface, the backend may be built as part of the Python installation process. However, a manual build can be useful for adjusting CMake options, debugging, or working directly with the standalone binary.