From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1374615-garchives=archives.gentoo.org@lists.gentoo.org>
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 2AD8615808C
	for <garchives@archives.gentoo.org>; Sat, 12 Mar 2022 09:20:13 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 4F8F92BC02A;
	Sat, 12 Mar 2022 09:20:12 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(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 1D3BF2BC02A
	for <gentoo-commits@lists.gentoo.org>; Sat, 12 Mar 2022 09:20:12 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(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 C3881343064
	for <gentoo-commits@lists.gentoo.org>; Sat, 12 Mar 2022 09:20:09 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 9AAD5330
	for <gentoo-commits@lists.gentoo.org>; Sat, 12 Mar 2022 09:20:04 +0000 (UTC)
From: "Michał Górny" <mgorny@gentoo.org>
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" <mgorny@gentoo.org>
Message-ID: <1647076690.7043e737dddd6dca2702d482b1ba2e4bea3a5ea5.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-14.0.0_rc4.ebuild
X-VCS-Directories: sys-libs/libomp/
X-VCS-Committer: mgorny
X-VCS-Committer-Name: Michał Górny
X-VCS-Revision: 7043e737dddd6dca2702d482b1ba2e4bea3a5ea5
X-VCS-Branch: master
Date: Sat, 12 Mar 2022 09:20:04 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 3dd542c3-8352-40cb-8b5b-1e8f8396bb3c
X-Archives-Hash: 58d0606f197cf702410c0050c0cc1335

commit:     7043e737dddd6dca2702d482b1ba2e4bea3a5ea5
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 12 09:18:10 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Mar 12 09:18:10 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7043e737

sys-libs/libomp: Bump to 14.0.0_rc4

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

 sys-libs/libomp/Manifest                 |   1 +
 sys-libs/libomp/libomp-14.0.0_rc4.ebuild | 134 +++++++++++++++++++++++++++++++
 2 files changed, 135 insertions(+)

diff --git a/sys-libs/libomp/Manifest b/sys-libs/libomp/Manifest
index a8eb0d1d89d5..89d9571285a7 100644
--- a/sys-libs/libomp/Manifest
+++ b/sys-libs/libomp/Manifest
@@ -6,3 +6,4 @@ DIST llvmorg-12.0.1.tar.gz 134259748 BLAKE2B f41de787bc73ff2edfda1b22cc8602be6f6
 DIST llvmorg-13.0.0.tar.gz 147270176 BLAKE2B 628f316b580e1edf3a58d4825b724df759e6ed2a4116802470c04562caefc392fa325c91f388036365a2e45a9595cca6d3557fab12984fc8bcfef29c9116d822 SHA512 8004c05d32b9720fb3391783621690c1df9bd1e97e72cbff9192ed88a84b0acd303b61432145fa917b5b5e548c8cee29b24ef8547dcc8677adf4816e7a8a0eb2
 DIST llvmorg-13.0.1.tar.gz 147290251 BLAKE2B 2a44b012a672501761d0c27c6b3a315b69bfef0cd13b078a7e7d2fccc4a9c8c0f2bee0f164c4271c9106b0a99cb06e8b64986f66253b613336719fb86b82541b SHA512 9a8cb5d11964ba88b7624f19ec861fb28701f23956ea3c92f6ac644332d5f41fde97bd8933dd3ee70ed378058c252fa3a3887c8d1af90d219970c2b27691166f
 DIST llvmorg-14.0.0-rc2.tar.gz 158069989 BLAKE2B 06dcf5d82cd100bd792eadb3816cb297a11dc64dc8b699ccb2eac8ef0da4f10a24ba1984376427b638def6c8c8ae5bc9562e1cc30281fc55f044aa2a9657fc81 SHA512 c77d8c6db2ee6536f7e980465d5a3eb34403c6529e2012a4778ce76a559a6d639cf4c5ec84f965287d4b0739a73dc3e65d7deb27815d74c35e823839e579d2a3
+DIST llvmorg-14.0.0-rc4.tar.gz 158082013 BLAKE2B 0e717898d8f1ed160e525a68aba56a84b7d31856ea72fdb8fa02e863c5a2074245a38d4a4aa7d178beab1ea64aa92d0ba9dcad4373ebb03868070bf718112107 SHA512 a942848aa5042b97bab6d0d5bcee11ea2f85f1244d7eaadb8f7000bf104b2160e6034c04e3755501dd178bc99c26669cf4aca40edb4bba598fdde6bcf3f40ddc

diff --git a/sys-libs/libomp/libomp-14.0.0_rc4.ebuild b/sys-libs/libomp/libomp-14.0.0_rc4.ebuild
new file mode 100644
index 000000000000..dbee89f1997c
--- /dev/null
+++ b/sys-libs/libomp/libomp-14.0.0_rc4.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+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=""
+IUSE="cuda debug hwloc offload ompt test
+	llvm_targets_AMDGPU llvm_targets_NVPTX"
+# CUDA works only with the x86_64 ABI
+REQUIRED_USE="
+	cuda? ( llvm_targets_NVPTX )
+	offload? ( cuda? ( abi_x86_64 ) )"
+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}]
+		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
+}