Skip to content

kokkos: remove restrictions for ~wrapper - #5775

Open
rbberger wants to merge 1 commit into
spack:developfrom
rbberger:kokkos/allow_launch_compiler_only
Open

kokkos: remove restrictions for ~wrapper#5775
rbberger wants to merge 1 commit into
spack:developfrom
rbberger:kokkos/allow_launch_compiler_only

Conversation

@rbberger

Copy link
Copy Markdown
Member

Kokkos has had an automatic launch_compiler since 3.3 that will automatically redirect to either host or NVCC. The nvcc_wrapper replacement comes from a time where we needed to explicitly set the CXX compiler to the wrapper. This launch_compiler behavior is the recommended default, so don't artifically force +wrapper in the +cuda case, when it's not actually needed.

Kokkos has had an automatic launch_compiler since 3.3 that will automatically
redirect to either host or NVCC. The nvcc_wrapper replacement comes from a time
where we needed to explicitly set the CXX compiler to the wrapper. This
launch_compiler behavior is the recommended default, so don't artifically force
+wrapper in the +cuda case, when it's not actually needed.
@spackbot-triage spackbot-triage Bot added the update-package Modifications to packages in the repository label Jul 28, 2026
@tpadioleau

Copy link
Copy Markdown
Contributor

This launch_compiler behavior is the recommended default

I am not against this statement but then maybe we should stop using self["kokkos"].kokkos_cxx ? A few packages still explicitly set it to use the wrapper for CXX:

spack-packages/repos/spack_repo/builtin/packages/ports_of_call/package.py:            args.append(self.define("CMAKE_CXX_COMPILER", self["kokkos"].kokkos_cxx))
spack-packages/repos/spack_repo/builtin/packages/singularity_eos/package.py:            args.append(self.define("CMAKE_CXX_COMPILER", self["kokkos"].kokkos_cxx))
spack-packages/repos/spack_repo/builtin/packages/spiner/package.py:            args.append(self.define("CMAKE_CXX_COMPILER", self["kokkos"].kokkos_cxx))
spack-packages/repos/spack_repo/builtin/packages/triton/package.py:                compiler = self["kokkos"].kokkos_cxx
spack-packages/repos/spack_repo/builtin/packages/legion/package.py:            options.append(self.define("CMAKE_CXX_COMPILER", self["kokkos"].kokkos_cxx))
spack-packages/repos/spack_repo/builtin/packages/gmgpolar/package.py:            args.append(self.define("CMAKE_CXX_COMPILER", self["kokkos"].kokkos_cxx))
spack-packages/repos/spack_repo/builtin/packages/realm/package.py:            options.append(self.define("CMAKE_CXX_COMPILER", self["kokkos"].kokkos_cxx))
spack-packages/repos/spack_repo/builtin/packages/kokkos_fft/package.py:            args.append(self.define("CMAKE_CXX_COMPILER", self["kokkos"].kokkos_cxx))
spack-packages/repos/spack_repo/builtin/packages/kokkos_kernels/package.py:            options.append(self.define("CMAKE_CXX_COMPILER", self["kokkos"].kokkos_cxx))
spack-packages/repos/spack_repo/builtin/packages/koliop/package.py:            args.append(self.define("CMAKE_CXX_COMPILER", self["kokkos"].kokkos_cxx))
spack-packages/repos/spack_repo/builtin/packages/flecsi/package.py:            options.append(self.define("CMAKE_CXX_COMPILER", self["kokkos"].kokkos_cxx))
spack-packages/repos/spack_repo/builtin/packages/ddc/package.py:            args.append(self.define("CMAKE_CXX_COMPILER", self["kokkos"].kokkos_cxx))

@rbberger

rbberger commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

@tpadioleau yes, but updating those packages is one or more separate PRs. 6 of those are "mine" to update.

@tpadioleau

Copy link
Copy Markdown
Contributor

@tpadioleau yes, but updating those packages is one or more separate PRs. 6 of those are "mine" to update.

Cool then we almost have them all, fyi i have ddc, koliop, gmgpolar and kokkos-fft. We should also update the template we provide in Kokkos documentation.

@tpadioleau

tpadioleau commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

@rbberger Also, I am getting this kind of error https://github.com/tpadioleau/dev-spack/actions/runs/30202966761/job/89796025706 when using a build cache. I have no idea what is happening, I get it with other packages that use kokkos_cxx.

@rbberger

rbberger commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

@tpadioleau yeah, I've seen this. I think that logic is just outdated and should be removed. I think we have to return None in that case and let it fall back to spack_cxx in the caller. Or maybe just return self.compiler.cxx

@rbberger

rbberger commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

@tpadioleau I've just tried this with develop and it doesn't show. So it's not fundamentally broken. Maybe it has something to do with the build cache or extra spack repo that gets added? (btw, gmgpolar seems to be missing a requires("^kokkos+cuda_constexpr+cuda_relocatable_device_code", when="^kokkos+cuda"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

update-package Modifications to packages in the repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants