Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 903017 - dev-util/spirv-llvm-translator-16.0.0 - cmake failed
Summary: dev-util/spirv-llvm-translator-16.0.0 - cmake failed
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jan Henke
URL:
Whiteboard:
Keywords:
: 903019 903099 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-03-25 08:48 UTC by Toralf Förster
Modified: 2023-04-09 19:55 UTC (History)
6 users (show)

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


Attachments
emerge-info.txt (emerge-info.txt,20.37 KB, text/plain)
2023-03-25 08:48 UTC, Toralf Förster
Details
dev-util:spirv-llvm-translator-16.0.0:20230325-012931.log (dev-util:spirv-llvm-translator-16.0.0:20230325-012931.log,18.92 KB, text/plain)
2023-03-25 08:48 UTC, Toralf Förster
Details
emerge-history.txt.bz2 (emerge-history.txt.bz2,92.77 KB, application/x-bzip)
2023-03-25 08:48 UTC, Toralf Förster
Details
environment (environment,99.41 KB, text/plain)
2023-03-25 08:48 UTC, Toralf Förster
Details
etc.clang.tar.bz2 (etc.clang.tar.bz2,715 bytes, application/x-bzip)
2023-03-25 08:48 UTC, Toralf Förster
Details
etc.portage.tar.bz2 (etc.portage.tar.bz2,32.88 KB, application/x-bzip)
2023-03-25 08:48 UTC, Toralf Förster
Details
temp.tar.bz2 (temp.tar.bz2,26.31 KB, application/x-bzip)
2023-03-25 08:48 UTC, Toralf Förster
Details
Work around (fix.patch,520 bytes, patch)
2023-04-02 10:45 UTC, Mike Lothian
Details | Diff
build.log.gz (build.log.gz,94.19 KB, application/gzip)
2023-04-05 10:10 UTC, darkbasic
Details
build.log (build.log,18.81 KB, text/plain)
2023-04-05 10:11 UTC, darkbasic
Details
static.patch (static.patch,362 bytes, patch)
2023-04-05 15:25 UTC, darkbasic
Details | Diff
Updated patch (fix.patch,667 bytes, patch)
2023-04-06 09:53 UTC, Mike Lothian
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2023-03-25 08:48:31 UTC
  lib/SPIRV/CMakeLists.txt:42 (add_llvm_library)


-- Generating done (0.0s)
CMake Generate step failed.  Build files cannot be regenerated correctly.
 * ERROR: dev-util/spirv-llvm-translator-16.0.0::gentoo failed (configure phase):
 *   cmake failed
 * 
 * Call stack:

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_no_multilib-j5-20230316-050014

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-10
 [2] x86_64-pc-linux-gnu-12 *
clang/llvm (if any):
clang version 16.0.0
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/16/bin
Configuration file: /etc/clang/clang.cfg
/usr/lib/llvm/16
16.0.0
Python 3.10.10
Available Ruby profiles:
  [1]   ruby27 (with Rubygems)
  [2]   ruby30 (with Rubygems) *
Available Rust versions:
  [1]   rust-bin-1.68.1
  [2]   rust-1.68.1 *
The following VMs are available for generation-2:
1)	Eclipse Temurin JDK 11.0.18_p10 [openjdk-bin-11]
*)	Eclipse Temurin JDK 17.0.6_p10 [openjdk-bin-17]
3)	Eclipse Temurin JDK 8.362_p09 [openjdk-bin-8]
4)	Eclipse Temurin JRE 17.0.6_p10 [openjdk-jre-bin-17]
Available Java Virtual Machines:
  [1]   openjdk-bin-8 
  [2]   openjdk-bin-11 
  [3]   openjdk-bin-17  system-vm
  [4]   openjdk-jre-bin-17 

The Glorious Glasgow Haskell Compilation System, version 9.0.2
php cli (if any):

  HEAD of ::gentoo
commit c6085bc912444325d2c84c455703ca1eb1a6f1d1
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Sat Mar 25 01:01:51 2023 +0000

    2023-03-25 01:01:51 UTC

emerge -qpvO dev-util/spirv-llvm-translator
[ebuild  NS   ] dev-util/spirv-llvm-translator-16.0.0 [15.0.0] USE="tools -test"
Comment 1 Toralf Förster gentoo-dev 2023-03-25 08:48:32 UTC
Created attachment 858931 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2023-03-25 08:48:33 UTC
Created attachment 858933 [details]
dev-util:spirv-llvm-translator-16.0.0:20230325-012931.log
Comment 3 Toralf Förster gentoo-dev 2023-03-25 08:48:34 UTC
Created attachment 858935 [details]
emerge-history.txt.bz2
Comment 4 Toralf Förster gentoo-dev 2023-03-25 08:48:35 UTC
Created attachment 858937 [details]
environment
Comment 5 Toralf Förster gentoo-dev 2023-03-25 08:48:36 UTC
Created attachment 858939 [details]
etc.clang.tar.bz2
Comment 6 Toralf Förster gentoo-dev 2023-03-25 08:48:37 UTC
Created attachment 858941 [details]
etc.portage.tar.bz2
Comment 7 Toralf Förster gentoo-dev 2023-03-25 08:48:39 UTC
Created attachment 858943 [details]
temp.tar.bz2
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2023-03-27 18:24:01 UTC
*** Bug 903099 has been marked as a duplicate of this bug. ***
Comment 9 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2023-03-27 18:24:25 UTC
*** Bug 903019 has been marked as a duplicate of this bug. ***
Comment 10 Mike Lothian 2023-04-02 10:44:15 UTC
So I got this working locally, it needed a newer version of spriv-headers (1.3.243) and I'll attach a patch that stops CMake looking for things that are definitely there
Comment 11 Mike Lothian 2023-04-02 10:45:46 UTC
Created attachment 859437 [details, diff]
Work around

I've popped the newer version of spirv-headers and this patch in the FireBurn overlay and I've got Rusticl OpenCL working with Clang 16
Comment 12 Conrad Kostecki gentoo-dev 2023-04-03 20:20:20 UTC
@mgorny: Could you have a look at the patch? What are those components?
Comment 13 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2023-04-04 04:44:16 UTC
(In reply to Conrad Kostecki from comment #12)
> @mgorny: Could you have a look at the patch? What are those components?

The patch probably isn't 100% upstream-correct but it's good enough for Gentoo.  Fedora seems to have a "more correct" patch [1] but it's much longer and I'm not sure about it.

Components are static libraries.  We're building a "dylib" that contains all static libraries combined.  Since we're not installing LLVM static libraries, they can't DEPEND on them -- and I'm not sure why they do in the first place, if they clearly account for dylib being linked rather than the static libs.

[1] https://src.fedoraproject.org/rpms/spirv-llvm-translator/pull-request/5#request_diff
Comment 14 darkbasic 2023-04-05 10:10:56 UTC
Created attachment 859534 [details]
build.log.gz

Unfortunately Mike's patch is not enough for me.
Comment 15 darkbasic 2023-04-05 10:11:53 UTC
Created attachment 859535 [details]
build.log

Fedora's patch fails at well with different errors.
Comment 16 darkbasic 2023-04-05 15:25:20 UTC
Created attachment 859553 [details, diff]
static.patch

Mike's patch plus the attached one fixed the build for me.

More info: https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/1936#issuecomment-1496563307
Comment 17 Mike Lothian 2023-04-06 09:53:32 UTC
Created attachment 859612 [details, diff]
Updated patch
Comment 18 darkbasic 2023-04-06 11:04:44 UTC
A better fix would be the following but it's still waiting for the CLA before being merged upstream:
https://github.com/KhronosGroup/SPIRV-LLVM-Translator/pull/1889

Please note that I still didn't test it yet.
Comment 19 Mike Lothian 2023-04-07 07:32:27 UTC
Whilst we have all this focus, can we update the ebuild to put the pkgconfig file into /usr/lib64/pkgconfig rather than /usr/lib/llvm/16/lib64/pkgconfig/LLVMSPIRVLib.pc?
Comment 20 Mike Lothian 2023-04-07 07:41:01 UTC
And I still need to create a symbolic link to get rusticl to stop complaining about opencl-c-base.h beiing missing

ln -s /usr/lib/clang /usr/lib/llvm/16/lib64/clang
Comment 21 darkbasic 2023-04-07 08:49:45 UTC
You can use PKG_CONFIG_LIBDIR instead:
https://github.com/gentoo/gentoo/pull/28209/files#diff-6c473421061cb7b3f14120cd9f34d9e88cb35c258b00e1c776909a25eab0840fR406

But I agree that it would be better without having to do so.
Comment 22 darkbasic 2023-04-07 08:54:33 UTC
Oh wait I think that's another issue: opencl-c-base.h is way more annoying and needs an out of tree patch which is NOT going to be mainlined:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19232#note_1776640

We definitely need a fix for that one because Mesa didn't manage to find a satisfying solution and they're currently consulting with llvm developers to figure out a way to get the path.
Comment 23 Larry the Git Cow gentoo-dev 2023-04-09 19:55:15 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8d83abc346d4856b7a87a8007b4094f4996056b6

commit 8d83abc346d4856b7a87a8007b4094f4996056b6
Author:     Conrad Kostecki <conikost@gentoo.org>
AuthorDate: 2023-04-09 19:53:45 +0000
Commit:     Conrad Kostecki <conikost@gentoo.org>
CommitDate: 2023-04-09 19:55:07 +0000

    dev-util/spirv-llvm-translator: fix build
    
    Closes: https://bugs.gentoo.org/903017
    Signed-off-by: Conrad Kostecki <conikost@gentoo.org>

 ...vm-translator-16.0.0-llvm-link-llvm-dylib.patch | 73 ++++++++++++++++++++++
 .../spirv-llvm-translator-16.0.0.ebuild            |  2 +
 profiles/package.mask                              |  4 --
 3 files changed, 75 insertions(+), 4 deletions(-)