hipsycl: update package (#42518)

This commit is contained in:
Thomas-Ulrich 2024-02-19 14:34:05 +01:00 committed by GitHub
parent a0e80b23b9
commit abe617c4ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,6 +26,8 @@ class Hipsycl(CMakePackage):
license("BSD-2-Clause")
version("stable", branch="stable", submodules=True)
version("23.10.0", commit="3952b468c9da89edad9dff953cdcab0a3c3bf78c", submodules=True)
version("0.9.4", commit="99d9e24d462b35e815e0e59c1b611936c70464ae", submodules=True)
version("0.9.4", commit="99d9e24d462b35e815e0e59c1b611936c70464ae", submodules=True)
version("0.9.3", commit="51507bad524c33afe8b124804091b10fa25618dc", submodules=True)
version("0.9.2", commit="49fd02499841ae884c61c738610e58c27ab51fdb", submodules=True)
@ -120,17 +122,36 @@ def cmake_args(self):
@run_after("install")
def filter_config_file(self):
config_file_paths = filesystem.find(self.prefix, "syclcc.json")
def edit_config(filename, editor):
config_file_paths = filesystem.find(self.prefix, filename)
if len(config_file_paths) != 1:
raise InstallError(
"installed hipSYCL must provide a unique compiler driver"
"configuration file, found: {0}".format(config_file_paths)
"configuration file ({0}), found: {1}".format(filename, config_file_paths)
)
config_file_path = config_file_paths[0]
with open(config_file_path) as f:
config = json.load(f)
# 1. Fix compiler: use the real one in place of the Spack wrapper
config_modified = editor(config)
with open(config_file_path, "w") as f:
json.dump(config_modified, f, indent=2)
if self.spec.satisfies("@:23.10.0"):
configfiles = {"core": "syclcc.json", "cuda": "syclcc.json"}
else:
configfiles = {"core": "acpp-core.json", "cuda": "acpp-cuda.json"}
def adjust_core_config(config):
config["default-cpu-cxx"] = self.compiler.cxx
return config
edit_config(configfiles["core"], adjust_core_config)
if self.spec.satisfies("+cuda"):
# 1. Fix compiler: use the real one in place of the Spack wrapper
# 2. Fix stdlib: we need to make sure cuda-enabled binaries find
# the libc++.so and libc++abi.so dyn linked to the sycl
# ptx backend
@ -155,7 +176,11 @@ def filter_config_file(self):
"found: {0}".format(so_paths)
)
rpaths.add(path.dirname(so_paths[0]))
config["default-cuda-link-line"] += " " + " ".join("-rpath {0}".format(p) for p in rpaths)
# Replace the installed config file
with open(config_file_path, "w") as f:
json.dump(config, f, indent=2)
def adjust_cuda_config(config):
config["default-cuda-link-line"] += " " + " ".join(
"-rpath {0}".format(p) for p in rpaths
)
return config
edit_config(configfiles["cuda"], adjust_cuda_config)