Skip to content

Commit

Permalink
Add support for Codeplay AMD Plugin for Intel OneAPI Compilers (spack…
Browse files Browse the repository at this point in the history
…#46749)

* Added support for Codeplay AMD Plugin for Intel OneAPI Compilers

* [@spackbot] updating style on behalf of kaanolgu

* Adding 2025.0.0

* removed HOME and XDG_RUNTIME_DIR

* [@spackbot] updating style on behalf of kaanolgu

---------

Co-authored-by: Kaan Olgu <kaan.olgu@bristol.ac.uk>
  • Loading branch information
kaanolgu and Kaan Olgu authored Nov 10, 2024
1 parent 4c9bc8d commit 97b5ec6
Showing 1 changed file with 34 additions and 4 deletions.
38 changes: 34 additions & 4 deletions var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
"url": "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/69f79888-2d6c-4b20-999e-e99d72af68d4/intel-fortran-compiler-2025.0.0.723_offline.sh",
"sha256": "2be6d607ce84f35921228595b118fbc516d28587cbc4e6dcf6b7219e5cd1a9a9",
},
"nvidia-plugin": {
"url": "https://developer.codeplay.com/api/v1/products/download?product=oneapi&variant=nvidia&version=2025.0.0&filters[]=12.0&filters[]=linux",
"sha256": "264a43d2e07c08eb31d6483fb1c289a6b148709e48e9a250efc1b1e9a527feb6",
},
"amd-plugin": {
"url": "https://developer.codeplay.com/api/v1/products/download?product=oneapi&variant=amd&version=2025.0.0&filters[]=6.1.0&filters[]=linux",
"sha256": "2c5a147e82f0e995b9c0457b53967cc066d5741d675cb64cb9eba8e3c791a064",
},
},
{
"version": "2024.2.1",
Expand All @@ -35,6 +43,10 @@
"url": "https://developer.codeplay.com/api/v1/products/download?product=oneapi&variant=nvidia&version=2024.2.1&filters[]=12.0&filters[]=linux",
"sha256": "2c377027c650291ccd8267cbf75bd3d00c7b11998cc59d5668a02a0cbc2c015f",
},
"amd-plugin": {
"url": "https://developer.codeplay.com/api/v1/products/download?product=oneapi&variant=amd&version=2024.2.1&filters[]=6.1.0&filters[]=linux",
"sha256": "fbeb64f959f907cbf3469f4e154b2af6d8ff46fe4fc667c811e04f3872a13823",
},
},
{
"version": "2024.2.0",
Expand All @@ -50,6 +62,10 @@
"url": "https://developer.codeplay.com/api/v1/products/download?product=oneapi&variant=nvidia&version=2024.2.0&filters[]=12.0&filters[]=linux",
"sha256": "0622df0054364b01e91e7ed72a33cb3281e281db5b0e86579f516b1cc5336b0f",
},
"amd-plugin": {
"url": "https://developer.codeplay.com/api/v1/products/download?product=oneapi&variant=amd&version=2024.2.0&filters[]=6.1.0&filters[]=linux",
"sha256": "d1e9d30fa92f3ef606f054d8cbd7c338b3e46f6a9f8472736e29e8ccd9e50688",
},
},
{
"version": "2024.1.0",
Expand Down Expand Up @@ -286,6 +302,9 @@ class IntelOneapiCompilers(IntelOneApiPackage, CompilerPackage):
# Add the nvidia variant
variant("nvidia", default=False, description="Install NVIDIA plugin for OneAPI")
conflicts("@:2022.2.1", when="+nvidia", msg="Codeplay NVIDIA plugin requires newer release")
# Add the amd variant
variant("amd", default=False, description="Install AMD plugin for OneAPI")
conflicts("@:2022.2.1", when="+amd", msg="Codeplay AMD plugin requires newer release")
# TODO: effectively gcc is a direct dependency of intel-oneapi-compilers, but we
# cannot express that properly. For now, add conflicts for non-gcc compilers
# instead.
Expand All @@ -309,6 +328,14 @@ class IntelOneapiCompilers(IntelOneApiPackage, CompilerPackage):
expand=False,
**v["nvidia-plugin"],
)
if "amd-plugin" in v:
resource(
name="amd-plugin-installer",
placement="amd-plugin-installer",
when="@{0}".format(v["version"]),
expand=False,
**v["amd-plugin"],
)

@property
def v2_layout_versions(self):
Expand Down Expand Up @@ -374,12 +401,15 @@ def install(self, spec, prefix):
if nvidia_script:
if platform.system() == "Linux":
bash = Executable("bash")
# Installer writes files in ~/intel set HOME so it goes to prefix
bash.add_default_env("HOME", prefix)
# Installer checks $XDG_RUNTIME_DIR/.bootstrapper_lock_file as well
bash.add_default_env("XDG_RUNTIME_DIR", join_path(self.stage.path, "runtime"))
# For NVIDIA plugin installer
bash(nvidia_script[0], "-y", "--install-dir", self.prefix)
if self.spec.satisfies("+amd"):
amd_script = find("amd-plugin-installer", "*")
if amd_script:
if platform.system() == "Linux":
bash = Executable("bash")
# For AMD plugin installer
bash(amd_script[0], "-y", "--install-dir", self.prefix)

@run_after("install")
def inject_rpaths(self):
Expand Down

0 comments on commit 97b5ec6

Please sign in to comment.