From caab0d53a247f8f68be93980ab32b7c2284fc65c Mon Sep 17 00:00:00 2001 From: David Wells Date: Thu, 18 Oct 2018 16:20:07 -0400 Subject: Update samrai 2.4.4 (#9311) * Add support for samrai+silo. * Add patch for SAMRAI 2.4.4 --- var/spack/repos/builtin/packages/samrai/package.py | 38 +++++++++++++--------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/var/spack/repos/builtin/packages/samrai/package.py b/var/spack/repos/builtin/packages/samrai/package.py index 69c840b490..468531da1b 100644 --- a/var/spack/repos/builtin/packages/samrai/package.py +++ b/var/spack/repos/builtin/packages/samrai/package.py @@ -41,19 +41,23 @@ class Samrai(AutotoolsPackage): # and more print statements variant('debug', default=False, description='Compile with reduced optimization and debugging on') + variant('silo', default=False, + description='Compile with support for silo') depends_on('mpi') depends_on('zlib') depends_on('hdf5+mpi') depends_on('m4', type='build') + depends_on('boost@:1.64.0', when='@3.0.0:3.11.99', type='build') + depends_on('silo+mpi', when='+silo') - # Starting with 3.12.0, samrai no longer depends on boost. - # version 3.11.5 or earlier can only work with boost version - # 1.64.0 or earlier. - depends_on('boost@:1.64.0', when='@0:3.11.99', type='build') + # don't build SAMRAI 3+ with tools with gcc + patch('no-tool-build.patch', when='@3.0.0:%gcc') - # don't build tools with gcc - patch('no-tool-build.patch', when='%gcc') + # 2.4.4 needs a lot of patches to fix ADL and performance problems + patch('https://github.com/IBAMR/IBAMR/releases/download/v0.3.0/ibamr-samrai-fixes.patch', + sha256='1d088b6cca41377747fa0ae8970440c20cb68988bbc34f9032d5a4e6aceede47', + when='@2.4.4') def configure_args(self): options = [] @@ -70,6 +74,10 @@ class Samrai(AutotoolsPackage): '--with-hypre=no', '--with-petsc=no']) + # SAMRAI 2 used templates; enable implicit instantiation + if self.spec.satisfies('@:3'): + options.append('--enable-implicit-template-instantiation') + if '+debug' in self.spec: options.extend([ '--disable-opt', @@ -79,16 +87,14 @@ class Samrai(AutotoolsPackage): '--enable-opt', '--disable-debug']) - if self.version >= Version('3.12.0'): - # only version 3.12.0 and above, samrai does not use - # boost, but needs c++11. Without c++11 flags, samrai - # cannot build with either gcc or intel compilers. - if 'CXXFLAGS' in env and env['CXXFLAGS']: - env['CXXFLAGS'] += ' ' + self.compiler.cxx11_flag - else: - env['CXXFLAGS'] = self.compiler.cxx11_flag - else: - # boost 1.64.0 or earlier works with samrai 2.4.4~3.11.5 + if '+silo' in self.spec: + options.append('--with-silo=%s' % self.spec['silo'].prefix) + + if self.spec.satisfies('@3.0:3.11.99'): options.append('--with-boost=%s' % self.spec['boost'].prefix) return options + + def setup_dependent_environment(self, spack_env, run_env, dependent_spec): + if self.spec.satisfies('@3.12:'): + spack_env.append_flags('CXXFLAGS', self.compiler.cxx11_flag) -- cgit v1.2.3-60-g2f50