armpl-gcc: add v24.04 (#43553)

Starting from 24.04, armpl-gcc will only have three packages files: dev, rpm, and macOS. 

Only one version for gcc is provided, so the changes in the code reflect that the tar provided
for gcc is only one rather than many.
This commit is contained in:
Paolo 2024-05-23 05:37:23 +01:00 committed by GitHub
parent 3e1a562312
commit f5f7cfdc8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 160 additions and 47 deletions

View File

@ -36,6 +36,40 @@
}
_versions = {
"24.04": {
"RHEL-7": (
"064c3ecfd71cba3d8bf639448e899388f58eb7faef4b38f3c1aace625ace8b1e",
"https://developer.arm.com/-/media/Files/downloads/hpc/arm-compiler-for-linux/24-04/arm-compiler-for-linux_24.04_RHEL-7_aarch64.tar",
),
"RHEL-8": (
"38f46a3549667d0fbccd947653d3a1a56b630d3bbb1251888c674c463f00dac3",
"https://developer.arm.com/-/media/Files/downloads/hpc/arm-compiler-for-linux/24-04/arm-compiler-for-linux_24.04_RHEL-8_aarch64.tar",
),
"RHEL-9": (
"d335db82c8310e1d79c96dc09a19e4d509c5ab17eb6027214bb79cfc75d8229e",
"https://developer.arm.com/-/media/Files/downloads/hpc/arm-compiler-for-linux/24-04/arm-compiler-for-linux_24.04_RHEL-9_aarch64.tar",
),
"SLES-15": (
"6f2e090efcd8da2cbeaf63272fac5917f637713f1e86d73cde2ad7268e3a05a2",
"https://developer.arm.com/-/media/Files/downloads/hpc/arm-compiler-for-linux/24-04/arm-compiler-for-linux_24.04_SLES-15_aarch64.tar",
),
"Ubuntu-20.04": (
"0d782e6a69a11f90bf3b392313c885a2376c5761f227bf2f68e34e9848ec8e97",
"https://developer.arm.com/-/media/Files/downloads/hpc/arm-compiler-for-linux/24-04/arm-compiler-for-linux_24.04_Ubuntu-20.04_aarch64.tar",
),
"Ubuntu-22.04": (
"0bab2e89f0a2359746f89a01251dca763305c5b0dee95cf47b0968dd1cb5f6f6",
"https://developer.arm.com/-/media/Files/downloads/hpc/arm-compiler-for-linux/24-04/arm-compiler-for-linux_24.04_Ubuntu-22.04_aarch64.tar",
),
"AmazonLinux-2": (
"cf0bebe2d7123749c919a5f4e36100ad21f08ffbad3b53e477205c08ae973a2d",
"https://developer.arm.com/-/media/Files/downloads/hpc/arm-compiler-for-linux/24-04/arm-compiler-for-linux_24.04_AmazonLinux-2_aarch64.tar",
),
"AmazonLinux-2023": (
"035dae8c41a1ac86c8885837978cb712306aa75dc5d26d17aca843b84eaee9f4",
"https://developer.arm.com/-/media/Files/downloads/hpc/arm-compiler-for-linux/24-04/arm-compiler-for-linux_24.04_AmazonLinux-2023_aarch64.tar",
),
},
"23.10": {
"RHEL-7": (
"c3bd4df3e5f6c97369237b0067e0a421dceb9c167d73f22f3da87f5025258314",
@ -192,34 +226,22 @@ def get_armpl_version_to_3(spec):
def get_armpl_prefix(spec):
ver = get_armpl_version_to_3(spec)
os = get_os(spec.version.string)
if spec.version.string.startswith("22."):
return join_path(
spec.prefix,
"armpl-{}_AArch64_{}_arm-linux-compiler_aarch64-linux".format(
get_armpl_version_to_3(spec), get_os(spec.version.string)
),
)
return join_path(spec.prefix, f"armpl-{ver}_AArch64_{os}_arm-linux-compiler_aarch64-linux")
else:
return join_path(
spec.prefix,
"armpl-{}_{}_arm-linux-compiler".format(
get_armpl_version_to_3(spec), get_os(spec.version.string)
),
)
return join_path(spec.prefix, f"armpl-{ver}_{os}_arm-linux-compiler")
def get_acfl_prefix(spec):
os = get_os(spec.version.string)
if spec.version.string.startswith("22."):
return join_path(
spec.prefix,
"arm-linux-compiler-{0}_Generic-AArch64_{1}_aarch64-linux".format(
spec.version, get_os(spec.version.string)
),
spec.prefix, f"arm-linux-compiler-{spec.version}_Generic-AArch64_{os}_aarch64-linux"
)
else:
return join_path(
spec.prefix, f"arm-linux-compiler-{spec.version}_{get_os(spec.version.string)}"
)
return join_path(spec.prefix, f"arm-linux-compiler-{spec.version}_{os}")
def get_gcc_prefix(spec):
@ -227,6 +249,16 @@ def get_gcc_prefix(spec):
return join_path(spec.prefix, next(dir for dir in dirlist if dir.startswith("gcc")))
def get_armpl_suffix(spec):
suffix = ""
if spec.satisfies("@24:"):
suffix += "_ilp64" if spec.satisfies("+ilp64") else "_lp64"
else:
suffix += "_ilp64" if spec.satisfies("+ilp64") else ""
suffix += "_mp" if spec.satisfies("threads=openmp") else ""
return suffix
class Acfl(Package, CompilerPackage):
"""Arm Compiler combines the optimized tools and libraries from Arm
with a modern LLVM-based compiler framework.
@ -235,7 +267,7 @@ class Acfl(Package, CompilerPackage):
homepage = "https://developer.arm.com/Tools%20and%20Software/Arm%20Compiler%20for%20Linux"
url = "https://developer.arm.com/-/media/Files/downloads/hpc/arm-compiler-for-linux/23-10/arm-compiler-for-linux_23.10_Ubuntu-22.04_aarch64.tar"
maintainers("annop-w")
maintainers("paolotricerri")
# Build Versions
for ver, packages in _versions.items():
@ -310,10 +342,7 @@ def fortran(self):
@property
def lib_suffix(self):
suffix = ""
suffix += "_ilp64" if self.spec.satisfies("+ilp64") else ""
suffix += "_mp" if self.spec.satisfies("threads=openmp") else ""
return suffix
return get_armpl_suffix(self.spec)
@property
def blas_libs(self):
@ -389,8 +418,9 @@ def setup_run_environment(self, env):
def check_install(self):
arm_dir = get_acfl_prefix(self.spec)
armpl_dir = get_armpl_prefix(self.spec)
suffix = get_armpl_suffix(self.spec)
gcc_dir = get_gcc_prefix(self.spec)
armpl_example_dir = join_path(armpl_dir, "examples")
armpl_example_dir = join_path(armpl_dir, f"examples{suffix}")
# run example makefile
make(
"-C",
@ -399,6 +429,7 @@ def check_install(self):
"F90=" + self.fortran,
"CPATH=" + join_path(arm_dir, "include"),
"COMPILER_PATH=" + gcc_dir,
"ARMPL_DIR=" + armpl_dir,
)
# clean up
make("-C", armpl_example_dir, "clean")

View File

@ -21,7 +21,7 @@
"amzn2023": "RHEL-7",
}
_os_map = {
_os_map_before_24 = {
"ubuntu20.04": "Ubuntu-20.04",
"ubuntu22.04": "Ubuntu-22.04",
"sles15": "SLES-15",
@ -36,7 +36,27 @@
"amzn2023": "AmazonLinux-2023",
}
_os_pkg_map = {
"ubuntu20.04": "deb",
"ubuntu22.04": "deb",
"sles15": "rpm",
"centos7": "rpm",
"centos8": "rpm",
"rhel7": "rpm",
"rhel8": "rpm",
"rhel9": "rpm",
"rocky8": "rpm",
"rocky9": "rpm",
"amzn2": "rpm",
"amzn2023": "rpm",
}
_versions = {
"24.04": {
"deb": ("a323074cd08af82f4d79988cc66088b18e47dea4b93323b1b8a0f994f769f2f0"),
"macOS": ("228bf3a2c25dbd45c2f89c78f455ee3c7dfb25e121c20d2765138b5174e688dc"),
"rpm": ("d3917523034cf5a35e4f31f9a8bf4e53e7cc97892e89739d5757cb65ce40dc2e"),
},
"23.10_gcc-12.2": {
"RHEL-7": ("e5e2c69ad281a676f2a06c835fbf31d4f9fdf46aa3f3f7c8aafff46985f64902"),
"RHEL-8": ("cc0f3572ead93d1e31797b7a39a40cff3414878df9bd24a452bf4877dc35ca4c"),
@ -227,28 +247,32 @@
}
def get_os(ver):
def get_os_or_pkg_manager(ver):
platform = spack.platforms.host()
if platform.name == "darwin":
return "macOS"
if ver.startswith("22."):
return _os_map_before_23.get(platform.default_os, "")
elif ver.startswith("23."):
return _os_map_before_24.get(platform.default_os, "RHEL-7")
else:
return _os_map.get(platform.default_os, "RHEL-7")
return _os_pkg_map.get(platform.default_os, "rpm")
def get_package_url(version):
base_url = "https://developer.arm.com/-/media/Files/downloads/hpc/arm-performance-libraries/"
def get_package_url_before_24(base_url, version):
armpl_version = version.split("_")[0]
armpl_version_dashed = armpl_version.replace(".", "-")
compiler_version = version.split("_", 1)[1]
os = get_os(armpl_version)
os = get_os_or_pkg_manager(armpl_version)
if os == "macOS":
if armpl_version.startswith("23.06"):
return f"{base_url}{armpl_version_dashed}/armpl_{armpl_version}_{compiler_version}.dmg"
return (
f"{base_url}/{armpl_version_dashed}/"
+ f"armpl_{armpl_version}_{compiler_version}.dmg"
)
else:
filename = f"arm-performance-libraries_{armpl_version}_macOS.dmg"
return f"{base_url}{armpl_version_dashed}/macos/{filename}"
return f"{base_url}/{armpl_version_dashed}/macos/{filename}"
filename = f"arm-performance-libraries_{armpl_version}_{os}_{compiler_version}.tar"
os_short = ""
if armpl_version.startswith("22.0."):
@ -257,11 +281,51 @@ def get_package_url(version):
os_short = os.split(".")[0].lower()
if "amazonlinux" in os_short:
os_short = os_short.replace("amazonlinux", "al")
return f"{base_url}{armpl_version_dashed}/{os_short}/{filename}"
return f"{base_url}/{armpl_version_dashed}/{os_short}/{filename}"
def get_package_url_from_24(base, version):
pkg_system = get_os_or_pkg_manager(version)
os = "macOS" if pkg_system == "macOS" else "linux"
extension = "tgz" if pkg_system == "macOS" else "tar"
full_name_library = f"arm-performance-libraries_{version}_{pkg_system}"
if pkg_system != "macOS":
full_name_library = f"{full_name_library}_gcc"
file_name = f"{full_name_library}.{extension}"
vn = version.replace(".", "-")
url_parts = f"{base}/{vn}/{os}/{file_name}"
return url_parts
def get_package_url(version):
base_url = "https://developer.arm.com/-/media/Files/downloads/hpc/arm-performance-libraries"
if version[:2] >= "24":
return get_package_url_from_24(base_url, version)
else:
return get_package_url_before_24(base_url, version)
def get_armpl_prefix(spec):
return os.path.join(spec.prefix, "armpl_" + spec.version.string)
armpl_dir = [
d
for d in os.listdir(spec.prefix)
if os.path.isdir(os.path.join(spec.prefix, d)) and d.startswith("armpl_")
][0]
return os.path.join(spec.prefix, armpl_dir)
def get_armpl_suffix(spec):
suffix = ""
if spec.satisfies("@24:"):
suffix += "_ilp64" if spec.satisfies("+ilp64") else "_lp64"
else:
suffix += "_ilp64" if spec.satisfies("+ilp64") else ""
suffix += "_mp" if spec.satisfies("threads=openmp") else ""
return suffix
class ArmplGcc(Package):
@ -269,12 +333,12 @@ class ArmplGcc(Package):
high-performance computing applications on Arm processors."""
homepage = "https://developer.arm.com/tools-and-software/server-and-hpc/downloads/arm-performance-libraries"
url = "https://developer.arm.com/-/media/Files/downloads/hpc/arm-performance-libraries/23-04-1/ubuntu-22/arm-performance-libraries_23.04.1_Ubuntu-22.04_gcc-12.2.tar"
url = "https://developer.arm.com/-/media/Files/downloads/hpc/arm-performance-libraries/24-04/linux/arm-performance-libraries_24.04_deb_gcc.tar"
maintainers("annop-w")
maintainers("paolotricerri")
for ver, packages in _versions.items():
key = get_os(ver)
key = get_os_or_pkg_manager(ver)
sha256sum = packages.get(key)
url = get_package_url(ver)
if sha256sum:
@ -341,10 +405,17 @@ def install(self, spec, prefix):
hdiutil = which("hdiutil")
# Mount image
mountpoint = os.path.join(self.stage.path, "mount")
hdiutil("attach", "-mountpoint", mountpoint, self.stage.archive_file)
if spec.satisfies("@:23"):
dmg_file = self.stage.archive_file
else:
# The archive file only extracts to one .dmg file
dmg_file = os.path.join(
self.stage.source_path, os.listdir(self.stage.source_path)[0]
)
hdiutil("attach", "-mountpoint", mountpoint, dmg_file)
try:
# Run installer
exe_name = f"armpl_{spec.version.string}_install.sh"
exe_name = [f for f in os.listdir(mountpoint) if f.endswith(".sh")][0]
installer = Executable(os.path.join(mountpoint, exe_name))
installer("-y", f"--install_dir={prefix}")
finally:
@ -359,15 +430,21 @@ def install(self, spec, prefix):
with when("@23:"):
armpl_version = spec.version.string.split("_")[0]
exe = Executable(f"./arm-performance-libraries_{armpl_version}_{get_os(armpl_version)}.sh")
if spec.satisfies("@:23"):
exe = Executable(
f"./arm-performance-libraries_{armpl_version}_"
+ f"{get_os_or_pkg_manager(armpl_version)}.sh"
)
else:
package_type = (
"deb" if spack.platforms.host().default_os.startswith("ubuntu") else "rpm"
)
exe = Executable(f"./arm-performance-libraries_{armpl_version}_{package_type}.sh")
exe("--accept", "--force", "--install-to", prefix)
@property
def lib_suffix(self):
suffix = ""
suffix += "_ilp64" if self.spec.satisfies("+ilp64") else ""
suffix += "_mp" if self.spec.satisfies("threads=openmp") else ""
return suffix
return get_armpl_suffix(self.spec)
@property
def blas_libs(self):
@ -403,7 +480,10 @@ def libs(self):
def headers(self):
armpl_dir = get_armpl_prefix(self.spec)
suffix = "include" + self.lib_suffix
if self.spec.satisfies("@24:"):
suffix = "include"
else:
suffix = "include" + self.lib_suffix
incdir = join_path(armpl_dir, suffix)
@ -421,7 +501,9 @@ def setup_run_environment(self, env):
@run_after("install")
def check_install(self):
armpl_dir = get_armpl_prefix(self.spec)
armpl_example_dir = join_path(armpl_dir, "examples")
suffix = get_armpl_suffix(self.spec)
armpl_example_dir = join_path(armpl_dir, f"examples{suffix}")
# run example makefile
if self.spec.platform == "darwin":
# Fortran examples on MacOS requires flang-new which is