From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 73B9C158041 for ; Sat, 30 Mar 2024 10:27:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 879C6E2A5F; Sat, 30 Mar 2024 10:27:31 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 62322E2A5F for ; Sat, 30 Mar 2024 10:27:31 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 79C60343131 for ; Sat, 30 Mar 2024 10:27:30 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9B85E161A for ; Sat, 30 Mar 2024 10:27:26 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1711794439.770d3e2c86769a6c4482312c56521086600e0bb4.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libomp/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-libs/libomp/Manifest sys-libs/libomp/libomp-19.0.0_pre20240330.ebuild X-VCS-Directories: sys-libs/libomp/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 770d3e2c86769a6c4482312c56521086600e0bb4 X-VCS-Branch: master Date: Sat, 30 Mar 2024 10:27:26 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 3f3070d6-ce24-4b3a-99a3-0c6d1a6d57f4 X-Archives-Hash: 80165ce1ee3bad479175423c7afd2665 commit: 770d3e2c86769a6c4482312c56521086600e0bb4 Author: Michał Górny gentoo org> AuthorDate: Sat Mar 30 10:21:46 2024 +0000 Commit: Michał Górny gentoo org> CommitDate: Sat Mar 30 10:27:19 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=770d3e2c sys-libs/libomp: Add 19.0.0_pre20240330 snapshot Signed-off-by: Michał Górny gentoo.org> sys-libs/libomp/Manifest | 1 + sys-libs/libomp/libomp-19.0.0_pre20240330.ebuild | 160 +++++++++++++++++++++++ 2 files changed, 161 insertions(+) diff --git a/sys-libs/libomp/Manifest b/sys-libs/libomp/Manifest index 8c9ebfb502b8..02db7bdd584d 100644 --- a/sys-libs/libomp/Manifest +++ b/sys-libs/libomp/Manifest @@ -8,4 +8,5 @@ DIST llvm-project-17.0.6.src.tar.xz.sig 438 BLAKE2B 186e75b6a0fbfe1e85408589c149 DIST llvm-project-18.1.2.src.tar.xz 132060436 BLAKE2B f21fca02fe9e02a3d440595aafbe0572be318ce69cc6285c1bf3dc9187b37ebf4c76f3ea60b6870c441675288f46e5597b069ec451d5026c5161f84daef6b4b2 SHA512 a0d01b018abbdf1609abc7b63911bb4c6c3619b748a0616b66be0843fcaa4240868412c5d1f77fe6dafdfed665b46570e7ce615da58efcaa91e9ddc8481e6fc4 DIST llvm-project-18.1.2.src.tar.xz.sig 566 BLAKE2B 97c6b6b4a041316e70abd54ff715d87a62410fe5590c9b90548fff5a5121d8d5e028ec681f7e99c130d6c6726835365825286ef0a01c82a98394d9369ea7a390 SHA512 1cd8d1c227782cb43e269696045cea500a43f3c6b786f2cda8d380f5b8fc28d3ada11c41c4a252f2d3db465f767b27ea50c5659faa43d4aa5655cc3ffd6243c2 DIST llvm-project-6d3cec01a6c29fa4e51ba129fa13dbf55d2b928e.tar.gz 207700152 BLAKE2B 855720b7a9cc7b1d8fdf398394eb5c702dd615c04e7dad51c449cb1c2f46e75f2ccf2ee10fa3a3403d6aec29f557023a11bd8cdb525bc9c3d76c79f23cd15e82 SHA512 ff6269158e165907c69bd3e4d2d6b87b4f4670546b7e290d7e6665e7097ec887d71174fa37bf5e1755524317e8ae8f0c7c7e428049e8b553faa52c614f1f4490 +DIST llvm-project-a8b0ecd2605ff23f495a8af64e06c35f86834e54.tar.gz 208451583 BLAKE2B 3f8557637b9d10ed924cfec0b3e83d85996417df24b317cac55740aa199ef97cf7560fe634debd1dbfc7c9fc25aa2b2643fccaecc4c866481dc57b11eba1d02f SHA512 1f4bf5a8a59582af426ad13cc828e1e482c5c831ed5a4bb0da419ed3cf67e5e485fd36074603ad22328e35be44b8ccd2d92d1382bc7a228fdf38d458a2321e07 DIST llvm-project-f3cfe016c5d8429c0dccfa6f85442e2ea0d45a58.tar.gz 208184654 BLAKE2B abd35798f7c921866bb221cecc42aa94915271d0804acbf44dbe5640efb787ef9d928c329eacde768fac4292217ed4d3c4187fba02dd1c826059aeaa1bad33f0 SHA512 513f7278367114ba3fe3271e8a790b62adbca97d280968537e44e5df9a7afb467a5ca93480f4d4fb7c4d5c0734d00ab54559bf68c00f09a1fcff2fee492aa84f diff --git a/sys-libs/libomp/libomp-19.0.0_pre20240330.ebuild b/sys-libs/libomp/libomp-19.0.0_pre20240330.ebuild new file mode 100644 index 000000000000..a40d0aed1c41 --- /dev/null +++ b/sys-libs/libomp/libomp-19.0.0_pre20240330.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 +}