Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 822369 - sys-libs/libomp-13.0.0 fails to build with USE="offload abi_x86_32" LLVM_TARGETS=NVPTX
Summary: sys-libs/libomp-13.0.0 fails to build with USE="offload abi_x86_32" LLVM_TARG...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Bernard Cafarelli
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2021-11-08 00:01 UTC by Fat-Zer
Modified: 2021-11-08 10:34 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,19.40 KB, text/x-log)
2021-11-08 00:04 UTC, Fat-Zer
Details
emerge --info '=sys-libs/libomp-13.0.0::gentoo' (file_822369.txt,11.33 KB, text/plain)
2021-11-08 00:05 UTC, Fat-Zer
Details
environment (environment,169.44 KB, text/plain)
2021-11-08 00:07 UTC, Fat-Zer
Details
proposed patch (file_822369.txt,779 bytes, patch)
2021-11-08 04:13 UTC, Fat-Zer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fat-Zer 2021-11-08 00:01:37 UTC
subj;

It looks like the assumption in the ebuild comments is not true anymore:

 97         # this is non-fatal and libomp checks for CUDA conditionally
 98         # to ABI, so we can just ignore passing the wrong value
 99         # on non-amd64 ABIs

So the offloading should be enabled only for the amd64 ABI.

Reproducible: Always

Steps to Reproduce:
1. USE="cuda offload abi_x86_32" emerge --info '=sys-libs/libomp-13.0.0::gentoo'
Actual Results:  
Configuration error

Expected Results:  
Compilation
Comment 1 Fat-Zer 2021-11-08 00:04:24 UTC
Created attachment 749469 [details]
build.log
Comment 2 Fat-Zer 2021-11-08 00:05:10 UTC
Created attachment 749472 [details]
emerge --info '=sys-libs/libomp-13.0.0::gentoo'
Comment 3 Fat-Zer 2021-11-08 00:07:06 UTC
Created attachment 749475 [details]
environment
Comment 4 Fat-Zer 2021-11-08 04:13:26 UTC
Created attachment 749481 [details, diff]
proposed patch
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-11-08 08:31:09 UTC
What nvidia-cuda-toolkit version are you using?  I'm surprised you have /usr/lib/libcuda.so.
Comment 6 Ionen Wolkens gentoo-dev 2021-11-08 08:49:08 UTC
(In reply to Michał Górny from comment #5)
> What nvidia-cuda-toolkit version are you using?  I'm surprised you have
> /usr/lib/libcuda.so.
/usr/lib/libcuda.so is installed by nvidia-drivers[abi_x86_32], not nvidia-cuda-toolkit
Comment 7 Fat-Zer 2021-11-08 09:31:13 UTC
(In reply to Michał Górny from comment #5)
> What nvidia-cuda-toolkit version are you using?

   $ emerge -pqv nvidia-cuda-toolkit
   [ebuild   R   ] dev-util/nvidia-cuda-toolkit-11.5.0  USE="-debugger -nsight -profiler -sanitizer -vis-profiler"

> I'm surprised you have /usr/lib/libcuda.so.

As Ionen Wolkens noticed the libcuda.so is installed by nvidia-drivers:

  $ equery b /usr/lib/libcuda.so
  * Searching for /usr/lib/libcuda.so ...
  x11-drivers/nvidia-drivers-495.44 (/usr/lib/libcuda.so.495.44)
  x11-drivers/nvidia-drivers-495.44 (/usr/lib/libcuda.so -> libcuda.so.495.44)
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-11-08 09:57:49 UTC
Ok, it turned out I couldn't reproduce because I had ccache enabled... and the stupid package assumes that llvm-link must be present in the same directory as the compiler.  Since it wasn't present in the ccache shadow directory, the check for llvm-link failed and it disabled nvidia stuff.
Comment 9 Larry the Git Cow gentoo-dev 2021-11-08 10:34:33 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=49fe1591b8692a955419f9bd944aa51b5e4f19b4

commit 49fe1591b8692a955419f9bd944aa51b5e4f19b4
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2021-11-08 10:18:39 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2021-11-08 10:34:28 +0000

    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>

 sys-libs/libomp/libomp-13.0.0-r1.ebuild   | 32 +++++++++++++++++--------------
 sys-libs/libomp/libomp-13.0.0.9999.ebuild | 32 +++++++++++++++++--------------
 sys-libs/libomp/libomp-14.0.0.9999.ebuild | 32 +++++++++++++++++--------------
 3 files changed, 54 insertions(+), 42 deletions(-)