Building Zig from source

Hi.
I’m trying to build zig from source in both: Windows (11) and Linux (CentOS9).
LLVM stuff installed (not from source, but from package managers).
And ‘cmake …’ in ‘build’ folder says:

-- Configuring zig version 0.14.0-dev.2437+c172877b8
CMake Error at cmake/Findllvm.cmake:30 (message):
  LLVM (according to llvm-config.exe) is
  missing target AVR.  Zig requires LLVM to be built with all default targets
  enabled.
Call Stack (most recent call first):
  CMakeLists.txt:135 (find_package)

On Windows

And same on Linux

CMake Error at cmake/Findllvm.cmake:30 (message):
  LLVM (according to /usr/bin/llvm-config-19) is missing target AVR.  Zig
  requires LLVM to be built with all default targets enabled.

  LLVM (according to /bin/llvm-config-19) is missing target AVR.  Zig
  requires LLVM to be built with all default targets enabled.
Call Stack (most recent call first):
  CMakeLists.txt:135 (find_package)


-- Configuring incomplete, errors occurred!

Should I install (somehow) cross compiler (llvm) for ARM?

(Welcome to Ziggit!)

I needed to build the compiler once to report a bug.
Here’s my docker environment with all of the dependencies I needed.

see: Building Zig from source for dummies? - #6 by matklad
When building, replace 18 with 19 and 18.x with 19.1.

1 Like