llvm-runtimes/openmp: Remove old

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2026-11-21 12:44:14 +01:00
parent 41e6eec0fc
commit b23abfbfda
4 changed files with 0 additions and 636 deletions
-4
View File
@@ -4,10 +4,6 @@ DIST llvm-project-21.1.8.src.tar.xz 158958576 BLAKE2B 0d3d4ee920f8e5db50e9815261
DIST llvm-project-21.1.8.src.tar.xz.sig 119 BLAKE2B cffc1825f5778a3e3c128ec3e856ff6ee50687319d621cdf42e895abf67e05cc51cb7493308e2b506ab60dbdbaca7aa75eb9f78d91d42c81f9682a36f4042e9d SHA512 10f58eff58ed6e701d0f123b15e68c82ab8cbdf99b1c86c0d83e3b8553e90ea51055e30327e8e442ded57c8f503e2a2de9ee075e9c28b5ba815a0f8922f8671c
DIST llvm-project-22.1.8.src.tar.xz 167061596 BLAKE2B 092204f62e0f0364a041c737eb2c25fd073cb5689663d6ccd5a9e4e1743d6d80822360d59b64bff7b4d7872a68a79e899bf2f75f384e55c7d313a79243576f03 SHA512 2615b20ba08534f83ab8ecc7b5ba43b5f1dfcf9cdb2534a32fcdbf0ccdd9a008b46276e45ef26ed9377f65b5e4ae89ea798f3863fd034484b5715140f3a7b35c
DIST llvm-project-22.1.8.src.tar.xz.sig 119 BLAKE2B 2ce93472036e68782252991e4a8bdbeeec8706a56022220083a38a42ef18714a7894c41aaa04dc0d03f18601d8bfc1a5a030ed0ef0f0d64a662eae9843a4b362 SHA512 99a457b5b1fb409a5fe72b59ebd4ddae5cade3e5f2493e33b44d4f4b4625f7a1743f80106efb1134668842b15ea3400ce2c29263bec8ff986e05040910125e15
DIST llvm-project-23.1.5.src.tar.xz 179220264 BLAKE2B 1e6000c921501053cd59171120c90ae39c901cdb3e667e6598f33a3f07569c811c5c73c9d772ce782a77663ef1cc1328086021bb487b45aac5ebd5d6409e752d SHA512 fae39af451683ad864299f497167616e63d3a1bb5719f0d5123119e7398972cb602aef8cc271b8433910064afa88e1e7b8eede3fdd1ff58664c3189cf4ab5880
DIST llvm-project-23.1.5.src.tar.xz.sig 119 BLAKE2B f30c8869caf3e084b20ea877d32aed069402234806bd680ce8426dd76d9cf7d535ac2eb710ccfd417c7be04b23fb41bb77ef8293eb6c148d8b03299b2f2458be SHA512 7937df41a9d66b2f227e5f708f78b191cc8e062299c03d70308b2c56d2885e4c1734661b76418747402099a4cd6d699dcf47ce193104e800676dc963724e317b
DIST llvm-project-23.1.6.src.tar.xz 179172364 BLAKE2B bd725af1a1f705fb5f50e4bbe71a92f44a8614019813464cf1c255a5b654b0f6b77a988af0fde4b4b90ad1a0d53e84f66f784dd0e78185fccbed415f1df4659b SHA512 03beadbaf13ec29911d3934395cfa19a7d77d6c50532e70375f5c1d43369a9b17c10f00325c08d874776df6679a3bee77ce50110408748a3f661372f1fdfbce6
DIST llvm-project-23.1.6.src.tar.xz.sig 466 BLAKE2B dbd43177600479ae1dd41649b247ba60165944f65528c46d317aa57c9528f68819103c59284527671127fe3a38dbddd84ec2241da1a55253d77129a8d3ca46bd SHA512 9bc214df88ef498b0041ff4454b0d3b36f8add9191cdaa05193b4254072d4210c61b692a1628d89ca85753ef178991f5ee64274e6fb9310896389b2af0560e43
DIST llvm-project-5c34792296df2e9e880198205282b17f4d210fbe.tar.gz 328362046 BLAKE2B dead7743c36270d0882d852a41043d7649c24273afc4c2e7d58e5fe57c621b6fc65181c76c8942c24e61e7ba36c04f8af921557384c852057f8288c8a79f5005 SHA512 7a63985fc8eda017357fff4baa3662116bea6831e9cebd75cfb09c7a87af1a1f27791fea48c7a486a2fc8f2c61fb85a46b3ed256deeadc61bb7f81a81f1e988a
DIST llvm-project-ac4bd3cf8dd61a17d728ebc9b5ac9b3101eeed43.tar.gz 322898483 BLAKE2B e36e0632acedfccb87f39c22cc1109e909c80936ffcc245b6cecc5adf3cbda62f4ab2952d19d4dffca8bf4a2c05542af92c79d9563696d38396ad149597c2a5d SHA512 e4edc6aa681d537d5627ae36aa96f3a3b08333cd933678c0cbd7ec10d0da72e1b6ae1e79b05112b7af0e63602a24f5fd7428974565260e0efdd9a445861b3361
DIST llvm-project-e1056bdfdc6ccc075fbd2fbf986bc22c736d6dd4.tar.gz 327626807 BLAKE2B 06997a0caae6512ec3e1ae835bc126771d981a2f3f4f979f6f9c59516fe5ec1806bfb09993f2813436b3c6e48abfcb29431e2bac6dbce3e2bc87f94443b4d32f SHA512 18836ee6f932f7f06bafea906855087d66e62e266c7c95394f77c240e07830ac1d6276d19ff23ce9d8e60671f3f2b1116149d102b3c35ef07dda246dfa901cda
-206
View File
@@ -1,206 +0,0 @@
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{12..14} )
inherit cmake-multilib crossdev flag-o-matic llvm.org python-single-r1
inherit toolchain-funcs
DESCRIPTION="OpenMP runtime libraries for LLVM/clang compiler"
HOMEPAGE="https://openmp.llvm.org"
LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
SLOT="0/${LLVM_SOABI}"
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~x86 ~x64-macos"
IUSE="
+clang debug fortran gdb-plugin hwloc offload ompt test
cuda level-zero rocm
"
REQUIRED_USE="
gdb-plugin? ( ${PYTHON_REQUIRED_USE} )
"
RESTRICT="!test? ( test )"
DEPEND="
hwloc? ( >=sys-apps/hwloc-2.5:0=[${MULTILIB_USEDEP}] )
offload? (
dev-libs/libffi:=
~llvm-core/llvm-${PV}
level-zero? ( dev-libs/level-zero:= )
rocm? ( dev-libs/rocr-runtime:= )
)
"
# tests:
# - dev-python/lit provides the test runner
# - llvm-core/llvm provide test utils (e.g. FileCheck)
# - llvm-core/clang provides the compiler to run tests
RDEPEND="
${DEPEND}
gdb-plugin? ( ${PYTHON_DEPS} )
offload? (
!llvm-runtimes/offload
cuda? ( ~llvm-runtimes/openmp-nvptx64-nvidia-cuda-${PV} )
level-zero? ( ~llvm-runtimes/openmp-spirv64-intel-${PV} )
rocm? ( ~llvm-runtimes/openmp-amdgcn-amd-amdhsa-${PV} )
)
"
BDEPEND="
dev-lang/perl
clang? ( llvm-core/clang )
fortran? (
llvm-core/flang:${LLVM_MAJOR}
llvm-runtimes/flang-rt:${LLVM_MAJOR}
)
gdb-plugin? ( ${PYTHON_DEPS} )
offload? (
virtual/pkgconfig
)
test? (
${PYTHON_DEPS}
$(python_gen_cond_dep '
dev-python/lit[${PYTHON_USEDEP}]
')
llvm-core/clang:${LLVM_MAJOR}
llvm-core/llvm:${LLVM_MAJOR}
)
"
LLVM_COMPONENTS=(
runtimes openmp offload cmake libc llvm/{cmake,include,utils}
third-party/unittest
)
llvm.org_set_globals
MULTILIB_WRAPPED_HEADERS=(
/usr/include/offload/OffloadPrint.hpp
/usr/include/offload/OffloadAPI.h
)
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 gdb-plugin || use test; then
python-single-r1_pkg_setup
fi
}
multilib_src_configure() {
if use clang && ! is_crosspkg; then
# Only do this conditionally to allow overriding with
# e.g. CC=clang-13 in case of breakage
if ! tc-is-clang ; then
local -x CC=${CHOST}-clang
local -x CXX=${CHOST}-clang++
fi
strip-unsupported-flags
fi
if use fortran; then
local -x FC=flang-${LLVM_MAJOR} F77=flang-${LLVM_MAJOR}
strip-unsupported-flags
else
local -x FC= F77=
fi
# LTO causes issues in other packages building, #870127
filter-lto
# LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
local libdir="$(get_libdir)"
local mycmakeargs=(
-DLLVM_ENABLE_RUNTIMES=openmp
-DLLVM_LIBDIR_SUFFIX="${libdir#lib}"
-DLLVM_BINARY_DIR="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}"
-DLIBOMP_USE_HWLOC=$(usex hwloc)
-DLIBOMP_OMPD_GDB_SUPPORT=$(multilib_native_usex gdb-plugin)
-DLIBOMP_OMPT_SUPPORT=$(usex ompt)
# do not install libgomp.so & libiomp5.so aliases
-DLIBOMP_INSTALL_ALIASES=OFF
# disable unnecessary hack copying stuff back to srcdir
-DLIBOMP_COPY_EXPORTS=OFF
# this breaks building static target libs
-DBUILD_SHARED_LIBS=OFF
)
if multilib_is_native_abi && use fortran; then
mycmakeargs+=(
# cmake.eclass does not set if it we don't inherit fortran-2
# and upstream code relies on it being set before Fortran logic
# kicks in and reds envvars
-DCMAKE_Fortran_COMPILER="${FC}"
-DRUNTIMES_FORTRAN_MODULES=ON
-DRUNTIMES_INSTALL_RESOURCE_PATH="${EPREFIX}/usr/lib/clang/${LLVM_MAJOR}"
)
fi
if multilib_is_native_abi && use offload; then
local ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
local ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
local plugins="host"
if has "${CHOST%%-*}" aarch64 powerpc64le x86_64; then
if use rocm; then
plugins+=";amdgpu"
fi
if use cuda; then
plugins+=";cuda"
fi
if use level-zero; then
plugins+=";level_zero"
fi
fi
mycmakeargs+=(
-DLLVM_ENABLE_RUNTIMES="openmp;offload"
-DOFFLOAD_INCLUDE_TESTS=$(usex test)
-DLIBOMPTARGET_PLUGINS_TO_BUILD="${plugins}"
-DLIBOMPTARGET_OMPT_SUPPORT="$(usex ompt)"
)
[[ ! ${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
-DLIBOMPTARGET_OFFLOAD_ARCH=LIBOMPTARGET_OFFLOAD_ARCH-NOTFOUND
)
fi
use test && mycmakeargs+=(
-DLLVM_LIT_ARGS="$(get_lit_flags)"
-DOPENMP_TEST_C_COMPILER="$(type -P "${CHOST}-clang-${LLVM_MAJOR}")"
-DOPENMP_TEST_CXX_COMPILER="$(type -P "${CHOST}-clang++-${LLVM_MAJOR}")"
# may be set to empty above
-DOPENMP_TEST_Fortran_COMPILER="${FC}"
)
cmake_src_configure
}
multilib_src_test() {
# respect TMPDIR!
local -x LIT_PRESERVES_TMP=1
local targets=( check-openmp )
if multilib_is_native_abi && use offload; then
targets+=( check-offload check-offload-unit )
fi
if multilib_is_native_abi && use fortran; then
# hack header search around by copying the modules to a directory
# that is already given via -I
cp "${BUILD_DIR}/$(get_libdir)/clang"/*/finclude/flang/*/*.mod \
"${WORKDIR}/offload/test/" || die
fi
cmake_build "${targets[@]}"
}
@@ -1,213 +0,0 @@
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{12..14} )
inherit cmake-multilib crossdev flag-o-matic llvm.org python-single-r1
inherit toolchain-funcs
DESCRIPTION="OpenMP runtime libraries for LLVM/clang compiler"
HOMEPAGE="https://openmp.llvm.org"
LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
SLOT="0/${LLVM_SOABI}"
IUSE="
+clang +debug fortran gdb-plugin hwloc offload ompt test
cuda level-zero rocm
"
REQUIRED_USE="
gdb-plugin? ( ${PYTHON_REQUIRED_USE} )
"
RESTRICT="!test? ( test )"
DEPEND="
hwloc? ( >=sys-apps/hwloc-2.5:0=[${MULTILIB_USEDEP}] )
offload? (
dev-libs/libffi:=
~llvm-core/llvm-${PV}
level-zero? ( dev-libs/level-zero:= )
rocm? ( dev-libs/rocr-runtime:= )
)
"
# tests:
# - dev-python/lit provides the test runner
# - llvm-core/llvm provide test utils (e.g. FileCheck)
# - llvm-core/clang provides the compiler to run tests
RDEPEND="
${DEPEND}
gdb-plugin? ( ${PYTHON_DEPS} )
offload? (
!llvm-runtimes/offload
cuda? ( ~llvm-runtimes/openmp-nvptx64-nvidia-cuda-${PV} )
level-zero? ( ~llvm-runtimes/openmp-spirv64-intel-${PV} )
rocm? ( ~llvm-runtimes/openmp-amdgcn-amd-amdhsa-${PV} )
)
"
BDEPEND="
dev-lang/perl
clang? ( llvm-core/clang )
fortran? (
llvm-core/flang:${LLVM_MAJOR}
llvm-runtimes/flang-rt:${LLVM_MAJOR}
)
gdb-plugin? ( ${PYTHON_DEPS} )
offload? (
virtual/pkgconfig
)
test? (
${PYTHON_DEPS}
$(python_gen_cond_dep '
dev-python/lit[${PYTHON_USEDEP}]
')
llvm-core/clang:${LLVM_MAJOR}
llvm-core/llvm:${LLVM_MAJOR}
)
"
LLVM_COMPONENTS=(
runtimes openmp offload cmake libc llvm/{cmake,include,utils}
third-party/unittest
)
llvm.org_set_globals
MULTILIB_WRAPPED_HEADERS=(
/usr/include/offload/OffloadAPI.h
/usr/include/offload/OffloadPrint.hpp
/usr/include/offload/cuda/cuda_runtime.h
/usr/include/offload/hip/hip_runtime.h
/usr/include/offload/kernel/DefineLanguageNames.inc
/usr/include/offload/kernel/LanguageErrors.h
/usr/include/offload/kernel/LanguageLaunch.h
/usr/include/offload/kernel/LanguageRuntime.h
/usr/include/offload/kernel/Types.h
/usr/include/offload/kernel/UndefineLanguageNames.inc
)
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 gdb-plugin || use test; then
python-single-r1_pkg_setup
fi
}
multilib_src_configure() {
if use clang && ! is_crosspkg; then
# Only do this conditionally to allow overriding with
# e.g. CC=clang-13 in case of breakage
if ! tc-is-clang ; then
local -x CC=${CHOST}-clang
local -x CXX=${CHOST}-clang++
fi
strip-unsupported-flags
fi
if use fortran; then
local -x FC=flang-${LLVM_MAJOR} F77=flang-${LLVM_MAJOR}
strip-unsupported-flags
else
local -x FC= F77=
fi
# LTO causes issues in other packages building, #870127
filter-lto
# LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
local libdir="$(get_libdir)"
local mycmakeargs=(
-DLLVM_ENABLE_RUNTIMES=openmp
-DLLVM_LIBDIR_SUFFIX="${libdir#lib}"
-DLLVM_BINARY_DIR="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}"
-DLIBOMP_USE_HWLOC=$(usex hwloc)
-DLIBOMP_OMPD_GDB_SUPPORT=$(multilib_native_usex gdb-plugin)
-DLIBOMP_OMPT_SUPPORT=$(usex ompt)
# do not install libgomp.so & libiomp5.so aliases
-DLIBOMP_INSTALL_ALIASES=OFF
# disable unnecessary hack copying stuff back to srcdir
-DLIBOMP_COPY_EXPORTS=OFF
# this breaks building static target libs
-DBUILD_SHARED_LIBS=OFF
)
if multilib_is_native_abi && use fortran; then
mycmakeargs+=(
# cmake.eclass does not set if it we don't inherit fortran-2
# and upstream code relies on it being set before Fortran logic
# kicks in and reds envvars
-DCMAKE_Fortran_COMPILER="${FC}"
-DRUNTIMES_FORTRAN_MODULES=ON
-DRUNTIMES_INSTALL_RESOURCE_PATH="${EPREFIX}/usr/lib/clang/${LLVM_MAJOR}"
)
fi
if multilib_is_native_abi && use offload; then
local ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
local ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
local plugins="host"
if has "${CHOST%%-*}" aarch64 powerpc64le x86_64; then
if use rocm; then
plugins+=";amdgpu"
fi
if use cuda; then
plugins+=";cuda"
fi
if use level-zero; then
plugins+=";level_zero"
fi
fi
mycmakeargs+=(
-DLLVM_ENABLE_RUNTIMES="openmp;offload"
-DOFFLOAD_INCLUDE_TESTS=$(usex test)
-DLIBOMPTARGET_PLUGINS_TO_BUILD="${plugins}"
-DLIBOMPTARGET_OMPT_SUPPORT="$(usex ompt)"
)
[[ ! ${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
-DLIBOMPTARGET_OFFLOAD_ARCH=LIBOMPTARGET_OFFLOAD_ARCH-NOTFOUND
)
fi
use test && mycmakeargs+=(
-DLLVM_LIT_ARGS="$(get_lit_flags)"
-DOPENMP_TEST_C_COMPILER="$(type -P "${CHOST}-clang-${LLVM_MAJOR}")"
-DOPENMP_TEST_CXX_COMPILER="$(type -P "${CHOST}-clang++-${LLVM_MAJOR}")"
# may be set to empty above
-DOPENMP_TEST_Fortran_COMPILER="${FC}"
)
cmake_src_configure
}
multilib_src_test() {
# respect TMPDIR!
local -x LIT_PRESERVES_TMP=1
local targets=( check-openmp )
if multilib_is_native_abi && use offload; then
targets+=( check-offload check-offload-unit )
fi
if multilib_is_native_abi && use fortran; then
# hack header search around by copying the modules to a directory
# that is already given via -I
cp "${BUILD_DIR}/$(get_libdir)/clang"/*/finclude/flang/*/*.mod \
"${WORKDIR}/offload/test/" || die
fi
cmake_build "${targets[@]}"
}
@@ -1,213 +0,0 @@
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{12..14} )
inherit cmake-multilib crossdev flag-o-matic llvm.org python-single-r1
inherit toolchain-funcs
DESCRIPTION="OpenMP runtime libraries for LLVM/clang compiler"
HOMEPAGE="https://openmp.llvm.org"
LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
SLOT="0/${LLVM_SOABI}"
IUSE="
+clang +debug fortran gdb-plugin hwloc offload ompt test
cuda level-zero rocm
"
REQUIRED_USE="
gdb-plugin? ( ${PYTHON_REQUIRED_USE} )
"
RESTRICT="!test? ( test )"
DEPEND="
hwloc? ( >=sys-apps/hwloc-2.5:0=[${MULTILIB_USEDEP}] )
offload? (
dev-libs/libffi:=
~llvm-core/llvm-${PV}
level-zero? ( dev-libs/level-zero:= )
rocm? ( dev-libs/rocr-runtime:= )
)
"
# tests:
# - dev-python/lit provides the test runner
# - llvm-core/llvm provide test utils (e.g. FileCheck)
# - llvm-core/clang provides the compiler to run tests
RDEPEND="
${DEPEND}
gdb-plugin? ( ${PYTHON_DEPS} )
offload? (
!llvm-runtimes/offload
cuda? ( ~llvm-runtimes/openmp-nvptx64-nvidia-cuda-${PV} )
level-zero? ( ~llvm-runtimes/openmp-spirv64-intel-${PV} )
rocm? ( ~llvm-runtimes/openmp-amdgcn-amd-amdhsa-${PV} )
)
"
BDEPEND="
dev-lang/perl
clang? ( llvm-core/clang )
fortran? (
llvm-core/flang:${LLVM_MAJOR}
llvm-runtimes/flang-rt:${LLVM_MAJOR}
)
gdb-plugin? ( ${PYTHON_DEPS} )
offload? (
virtual/pkgconfig
)
test? (
${PYTHON_DEPS}
$(python_gen_cond_dep '
dev-python/lit[${PYTHON_USEDEP}]
')
llvm-core/clang:${LLVM_MAJOR}
llvm-core/llvm:${LLVM_MAJOR}
)
"
LLVM_COMPONENTS=(
runtimes openmp offload cmake libc llvm/{cmake,include,utils}
third-party/unittest
)
llvm.org_set_globals
MULTILIB_WRAPPED_HEADERS=(
/usr/include/offload/OffloadAPI.h
/usr/include/offload/OffloadPrint.hpp
/usr/include/offload/cuda/cuda_runtime.h
/usr/include/offload/hip/hip_runtime.h
/usr/include/offload/kernel/DefineLanguageNames.inc
/usr/include/offload/kernel/LanguageErrors.h
/usr/include/offload/kernel/LanguageLaunch.h
/usr/include/offload/kernel/LanguageRuntime.h
/usr/include/offload/kernel/Types.h
/usr/include/offload/kernel/UndefineLanguageNames.inc
)
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 gdb-plugin || use test; then
python-single-r1_pkg_setup
fi
}
multilib_src_configure() {
if use clang && ! is_crosspkg; then
# Only do this conditionally to allow overriding with
# e.g. CC=clang-13 in case of breakage
if ! tc-is-clang ; then
local -x CC=${CHOST}-clang
local -x CXX=${CHOST}-clang++
fi
strip-unsupported-flags
fi
if use fortran; then
local -x FC=flang-${LLVM_MAJOR} F77=flang-${LLVM_MAJOR}
strip-unsupported-flags
else
local -x FC= F77=
fi
# LTO causes issues in other packages building, #870127
filter-lto
# LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
local libdir="$(get_libdir)"
local mycmakeargs=(
-DLLVM_ENABLE_RUNTIMES=openmp
-DLLVM_LIBDIR_SUFFIX="${libdir#lib}"
-DLLVM_BINARY_DIR="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}"
-DLIBOMP_USE_HWLOC=$(usex hwloc)
-DLIBOMP_OMPD_GDB_SUPPORT=$(multilib_native_usex gdb-plugin)
-DLIBOMP_OMPT_SUPPORT=$(usex ompt)
# do not install libgomp.so & libiomp5.so aliases
-DLIBOMP_INSTALL_ALIASES=OFF
# disable unnecessary hack copying stuff back to srcdir
-DLIBOMP_COPY_EXPORTS=OFF
# this breaks building static target libs
-DBUILD_SHARED_LIBS=OFF
)
if multilib_is_native_abi && use fortran; then
mycmakeargs+=(
# cmake.eclass does not set if it we don't inherit fortran-2
# and upstream code relies on it being set before Fortran logic
# kicks in and reds envvars
-DCMAKE_Fortran_COMPILER="${FC}"
-DRUNTIMES_FORTRAN_MODULES=ON
-DRUNTIMES_INSTALL_RESOURCE_PATH="${EPREFIX}/usr/lib/clang/${LLVM_MAJOR}"
)
fi
if multilib_is_native_abi && use offload; then
local ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
local ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
local plugins="host"
if has "${CHOST%%-*}" aarch64 powerpc64le x86_64; then
if use rocm; then
plugins+=";amdgpu"
fi
if use cuda; then
plugins+=";cuda"
fi
if use level-zero; then
plugins+=";level_zero"
fi
fi
mycmakeargs+=(
-DLLVM_ENABLE_RUNTIMES="openmp;offload"
-DOFFLOAD_INCLUDE_TESTS=$(usex test)
-DLIBOMPTARGET_PLUGINS_TO_BUILD="${plugins}"
-DLIBOMPTARGET_OMPT_SUPPORT="$(usex ompt)"
)
[[ ! ${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
-DLIBOMPTARGET_OFFLOAD_ARCH=LIBOMPTARGET_OFFLOAD_ARCH-NOTFOUND
)
fi
use test && mycmakeargs+=(
-DLLVM_LIT_ARGS="$(get_lit_flags)"
-DOPENMP_TEST_C_COMPILER="$(type -P "${CHOST}-clang-${LLVM_MAJOR}")"
-DOPENMP_TEST_CXX_COMPILER="$(type -P "${CHOST}-clang++-${LLVM_MAJOR}")"
# may be set to empty above
-DOPENMP_TEST_Fortran_COMPILER="${FC}"
)
cmake_src_configure
}
multilib_src_test() {
# respect TMPDIR!
local -x LIT_PRESERVES_TMP=1
local targets=( check-openmp )
if multilib_is_native_abi && use offload; then
targets+=( check-offload check-offload-unit )
fi
if multilib_is_native_abi && use fortran; then
# hack header search around by copying the modules to a directory
# that is already given via -I
cp "${BUILD_DIR}/$(get_libdir)/clang"/*/finclude/flang/*/*.mod \
"${WORKDIR}/offload/test/" || die
fi
cmake_build "${targets[@]}"
}