Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions repos/c2sm/packages/icon/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ class Icon(SpackIcon):
description="Create a Fortran compile group: GROUP;files;flag \nNote: flag can only be one single value, i.e. -O1",
)

variant("nvtx", default=False, description="Enable NVTX for profiling")
requires("%nvhpc", when="+nvtx") # NVTX is only supported for nvhpc

# verbosity
variant(
"silent-rules",
Expand Down Expand Up @@ -234,6 +237,16 @@ def configure_args(self):
if "+sct" in self.spec:
libs += self.spec["hdf5"].libs

if "+nvtx" in self.spec:
for i, arg in enumerate(args):
if "FCFLAGS" in arg:
args[i] += " -D_USE_NVTX"
break
else:
flags["FCFLAGS"].append("-D_USE_NVTX")

libs += LibraryList(["nvhpcwrapnvtx"])

fcgroup = self.spec.variants["fcgroup"].value
# ('none',) is the values spack assign if fcgroup is not set
if fcgroup != ("none",):
Expand Down
Loading