Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Arch Linux] "could not find native static library SPIRV-Tools-opt, perhaps an -L flag is missing?" #61

Closed
mitchmindtree opened this issue Jul 28, 2019 · 5 comments

Comments

@mitchmindtree
Copy link

This error started occurring on my Arch Linux system after doing a fresh build of nannou yesterday which relies on this crate via vulkano_shaders.

This seems related to #58, though the patch posted at #59 seems to make no difference in my case. @Abendstolz were you able to get shaderc building (not just type-checking) with the patch at #59? cargo check works OK for me, but cargo build fails with the title error.

Here is the full output I get when attempting to build shaderc-rs master branch today:

[mindtree@mindtree shaderc-rs]$ cargo build
   Compiling cc v1.0.38
   Compiling libc v0.2.60
   Compiling cmake v0.1.40
   Compiling shaderc-sys v0.6.0 (/home/mindtree/programming/rust/shaderc-rs/shaderc-sys)
warning: Checking for system installed libraries.  Use --features = build-from-source to disable this behavior
warning: Found SPIRV.  Linking libSPIRV & libglslang
error: could not find native static library `SPIRV-Tools-opt`, perhaps an -L flag is missing?

error: aborting due to previous error

The following warnings were emitted during compilation:

warning: Checking for system installed libraries.  Use --features = build-from-source to disable this behavior
warning: Found SPIRV.  Linking libSPIRV & libglslang

error: Could not compile `shaderc-sys`.

Here is the full output building the patch at #59 with unrelated deprecated item warnings omitted:

[mindtree@mindtree shaderc-rs]$ cargo build                                                                                                   
   Compiling cc v1.0.38                                                                                                                       
   Compiling libc v0.2.60                                              
   Compiling cmake v0.1.40                                                                                                                    
   Compiling shaderc-sys v0.5.0 (/home/mindtree/programming/rust/shaderc-rs/shaderc-sys)                                                      
warning: Checking for system installed libraries.  Use --features = build-from-source to disable this behavior
warning: Found SPIRV.  Linking libSPIRV & libglslang

# ... Deprecated item warnings ...

error: could not find native static library `SPIRV-Tools-opt`, perhaps an -L flag is missing?

error: aborting due to previous error

The following warnings were emitted during compilation:

warning: Checking for system installed libraries.  Use --features = build-from-source to disable this behavior
warning: Found SPIRV.  Linking libSPIRV & libglslang

error: Could not compile `shaderc-sys`.

I cargo cleaned and cargo updated before each to ensure no old broken artifacts were being used. Using the "build-from-source" feature seems to make no difference to the output in either case.

Here are the related libSPIRV* libraries I can find in my /usr/lib directory:

-rw-r--r--   1 root root 1010K Jul 19 19:46 libSPIRV.a                                                                                        
-rwxr-xr-x   1 root root  526K Jul 19 19:46 libSPIRV.so                                                                                       
lrwxrwxrwx   1 root root    11 Jul 19 19:46 libSPIRV.so.0 -> libSPIRV.so                                                                      
-rwxr-xr-x   1 root root   98K Jul 19 18:38 libSPIRV-Tools-link.so                                                                            
-rwxr-xr-x   1 root root  2.6M Jul 19 18:38 libSPIRV-Tools-opt.so                                                                             
-rwxr-xr-x   1 root root  178K Jul 19 18:38 libSPIRV-Tools-reduce.so                                                                          
-rwxr-xr-x   1 root root  1.1M Jul 19 18:38 libSPIRV-Tools-shared.so                                                                          
-rwxr-xr-x   1 root root  1.2M Jul 19 18:38 libSPIRV-Tools.so                                                                                 

Any advice on solutions/workarounds would be greatly appreciated!

@mitchmindtree mitchmindtree changed the title "could not find native static library SPIRV-Tools-opt, perhaps an -L flag is missing?" [Arch Linux] "could not find native static library SPIRV-Tools-opt, perhaps an -L flag is missing?" Jul 28, 2019
@Abendstolz
Copy link

Hey @mitchmindtree,

as I wrote in #58 I've fixed it on my machine with:

[dependencies]
... 
# Fixing broken detection of glslang on my arch machine, see: https://github.com/google/shaderc-rs/pull/59
shaderc = "0.5.1"
shaderc-sys = "0.5.1"

[features]
shaderc_fix = ["shaderc/build-from-source"]

@mitchmindtree
Copy link
Author

Thanks, I just wanted to clarify as the same patch is not working on my machine. Hmmmm.

@Abendstolz
Copy link

Abendstolz commented Jul 28, 2019

Thanks, I just wanted to clarify as the same patch is not working on my machine. Hmmmm.

I'm sorry, I am curious by nature: How do you try to build? You write about using the build-from-source feature, but how do you pass that to rustc?

I only could get this to work with re-exposing it as another feature, so I have to run:

cargo r --release --features=shaderc_fix

I just did a cargo clean and cargo update to verify this still works and yes it does, it just takes forever re-compiling shaderc-sys from source

edit: One more note, I am using the latest stable rust-compiler, which is 1.36.0 as of writing this

@mitchmindtree
Copy link
Author

I have tried via specifying the feature in the Cargo.toml of multiple downstream projects and I have also tried while attempting to build local copies of both shaderc-rs and shaderc-sys, and I have tried both with and without the patch. I have also tried rebasing the patch onto master to no avail.

I have also tried uninstalling and re-installing the shaderc pacman package.

[mindtree@mindtree shaderc-rs]$ rustc --version
rustc 1.35.0 (3c235d560 2019-05-20)
[mindtree@mindtree shaderc-rs]$ cargo --version
cargo 1.35.0 (6f3e9c367 2019-04-04)
[mindtree@mindtree shaderc-rs]$ rustup which rustc
/home/mindtree/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc

@mitchmindtree
Copy link
Author

OK! It appears I failed to clone the repo recursively which caused my build-from-souce attempts to fail. After git submodule update --init --recursive and building shaderc-sys with the build-from-source feature I have managed to get the voidlinux patch branch working. Going to close this in favour of #58 and #59.

m0ppers added a commit to m0ppers/fbx-viewer that referenced this issue May 5, 2020
Suffering from this issue under arch linux google/shaderc-rs#61.
Apparently they fixed it upstream and vulkano 0.14 seems to have picked it up.
upgrading vulkano seems to work fine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants