diff options
author | Erik Schnetter <schnetter@gmail.com> | 2021-08-01 15:22:07 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-01 19:22:07 +0000 |
commit | f9703c1c9fac46ee24a85d3740a4d0fd40da4533 (patch) | |
tree | 070be8fc7e15cdd7cc278dc16c6f95ba117918dc /var | |
parent | 861abb512e7f974cd399d2bcfdf4e22b38db7b4b (diff) | |
download | spack-f9703c1c9fac46ee24a85d3740a4d0fd40da4533.tar.gz spack-f9703c1c9fac46ee24a85d3740a4d0fd40da4533.tar.bz2 spack-f9703c1c9fac46ee24a85d3740a4d0fd40da4533.tar.xz spack-f9703c1c9fac46ee24a85d3740a4d0fd40da4533.zip |
kadath: New package (#25162)
* kadath: New package
* Update var/spack/repos/builtin/packages/kadath/package.py
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
* Update var/spack/repos/builtin/packages/kadath/package.py
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
* Update var/spack/repos/builtin/packages/kadath/package.py
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
* Update var/spack/repos/builtin/packages/kadath/package.py
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
* kadath: Add description to MPI variant
* kadath: Add empty line
* kadath: Add variant "codes=none" to avoid empty default
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/kadath/package.py | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/kadath/package.py b/var/spack/repos/builtin/packages/kadath/package.py new file mode 100644 index 0000000000..6abfdd9ab2 --- /dev/null +++ b/var/spack/repos/builtin/packages/kadath/package.py @@ -0,0 +1,88 @@ +# 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) + +import os + +from spack import * + + +class Kadath(CMakePackage): + """KADATH SPECTRAL SOLVER. + + The Frankfurt University/Kadath (FUKA) Initial Data solver branch is + a collection of ID solvers aimed at delivering consistent initial + data (ID) solutions to the eXtended Conformal Thin-Sandwich (XCTS) + formulation of Einstein's field equations for a variety of compact + object configurations to include extremely compact, asymmetric, and + mixed spin binaries. + """ + + homepage = "https://kadath.obspm.fr/fuka/" + git = "https://gitlab.obspm.fr/grandcle/Kadath.git" + + maintainers = ['eschnett'] + + version('fuka', branch='fuka') + + variant('mpi', default=True, description='Enable MPI support') + + variant('codes', multi=True, + description="Codes to enable", + values=('none', 'BBH', 'BH', 'BHNS', 'BNS', 'NS'), + default='none') + + depends_on('blas') + depends_on('boost cxxstd=17') # kadath uses std=C++17 + depends_on('cmake @2.8:', type='build') + depends_on('fftw-api @3:') + depends_on('gsl') + depends_on('lapack') + depends_on('mpi', when='+mpi') + depends_on('pgplot') + depends_on('scalapack') + + root_cmakelists_dir = 'build_release' + + def patch(self): + for code in self.spec.variants['codes'].value: + if code != 'none': + # Disable unwanted explicit include directory settings + filter_file(r"include_directories\(/usr", + "# include_directories(/usr", + join_path("codes", code, "CMakeLists.txt")) + + def setup_build_environment(self, env): + env.set('HOME_KADATH', self.stage.source_path) + + def cmake_args(self): + return [ + # kadath uses a non-standard option to enable MPI + self.define_from_variant('PAR_VERSION', 'mpi'), + ] + + def cmake(self, spec, prefix): + options = self.std_cmake_args + options += self.cmake_args() + options.append(os.path.abspath(self.root_cmakelists_dir)) + with working_dir(self.build_directory, create=True): + cmake(*options) + for code in self.spec.variants['codes'].value: + if code != 'none': + with working_dir(join_path("codes", code)): + cmake(*options) + + def build(self, spec, prefix): + with working_dir(self.build_directory): + make(*self.build_targets) + for code in self.spec.variants['codes'].value: + if code != 'none': + with working_dir(join_path("codes", code)): + make(*self.build_targets) + + def install(self, spec, prefix): + mkdirp(prefix.include) + install_tree('include', prefix.include) + mkdirp(prefix.lib) + install_tree('lib', prefix.lib) |