Replace if ... in spec
with spec.satisfies
in h* and i* packages (#46387)
* Replace if ... in spec with spec.satisfies in h* packages * Replace if ... in spec with spec.satisfies in i* packages
This commit is contained in:
parent
9818002219
commit
6df831ef00
@ -43,7 +43,7 @@ class H5hut(AutotoolsPackage):
|
||||
def validate(self):
|
||||
"""Checks if Fortran compiler is available."""
|
||||
|
||||
if "+fortran" in self.spec and not self.compiler.fc:
|
||||
if self.spec.satisfies("+fortran") and not self.compiler.fc:
|
||||
raise RuntimeError("Cannot build Fortran variant without a Fortran compiler.")
|
||||
|
||||
def flag_handler(self, name, flags):
|
||||
@ -59,10 +59,10 @@ def configure_args(self):
|
||||
spec = self.spec
|
||||
config_args = ["--enable-shared"]
|
||||
|
||||
if "+fortran" in spec:
|
||||
if spec.satisfies("+fortran"):
|
||||
config_args.append("--enable-fortran")
|
||||
|
||||
if "+mpi" in spec:
|
||||
if spec.satisfies("+mpi"):
|
||||
config_args.extend(
|
||||
[
|
||||
"--enable-parallel",
|
||||
@ -71,7 +71,7 @@ def configure_args(self):
|
||||
]
|
||||
)
|
||||
|
||||
if "+fortran" in spec:
|
||||
if spec.satisfies("+fortran"):
|
||||
config_args.append("FC={0}".format(spec["mpi"].mpifc))
|
||||
|
||||
return config_args
|
||||
|
@ -47,17 +47,17 @@ def configure_args(self):
|
||||
spec = self.spec
|
||||
args = []
|
||||
|
||||
if "+vis5d" in spec:
|
||||
if spec.satisfies("+vis5d"):
|
||||
args.append(f"--with-v5d={spec['vis5d'].prefix}")
|
||||
else:
|
||||
args.append("--without-v5d")
|
||||
|
||||
if "+octave" in spec:
|
||||
if spec.satisfies("+octave"):
|
||||
args.append("--with-octave")
|
||||
else:
|
||||
args.append("--without-octave")
|
||||
|
||||
if "+hdf" in spec:
|
||||
if spec.satisfies("+hdf"):
|
||||
args.append("--with-hdf4")
|
||||
else:
|
||||
args.append("--without-hdf4")
|
||||
|
@ -34,7 +34,7 @@ class H5zZfp(CMakePackage):
|
||||
def make_defs(self):
|
||||
cc = spack_cc
|
||||
fc = spack_fc
|
||||
if "^hdf5+mpi" in self.spec:
|
||||
if self.spec.satisfies("^hdf5+mpi"):
|
||||
cc = self.spec["mpi"].mpicc
|
||||
fc = self.spec["mpi"].mpifc
|
||||
make_defs = [
|
||||
@ -44,7 +44,7 @@ def make_defs(self):
|
||||
"ZFP_HOME=%s" % self.spec["zfp"].prefix,
|
||||
]
|
||||
|
||||
if "+fortran" in self.spec and fc:
|
||||
if self.spec.satisfies("+fortran") and fc:
|
||||
make_defs += ["FC=%s" % fc]
|
||||
else:
|
||||
make_defs += ["FC="]
|
||||
|
@ -118,7 +118,7 @@ def cmake_args(self):
|
||||
for target in llvm_targets:
|
||||
args += [self.define("TARGET_{0}".format(target[0]), target[1])]
|
||||
|
||||
if "+python" in spec:
|
||||
if spec.satisfies("+python"):
|
||||
args += [
|
||||
self.define("PYBIND11_USE_FETCHCONTENT", False),
|
||||
self.define("Halide_INSTALL_PYTHONDIR", python_platlib),
|
||||
|
@ -71,7 +71,7 @@ class HdfEos2(AutotoolsPackage):
|
||||
# Build dependencies
|
||||
depends_on("hdf")
|
||||
# Because hdf always depends on zlib and jpeg in spack, the tests below in configure_args
|
||||
# (if "jpeg" in self.spec:) always returns true and hdf-eos2 wants zlib and jpeg, too.
|
||||
# (if self.spec.satisfies("^jpeg"):) always returns true and hdf-eos2 wants zlib and jpeg, too.
|
||||
depends_on("zlib-api")
|
||||
depends_on("jpeg")
|
||||
depends_on("szip", when="^hdf +szip")
|
||||
@ -151,15 +151,15 @@ def configure_args(self):
|
||||
|
||||
# Provide config args for dependencies
|
||||
extra_args.append("--with-hdf4={0}".format(self.spec["hdf"].prefix))
|
||||
if "jpeg" in self.spec:
|
||||
if self.spec.satisfies("^jpeg"):
|
||||
# Allow handling whatever provider of jpeg are using
|
||||
tmp = self.spec["jpeg"].libs.directories
|
||||
if tmp:
|
||||
tmp = tmp[0]
|
||||
extra_args.append("--with-jpeg={0}".format(tmp))
|
||||
if "szip" in self.spec:
|
||||
if self.spec.satisfies("^szip"):
|
||||
extra_args.append("--with-szlib={0}".format(self.spec["szip"].prefix))
|
||||
if "zlib" in self.spec:
|
||||
if self.spec.satisfies("^zlib"):
|
||||
extra_args.append("--with-zlib={0}".format(self.spec["zlib-api"].prefix))
|
||||
|
||||
return extra_args
|
||||
|
@ -107,9 +107,9 @@ def configure_args(self):
|
||||
|
||||
# Provide config args for dependencies
|
||||
extra_args.append("--with-hdf5={0}".format(self.spec["hdf5"].prefix))
|
||||
if "szip" in self.spec:
|
||||
if self.spec.satisfies("^szip"):
|
||||
extra_args.append("--with-szlib={0}".format(self.spec["szip"].prefix))
|
||||
if "zlib-api" in self.spec:
|
||||
if self.spec.satisfies("^zlib-api"):
|
||||
extra_args.append("--with-zlib={0}".format(self.spec["zlib-api"].prefix))
|
||||
|
||||
return extra_args
|
||||
|
@ -121,7 +121,7 @@ def libs(self):
|
||||
elif "static" in query_parameters:
|
||||
shared = False
|
||||
else:
|
||||
shared = "+shared" in self.spec
|
||||
shared = self.spec.satisfies("+shared")
|
||||
|
||||
libs = find_libraries(libraries, root=self.prefix, shared=shared, recursive=True)
|
||||
|
||||
@ -134,15 +134,15 @@ def libs(self):
|
||||
if not shared and "transitive" in query_parameters:
|
||||
libs += self.spec["jpeg:transitive"].libs
|
||||
libs += self.spec["zlib:transitive"].libs
|
||||
if "+szip" in self.spec:
|
||||
if self.spec.satisfies("+szip"):
|
||||
libs += self.spec["szip:transitive"].libs
|
||||
if "+external-xdr" in self.spec and self.spec["rpc"].name == "libtirpc":
|
||||
if self.spec.satisfies("+external-xdr") and self.spec["rpc"].name == "libtirpc":
|
||||
libs += self.spec["rpc:transitive"].libs
|
||||
|
||||
return libs
|
||||
|
||||
def flag_handler(self, name, flags):
|
||||
if "+pic" in self.spec:
|
||||
if self.spec.satisfies("+pic"):
|
||||
if name == "cflags":
|
||||
flags.append(self.compiler.cc_pic_flag)
|
||||
elif name == "fflags":
|
||||
@ -175,12 +175,12 @@ def configure_args(self):
|
||||
config_args += self.enable_or_disable("fortran")
|
||||
config_args += self.enable_or_disable("java")
|
||||
|
||||
if "+szip" in self.spec:
|
||||
if self.spec.satisfies("+szip"):
|
||||
config_args.append("--with-szlib=%s" % self.spec["szip"].prefix)
|
||||
else:
|
||||
config_args.append("--without-szlib")
|
||||
|
||||
if "~external-xdr" in self.spec:
|
||||
if self.spec.satisfies("~external-xdr"):
|
||||
config_args.append("--enable-hdf4-xdr")
|
||||
elif self.spec["rpc"].name == "libtirpc":
|
||||
# We should not specify '--disable-hdf4-xdr' due to a bug in the
|
||||
|
@ -326,7 +326,7 @@ def flag_handler(self, name, flags):
|
||||
if spec.satisfies("@:1.8.12+fortran~shared"):
|
||||
cmake_flags.append(self.compiler.fc_pic_flag)
|
||||
elif name == "ldlibs":
|
||||
if "+fortran %fj" in spec:
|
||||
if spec.satisfies("+fortran %fj"):
|
||||
cmake_flags.extend(["-lfj90i", "-lfj90f", "-lfjsrcinfo", "-lelf"])
|
||||
|
||||
return flags, None, (cmake_flags or None)
|
||||
@ -344,7 +344,7 @@ def libs(self):
|
||||
"""
|
||||
query_parameters = self.spec.last_query.extra_parameters
|
||||
|
||||
shared = "+shared" in self.spec
|
||||
shared = self.spec.satisfies("+shared")
|
||||
|
||||
# This map contains a translation from query_parameters
|
||||
# to the libraries needed
|
||||
@ -485,7 +485,7 @@ def setup_run_environment(self, env):
|
||||
|
||||
@run_before("cmake")
|
||||
def fortran_check(self):
|
||||
if "+fortran" in self.spec and not self.compiler.fc:
|
||||
if self.spec.satisfies("+fortran") and not self.compiler.fc:
|
||||
msg = "cannot build a Fortran variant without a Fortran compiler"
|
||||
raise RuntimeError(msg)
|
||||
|
||||
@ -532,7 +532,7 @@ def cmake_args(self):
|
||||
# MSMPI does not provide compiler wrappers
|
||||
# and pointing these variables at the MSVC compilers
|
||||
# breaks CMake's mpi detection for MSMPI.
|
||||
if "+mpi" in spec and "msmpi" not in spec:
|
||||
if spec.satisfies("+mpi") and "msmpi" not in spec:
|
||||
args.extend(
|
||||
[
|
||||
"-DMPI_CXX_COMPILER:PATH=%s" % spec["mpi"].mpicxx,
|
||||
@ -540,7 +540,7 @@ def cmake_args(self):
|
||||
]
|
||||
)
|
||||
|
||||
if "+fortran" in spec:
|
||||
if spec.satisfies("+fortran"):
|
||||
args.extend(["-DMPI_Fortran_COMPILER:PATH=%s" % spec["mpi"].mpifc])
|
||||
|
||||
# work-around for https://github.com/HDFGroup/hdf5/issues/1320
|
||||
@ -618,7 +618,7 @@ def fix_package_config(self):
|
||||
def link_debug_libs(self):
|
||||
# When build_type is Debug, the hdf5 build appends _debug to all library names.
|
||||
# Dependents of hdf5 (netcdf-c etc.) can't handle those, thus make symlinks.
|
||||
if "build_type=Debug" in self.spec:
|
||||
if self.spec.satisfies("build_type=Debug"):
|
||||
libs = find(self.prefix.lib, "libhdf5*_debug.*", recursive=False)
|
||||
with working_dir(self.prefix.lib):
|
||||
for lib in libs:
|
||||
|
@ -93,7 +93,7 @@ def patch(self):
|
||||
join_path("tcltk", "BUILD_DIR", "hd_config_info"),
|
||||
)
|
||||
|
||||
if "+X" in self.spec:
|
||||
if self.spec.satisfies("+X"):
|
||||
filter_file(
|
||||
r"(\s+XDIR => ).*",
|
||||
r"\1'{0}',".format(self.spec["libx11"].libs.directories[0]),
|
||||
@ -109,7 +109,7 @@ def configure_args(self):
|
||||
|
||||
config_args += self.enable_or_disable("x", variant="X")
|
||||
|
||||
if "+X" in self.spec:
|
||||
if self.spec.satisfies("+X"):
|
||||
config_args.extend(
|
||||
[
|
||||
"--x-includes={0}".format(self.spec["libx11"].headers.directories[0]),
|
||||
|
@ -100,7 +100,7 @@ def cmake_args(self):
|
||||
self.define_from_variant("Heffte_ENABLE_PYTHON", "python"),
|
||||
]
|
||||
|
||||
if "+cuda" in self.spec and self.spec.satisfies("@:2.3.0"):
|
||||
if self.spec.satisfies("+cuda") and self.spec.satisfies("@:2.3.0"):
|
||||
cuda_arch = self.spec.variants["cuda_arch"].value
|
||||
if len(cuda_arch) > 0 or cuda_arch[0] != "none":
|
||||
nvcc_flags = ""
|
||||
@ -111,7 +111,7 @@ def cmake_args(self):
|
||||
archs = ";".join(cuda_arch)
|
||||
args.append("-DCMAKE_CUDA_ARCHITECTURES=%s" % archs)
|
||||
|
||||
if "+rocm" in self.spec:
|
||||
if self.spec.satisfies("+rocm"):
|
||||
args.append("-DCMAKE_CXX_COMPILER={0}".format(self.spec["hip"].hipcc))
|
||||
|
||||
rocm_arch = self.spec.variants["amdgpu_target"].value
|
||||
@ -143,7 +143,7 @@ def test_make_test(self):
|
||||
|
||||
options = [cmake_dir]
|
||||
options.append(self.define("Heffte_DIR", self.spec.prefix.lib.cmake.Heffte))
|
||||
if "+rocm" in self.spec:
|
||||
if self.spec.satisfies("+rocm"):
|
||||
# path name is 'hsa-runtime64' but python cannot have '-' in variable name
|
||||
hsa_runtime = join_path(self.spec["hsa-rocr-dev"].prefix.lib.cmake, "hsa-runtime64")
|
||||
options.extend(
|
||||
|
@ -142,7 +142,9 @@ def cmake_args(self):
|
||||
|
||||
# HELICS shared library options
|
||||
args.append(
|
||||
"-DHELICS_DISABLE_C_SHARED_LIB={0}".format("OFF" if "+c_shared" in spec else "ON")
|
||||
"-DHELICS_DISABLE_C_SHARED_LIB={0}".format(
|
||||
"OFF" if spec.satisfies("+c_shared") else "ON"
|
||||
)
|
||||
)
|
||||
args.append(from_variant("HELICS_BUILD_CXX_SHARED_LIB", "cxx_shared"))
|
||||
|
||||
@ -150,13 +152,17 @@ def cmake_args(self):
|
||||
args.append(from_variant("HELICS_BUILD_APP_EXECUTABLES", "apps"))
|
||||
args.append(from_variant("HELICS_BUILD_APP_LIBRARY", "apps_lib"))
|
||||
args.append(
|
||||
"-DHELICS_DISABLE_WEBSERVER={0}".format("OFF" if "+webserver" in spec else "ON")
|
||||
"-DHELICS_DISABLE_WEBSERVER={0}".format(
|
||||
"OFF" if spec.satisfies("+webserver") else "ON"
|
||||
)
|
||||
)
|
||||
args.append(from_variant("HELICS_BUILD_BENCHMARKS", "benchmarks"))
|
||||
|
||||
# Extra HELICS library dependencies
|
||||
args.append("-DHELICS_DISABLE_BOOST={0}".format("OFF" if "+boost" in spec else "ON"))
|
||||
args.append("-DHELICS_DISABLE_ASIO={0}".format("OFF" if "+asio" in spec else "ON"))
|
||||
args.append(
|
||||
"-DHELICS_DISABLE_BOOST={0}".format("OFF" if spec.satisfies("+boost") else "ON")
|
||||
)
|
||||
args.append("-DHELICS_DISABLE_ASIO={0}".format("OFF" if spec.satisfies("+asio") else "ON"))
|
||||
|
||||
# Encryption
|
||||
args.append(from_variant("HELICS_ENABLE_ENCRYPTION", "encryption"))
|
||||
@ -178,5 +184,5 @@ def cmake_args(self):
|
||||
|
||||
def setup_run_environment(self, env):
|
||||
spec = self.spec
|
||||
if "+python" in spec:
|
||||
if spec.satisfies("+python"):
|
||||
env.prepend_path("PYTHONPATH", self.prefix.python)
|
||||
|
@ -37,7 +37,7 @@ class HhSuite(CMakePackage):
|
||||
|
||||
def build_args(self, spec, prefix):
|
||||
args = []
|
||||
if "+mpi" in self.spec:
|
||||
if self.spec.satisfies("+mpi"):
|
||||
args.append("-DCHECK_MPI=1")
|
||||
else:
|
||||
args.append("-DCHECK_MPI=0")
|
||||
|
@ -58,8 +58,8 @@ class Highfive(CMakePackage):
|
||||
|
||||
def cmake_args(self):
|
||||
args = [
|
||||
"-DUSE_BOOST:Bool={0}".format("+boost" in self.spec),
|
||||
"-DHIGHFIVE_PARALLEL_HDF5:Bool={0}".format("+mpi" in self.spec),
|
||||
"-DUSE_BOOST:Bool={0}".format(self.spec.satisfies("+boost")),
|
||||
"-DHIGHFIVE_PARALLEL_HDF5:Bool={0}".format(self.spec.satisfies("+mpi")),
|
||||
"-DHIGHFIVE_UNIT_TESTS:Bool=false",
|
||||
"-DHIGHFIVE_EXAMPLES:Bool=false",
|
||||
]
|
||||
|
@ -178,7 +178,7 @@ def cmake_args(self):
|
||||
args = []
|
||||
spec = self.spec
|
||||
|
||||
use_gpu = "+cuda" in spec or "+rocm" in spec
|
||||
use_gpu = spec.satisfies("+cuda") or spec.satisfies("+rocm")
|
||||
|
||||
if use_gpu:
|
||||
args.extend(
|
||||
@ -218,7 +218,7 @@ def cmake_args(self):
|
||||
# args.append(
|
||||
# self.define('HIOP_CTEST_LAUNCH_COMMAND', 'srun -t 10:00'))
|
||||
|
||||
if "+mpi" in spec:
|
||||
if spec.satisfies("+mpi"):
|
||||
args.extend(
|
||||
[
|
||||
self.define("MPI_HOME", spec["mpi"].prefix),
|
||||
@ -237,7 +237,7 @@ def cmake_args(self):
|
||||
# self.define('MPI_Fortran_LINK_FLAGS',
|
||||
# '-L/path/to/libfabric/lib64/ -lfabric'))
|
||||
|
||||
if "+cuda" in spec:
|
||||
if spec.satisfies("+cuda"):
|
||||
cuda_arch_list = spec.variants["cuda_arch"].value
|
||||
if cuda_arch_list[0] != "none":
|
||||
args.append(self.define("CMAKE_CUDA_ARCHITECTURES", cuda_arch_list))
|
||||
@ -250,7 +250,7 @@ def cmake_args(self):
|
||||
# args.append(
|
||||
# self.define('HIP_CLANG_INCLUDE_PATH',
|
||||
# '/opt/rocm-X.Y.Z/llvm/lib/clang/14.0.0/include/'))
|
||||
if "+rocm" in spec:
|
||||
if spec.satisfies("+rocm"):
|
||||
args.append(self.define("CMAKE_CXX_COMPILER", spec["hip"].hipcc))
|
||||
|
||||
rocm_arch_list = spec.variants["amdgpu_target"].value
|
||||
@ -258,7 +258,7 @@ def cmake_args(self):
|
||||
args.append(self.define("GPU_TARGETS", rocm_arch_list))
|
||||
args.append(self.define("AMDGPU_TARGETS", rocm_arch_list))
|
||||
|
||||
if "+kron" in spec:
|
||||
if spec.satisfies("+kron"):
|
||||
args.append(self.define("HIOP_UMFPACK_DIR", spec["suite-sparse"].prefix))
|
||||
|
||||
# Unconditionally disable strumpack, even when +sparse. This may be
|
||||
@ -266,7 +266,7 @@ def cmake_args(self):
|
||||
# fully supported in spack at the moment.
|
||||
args.append(self.define("HIOP_USE_STRUMPACK", False))
|
||||
|
||||
if "+sparse" in spec:
|
||||
if spec.satisfies("+sparse"):
|
||||
args.append(self.define("HIOP_COINHSL_DIR", spec["coinhsl"].prefix))
|
||||
|
||||
return args
|
||||
|
@ -577,19 +577,19 @@ def cmake_args(self):
|
||||
|
||||
args.append(self.define("HIP_COMMON_DIR", self.stage.source_path))
|
||||
args.append(self.define("HIP_CATCH_TEST", "OFF"))
|
||||
if "@:5.5" in self.spec:
|
||||
if self.spec.satisfies("@:5.5"):
|
||||
args.append(self.define("ROCCLR_PATH", self.stage.source_path + "rocclr"))
|
||||
args.append(self.define("AMD_OPENCL_PATH", self.stage.source_path + "opencl"))
|
||||
if "@5.3.0:" in self.spec:
|
||||
if self.spec.satisfies("@5.3.0:"):
|
||||
args.append("-DCMAKE_INSTALL_LIBDIR=lib")
|
||||
if "@5.6.0:" in self.spec:
|
||||
if self.spec.satisfies("@5.6.0:"):
|
||||
args.append(self.define("ROCCLR_PATH", self.stage.source_path + "/clr/rocclr"))
|
||||
args.append(self.define("AMD_OPENCL_PATH", self.stage.source_path + "/clr/opencl"))
|
||||
args.append(self.define("CLR_BUILD_HIP", True)),
|
||||
args.append(self.define("CLR_BUILD_OCL", False)),
|
||||
if "@5.6:5.7" in self.spec:
|
||||
if self.spec.satisfies("@5.6:5.7"):
|
||||
args.append(self.define("HIPCC_BIN_DIR", self.stage.source_path + "/hipcc/bin")),
|
||||
if "@6.0:" in self.spec:
|
||||
if self.spec.satisfies("@6.0:"):
|
||||
args.append(self.define("HIPCC_BIN_DIR", self.spec["hipcc"].prefix.bin)),
|
||||
return args
|
||||
|
||||
|
@ -77,8 +77,8 @@ def cmake_args(self):
|
||||
spec = self.spec
|
||||
args = [
|
||||
"-DWITH_CPU_BACKEND:Bool=TRUE",
|
||||
"-DWITH_ROCM_BACKEND:Bool={0}".format("TRUE" if "+rocm" in spec else "FALSE"),
|
||||
"-DWITH_CUDA_BACKEND:Bool={0}".format("TRUE" if "+cuda" in spec else "FALSE"),
|
||||
"-DWITH_ROCM_BACKEND:Bool={0}".format("TRUE" if spec.satisfies("+rocm") else "FALSE"),
|
||||
"-DWITH_CUDA_BACKEND:Bool={0}".format("TRUE" if spec.satisfies("+cuda") else "FALSE"),
|
||||
# prevent hipSYCL's cmake to look for other LLVM installations
|
||||
# if the specified one isn't compatible
|
||||
"-DDISABLE_LLVM_VERSION_CHECK:Bool=TRUE",
|
||||
@ -116,9 +116,9 @@ def cmake_args(self):
|
||||
)
|
||||
args.append("-DCLANG_EXECUTABLE_PATH:String={0}".format(llvm_clang_bin))
|
||||
# explicit CUDA toolkit
|
||||
if "+cuda" in spec:
|
||||
if spec.satisfies("+cuda"):
|
||||
args.append("-DCUDA_TOOLKIT_ROOT_DIR:String={0}".format(spec["cuda"].prefix))
|
||||
if "+rocm" in spec:
|
||||
if spec.satisfies("+rocm"):
|
||||
args.append("-DWITH_ACCELERATED_CPU:STRING=OFF")
|
||||
args.append("-DROCM_PATH:STRING={0}".format(os.environ.get("ROCM_PATH")))
|
||||
if self.spec.satisfies("@24.02.0:"):
|
||||
@ -161,7 +161,7 @@ def adjust_core_config(config):
|
||||
# the libc++.so and libc++abi.so dyn linked to the sycl
|
||||
# ptx backend
|
||||
rpaths = set()
|
||||
if "~rocm" in spec:
|
||||
if spec.satisfies("~rocm"):
|
||||
so_paths = filesystem.find_libraries(
|
||||
"libc++", self.spec["llvm"].prefix, shared=True, recursive=True
|
||||
)
|
||||
|
@ -46,13 +46,17 @@ class Hiredis(MakefilePackage, CMakePackage):
|
||||
class MakefileBuilder(spack.build_systems.makefile.MakefileBuilder):
|
||||
@property
|
||||
def build_targets(self):
|
||||
use_ssl = 1 if "+ssl" in self.spec else 0
|
||||
run_test_async = 1 if "+test_async" in self.spec else 0
|
||||
use_ssl = 1 if self.spec.satisfies("+ssl") else 0
|
||||
run_test_async = 1 if self.spec.satisfies("+test_async") else 0
|
||||
return ["USE_SSL={0}".format(use_ssl), "TEST_ASYNC={0}".format(run_test_async)]
|
||||
|
||||
def install(self, pkg, spec, prefix):
|
||||
make("PREFIX={0}".format(prefix), "install")
|
||||
if "+test" in self.spec or "+test_async" in self.spec or "+test_ssl" in self.spec:
|
||||
if (
|
||||
self.spec.satisfies("+test")
|
||||
or self.spec.satisfies("+test_async")
|
||||
or self.spec.satisfies("+test_ssl")
|
||||
):
|
||||
make("PREFIX={0}".format(prefix), "test")
|
||||
|
||||
@run_after("install")
|
||||
@ -63,9 +67,9 @@ def darwin_fix(self):
|
||||
|
||||
class CMakeBuilder(spack.build_systems.cmake.CMakeBuilder):
|
||||
def cmake_args(self):
|
||||
build_test = not ("+test" in self.spec)
|
||||
ssl_test = ("+test_ssl" in self.spec) and ("+test" in self.spec)
|
||||
async_test = ("+test_async" in self.spec) and ("+test" in self.spec)
|
||||
build_test = not self.spec.satisfies("+test")
|
||||
ssl_test = self.spec.satisfies("+test_ssl") and self.spec.satisfies("+test")
|
||||
async_test = self.spec.satisfies("+test_async") and self.spec.satisfies("+test")
|
||||
|
||||
args = [
|
||||
self.define_from_variant("ENABLE_SSL", "ssl"),
|
||||
|
@ -41,10 +41,10 @@ class Hmmer(Package):
|
||||
def install(self, spec, prefix):
|
||||
configure_args = ["--prefix={0}".format(prefix)]
|
||||
|
||||
if "+gsl" in self.spec:
|
||||
if self.spec.satisfies("+gsl"):
|
||||
configure_args.extend(["--with-gsl", "LIBS=-lgsl -lgslcblas"])
|
||||
|
||||
if "+mpi" in self.spec:
|
||||
if self.spec.satisfies("+mpi"):
|
||||
configure_args.append("--enable-mpi")
|
||||
|
||||
configure(*configure_args)
|
||||
|
@ -50,5 +50,5 @@ def install(self, spec, prefix):
|
||||
perl("configureHomer.pl", "-local")
|
||||
|
||||
# download extra data if requested
|
||||
if "+data" in spec:
|
||||
if spec.satisfies("+data"):
|
||||
perl("configureHomer.pl", "-install", "-all")
|
||||
|
@ -71,14 +71,14 @@ def cmake_args(self):
|
||||
cmake_args = ["-DCMAKE_INSTALL_PREFIX={0}".format(python_platlib)]
|
||||
|
||||
# MPI support
|
||||
if "+mpi" in spec:
|
||||
if spec.satisfies("+mpi"):
|
||||
os.environ["MPI_HOME"] = spec["mpi"].prefix
|
||||
cmake_args.append("-DENABLE_MPI=ON")
|
||||
else:
|
||||
cmake_args.append("-DENABLE_MPI=OFF")
|
||||
|
||||
# CUDA support
|
||||
if "+cuda" in spec:
|
||||
if spec.satisfies("+cuda"):
|
||||
cmake_args.append("-DENABLE_CUDA=ON")
|
||||
else:
|
||||
cmake_args.append("-DENABLE_CUDA=OFF")
|
||||
@ -95,7 +95,7 @@ def cmake_args(self):
|
||||
cmake_args.append("-DENABLE_MPI_CUDA=OFF")
|
||||
|
||||
# Documentation
|
||||
if "+doc" in spec:
|
||||
if spec.satisfies("+doc"):
|
||||
cmake_args.append("-DENABLE_DOXYGEN=ON")
|
||||
else:
|
||||
cmake_args.append("-DENABLE_DOXYGEN=OFF")
|
||||
|
@ -85,7 +85,7 @@ class Hpcc(MakefilePackage):
|
||||
}
|
||||
|
||||
def patch(self):
|
||||
if "fftw" in self.spec:
|
||||
if self.spec.satisfies("^fftw"):
|
||||
# spack's fftw2 prefix headers with floating point type
|
||||
filter_file(r"^\s*#include <fftw.h>", "#include <sfftw.h>", "FFT/wrapfftw.h")
|
||||
filter_file(
|
||||
|
@ -31,7 +31,7 @@ class Hpccg(MakefilePackage):
|
||||
def build_targets(self):
|
||||
targets = []
|
||||
|
||||
if "+mpi" in self.spec:
|
||||
if self.spec.satisfies("+mpi"):
|
||||
targets.append("CXX={0}".format(self.spec["mpi"].mpicxx))
|
||||
targets.append("LINKER={0}".format(self.spec["mpi"].mpicxx))
|
||||
targets.append("USE_MPI=-DUSING_MPI")
|
||||
@ -39,7 +39,7 @@ def build_targets(self):
|
||||
targets.append("CXX=c++")
|
||||
targets.append("LINKER=c++")
|
||||
|
||||
if "+openmp" in self.spec:
|
||||
if self.spec.satisfies("+openmp"):
|
||||
targets.append("USE_OMP=-DUSING_OMP")
|
||||
targets.append("OMP_FLAGS={0}".format(self.compiler.openmp_flag))
|
||||
|
||||
|
@ -76,7 +76,7 @@ def configure(self, spec, prefix):
|
||||
CXXFLAGS += " -Rpass=loop-vectorize"
|
||||
CXXFLAGS += " -Rpass-missed=loop-vectorize"
|
||||
CXXFLAGS += " -Rpass-analysis=loop-vectorize "
|
||||
if "+openmp" in self.spec:
|
||||
if self.spec.satisfies("+openmp"):
|
||||
CXXFLAGS += self.compiler.openmp_flag
|
||||
config = [
|
||||
# Shell
|
||||
|
@ -263,7 +263,7 @@ def setup_run_environment(self, env):
|
||||
env.prepend_path("MANPATH", spec.prefix.share.man)
|
||||
env.prepend_path("CPATH", spec.prefix.include)
|
||||
env.prepend_path("LD_LIBRARY_PATH", spec.prefix.lib.hpctoolkit)
|
||||
if "+viewer" in spec:
|
||||
if spec.satisfies("+viewer"):
|
||||
env.prepend_path("PATH", spec["hpcviewer"].prefix.bin)
|
||||
env.prepend_path("MANPATH", spec["hpcviewer"].prefix.share.man)
|
||||
|
||||
@ -329,18 +329,18 @@ def configure_args(self):
|
||||
if spec.satisfies("@2022.10:"):
|
||||
args.append("--with-yaml-cpp=%s" % spec["yaml-cpp"].prefix)
|
||||
|
||||
if "+cuda" in spec:
|
||||
if spec.satisfies("+cuda"):
|
||||
args.append("--with-cuda=%s" % spec["cuda"].prefix)
|
||||
|
||||
if "+level_zero" in spec:
|
||||
if spec.satisfies("+level_zero"):
|
||||
args.append("--with-level0=%s" % spec["oneapi-level-zero"].prefix)
|
||||
|
||||
# gtpin requires level_zero
|
||||
if "+gtpin" in spec:
|
||||
if spec.satisfies("+gtpin"):
|
||||
args.append("--with-gtpin=%s" % spec["intel-gtpin"].prefix)
|
||||
args.append("--with-igc=%s" % spec["oneapi-igc"].prefix)
|
||||
|
||||
if "+opencl" in spec:
|
||||
if spec.satisfies("+opencl"):
|
||||
args.append("--with-opencl=%s" % spec["opencl-c-headers"].prefix)
|
||||
|
||||
if spec.satisfies("+rocm"):
|
||||
@ -399,17 +399,17 @@ def meson_args(self):
|
||||
spec = self.spec
|
||||
|
||||
args = [
|
||||
"-Dhpcprof_mpi=" + ("enabled" if "+mpi" in spec else "disabled"),
|
||||
"-Dpython=" + ("enabled" if "+python" in spec else "disabled"),
|
||||
"-Dpapi=" + ("enabled" if "+papi" in spec else "disabled"),
|
||||
"-Dopencl=" + ("enabled" if "+opencl" in spec else "disabled"),
|
||||
"-Dcuda=" + ("enabled" if "+cuda" in spec else "disabled"),
|
||||
"-Drocm=" + ("enabled" if "+rocm" in spec else "disabled"),
|
||||
"-Dlevel0=" + ("enabled" if "+level_zero" in spec else "disabled"),
|
||||
"-Dgtpin=" + ("enabled" if "+gtpin" in spec else "disabled"),
|
||||
"-Dhpcprof_mpi=" + ("enabled" if spec.satisfies("+mpi") else "disabled"),
|
||||
"-Dpython=" + ("enabled" if spec.satisfies("+python") else "disabled"),
|
||||
"-Dpapi=" + ("enabled" if spec.satisfies("+papi") else "disabled"),
|
||||
"-Dopencl=" + ("enabled" if spec.satisfies("+opencl") else "disabled"),
|
||||
"-Dcuda=" + ("enabled" if spec.satisfies("+cuda") else "disabled"),
|
||||
"-Drocm=" + ("enabled" if spec.satisfies("+rocm") else "disabled"),
|
||||
"-Dlevel0=" + ("enabled" if spec.satisfies("+level_zero") else "disabled"),
|
||||
"-Dgtpin=" + ("enabled" if spec.satisfies("+gtpin") else "disabled"),
|
||||
]
|
||||
|
||||
if "@:2024.01" in spec:
|
||||
if spec.satisfies("@:2024.01"):
|
||||
args.append(f"--native-file={self.gen_prefix_file()}")
|
||||
|
||||
return args
|
||||
@ -444,29 +444,29 @@ def gen_prefix_file(self):
|
||||
|
||||
cfg["properties"]["prefix_yaml_cpp"] = f"'''{spec['yaml-cpp'].prefix}'''"
|
||||
|
||||
if "+cuda" in spec:
|
||||
if spec.satisfies("+cuda"):
|
||||
cfg["properties"]["prefix_cuda"] = f"'''{spec['cuda'].prefix}'''"
|
||||
|
||||
if "+level_zero" in spec:
|
||||
if spec.satisfies("+level_zero"):
|
||||
cfg["properties"]["prefix_level0"] = f"'''{spec['oneapi-level-zero'].prefix}'''"
|
||||
|
||||
if "+gtpin" in spec:
|
||||
if spec.satisfies("+gtpin"):
|
||||
cfg["properties"]["prefix_gtpin"] = f"'''{spec['intel-gtpin'].prefix}'''"
|
||||
cfg["properties"]["prefix_igc"] = f"'''{spec['oneapi-igc'].prefix}'''"
|
||||
|
||||
if "+opencl" in spec:
|
||||
if spec.satisfies("+opencl"):
|
||||
cfg["properties"]["prefix_opencl"] = f"'''{spec['opencl-c-headers'].prefix}'''"
|
||||
|
||||
if "+rocm" in spec:
|
||||
if spec.satisfies("+rocm"):
|
||||
cfg["properties"]["prefix_rocm_hip"] = f"'''{spec['hip'].prefix}'''"
|
||||
cfg["properties"]["prefix_rocm_hsa"] = f"'''{spec['hsa-rocr-dev'].prefix}'''"
|
||||
cfg["properties"]["prefix_rocm_tracer"] = f"'''{spec['roctracer-dev'].prefix}'''"
|
||||
cfg["properties"]["prefix_rocm_profiler"] = f"'''{spec['rocprofiler-dev'].prefix}'''"
|
||||
|
||||
if "+python" in spec:
|
||||
if spec.satisfies("+python"):
|
||||
cfg["binaries"]["python"] = f"'''{spec['python'].command}'''"
|
||||
|
||||
if "+mpi" in spec:
|
||||
if spec.satisfies("+mpi"):
|
||||
cfg["binaries"]["mpicxx"] = f"'''{spec['mpi'].mpicxx}'''"
|
||||
|
||||
native_fd, native_path = tempfile.mkstemp(
|
||||
|
@ -52,24 +52,24 @@ class Hpgmg(MakefilePackage):
|
||||
|
||||
def configure_args(self):
|
||||
args = []
|
||||
if "+fe" in self.spec and not ("@0.3" in self.spec):
|
||||
if self.spec.satisfies("+fe") and not self.spec.satisfies("@0.3"):
|
||||
args.append("--fe")
|
||||
|
||||
if "fv=serial" in self.spec:
|
||||
if self.spec.satisfies("fv=serial"):
|
||||
args.append("--no-fv-mpi")
|
||||
|
||||
if "mpi" in self.spec:
|
||||
if self.spec.satisfies("^mpi"):
|
||||
args.append("--CC={0}".format(self.spec["mpi"].mpicc))
|
||||
|
||||
cflags = []
|
||||
if "fv=none" in self.spec:
|
||||
if self.spec.satisfies("fv=none"):
|
||||
args.append("--no-fv")
|
||||
else:
|
||||
# Apple's Clang doesn't support OpenMP
|
||||
if not self.spec.satisfies("%apple-clang"):
|
||||
cflags.append(self.compiler.openmp_flag)
|
||||
|
||||
if "+debug" in self.spec:
|
||||
if self.spec.satisfies("+debug"):
|
||||
cflags.append("-g")
|
||||
else:
|
||||
cflags.append("-O3")
|
||||
|
@ -50,7 +50,7 @@ def configure(self, spec, prefix):
|
||||
config = []
|
||||
|
||||
# OpenMP support
|
||||
if "+openmp" in spec:
|
||||
if spec.satisfies("+openmp"):
|
||||
config.append("OMP_DEFS = {0}".format(self.compiler.openmp_flag))
|
||||
|
||||
config.extend(
|
||||
@ -106,7 +106,7 @@ def configure_args(self):
|
||||
filter_file(r"^libs10=.*", "libs10=%s" % self.spec["blas"].libs.ld_flags, "configure")
|
||||
|
||||
cflags, ldflags = ["-O3"], []
|
||||
if "+openmp" in self.spec:
|
||||
if self.spec.satisfies("+openmp"):
|
||||
cflags.append(self.compiler.openmp_flag)
|
||||
|
||||
if (
|
||||
@ -116,10 +116,10 @@ def configure_args(self):
|
||||
):
|
||||
ldflags.append(self.spec["blas"].libs.ld_flags)
|
||||
|
||||
if "%aocc" in self.spec:
|
||||
if "%aocc@3:" in self.spec:
|
||||
if self.spec.satisfies("%aocc"):
|
||||
if self.spec.satisfies("%aocc@3:"):
|
||||
ldflags.extend(["-lamdlibm", "-lm"])
|
||||
if "%aocc@4:" in self.spec:
|
||||
if self.spec.satisfies("%aocc@4:"):
|
||||
ldflags.append("-lamdalloc")
|
||||
|
||||
if self.spec["blas"].name == "fujitsu-ssl2" and (
|
||||
|
@ -81,7 +81,7 @@ def cmake_args(self):
|
||||
self.define("HPX_KOKKOS_ENABLE_BENCHMARKS", self.run_tests),
|
||||
]
|
||||
|
||||
if "+rocm" in self.spec:
|
||||
if self.spec.satisfies("+rocm"):
|
||||
args += [self.define("CMAKE_CXX_COMPILER", self.spec["hip"].hipcc)]
|
||||
|
||||
return args
|
||||
|
@ -241,8 +241,8 @@ def cmake_args(self):
|
||||
self.define_from_variant("HPX_WITH_ASYNC_CUDA", "async_cuda"),
|
||||
self.define("HPX_WITH_TESTS", self.run_tests),
|
||||
self.define("HPX_WITH_NETWORKING", "networking=none" not in spec),
|
||||
self.define("HPX_WITH_PARCELPORT_TCP", "networking=tcp" in spec),
|
||||
self.define("HPX_WITH_PARCELPORT_MPI", "networking=mpi" in spec),
|
||||
self.define("HPX_WITH_PARCELPORT_TCP", spec.satisfies("networking=tcp")),
|
||||
self.define("HPX_WITH_PARCELPORT_MPI", spec.satisfies("networking=mpi")),
|
||||
self.define(
|
||||
"HPX_WITH_MAX_CPU_COUNT",
|
||||
format_max_cpu_count(spec.variants["max_cpu_count"].value),
|
||||
@ -260,7 +260,7 @@ def cmake_args(self):
|
||||
args += [self.define("HPX_WITH_UNITY_BUILD", True)]
|
||||
|
||||
# HIP support requires compiling with hipcc
|
||||
if "+rocm" in self.spec:
|
||||
if self.spec.satisfies("+rocm"):
|
||||
args += [self.define("CMAKE_CXX_COMPILER", self.spec["hip"].hipcc)]
|
||||
if self.spec.satisfies("^cmake@3.21.0:3.21.2"):
|
||||
args += [self.define("__skip_rocmclang", True)]
|
||||
@ -268,13 +268,13 @@ def cmake_args(self):
|
||||
# Instrumentation
|
||||
args += self.instrumentation_args()
|
||||
|
||||
if "instrumentation=thread_debug" in spec:
|
||||
if spec.satisfies("instrumentation=thread_debug"):
|
||||
args += [
|
||||
self.define("HPX_WITH_THREAD_DEBUG_INFO", True),
|
||||
self.define("HPX_WITH_LOGGING", True),
|
||||
]
|
||||
|
||||
if "instrumentation=apex" in spec:
|
||||
if spec.satisfies("instrumentation=apex"):
|
||||
args += [
|
||||
self.define("APEX_WITH_OTF2", True),
|
||||
self.define("OTF2_ROOT", spec["otf2"].prefix),
|
||||
|
@ -84,24 +84,24 @@ def configure_args(self):
|
||||
# '--with-papi=papi', # currently disabled in HPX
|
||||
]
|
||||
|
||||
if "+cxx11" in spec:
|
||||
if spec.satisfies("+cxx11"):
|
||||
args += ["--enable-hpx++"]
|
||||
|
||||
if "+debug" in spec:
|
||||
if spec.satisfies("+debug"):
|
||||
args += ["--enable-debug"]
|
||||
|
||||
if "+instrumentation" in spec:
|
||||
if spec.satisfies("+instrumentation"):
|
||||
args += ["--enable-instrumentation"]
|
||||
|
||||
if "+mpi" in spec or "+photon" in spec:
|
||||
if spec.satisfies("+mpi") or spec.satisfies("+photon"):
|
||||
# photon requires mpi
|
||||
args += ["--enable-mpi"]
|
||||
# Choose pkg-config name for MPI library
|
||||
if "^openmpi" in spec:
|
||||
if spec.satisfies("^openmpi"):
|
||||
args += ["--with-mpi=ompi-cxx"]
|
||||
elif "^mpich" in spec:
|
||||
elif spec.satisfies("^mpich"):
|
||||
args += ["--with-mpi=mpich"]
|
||||
elif "^mvapich2" in spec:
|
||||
elif spec.satisfies("^mvapich2"):
|
||||
args += ["--with-mpi=mvapich2-cxx"]
|
||||
else:
|
||||
args += ["--with-mpi=system"]
|
||||
@ -110,17 +110,17 @@ def configure_args(self):
|
||||
# if '+metis' in spec:
|
||||
# args += ['--with-metis=???']
|
||||
|
||||
if "+opencl" in spec:
|
||||
if spec.satisfies("+opencl"):
|
||||
args += ["--enable-opencl"]
|
||||
if "^pocl" in spec:
|
||||
if spec.satisfies("^pocl"):
|
||||
args += ["--with-opencl=pocl"]
|
||||
else:
|
||||
args += ["--with-opencl=system"]
|
||||
|
||||
if "+photon" in spec:
|
||||
if spec.satisfies("+photon"):
|
||||
args += ["--enable-photon"]
|
||||
|
||||
if "+pic" in spec:
|
||||
if spec.satisfies("+pic"):
|
||||
args += ["--with-pic"]
|
||||
|
||||
return args
|
||||
|
@ -178,7 +178,7 @@ def configure_args(self):
|
||||
if "+rocm" not in self.spec:
|
||||
args.append("--disable-rsmi")
|
||||
|
||||
if "+rocm" in self.spec:
|
||||
if self.spec.satisfies("+rocm"):
|
||||
args.append("--with-rocm={0}".format(self.spec["hip"].prefix))
|
||||
args.append("--with-rocm-version={0}".format(self.spec["hip"].version))
|
||||
|
||||
@ -192,11 +192,11 @@ def configure_args(self):
|
||||
args.extend(self.enable_or_disable("pci"))
|
||||
args.extend(self.enable_or_disable("libs"))
|
||||
|
||||
if "+cuda" in self.spec:
|
||||
if self.spec.satisfies("+cuda"):
|
||||
args.append("--with-cuda={0}".format(self.spec["cuda"].prefix))
|
||||
args.append("--with-cuda-version={0}".format(self.spec["cuda"].version))
|
||||
|
||||
if "+oneapi-level-zero" in self.spec:
|
||||
if self.spec.satisfies("+oneapi-level-zero"):
|
||||
args.append("--enable-levelzero")
|
||||
|
||||
return args
|
||||
|
@ -139,7 +139,7 @@ class Hydrogen(CachedCMakePackage, CudaPackage, ROCmPackage):
|
||||
|
||||
@property
|
||||
def libs(self):
|
||||
shared = True if "+shared" in self.spec else False
|
||||
shared = True if self.spec.satisfies("+shared") else False
|
||||
return find_libraries("libHydrogen", root=self.prefix, shared=shared, recursive=True)
|
||||
|
||||
def cmake_args(self):
|
||||
@ -175,7 +175,7 @@ def initconfig_compiler_entries(self):
|
||||
|
||||
# FIXME: Enforce this better in the actual CMake.
|
||||
entries.append(cmake_cache_string("CMAKE_CXX_STANDARD", "17"))
|
||||
entries.append(cmake_cache_option("BUILD_SHARED_LIBS", "+shared" in spec))
|
||||
entries.append(cmake_cache_option("BUILD_SHARED_LIBS", spec.satisfies("+shared")))
|
||||
entries.append(cmake_cache_option("CMAKE_EXPORT_COMPILE_COMMANDS", True))
|
||||
|
||||
entries.append(cmake_cache_option("MPI_ASSUME_NO_BUILTIN_MPI", True))
|
||||
@ -200,7 +200,7 @@ def initconfig_hardware_entries(self):
|
||||
spec = self.spec
|
||||
entries = super(Hydrogen, self).initconfig_hardware_entries()
|
||||
|
||||
entries.append(cmake_cache_option("Hydrogen_ENABLE_CUDA", "+cuda" in spec))
|
||||
entries.append(cmake_cache_option("Hydrogen_ENABLE_CUDA", spec.satisfies("+cuda")))
|
||||
if spec.satisfies("+cuda"):
|
||||
entries.append(cmake_cache_string("CMAKE_CUDA_STANDARD", "17"))
|
||||
if not spec.satisfies("cuda_arch=none"):
|
||||
@ -215,7 +215,7 @@ def initconfig_hardware_entries(self):
|
||||
if len(cuda_flags) > 0:
|
||||
entries.append(cmake_cache_string("CMAKE_CUDA_FLAGS", " ".join(cuda_flags)))
|
||||
|
||||
entries.append(cmake_cache_option("Hydrogen_ENABLE_ROCM", "+rocm" in spec))
|
||||
entries.append(cmake_cache_option("Hydrogen_ENABLE_ROCM", spec.satisfies("+rocm")))
|
||||
if spec.satisfies("+rocm"):
|
||||
entries.append(cmake_cache_string("CMAKE_HIP_STANDARD", "17"))
|
||||
if not spec.satisfies("amdgpu_target=none"):
|
||||
@ -233,30 +233,36 @@ def initconfig_package_entries(self):
|
||||
entries = super(Hydrogen, self).initconfig_package_entries()
|
||||
|
||||
# Basic Hydrogen options
|
||||
entries.append(cmake_cache_option("Hydrogen_ENABLE_TESTING", "+test" in spec))
|
||||
entries.append(cmake_cache_option("Hydrogen_ENABLE_TESTING", spec.satisfies("+test")))
|
||||
entries.append(cmake_cache_option("Hydrogen_GENERAL_LAPACK_FALLBACK", True))
|
||||
entries.append(cmake_cache_option("Hydrogen_USE_64BIT_INTS", "+int64" in spec))
|
||||
entries.append(cmake_cache_option("Hydrogen_USE_64BIT_BLAS_INTS", "+int64_blas" in spec))
|
||||
entries.append(cmake_cache_option("Hydrogen_USE_64BIT_INTS", spec.satisfies("+int64")))
|
||||
entries.append(
|
||||
cmake_cache_option("Hydrogen_USE_64BIT_BLAS_INTS", spec.satisfies("+int64_blas"))
|
||||
)
|
||||
|
||||
# Advanced dependency options
|
||||
entries.append(cmake_cache_option("Hydrogen_ENABLE_ALUMINUM", "+al" in spec))
|
||||
entries.append(cmake_cache_option("Hydrogen_ENABLE_CUB", "+cub" in spec))
|
||||
entries.append(cmake_cache_option("Hydrogen_ENABLE_GPU_FP16", "+cuda +half" in spec))
|
||||
entries.append(cmake_cache_option("Hydrogen_ENABLE_HALF", "+half" in spec))
|
||||
entries.append(cmake_cache_option("Hydrogen_ENABLE_OPENMP", "+openmp" in spec))
|
||||
entries.append(cmake_cache_option("Hydrogen_ENABLE_ALUMINUM", spec.satisfies("+al")))
|
||||
entries.append(cmake_cache_option("Hydrogen_ENABLE_CUB", spec.satisfies("+cub")))
|
||||
entries.append(
|
||||
cmake_cache_option("Hydrogen_ENABLE_OMP_TASKLOOP", "+omp_taskloops" in spec)
|
||||
cmake_cache_option("Hydrogen_ENABLE_GPU_FP16", spec.satisfies("+cuda +half"))
|
||||
)
|
||||
entries.append(cmake_cache_option("Hydrogen_ENABLE_HALF", spec.satisfies("+half")))
|
||||
entries.append(cmake_cache_option("Hydrogen_ENABLE_OPENMP", spec.satisfies("+openmp")))
|
||||
entries.append(
|
||||
cmake_cache_option("Hydrogen_ENABLE_OMP_TASKLOOP", spec.satisfies("+omp_taskloops"))
|
||||
)
|
||||
|
||||
# Note that CUDA/ROCm are handled above.
|
||||
|
||||
if "blas=openblas" in spec:
|
||||
entries.append(cmake_cache_option("Hydrogen_USE_OpenBLAS", "blas=openblas" in spec))
|
||||
if spec.satisfies("blas=openblas"):
|
||||
entries.append(
|
||||
cmake_cache_option("Hydrogen_USE_OpenBLAS", spec.satisfies("blas=openblas"))
|
||||
)
|
||||
# CMAKE_PREFIX_PATH should handle this
|
||||
entries.append(cmake_cache_string("OpenBLAS_DIR", spec["openblas"].prefix))
|
||||
elif "blas=mkl" in spec or spec.satisfies("^intel-mkl"):
|
||||
elif spec.satisfies("blas=mkl") or spec.satisfies("^intel-mkl"):
|
||||
entries.append(cmake_cache_option("Hydrogen_USE_MKL", True))
|
||||
elif "blas=essl" in spec or spec.satisfies("^essl"):
|
||||
elif spec.satisfies("blas=essl") or spec.satisfies("^essl"):
|
||||
entries.append(cmake_cache_string("BLA_VENDOR", "IBMESSL"))
|
||||
# IF IBM ESSL is used it needs help finding the proper LAPACK libraries
|
||||
entries.append(
|
||||
@ -273,7 +279,7 @@ def initconfig_package_entries(self):
|
||||
% ";".join("-l{0}".format(lib) for lib in self.spec["essl"].libs.names),
|
||||
)
|
||||
)
|
||||
elif "blas=accelerate" in spec:
|
||||
elif spec.satisfies("blas=accelerate"):
|
||||
entries.append(cmake_cache_option("Hydrogen_USE_ACCELERATE", True))
|
||||
elif spec.satisfies("^netlib-lapack"):
|
||||
entries.append(cmake_cache_string("BLA_VENDOR", "Generic"))
|
||||
|
@ -47,18 +47,18 @@ class Hypar(AutotoolsPackage):
|
||||
def configure_args(self):
|
||||
args = []
|
||||
spec = self.spec
|
||||
if "+mpi" in spec:
|
||||
if spec.satisfies("+mpi"):
|
||||
args.append("--with-mpi-dir={0}".format(spec["mpi"].prefix))
|
||||
else:
|
||||
args.append("--enable-serial")
|
||||
if "+openmp" in spec:
|
||||
if spec.satisfies("+openmp"):
|
||||
args.append("--enable-omp")
|
||||
if "+scalapack" in spec:
|
||||
if spec.satisfies("+scalapack"):
|
||||
args.append("--enable-scalapack")
|
||||
args.append("--with-blas-dir={0}".format(spec["blas"].prefix))
|
||||
args.append("--with-lapack-dir={0}".format(spec["lapack"].prefix))
|
||||
args.append("--with-scalapack-dir={0}".format(spec["scalapack"].prefix))
|
||||
if "+fftw" in spec:
|
||||
if spec.satisfies("+fftw"):
|
||||
args.append("--enable-fftw")
|
||||
args.append("--with-fftw-dir={0}".format(spec["fftw"].prefix))
|
||||
return args
|
||||
|
@ -82,7 +82,7 @@ def cmake_args(self):
|
||||
return args
|
||||
|
||||
def setup_build_environment(self, env):
|
||||
if "+cuda" in self.spec:
|
||||
if self.spec.satisfies("+cuda"):
|
||||
env.set("CUDA_HOME", self.spec["cuda"].prefix)
|
||||
env.set("CUDA_PATH", self.spec["cuda"].prefix)
|
||||
cuda_arch = self.spec.variants["cuda_arch"].value
|
||||
@ -90,7 +90,7 @@ def setup_build_environment(self, env):
|
||||
arch_sorted = list(sorted(cuda_arch, reverse=True))
|
||||
env.set("HYPRE_CUDA_SM", arch_sorted[0])
|
||||
# In CUDA builds hypre currently doesn't handle flags correctly
|
||||
env.append_flags("CXXFLAGS", "-O2" if "~debug" in self.spec else "-g")
|
||||
env.append_flags("CXXFLAGS", "-O2" if self.spec.satisfies("~debug") else "-g")
|
||||
|
||||
extra_install_tests = join_path("src", "examples")
|
||||
|
||||
@ -152,6 +152,6 @@ def libs(self):
|
||||
"""Export the hypre library.
|
||||
Sample usage: spec['hypre'].libs.ld_flags
|
||||
"""
|
||||
is_shared = "+shared" in self.spec
|
||||
is_shared = self.spec.satisfies("+shared")
|
||||
libs = find_libraries("libHYPRE", root=self.prefix, shared=is_shared, recursive=True)
|
||||
return libs or None
|
||||
|
@ -329,7 +329,7 @@ def configure_args(self):
|
||||
configure_args.append("--with-magma-lib=%s" % spec["magma"].libs)
|
||||
configure_args.append("--with-magma")
|
||||
|
||||
if "+gpu-aware-mpi" in spec:
|
||||
if spec.satisfies("+gpu-aware-mpi"):
|
||||
configure_args.append("--enable-gpu-aware-mpi")
|
||||
|
||||
configure_args.extend(self.enable_or_disable("fortran"))
|
||||
@ -348,7 +348,7 @@ def setup_build_environment(self, env):
|
||||
env.set("CUDA_HOME", spec["cuda"].prefix)
|
||||
env.set("CUDA_PATH", spec["cuda"].prefix)
|
||||
# In CUDA builds hypre currently doesn't handle flags correctly
|
||||
env.append_flags("CXXFLAGS", "-O2" if "~debug" in spec else "-g")
|
||||
env.append_flags("CXXFLAGS", "-O2" if spec.satisfies("~debug") else "-g")
|
||||
|
||||
if spec.satisfies("+rocm"):
|
||||
# As of 2022/04/05, the following are set by 'llvm-amdgpu' and
|
||||
@ -426,6 +426,6 @@ def libs(self):
|
||||
"""Export the hypre library.
|
||||
Sample usage: spec['hypre'].libs.ld_flags
|
||||
"""
|
||||
is_shared = "+shared" in self.spec
|
||||
is_shared = self.spec.satisfies("+shared")
|
||||
libs = find_libraries("libHYPRE", root=self.prefix, shared=is_shared, recursive=True)
|
||||
return libs or None
|
||||
|
@ -47,6 +47,6 @@ class IbmDatabroker(CMakePackage, PythonExtension):
|
||||
def cmake_args(self):
|
||||
args = []
|
||||
args.append("-DDEFAULT_BE=redis")
|
||||
if "+python" in self.spec:
|
||||
if self.spec.satisfies("+python"):
|
||||
args.append("-DPYDBR=1")
|
||||
return args
|
||||
|
@ -158,9 +158,9 @@ def configure_args(self):
|
||||
os.environ["POTENTIAL_CC"] = os.environ["CC"]
|
||||
os.environ["WGET"] = self.spec["wget"].command.path
|
||||
args = []
|
||||
if "~X" in self.spec:
|
||||
if self.spec.satisfies("~X"):
|
||||
args.append("--enable-headless")
|
||||
if "+shenandoah" in self.spec:
|
||||
if self.spec.satisfies("+shenandoah"):
|
||||
args.append("--with-hotspot-build=shenandoah")
|
||||
args.append("--with-hotspot-src-zip=" + self.stage[9].archive_file)
|
||||
args.append("--with-hotspot-checksum=no")
|
||||
|
@ -144,13 +144,13 @@ def configure_args(self):
|
||||
]:
|
||||
args += self.enable_or_disable(x)
|
||||
|
||||
if "+art" in self.spec:
|
||||
if self.spec.satisfies("+art"):
|
||||
args.append("--enable-art")
|
||||
libs += self.spec["libxml2"].libs
|
||||
else:
|
||||
args.append("--disable-art")
|
||||
|
||||
if "+coupling" in self.spec:
|
||||
if self.spec.satisfies("+coupling"):
|
||||
args.append("--enable-coupling")
|
||||
libs += self.spec["libfyaml"].libs
|
||||
else:
|
||||
@ -168,7 +168,7 @@ def configure_args(self):
|
||||
)
|
||||
libs += self.spec["serialbox:fortran"].libs
|
||||
|
||||
if "+grib2" in self.spec:
|
||||
if self.spec.satisfies("+grib2"):
|
||||
args.append("--enable-grib2")
|
||||
libs += self.spec["eccodes:c"].libs
|
||||
else:
|
||||
@ -179,7 +179,7 @@ def configure_args(self):
|
||||
libs += self.spec["netcdf-fortran"].libs
|
||||
libs += self.spec["netcdf-c"].libs
|
||||
|
||||
if "+mpi" in self.spec:
|
||||
if self.spec.satisfies("+mpi"):
|
||||
args.extend(
|
||||
[
|
||||
"--enable-mpi",
|
||||
@ -214,7 +214,7 @@ def configure_args(self):
|
||||
flags["ICON_BUNDLED_CFLAGS"].append("-O2")
|
||||
flags["FCFLAGS"].append("-g")
|
||||
flags["ICON_FCFLAGS"].append("-O2")
|
||||
if "+ocean" in self.spec:
|
||||
if self.spec.satisfies("+ocean"):
|
||||
flags["ICON_OCEAN_FCFLAGS"].extend(["-O3", "-fno-tree-loop-vectorize"])
|
||||
args.extend(
|
||||
["--enable-fcgroup-OCEAN", "ICON_OCEAN_PATH=src/hamocc:src/ocean:src/sea_ice"]
|
||||
@ -239,10 +239,10 @@ def configure_args(self):
|
||||
]
|
||||
)
|
||||
|
||||
if "%oneapi+coupling" in self.spec:
|
||||
if self.spec.satisfies("%oneapi+coupling"):
|
||||
flags["ICON_YAC_CFLAGS"].extend(["-O2", "-fp-model precise"])
|
||||
|
||||
if "+ocean" in self.spec:
|
||||
if self.spec.satisfies("+ocean"):
|
||||
flags["ICON_OCEAN_FCFLAGS"].extend(
|
||||
["-O3", "-assume norealloc_lhs", "-reentrancy threaded"]
|
||||
)
|
||||
@ -250,10 +250,10 @@ def configure_args(self):
|
||||
["--enable-fcgroup-OCEAN", "ICON_OCEAN_PATH=src/hamocc:src/ocean:src/sea_ice"]
|
||||
)
|
||||
|
||||
if "+openmp" in self.spec:
|
||||
if self.spec.satisfies("+openmp"):
|
||||
flags["ICON_OCEAN_FCFLAGS"].extend(["-DOCE_SOLVE_OMP"])
|
||||
|
||||
if "+ecrad" in self.spec:
|
||||
if self.spec.satisfies("+ecrad"):
|
||||
flags["ICON_ECRAD_FCFLAGS"].extend(["-qno-opt-dynamic-align", "-no-fma", "-fpe0"])
|
||||
|
||||
elif self.compiler.name == "nvhpc":
|
||||
@ -267,7 +267,7 @@ def configure_args(self):
|
||||
["-acc=gpu", "-gpu=cc{0}".format(self.nvidia_targets[gpu])]
|
||||
)
|
||||
|
||||
if "%nvhpc@:23.9+coupling" in self.spec:
|
||||
if self.spec.satisfies("%nvhpc@:23.9+coupling"):
|
||||
args.append("yac_cv_fc_is_contiguous_works=yes")
|
||||
|
||||
else:
|
||||
|
@ -51,7 +51,7 @@ def cmake_args(self):
|
||||
"-DBLA_VENDOR=OpenBLAS",
|
||||
]
|
||||
|
||||
if "+shared" in self.spec:
|
||||
if self.spec.satisfies("+shared"):
|
||||
args.append("-DBUILD_SHARED_LIBS=ON")
|
||||
else:
|
||||
args.append("-DBUILD_SHARED_LIBS=OFF")
|
||||
|
@ -34,7 +34,7 @@ def install(self, spec, prefix):
|
||||
mkdirp(prefix.bin)
|
||||
install("igv.args", prefix)
|
||||
files = ["igv.sh", "igv_hidpi.sh"]
|
||||
if "+igvtools" in spec:
|
||||
if spec.satisfies("+igvtools"):
|
||||
files.extend(["igvtools", "igvtools_gui", "igvtools_gui_hidpi"])
|
||||
for f in files:
|
||||
filter_file("^prefix=.*$", "prefix=" + prefix, f)
|
||||
|
@ -30,7 +30,7 @@ class Infernal(AutotoolsPackage):
|
||||
|
||||
def configure_args(self):
|
||||
args = []
|
||||
if "+mpi" in self.spec:
|
||||
if self.spec.satisfies("+mpi"):
|
||||
args.append("--enable-mpi")
|
||||
else:
|
||||
args.append("--disable-mpi")
|
||||
|
@ -32,7 +32,7 @@ def setup_build_environment(self, env):
|
||||
env.append_flags("CXXFLAGS", self.compiler.cxx11_flag)
|
||||
|
||||
def setup_run_environment(self, env):
|
||||
if "+clang" in self.spec:
|
||||
if self.spec.satisfies("+clang"):
|
||||
env.set("CC", join_path(self.spec.prefix.bin, "clang"))
|
||||
env.set("CXX", join_path(self.spec.prefix.bin, "clang++"))
|
||||
|
||||
|
@ -98,25 +98,25 @@ def parallel(self):
|
||||
def build_targets(self):
|
||||
spec = self.spec
|
||||
targets = []
|
||||
if "+mpi1" in spec:
|
||||
if spec.satisfies("+mpi1"):
|
||||
targets.append("MPI1")
|
||||
if "+ext" in spec:
|
||||
if spec.satisfies("+ext"):
|
||||
targets.append("EXT")
|
||||
if "+io" in spec:
|
||||
if spec.satisfies("+io"):
|
||||
targets.append("IO")
|
||||
if "+nbc" in spec:
|
||||
if spec.satisfies("+nbc"):
|
||||
targets.append("NBC")
|
||||
if "+p2p" in spec:
|
||||
if spec.satisfies("+p2p"):
|
||||
targets.append("P2P")
|
||||
if "+rma" in spec:
|
||||
if spec.satisfies("+rma"):
|
||||
targets.append("RMA")
|
||||
if "+mt" in spec:
|
||||
if spec.satisfies("+mt"):
|
||||
targets.append("MT")
|
||||
|
||||
if spec.satisfies("@2019:"):
|
||||
targets = ["TARGET=" + target for target in targets]
|
||||
|
||||
if "+check" in spec:
|
||||
if spec.satisfies("+check"):
|
||||
targets.append("CPPFLAGS=-DCHECK")
|
||||
|
||||
return targets
|
||||
@ -129,17 +129,17 @@ def install(self, spec, prefix):
|
||||
mkdir(prefix.bin)
|
||||
|
||||
with working_dir(self.build_directory):
|
||||
if "+mpi1" in spec:
|
||||
if spec.satisfies("+mpi1"):
|
||||
install("IMB-MPI1", prefix.bin)
|
||||
if "+ext" in spec:
|
||||
if spec.satisfies("+ext"):
|
||||
install("IMB-EXT", prefix.bin)
|
||||
if "+io" in spec:
|
||||
if spec.satisfies("+io"):
|
||||
install("IMB-IO", prefix.bin)
|
||||
if "+nbc" in spec:
|
||||
if spec.satisfies("+nbc"):
|
||||
install("IMB-NBC", prefix.bin)
|
||||
if "+p2p" in spec:
|
||||
if spec.satisfies("+p2p"):
|
||||
install("IMB-P2P", prefix.bin)
|
||||
if "+rma" in spec:
|
||||
if spec.satisfies("+rma"):
|
||||
install("IMB-RMA", prefix.bin)
|
||||
if "+mt" in spec:
|
||||
if spec.satisfies("+mt"):
|
||||
install("IMB-MT", prefix.bin)
|
||||
|
@ -157,15 +157,15 @@ def component_dir(self):
|
||||
|
||||
@property
|
||||
def env_script_args(self):
|
||||
if "+external-libfabric" in self.spec:
|
||||
if self.spec.satisfies("+external-libfabric"):
|
||||
return ("-i_mpi_ofi_internal=0",)
|
||||
else:
|
||||
return ()
|
||||
|
||||
def wrapper_names(self):
|
||||
if "+generic-names" in self.spec:
|
||||
if self.spec.satisfies("+generic-names"):
|
||||
return ["mpicc", "mpicxx", "mpif77", "mpif90", "mpifc"]
|
||||
elif "+classic-names" in self.spec:
|
||||
elif self.spec.satisfies("+classic-names"):
|
||||
return ["mpiicc", "mpiicpc", "mpiifort", "mpiifort", "mpiifort"]
|
||||
else:
|
||||
return ["mpiicx", "mpiicpx", "mpiifx", "mpiifx", "mpiifx"]
|
||||
@ -202,14 +202,14 @@ def setup_dependent_build_environment(self, env, dependent_spec):
|
||||
@property
|
||||
def libs(self):
|
||||
libs = []
|
||||
if "+ilp64" in self.spec:
|
||||
if self.spec.satisfies("+ilp64"):
|
||||
libs += find_libraries("libmpi_ilp64", self.component_prefix.lib.release)
|
||||
libs += find_libraries(["libmpicxx", "libmpifort"], self.component_prefix.lib)
|
||||
libs += find_libraries("libmpi", self.component_prefix.lib.release)
|
||||
libs += find_system_libraries(["libdl", "librt", "libpthread"])
|
||||
|
||||
# Find libfabric for libmpi.so
|
||||
if "+external-libfabric" in self.spec:
|
||||
if self.spec.satisfies("+external-libfabric"):
|
||||
libs += self.spec["libfabric"].libs
|
||||
else:
|
||||
libs += find_libraries(["libfabric"], self.component_prefix.libfabric.lib)
|
||||
|
@ -187,7 +187,7 @@ def url_for_version(self, version):
|
||||
|
||||
@property
|
||||
def libs(self):
|
||||
shared = True if "+shared" in self.spec else False
|
||||
shared = True if self.spec.satisfies("+shared") else False
|
||||
return find_libraries("libtbb*", root=self.prefix, shared=shared, recursive=True)
|
||||
|
||||
|
||||
|
@ -124,11 +124,11 @@ def install(self, spec, prefix):
|
||||
"--no-werror",
|
||||
f"--prefix={prefix}",
|
||||
)
|
||||
if "+optimize" in spec:
|
||||
if spec.satisfies("+optimize"):
|
||||
mfile.add_default_arg("--opt=2")
|
||||
if "+debug" in spec:
|
||||
if spec.satisfies("+debug"):
|
||||
mfile.add_default_arg("--debug")
|
||||
if "+pic" in spec:
|
||||
if spec.satisfies("+pic"):
|
||||
mfile.add_default_arg(
|
||||
f"--extra-ccflags={self.compiler.cc_pic_flag}",
|
||||
f"--extra-cxxflags={self.compiler.cxx_pic_flag}",
|
||||
@ -144,11 +144,11 @@ def install(self, spec, prefix):
|
||||
mfile(
|
||||
f"--install-dir={shared_kit}",
|
||||
"--shared",
|
||||
*(["examples"] if "+examples" in spec else []),
|
||||
*(["examples"] if spec.satisfies("+examples") else []),
|
||||
"install",
|
||||
)
|
||||
|
||||
if "+examples" in self.spec:
|
||||
if self.spec.satisfies("+examples"):
|
||||
# Install the example binaries to share/xed/examples
|
||||
install_tree(join_path(shared_kit, "bin"), prefix.share.xed.examples)
|
||||
|
||||
|
@ -66,18 +66,18 @@ def configure_args(self):
|
||||
|
||||
env["CC"] = spec["mpi"].mpicc
|
||||
|
||||
if "+hdf5" in spec:
|
||||
if spec.satisfies("+hdf5"):
|
||||
config_args.append("--with-hdf5")
|
||||
config_args.append("CFLAGS=-D H5_USE_16_API")
|
||||
else:
|
||||
config_args.append("--without-hdf5")
|
||||
|
||||
if "+ncmpi" in spec:
|
||||
if spec.satisfies("+ncmpi"):
|
||||
config_args.append("--with-ncmpi")
|
||||
else:
|
||||
config_args.append("--without-ncmpi")
|
||||
|
||||
if "+lustre" in spec:
|
||||
if spec.satisfies("+lustre"):
|
||||
config_args.append("--with-lustre")
|
||||
else:
|
||||
config_args.append("--without-lustre")
|
||||
|
@ -79,25 +79,25 @@ def autoreconf(self, spec, prefix):
|
||||
def configure_args(self):
|
||||
args = []
|
||||
spec = self.spec
|
||||
if "+papi" in spec:
|
||||
if spec.satisfies("+papi"):
|
||||
args.append("--with-papi={0}".format(spec["papi"].prefix))
|
||||
|
||||
if "+cuda" in spec:
|
||||
if spec.satisfies("+cuda"):
|
||||
args.append("--with-cudapath={0}".format(spec["cuda"].prefix))
|
||||
|
||||
if "+libunwind" in spec:
|
||||
if spec.satisfies("+libunwind"):
|
||||
args.append("--with-libunwind={0}".format(spec["libunwind"].prefix))
|
||||
|
||||
if "+papi_multiplexing" in spec:
|
||||
if spec.satisfies("+papi_multiplexing"):
|
||||
args.append("--enable-papi-multiplexing")
|
||||
|
||||
if "+posixio" in spec:
|
||||
if spec.satisfies("+posixio"):
|
||||
args.append("--enable-posixio")
|
||||
|
||||
if "+pmon" in spec:
|
||||
if spec.satisfies("+pmon"):
|
||||
args.append("--enable-pmon")
|
||||
|
||||
if "+coll_details" in spec:
|
||||
if spec.satisfies("+coll_details"):
|
||||
args.append("--enable-coll-details")
|
||||
|
||||
args.extend(
|
||||
|
@ -93,7 +93,7 @@ def configure_args(self):
|
||||
else:
|
||||
args.extend(["--with-lapack-lflags={0} {1}".format(lapack_lib, blas_lib)])
|
||||
|
||||
if "+mumps" in spec:
|
||||
if spec.satisfies("+mumps"):
|
||||
mumps_dir = spec["mumps"].prefix
|
||||
mumps_flags = "-ldmumps -lmumps_common -lpord -lmpiseq"
|
||||
mumps_libcmd = "-L%s " % mumps_dir.lib + mumps_flags
|
||||
@ -113,7 +113,7 @@ def configure_args(self):
|
||||
]
|
||||
)
|
||||
|
||||
if "coinhsl" in spec:
|
||||
if spec.satisfies("^coinhsl"):
|
||||
hsl_ld_flags = "-ldl {0}".format(spec["coinhsl"].libs.ld_flags)
|
||||
|
||||
if spec.satisfies("^coinhsl+blas"):
|
||||
@ -135,7 +135,7 @@ def configure_args(self):
|
||||
]
|
||||
)
|
||||
|
||||
if "metis" in spec:
|
||||
if spec.satisfies("^metis"):
|
||||
if spec.satisfies("@:3.12.13"):
|
||||
args.extend(
|
||||
[
|
||||
@ -147,7 +147,7 @@ def configure_args(self):
|
||||
# The IPOPT configure file states that '--enable-debug' implies
|
||||
# '--disable-shared', but adding '--enable-shared' overrides
|
||||
# '--disable-shared' and builds a shared library with debug symbols
|
||||
if "+debug" in spec:
|
||||
if spec.satisfies("+debug"):
|
||||
args.append("--enable-debug")
|
||||
else:
|
||||
args.append("--disable-debug")
|
||||
|
@ -57,13 +57,13 @@ def cmake_args(self):
|
||||
args = []
|
||||
iqflags = []
|
||||
|
||||
if "+lsd2" in spec:
|
||||
if spec.satisfies("+lsd2"):
|
||||
args.append("-DUSE_LSD2=ON")
|
||||
|
||||
if "+openmp" in spec:
|
||||
if spec.satisfies("+openmp"):
|
||||
iqflags.append("omp")
|
||||
|
||||
if "+mpi" in spec:
|
||||
if spec.satisfies("+mpi"):
|
||||
iqflags.append("mpi")
|
||||
|
||||
if not iqflags:
|
||||
|
@ -92,12 +92,12 @@ def edit(self, spec, prefix):
|
||||
filter_file(r"^BLAS_LAPACK_LIBFLAGS.+", vlib, mf)
|
||||
|
||||
# 3.HDF5
|
||||
if "+hdf5" in spec:
|
||||
if spec.satisfies("+hdf5"):
|
||||
hdf5p = f"HDF5_PREFIX={spec['hdf5'].prefix.lib}"
|
||||
filter_file("^#HDF5.+", hdf5p, mf)
|
||||
|
||||
# 4.openmp
|
||||
if "+openmp" in spec:
|
||||
if spec.satisfies("+openmp"):
|
||||
filter_file("#ITENSOR_USE_OMP", "ITENSOR_USE_OMP", mf)
|
||||
filter_file("-fopenmp", self.compiler.openmp_flag, mf)
|
||||
|
||||
@ -105,7 +105,7 @@ def edit(self, spec, prefix):
|
||||
filter_file(r"^PREFIX.+", f"PREFIX={os.getcwd()}", mf)
|
||||
|
||||
# 5.shared
|
||||
if "+shared" in spec:
|
||||
if spec.satisfies("+shared"):
|
||||
filter_file("ITENSOR_MAKE_DYLIB=0", "ITENSOR_MAKE_DYLIB=1", mf)
|
||||
|
||||
def install(self, spec, prefix):
|
||||
|
Loading…
Reference in New Issue
Block a user