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
11 changes: 11 additions & 0 deletions repos/c2sm/packages/icon/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ class Icon(AutotoolsPackage, CudaPackage):
'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')

# verbosity
variant('silent-rules',
default=True,
Expand Down Expand Up @@ -279,6 +281,11 @@ class Icon(AutotoolsPackage, CudaPackage):

conflicts('+loop-exchange', when='gpu=openacc+cuda')

# nvtx is only supported for nvhpc
conflicts('+nvtx', when='%cce')
conflicts('+nvtx', when='%gcc')
conflicts('+nvtx', when='%intel')

# Flag to mark if we build out-of-source
# Needed to trigger sync of input files for experiments
out_of_source_build = False
Expand Down Expand Up @@ -526,6 +533,10 @@ def configure_args(self):
if '+pytorch' in self.spec:
libs += self.spec['pytorch-fortran'].libs

if '+nvtx' in self.spec:
flags['FCFLAGS'].append('-D_USE_NVTX')
flags['LIBS'].append('-lnvhpcwrapnvtx')

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