summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2018-01-20 09:05:03 +0100
committerMichał Górny <mgorny@gentoo.org>2018-01-20 09:54:38 +0100
commit6bd35597bac4453dbdd861daba54b9228558a4df (patch)
treec93989a226a41448c2ce832e7196ee37952d0cd5 /sys-libs/libomp/libomp-6.0.9999.ebuild
parentsys-libs/llvm-libunwind: Enable testing (diff)
downloadgentoo-6bd35597bac4453dbdd861daba54b9228558a4df.tar.gz
gentoo-6bd35597bac4453dbdd861daba54b9228558a4df.tar.bz2
gentoo-6bd35597bac4453dbdd861daba54b9228558a4df.zip
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
Diffstat (limited to 'sys-libs/libomp/libomp-6.0.9999.ebuild')
-rw-r--r--sys-libs/libomp/libomp-6.0.9999.ebuild28
1 files changed, 23 insertions, 5 deletions
diff --git a/sys-libs/libomp/libomp-6.0.9999.ebuild b/sys-libs/libomp/libomp-6.0.9999.ebuild
index 5e156aca296c..fe232b72fc87 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++")"