osu-micro-benchmarks: set NVCCFLAGS (#30221)

This commit is contained in:
Harmen Stoppels 2022-04-22 13:59:26 +02:00 committed by GitHub
parent 62553e7521
commit a7ebdd2d10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,7 @@
from spack import * from spack import *
class OsuMicroBenchmarks(AutotoolsPackage): class OsuMicroBenchmarks(AutotoolsPackage, CudaPackage):
"""The Ohio MicroBenchmark suite is a collection of independent MPI """The Ohio MicroBenchmark suite is a collection of independent MPI
message passing performance microbenchmarks developed and written at message passing performance microbenchmarks developed and written at
The Ohio State University. It includes traditional benchmarks and The Ohio State University. It includes traditional benchmarks and
@ -28,10 +28,7 @@ class OsuMicroBenchmarks(AutotoolsPackage):
version('5.4', sha256='e1ca762e13a07205a59b59ad85e85ce0f826b70f76fd555ce5568efb1f2a8f33') version('5.4', sha256='e1ca762e13a07205a59b59ad85e85ce0f826b70f76fd555ce5568efb1f2a8f33')
version('5.3', sha256='d7b3ad4bee48ac32f5bef39650a88f8f2c23a3050b17130c63966283edced89b') version('5.3', sha256='d7b3ad4bee48ac32f5bef39650a88f8f2c23a3050b17130c63966283edced89b')
variant('cuda', default=False, description="Enable CUDA support")
depends_on('mpi') depends_on('mpi')
depends_on('cuda', when='+cuda')
def configure_args(self): def configure_args(self):
spec = self.spec spec = self.spec
@ -43,13 +40,15 @@ def configure_args(self):
if '+cuda' in spec: if '+cuda' in spec:
config_args.extend([ config_args.extend([
'--enable-cuda', '--enable-cuda',
'--with-cuda=%s' % spec['cuda'].prefix, '--with-cuda=%s' % spec['cuda'].prefix
]) ])
cuda_arch = spec.variants['cuda_arch'].value
if 'none' not in cuda_arch:
config_args.append('NVCCFLAGS=' + ' '.join(self.cuda_flags(cuda_arch)))
# librt not available on darwin (and not required) # librt not available on darwin (and not required)
if not sys.platform == 'darwin': if not sys.platform == 'darwin':
config_args.append('LDFLAGS=-lrt') config_args.append('LDFLAGS=-lrt')
return config_args return config_args
def setup_run_environment(self, env): def setup_run_environment(self, env):