Zig Version
0.12.0-dev.2059+42389cb9c
Steps to Reproduce and Observed Behavior
While running below test command (that's the default test command created by buiild_runner), there's a compiler error on not finding header files.
/home/akhil/.config/Code/User/globalStorage/ziglang.vscode-zig/zig_install/zig test \
-lcuda -lnvrtc \
-I /usr/local/cuda/include -L /usr/local/cuda/lib64 \
--dep cudaz --mod root /home/akhil/practice/cudaz/test/general.zig \
--mod cudaz /home/akhil/practice/cudaz/src/lib.zig \
-lc \
--cache-dir /home/akhil/practice/cudaz/zig-cache --global-cache-dir /home/akhil/.cache/zig \
--name test
Output:
src/c.zig:1:18: error: C import failed
pub const cuda = @cImport({
^~~~~~~~
referenced by:
cuda: src/error.zig:5:15
CudaErrorEnum: src/error.zig:10:47
remaining reference traces hidden; use '-freference-trace' to see all reference traces
/home/akhil/practice/cudaz/zig-cache/o/d41127f1c4e1cd6955c7dad1694f4c1c/cimport.h:1:10: error: 'cuda.h' file not found
#include <cuda.h>
^
src/c.zig:7:19: error: C import failed
pub const nvrtc = @cImport(@cInclude("nvrtc.h"));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/akhil/practice/cudaz/zig-cache/o/841287f7c59616b0e1de04edb366cdad/cimport.h:1:10: error: 'nvrtc.h' file not found
#include <nvrtc.h>
If -I /usr/local/cuda/include is rearanged then zig compiles and runs the test successfully
/home/akhil/.config/Code/User/globalStorage/ziglang.vscode-zig/zig_install/zig test \
-lcuda -lnvrtc \
-L /usr/local/cuda/lib64 \
--dep cudaz --mod root /home/akhil/practice/cudaz/test/general.zig \
-I /usr/local/cuda/include \
--mod cudaz /home/akhil/practice/cudaz/src/lib.zig \
-lc \
--cache-dir /home/akhil/practice/cudaz/zig-cache --global-cache-dir /home/akhil/.cache/zig \
--name test
Output:
Expected Behavior
Test should run without compile errors.
Zig Version
0.12.0-dev.2059+42389cb9c
Steps to Reproduce and Observed Behavior
While running below test command (that's the default test command created by buiild_runner), there's a compiler error on not finding header files.
Output:
src/c.zig:1:18: error: C import failed pub const cuda = @cImport({ ^~~~~~~~ referenced by: cuda: src/error.zig:5:15 CudaErrorEnum: src/error.zig:10:47 remaining reference traces hidden; use '-freference-trace' to see all reference traces /home/akhil/practice/cudaz/zig-cache/o/d41127f1c4e1cd6955c7dad1694f4c1c/cimport.h:1:10: error: 'cuda.h' file not found #include <cuda.h> ^ src/c.zig:7:19: error: C import failed pub const nvrtc = @cImport(@cInclude("nvrtc.h")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/akhil/practice/cudaz/zig-cache/o/841287f7c59616b0e1de04edb366cdad/cimport.h:1:10: error: 'nvrtc.h' file not found #include <nvrtc.h>If
-I /usr/local/cuda/includeis rearanged then zig compiles and runs the test successfullyOutput:
Expected Behavior
Test should run without compile errors.