Hi,
I would like to link lapacke to my zig code, so I added
exe.linkSystemLibrary2("lapacke", .{ .preferred_link_mode = .static });
exe.linkSystemLibrary2("lapack", .{ .preferred_link_mode = .static });
exe.linkSystemLibrary2("gfortran", .{ .preferred_link_mode = .static });
exe.linkLibC();
To my build.zig. However, the libgfortran, which is required by lapack on my ubuntu machine, is located in /usr/lib/gcc/x86_64-linux-gnu/13/libgfortran.a
which is not searched by the linker.
I tried to add the library path with
exe.addLibraryPath(.{ .path = "/usr/lib/gcc/x86_64-linux-gnu/13/" });
but I get the error, that LazyPath has no member “path”. How can I add the path to be searched?
Thanks.
Edit: So I just found out, that the addLibraryPath
ist not required if the linking of lapacke is dynamic. But if you know how to solve this statically, help would be much appreciated.