Stream: beginners

Topic: m1 mac problems


view this post on Zulip James Carlson (Jan 22 2022 at 19:04):

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

view this post on Zulip Lucas Rosa (Jan 22 2022 at 19:19):

you probably have the wrong version of zig @James Carlson

view this post on Zulip Lucas Rosa (Jan 22 2022 at 19:19):

you need 0.8.* and that looks like an error from 0.9

view this post on Zulip David Dunn (Sep 13 2022 at 06:24):

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).

view this post on Zulip Brian Carroll (Sep 13 2022 at 06:40):

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.

view this post on Zulip Brendan Hansknecht (Sep 13 2022 at 14:22):

Brew should let you install at a specific version brew install llvm@13 or something like that

view this post on Zulip David Dunn (Sep 13 2022 at 14:28):

Opened a PR to update the getting started doc

view this post on Zulip Anton (Sep 13 2022 at 14:43):

Is this issue caused by what you mentioned here @Brendan Hansknecht?

view this post on Zulip Brendan Hansknecht (Sep 13 2022 at 14:47):

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.

view this post on Zulip Brendan Hansknecht (Sep 13 2022 at 14:48):

probably a platform dynamically links to it? Since I don't think we should link to libc++ in the compiler

view this post on Zulip Anton (Sep 13 2022 at 14:51):

@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?

view this post on Zulip David Dunn (Sep 13 2022 at 14:56):

@Anton It was ./roc examples/hello-world/main.roc, from inside the unzipped release directory

view this post on Zulip Anton (Sep 13 2022 at 14:57):

Thanks @doubledup

view this post on Zulip David Dunn (Sep 13 2022 at 14:58):

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)

view this post on Zulip David Dunn (Sep 13 2022 at 20:53):

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