From b5f812cd32c2bc61b511e5a12228fdf413781d13 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Thu, 26 Aug 2021 18:03:49 -0400 Subject: New package: reprimand (#25364) --- .../repos/builtin/packages/reprimand/include.patch | 32 ++++++++++++ .../repos/builtin/packages/reprimand/package.py | 57 ++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 var/spack/repos/builtin/packages/reprimand/include.patch create mode 100644 var/spack/repos/builtin/packages/reprimand/package.py diff --git a/var/spack/repos/builtin/packages/reprimand/include.patch b/var/spack/repos/builtin/packages/reprimand/include.patch new file mode 100644 index 0000000000..11d390d154 --- /dev/null +++ b/var/spack/repos/builtin/packages/reprimand/include.patch @@ -0,0 +1,32 @@ +--- a/library/EOS_Barotropic/eos_barotr_poly.cc ++++ b/library/EOS_Barotropic/eos_barotr_poly.cc +@@ -1,6 +1,7 @@ + #include "eos_barotr_poly.h" + #include "eos_barotr_poly_impl.h" + #include ++#include + #include + + using namespace std; +--- a/library/EOS_Barotropic/eos_barotr_pwpoly.cc ++++ b/library/EOS_Barotropic/eos_barotr_pwpoly.cc +@@ -1,6 +1,7 @@ + #include "eos_barotr_pwpoly.h" + #include "eos_barotr_pwpoly_impl.h" +-#include +-#include ++#include ++#include ++#include + + using namespace std; +--- a/tests/benchmarks/src/accuracy_con2prim_mhd.cc ++++ b/tests/benchmarks/src/accuracy_con2prim_mhd.cc +@@ -9,6 +9,7 @@ + #include + #include + #include ++#include + #include "con2prim_imhd.h" + #include "eos_thermal_file.h" + #include "eos_hybrid.h" diff --git a/var/spack/repos/builtin/packages/reprimand/package.py b/var/spack/repos/builtin/packages/reprimand/package.py new file mode 100644 index 0000000000..d57c60b3e2 --- /dev/null +++ b/var/spack/repos/builtin/packages/reprimand/package.py @@ -0,0 +1,57 @@ +# 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 Reprimand(MesonPackage): + """RePrimAnd is a support library for numerical simulations of general + relativistic magnetohydrodynamics. If provides methods for recovering + primitive variables like pressure and velocity from the variables evolved + in quasi-conservative formulations. Further, it provides a general + framework for handling matter equations of state.""" + + homepage = "https://www.atlas.aei.uni-hannover.de/holohome/wolfgang.kastaun/doc/reprimand/latest/index.html" + url = "https://github.com/wokast/RePrimAnd/archive/refs/tags/v1.3.tar.gz" + + maintainers = ['eschnett'] + + version('develop', git='https://github.com/wokast/RePrimAnd', branch='public') + version('1.3', sha256='8e9f05b1f065a876d1405562285a9f64d1b31c4a436d5a6bb1f023212b40314e') + + # Add missing #include statments; see + # + patch('include.patch', when='@1.3') + + variant('python', default=False, description='Enable Python bindings') + variant('shared', default=True, description='Build shared library') + + depends_on('boost') + depends_on('gsl') + depends_on('hdf5') + depends_on('python', when='+python') + depends_on('py-matplotlib', when='+python') + depends_on('py-pybind11 @2.6.0:', when='+python') + + extends('python', when='+python') + + def setup_build_environment(self, env): + env.set('CXXFLAGS', self.compiler.cxx11_flag) + env.set('BOOST_ROOT', self.spec['boost'].prefix) + + def meson_args(self): + args = [ + '-Dbuild_documentation=false', + '-Dbuild_python_api={0}'.format( + str('+python' in self.spec).lower()), + ] + return args + + @property + def libs(self): + shared = "+shared" in self.spec + return find_libraries( + "libRePrimAnd*", root=self.prefix, shared=shared, recursive=True + ) -- cgit v1.2.3-70-g09d2