enzo: new package (#21634)

This commit is contained in:
Michael Kuhn 2021-02-16 19:42:01 +01:00 committed by GitHub
parent 0107d71b93
commit c8406bd303
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,64 @@
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Enzo(MakefilePackage):
"""The Enzo adaptive mesh-refinement simulation code."""
homepage = "https://enzo-project.org/"
url = "https://github.com/enzo-project/enzo-dev/archive/enzo-2.6.1.tar.gz"
git = "https://github.com/enzo-project/enzo-dev.git"
version('master', branch='master')
version('2.6.1', sha256='280270accfc1ddb60e92cc98ca538a3e5787e8cc93ed58fb5c3ab75db8c4b048')
depends_on('mpi')
depends_on('hdf5~mpi')
# https://github.com/enzo-project/enzo-dev/pull/158
patch('https://github.com/enzo-project/enzo-dev/commit/0191ff5ad9ad2c7639d44823e84cd0115e7a2970.patch', sha256='01328a5f5fe72ac5af31661deb6891ea160264b67a470d6ce91b71b001845810', when='@2.6.1 ^hdf5@1.12.0:')
def flag_handler(self, name, flags):
if name == 'fflags':
if self.spec.satisfies('%gcc@10:'):
if flags is None:
flags = []
flags.append('-fallow-argument-mismatch')
return (flags, None, None)
def edit(self, spec, prefix):
configure = Executable('./configure')
configure()
with working_dir('src/enzo'):
copy('Make.mach.linux-gnu', 'Make.mach.spack')
filter_file('^MACH_FILE.*',
'MACH_FILE = Make.mach.spack',
'Make.mach.spack')
filter_file('^LOCAL_HDF5_INSTALL.*',
'LOCAL_HDF5_INSTALL = {0}'.format(spec['hdf5'].prefix),
'Make.mach.spack')
filter_file('^LOCAL_GRACKLE_INSTALL.*',
'LOCAL_GRACKLE_INSTALL =',
'Make.mach.spack')
filter_file('^LOCAL_HYPRE_INSTALL.*',
'LOCAL_HYPRE_INSTALL =',
'Make.mach.spack')
def build(self, spec, prefix):
with working_dir('src/enzo'):
make('machine-spack')
make('opt-high')
make('show-config')
make()
def install(self, spec, prefix):
install_tree('bin', prefix.bin)
install_tree('doc', prefix.doc)
install_tree('input', prefix.input)
install_tree('run', prefix.run)