Reputation: 31
ghc -fllvm -keep-llvm-files -fforce-recomp hello.hs
[1 of 1] Compiling Main ( hello.hs, hello.o )
: Warning: Couldn't figure out LLVM version! Make sure you have installed LLVM ghc: could not execute: opt
Although the .ll file is generated in the current directory but I still don't get the error.
Upvotes: 1
Views: 738
Reputation: 31
Need to set PATH, CPLUS_INCLUDE_PATH and LD_LIBRARY_PATH
# export PATH=/usr/local/opt/llvm/bin:$PATH
# export CPLUS_INCLUDE_PATH=$(llvm-config --includedir):$CPLUS_INCLUDE_PATH
# export LD_LIBRARY_PATH=$(llvm-config --libdir):$LD_LIBRARY_PATH
Upvotes: 2