/
package.py
81 lines (61 loc) · 2.89 KB
/
package.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Copyright 2013-2024 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.package import *
class Easi(CMakePackage):
"""easi is a library for the Easy Initialization of models
in three (or less or more) dimensional domains.
"""
homepage = "https://easyinit.readthedocs.io"
git = "https://github.com/SeisSol/easi.git"
maintainers("Thomas-Ulrich", "davschneller", "vikaskurapati")
license("BSD-3-Clause")
version("master", branch="master")
version("1.3.0", tag="v1.3.0", commit="99309a0fa78bf11d668c599b3ee469224f04d55b")
version("1.2.0", tag="v1.2.0", commit="305a119338116a0ceac6b68b36841a50250d05b1")
version("1.1.2", tag="v1.1.2", commit="4c87ef3b3dca9415d116ef102cb8de750ef7e1a0")
variant("python", default=True, description="Install python bindings")
extends("python", when="+python")
variant("asagi", default=True, description="build with ASAGI support")
variant(
"jit",
default="impalajit,lua",
description="build with JIT support",
values=("impalajit", "impalajit-llvm", "lua"),
multi=True,
)
depends_on("asagi +mpi +mpi3", when="+asagi")
depends_on("yaml-cpp@0.6.2")
depends_on("impalajit@llvm-1.0.0", when="jit=impalajit-llvm")
depends_on("lua@5.3.2", when="jit=lua")
depends_on("impalajit@main", when="jit=impalajit")
depends_on("py-pybind11@2.6.2:", type="build", when="+python")
conflicts("jit=impalajit", when="jit=impalajit-llvm")
conflicts("jit=impalajit-llvm", when="jit=impalajit")
conflicts("jit=impalajit", when="target=aarch64:")
conflicts("jit=impalajit", when="target=ppc64:")
conflicts("jit=impalajit", when="target=ppc64le:")
conflicts("jit=impalajit", when="target=riscv64:")
def cmake_args(self):
args = []
args.append(self.define_from_variant("ASAGI", "asagi"))
args.append(self.define_from_variant("PYTHON_BINDINGS", "python"))
self.define("PYBIND11_USE_FETCHCONTENT", False)
spec = self.spec
if "jit=impalajit" in spec or "jit=impalajit-llvm" in spec:
args.append(self.define("IMPALAJIT", True))
backend_type = "llvm" if "jit=impalajit-llvm" in spec else "original"
args.append(self.define("IMPALAJIT_BACKEND", backend_type))
else:
args.append(self.define("IMPALAJIT", False))
if "jit=lua" in spec:
args.append(self.define("LUA", True))
if "+python" in spec:
args += [self.define("easi_INSTALL_PYTHONDIR", python_platlib)]
return args
def setup_run_environment(self, env):
if "+python" in self.spec:
full_path = os.path.join(python_platlib, "easilib/cmake/easi/python_wrapper")
env.prepend_path("PYTHONPATH", full_path)