diff options
author | Michał Górny <mgorny@gentoo.org> | 2021-11-08 11:18:39 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2021-11-08 11:34:28 +0100 |
commit | 49fe1591b8692a955419f9bd944aa51b5e4f19b4 (patch) | |
tree | 57035e673f5c00c8bacf6b168b3e0e6dd78eb728 /sys-libs | |
parent | sys-libs/libomp: Fix finding llvm-link when using compiler shadow (diff) | |
download | gentoo-49fe1591b8692a955419f9bd944aa51b5e4f19b4.tar.gz gentoo-49fe1591b8692a955419f9bd944aa51b5e4f19b4.tar.bz2 gentoo-49fe1591b8692a955419f9bd944aa51b5e4f19b4.zip |
sys-libs/libomp: Selectively enable deviceRTLs based on CHOST
deviceRTLs are only supported on amd64, aarch64 and ppc64le, and trying
to build them elsewhere may cause CMake failures. Check CHOST
to determine whether to enable them.
Closes: https://bugs.gentoo.org/822369
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'sys-libs')
-rw-r--r-- | sys-libs/libomp/libomp-13.0.0-r1.ebuild | 32 | ||||
-rw-r--r-- | sys-libs/libomp/libomp-13.0.0.9999.ebuild | 32 | ||||
-rw-r--r-- | sys-libs/libomp/libomp-14.0.0.9999.ebuild | 32 |
3 files changed, 54 insertions, 42 deletions
diff --git a/sys-libs/libomp/libomp-13.0.0-r1.ebuild b/sys-libs/libomp/libomp-13.0.0-r1.ebuild index 9009d8a82952..e7e848f2cb27 100644 --- a/sys-libs/libomp/libomp-13.0.0-r1.ebuild +++ b/sys-libs/libomp/libomp-13.0.0-r1.ebuild @@ -93,20 +93,24 @@ multilib_src_configure() { # 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) - - -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)" - ) + if use offload && 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 use test && mycmakeargs+=( # this project does not use standard LLVM cmake macros -DOPENMP_LLVM_LIT_EXECUTABLE="${EPREFIX}/usr/bin/lit" diff --git a/sys-libs/libomp/libomp-13.0.0.9999.ebuild b/sys-libs/libomp/libomp-13.0.0.9999.ebuild index 8ff1b93cd2f6..28c0f1fb620c 100644 --- a/sys-libs/libomp/libomp-13.0.0.9999.ebuild +++ b/sys-libs/libomp/libomp-13.0.0.9999.ebuild @@ -92,20 +92,24 @@ multilib_src_configure() { # 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) - - -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)" - ) + if use offload && 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 use test && mycmakeargs+=( # this project does not use standard LLVM cmake macros -DOPENMP_LLVM_LIT_EXECUTABLE="${EPREFIX}/usr/bin/lit" diff --git a/sys-libs/libomp/libomp-14.0.0.9999.ebuild b/sys-libs/libomp/libomp-14.0.0.9999.ebuild index 8ff1b93cd2f6..28c0f1fb620c 100644 --- a/sys-libs/libomp/libomp-14.0.0.9999.ebuild +++ b/sys-libs/libomp/libomp-14.0.0.9999.ebuild @@ -92,20 +92,24 @@ multilib_src_configure() { # 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) - - -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)" - ) + if use offload && 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 use test && mycmakeargs+=( # this project does not use standard LLVM cmake macros -DOPENMP_LLVM_LIT_EXECUTABLE="${EPREFIX}/usr/bin/lit" |