-
Notifications
You must be signed in to change notification settings - Fork 6
Building with Spack
If you would like to use Spack to build Compadre, it is as simple as (assuming you have your spack environment setup correctly):
Generic:
spack install compadre ^kokkos+{parallellism} ^kokkos-kernels
where {parallelism} is replaced by threads, openmp, or cuda.
For mac with pthreads:
spack install compadre ^kokkos+threads ^kokkos-kernels
For linux with openmp:
spack install compadre%gcc ^kokkos+openmp ^kokkos-kernels
If using Cuda in Kokkos, you'll also need to set the architecture as well as use kokkos-nvcc-wrapper with something like:
spack install compadre ^kokkos@master +cuda +cuda_constexpr +wrapper cuda_arch=75
The @master in the last example indicates to spack that you want the versions of these packages from the master branch of their respective git repos.
Notes to speed things along:
If you are on some machine that uses modules, like module avail [packagename], then it is possible to use these modules within spack. https://spack.readthedocs.io/en/latest/build_settings.html#external-packages
Here is an example ~/.spack/packages.yaml:
packages:
cuda:
buildable: false
externals:
- spec: cuda@10.2.88
modules:
- 'cuda/9.2.88'
cmake:
buildable: false
externals:
- spec: cmake@3.17
prefix: /ascldap/users/pakuber/anaconda3/envs/mypy
- spec: cmake@3.18
modules:
- 'cmake/3.18.0'
openmpi:
buildable: false
externals:
- spec: openmpi@3.1.0
modules:
- 'openmpi/3.1.0/gcc/7.2.0/cuda/9.2.88'