Make usage example consistent with current MV variants (#16468)

Since #9481 Python's None is not permitted as a value for
MV variants. The string 'none' is used instead.

Add the same fix for the amgx and lammps packages
This commit is contained in:
Massimiliano Culpo 2020-05-05 20:22:32 +02:00 committed by GitHub
parent de71b2828f
commit aa9c98b6a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -37,7 +37,7 @@ In order to use it, just add another base class to your package, for example:
if '+cuda' in spec: if '+cuda' in spec:
options.append('-DWITH_CUDA=ON') options.append('-DWITH_CUDA=ON')
cuda_arch = spec.variants['cuda_arch'].value cuda_arch = spec.variants['cuda_arch'].value
if cuda_arch is not None: if cuda_arch != 'none':
options.append('-DCUDA_FLAGS=-arch=sm_{0}'.format(cuda_arch[0])) options.append('-DCUDA_FLAGS=-arch=sm_{0}'.format(cuda_arch[0]))
else: else:
options.append('-DWITH_CUDA=OFF') options.append('-DWITH_CUDA=OFF')

View file

@ -42,7 +42,7 @@ def cmake_args(self):
if '+cuda' in self.spec: if '+cuda' in self.spec:
args.append('-DWITH_CUDA=ON') args.append('-DWITH_CUDA=ON')
cuda_arch = self.spec.variants['cuda_arch'].value cuda_arch = self.spec.variants['cuda_arch'].value
if cuda_arch is not None: if cuda_arch != 'none':
args.append('-DCUDA_ARCH={0}'.format(cuda_arch[0])) args.append('-DCUDA_ARCH={0}'.format(cuda_arch[0]))
else: else:
args.append('-DWITH_CUDA=OFF') args.append('-DWITH_CUDA=OFF')

View file

@ -150,7 +150,7 @@ def cmake_args(self):
args.append('-DPKG_GPU=ON') args.append('-DPKG_GPU=ON')
args.append('-DGPU_API=cuda') args.append('-DGPU_API=cuda')
cuda_arch = spec.variants['cuda_arch'].value cuda_arch = spec.variants['cuda_arch'].value
if cuda_arch is not None: if cuda_arch != 'none':
args.append('-DGPU_ARCH=sm_{0}'.format(cuda_arch[0])) args.append('-DGPU_ARCH=sm_{0}'.format(cuda_arch[0]))
args.append('-DCUDA_MPS_SUPPORT={0}'.format( args.append('-DCUDA_MPS_SUPPORT={0}'.format(
'ON' if '+cuda_mps' in spec else 'OFF')) 'ON' if '+cuda_mps' in spec else 'OFF'))