commit:     f5496c6f045141c63991a07ad4d8e8dc0f3295ce
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 10 09:52:55 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Apr 10 11:09:58 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f5496c6f

sys-libs/libomp: Add 19.0.0_pre20240410 snapshot

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

 sys-libs/libomp/Manifest                         |   1 +
 sys-libs/libomp/libomp-19.0.0_pre20240410.ebuild | 160 +++++++++++++++++++++++
 2 files changed, 161 insertions(+)

diff --git a/sys-libs/libomp/Manifest b/sys-libs/libomp/Manifest
index a209f3529cfc..3b18335c7afb 100644
--- a/sys-libs/libomp/Manifest
+++ b/sys-libs/libomp/Manifest
@@ -9,3 +9,4 @@ DIST llvm-project-17.0.6.src.tar.xz.sig 438 BLAKE2B 
186e75b6a0fbfe1e85408589c149
 DIST llvm-project-18.1.3.src.tar.xz 132049300 BLAKE2B 
0681177cfe6a65f5cf11942381078388e8f5d9d5a4bb50b040e4c10a3898e7311ff379fcca008e82e4bef225792a38eb77f722c972725b9251a0fda29d8d7ecc
 SHA512 
b8b8a00c560bc7d4c4b5d533b92dbd52f2c0254f0acf687e787e8b7fa780cd5d96f6e9709356d2c406c0b36b186dee4de6b1bc1928a97de0bda863fa873e0783
 DIST llvm-project-18.1.3.src.tar.xz.sig 566 BLAKE2B 
dcecf41346cc864c6e5bedd3a7db3db4f32a68534364d2537a15ca7e4e2f2d35a22722385ac556d2a4ac48ab37567566094f223534e696299f98040e702146d0
 SHA512 
b7e50779841891e9ed9de5ed917c5be3209a52a5d98c67a032509ae8fad8a2a882bf619c66d2ee45bb53dfb03d750cb94dc4b2750ec2a8edb0465700d5bc657c
 DIST llvm-project-a8b0ecd2605ff23f495a8af64e06c35f86834e54.tar.gz 208451583 
BLAKE2B 
3f8557637b9d10ed924cfec0b3e83d85996417df24b317cac55740aa199ef97cf7560fe634debd1dbfc7c9fc25aa2b2643fccaecc4c866481dc57b11eba1d02f
 SHA512 
1f4bf5a8a59582af426ad13cc828e1e482c5c831ed5a4bb0da419ed3cf67e5e485fd36074603ad22328e35be44b8ccd2d92d1382bc7a228fdf38d458a2321e07
+DIST llvm-project-ee284d2da0720dc21191d6f545504cbfcf5dcbcf.tar.gz 208883034 
BLAKE2B 
e37c9f1a6a4d0caa9a3091f979dd09f509d458f8b7b30286c77dd2385aea748b7aac6dd488c79573f82feb655aa321717bd2fb46bba4a12b388b52064f6e13bf
 SHA512 
1335ade87cd2accc47ac47ed2ab302999e375808b158b6c9d31fac9059cbb992d2bdaaadf1fd9a1b37268c1123d43346ea4d150894d6d2e6f80ba790b65b93b1

diff --git a/sys-libs/libomp/libomp-19.0.0_pre20240410.ebuild 
b/sys-libs/libomp/libomp-19.0.0_pre20240410.ebuild
new file mode 100644
index 000000000000..a40d0aed1c41
--- /dev/null
+++ b/sys-libs/libomp/libomp-19.0.0_pre20240410.ebuild
@@ -0,0 +1,160 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+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
+
+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
+"
+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:= )
+       )
+"
+# 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() {
+       if use gdb-plugin || use test; then
+               python-single-r1_pkg_setup
+       fi
+}
+
+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}"
+
+               -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
+               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"
+               -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