Skip to content

Spack package for kEDM#85

Open
freifrauvonbleifrei wants to merge 6 commits intokeichi:masterfrom
freifrauvonbleifrei:master
Open

Spack package for kEDM#85
freifrauvonbleifrei wants to merge 6 commits intokeichi:masterfrom
freifrauvonbleifrei:master

Conversation

@freifrauvonbleifrei
Copy link

Hi @keichi !

Here's a draft for a spack package. I used it to install kEDM on my laptop, and am currently testing installation on miyabi (veeery slow but looking good so far). Here's how.

With spack and kEDM cloned in the work folder:

export SPACK_PATH=$(pwd)/spack && export SPACK_USER_CONFIG_PATH="${SPACK_PATH}/user_config" && export SPACK_SYSTEM_CONFIG_PATH="${SPACK_PATH}/sys_config" && export SPACK_USER_CACHE_PATH="${SPACK_PATH}/user_cache" && . ${SPACK_PATH}/share/spack/setup-env.sh

spack compiler find
spack external find

I needed to manually add some installed dependencies to ${SPACK_PATH}/user_config/packages.yaml:

  cuda:
    externals:
    - spec: cuda@12.6
      prefix: /work/opt/local/aarch64/cores/cuda/12.6
    buildable: false
  openmpi:
    externals:
    - spec: openmpi@4.1.6 +cuda %nvhpc@25.9 ^cuda@12.6
      prefix: /work/opt/local/aarch64/apps/nvidia/25.9/openmpi-cuda/4.1.6-12.6
    buildable: false

Then, register the kedm repo with

spack repo add kEDM/spack_repo/kedm/

and try the usual specification and install commands.
The latter has to be run from the kEDM folder and shows normal CMake output:

spack spec kedm@master +cuda+executables+mpi+tests ^kokkos+cuda+wrapper cuda_arch=90 %nvhpc
spack dev-build kedm@master +cuda+executables+mpi+tests ^kokkos+cuda+wrapper cuda_arch=90 %nvhpc

Unfortunately, I could not test installation of the python bindings, because I consistently get

$ spack spec kedm+python
==> Error: Spack concretizer internal error. Please submit a bug report and include the command, environment if applicable and the following error message.
    kedm+python is unsatisfiable

I'm not sure if it makes sense to submit an issue to spack about it (yet).

Hope this can be useful!

@freifrauvonbleifrei
Copy link
Author

If using it in CI workflows could be interesting, here is my workflow for installing a custom spack package (on an outdated spack version though):
https://github.com/RIKEN-RCCS/dalotia/blob/main/.github/workflows/spack.yml

Copy link
Owner

@keichi keichi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @freifrauvonbleifrei for adding the Spack package recipe and refactoring the CMake file! Here are a few things I've noticed.

@freifrauvonbleifrei freifrauvonbleifrei marked this pull request as ready for review February 26, 2026 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants