diff --git a/var/spack/repos/builtin/packages/hpctoolkit/package.py b/var/spack/repos/builtin/packages/hpctoolkit/package.py index 6c9c7ab095..170e714e55 100644 --- a/var/spack/repos/builtin/packages/hpctoolkit/package.py +++ b/var/spack/repos/builtin/packages/hpctoolkit/package.py @@ -55,6 +55,10 @@ class Hpctoolkit(AutotoolsPackage): variant('cuda', default=False, description='Support CUDA on NVIDIA GPUs (2020.03.01 or later).') + variant('rocm', default=False, + description='Support ROCM on AMD GPUs (develop branch only, ' + 'requires ROCM as external packages.') + boost_libs = ( '+atomic +chrono +date_time +filesystem +system +thread +timer' ' +graph +regex +shared +multithreaded visibility=global' @@ -84,6 +88,10 @@ class Hpctoolkit(AutotoolsPackage): depends_on('libpfm4', when='~papi') depends_on('mpi', when='+mpi') + depends_on('hip', when='@develop+rocm') + depends_on('rocm-dbgapi', when='@develop+rocm') + depends_on('roctracer-dev', when='@develop+rocm') + conflicts('%gcc@:4.7.99', when='^dyninst@10.0.0:', msg='hpctoolkit requires gnu gcc 4.8.x or later') @@ -126,6 +134,13 @@ def configure_args(self): else: args.append('--with-perfmon=%s' % spec['libpfm4'].prefix) + if spec.satisfies('@develop+rocm'): + args.extend([ + '--with-rocm-hip=%s' % spec['hip'].prefix, + '--with-rocm-dbgapi=%s' % spec['rocm-dbgapi'].prefix, + '--with-rocm-tracer=%s' % spec['roctracer-dev'].prefix, + ]) + # MPI options for hpcprof-mpi. if '+cray' in spec: args.extend([