Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tsoc
spack-packages
Commits
beb5c9ff
Commit
beb5c9ff
authored
Feb 10, 2026
by
one
Browse files
Update nekRS
parent
ba454342
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
2 deletions
+32
-2
repos/spack_repo/hygon/tsoc/packages/nekrs/package.py
repos/spack_repo/hygon/tsoc/packages/nekrs/package.py
+32
-2
No files found.
repos/spack_repo/hygon/tsoc/packages/nekrs/package.py
View file @
beb5c9ff
...
...
@@ -136,8 +136,20 @@ class Nekrs(Package, CMakePackage, CudaPackage, ROCmPackage):
def
setup_dependent_build_environment
(
self
,
env
:
EnvironmentModifications
,
dependent_spec
:
Spec
)
->
None
:
# Export the same runtime settings for dependents built in Spack.
self
.
setup_run_environment
(
env
)
# Export only compiler-related OCCA vars to dependent builds to avoid
# polluting their runtime-oriented environment (e.g. PATH/NEKRS_HOME).
spec
=
self
.
spec
runtime_cxx
=
spec
[
"mpi"
].
mpicxx
env
.
set
(
"OCCA_CXX"
,
runtime_cxx
)
env
.
set
(
"NEKRS_MPI_UNDERLYING_COMPILER"
,
runtime_cxx
)
cxxflags
=
spec
.
compiler_flags
.
get
(
"cxxflags"
,
[])
if
cxxflags
:
env
.
set
(
"OCCA_CXXFLAGS"
,
" "
.
join
(
cxxflags
))
if
"+cuda"
in
spec
:
cuda_dir
=
spec
[
"cuda"
].
prefix
env
.
set
(
"OCCA_CUDA_COMPILER"
,
join_path
(
cuda_dir
,
"bin"
,
"nvcc"
))
class
GenericBuilder
(
generic
.
GenericBuilder
):
def
install
(
self
,
pkg
,
spec
,
prefix
):
...
...
@@ -153,6 +165,23 @@ class GenericBuilder(generic.GenericBuilder):
class
CMakeBuilder
(
cmake
.
CMakeBuilder
):
def
install
(
self
,
pkg
,
spec
,
prefix
):
super
().
install
(
pkg
,
spec
,
prefix
)
# Ensure installed runtime config does not retain Spack build wrappers.
runtime_cxx
=
spec
[
"mpi"
].
mpicxx
conf
=
join_path
(
prefix
,
"nekrs.conf"
)
filter_file
(
r
"^NEKRS_MPI_UNDERLYING_COMPILER = .*$"
,
f
"NEKRS_MPI_UNDERLYING_COMPILER =
{
runtime_cxx
}
"
,
conf
,
)
filter_file
(
r
"^OCCA_CXX = .*$"
,
f
"OCCA_CXX =
{
runtime_cxx
}
"
,
conf
,
)
def
cmake_args
(
self
):
cxxflags
=
self
.
spec
.
compiler_flags
.
get
(
"cxxflags"
,
[])
args
=
[
...
...
@@ -160,6 +189,7 @@ class CMakeBuilder(cmake.CMakeBuilder):
self
.
define
(
"CMAKE_C_COMPILER"
,
self
.
spec
[
"mpi"
].
mpicc
),
self
.
define
(
"CMAKE_CXX_COMPILER"
,
self
.
spec
[
"mpi"
].
mpicxx
),
self
.
define
(
"CMAKE_Fortran_COMPILER"
,
self
.
spec
[
"mpi"
].
mpifc
),
self
.
define
(
"OCCA_CXX"
,
self
.
spec
[
"mpi"
].
mpicxx
),
self
.
define_from_variant
(
"ENABLE_CUDA"
,
"cuda"
),
self
.
define_from_variant
(
"ENABLE_OPENCL"
,
"opencl"
),
self
.
define_from_variant
(
"ENABLE_HIP"
,
"rocm"
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment