summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-04-27 10:47:04 +0200
committerMichał Górny <mgorny@gentoo.org>2022-04-30 09:34:50 +0200
commit3e45b63b92797fe6cc10f94a133c1cb92f49c5da (patch)
tree44243a10bb148aea465e84165a307e3fb80255c3 /sys-libs
parentsys-libs/libcxx: Bump to 14.0.3 (diff)
downloadgentoo-3e45b63b92797fe6cc10f94a133c1cb92f49c5da.tar.gz
gentoo-3e45b63b92797fe6cc10f94a133c1cb92f49c5da.tar.bz2
gentoo-3e45b63b92797fe6cc10f94a133c1cb92f49c5da.zip
sys-libs/libomp: Bump to 14.0.3
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'sys-libs')
-rw-r--r--sys-libs/libomp/Manifest1
-rw-r--r--sys-libs/libomp/libomp-14.0.3.ebuild142
2 files changed, 143 insertions, 0 deletions
diff --git a/sys-libs/libomp/Manifest b/sys-libs/libomp/Manifest
index 816a5e3f18d0..2f4126a4d716 100644
--- a/sys-libs/libomp/Manifest
+++ b/sys-libs/libomp/Manifest
@@ -3,3 +3,4 @@ DIST llvm-gentoo-patchset-13.0.1.tar.xz 6288 BLAKE2B 899222b962486e924e4f8a2b574
DIST llvmorg-12.0.1.tar.gz 134259748 BLAKE2B f41de787bc73ff2edfda1b22cc8602be6f65f37dd9e4c8888533cfa8c3ccdcf4f108aaab9de23ab0ab987966eb160f2a553a0bdff99461e71ddd5bfcd086090d SHA512 6eb0dc18e2c25935fabfdfc48b0114be0939158dfdef7b85b395fe2e71042672446af0e68750aae003c9847d10d1f63316fe95d3df738d18f249174292b1b9e1
DIST llvmorg-13.0.1.tar.gz 147290251 BLAKE2B 2a44b012a672501761d0c27c6b3a315b69bfef0cd13b078a7e7d2fccc4a9c8c0f2bee0f164c4271c9106b0a99cb06e8b64986f66253b613336719fb86b82541b SHA512 9a8cb5d11964ba88b7624f19ec861fb28701f23956ea3c92f6ac644332d5f41fde97bd8933dd3ee70ed378058c252fa3a3887c8d1af90d219970c2b27691166f
DIST llvmorg-14.0.1.tar.gz 158074615 BLAKE2B bf80366461580058494eb101646efcd1a8b55a66818a710c2eb8c649bf88c02fe4552cecf4c1c8637a64e7cee8d644bca31aafc804765ed18f2b5e2975dd6c92 SHA512 0a15aa9cfc978a7b03a1659a2affad65ede66d280f5c12bf0beaaf194cd7bdd57ff438b5f40e64c1e1b88f368de99be349e9d30b544d2bbe4a50f0ebed3307f2
+DIST llvmorg-14.0.3.tar.gz 158092596 BLAKE2B ef901df510ec6bc1242595ec330e9c9ee76e696b077d67a8d62b53608c3d18b2f2d7ea3150864e13d9b37a8ce899ebca946ebe72cbc4538700176e20859ddec2 SHA512 511e93fd9b1c414c38fe9e2649679ac0b16cb04f7f7838569d187b04c542a185e364d6db73e96465026e3b2533649eb75ac95507d12514af32b28bdfb66f2646
diff --git a/sys-libs/libomp/libomp-14.0.3.ebuild b/sys-libs/libomp/libomp-14.0.3.ebuild
new file mode 100644
index 000000000000..987d01113d97
--- /dev/null
+++ b/sys-libs/libomp/libomp-14.0.3.ebuild
@@ -0,0 +1,142 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+CMAKE_ECLASS=cmake
+PYTHON_COMPAT=( python3_{8..10} )
+inherit cmake-multilib linux-info llvm llvm.org python-any-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"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86 ~amd64-linux ~x64-macos"
+IUSE="
+ cuda debug hwloc offload ompt test
+ llvm_targets_AMDGPU llvm_targets_NVPTX
+"
+RESTRICT="!test? ( test )"
+# CUDA works only with the x86_64 ABI
+REQUIRED_USE="
+ cuda? ( llvm_targets_NVPTX )
+ offload? ( cuda? ( abi_x86_64 ) )
+"
+
+RDEPEND="
+ hwloc? ( >=sys-apps/hwloc-2.5:0=[${MULTILIB_USEDEP}] )
+ offload? (
+ virtual/libelf:=[${MULTILIB_USEDEP}]
+ dev-libs/libffi:=[${MULTILIB_USEDEP}]
+ ~sys-devel/llvm-${PV}[${MULTILIB_USEDEP}]
+ cuda? ( dev-util/nvidia-cuda-toolkit:= )
+ )
+"
+# tests:
+# - dev-python/lit provides the test runner
+# - sys-devel/llvm provide test utils (e.g. FileCheck)
+# - sys-devel/clang provides the compiler to run tests
+DEPEND="
+ ${RDEPEND}
+"
+BDEPEND="
+ dev-lang/perl
+ offload? (
+ llvm_targets_AMDGPU? ( sys-devel/clang )
+ llvm_targets_NVPTX? ( sys-devel/clang )
+ virtual/pkgconfig
+ )
+ test? (
+ $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]')
+ sys-devel/clang
+ )
+"
+
+LLVM_COMPONENTS=( openmp llvm/include )
+llvm.org_set_globals
+
+python_check_deps() {
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+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() {
+ use offload && LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup
+ use test && python-any-r1_pkg_setup
+}
+
+multilib_src_configure() {
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+
+ local libdir="$(get_libdir)"
+ local mycmakeargs=(
+ -DOPENMP_LIBDIR_SUFFIX="${libdir#lib}"
+
+ -DLIBOMP_USE_HWLOC=$(usex hwloc)
+ -DLIBOMP_OMPT_SUPPORT=$(usex ompt)
+
+ -DOPENMP_ENABLE_LIBOMPTARGET=$(usex offload)
+
+ # 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 use offload; then
+ if has "${CHOST%%-*}" aarch64 powerpc64le x86_64; then
+ mycmakeargs+=(
+ -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=$(usex !cuda)
+ -DLIBOMPTARGET_BUILD_AMDGCN_BCLIB=$(usex llvm_targets_AMDGPU)
+ -DLIBOMPTARGET_BUILD_NVPTX_BCLIB=$(usex llvm_targets_NVPTX)
+ # a cheap hack to force clang
+ -DLIBOMPTARGET_NVPTX_CUDA_COMPILER="$(type -P "${CHOST}-clang")"
+ # upstream defaults to looking for it in clang dir
+ # this fails when ccache is being used
+ -DLIBOMPTARGET_NVPTX_BC_LINKER="$(type -P llvm-link)"
+ )
+ else
+ mycmakeargs+=(
+ -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=ON
+ -DLIBOMPTARGET_BUILD_AMDGCN_BCLIB=OFF
+ -DLIBOMPTARGET_BUILD_NVPTX_BCLIB=OFF
+ )
+ fi
+ fi
+
+ use test && mycmakeargs+=(
+ # this project does not use standard LLVM cmake macros
+ -DOPENMP_LLVM_LIT_EXECUTABLE="${EPREFIX}/usr/bin/lit"
+ -DOPENMP_LIT_ARGS="$(get_lit_flags)"
+
+ -DOPENMP_TEST_C_COMPILER="$(type -P "${CHOST}-clang")"
+ -DOPENMP_TEST_CXX_COMPILER="$(type -P "${CHOST}-clang++")"
+ )
+ addpredict /dev/nvidiactl
+ cmake_src_configure
+}
+
+multilib_src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+
+ cmake_build check-libomp
+}