Update samrai 2.4.4 (#9311)
* Add support for samrai+silo. * Add patch for SAMRAI 2.4.4
This commit is contained in:
parent
37056edb56
commit
caab0d53a2
@ -41,19 +41,23 @@ class Samrai(AutotoolsPackage):
|
|||||||
# and more print statements
|
# and more print statements
|
||||||
variant('debug', default=False,
|
variant('debug', default=False,
|
||||||
description='Compile with reduced optimization and debugging on')
|
description='Compile with reduced optimization and debugging on')
|
||||||
|
variant('silo', default=False,
|
||||||
|
description='Compile with support for silo')
|
||||||
|
|
||||||
depends_on('mpi')
|
depends_on('mpi')
|
||||||
depends_on('zlib')
|
depends_on('zlib')
|
||||||
depends_on('hdf5+mpi')
|
depends_on('hdf5+mpi')
|
||||||
depends_on('m4', type='build')
|
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.
|
# don't build SAMRAI 3+ with tools with gcc
|
||||||
# version 3.11.5 or earlier can only work with boost version
|
patch('no-tool-build.patch', when='@3.0.0:%gcc')
|
||||||
# 1.64.0 or earlier.
|
|
||||||
depends_on('boost@:1.64.0', when='@0:3.11.99', type='build')
|
|
||||||
|
|
||||||
# don't build tools with gcc
|
# 2.4.4 needs a lot of patches to fix ADL and performance problems
|
||||||
patch('no-tool-build.patch', when='%gcc')
|
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):
|
def configure_args(self):
|
||||||
options = []
|
options = []
|
||||||
@ -70,6 +74,10 @@ def configure_args(self):
|
|||||||
'--with-hypre=no',
|
'--with-hypre=no',
|
||||||
'--with-petsc=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:
|
if '+debug' in self.spec:
|
||||||
options.extend([
|
options.extend([
|
||||||
'--disable-opt',
|
'--disable-opt',
|
||||||
@ -79,16 +87,14 @@ def configure_args(self):
|
|||||||
'--enable-opt',
|
'--enable-opt',
|
||||||
'--disable-debug'])
|
'--disable-debug'])
|
||||||
|
|
||||||
if self.version >= Version('3.12.0'):
|
if '+silo' in self.spec:
|
||||||
# only version 3.12.0 and above, samrai does not use
|
options.append('--with-silo=%s' % self.spec['silo'].prefix)
|
||||||
# boost, but needs c++11. Without c++11 flags, samrai
|
|
||||||
# cannot build with either gcc or intel compilers.
|
if self.spec.satisfies('@3.0:3.11.99'):
|
||||||
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
|
|
||||||
options.append('--with-boost=%s' % self.spec['boost'].prefix)
|
options.append('--with-boost=%s' % self.spec['boost'].prefix)
|
||||||
|
|
||||||
return options
|
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user