summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAMD Toolchain Support <73240730+amd-toolchain-support@users.noreply.github.com>2023-08-25 06:35:39 +0530
committerGitHub <noreply@github.com>2023-08-24 18:05:39 -0700
commit91d674f5d09db78b893319ebedc10dbe469a11cc (patch)
tree56542cc4eaefba2349f461a9baca3b896bc1e489
parent76fbb8cd8f1ceecbc9eb36f5ee2d78f502660fda (diff)
downloadspack-91d674f5d09db78b893319ebedc10dbe469a11cc.tar.gz
spack-91d674f5d09db78b893319ebedc10dbe469a11cc.tar.bz2
spack-91d674f5d09db78b893319ebedc10dbe469a11cc.tar.xz
spack-91d674f5d09db78b893319ebedc10dbe469a11cc.zip
AOCL spack recipes for 4.1 release w. new AOCL-Utils library (#39489)
* AOCC and AOCL spack recipes for 4.1 release * Fix broken checksum * remove blank line * Add missing `@when` for 4.1 only function --------- Co-authored-by: vijay kallesh <Vijay-teekinavar.Kallesh@amd.com>
-rw-r--r--var/spack/repos/builtin/packages/amd-aocl/package.py14
-rw-r--r--var/spack/repos/builtin/packages/amdblis/package.py45
-rw-r--r--var/spack/repos/builtin/packages/amdfftw/package.py42
-rw-r--r--var/spack/repos/builtin/packages/amdlibflame/package.py48
-rw-r--r--var/spack/repos/builtin/packages/amdlibm/package.py25
-rw-r--r--var/spack/repos/builtin/packages/amdscalapack/package.py34
-rw-r--r--var/spack/repos/builtin/packages/aocl-sparse/package.py53
-rw-r--r--var/spack/repos/builtin/packages/aocl-utils/package.py64
8 files changed, 259 insertions, 66 deletions
diff --git a/var/spack/repos/builtin/packages/amd-aocl/package.py b/var/spack/repos/builtin/packages/amd-aocl/package.py
index 337162a375..a1fb1cb061 100644
--- a/var/spack/repos/builtin/packages/amd-aocl/package.py
+++ b/var/spack/repos/builtin/packages/amd-aocl/package.py
@@ -17,13 +17,14 @@ class AmdAocl(BundlePackage):
you agree to the terms and conditions of the AMD AOCL license agreement.
You may obtain a copy of this license agreement from
https://www.amd.com/en/developer/aocl/aocl-eula.html
- https://www.amd.com/en/developer/aocl/aocl-4-0-eula.html
+ https://www.amd.com/en/developer/aocl/eula/aocl-4-1-eula.html
"""
homepage = "https://developer.amd.com/amd-aocl/"
maintainers("amd-toolchain-support")
+ version("4.1")
version("4.0")
version("3.2")
version("3.1")
@@ -31,8 +32,7 @@ class AmdAocl(BundlePackage):
version("2.2")
variant("openmp", default=False, description="Enable OpenMP support.")
-
- for vers in ["2.2", "3.0", "3.1", "3.2", "4.0"]:
+ for vers in ["2.2", "3.0", "3.1", "3.2", "4.0", "4.1"]:
depends_on("amdblis@{0} threads=openmp".format(vers), when="@{0} +openmp".format(vers))
depends_on("amdblis@{0} threads=none".format(vers), when="@{0} ~openmp".format(vers))
depends_on("amdfftw@{0} +openmp".format(vers), when="@{0} +openmp".format(vers))
@@ -40,11 +40,13 @@ class AmdAocl(BundlePackage):
depends_on("amdlibflame@{0}".format(vers), when="@{0}".format(vers))
depends_on("amdlibm@{0}".format(vers), when="@{0}".format(vers))
depends_on(
- "amdscalapack@{0} ^amdblis@{0} threads=none".format(vers),
+ "amdscalapack@{0} ^amdblis@{0} ^amdlibflame@{0} threads=none".format(vers),
when="@{0} ~openmp".format(vers),
)
depends_on(
- "amdscalapack@{0} ^amdblis@{0} threads=openmp".format(vers),
+ "amdscalapack@{0} ^amdblis@{0} ^amdlibflame@{0} threads=openmp".format(vers),
when="@{0} +openmp".format(vers),
)
- depends_on("aocl-sparse@{0}".format(vers), when="@{0}".format(vers))
+ depends_on(
+ "aocl-sparse@{0} ^amdblis@{0} ^amdlibflame@{0}".format(vers), when="@{0}".format(vers)
+ )
diff --git a/var/spack/repos/builtin/packages/amdblis/package.py b/var/spack/repos/builtin/packages/amdblis/package.py
index 8f380bf3cf..5d8bb376f3 100644
--- a/var/spack/repos/builtin/packages/amdblis/package.py
+++ b/var/spack/repos/builtin/packages/amdblis/package.py
@@ -5,6 +5,8 @@
import os
+from llnl.util import tty
+
from spack.package import *
from spack.pkg.builtin.blis import BlisBase
@@ -21,17 +23,18 @@ class Amdblis(BlisBase):
LICENSING INFORMATION: By downloading, installing and using this software,
you agree to the terms and conditions of the AMD AOCL-BLIS license
agreement. You may obtain a copy of this license agreement from
- https://www.amd.com/en/developer/aocl/blis/blis-4-0-eula.html
- https://www.amd.com/en/developer/aocl/blis/blis-eula.html
+ https://www.amd.com/en/developer/aocl/dense/eula/blas-4-1-eula.html
+ https://www.amd.com/en/developer/aocl/dense/eula/blas-eula.html
"""
_name = "amdblis"
homepage = "https://www.amd.com/en/developer/aocl/blis.html"
url = "https://github.com/amd/blis/archive/3.0.tar.gz"
- git = "https://github.com/amd/blis.git"
+ git = "https://github.com/amd/blis"
maintainers("amd-toolchain-support")
+ version("4.1", sha256="a05c6c7d359232580d1d599696053ad0beeedf50f3b88d5d22ee7d34375ab577")
version("4.0", sha256="cddd31176834a932753ac0fc4c76332868feab3e9ac607fa197d8b44c1e74a41")
version("3.2", sha256="5a400ee4fc324e224e12f73cc37b915a00f92b400443b15ce3350278ad46fff6")
version("3.1", sha256="2891948925b9db99eec02a1917d9887a7bee9ad2afc5421c9ba58602a620f2bf")
@@ -40,15 +43,33 @@ class Amdblis(BlisBase):
version("2.2", sha256="e1feb60ac919cf6d233c43c424f6a8a11eab2c62c2c6e3f2652c15ee9063c0c9")
variant("ilp64", default=False, when="@3.0.1:", description="ILP64 support")
+ variant("aocl_gemm", default=False, when="@4.1:", description="aocl_gemm support")
variant("suphandling", default=True, description="Small Unpacked Kernel handling")
def configure_args(self):
spec = self.spec
args = super().configure_args()
+ if not (
+ spec.satisfies(r"%aocc@3.2:4.1")
+ or spec.satisfies(r"%gcc@12.2:13.1")
+ or spec.satisfies(r"%clang@15:16")
+ ):
+ tty.warn(
+ "AOCL has been tested to work with the following compilers\
+ versions - gcc@12.2:13.1, aocc@3.2:4.1, and clang@15:16\
+ see the following aocl userguide for details: \
+ https://www.amd.com/content/dam/amd/en/documents/developer/version-4-1-documents/aocl/aocl-4-1-user-guide.pdf"
+ )
+
if spec.satisfies("+ilp64"):
args.append("--blas-int-size=64")
+ if spec.satisfies("+aocl_gemm"):
+ args.append("-a aocl_gemm")
+ args.append("CC={0}".format(os.path.basename(spack_cc)))
+ args.append("CXX={0}".format(os.path.basename(spack_cxx)))
+
if spec.satisfies("+suphandling"):
args.append("--enable-sup-handling")
else:
@@ -56,29 +77,17 @@ class Amdblis(BlisBase):
# To enable Fortran to C calling convention for
# complex types when compiling with aocc flang
- if self.spec.satisfies("@3.0 %aocc"):
+ if spec.satisfies("@3.0 %aocc"):
args.append("CFLAGS={0}".format("-DAOCL_F2C"))
args.append("CXXFLAGS={0}".format("-DAOCL_F2C"))
- elif self.spec.satisfies("@3.0.1: %aocc"):
+ elif spec.satisfies("@3.0.1: %aocc"):
args.append("--complex-return=intel")
- if self.spec.satisfies("@3.1:"):
+ if spec.satisfies("@3.1:"):
args.append("--disable-aocl-dynamic")
return args
- def config_args(self):
- config_args = super().config_args()
-
- # "amdzen" - A fat binary or multiarchitecture binary
- # support for 3.1 release onwards
- if self.spec.satisfies("@3.1:"):
- config_args.append("amdzen")
- else:
- config_args.append("auto")
-
- return config_args
-
@run_after("install")
def create_symlink(self):
with working_dir(self.prefix.lib):
diff --git a/var/spack/repos/builtin/packages/amdfftw/package.py b/var/spack/repos/builtin/packages/amdfftw/package.py
index 06efab157a..475327e335 100644
--- a/var/spack/repos/builtin/packages/amdfftw/package.py
+++ b/var/spack/repos/builtin/packages/amdfftw/package.py
@@ -5,6 +5,8 @@
import os
+from llnl.util import tty
+
from spack.package import *
from spack.pkg.builtin.fftw import FftwBase
@@ -26,8 +28,8 @@ class Amdfftw(FftwBase):
LICENSING INFORMATION: By downloading, installing and using this software,
you agree to the terms and conditions of the AMD AOCL-FFTW license
agreement. You may obtain a copy of this license agreement from
- https://www.amd.com/en/developer/aocl/fftw/fftw-libraries-4-0-eula.html
- https://www.amd.com/en/developer/aocl/fftw/fftw-libraries-eula.html
+ https://www.amd.com/en/developer/aocl/fftw/eula/fftw-libraries-4-1-eula.html
+ https://www.amd.com/en/developer/aocl/fftw/eula/fftw-libraries-eula.html
"""
_name = "amdfftw"
@@ -37,6 +39,7 @@ class Amdfftw(FftwBase):
maintainers("amd-toolchain-support")
+ version("4.1", sha256="f1cfecfcc0729f96a5bd61c6b26f3fa43bb0662d3fff370d4f73490c60cf4e59")
version("4.0", sha256="5f02cb05f224bd86bd88ec6272b294c26dba3b1d22c7fb298745fd7b9d2271c0")
version("3.2", sha256="31cab17a93e03b5b606e88dd6116a1055b8f49542d7d0890dbfcca057087b8d0")
version("3.1", sha256="3e777f3acef13fa1910db097e818b1d0d03a6a36ef41186247c6ab1ab0afc132")
@@ -83,8 +86,15 @@ class Amdfftw(FftwBase):
)
variant(
"amd-dynamic-dispatcher",
- default=False,
- when="@3.2:",
+ default=True,
+ when="@4.1: %aocc@4.1.0:",
+ description="Single portable optimized library"
+ " to execute on different x86 CPU architectures",
+ )
+ variant(
+ "amd-dynamic-dispatcher",
+ default=True,
+ when="@3.2: %gcc",
description="Single portable optimized library"
" to execute on different x86 CPU architectures",
)
@@ -135,12 +145,6 @@ class Amdfftw(FftwBase):
)
conflicts("precision=quad", msg="Quad precision is not supported with amd-app-opt")
- conflicts(
- "+amd-dynamic-dispatcher",
- when="%aocc",
- msg="dynamic-dispatcher is not supported by AOCC clang compiler",
- )
-
def configure(self, spec, prefix):
"""Configure function"""
# Base options
@@ -149,7 +153,7 @@ class Amdfftw(FftwBase):
# Dynamic dispatcher builds a single portable optimized library
# that can execute on different x86 CPU architectures.
# It is supported for GCC compiler and Linux based systems only.
- if "+amd-dynamic-dispatcher" in self.spec:
+ if "+amd-dynamic-dispatcher" in spec:
options.append("--enable-dynamic-dispatcher")
# Check if compiler is AOCC
@@ -158,6 +162,18 @@ class Amdfftw(FftwBase):
options.append("FC={0}".format(os.path.basename(spack_fc)))
options.append("F77={0}".format(os.path.basename(spack_fc)))
+ if not (
+ spec.satisfies(r"%aocc@3.2:4.1")
+ or spec.satisfies(r"%gcc@12.2:13.1")
+ or spec.satisfies(r"%clang@15:16")
+ ):
+ tty.warn(
+ "AOCL has been tested to work with the following compilers\
+ versions - gcc@12.2:13.1, aocc@3.2:4.1, and clang@15:16\
+ see the following aocl userguide for details: \
+ https://www.amd.com/content/dam/amd/en/documents/developer/version-4-1-documents/aocl/aocl-4-1-user-guide.pdf"
+ )
+
if "+debug" in spec:
options.append("--enable-debug")
@@ -194,6 +210,10 @@ class Amdfftw(FftwBase):
# float and double precisions are supported
simd_features = ["sse2", "avx", "avx2", "avx512"]
+ # "avx512" is supported from amdfftw 4.0 version onwards
+ if "@2.2:3.2" in self.spec:
+ simd_features.remove("avx512")
+
simd_options = []
for feature in simd_features:
msg = "--enable-{0}" if feature in spec.target else "--disable-{0}"
diff --git a/var/spack/repos/builtin/packages/amdlibflame/package.py b/var/spack/repos/builtin/packages/amdlibflame/package.py
index 571fd9babf..ca9d73813e 100644
--- a/var/spack/repos/builtin/packages/amdlibflame/package.py
+++ b/var/spack/repos/builtin/packages/amdlibflame/package.py
@@ -3,6 +3,9 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
# ----------------------------------------------------------------------------\
+import os
+
+from llnl.util import tty
from spack.package import *
from spack.pkg.builtin.libflame import LibflameBase
@@ -33,17 +36,18 @@ class Amdlibflame(LibflameBase):
LICENSING INFORMATION: By downloading, installing and using this software,
you agree to the terms and conditions of the AMD AOCL-libFLAME license
agreement. You may obtain a copy of this license agreement from
- https://www.amd.com/en/developer/aocl/blis/libflame-4-0-eula.html
- https://www.amd.com/en/developer/aocl/blis/libflame-eula.html
+ https://www.amd.com/en/developer/aocl/dense/eula-libflame/libflame-4-1-eula.html
+ https://www.amd.com/en/developer/aocl/dense/eula-libflame/libflame-eula.html
"""
_name = "amdlibflame"
homepage = "https://www.amd.com/en/developer/aocl/blis.html#libflame"
url = "https://github.com/amd/libflame/archive/3.0.tar.gz"
- git = "https://github.com/amd/libflame.git"
+ git = "https://github.com/amd/amdlibflame"
maintainers("amd-toolchain-support")
+ version("4.1", sha256="8aed69c60d11cc17e058cabcb8a931cee4f343064ade3e73d3392b7214624b61")
version("4.0", sha256="bcb05763aa1df1e88f0da5e43ff86d956826cbea1d9c5ff591d78a3e091c66a4")
version("3.2", sha256="6b5337fb668b82d0ed0a4ab4b5af4e2f72e4cedbeeb4a8b6eb9a3ef057fb749a")
version("3.1", sha256="4520fb93fcc89161f65a40810cae0fa1f87cecb242da4a69655f502545a53426")
@@ -64,17 +68,39 @@ class Amdlibflame(LibflameBase):
depends_on("python+pythoncmd", type="build")
depends_on("gmake@4:", when="@3.0.1,3.1:", type="build")
+ depends_on("aocl-utils", type=("build"), when="@4.1: ")
@property
def lapack_libs(self):
"""find lapack_libs function"""
- shared = True if "+shared" in self.spec else False
- return find_libraries("libflame", root=self.prefix, shared=shared, recursive=True)
+ return find_libraries(
+ "libflame", root=self.prefix, shared="+shared" in self.spec, recursive=True
+ )
+
+ def flag_handler(self, name, flags):
+ if name == "cflags":
+ if self.spec.satisfies("%clang@16:") or self.spec.satisfies("%aocc@4.1.0:"):
+ flags.append("-Wno-error=incompatible-function-pointer-types")
+ flags.append("-Wno-implicit-function-declaration")
+ flags.append("-Wno-sometimes-uninitialized")
+ return (flags, None, None)
def configure_args(self):
"""configure_args function"""
args = super().configure_args()
+ if not (
+ self.spec.satisfies(r"%aocc@3.2:4.1")
+ or self.spec.satisfies(r"%gcc@12.2:13.1")
+ or self.spec.satisfies(r"%clang@15:16")
+ ):
+ tty.warn(
+ "AOCL has been tested to work with the following compilers\
+ versions - gcc@12.2:13.1, aocc@3.2:4.1, and clang@15:16\
+ see the following aocl userguide for details: \
+ https://www.amd.com/content/dam/amd/en/documents/developer/version-4-1-documents/aocl/aocl-4-1-user-guide.pdf"
+ )
+
# From 3.2 version, amd optimized flags are encapsulated under:
# enable-amd-flags for gcc compiler
# enable-amd-aocc-flags for aocc compiler
@@ -101,8 +127,20 @@ class Amdlibflame(LibflameBase):
if "@3.0.1: +ilp64" in self.spec:
args.append("--enable-ilp64")
+ if "@4.1:" in self.spec:
+ args.append("CFLAGS=-I{0}".format(self.spec["aocl-utils"].prefix.include))
+ aocl_utils_lib_path = os.path.join(
+ self.spec["aocl-utils"].prefix.lib, "libaoclutils.a"
+ )
+ args.append("LIBAOCLUTILS_LIBRARY_PATH={0}".format(aocl_utils_lib_path))
+
return args
+ @when("@4.1:")
+ def build(self, spec, prefix):
+ aocl_utils_lib_path = os.path.join(self.spec["aocl-utils"].prefix.lib, "libaoclutils.a")
+ make("all", "LIBAOCLUTILS_LIBRARY_PATH={0}".format(aocl_utils_lib_path))
+
@run_after("build")
@on_package_attributes(run_tests=True)
def check(self):
diff --git a/var/spack/repos/builtin/packages/amdlibm/package.py b/var/spack/repos/builtin/packages/amdlibm/package.py
index 30bf0708ae..9a988b4962 100644
--- a/var/spack/repos/builtin/packages/amdlibm/package.py
+++ b/var/spack/repos/builtin/packages/amdlibm/package.py
@@ -5,6 +5,8 @@
import os
+from llnl.util import tty
+
from spack.package import *
@@ -19,7 +21,7 @@ class Amdlibm(SConsPackage):
LICENSING INFORMATION: By downloading, installing and using this software,
you agree to the terms and conditions of the AMD AOCL-FFTW license
agreement. You may obtain a copy of this license agreement from
- https://www.amd.com/en/developer/aocl/libm/libm-4-0-eula.html
+ https://www.amd.com/en/developer/aocl/libm/eula/libm-4-1-eula.html
https://www.amd.com/en/developer/aocl/libm/libm-eula.html
"""
@@ -29,6 +31,7 @@ class Amdlibm(SConsPackage):
url = "https://github.com/amd/aocl-libm-ose/archive/refs/tags/3.0.tar.gz"
maintainers("amd-toolchain-support")
+ version("4.1", sha256="5bbbbc6bc721d9a775822eab60fbc11eb245e77d9f105b4fcb26a54d01456122")
version("4.0", sha256="038c1eab544be77598eccda791b26553d3b9e2ee4ab3f5ad85fdd2a77d015a7d")
version("3.2", sha256="c75b287c38a3ce997066af1f5c8d2b19fc460d5e56678ea81f3ac33eb79ec890")
version("3.1", sha256="dee487cc2d89c2dc93508be2c67592670ffc1d02776c017e8907317003f48845")
@@ -40,20 +43,36 @@ class Amdlibm(SConsPackage):
# Mandatory dependencies
depends_on("python@3.6.1:", type=("build", "run"))
depends_on("scons@3.1.2:", type=("build"))
+ depends_on("aocl-utils", type=("build"), when="@4.1: ")
depends_on("mpfr", type=("link"))
patch("0001-libm-ose-Scripts-cleanup-pyc-files.patch", when="@2.2")
patch("0002-libm-ose-prevent-log-v3.c-from-building.patch", when="@2.2")
conflicts("%gcc@:9.1.0", msg="Minimum supported GCC version is 9.2.0")
- conflicts("%gcc@12.2.0:", msg="Maximum supported GCC version is 12.1.0")
- conflicts("%clang@9:", msg="Minimum supported Clang version is 9.0.0")
+ conflicts("%gcc@13.2.0:", msg="Maximum supported GCC version is 13.1.0")
+ conflicts("%clang@9.0:16.0", msg="supported Clang version is from 9 to 16")
conflicts("%aocc@3.2.0", msg="dependency on python@3.6.2")
def build_args(self, spec, prefix):
"""Setting build arguments for amdlibm"""
args = ["--prefix={0}".format(prefix)]
+ if self.spec.satisfies("@4.1: "):
+ args.append("--aocl_utils_install_path={0}".format(self.spec["aocl-utils"].prefix))
+
+ if not (
+ self.spec.satisfies(r"%aocc@3.2:4.1")
+ or self.spec.satisfies(r"%gcc@12.2:13.1")
+ or self.spec.satisfies(r"%clang@15:16")
+ ):
+ tty.warn(
+ "AOCL has been tested to work with the following compilers\
+ versions - gcc@12.2:13.1, aocc@3.2:4.1, and clang@15:16\
+ see the following aocl userguide for details: \
+ https://www.amd.com/content/dam/amd/en/documents/developer/version-4-1-documents/aocl/aocl-4-1-user-guide.pdf"
+ )
+
# we are circumventing the use of
# Spacks compiler wrappers because
# SCons wipes out all environment variables.
diff --git a/var/spack/repos/builtin/packages/amdscalapack/package.py b/var/spack/repos/builtin/packages/amdscalapack/package.py
index 3da1a8a03b..0213da5c97 100644
--- a/var/spack/repos/builtin/packages/amdscalapack/package.py
+++ b/var/spack/repos/builtin/packages/amdscalapack/package.py
@@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+from llnl.util import tty
+
from spack.package import *
from spack.pkg.builtin.netlib_scalapack import ScalapackBase
@@ -20,16 +22,17 @@ class Amdscalapack(ScalapackBase):
LICENSING INFORMATION: By downloading, installing and using this software,
you agree to the terms and conditions of the AMD AOCL-ScaLAPACK license
agreement. You may obtain a copy of this license agreement from
- https://www.amd.com/en/developer/aocl/scalapack/scalapack-libraries-4-0-eula.html
- https://www.amd.com/en/developer/aocl/scalapack/scalapack-libraries-eula.html
+ https://www.amd.com/en/developer/aocl/scalapack/eula/scalapack-libraries-4-1-eula.html
+ https://www.amd.com/en/developer/aocl/scalapack/eula/scalapack-libraries-eula.html
"""
_name = "amdscalapack"
homepage = "https://www.amd.com/en/developer/aocl/scalapack.html"
- git = "https://github.com/amd/scalapack.git"
+ git = "https://github.com/amd/aocl-scalapack"
maintainers("amd-toolchain-support")
+ version("4.1", sha256="b2e51c3604e5869d1faaef2e52c92071fcb3de1345aebb2ea172206622067ad9")
version("4.0", sha256="f02913b5984597b22cdb9a36198ed61039a1bf130308e778dc31b2a7eb88b33b")
version("3.2", sha256="9e00979bb1be39d627bdacb01774bc043029840d542fafc934d16fec3e3b0892")
version("3.1", sha256="4c2ee2c44644a0feec0c6fc1b1a413fa9028f14d7035d43a398f5afcfdbacb98")
@@ -52,9 +55,24 @@ class Amdscalapack(ScalapackBase):
args = super().cmake_args()
spec = self.spec
+ if not (
+ spec.satisfies(r"%aocc@3.2:4.1")
+ or spec.satisfies(r"%gcc@12.2:13.1")
+ or spec.satisfies(r"%clang@15:16")
+ ):
+ tty.warn(
+ "AOCL has been tested to work with the following compilers\
+ versions - gcc@12.2:13.1, aocc@3.2:4.1, and clang@15:16\
+ see the following aocl userguide for details: \
+ https://www.amd.com/content/dam/amd/en/documents/developer/version-4-1-documents/aocl/aocl-4-1-user-guide.pdf"
+ )
+
if spec.satisfies("%gcc@10:"):
args.extend(["-DCMAKE_Fortran_FLAGS={0}".format("-fallow-argument-mismatch")])
+ if spec.satisfies("%clang@16:"):
+ args.extend(["-DCMAKE_Fortran_FLAGS={0}".format("-cpp -fno-implicit-none")])
+
if spec.satisfies("@2.2"):
args.extend(
[
@@ -69,6 +87,16 @@ class Amdscalapack(ScalapackBase):
# -DUSE_F2C:BOOL=ON
args.extend([self.define("USE_F2C", spec.satisfies("@:3.0"))])
+ if self.spec.satisfies("%clang@16:") or self.spec.satisfies("%aocc@4.1.0:"):
+ c_flags = []
+ c_flags.append("-Wno-implicit-function-declaration")
+ c_flags.append("-Wno-deprecated-non-prototype")
+ c_flags.append("-Wno-incompatible-pointer-types")
+ args.append(self.define("CMAKE_C_FLAGS", " ".join(c_flags)))
+
+ # link libflame library
+ args.extend(["-DLAPACK_LIBRARIES={0}".format(self.spec["lapack"].libs)])
+
args.extend(
[
"-DLAPACK_FOUND=true",
diff --git a/var/spack/repos/builtin/packages/aocl-sparse/package.py b/var/spack/repos/builtin/packages/aocl-sparse/package.py
index 365f6b47be..da993c57dd 100644
--- a/var/spack/repos/builtin/packages/aocl-sparse/package.py
+++ b/var/spack/repos/builtin/packages/aocl-sparse/package.py
@@ -5,6 +5,8 @@
import os
+from llnl.util import tty
+
from spack.package import *
@@ -17,29 +19,24 @@ class AoclSparse(CMakePackage):
LICENSING INFORMATION: By downloading, installing and using this software,
you agree to the terms and conditions of the AMD AOCL-Sparse license agreement.
You may obtain a copy of this license agreement from
- https://www.amd.com/en/developer/aocl/sparse/sparse-libraries-4-0-eula.html
- https://www.amd.com/en/developer/aocl/sparse/sparse-libraries-eula.html
+ https://www.amd.com/en/developer/aocl/sparse/eula/sparse-libraries-4-1-eula.html
+ https://www.amd.com/en/developer/aocl/sparse/eula/sparse-libraries-eula.html
"""
_name = "aocl-sparse"
homepage = "https://www.amd.com/en/developer/aocl/sparse.html"
url = "https://github.com/amd/aocl-sparse/archive/3.0.tar.gz"
- git = "https://github.com/amd/aocl-sparse.git"
+ git = "https://github.com/amd/aocl-sparse"
maintainers("amd-toolchain-support")
+ version("4.1", sha256="35ef437210bc25fdd802b462eaca830bfd928f962569b91b592f2866033ef2bb")
version("4.0", sha256="68524e441fdc7bb923333b98151005bed39154d9f4b5e8310b5c37de1d69c2c3")
version("3.2", sha256="db7d681a8697d6ef49acf3e97e8bec35b048ce0ad74549c3b738bbdff496618f")
version("3.1", sha256="8536f06095c95074d4297a3d2910654085dd91bce82e116c10368a9f87e9c7b9")
version("3.0", sha256="1d04ba16e04c065051af916b1ed9afce50296edfa9b1513211a7378e1d6b952e")
version("2.2", sha256="33c2ed6622cda61d2613ee63ff12c116a6cd209c62e54307b8fde986cd65f664")
- variant(
- "build_type",
- default="Release",
- description="CMake build type",
- values=("Debug", "Release"),
- )
variant("shared", default=True, description="Build shared library")
variant("ilp64", default=False, description="Build with ILP64 support")
variant("examples", default=False, description="Build sparse examples")
@@ -52,9 +49,11 @@ class AoclSparse(CMakePackage):
description="Enable experimental AVX512 support",
)
+ depends_on("amdblis", when="@4.1:")
+ depends_on("amdlibflame", when="@4.1:")
depends_on("boost", when="+benchmarks")
depends_on("boost", when="@2.2")
- depends_on("cmake@3.5:", type="build")
+ depends_on("cmake@3.11:", type="build")
@property
def build_directory(self):
@@ -76,17 +75,19 @@ class AoclSparse(CMakePackage):
"""Runs ``cmake`` in the build directory"""
spec = self.spec
- args = [
- "../..",
- "-DCMAKE_INSTALL_PREFIX:PATH={0}".format(spec.prefix),
- "-DCMAKE_CXX_COMPILER={0}".format(os.path.basename(spack_cxx)),
- ]
-
- if spec.variants["build_type"].value == "Debug":
- args.append("-DCMAKE_BUILD_TYPE=Debug")
- else:
- args.append("-DCMAKE_BUILD_TYPE=Release")
+ if not (
+ spec.satisfies(r"%aocc@3.2:4.1")
+ or spec.satisfies(r"%gcc@12.2:13.1")
+ or spec.satisfies(r"%clang@15:16")
+ ):
+ tty.warn(
+ "AOCL has been tested to work with the following compilers\
+ versions - gcc@12.2:13.1, aocc@3.2:4.1, and clang@15:16\
+ see the following aocl userguide for details: \
+ https://www.amd.com/content/dam/amd/en/documents/developer/version-4-1-documents/aocl/aocl-4-1-user-guide.pdf"
+ )
+ args = []
args.append(self.define_from_variant("BUILD_SHARED_LIBS", "shared"))
args.append(self.define_from_variant("BUILD_CLIENTS_SAMPLES", "examples"))
args.append(self.define_from_variant("BUILD_CLIENTS_TESTS", "unit_tests"))
@@ -96,6 +97,18 @@ class AoclSparse(CMakePackage):
if spec.satisfies("@3.0:"):
args.append(self.define_from_variant("BUILD_ILP64", "ilp64"))
+ if self.spec.satisfies("@4.0:"):
+ args.append("-DAOCL_BLIS_LIB={0}/libblis.so".format(self.spec["amdblis"].prefix.lib))
+ args.append(
+ "-DAOCL_BLIS_INCLUDE_DIR={0}/blis".format(self.spec["amdblis"].prefix.include)
+ )
+ args.append(
+ "-DAOCL_LIBFLAME={0}/libflame.so".format(self.spec["amdlibflame"].prefix.lib)
+ )
+ args.append(
+ "-DAOCL_LIBFLAME_INCLUDE_DIR={0}".format(self.spec["amdlibflame"].prefix.include)
+ )
+
return args
@run_after("build")
diff --git a/var/spack/repos/builtin/packages/aocl-utils/package.py b/var/spack/repos/builtin/packages/aocl-utils/package.py
new file mode 100644
index 0000000000..cc0e8ff4d6
--- /dev/null
+++ b/var/spack/repos/builtin/packages/aocl-utils/package.py
@@ -0,0 +1,64 @@
+# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+from llnl.util import tty
+
+from spack.package import *
+
+
+class AoclUtils(CMakePackage):
+ """The library AOCL-Utils is intended to provide a uniform interface to all
+ AOCL libraries to access CPU features, especially for AMD CPUs. The library
+ provides the following features:
+ * Core details
+ * Flags available/usable
+ * ISA available/usable
+ * Topology about L1/L2/L3
+ AOCL-Utils is designed to be integrated into other AMD AOCL libraries. Each
+ project has their own mechanism to identify CPU and provide necessary
+ features such as "dynamic dispatch".The main purpose of this library is to
+ provide a centralized mechanism to update/validate and provide information
+ to the users of this library.
+
+ LICENSING INFORMATION: By downloading, installing and using this software,
+ you agree to the terms and conditions of the AMD AOCL-Utils license
+ agreement. You may obtain a copy of this license agreement from
+ https://www.amd.com/en/developer/aocl/utils/utils-eula/utils-eula-4-1.html
+ """
+
+ _name = "aocl-utils"
+ homepage = "https://www.amd.com/en/developer/aocl/utils.html"
+ url = "https://github.com/amd/aocl-utils/archive/refs/tags/4.1.tar.gz"
+ git = "https://github.com/amd/aocl-utils"
+
+ maintainers("amd-toolchain-support")
+
+ version("4.1", sha256="a2f271f5eef07da366dae421af3c89286ebb6239047a31a46451758d4a06bc85")
+
+ variant("doc", default=False, description="enable documentation")
+ variant("tests", default=False, description="enable testing")
+ variant("examples", default=False, description="enable examples")
+
+ depends_on("doxygen", when="+doc")
+
+ def cmake_args(self):
+ if not (
+ self.spec.satisfies(r"%aocc@3.2:4.1")
+ or self.spec.satisfies(r"%gcc@12.2:13.1")
+ or self.spec.satisfies(r"%clang@15:16")
+ ):
+ tty.warn(
+ "AOCL has been tested to work with the following compilers\
+ versions - gcc@12.2:13.1, aocc@3.2:4.1, and clang@15:16\
+ see the following aocl userguide for details: \
+ https://www.amd.com/content/dam/amd/en/documents/developer/version-4-1-documents/aocl/aocl-4-1-user-guide.pdf"
+ )
+
+ args = []
+ args.append(self.define_from_variant("ALCI_DOCS", "doc"))
+ args.append(self.define_from_variant("ALCI_TESTS", "tests"))
+ args.append(self.define_from_variant("ALCI_EXAMPLES", "examples"))
+
+ return args