openfoam-org: add precision option (#38746)
This commit is contained in:
parent
778cbb225c
commit
c2bafd7b7f
1 changed files with 15 additions and 1 deletions
|
@ -83,11 +83,17 @@ class OpenfoamOrg(Package):
|
||||||
)
|
)
|
||||||
|
|
||||||
variant("int64", default=False, description="Compile with 64-bit label")
|
variant("int64", default=False, description="Compile with 64-bit label")
|
||||||
variant("float32", default=False, description="Compile with 32-bit scalar (single-precision)")
|
|
||||||
variant(
|
variant(
|
||||||
"source", default=True, description="Install library/application sources and tutorials"
|
"source", default=True, description="Install library/application sources and tutorials"
|
||||||
)
|
)
|
||||||
variant("metis", default=False, description="With metis decomposition")
|
variant("metis", default=False, description="With metis decomposition")
|
||||||
|
variant(
|
||||||
|
"precision",
|
||||||
|
default="dp",
|
||||||
|
description="Precision option",
|
||||||
|
values=("sp", "dp", conditional("lp", when="@6:")),
|
||||||
|
multi=False,
|
||||||
|
)
|
||||||
|
|
||||||
depends_on("mpi")
|
depends_on("mpi")
|
||||||
depends_on("zlib")
|
depends_on("zlib")
|
||||||
|
@ -415,6 +421,14 @@ def install_links(self):
|
||||||
class OpenfoamOrgArch(OpenfoamArch):
|
class OpenfoamOrgArch(OpenfoamArch):
|
||||||
"""An openfoam-org variant of OpenfoamArch"""
|
"""An openfoam-org variant of OpenfoamArch"""
|
||||||
|
|
||||||
|
def __init__(self, spec, **kwargs):
|
||||||
|
super().__init__(spec, **kwargs)
|
||||||
|
if "precision=lp" in spec:
|
||||||
|
self.precision_option = "LP"
|
||||||
|
elif "precision=sp" in spec:
|
||||||
|
self.precision_option = "SP"
|
||||||
|
self.update_options()
|
||||||
|
|
||||||
def update_arch(self, spec):
|
def update_arch(self, spec):
|
||||||
"""Handle differences in WM_ARCH naming"""
|
"""Handle differences in WM_ARCH naming"""
|
||||||
OpenfoamArch.update_arch(self, spec)
|
OpenfoamArch.update_arch(self, spec)
|
||||||
|
|
Loading…
Reference in a new issue