92 lines
3.8 KiB
Python
92 lines
3.8 KiB
Python
# Copyright Spack Project Developers. See COPYRIGHT file for details.
|
|
#
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
from spack.package import *
|
|
|
|
|
|
class Purify(CMakePackage):
|
|
"""PURIFY is an open-source collection of routines written in C++ available under the
|
|
license below. It implements different tools and high-level to perform radio interferometric
|
|
imaging, i.e. to recover images from the Fourier measurements taken by radio interferometric
|
|
telescopes.
|
|
"""
|
|
|
|
homepage = "https://astro-informatics.github.io/purify/"
|
|
url = "https://github.com/astro-informatics/purify/archive/refs/tags/v4.2.0.tar.gz"
|
|
git = "https://github.com/astro-informatics/purify"
|
|
|
|
maintainers("tkoskela", "mmcleod89", "20DM")
|
|
license("GPL-2.0")
|
|
|
|
version("5.0.1", sha256="a5f4b1bac1e46d858b5dbb1237ef3babd9c1f23f5b9f081cca3992da61bbc124")
|
|
version("5.0.0", sha256="64e150427c94f6edfcc5a630f14c8939db73349ff7b32f43504ce8211b5fd6fa")
|
|
version("4.2.0", sha256="4d674007efc727628839fb6c8864e74f22adb39ee6405d3dab273f65b31b37e6")
|
|
version("dev", branch="development")
|
|
|
|
variant("tests", default=True, description="Build tests")
|
|
variant("openmp", default=True, description="Enable multithreading with OpenMP")
|
|
variant("mpi", default=True, description="Enable parallelisation with MPI")
|
|
variant("benchmarks", default=False, description="Build benchmarks")
|
|
variant("docs", default=False, description="Enable multithreading with OpenMP")
|
|
variant("coverage", default=False, description="Enable code coverage")
|
|
variant("hdf5", default=False, description="Enable hdf5 I/O")
|
|
variant(
|
|
"onnxrt",
|
|
when="@5.0.0:",
|
|
default=False,
|
|
description="Build with Tensorflow support using onnx in SOPT",
|
|
)
|
|
|
|
depends_on("cmake@3")
|
|
depends_on("eigen@3.4:3")
|
|
depends_on("libtiff@4.7:")
|
|
depends_on("fftw-api")
|
|
depends_on("yaml-cpp@0.7:")
|
|
depends_on("boost@1.82+system+filesystem")
|
|
depends_on("cfitsio@4")
|
|
depends_on("cubature@1")
|
|
depends_on("sopt~mpi", when="~mpi")
|
|
depends_on("sopt+mpi", when="+mpi")
|
|
depends_on("sopt~openmp", when="~openmp")
|
|
depends_on("sopt+openmp", when="+openmp")
|
|
depends_on("sopt~onnxrt", when="~onnxrt")
|
|
depends_on("sopt+onnxrt", when="+onnxrt")
|
|
depends_on("catch2@3.4:3", when="+tests")
|
|
depends_on("mpi", when="+mpi")
|
|
depends_on("benchmark@1.8~performance_counters", when="+benchmarks")
|
|
depends_on("doxygen@1.9:1.12+graphviz", when="+docs")
|
|
depends_on("py-onnxruntime@1.17.1:", when="+onnxrt")
|
|
depends_on("hdf5+cxx", when="+hdf5")
|
|
depends_on("highfive", when="+hdf5")
|
|
depends_on("c", type="build")
|
|
depends_on("cxx", type="build")
|
|
|
|
def cmake_args(self):
|
|
args = [
|
|
self.define_from_variant("docs", "docs"),
|
|
self.define_from_variant("tests", "tests"),
|
|
self.define_from_variant("benchmarks", "benchmarks"),
|
|
self.define_from_variant("openmp", "openmp"),
|
|
self.define_from_variant("dompi", "mpi"),
|
|
self.define_from_variant("coverage", "coverage"),
|
|
self.define_from_variant("onnxrt", "onnxrt"),
|
|
self.define_from_variant("hdf5", "hdf5"),
|
|
]
|
|
return args
|
|
|
|
def setup_run_environment(self, env: EnvironmentModifications) -> None:
|
|
if "+tests" in self.spec:
|
|
env.prepend_path("PATH", self.spec.prefix.tests)
|
|
if "+benchmarks" in self.spec:
|
|
env.prepend_path("PATH", join_path(self.spec.prefix, "benchmarks"))
|
|
|
|
def install(self, spec, prefix):
|
|
with working_dir(self.build_directory):
|
|
make("install")
|
|
if "+tests" in spec:
|
|
install_tree("cpp/tests", spec.prefix.tests)
|
|
install_tree("data", join_path(spec.prefix, "data"))
|
|
if "+benchmarks" in spec:
|
|
install_tree("cpp/benchmarks", join_path(spec.prefix, "benchmarks"))
|