LBANN: add hydrogen as optional dependency (#8085)

Add Hydrogen package for fork of Elemental library. Update LBANN
to use either Hydrogen or Elemental.
This commit is contained in:
Brian Van Essen
2018-05-14 11:58:34 -07:00
committed by scheibelp
parent e7a737621f
commit 281e22ed73
2 changed files with 188 additions and 6 deletions

View File

@@ -51,13 +51,30 @@ class Lbann(CMakePackage):
description='The build type to build',
values=('Debug', 'Release'))
depends_on('elemental +openmp_blas +shared +int64')
# It seems that there is a need for one statement per version bounds
depends_on('hydrogen +openmp_blas +shared +int64', when='@0.95:')
depends_on('hydrogen +openmp_blas +shared +int64', when='@:0.90')
depends_on('hydrogen +openmp_blas +shared +int64 build_type=Debug',
when=('build_type=Debug' '@0.95:'))
depends_on('hydrogen +openmp_blas +shared +int64 build_type=Debug',
when=('build_type=Debug' '@:0.90'))
depends_on('hydrogen +openmp_blas +shared +int64 +cuda',
when=('+gpu' '@0.95:'))
depends_on('hydrogen +openmp_blas +shared +int64 +cuda',
when=('+gpu' '@:0.90'))
depends_on('hydrogen +openmp_blas +shared +int64 +cuda build_type=Debug',
when=('build_type=Debug' '@0.95:' '+gpu'))
depends_on('hydrogen +openmp_blas +shared +int64 +cuda build_type=Debug',
when=('build_type=Debug' '@:0.90' '+gpu'))
depends_on('elemental +openmp_blas +shared +int64', when=('@0.91:0.94'))
depends_on('elemental +openmp_blas +shared +int64 build_type=Debug',
when=('build_type=Debug'))
when=('build_type=Debug' '@0.91:0.94'))
depends_on('cuda', when='+gpu')
depends_on('cudnn', when='+gpu')
depends_on('cub', when='+gpu')
depends_on('mpi')
depends_on('mpi', when='~gpu')
depends_on('mpi +cuda', when='+gpu')
depends_on('hwloc ~pci ~libxml2')
# LBANN wraps OpenCV calls in OpenMP parallel loops, build without OpenMP
# Additionally disable video related options, they incorrectly link in a
@@ -89,7 +106,7 @@ def common_config_args(self):
# Get any recent versions or non-numeric version
# Note that develop > numeric and non-develop < numeric
@when('@:0.91' or '@0.94:')
@when('@:0.90' or '@0.94:')
def cmake_args(self):
spec = self.spec
args = self.common_config_args
@@ -99,11 +116,18 @@ def cmake_args(self):
('+seq_init' in spec),
'-DLBANN_WITH_TBINF=OFF',
'-DLBANN_WITH_VTUNE=OFF',
'-DElemental_DIR={0}/CMake/elemental'.format(
spec['elemental'].prefix),
'-DLBANN_DATATYPE={0}'.format(spec.variants['dtype'].value),
'-DLBANN_VERBOSE=0'])
if self.spec.satisfies('@:0.90') or self.spec.satisfies('@0.95:'):
args.extend([
'-DHydrogen_DIR={0}/CMake/hydrogen'.format(
spec['hydrogen'].prefix)])
elif self.spec.satisfies('@0.94'):
args.extend([
'-DElemental_DIR={0}/CMake/elemental'.format(
spec['elemental'].prefix)])
# Add support for OpenMP
if (self.spec.satisfies('%clang')):
if (sys.platform == 'darwin'):