commit:     de0bfa1f864f7a62fc5a173de9a0fb39a3de9772
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 16 09:00:02 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Sep 16 12:14:40 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de0bfa1f

sys-libs/libomp: Add 16.0.0_pre20220915 snap

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 sys-libs/libomp/Manifest                         |   1 +
 sys-libs/libomp/libomp-16.0.0_pre20220915.ebuild | 130 +++++++++++++++++++++++
 2 files changed, 131 insertions(+)

diff --git a/sys-libs/libomp/Manifest b/sys-libs/libomp/Manifest
index ecb1d2da70fb..dc07bca79905 100644
--- a/sys-libs/libomp/Manifest
+++ b/sys-libs/libomp/Manifest
@@ -1,5 +1,6 @@
 DIST llvm-gentoo-patchset-13.0.1.tar.xz 6288 BLAKE2B 
899222b962486e924e4f8a2b574d285531a3f87af9385ff68c81db92aa224a0cde6d4ee049b5405056bedb4b232b50e1d5840024071a4a215f6311853304c92d
 SHA512 
b2805337f1deca626768a44c5e7ac9ed16e0c31bead1647d44a493a8123c1b8e8f1c8ceee3536bcc6fa87fdd3fcec408229f701adf30eff07e7ef9889b847b01
 DIST llvm-gentoo-patchset-14.0.6-r2.tar.xz 16120 BLAKE2B 
e12e522fdb7ba505693c679cb09cc8e00e6a954df195c86c2af4dbf1b68334a405b8dcc45f2e28b5e5e0b7e9d5eb7ba907337027927371b7a3b7784ff8aae7e0
 SHA512 
8a5ea71c30fc0727cc855dd812bbcb6d5f51c80c98eb3d5b80258d5c5eaab1310edc9d53ae63c2ca827abec68e2912c4b69ef0da351ff883fb30545a61e1d09c
+DIST llvm-project-02a27b38909edc46c41732f79a837c95c9992d5a.tar.gz 167414990 
BLAKE2B 
cd9c4be6d3155a4cbf1abff9d8246b9d6fea98e29459c226bda36df250cc22883f08175514fce037d146866d521a56669678b5c35b5163b38532b8c2920b25a6
 SHA512 
e862e148b8f053d8f4d40de8db9a4db587cb0c7b4120fe433d769aa2772a1aabd697c3c3f8ee34f547ee12c4bc4355116d5694d5f451264f8719d4af0fb32cb0
 DIST llvm-project-14.0.6.src.tar.xz 105618228 BLAKE2B 
ee67c5407df8cef493b9c0004f15e428f22a536a17e5f4e3eb29a003b8a8ec0abe0fa3e072591161d5f30ef7d8867c1ce34d1b341ad858e93c00263499941a99
 SHA512 
6fc6eeb60fac698702d1aac495fc0161eb7216a1f8db2020af8fccec5837831f7cc20dc2a169bf4f0b5f520748280b4a86621f3697d622aa58faaa45dbfaad13
 DIST llvm-project-14.0.6.src.tar.xz.sig 566 BLAKE2B 
cb658ad43d8ab6c43a5773aedadf0569c97b5ee4b1bd58eceb10e1879a30880c741c3d66bedd462c892309b688fb7b2673115a62d1f74d71ee375a578de9547f
 SHA512 
b4a7b368532a7a4a24376cfa7db8f6d3478f6d4446474342fc00b474ecf466330cd0f16783209263c4c72d5fc7ddedfb11b95578842e700cfb7ee0bb34cc95d6
 DIST llvm-project-15.0.0.src.tar.xz 112062796 BLAKE2B 
947917b6c75cbd8882133dc01f57013523274962371ac5ae4a22b010f8a7d5d31288c1d9847bf19ba919fa3110fe34a8ff937107fe19bd064ed87bf4d08d8a51
 SHA512 
e5aacbe7574dcec62017cc03c9fa2ee4cf075125a3d6c3975c38f06e91adcebb1ff92bcf40c6dd67db087813c60b15a04f1424c713d751199518b58025ce87fc

diff --git a/sys-libs/libomp/libomp-16.0.0_pre20220915.ebuild 
b/sys-libs/libomp/libomp-16.0.0_pre20220915.ebuild
new file mode 100644
index 000000000000..83d025fd921f
--- /dev/null
+++ b/sys-libs/libomp/libomp-16.0.0_pre20220915.ebuild
@@ -0,0 +1,130 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..11} )
+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=""
+IUSE="
+       debug hwloc offload ompt test
+       llvm_targets_AMDGPU llvm_targets_NVPTX
+"
+RESTRICT="!test? ( test )"
+
+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}]
+       )
+"
+# 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 cmake llvm/include )
+llvm.org_set_globals
+
+python_check_deps() {
+       python_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
+               # disable until upstream fixes it to use positive logic
+               -DDISABLE_OMPD_GDB_PLUGIN=ON
+       )
+
+       if use offload; then
+               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)
+                       )
+               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"
+               -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
+}

Reply via email to