Shared or pic condition not enforced on kokkos-kernels

Open Beginner friendly
#7,516 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@robertexternbrink is already working on this.

Since Nov 16, 2026.

  • #7702 by @robertexternbrink — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
hpc, python
Domain
build-system

Research direction

The dependency is declared in the depends_on lines of repos/spack_repo/builtin/packages/petsc/package.py around lines 405-407, under the kokkos variant. Look at how the package already constrains other dependencies by variant, then add a constraint on kokkos-kernels so that it is shared and built with PIC when petsc is +shared. Done when a spec like petsc+kokkos+shared can no longer concretize kokkos-kernels as ~shared or ~pic.

Written by the indexing model from the issue text.

Description

https://github.com/spack/spack-packages/blob/e2b598a34209615e7093a444a9968ac7184a4c92/repos/spack_repo/builtin/packages/petsc/package.py#L405-L407

petsc+kokkos depends on kokkos-kernels with no constraint on how it's built. petsc is +shared by default, but the concretizer can still pick kokkos-kernels~shared with kokkos~pic. Linking libpetsc.so then fails because the static libkokkoskernels.a wasn't compiled with -fPIC.

Dominant language
Python
Stars
158
Forks
849
Avg merge
2d 22h
Merged PRs (30d)
426

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from spack/spack-packages

All issues in spack/spack-packages

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.