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
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.
point that to wherever you put llvm
Thank you! I am using MacOS. I'll try the commend first.
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
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.
it is in your path, I think?
or actually, it being on your path does not matter
you need to define the LLVM_SYS_130_PREFIX
variable to point to where llvm lives
whether it is or is not on PATH is then irrelevant, I think
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.
Thank you so much!
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.
Thank you! I'll definitely take a look.
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
@Anton any ideas? I think you are the most familiar with debugging nix.
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?
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.
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
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
I used "cargo run repl" to install repl, but still cannot run command starting with "roc"
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
you can use symbolic links to make the roc
binary available everywhere
Thanks a lot!
Last updated: Jul 05 2025 at 12:14 UTC