summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/mercury/package.py136
1 files changed, 60 insertions, 76 deletions
diff --git a/var/spack/repos/builtin/packages/mercury/package.py b/var/spack/repos/builtin/packages/mercury/package.py
index f25d250ec8..87abf1069e 100644
--- a/var/spack/repos/builtin/packages/mercury/package.py
+++ b/var/spack/repos/builtin/packages/mercury/package.py
@@ -9,21 +9,28 @@ class Mercury(CMakePackage):
"""Mercury is a C library for implementing RPC, optimized for HPC"""
homepage = 'https://mercury-hpc.github.io/'
- url = 'https://github.com/mercury-hpc/mercury/archive/0.9.0.tar.gz'
+ url = 'https://github.com/mercury-hpc/mercury/releases/download/v1.0.1/mercury-1.0.1.tar.bz2'
git = 'https://github.com/mercury-hpc/mercury.git'
- version('develop', branch='master', submodules=True)
- version('1.0.1', tag='v1.0.1', submodules=True)
- version('1.0.0', tag='v1.0.0', submodules=True)
- version('0.9.0', tag='v0.9.0', submodules=True)
-
- variant('bmi', default=False, description='Use BMI for network transport')
- variant('cci', default=False, description='Use CCI for network transport')
- variant('mpi', default=False, description='Use MPI for network transport')
- variant('ofi', default=True, description='Use libfabric plugin')
- variant('sm', default=False, description='Use shared-memory plugin')
- variant('opa', default=False, description='Use OpenPA for atomics')
- variant('boost', default=True, description='Use BOOST preprocessor macros')
+ maintainers = ['soumagne']
+
+ version('master', branch='master', submodules=True)
+ version('1.0.1', sha256='02febd56c401ef7afa250caf28d012b37dee842bfde7ee16fcd2f741b9cf25b3')
+ version('1.0.0', sha256='fb0e44d13f4652f53e21040435f91d452bc2b629b6e98dcf5292cd0bece899d4')
+ version('0.9.0', sha256='40868e141cac035213fe79400f8926823fb1f5a0651fd7027cbe162b063843ef')
+
+ variant('bmi', default=False, description='Use BMI plugin')
+ variant('cci', default=False, description='Use CCI plugin')
+ variant('mpi', default=False, description='Use MPI plugin')
+ variant('ofi', default=True, description='Use OFI libfabric plugin')
+ # NOTE: the sm plugin does not require any package dependency.
+ variant('sm', default=True, description='Use shared-memory plugin')
+ # NOTE: if boostsys is False, mercury will install its own copy
+ # of the preprocessor headers.
+ variant('boostsys', default=True,
+ description='Use preprocessor headers from boost dependency')
+ variant('shared', default=True,
+ description='Build with shared libraries')
variant('selfforward', default=True,
description='Mercury will short-circuit operations' +
' by forwarding to itself when possible')
@@ -38,78 +45,55 @@ class Mercury(CMakePackage):
depends_on('bmi', when='+bmi')
depends_on('mpi', when='+mpi')
depends_on('libfabric@1.5:', when='+ofi')
- depends_on('openpa@1.0.3:', when='+opa')
- depends_on('boost@1.48:', when='+boost')
+ depends_on('openpa@1.0.3:', when='%gcc@:4.8')
+ depends_on('boost@1.48:', when='+boostsys')
+ depends_on('boost', when='@:0.9') # internal boost headers were added in 1.0.0
+
+ conflicts('+ofi', when='@:0.9') # libfabric support was added in 1.0.0
+ conflicts('~ofi', when='+udreg') # udreg option is specific to OFI
def cmake_args(self):
+ """Populate cmake arguments for Mercury."""
spec = self.spec
- args = [
- '-DBUILD_SHARED_LIBS=ON',
- '-DMERCURY_USE_CHECKSUMS=ON',
- '-DMERCURY_USE_EAGER_BULK=ON',
- '-DMERCURY_USE_SYSTEM_MCHECKSUM=OFF',
- '-DMERCURY_USE_XDR=OFF'
+ variant_bool = lambda feature: str(feature in spec)
+ parallel_tests = '+mpi' in spec and self.run_tests
+
+ cmake_args = [
+ '-DBUILD_SHARED_LIBS:BOOL=%s' % variant_bool('+shared'),
+ '-DBUILD_TESTING:BOOL=%s' % str(self.run_tests),
+ '-DMERCURY_ENABLE_PARALLEL_TESTING:BOOL=%s' % str(parallel_tests),
+ '-DMERCURY_USE_BOOST_PP:BOOL=ON',
+ '-DMERCURY_USE_CHECKSUMS:BOOL=ON',
+ '-DMERCURY_USE_EAGER_BULK:BOOL=ON',
+ '-DMERCURY_USE_SELF_FORWARD:BOOL=%s'
+ % variant_bool('+selfforward'),
+ '-DMERCURY_USE_SYSTEM_MCHECKSUM:BOOL=OFF',
+ '-DMERCURY_USE_XDR:BOOL=OFF',
+ '-DNA_USE_BMI:BOOL=%s' % variant_bool('+bmi'),
+ '-DNA_USE_CCI:BOOL=%s' % variant_bool('+cci'),
+ '-DNA_USE_MPI:BOOL=%s' % variant_bool('+mpi'),
+ '-DNA_USE_SM:BOOL=%s' % variant_bool('+sm'),
]
- if '+boost' in spec:
- args.append('-DMERCURY_USE_BOOST_PP=ON')
- else:
- args.append('-DMERCURY_USE_BOOST_PP=OFF')
-
- if '+bmi' in spec:
- args.append('-DNA_USE_BMI=ON')
- else:
- args.append('-DNA_USE_BMI=OFF')
-
- if '+cci' in spec:
- args.append('-DNA_USE_CCI=ON')
- else:
- args.append('-DNA_USE_CCI=OFF')
-
- if '+mpi' in spec:
- args.append('-DNA_USE_MPI=ON')
- else:
- args.append('-DNA_USE_MPI=OFF')
+ if '@1.0.0:' in spec:
+ cmake_args.extend([
+ '-DMERCURY_USE_SYSTEM_BOOST:BOOL=%s'
+ % variant_bool('+boostsys'),
+ '-DNA_USE_OFI:BOOL=%s' % variant_bool('+ofi'),
+ ])
if '+ofi' in spec:
- args.append('-DNA_USE_OFI=ON')
+ cmake_args.append(
+ '-DNA_OFI_GNI_USE_UDREG:BOOL=%s' % variant_bool('+udreg')
+ )
if self.run_tests:
- args.append('-DNA_OFI_TESTING_PROTOCOL={0}'.format(';'.join(
- spec['libfabric'].variants['fabrics'].value)))
- else:
- args.append('-DNA_USE_OFI=OFF')
-
- if '+sm' in spec:
- args.append('-DNA_USE_SM=ON')
- else:
- args.append('-DNA_USE_SM=OFF')
-
- if '+opa' in spec:
- args.append('-DMERCURY_USE_OPA=ON')
- else:
- args.append('-DMERCURY_USE_OPA=OFF')
-
- if '+selfforward' in spec:
- args.append('-DMERCURY_USE_SELF_FORWARD=ON')
- else:
- args.append('-DMERCURY_USE_SELF_FORWARD=OFF')
-
- if '+udreg' in spec:
- args.append('-DNA_OFI_GNI_USE_UDREG=ON')
- else:
- args.append('-DNA_OFI_GNI_USE_UDREG=OFF')
-
- if self.run_tests:
- args.append('-DBUILD_TESTING=ON')
- else:
- args.append('-DBUILD_TESTING=OFF')
-
- if '+mpi' in spec and self.run_tests:
- args.append('-DMERCURY_ENABLE_PARALLEL_TESTING=ON')
- else:
- args.append('-DMERCURY_ENABLE_PARALLEL_TESTING=OFF')
+ cmake_args.append(
+ '-DNA_OFI_TESTING_PROTOCOL:STRING={0}'.format(
+ ';'.join(spec['libfabric'].variants['fabrics'].value)
+ )
+ )
- return args
+ return cmake_args
def check(self):
"""Unit tests fail when run in parallel."""