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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4F9E61382C5 for ; Sat, 20 Jan 2018 08:54:57 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 31113E092F; Sat, 20 Jan 2018 08:54:56 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id F4196E092F for ; Sat, 20 Jan 2018 08:54:55 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 58DD0335C3A for ; Sat, 20 Jan 2018 08:54:54 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D2B481BB for ; Sat, 20 Jan 2018 08:54:52 +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: <1516438478.6bd35597bac4453dbdd861daba54b9228558a4df.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libomp/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-libs/libomp/libomp-6.0.9999.ebuild sys-libs/libomp/libomp-9999.ebuild sys-libs/libomp/metadata.xml X-VCS-Directories: sys-libs/libomp/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 6bd35597bac4453dbdd861daba54b9228558a4df X-VCS-Branch: master Date: Sat, 20 Jan 2018 08:54:52 +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-Archives-Salt: ca15affc-c1c9-4d85-bc35-0e15795ac2b6 X-Archives-Hash: 2c171f9afb7093c6563a2478412d48eb commit: 6bd35597bac4453dbdd861daba54b9228558a4df Author: Michał Górny gentoo org> AuthorDate: Sat Jan 20 08:05:03 2018 +0000 Commit: Michał Górny gentoo org> CommitDate: Sat Jan 20 08:54:38 2018 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6bd35597 sys-libs/libomp: Add flags to control offloading (to 6+) Add USE=offload to control building libomptarget for offloading. When enabled, build the native offloading plugin unconditionally. Also add USE=cuda to support building the CUDA plugin. Closes: https://bugs.gentoo.org/645048 sys-libs/libomp/libomp-6.0.9999.ebuild | 28 +++++++++++++++++++++++----- sys-libs/libomp/libomp-9999.ebuild | 30 ++++++++++++++++++++++++------ sys-libs/libomp/metadata.xml | 2 ++ 3 files changed, 49 insertions(+), 11 deletions(-) diff --git a/sys-libs/libomp/libomp-6.0.9999.ebuild b/sys-libs/libomp/libomp-6.0.9999.ebuild index 5e156aca296..fe232b72fc8 100644 --- a/sys-libs/libomp/libomp-6.0.9999.ebuild +++ b/sys-libs/libomp/libomp-6.0.9999.ebuild @@ -24,19 +24,27 @@ EGIT_BRANCH="release_60" LICENSE="|| ( UoI-NCSA MIT ) MIT LLVM-Grant" SLOT="0" KEYWORDS="" -IUSE="hwloc ompt test" +IUSE="cuda hwloc offload ompt test" +# CUDA works only with the x86_64 ABI +REQUIRED_USE="offload? ( cuda? ( abi_x86_64 ) )" RESTRICT="!test? ( test )" -RDEPEND="hwloc? ( sys-apps/hwloc:0=[${MULTILIB_USEDEP}] )" +RDEPEND=" + hwloc? ( sys-apps/hwloc:0=[${MULTILIB_USEDEP}] ) + offload? ( + virtual/libelf:=[${MULTILIB_USEDEP}] + virtual/libffi:=[${MULTILIB_USEDEP}] + cuda? ( dev-util/nvidia-cuda-sdk:= ) + )" # 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} dev-lang/perl + offload? ( virtual/pkgconfig[${MULTILIB_USEDEP}] ) test? ( $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') - sys-devel/llvm >=sys-devel/clang-6 )" @@ -69,14 +77,24 @@ multilib_src_configure() { -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 ) + use offload && mycmakeargs+=( + # this is non-fatal and libomp checks for CUDA conditionally + # to ABI, so we can just ignore passing the wrong value + # on non-amd64 ABIs + -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=$(usex !cuda) + ) use test && mycmakeargs+=( - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" - -DLLVM_LIT_ARGS="-vv" + # this project does not use standard LLVM cmake macros + -DOPENMP_LLVM_LIT_EXECUTABLE="${EPREFIX}/usr/bin/lit" + -DOPENMP_LIT_ARGS="-vv" -DOPENMP_TEST_C_COMPILER="$(type -P "${CHOST}-clang")" -DOPENMP_TEST_CXX_COMPILER="$(type -P "${CHOST}-clang++")" diff --git a/sys-libs/libomp/libomp-9999.ebuild b/sys-libs/libomp/libomp-9999.ebuild index ad6d62ae744..d215cbe3638 100644 --- a/sys-libs/libomp/libomp-9999.ebuild +++ b/sys-libs/libomp/libomp-9999.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 EAPI=6 @@ -23,19 +23,27 @@ EGIT_REPO_URI="https://git.llvm.org/git/openmp.git LICENSE="|| ( UoI-NCSA MIT ) MIT LLVM-Grant" SLOT="0" KEYWORDS="" -IUSE="hwloc ompt test" +IUSE="cuda hwloc offload ompt test" +# CUDA works only with the x86_64 ABI +REQUIRED_USE="offload? ( cuda? ( abi_x86_64 ) )" RESTRICT="!test? ( test )" -RDEPEND="hwloc? ( sys-apps/hwloc:0=[${MULTILIB_USEDEP}] )" +RDEPEND=" + hwloc? ( sys-apps/hwloc:0=[${MULTILIB_USEDEP}] ) + offload? ( + virtual/libelf:=[${MULTILIB_USEDEP}] + virtual/libffi:=[${MULTILIB_USEDEP}] + cuda? ( dev-util/nvidia-cuda-sdk:= ) + )" # 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} dev-lang/perl + offload? ( virtual/pkgconfig[${MULTILIB_USEDEP}] ) test? ( $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') - sys-devel/llvm >=sys-devel/clang-6 )" @@ -68,14 +76,24 @@ multilib_src_configure() { -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 ) + use offload && mycmakeargs+=( + # this is non-fatal and libomp checks for CUDA conditionally + # to ABI, so we can just ignore passing the wrong value + # on non-amd64 ABIs + -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=$(usex !cuda) + ) use test && mycmakeargs+=( - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" - -DLLVM_LIT_ARGS="-vv" + # this project does not use standard LLVM cmake macros + -DOPENMP_LLVM_LIT_EXECUTABLE="${EPREFIX}/usr/bin/lit" + -DOPENMP_LIT_ARGS="-vv" -DOPENMP_TEST_C_COMPILER="$(type -P "${CHOST}-clang")" -DOPENMP_TEST_CXX_COMPILER="$(type -P "${CHOST}-clang++")" diff --git a/sys-libs/libomp/metadata.xml b/sys-libs/libomp/metadata.xml index ca91e84fce5..58df765860e 100644 --- a/sys-libs/libomp/metadata.xml +++ b/sys-libs/libomp/metadata.xml @@ -9,7 +9,9 @@ llvm@gentoo.org + Build CUDA offloading plugin (only with USE=offload) Enable CPU affinity support via hwloc + Support offloading OpenMP using libomptarget Enable OpenMP Tools Interface support The OpenMP subproject of LLVM is intended to contain all of the components required to build an executing OpenMP program that are outside the compiler itself.