RandomEli
RandomEli

Reputation: 1557

Installed LLVM on OS X with brew but no path were set to the executable

I installed LLVM on OS X with brew by brew install llvm and I tested it with hello.c with llvm-gcc, and it generates the IR for me. However, when I want to execute the IR code with lli hello.ll or compile it to assembler by llc hello.ll, clang hello.s -x assembler -o hello and run it with ./hello. I got -bash: lli: command not found error. So I tried to add the class path as: export CLASSPATH="/usr/local/Cellar/llvm/3.6.2/bin/lli:$CLASSPATH". However, I still didn't add the class path successfully. Anyone has ideas?

Upvotes: 2

Views: 5771

Answers (1)

RandomEli
RandomEli

Reputation: 1557

As discussed in the comment, the actual path where executables located is in opt. So export PATH="/usr/local/opt/llvm/bin:$PATH" should set the environment variables for llvm.

Upvotes: 5

Related Questions