Skip to content

Commit

Permalink
Merge pull request #632 from LLNL/task/update-spack-package
Browse files Browse the repository at this point in the history
Update local Spack package to match Spack develop
  • Loading branch information
davidbeckingsale committed Sep 3, 2021
2 parents 6c32b36 + 76713ad commit e6bd629
Showing 1 changed file with 53 additions and 46 deletions.
99 changes: 53 additions & 46 deletions .spack_packages/packages/umpire/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,35 @@ class Umpire(CachedCMakePackage, CudaPackage, ROCmPackage):

maintainers = ['davidbeckingsale']

version('develop', branch='develop', submodules='True')
version('main', branch='main', submodules='True')
version('4.1.2', tag='v4.1.2', submodules='True')
version('4.1.1', tag='v4.1.1', submodules='True')
version('4.1.0', tag='v4.1.0', submodules='True')
version('4.0.1', tag='v4.0.1', submodules='True')
version('4.0.0', tag='v4.0.0', submodules='True')
version('3.0.0', tag='v3.0.0', submodules='True')
version('2.1.0', tag='v2.1.0', submodules='True')
version('2.0.0', tag='v2.0.0', submodules='True')
version('1.1.0', tag='v1.1.0', submodules='True')
version('1.0.1', tag='v1.0.1', submodules='True')
version('1.0.0', tag='v1.0.0', submodules='True')
version('0.3.5', tag='v0.3.5', submodules='True')
version('0.3.4', tag='v0.3.4', submodules='True')
version('0.3.3', tag='v0.3.3', submodules='True')
version('0.3.2', tag='v0.3.2', submodules='True')
version('0.3.1', tag='v0.3.1', submodules='True')
version('0.3.0', tag='v0.3.0', submodules='True')
version('0.2.4', tag='v0.2.4', submodules='True')
version('0.2.3', tag='v0.2.3', submodules='True')
version('0.2.2', tag='v0.2.2', submodules='True')
version('0.2.1', tag='v0.2.1', submodules='True')
version('0.2.0', tag='v0.2.0', submodules='True')
version('0.1.4', tag='v0.1.4', submodules='True')
version('0.1.3', tag='v0.1.3', submodules='True')
version('develop', branch='develop', submodules=True)
version('main', branch='main', submodules=True)
version('6.0.0', tag='v6.0.0', submodules=True)
version('5.0.1', tag='v5.0.1', submodules=True)
version('5.0.0', tag='v5.0.0', submodules=True)
version('4.1.2', tag='v4.1.2', submodules=True)
version('4.1.1', tag='v4.1.1', submodules=True)
version('4.1.0', tag='v4.1.0', submodules=True)
version('4.0.1', tag='v4.0.1', submodules=True)
version('4.0.0', tag='v4.0.0', submodules=True)
version('3.0.0', tag='v3.0.0', submodules=True)
version('2.1.0', tag='v2.1.0', submodules=True)
version('2.0.0', tag='v2.0.0', submodules=True)
version('1.1.0', tag='v1.1.0', submodules=True)
version('1.0.1', tag='v1.0.1', submodules=True)
version('1.0.0', tag='v1.0.0', submodules=True)
version('0.3.5', tag='v0.3.5', submodules=True)
version('0.3.4', tag='v0.3.4', submodules=True)
version('0.3.3', tag='v0.3.3', submodules=True)
version('0.3.2', tag='v0.3.2', submodules=True)
version('0.3.1', tag='v0.3.1', submodules=True)
version('0.3.0', tag='v0.3.0', submodules=True)
version('0.2.4', tag='v0.2.4', submodules=True)
version('0.2.3', tag='v0.2.3', submodules=True)
version('0.2.2', tag='v0.2.2', submodules=True)
version('0.2.1', tag='v0.2.1', submodules=True)
version('0.2.0', tag='v0.2.0', submodules=True)
version('0.1.4', tag='v0.1.4', submodules=True)
version('0.1.3', tag='v0.1.3', submodules=True)

patch('camp_target_umpire_3.0.0.patch', when='@3.0.0')
patch('cmake_version_check.patch', when='@4.1.0:main')
Expand All @@ -62,21 +65,26 @@ class Umpire(CachedCMakePackage, CudaPackage, ROCmPackage):
depends_on('cmake@3.8:', type='build')
depends_on('cmake@3.9:', when='+cuda', type='build')

depends_on('blt@0.4.0:', type='build', when='@4.1.3:')
depends_on('blt@:0.3.6', type='build', when='@:4.1.2')
depends_on('blt@0.4.1:', type='build', when='@6.0.0:')
depends_on('blt@0.4.0:', type='build', when='@4.1.3:5.0.1')
depends_on('blt@0.3.6:', type='build', when='@:4.1.2')

# variants +rocm and amdgpu_targets are not automatically passed to
# dependencies, so do it manually.
depends_on('camp+rocm', when='+rocm')
for val in ROCmPackage.amdgpu_targets:
depends_on('camp amdgpu_target=%s' % val, when='amdgpu_target=%s' % val)
depends_on('camp', when='@5.0.0:')
depends_on('camp@0.2.2', when='@6.0.0:')
depends_on('camp@0.1.0', when='@5.0.0:5.0.1')

depends_on('camp+cuda', when='+cuda')
for sm_ in CudaPackage.cuda_arch_values:
depends_on('camp cuda_arch={0}'.format(sm_),
when='cuda_arch={0}'.format(sm_))
with when('@5.0.0:'):
with when('+cuda'):
depends_on('camp+cuda')
for sm_ in CudaPackage.cuda_arch_values:
depends_on('camp+cuda cuda_arch={0}'.format(sm_),
when='cuda_arch={0}'.format(sm_))

depends_on('camp')
with when('+rocm'):
depends_on('camp+rocm')
for arch_ in ROCmPackage.amdgpu_targets:
depends_on('camp+rocm amdgpu_target={0}'.format(arch_),
when='amdgpu_target={0}'.format(arch_))

conflicts('+numa', when='@:0.3.2')
conflicts('~c', when='+fortran', msg='Fortran API requires C API')
Expand Down Expand Up @@ -113,6 +121,8 @@ def initconfig_compiler_entries(self):
else:
entries.append(cmake_cache_option("ENABLE_FORTRAN", False))

entries.append(cmake_cache_option("ENABLE_C", '+c' in spec))

return entries

def initconfig_hardware_entries(self):
Expand All @@ -125,6 +135,7 @@ def initconfig_hardware_entries(self):
if not spec.satisfies('cuda_arch=none'):
cuda_arch = spec.variants['cuda_arch'].value
entries.append(cmake_cache_string("CUDA_ARCH", 'sm_{0}'.format(cuda_arch[0])))
entries.append(cmake_cache_string("CMAKE_CUDA_ARCHITECTURES={0}".format(cuda_arch[0])))
flag = '-arch sm_{0}'.format(cuda_arch[0])
entries.append(cmake_cache_string("CMAKE_CUDA_FLAGS", '{0}'.format(flag)))

Expand Down Expand Up @@ -154,12 +165,14 @@ def initconfig_package_entries(self):
entries.append("#------------------{0}\n".format("-" * 60))

entries.append(cmake_cache_path("BLT_SOURCE_DIR", spec['blt'].prefix))
entries.append(cmake_cache_path("camp_DIR" ,spec['camp'].prefix))
entries.append(cmake_cache_option("ENABLE_C", '+c' in spec))
if spec.satisfies('@5.0.0:'):
entries.append(cmake_cache_path("camp_DIR" ,spec['camp'].prefix))
entries.append(cmake_cache_option("ENABLE_NUMA", '+numa' in spec))
entries.append(cmake_cache_option("ENABLE_OPENMP", '+openmp' in spec))
entries.append(cmake_cache_option("ENABLE_BENCHMARKS", 'tests=benchmarks' in spec))
entries.append(cmake_cache_option("ENABLE_EXAMPLES", '+examples' in spec))
entries.append(cmake_cache_option("BUILD_SHARED_LIBS", '+shared' in spec))
entries.append(cmake_cache_option("ENABLE_TESTS", not 'tests=none' in spec))

return entries

Expand All @@ -168,12 +181,6 @@ def cmake_args(self):

options = []

options.append('-DBUILD_SHARED_LIBS={0}'.format(
'On' if '+shared' in spec else 'Off'))

options.append('-DENABLE_TESTS={0}'.format(
'Off' if 'tests=none' in spec else 'On'))

return options

def test(self):
Expand Down

0 comments on commit e6bd629

Please sign in to comment.