#Debug build of zgpu application works, but release build fails

1 messages · Page 1 of 1 (latest)

quaint topaz
#

Hey everyone, I am trying to get some graphics programming done and want to use zglfw and zgpu (wrapper around dawn). When I build the program (which is a trimmed down copy of one of the zig-gamedev samples) with zig build run, it starts up fine. But when I try to do zig build --release=fast it gives the following error:

/home/tadeo/code/test/zgputest/zig-out/bin/zgputest: symbol lookup error: .zig-cache/o/419e4270d2b5e83a479a403f59b51466/libzdawn.so: undefined symbol: XSetErrorHandler
run
└─ run exe zgputest failure
error: the following command exited with error code 127:
/home/tadeo/code/test/zgputest/zig-out/bin/zgputest

Build Summary: 12/14 steps succeeded; 1 failed
run transitive failure
└─ run exe zgputest failure

error: the following build command failed with exit code 1:
.zig-cache/o/605e8317f0f3d2a2b0c058fa6f703235/build /home/tadeo/.config/Code - OSS/User/globalStorage/ziglang.vscode-zig/zig/x86_64-linux-0.15.2/zig /home/tadeo/.config/Code - OSS/User/globalStorage/ziglang.vscode-zig/zig/x86_64-linux-0.15.2/lib /home/tadeo/code/test/zgputest .zig-cache /home/tadeo/.cache/zig --seed 0x90153b33 -Zc37ca54fd61cc598 --release=safe run

I am on Linux 6.1.126-1-MANJARO
I think I setup the linking incorrectly. When I just start the built binary from the bin directory it also tells me:

./zgputest: error while loading shared libraries: libzdawn.so: cannot open shared object file: No such file or directory

The project repo can be found here
https://github.com/tadeohepperle/zig-gpu-test

GitHub

Contribute to tadeohepperle/zig-gpu-test development by creating an account on GitHub.

#

With just zig build run it renders something to the screen at least, see screenshot attached.

civic prism
quaint topaz
#

Yeah, but why is my release build failing while the debug build works?

echo wigeon
#

could you try adding .use_llvm = true to your build script?

#

since debug is built with the new backend by default, this could be a discrepancy between LLVM and the new backend

quaint topaz
#

I added that the use_llvm flag, it shows that it is using LLVM too. But the build fails.

civic prism
#

u should create a new issue ig