[Haskell-cafe] llvm on macos

Dominic Steinitz dominic at steinitz.org
Sat Aug 10 13:39:40 CEST 2013


I am trying to use llvm but am being told I don't have llvm installed.

Dominics-MacBook-Pro:Laplace dom$ ghc src-repa/Main.hs -rtsopts -threaded -eventlog -Odph -fllvm -optlo-O3 -fno-liberate-case -isrc-repa
[1 of 3] Compiling SolverStencil    ( src-repa/SolverStencil.hs, src-repa/SolverStencil.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package array-0.4.0.1 ... linking ... done.
Loading package deepseq-1.3.0.1 ... linking ... done.
Loading package containers-0.5.0.0 ... linking ... done.
Loading package old-locale-1.0.0.5 ... linking ... done.
Loading package time-1.4.0.1 ... linking ... done.
Loading package random-1.0.1.1 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package QuickCheck-2.5.1.1 ... linking ... done.
Loading package bytestring-0.10.0.2 ... linking ... done.
Loading package primitive-0.5.0.1 ... linking ... done.
Loading package vector-0.10.0.1 ... linking ... done.
Loading package repa-3.2.3.1 ... linking ... done.

<no location info>:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM
ghc: could not execute: opt

The ghc documentation
(http://www.haskell.org/ghc/docs/7.6.1/html/users_guide/code-generators.html)
says that llvm and clang are installed by default for 10.6 and
later. I am on 10.8.3.

Indeed

Dominics-MacBook-Pro:Laplace dom$ llvm-
llvm-cpp-4.2  llvm-g++      llvm-g++-4.2  llvm-gcc      llvm-gcc-4.2

And

Dominics-MacBook-Pro:Laplace dom$ clang
clang    clang++  

But ghc-info tells me

Dominics-MacBook-Pro:Laplace dom$ ghc --info
 [("Project name","The Glorious Glasgow Haskell Compilation System")
 ,("GCC extra via C opts"," -fwrapv")
 ,("C compiler command","/usr/bin/gcc")
 ,("C compiler flags"," -m64 -fno-stack-protector  -m64")
 ,("ar command","/usr/bin/ar")
 ,("ar flags","clqs")
 ,("ar supports at file","@ArSupportsAtFile@")
 ,("touch command","touch")
 ,("dllwrap command","/bin/false")
 ,("windres command","/bin/false")
 ,("perl command","/usr/bin/perl")
 ,("target os","OSDarwin")
 ,("target arch","ArchX86_64")
 ,("target word size","8")
 ,("target has GNU nonexec stack","False")
 ,("target has .ident directive","True")
 ,("target has subsections via symbols","True")
 ,("LLVM llc command","llc")
 ,("LLVM opt command","opt")
 ,("Project version","7.6.2")
 ,("Booter version","7.4.2")
 ,("Stage","2")
 ,("Build platform","x86_64-apple-darwin")
 ,("Host platform","x86_64-apple-darwin")
 ,("Target platform","x86_64-apple-darwin")
 ,("Have interpreter","YES")
 ,("Object splitting supported","YES")
 ,("Have native code generator","YES")
 ,("Support SMP","YES")
 ,("Unregisterised","NO")
 ,("Tables next to code","YES")
 ,("RTS ways","l debug  thr thr_debug thr_l thr_p dyn debug_dyn thr_dyn thr_debug_dyn")
 ,("Leading underscore","YES")
 ,("Debug on","False")
 ,("LibDir","/usr/local/lib/ghc-7.6.2")
 ,("Global Package DB","/usr/local/lib/ghc-7.6.2/package.conf.d")
 ,("Gcc Linker flags","[\"-m64\"]")
 ,("Ld Linker flags","[\"-arch\",\"x86_64\"]")
 ]

But I don't have either llc or opt

Dominics-MacBook-Pro:Laplace dom$ llc
-bash: llc: command not found
Dominics-MacBook-Pro:Laplace dom$ opt
-bash: opt: command not found
Dominics-MacBook-Pro:Laplace dom$ 

What is the solution?

Thanks,

Dominic Steinitz
dominic at steinitz.org
http://idontgetoutmuch.wordpress.com





More information about the Haskell-Cafe mailing list