summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2024-01-19 10:11:56 +0100
committerGitHub <noreply@github.com>2024-01-19 10:11:56 +0100
commit75e96b856eba55f7a47a2f446b3cd4e8f3f90e3c (patch)
tree47467c991821322af0d34824384dddb8daa5cbdf
parent549ab690a859fff212e86815ee0a6258b0de9a75 (diff)
downloadspack-75e96b856eba55f7a47a2f446b3cd4e8f3f90e3c.tar.gz
spack-75e96b856eba55f7a47a2f446b3cd4e8f3f90e3c.tar.bz2
spack-75e96b856eba55f7a47a2f446b3cd4e8f3f90e3c.tar.xz
spack-75e96b856eba55f7a47a2f446b3cd4e8f3f90e3c.zip
btop: add v1.3.0, added GPU variant (#42139)
-rw-r--r--var/spack/repos/builtin/packages/btop/link-dl.patch12
-rw-r--r--var/spack/repos/builtin/packages/btop/package.py20
2 files changed, 30 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/btop/link-dl.patch b/var/spack/repos/builtin/packages/btop/link-dl.patch
new file mode 100644
index 0000000000..ff4d56949e
--- /dev/null
+++ b/var/spack/repos/builtin/packages/btop/link-dl.patch
@@ -0,0 +1,12 @@
+--- a/CMakeLists.txt 2024-01-07 15:23:01.000000000 +0100
++++ b/CMakeLists.txt 2024-01-18 10:55:06.245357111 +0100
+@@ -150,6 +150,9 @@
+
+ target_link_libraries(btop ROCm)
+ endif()
++ if(NOT BTOP_STATIC)
++ target_link_libraries(btop ${CMAKE_DL_LIBS})
++ endif()
+ endif()
+
+ if(BTOP_USE_MOLD)
diff --git a/var/spack/repos/builtin/packages/btop/package.py b/var/spack/repos/builtin/packages/btop/package.py
index 26fc2de151..18d9fea669 100644
--- a/var/spack/repos/builtin/packages/btop/package.py
+++ b/var/spack/repos/builtin/packages/btop/package.py
@@ -2,10 +2,11 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+from spack.build_systems import cmake, makefile
from spack.package import *
-class Btop(MakefilePackage):
+class Btop(MakefilePackage, CMakePackage):
"""Resource monitor that shows usage and stats for processor,
memory, disks, network and processes.
"""
@@ -17,12 +18,27 @@ class Btop(MakefilePackage):
license("Apache-2.0")
+ version("1.3.0", sha256="375e078ce2091969f0cd14030620bd1a94987451cf7a73859127a786006a32cf")
version("1.2.13", sha256="668dc4782432564c35ad0d32748f972248cc5c5448c9009faeb3445282920e02")
- conflicts("%gcc@:9", msg="C++ 20 is required")
+ build_system("makefile", conditional("cmake", when="@1.3.0:"), default="cmake")
+ variant("gpu", default=False, description="Enable GPU support", when="build_system=cmake")
+
+ # Fix linking GPU support, by adding an explicit "target_link_libraries" to ${CMAKE_DL_LIBS}
+ patch("link-dl.patch", when="+gpu")
+
+ requires("%gcc@10:", "%clang@16:", policy="one_of", msg="C++ 20 is required")
+
+
+class MakefileBuilder(makefile.MakefileBuilder):
build_targets = ["STATIC=true", "VERBOSE=true"]
@property
def install_targets(self):
return [f"PREFIX={self.prefix}", "install"]
+
+
+class CMakeBuilder(cmake.CMakeBuilder):
+ def cmake_args(self):
+ return [self.define_from_variant("BTOP_GPU", "gpu")]