-
Notifications
You must be signed in to change notification settings - Fork 14
Build instructions
The following shows how to build, configure, and test CabanaMD.
CabanaMD has the following dependencies:
Dependency | Version | Required | Details |
---|---|---|---|
CMake | 3.9+ | Yes | Build system |
MPI | GPU Aware if CUDA Enabled | Yes | Message Passing Interface |
Kokkos | 3.0 | Yes | Provides portable on-node parallelism |
Cabana | master | Yes | Performance portable particle algorithms |
ArborX | master | No | Performance portable geometric search |
libnnp | 1.0.0 | No | Neural network potential utilities |
Build Kokkos, followed by Cabana: https://github.com/ECP-copa/Cabana/wiki/Build-Instructions
Build instructions are available for both CPU and GPU. Note that Cabana with
MPI is required (-D Cabana_ENABLE_MPI=ON
)
After building Kokkos and Cabana for CPU:
# Change directories as needed
export KOKKOS_DIR=$HOME/kokkos
export CABANA_DIR=$HOME/Cabana
cd ./CabanaMD
export CBNMD_INSTALL_DIR=`pwd`/build/install
mkdir build
cd build
pwd
cmake \
-D CMAKE_PREFIX_PATH="$CABANA_DIR" \
-D CMAKE_INSTALL_PREFIX=$CBNMD_INSTALL_DIR \
-D CabanaMD_REQUIRE_OPENMP=ON \
-D CabanaMD_VECTORLENGTH=1 \
\
.. ;
make install
cd ../../
CabanaMD will build for all Kokkos enabled backends by default,
where the optional CabanaMD_REQUIRE_*
flags can ensure those
desired were built. The vector length flag sets the Cabana::AoSoA
vector length for all particle properties.
After building Kokkos and Cabana for GPU: https://github.com/ECP-copa/Cabana/wiki/Build-Instructions#GPU-Build
the GPU build is identical to that above except the options passed to CMake:
cmake \
-D CMAKE_CXX_COMPILER=$KOKKOS_SRC_DIR/bin/nvcc_wrapper \
-D CMAKE_PREFIX_PATH="$CABANA_DIR" \
-D CMAKE_INSTALL_PREFIX=$CBNMD_INSTALL_DIR \
-D CabanaMD_REQUIRE_CUDA=ON \
-D CabanaMD_VECTORLENGTH=32 \
\
.. ;
If using the optional neural network potential, additional CMake flags for the location of the libnnp library (https://github.com/CompPhysVienna/n2p2) and enabling the potential are needed (with one additional optional vector length setting and maximum preallocation symmetry function setting):
-D N2P2_DIR=$N2P2_DIR \
-D CabanaMD_ENABLE_NNP=ON \
-D CabanaMD_VECTORLENGTH_NNP=1 \
-D CabanaMD_MAXSYMMFUNC_NNP=30 \
If using the optional ArborX library (https://github.com/arborx/ArborX), the location of the library must be passed to the Cabana (not CabanaMD) CMake:
-D CMAKE_PREFIX_PATH="$KOKKOS_DIR;$ARBORX_DIR"
Once configured, build and install CabanaMD with:
make -j $BUILD_NUM_THREADS
make install
Ensure installation by checking the installed libraries an headers in CABANAMD_INSTALL_DIR. If tests are enable you can run the Cabana unit test suite with:
ctest