Building Zig from Source: Missing CLANG_LIBRARIES, LLD_LIBRARIES, LLD_INCLUDE_DIRS

You find it by understanding the relationship between the upstream project, the dependency project, and the Linux distribution project.

Upstream is Zig, which depends on LLVM. Ubuntu is the Linux distribution.

LLVM has its own build system and configuration options. You’re choosing to use LLVM provided by Ubuntu, which has made configuration choices on your behalf. Zig expects to find dependency libraries in a standardized manner.

Knowing all this, it’s a matter of guessing that there is an Ubuntu package which provides the required files in the standard location. It’s not really something that belongs on Zig or LLVM’s documentation or issue tracker. If you built LLVM from source yourself, for example, this would not be a problem.

In summary, it’s an issue that you opt into by using Ubuntu to provide LLVM.

4 Likes