openfoam-org: add precision option (#38746)

This commit is contained in:
kjrstory 2023-07-12 21:49:45 +09:00 committed by GitHub
parent 778cbb225c
commit c2bafd7b7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -83,11 +83,17 @@ class OpenfoamOrg(Package):
)
variant("int64", default=False, description="Compile with 64-bit label")
variant("float32", default=False, description="Compile with 32-bit scalar (single-precision)")
variant(
"source", default=True, description="Install library/application sources and tutorials"
)
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("zlib")
@ -415,6 +421,14 @@ def install_links(self):
class OpenfoamOrgArch(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):
"""Handle differences in WM_ARCH naming"""
OpenfoamArch.update_arch(self, spec)