Stream: beginners

Topic: installation issue regrading llvm-sys


view this post on Zulip Audrey Gao (Nov 23 2022 at 18:52):

Hi everyone, I'm new to roc and still have some issue with the installation. Has anyone met the error "No suitable version of LLVM was found system-wide or pointed to by LLVM_SYS_130_PREFIX" before? I have installed llvm and updated the PATH, but when I run "cargo build --release --locked" on the main branch, I got the error message stated below:
image.png

view this post on Zulip Folkert de Vries (Nov 23 2022 at 19:01):

what OS are you on? this might help (from BUILDING_FROM_SOURCE.md)

Add export LLVM_SYS_130_PREFIX=/usr/lib/llvm-13 to your ~/.bashrc or equivalent file for your shell.

view this post on Zulip Folkert de Vries (Nov 23 2022 at 19:01):

point that to wherever you put llvm

view this post on Zulip Audrey Gao (Nov 23 2022 at 19:05):

Thank you! I am using MacOS. I'll try the commend first.

view this post on Zulip Folkert de Vries (Nov 23 2022 at 19:07):

the document says

For macOS, you can install LLVM 13 using brew install llvm@13 and then adding
$(brew --prefix llvm@13)/bin to your PATH. You can confirm this worked by
running llc --version - it should mention "LLVM version 13.0.1" at the top.
You may also need to manually specify a prefix env var like so:

export LLVM_SYS_130_PREFIX=/usr/local/opt/llvm@13

view this post on Zulip Audrey Gao (Nov 23 2022 at 19:37):

Can you explain more about how to add $(brew --prefix llvm@13)/bin to the PATH? I tried to add a line of PATH = "$(brew --prefix llvm@13)/bin" to my ~/.bash_profile, but it didn't seem to be the right way to do.

view this post on Zulip Folkert de Vries (Nov 23 2022 at 19:39):

it is in your path, I think?

view this post on Zulip Folkert de Vries (Nov 23 2022 at 19:39):

or actually, it being on your path does not matter

view this post on Zulip Folkert de Vries (Nov 23 2022 at 19:40):

you need to define the LLVM_SYS_130_PREFIX variable to point to where llvm lives

view this post on Zulip Folkert de Vries (Nov 23 2022 at 19:40):

whether it is or is not on PATH is then irrelevant, I think

view this post on Zulip Audrey Gao (Nov 23 2022 at 19:53):

Oh yes! I haven't noticed that it works now. Even though I met with some new issues with wasi_libc_sys and roc_builtins, I guess they have something to do with the installation of WASI SDK.

view this post on Zulip Audrey Gao (Nov 23 2022 at 19:54):

Thank you so much!

view this post on Zulip Brendan Hansknecht (Nov 23 2022 at 20:22):

I highly advising installing and using nix for dependencies (or just using nightly if you have no need to compile from source). It makes all of this a lot easier and more manageable.

view this post on Zulip Audrey Gao (Nov 23 2022 at 20:39):

Thank you! I'll definitely take a look.

view this post on Zulip Audrey Gao (Nov 23 2022 at 22:35):

I tried to run nix develop after I installed nix in multi-user mode and restarted my computer. I got the error below and didn't quite know how to solve:
image.png

view this post on Zulip Brendan Hansknecht (Nov 23 2022 at 23:16):

@Anton any ideas? I think you are the most familiar with debugging nix.

view this post on Zulip Anton (Nov 24 2022 at 09:00):

Hi @Audrey Gao, are you at the root of our repository (folder named roc)? Can you also share the output of git status from the roc folder?

view this post on Zulip Audrey Gao (Jan 20 2023 at 21:14):

Hi @Anton, I am so sorry for replaying this late. I just came to have time continue working on this issue. I am at the root of the repository, but the folder name is roc-main. I no longer get the error of git tree dirty, but the error "error: getting status of '/nix/store/mv4nmhdcfixn9gmh7lkqilni8cicwv5r-source/Documents': No such file or directory" stays.

view this post on Zulip Anton (Jan 21 2023 at 08:32):

No need to apologize :)

So if I understand correctly, you executed git clone https://github.com/roc-lang/roc.git, and then you renamed the roc folder that was created by git to roc-main?

We don't use a Documents folder anywhere so I don't understand how it is encountering that error.

I would recommend deleting the roc-main folder and executing the following commands:

git clone https://github.com/roc-lang/roc.git
cd roc
nix develop

view this post on Zulip Audrey Gao (Jan 23 2023 at 16:04):

Thanks for your advice! I followed the commands and successfully run the command "nix develop." But another problem popped up: when I checked if Roc is installed, I didn't see the message "The rockin’ roc repl": image.png

view this post on Zulip Audrey Gao (Jan 23 2023 at 16:05):

I used "cargo run repl" to install repl, but still cannot run command starting with "roc"

view this post on Zulip Folkert de Vries (Jan 23 2023 at 16:07):

the roc binary is hidden in the target folder. depending on whether you make a release or debug build, it is target/debug/roc (this is the default with cargo) or target/release/roc

view this post on Zulip Folkert de Vries (Jan 23 2023 at 16:07):

you can use symbolic links to make the roc binary available everywhere

view this post on Zulip Audrey Gao (Jan 23 2023 at 16:10):

Thanks a lot!


Last updated: Jul 05 2025 at 12:14 UTC