CUP-ECS internal spack package respository.
- Clone spack from https://github.com/spack/spack.
- Clone this repository.
- Set up your environment so that the ~/.spack directory is created.
- Find the
repos.yamlfile in the~/.spackdirectory. If you are on a cluster, therepos.yamlfile will be in~./spack/{cluster name}/, for example on tioga,~./spack/tioga/. Sometimes spack does not create therepos.yamlfile for you. If so, create it yourself in the correct directory. - Register this repository by adding the following lines to the
repos.yamlfile:
repos:
cupecs: /path/to/repo/spack-packages/spack_pkgs/spack_repo/cupecs
- Run
spack repo listto verify spack has found the cupecs package repository. The output should be similar to:
bash:$ spack repo ls
[+] cupecs v2.0 /path/to/repo/spack-packages/spack_pkgs/spack_repo/cupecs
[+] builtin v2.2 ~/.spack/package_repos/fncqgg4/repos/spack_repo/builtin
- Follow the instructions in the README of CUP-ECS/spack-externals to tell Spack about libraries externally installed on the system you are using.
- Use Spack normally. Spack will automatically find libraries included in this repository.
Create a directory with the name of your package in spack_pkgs/spack_repo/cupecs/packages and place your package.py file in that directory.
For packages that include CMakePackage, CudaPackage, and/or ROCmPackage, you must include the following imports in your packages.py file:
from spack_repo.builtin.build_systems.cmake import CMakePackage
from spack_repo.builtin.build_systems.cuda import CudaPackage
from spack_repo.builtin.build_systems.rocm import ROCmPackage
And for other spack-related functions, import:
from spack.package import *