2023-01-19 06:30:17 +08:00
|
|
|
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
2020-08-21 03:55:02 +08:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
2022-06-17 15:34:49 +08:00
|
|
|
import re
|
|
|
|
|
2022-05-29 00:55:44 +08:00
|
|
|
from spack.package import *
|
2020-08-21 03:55:02 +08:00
|
|
|
|
|
|
|
|
2023-04-04 02:28:24 +08:00
|
|
|
class Hipsparse(CMakePackage, CudaPackage, ROCmPackage):
|
2020-08-21 03:55:02 +08:00
|
|
|
"""hipSPARSE is a SPARSE marshalling library, with
|
|
|
|
multiple supported backends"""
|
|
|
|
|
|
|
|
homepage = "https://github.com/ROCmSoftwarePlatform/hipSPARSE"
|
|
|
|
git = "https://github.com/ROCmSoftwarePlatform/hipSPARSE.git"
|
2023-02-16 17:14:31 +08:00
|
|
|
url = "https://github.com/ROCmSoftwarePlatform/hipSPARSE/archive/rocm-5.4.3.tar.gz"
|
2022-06-24 00:10:01 +08:00
|
|
|
tags = ["rocm"]
|
2022-07-31 06:19:18 +08:00
|
|
|
|
2023-02-02 13:07:25 +08:00
|
|
|
maintainers("cgmb", "srekolam", "renjithravindrankannath", "haampie")
|
2022-06-17 15:34:49 +08:00
|
|
|
libraries = ["libhipsparse"]
|
2022-07-31 06:19:18 +08:00
|
|
|
|
2023-02-16 17:14:31 +08:00
|
|
|
version("5.4.3", sha256="b373eccd03679a13fab4e740fc780da25cbd598abca3a1e5e3613ae14954f9db")
|
2023-02-07 07:00:10 +08:00
|
|
|
version("5.4.0", sha256="47420d38483c8124813b744971e428a0352c83d9b62a5a50f74ffa8f9b785b20")
|
2023-01-12 01:47:27 +08:00
|
|
|
version("5.3.3", sha256="d96d0e47594ab12e8c380da2300704c105736a0771940d7d2fae666f2869e457")
|
2022-12-13 03:46:20 +08:00
|
|
|
version("5.3.0", sha256="691b32b916952ed9af008aa29f60cc190322b73cfc098bb2eda3ff68c89c7b35")
|
2022-09-22 05:40:40 +08:00
|
|
|
version("5.2.3", sha256="f70d3deff13188adc4105ef3ead53510e4b54075b9ffcfe3d3355d90d4b6eadd")
|
2022-09-20 11:13:38 +08:00
|
|
|
version("5.2.1", sha256="7b8e4ff264285ae5aabb3c5c2b38bf28f90b2af44efb0398fcf13ffc24bc000a")
|
2022-08-12 15:20:47 +08:00
|
|
|
version("5.2.0", sha256="4fdab6ec953c6d2d000687c5979077deafd37208cd722554b5a6ede1e5ba170c")
|
2022-06-02 01:57:10 +08:00
|
|
|
version("5.1.3", sha256="6e6a0752654f0d391533df8cedf4b630a78ad34c99087741520c582963ce1602")
|
2022-05-10 23:42:22 +08:00
|
|
|
version("5.1.0", sha256="f41329534f2ff477a0db6b7f77a72bb062f117800970c122d676db8b207ce80b")
|
2022-12-06 02:47:45 +08:00
|
|
|
version(
|
|
|
|
"5.0.2",
|
|
|
|
sha256="a266e8b3bbdea04617260f51b3d85cc672af6ca417cae0812d04fd9702429c47",
|
|
|
|
deprecated=True,
|
|
|
|
)
|
|
|
|
version(
|
|
|
|
"5.0.0",
|
|
|
|
sha256="0a1754508e06d3a6b17593a71a3c57a3e25d3b46d88573098fda11442853196c",
|
|
|
|
deprecated=True,
|
|
|
|
)
|
|
|
|
version(
|
|
|
|
"4.5.2",
|
|
|
|
sha256="81ca24491fbf2bc8e5aa477a6c38776877579ac9f4241ddadeca76a579a7ebb5",
|
|
|
|
deprecated=True,
|
|
|
|
)
|
|
|
|
version(
|
|
|
|
"4.5.0",
|
|
|
|
sha256="1049c490fc2008d701a16d14e11004e3bc5b4da993aa48b117e3c44be5677e3c",
|
|
|
|
deprecated=True,
|
|
|
|
)
|
2022-05-18 05:11:32 +08:00
|
|
|
version(
|
|
|
|
"4.3.1",
|
|
|
|
sha256="e5757b5213b880237ae0f24616088f79c449c2955cf2133642dbbc9c655f4691",
|
|
|
|
deprecated=True,
|
|
|
|
)
|
|
|
|
version(
|
|
|
|
"4.3.0",
|
|
|
|
sha256="194fbd589ce34471f3255f71ea5fca2d27bee47a464558a86d0713b4d26237ea",
|
|
|
|
deprecated=True,
|
|
|
|
)
|
|
|
|
version(
|
|
|
|
"4.2.0",
|
|
|
|
sha256="cdedf3766c10200d3ebabe86cbb9c0fe6504e4b3317dccca289327d7c189bb3f",
|
2022-01-17 20:08:24 +08:00
|
|
|
deprecated=True,
|
|
|
|
)
|
|
|
|
version(
|
|
|
|
"4.1.0",
|
|
|
|
sha256="66710c390489922f0bd1ac38fd8c32fcfb5b7760b92c2d282f7d1abf214742ee",
|
|
|
|
deprecated=True,
|
|
|
|
)
|
|
|
|
version(
|
|
|
|
"4.0.0",
|
|
|
|
sha256="fc3736b2ea203209021616b2ffbcdd664781d692b07b8e8bb7f78b42dabbd5e5",
|
|
|
|
deprecated=True,
|
|
|
|
)
|
|
|
|
version(
|
|
|
|
"3.10.0",
|
|
|
|
sha256="7fd863ebf6eed09325c23ba06d9008b2f2c1345283d1a331e329e1a512b602f7",
|
|
|
|
deprecated=True,
|
|
|
|
)
|
|
|
|
version(
|
|
|
|
"3.9.0",
|
|
|
|
sha256="ab0ea3dd9b68a126291ed5a35e50fc85d0aeb35fe862f5d9e544435e4262c435",
|
|
|
|
deprecated=True,
|
|
|
|
)
|
|
|
|
version(
|
|
|
|
"3.8.0",
|
|
|
|
sha256="8874c100e9ba54587a6057c2a0e555a0903254a16e9e01c2385bae1b027f83b5",
|
|
|
|
deprecated=True,
|
|
|
|
)
|
|
|
|
version(
|
|
|
|
"3.7.0",
|
|
|
|
sha256="a2f02d8fc6ad9a561f06dacde54ecafd30563c5c95f93819a5694e5b650dad7f",
|
|
|
|
deprecated=True,
|
|
|
|
)
|
|
|
|
version(
|
|
|
|
"3.5.0",
|
|
|
|
sha256="fa16b2a307a5d9716066c2876febcbc1cef855bf0c96d235d2d8f2206a0fb69d",
|
2021-10-27 03:18:38 +08:00
|
|
|
deprecated=True,
|
|
|
|
)
|
2022-07-31 06:19:18 +08:00
|
|
|
|
2023-04-04 02:28:24 +08:00
|
|
|
# default to an 'auto' variant until amdgpu_targets can be given a better default than 'none'
|
|
|
|
amdgpu_targets = ROCmPackage.amdgpu_targets
|
|
|
|
variant(
|
|
|
|
"amdgpu_target",
|
|
|
|
values=spack.variant.DisjointSetsOfValues(("auto",), ("none",), amdgpu_targets)
|
|
|
|
.with_default("auto")
|
|
|
|
.with_error(
|
|
|
|
"the values 'auto' and 'none' are mutually exclusive with any of the other values"
|
|
|
|
)
|
|
|
|
.with_non_feature_values("auto", "none"),
|
|
|
|
sticky=True,
|
|
|
|
)
|
|
|
|
variant("rocm", default=True, description="Enable ROCm support")
|
|
|
|
conflicts("+cuda +rocm", msg="CUDA and ROCm support are mutually exclusive")
|
|
|
|
conflicts("~cuda ~rocm", msg="CUDA or ROCm support is required")
|
|
|
|
|
|
|
|
depends_on("hip +cuda", when="+cuda")
|
|
|
|
|
rocmlibs: relax rocm-cmake version requirements (#29857)
* rocmlibs: relax rocm-cmake version requirements
The rocm-cmake modules tend to be backwards-compatible, to the extent
that most ROCm math libraries were built using rocm-cmake@master
for a long while without anybody noticing. (That was fixed in
97f0c3ccd9f0a40896998a7580150a514ec3bc37.)
Some packages, like comgr, barely use rocm-cmake for anything, and
we can easily set a very minimal version requirement. For most
packages, however, it would be a lot of effort to determine the
minimum rocm-cmake version required for each release. For those
packages, I just turned the exact version requirement into a
minimum version requirement.
Since I was looking through the CMakeLists.txt for a large number of
libraries, I also took note of the cmake_minimum_required and adjusted
the cmake minimum requirements to match.
* Add rocblas build dependency to hipblas
The rocblas library is required both for both building and linking
hipblas.
* Remove rocm-cmake from vtk-m dependency list
The rocm-cmake package provides CMake scripts that facilitate common
build configuration tasks in the ROCm libraries. It is never needed at
link-time. Also, there are no calls to find_package(ROCM) or
include(ROCM.*)in vtk-m, so this dependency will never be used.
2022-04-19 21:26:40 +08:00
|
|
|
depends_on("cmake@3.5:", type="build")
|
2020-08-21 03:55:02 +08:00
|
|
|
depends_on("git", type="build")
|
2022-07-31 06:19:18 +08:00
|
|
|
|
2021-05-20 18:55:16 +08:00
|
|
|
for ver in [
|
|
|
|
"3.5.0",
|
|
|
|
"3.7.0",
|
|
|
|
"3.8.0",
|
|
|
|
"3.9.0",
|
|
|
|
"3.10.0",
|
|
|
|
"4.0.0",
|
|
|
|
"4.1.0",
|
2022-03-26 01:56:52 +08:00
|
|
|
"4.2.0",
|
|
|
|
"4.3.0",
|
|
|
|
"4.3.1",
|
|
|
|
"4.5.0",
|
|
|
|
"4.5.2",
|
|
|
|
"5.0.0",
|
2022-06-02 01:57:10 +08:00
|
|
|
"5.0.2",
|
|
|
|
"5.1.0",
|
|
|
|
"5.1.3",
|
2022-08-12 15:20:47 +08:00
|
|
|
"5.2.0",
|
2022-09-20 11:13:38 +08:00
|
|
|
"5.2.1",
|
2022-09-22 05:40:40 +08:00
|
|
|
"5.2.3",
|
2022-12-13 03:46:20 +08:00
|
|
|
"5.3.0",
|
2023-01-12 01:47:27 +08:00
|
|
|
"5.3.3",
|
2023-02-07 07:00:10 +08:00
|
|
|
"5.4.0",
|
2023-02-16 17:14:31 +08:00
|
|
|
"5.4.3",
|
2022-06-02 01:57:10 +08:00
|
|
|
]:
|
rocmlibs: relax rocm-cmake version requirements (#29857)
* rocmlibs: relax rocm-cmake version requirements
The rocm-cmake modules tend to be backwards-compatible, to the extent
that most ROCm math libraries were built using rocm-cmake@master
for a long while without anybody noticing. (That was fixed in
97f0c3ccd9f0a40896998a7580150a514ec3bc37.)
Some packages, like comgr, barely use rocm-cmake for anything, and
we can easily set a very minimal version requirement. For most
packages, however, it would be a lot of effort to determine the
minimum rocm-cmake version required for each release. For those
packages, I just turned the exact version requirement into a
minimum version requirement.
Since I was looking through the CMakeLists.txt for a large number of
libraries, I also took note of the cmake_minimum_required and adjusted
the cmake minimum requirements to match.
* Add rocblas build dependency to hipblas
The rocblas library is required both for both building and linking
hipblas.
* Remove rocm-cmake from vtk-m dependency list
The rocm-cmake package provides CMake scripts that facilitate common
build configuration tasks in the ROCm libraries. It is never needed at
link-time. Also, there are no calls to find_package(ROCM) or
include(ROCM.*)in vtk-m, so this dependency will never be used.
2022-04-19 21:26:40 +08:00
|
|
|
depends_on("rocm-cmake@%s:" % ver, type="build", when="@" + ver)
|
2023-04-04 02:28:24 +08:00
|
|
|
depends_on("rocsparse@" + ver, when="+rocm @" + ver)
|
|
|
|
|
|
|
|
for tgt in ROCmPackage.amdgpu_targets:
|
|
|
|
depends_on(
|
|
|
|
"rocsparse amdgpu_target={0}".format(tgt), when="+rocm amdgpu_target={0}".format(tgt)
|
|
|
|
)
|
2022-07-31 06:19:18 +08:00
|
|
|
|
2020-09-11 06:33:21 +08:00
|
|
|
patch("e79985dccde22d826aceb3badfc643a3227979d2.patch", when="@3.5.0")
|
|
|
|
patch("530047af4a0f437dafc02f76b3a17e3b1536c7ec.patch", when="@3.5.0")
|
2023-04-04 02:28:24 +08:00
|
|
|
patch("0a90ddc4c33ed409a938513b9dbdca8bfad65e06.patch")
|
2020-08-21 03:55:02 +08:00
|
|
|
|
2022-06-17 15:34:49 +08:00
|
|
|
@classmethod
|
|
|
|
def determine_version(cls, lib):
|
|
|
|
match = re.search(r"lib\S*\.so\.\d+\.\d+\.(\d)(\d\d)(\d\d)", lib)
|
|
|
|
if match:
|
|
|
|
ver = "{0}.{1}.{2}".format(
|
|
|
|
int(match.group(1)), int(match.group(2)), int(match.group(3))
|
|
|
|
)
|
|
|
|
else:
|
|
|
|
ver = None
|
|
|
|
return ver
|
|
|
|
|
2020-08-21 03:55:02 +08:00
|
|
|
def cmake_args(self):
|
2021-08-11 14:21:17 +08:00
|
|
|
args = [
|
2021-06-17 17:52:33 +08:00
|
|
|
self.define("CMAKE_CXX_STANDARD", "14"),
|
|
|
|
self.define("BUILD_CLIENTS_SAMPLES", "OFF"),
|
|
|
|
self.define("BUILD_CLIENTS_TESTS", "OFF"),
|
2020-08-21 03:55:02 +08:00
|
|
|
]
|
|
|
|
|
2023-04-04 02:28:24 +08:00
|
|
|
args.append(self.define_from_variant("BUILD_CUDA", "cuda"))
|
2021-08-11 14:21:17 +08:00
|
|
|
|
2023-04-04 02:28:24 +08:00
|
|
|
# FindHIP.cmake was used for +rocm until 5.0.0 and is still used for +cuda
|
|
|
|
if self.spec.satisfies("@:4") or self.spec.satisfies("+cuda"):
|
|
|
|
if self.spec["hip"].satisfies("@:5.1"):
|
|
|
|
args.append(self.define("CMAKE_MODULE_PATH", self.spec["hip"].prefix.cmake))
|
|
|
|
else:
|
|
|
|
args.append(
|
|
|
|
self.define("CMAKE_MODULE_PATH", self.spec["hip"].prefix.lib.cmake.hip)
|
|
|
|
)
|
|
|
|
|
|
|
|
if self.spec.satisfies("@5.2.0:"):
|
2022-08-12 15:20:47 +08:00
|
|
|
args.append(self.define("BUILD_FILE_REORG_BACKWARD_COMPATIBILITY", True))
|
2023-04-04 02:28:24 +08:00
|
|
|
|
2022-12-13 03:46:20 +08:00
|
|
|
if self.spec.satisfies("@5.3.0:"):
|
|
|
|
args.append("-DCMAKE_INSTALL_LIBDIR=lib")
|
2021-08-11 14:21:17 +08:00
|
|
|
|
2023-04-04 02:28:24 +08:00
|
|
|
return args
|