commit:     5e7a65e1ea3b250c9ad48cf101c4d246132a81f2
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 25 09:52:29 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Feb 25 18:41:35 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5e7a65e1

sys-libs/libomp: Add 17.0.0_pre20230225 snapshot

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

 sys-libs/libomp/Manifest                         |   1 +
 sys-libs/libomp/libomp-17.0.0_pre20230225.ebuild | 149 +++++++++++++++++++++++
 2 files changed, 150 insertions(+)

diff --git a/sys-libs/libomp/Manifest b/sys-libs/libomp/Manifest
index 74e4d55c4b13..a4c929d7413f 100644
--- a/sys-libs/libomp/Manifest
+++ b/sys-libs/libomp/Manifest
@@ -10,3 +10,4 @@ DIST llvm-project-16.0.0rc3.src.tar.xz 117914548 BLAKE2B 
18ffa35eb73c7cc4626d7b6
 DIST llvm-project-16.0.0rc3.src.tar.xz.sig 566 BLAKE2B 
43683d2d7b266a847516f71412bf6236a355462430330fc0da1d624fb8dfbc98bfc982d367baee74d5b4964a9e82e7a4a6ea84bdcff3996d246932f516cced1a
 SHA512 
61adc4dc3eb5a4c11a7f96f9267ff37895e5845a08d48a609a03a2696c1b6bca5af5861a6f28de936c48e6d621bf282170589187f2cb593a912b9078300cf47c
 DIST llvm-project-22fb66eb94b643c858c2beecbcfac438a7fa29ed.tar.gz 179795537 
BLAKE2B 
aef57ef739c52a8f8b2b327a8f6d8cce4734d9704018fb43a21468e56748e5d5b3d2d47fb4e95fd72b2af9f2e4be88839553e26fd7da08df60c5cc0f51c001d4
 SHA512 
9ed093ef7dac4891660aafbc5cad66bddefa796bff4dd70c792cc636268742142d82b84520ac2f5a5963521d7b9e4325440763ce0c88937f89722f07d3acd4b8
 DIST llvm-project-5e262d58c42668c78d932fab6bf75cf8c3b9d07e.tar.gz 179975303 
BLAKE2B 
184e7ff6e9a7de77d4a8c36c6910e4e3c7c5e9ff73ed6111ec4704dd457205278abb258ff37170e41a6b21c9ae3f243a80b34e4b17f8977fb9a42876db6465b7
 SHA512 
ec7e16a4d8f8292d1184ae08c1c5eda0dba1876e7d9c228eb0added5cde45f3094fde7eb1da662d436f85315850310cc0612210ff3ddf82967d5c2de0047a724
+DIST llvm-project-b0676fb0fb0a44a4a1c4ec1f0270fef1f1842817.tar.gz 180277698 
BLAKE2B 
d2c1e6a1942e51f5844c18605f38b005e9bb4123850a173e4c4b3d7b6a14f4986c7b276b40df4d0594ae04e869e92ba1a4269c5055c0229cfd28aa1bd709da4f
 SHA512 
d1281b942dcc254641865f11b0c4fbd1d562d016681b6b7268549bed1cdb7d4536f743a8ed089095eaab9f4bfb9de624153f448bf13d0e22f8ea24a4d264df7b

diff --git a/sys-libs/libomp/libomp-17.0.0_pre20230225.ebuild 
b/sys-libs/libomp/libomp-17.0.0_pre20230225.ebuild
new file mode 100644
index 000000000000..6bb50cb9edf9
--- /dev/null
+++ b/sys-libs/libomp/libomp-17.0.0_pre20230225.ebuild
@@ -0,0 +1,149 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..11} )
+inherit flag-o-matic cmake-multilib linux-info llvm llvm.org
+inherit python-single-r1 toolchain-funcs
+
+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}"
+KEYWORDS=""
+IUSE="
+       debug gdb-plugin hwloc offload ompt test
+       llvm_targets_AMDGPU llvm_targets_NVPTX
+"
+REQUIRED_USE="
+       gdb-plugin? ( ${PYTHON_REQUIRED_USE} )
+"
+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:0/5.3 )
+       )
+"
+# 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_DEPS}
+               $(python_gen_cond_dep '
+                       dev-python/lit[${PYTHON_USEDEP}]
+               ')
+               sys-devel/clang
+       )
+"
+
+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() {
+       use offload && LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup
+       if use gdb-plugin || use test; then
+               python-single-r1_pkg_setup
+       fi
+}
+
+multilib_src_configure() {
+       # 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}"
+
+               -DLIBOMP_USE_HWLOC=$(usex hwloc)
+               -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
+               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