Hi, I am trying to install the roc toolchain on an M1 mac. Got the error below:
(base) ➜ roc git:(trunk) cargo run test
.....
error: failed to run custom build command for `roc_builtins v0.1.0 (/Users/jxxcarlson/dev/roc/roc/compiler/builtins)`
Caused by:
process didn't exit successfully: `/Users/jxxcarlson/dev/roc/roc/target/debug/build/roc_builtins-5b244d1fce26b1b1/build-script-build` (exit status: 101)
--- stdout
cargo:rerun-if-changed=build.rs
Compiling host ir to: /Users/jxxcarlson/dev/roc/roc/compiler/builtins/bitcode/builtins-host.ll
--- stderr
thread 'main' panicked at 'zig failed: ./build.zig:58:24: error: expected type 'std.build.EmitOption', found 'bool'
obj.emit_llvm_ir = true;
^
/opt/homebrew/Cellar/zig/0.9.0/lib/zig/std/build.zig:1595:28: note: std.build.EmitOption declared here
pub const EmitOption = union(enum) {
^
', compiler/builtins/build.rs:157:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
you probably have the wrong version of zig @James Carlson
you need 0.8.* and that looks like an error from 0.9
hey folks :wave: I just pulled the latest release (roc_nightly-macos_apple_silicon-2022-09-12-8fbd09b) when following the guide for apple silicon, and got an error about a missing dylib: dyld[55226]: Library not loaded: '/opt/homebrew/opt/llvm/lib/libc++abi.1.dylib'
. This sounded like llvm was missing, and indeed after brew install llvm
the hello world example in the nightly release ran fine.
Is there a particular llvm version that Roc is using? From the Earthfile & Nix files I'd guess 13, but the llvm brew package is 14 and that worked (at least for hello world).
We're currently on LLVM 13. The changes in LLVM 14 are not too large so I guess that's why it worked for hello world! But it's likely you'd run into problems eventually.
Brew should let you install at a specific version brew install llvm@13
or something like that
Opened a PR to update the getting started doc
Is this issue caused by what you mentioned here @Brendan Hansknecht?
No, I don't think so. It just looks like we dynamically link to one of the llvm libraries, thus it needs to be installed.
probably a platform dynamically links to it? Since I don't think we should link to libc++ in the compiler
@doubledup can you share what command you executed or which example you tried to run when you encountered the dyld[55226]: Library not loaded
error?
@Anton It was ./roc examples/hello-world/main.roc
, from inside the unzipped release directory
Thanks @doubledup
Looks like llvm@13 is keg-only/doesn't link automatically and has some conflicts, at least with libomp (that's the only one that conflicted for me)
Actually llvm is also key-only, so not sure why there's only a conflict with llvm@13 - maybe llvm 13 has a libomp dylib when 14 doesn't?
Last updated: Jul 06 2025 at 12:14 UTC