summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2024-12-07 20:25:30 +0100
committerMichał Górny <mgorny@gentoo.org>2024-12-07 20:25:57 +0100
commit90865237269a77e27ea75f8179b5e5fc0ea99f7c (patch)
treef4dc9d6ab4d9e658cda1a62c811c4ce346c1d563
parentwww-apps/airdcpp-webui: add 2.13.0 (diff)
downloadgentoo-90865237269a77e27ea75f8179b5e5fc0ea99f7c.tar.gz
gentoo-90865237269a77e27ea75f8179b5e5fc0ea99f7c.tar.bz2
gentoo-90865237269a77e27ea75f8179b5e5fc0ea99f7c.zip
sys-libs/llvm-offload: Let users enable GPU testing
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r--sys-libs/llvm-offload/llvm-offload-20.0.0.9999.ebuild10
-rw-r--r--sys-libs/llvm-offload/llvm-offload-20.0.0_pre20241207.ebuild10
2 files changed, 20 insertions, 0 deletions
diff --git a/sys-libs/llvm-offload/llvm-offload-20.0.0.9999.ebuild b/sys-libs/llvm-offload/llvm-offload-20.0.0.9999.ebuild
index e47a34dbbcac..1e9ec4ce3ce4 100644
--- a/sys-libs/llvm-offload/llvm-offload-20.0.0.9999.ebuild
+++ b/sys-libs/llvm-offload/llvm-offload-20.0.0.9999.ebuild
@@ -48,6 +48,14 @@ LLVM_COMPONENTS=( offload cmake runtimes/cmake libc/shared )
LLVM_TEST_COMPONENTS=( openmp/cmake )
llvm.org_set_globals
+pkg_pretend() {
+ if [[ ${LLVM_ALLOW_GPU_TESTING} ]]; then
+ ewarn "LLVM_ALLOW_GPU_TESTING set. This package will run tests against your"
+ ewarn "GPU if it is supported. Note that these tests may be flaky, fail or"
+ ewarn "hang, or even cause your GPU to crash (requiring a reboot)."
+ fi
+}
+
pkg_setup() {
if use test; then
python-any-r1_pkg_setup
@@ -95,7 +103,9 @@ src_configure() {
-DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
-DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
+ )
+ [[ ! ${LLVM_ALLOW_GPU_TESTING} ]] && mycmakeargs+=(
# prevent trying to access the GPU
-DLIBOMPTARGET_AMDGPU_ARCH=LIBOMPTARGET_AMDGPU_ARCH-NOTFOUND
-DLIBOMPTARGET_NVPTX_ARCH=LIBOMPTARGET_NVPTX_ARCH-NOTFOUND
diff --git a/sys-libs/llvm-offload/llvm-offload-20.0.0_pre20241207.ebuild b/sys-libs/llvm-offload/llvm-offload-20.0.0_pre20241207.ebuild
index e86522254aa8..adee1702c49a 100644
--- a/sys-libs/llvm-offload/llvm-offload-20.0.0_pre20241207.ebuild
+++ b/sys-libs/llvm-offload/llvm-offload-20.0.0_pre20241207.ebuild
@@ -49,6 +49,14 @@ LLVM_COMPONENTS=( offload cmake runtimes/cmake libc/shared )
LLVM_TEST_COMPONENTS=( openmp/cmake )
llvm.org_set_globals
+pkg_pretend() {
+ if [[ ${LLVM_ALLOW_GPU_TESTING} ]]; then
+ ewarn "LLVM_ALLOW_GPU_TESTING set. This package will run tests against your"
+ ewarn "GPU if it is supported. Note that these tests may be flaky, fail or"
+ ewarn "hang, or even cause your GPU to crash (requiring a reboot)."
+ fi
+}
+
pkg_setup() {
if use test; then
python-any-r1_pkg_setup
@@ -100,7 +108,9 @@ src_configure() {
-DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
-DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
+ )
+ [[ ! ${LLVM_ALLOW_GPU_TESTING} ]] && mycmakeargs+=(
# prevent trying to access the GPU
-DLIBOMPTARGET_AMDGPU_ARCH=LIBOMPTARGET_AMDGPU_ARCH-NOTFOUND
-DLIBOMPTARGET_NVPTX_ARCH=LIBOMPTARGET_NVPTX_ARCH-NOTFOUND