commit:     20caeaec04410f2470ea6ed2bd6aac14ed09ee9c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Oct  5 15:33:38 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Oct  5 15:34:22 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20caeaec

sys-libs/libomp: Add flags & deps for deviceRTLs

Closes: https://bugs.gentoo.org/816270
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 sys-libs/libomp/libomp-13.0.0.9999.ebuild | 20 ++++++++++++++++----
 sys-libs/libomp/libomp-13.0.0.ebuild      | 20 ++++++++++++++++----
 sys-libs/libomp/libomp-14.0.0.9999.ebuild | 20 ++++++++++++++++----
 3 files changed, 48 insertions(+), 12 deletions(-)

diff --git a/sys-libs/libomp/libomp-13.0.0.9999.ebuild 
b/sys-libs/libomp/libomp-13.0.0.9999.ebuild
index cce3a6bf584..c16560830be 100644
--- a/sys-libs/libomp/libomp-13.0.0.9999.ebuild
+++ b/sys-libs/libomp/libomp-13.0.0.9999.ebuild
@@ -13,9 +13,12 @@ HOMEPAGE="https://openmp.llvm.org";
 LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
 SLOT="0"
 KEYWORDS=""
-IUSE="cuda debug hwloc kernel_linux offload ompt test"
+IUSE="cuda debug hwloc kernel_linux offload ompt test
+       llvm_targets_AMDGPU llvm_targets_NVPTX"
 # CUDA works only with the x86_64 ABI
-REQUIRED_USE="offload? ( cuda? ( abi_x86_64 ) )"
+REQUIRED_USE="
+       cuda? ( llvm_targets_NVPTX )
+       offload? ( cuda? ( abi_x86_64 ) )"
 RESTRICT="!test? ( test )"
 
 RDEPEND="
@@ -32,10 +35,14 @@ RDEPEND="
 # - sys-devel/clang provides the compiler to run tests
 DEPEND="${RDEPEND}"
 BDEPEND="dev-lang/perl
-       offload? ( virtual/pkgconfig )
+       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-6
+               sys-devel/clang
        )"
 
 LLVM_COMPONENTS=( openmp llvm/include )
@@ -90,6 +97,11 @@ multilib_src_configure() {
                # to ABI, so we can just ignore passing the wrong value
                # on non-amd64 ABIs
                -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")"
        )
        use test && mycmakeargs+=(
                # this project does not use standard LLVM cmake macros

diff --git a/sys-libs/libomp/libomp-13.0.0.ebuild 
b/sys-libs/libomp/libomp-13.0.0.ebuild
index d40f733e636..8771f7014c5 100644
--- a/sys-libs/libomp/libomp-13.0.0.ebuild
+++ b/sys-libs/libomp/libomp-13.0.0.ebuild
@@ -13,9 +13,12 @@ HOMEPAGE="https://openmp.llvm.org";
 LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
 SLOT="0"
 KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86 ~amd64-linux ~x64-macos"
-IUSE="cuda debug hwloc kernel_linux offload ompt test"
+IUSE="cuda debug hwloc kernel_linux offload ompt test
+       llvm_targets_AMDGPU llvm_targets_NVPTX"
 # CUDA works only with the x86_64 ABI
-REQUIRED_USE="offload? ( cuda? ( abi_x86_64 ) )"
+REQUIRED_USE="
+       cuda? ( llvm_targets_NVPTX )
+       offload? ( cuda? ( abi_x86_64 ) )"
 RESTRICT="!test? ( test )"
 
 RDEPEND="
@@ -32,10 +35,14 @@ RDEPEND="
 # - sys-devel/clang provides the compiler to run tests
 DEPEND="${RDEPEND}"
 BDEPEND="dev-lang/perl
-       offload? ( virtual/pkgconfig )
+       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-6
+               sys-devel/clang
        )"
 
 LLVM_COMPONENTS=( openmp llvm/include )
@@ -91,6 +98,11 @@ multilib_src_configure() {
                # to ABI, so we can just ignore passing the wrong value
                # on non-amd64 ABIs
                -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")"
        )
        use test && mycmakeargs+=(
                # this project does not use standard LLVM cmake macros

diff --git a/sys-libs/libomp/libomp-14.0.0.9999.ebuild 
b/sys-libs/libomp/libomp-14.0.0.9999.ebuild
index cce3a6bf584..c16560830be 100644
--- a/sys-libs/libomp/libomp-14.0.0.9999.ebuild
+++ b/sys-libs/libomp/libomp-14.0.0.9999.ebuild
@@ -13,9 +13,12 @@ HOMEPAGE="https://openmp.llvm.org";
 LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
 SLOT="0"
 KEYWORDS=""
-IUSE="cuda debug hwloc kernel_linux offload ompt test"
+IUSE="cuda debug hwloc kernel_linux offload ompt test
+       llvm_targets_AMDGPU llvm_targets_NVPTX"
 # CUDA works only with the x86_64 ABI
-REQUIRED_USE="offload? ( cuda? ( abi_x86_64 ) )"
+REQUIRED_USE="
+       cuda? ( llvm_targets_NVPTX )
+       offload? ( cuda? ( abi_x86_64 ) )"
 RESTRICT="!test? ( test )"
 
 RDEPEND="
@@ -32,10 +35,14 @@ RDEPEND="
 # - sys-devel/clang provides the compiler to run tests
 DEPEND="${RDEPEND}"
 BDEPEND="dev-lang/perl
-       offload? ( virtual/pkgconfig )
+       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-6
+               sys-devel/clang
        )"
 
 LLVM_COMPONENTS=( openmp llvm/include )
@@ -90,6 +97,11 @@ multilib_src_configure() {
                # to ABI, so we can just ignore passing the wrong value
                # on non-amd64 ABIs
                -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")"
        )
        use test && mycmakeargs+=(
                # this project does not use standard LLVM cmake macros

Reply via email to