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
2ad790fd
Commit
2ad790fd
authored
Feb 12, 2026
by
one
Browse files
Update nekRS flags
parent
a745432b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
10 deletions
+23
-10
repos/spack_repo/hygon/tsoc/packages/nekrs/package.py
repos/spack_repo/hygon/tsoc/packages/nekrs/package.py
+23
-10
No files found.
repos/spack_repo/hygon/tsoc/packages/nekrs/package.py
View file @
2ad790fd
...
@@ -8,11 +8,11 @@ from spack.package import *
...
@@ -8,11 +8,11 @@ from spack.package import *
from
spack_repo.builtin.build_systems
import
cmake
,
generic
from
spack_repo.builtin.build_systems
import
cmake
,
generic
from
spack_repo.builtin.build_systems.cmake
import
CMakePackage
from
spack_repo.builtin.build_systems.cmake
import
CMakePackage
from
spack_repo.builtin.build_systems.cuda
import
CudaPackage
from
spack_repo.builtin.build_systems.cuda
import
CudaPackage
from
spack_repo.builtin.build_systems.generic
import
Package
from
spack_repo.builtin.build_systems.rocm
import
ROCmPackage
from
spack_repo.builtin.build_systems.rocm
import
ROCmPackage
class
Nekrs
(
Package
,
CMakePackage
,
CudaPackage
,
ROCmPackage
):
class
Nekrs
(
CMakePackage
,
CudaPackage
,
ROCmPackage
):
"""nekRS is an open-source Navier Stokes solver based on the spectral
"""nekRS is an open-source Navier Stokes solver based on the spectral
element method targeting classical processors and hardware accelerators
element method targeting classical processors and hardware accelerators
like GPUs"""
like GPUs"""
...
@@ -208,6 +208,9 @@ class CMakeBuilder(cmake.CMakeBuilder):
...
@@ -208,6 +208,9 @@ class CMakeBuilder(cmake.CMakeBuilder):
def
cmake_args
(
self
):
def
cmake_args
(
self
):
cxxflags
=
self
.
spec
.
compiler_flags
.
get
(
"cxxflags"
,
[])
cxxflags
=
self
.
spec
.
compiler_flags
.
get
(
"cxxflags"
,
[])
cflags
=
self
.
spec
.
compiler_flags
.
get
(
"cflags"
,
[])
fflags
=
self
.
spec
.
compiler_flags
.
get
(
"fflags"
,
[])
args
=
[
args
=
[
# Match upstream recommended usage: MPI wrappers for all languages.
# Match upstream recommended usage: MPI wrappers for all languages.
self
.
define
(
"CMAKE_C_COMPILER"
,
self
.
spec
[
"mpi"
].
mpicc
),
self
.
define
(
"CMAKE_C_COMPILER"
,
self
.
spec
[
"mpi"
].
mpicc
),
...
@@ -215,7 +218,6 @@ class CMakeBuilder(cmake.CMakeBuilder):
...
@@ -215,7 +218,6 @@ class CMakeBuilder(cmake.CMakeBuilder):
self
.
define
(
"CMAKE_Fortran_COMPILER"
,
self
.
spec
[
"mpi"
].
mpifc
),
self
.
define
(
"CMAKE_Fortran_COMPILER"
,
self
.
spec
[
"mpi"
].
mpifc
),
self
.
define
(
"OCCA_CXX"
,
self
.
spec
[
"mpi"
].
mpicxx
),
self
.
define
(
"OCCA_CXX"
,
self
.
spec
[
"mpi"
].
mpicxx
),
self
.
define_from_variant
(
"NEKRS_GPU_MPI"
,
"gpu_aware_mpi"
),
self
.
define_from_variant
(
"NEKRS_GPU_MPI"
,
"gpu_aware_mpi"
),
self
.
define_from_variant
(
"ENABLE_AMGX"
,
"amgx"
),
self
.
define_from_variant
(
"ENABLE_CVODE"
,
"cvode"
),
self
.
define_from_variant
(
"ENABLE_CVODE"
,
"cvode"
),
self
.
define_from_variant
(
"ENABLE_HYPRE_GPU"
,
"hypre"
),
self
.
define_from_variant
(
"ENABLE_HYPRE_GPU"
,
"hypre"
),
]
]
...
@@ -241,14 +243,25 @@ class CMakeBuilder(cmake.CMakeBuilder):
...
@@ -241,14 +243,25 @@ class CMakeBuilder(cmake.CMakeBuilder):
self
.
define_from_variant
(
"ENABLE_OPENCL"
,
"opencl"
),
self
.
define_from_variant
(
"ENABLE_OPENCL"
,
"opencl"
),
self
.
define_from_variant
(
"ENABLE_HIP"
,
"rocm"
),
self
.
define_from_variant
(
"ENABLE_HIP"
,
"rocm"
),
self
.
define_from_variant
(
"ENABLE_DPCPP"
,
"dpcpp"
),
self
.
define_from_variant
(
"ENABLE_DPCPP"
,
"dpcpp"
),
self
.
define_from_variant
(
"ENABLE_AMGX"
,
"amgx"
),
]
]
)
)
# OCCA is C++ only
if
cxxflags
:
if
cxxflags
:
cxxflags_str
=
" "
.
join
(
cxxflags
)
args
.
append
(
self
.
define
(
"OCCA_CXXFLAGS"
,
" "
.
join
(
cxxflags
)))
args
.
extend
(
[
if
self
.
spec
.
satisfies
(
"@26.0:"
):
self
.
define
(
"NEKRS_COMPILER_FLAGS"
,
cxxflags_str
),
# v26.0 split NEKRS_COMPILER_FLAGS into per-language variables.
self
.
define
(
"OCCA_CXXFLAGS"
,
cxxflags_str
),
if
cxxflags
:
]
args
.
append
(
self
.
define
(
"NEKRS_CXX_FLAGS"
,
" "
.
join
(
cxxflags
)))
)
if
cflags
:
args
.
append
(
self
.
define
(
"NEKRS_C_FLAGS"
,
" "
.
join
(
cflags
)))
if
fflags
:
args
.
append
(
self
.
define
(
"NEKRS_Fortran_FLAGS"
,
" "
.
join
(
fflags
)))
else
:
# v23.0 uses unified NEKRS_COMPILER_FLAGS for all languages.
if
cxxflags
:
args
.
append
(
self
.
define
(
"NEKRS_COMPILER_FLAGS"
,
" "
.
join
(
cxxflags
)))
return
args
return
args
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