commit: 81b1f0d8cf5e39e0250b73208705aaf4b3367042
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 27 10:33:27 2024 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Apr 27 10:42:21 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=81b1f0d8
sys-libs/libomp: Remove offloading support
Upstream split offload into a separate component, that does not work
when built standalone, and building via runtimes is entirely broken.
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
sys-libs/libomp/libomp-19.0.0.9999.ebuild | 76 +------------------------------
1 file changed, 2 insertions(+), 74 deletions(-)
diff --git a/sys-libs/libomp/libomp-19.0.0.9999.ebuild
b/sys-libs/libomp/libomp-19.0.0.9999.ebuild
index a40d0aed1c41..0084c1ccb07c 100644
--- a/sys-libs/libomp/libomp-19.0.0.9999.ebuild
+++ b/sys-libs/libomp/libomp-19.0.0.9999.ebuild
@@ -4,18 +4,14 @@
EAPI=8
PYTHON_COMPAT=( python3_{10..12} )
-inherit flag-o-matic cmake-multilib linux-info llvm.org llvm-utils
-inherit python-single-r1 toolchain-funcs
+inherit flag-o-matic cmake-multilib linux-info llvm.org python-single-r1
DESCRIPTION="OpenMP runtime library for LLVM/clang compiler"
HOMEPAGE="https://openmp.llvm.org"
LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
SLOT="0/${LLVM_SOABI}"
-IUSE="
- +debug gdb-plugin hwloc offload ompt test
- llvm_targets_AMDGPU llvm_targets_NVPTX
-"
+IUSE="+debug gdb-plugin hwloc ompt test"
REQUIRED_USE="
gdb-plugin? ( ${PYTHON_REQUIRED_USE} )
"
@@ -24,11 +20,6 @@ RESTRICT="!test? ( test )"
RDEPEND="
gdb-plugin? ( ${PYTHON_DEPS} )
hwloc? ( >=sys-apps/hwloc-2.5:0=[${MULTILIB_USEDEP}] )
- offload? (
- dev-libs/libffi:=[${MULTILIB_USEDEP}]
- ~sys-devel/llvm-${PV}[${MULTILIB_USEDEP}]
- llvm_targets_AMDGPU? ( dev-libs/rocr-runtime:= )
- )
"
# tests:
# - dev-python/lit provides the test runner
@@ -39,11 +30,6 @@ DEPEND="
"
BDEPEND="
dev-lang/perl
- offload? (
- llvm_targets_AMDGPU? ( sys-devel/clang )
- llvm_targets_NVPTX? ( sys-devel/clang )
- virtual/pkgconfig
- )
test? (
${PYTHON_DEPS}
$(python_gen_cond_dep '
@@ -56,23 +42,6 @@ BDEPEND="
LLVM_COMPONENTS=( openmp cmake llvm/include )
llvm.org_set_globals
-kernel_pds_check() {
- if use kernel_linux && kernel_is -lt 4 15 && kernel_is -ge 4 13; then
- local CONFIG_CHECK="~!SCHED_PDS"
- local ERROR_SCHED_PDS="\
-PDS scheduler versions >= 0.98c < 0.98i (e.g. used in kernels >= 4.13-pf11
-< 4.14-pf9) do not implement sched_yield() call which may result in horrible
-performance problems with libomp. If you are using one of the specified
-kernel versions, you may want to disable the PDS scheduler."
-
- check_extra_config
- fi
-}
-
-pkg_pretend() {
- kernel_pds_check
-}
-
pkg_setup() {
if use gdb-plugin || use test; then
python-single-r1_pkg_setup
@@ -80,25 +49,12 @@ pkg_setup() {
}
multilib_src_configure() {
- use offload && llvm_prepend_path "${LLVM_MAJOR}"
-
# 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 build_omptarget=OFF
- # upstream disallows building libomptarget when sizeof(void*) != 8
- if use offload &&
- "$(tc-getCC)" ${CFLAGS} ${CPPFLAGS} -c -x c - -o /dev/null \
- <<-EOF &>/dev/null
- int test[sizeof(void *) == 8 ? 1 : -1];
- EOF
- then
- build_omptarget=ON
- fi
-
local libdir="$(get_libdir)"
local mycmakeargs=(
-DOPENMP_LIBDIR_SUFFIX="${libdir#lib}"
@@ -107,39 +63,12 @@ multilib_src_configure() {
-DLIBOMP_OMPD_GDB_SUPPORT=$(multilib_native_usex gdb-plugin)
-DLIBOMP_OMPT_SUPPORT=$(usex ompt)
- -DOPENMP_ENABLE_LIBOMPTARGET=${build_omptarget}
-
# do not install libgomp.so & libiomp5.so aliases
-DLIBOMP_INSTALL_ALIASES=OFF
# disable unnecessary hack copying stuff back to srcdir
-DLIBOMP_COPY_EXPORTS=OFF
)
- if [[ ${build_omptarget} == ON ]]; then
- local ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
- local ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
- mycmakeargs+=(
- -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
- -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
- )
-
- if has "${CHOST%%-*}" aarch64 powerpc64le x86_64; then
- mycmakeargs+=(
- -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=$(usex
llvm_targets_AMDGPU)
- -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=$(usex
llvm_targets_NVPTX)
-
- # prevent trying to access the GPU
-
-DLIBOMPTARGET_AMDGPU_ARCH=LIBOMPTARGET_AMDGPU_ARCH-NOTFOUND
-
-DLIBOMPTARGET_NVPTX_ARCH=LIBOMPTARGET_NVPTX_ARCH-NOTFOUND
- )
- else
- mycmakeargs+=(
- -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF
- -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF
- )
- fi
- fi
-
use test && mycmakeargs+=(
# this project does not use standard LLVM cmake macros
-DOPENMP_LLVM_LIT_EXECUTABLE="${EPREFIX}/usr/bin/lit"
@@ -148,7 +77,6 @@ multilib_src_configure() {
-DOPENMP_TEST_C_COMPILER="$(type -P "${CHOST}-clang")"
-DOPENMP_TEST_CXX_COMPILER="$(type -P "${CHOST}-clang++")"
)
- addpredict /dev/nvidiactl
cmake_src_configure
}