Dominic Steinitz | 10 Aug 13:39 2013

llvm on macos

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
(Continue reading)

Brandon Allbery | 10 Aug 17:36 2013
Picon

Re: llvm on macos

On Sat, Aug 10, 2013 at 7:39 AM, Dominic Steinitz <dominic <at> steinitz.org> wrote:
<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.

Apple *still* doesn't ship a full LLVM for some reason. I installed one via MacPorts; Homebrew also has it. Maybe if enough people file bugs with Apple, they'll start providing the whole thing instead of just the parts they use in Xcode. :/
 
--
brandon s allbery kf8nh                               sine nomine associates
allbery.b <at> gmail.com                                  ballbery <at> sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Dominic Steinitz | 10 Aug 18:53 2013

Re: llvm on macos

Thank you very much. I used Homebrew. Now I can compile albeit with a warning. I have yet to try running it.

Loading package repa-3.2.3.1 ... linking ... done.
You are using a new version of LLVM that hasn't been tested yet!
We will try though...


On 10 Aug 2013, at 16:36, Brandon Allbery <allbery.b <at> gmail.com> wrote:

On Sat, Aug 10, 2013 at 7:39 AM, Dominic Steinitz <dominic <at> steinitz.org> wrote:
<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.

Apple *still* doesn't ship a full LLVM for some reason. I installed one via MacPorts; Homebrew also has it. Maybe if enough people file bugs with Apple, they'll start providing the whole thing instead of just the parts they use in Xcode. :/
 
--
brandon s allbery kf8nh                               sine nomine associates
allbery.b <at> gmail.com                                  ballbery <at> sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Brandon Allbery | 10 Aug 19:20 2013
Picon

Re: llvm on macos

On Sat, Aug 10, 2013 at 12:53 PM, Dominic Steinitz <dominic <at> steinitz.org> wrote:
Thank you very much. I used Homebrew. Now I can compile albeit with a warning. I have yet to try running it.

Loading package repa-3.2.3.1 ... linking ... done.
You are using a new version of LLVM that hasn't been tested yet!
We will try though...
There may be some support for requesting specific versions from Homebrew. With MacPorts I can install any or all of LLVM 2.9 through 3.4 (prerelease) and then use port select to specify which one is default (or even make Apple's the default while keeping the MP ones available).

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b <at> gmail.com                                  ballbery <at> sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Ozgur Akgun | 10 Aug 19:41 2013
Picon

Re: llvm on macos

Hi.

On 10 August 2013 18:20, Brandon Allbery <allbery.b <at> gmail.com> wrote:
There may be some support for requesting specific versions from Homebrew.

Try `brew versions llvm`. Then, you'll need to run the git checkout command in `brew --prefix` directory.

I am using llvm 3.2 because I had a few ghc related problems with llvm 3.3.
Never had any problems with 3.2 though.

Hope this helps,
Ozgur

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Dominic Steinitz | 11 Aug 18:48 2013

Re: llvm on macos

Thank you both.

I seem to be running LLVM 3.2 so I am a bit puzzled by the warning. Is it because I am running ghc 7.6.2?

Dominics-MacBook-Pro:Laplace dom$ brew versions llvm
3.2      git checkout 40e9b90 /usr/local/Library/Formula/llvm.rb
3.1      git checkout 7d15192 /usr/local/Library/Formula/llvm.rb
3.0      git checkout 8022bf4 /usr/local/Library/Formula/llvm.rb
2.9      git checkout 471288b /usr/local/Library/Formula/llvm.rb
2.8      git checkout 1fb85ef /usr/local/Library/Formula/llvm.rb
2.7      git checkout d0efd9e /usr/local/Library/Formula/llvm.rb
2.6      git checkout 6ae3b89 /usr/local/Library/Formula/llvm.rb
Dominics-MacBook-Pro:Laplace dom$ llc --version
  LLVM version 3.2svn
  Optimized build with assertions.
  Built Dec 22 2012 (01:03:07).
  Default target: x86_64-apple-darwin12.3.0
  Host CPU: core-avx-i

  Registered Targets:
    x86    - 32-bit X86: Pentium-Pro and above
    x86-64 - 64-bit X86: EM64T and AMD64
Dominics-MacBook-Pro:Laplace dom$ opt --version
  LLVM version 3.2svn
  Optimized build with assertions.
  Built Dec 22 2012 (01:03:07).
  Default target: x86_64-apple-darwin12.3.0
  Host CPU: core-avx-i

Dominics-MacBook-Pro:Laplace dom$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.2



On 10 Aug 2013, at 18:41, Ozgur Akgun <ozgurakgun <at> gmail.com> wrote:

Hi.

On 10 August 2013 18:20, Brandon Allbery <allbery.b <at> gmail.com> wrote:
There may be some support for requesting specific versions from Homebrew.

Try `brew versions llvm`. Then, you'll need to run the git checkout command in `brew --prefix` directory.

I am using llvm 3.2 because I had a few ghc related problems with llvm 3.3.
Never had any problems with 3.2 though.

Hope this helps,
Ozgur


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Ozgur Akgun | 11 Aug 19:00 2013
Picon

Re: llvm on macos


On 11 August 2013 17:48, Dominic Steinitz <dominic <at> steinitz.org> wrote:
I seem to be running LLVM 3.2 so I am a bit puzzled by the warning. Is it because I am running ghc 7.6.2?

I get the warning too, but nothing seems to be broken with 3.2. This is what I meant to say, sorry if I was confusing.


--
Ozgur Akgun
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Anton Nikishaev | 15 Aug 14:02 2013
Picon

Re: llvm on macos

Ozgur Akgun <ozgurakgun <at> gmail.com> writes:

> Hi.
>
> On 10 August 2013 18:20, Brandon Allbery <allbery.b <at> gmail.com> wrote:
>
>     There may be some support for requesting specific versions from
>     Homebrew.
>
>
> Try `brew versions llvm`. Then, you'll need to run the git checkout
> command in `brew --prefix` directory.
>

Or brew tap homebrew/versions and then install llvm31 or whatever

--

-- 
lelf
Carter Schonwald | 15 Aug 21:35 2013
Picon

Re: llvm on macos

Just brew install llvm should work fine.  


The version warning is just the ghc devs beig conservative about what they are committing to supporting given finite resources and llvm changing over time. 

On Thursday, August 15, 2013, Anton Nikishaev wrote:
Ozgur Akgun <ozgurakgun <at> gmail.com> writes:

> Hi.
>
> On 10 August 2013 18:20, Brandon Allbery <allbery.b <at> gmail.com> wrote:
>
>     There may be some support for requesting specific versions from
>     Homebrew.
>
>
> Try `brew versions llvm`. Then, you'll need to run the git checkout
> command in `brew --prefix` directory.
>

Or brew tap homebrew/versions and then install llvm31 or whatever


--
lelf


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Ozgur Akgun | 15 Aug 22:35 2013
Picon

Re: llvm on macos

Hi.

On 15 August 2013 20:35, Carter Schonwald <carter.schonwald <at> gmail.com> wrote:
Just brew install llvm should work fine.  

I wonder what makes you think this is the case.

At this moment in time, `brew install llvm` will install llvm-3.3.
Using llvm-3.3, I get warnings and errors. Using llvm-3.2, I get warnings but I never got any errors. This is not to say that they cannot happen on other packages.

I've just uninstalled 3.2, installed 3.3, and tried to compile a project of mine. One of its dependencies, data-default-class, failed to compile.
The following is what happened on my computer.

Hope this helps,
Ozgur.


$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3
$ cabal --version
cabal-install version 1.16.0.2
using version 1.16.0 of the Cabal library
$ cabal install --force-reinstalls --disable-documentation --disable-library-profiling --disable-executable-profiling  --ghc-options="-fllvm" data-default-class
Resolving dependencies...
Configuring data-default-class-0.0.1...
Building data-default-class-0.0.1...
Preprocessing library data-default-class-0.0.1...
[1 of 1] Compiling Data.Default.Class ( Data/Default/Class.hs, dist/build/Data/Default/Class.o )
You are using a new version of LLVM that hasn't been tested yet!
We will try though...
wrong initalizer for intrinsic global variable
[0 x i8*] undef
Broken module found, compilation aborted!
0  libLLVM-3.3.dylib 0x000000010223faee llvm::sys::PrintStackTrace(__sFILE*) + 40
1  libLLVM-3.3.dylib 0x000000010223fef5 SignalHandler(int) + 241
2  libsystem_c.dylib 0x00007fff8601f94a _sigtramp + 26
3  libsystem_c.dylib 0x0000000102a10a00 _sigtramp + 2090799312
4  libLLVM-3.3.dylib 0x000000010223fd6d abort + 22
5  libLLVM-3.3.dylib 0x0000000101f08466 (anonymous namespace)::Verifier::abortIfBroken() + 236
6  libLLVM-3.3.dylib 0x0000000101f07b97 (anonymous namespace)::Verifier::doFinalization(llvm::Module&) + 3477
7  libLLVM-3.3.dylib 0x0000000101ef63a4 llvm::FPPassManager::doFinalization(llvm::Module&) + 56
8  libLLVM-3.3.dylib 0x0000000101ef5e52 llvm::FunctionPassManagerImpl::doFinalization(llvm::Module&) + 62
9  libLLVM-3.3.dylib 0x0000000101ef5d43 llvm::FunctionPassManager::doFinalization() + 21
10 opt               0x0000000101be19aa std::vector<std::pair<llvm::BasicBlock*, llvm::SuccIterator<llvm::TerminatorInst*, llvm::BasicBlock> >, std::allocator<std::pair<llvm::BasicBlock*, llvm::SuccIterator<llvm::TerminatorInst*, llvm::BasicBlock> > > >::_M_insert_aux(__gnu_cxx::__normal_iterator<std::pair<llvm::BasicBlock*, llvm::SuccIterator<llvm::TerminatorInst*, llvm::BasicBlock> >*, std::vector<std::pair<llvm::BasicBlock*, llvm::SuccIterator<llvm::TerminatorInst*, llvm::BasicBlock> >, std::allocator<std::pair<llvm::BasicBlock*, llvm::SuccIterator<llvm::TerminatorInst*, llvm::BasicBlock> > > > >, std::pair<llvm::BasicBlock*, llvm::SuccIterator<llvm::TerminatorInst*, llvm::BasicBlock> > const&) + 6988
11 libdyld.dylib     0x00007fff8959c7e1 start + 0
12 libdyld.dylib     0x0000000000000006 start + 1990604837
Stack dump:
0. Program arguments: opt /var/folders/h5/3mmbxydn5qs3w9f3j6mgmhsc0000gn/T/ghc11789_0/ghc11789_0.ll -o /var/folders/h5/3mmbxydn5qs3w9f3j6mgmhsc0000gn/T/ghc11789_0/ghc11789_0.bc -O1 --enable-tbaa=true
llc: /var/folders/h5/3mmbxydn5qs3w9f3j6mgmhsc0000gn/T/ghc11789_0/ghc11789_0.bc: error: Could not open input file: No such file or directory
Failed to install data-default-class-0.0.1
cabal: Error: some packages failed to install:
data-default-class-0.0.1 failed during the building phase. The exception was:
ExitFailure 1

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Carter Schonwald | 15 Aug 23:25 2013
Picon

Re: llvm on macos

Huh.  I thought the 3.3 llvm problems only happened when building ghc.  Oops.  Your absolutely right.  Ghc < 7.7 does not generate in general, IR that llvm >= 3.3 will be happy with. 

On Thursday, August 15, 2013, Ozgur Akgun wrote:

Hi.

On 15 August 2013 20:35, Carter Schonwald <carter.schonwald <at> gmail.com> wrote:
Just brew install llvm should work fine.  

I wonder what makes you think this is the case.

At this moment in time, `brew install llvm` will install llvm-3.3.
Using llvm-3.3, I get warnings and errors. Using llvm-3.2, I get warnings but I never got any errors. This is not to say that they cannot happen on other packages.

I've just uninstalled 3.2, installed 3.3, and tried to compile a project of mine. One of its dependencies, data-default-class, failed to compile.
The following is what happened on my computer.

Hope this helps,
Ozgur.


$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3
$ cabal --version
cabal-install version 1.16.0.2
using version 1.16.0 of the Cabal library
$ cabal install --force-reinstalls --disable-documentation --disable-library-profiling --disable-executable-profiling  --ghc-options="-fllvm" data-default-class
Resolving dependencies...
Configuring data-default-class-0.0.1...
Building data-default-class-0.0.1...
Preprocessing library data-default-class-0.0.1...
[1 of 1] Compiling Data.Default.Class ( Data/Default/Class.hs, dist/build/Data/Default/Class.o )
You are using a new version of LLVM that hasn't been tested yet!
We will try though...
wrong initalizer for intrinsic global variable
[0 x i8*] undef
Broken module found, compilation aborted!
0  libLLVM-3.3.dylib 0x000000010223faee llvm::sys::PrintStackTrace(__sFILE*) + 40
1  libLLVM-3.3.dylib 0x000000010223fef5 SignalHandler(int) + 241
2  libsystem_c.dylib 0x00007fff8601f94a _sigtramp + 26
3  libsystem_c.dylib 0x0000000102a10a00 _sigtramp + 2090799312
4  libLLVM-3.3.dylib 0x000000010223fd6d abort + 22
5  libLLVM-3.3.dylib 0x0000000101f08466 (anonymous namespace)::Verifier::abortIfBroken() + 236
6  libLLVM-3.3.dylib 0x0000000101f07b97 (anonymous namespace)::Verifier::doFinalization(llvm::Module&) + 3477
7  libLLVM-3.3.dylib 0x0000000101ef63a4 llvm::FPPassManager::doFinalization(llvm::Module&) + 56
8  libLLVM-3.3.dylib 0x0000000101ef5e52 llvm::FunctionPassManagerImpl::doFinalization(llvm::Module&) + 62
9  libLLVM-3.3.dylib 0x0000000101ef5d43 llvm::FunctionPassManager::doFinalization() + 21
10 opt               0x0000000101be19aa std::vector<std::pair<llvm::BasicBlock*, llvm::SuccIterator<llvm::TerminatorInst*, llvm::BasicBlock> >, std::allocator<std::pair<llvm::BasicBlock*, llvm::SuccIterator<llvm::TerminatorInst*, llvm::BasicBlock> > > >::_M_insert_aux(__gnu_cxx::__normal_iterator<std::pair<llvm::BasicBlock*, llvm::SuccIterator<llvm::TerminatorInst*, llvm::BasicBlock> >*, std::vector<std::pair<llvm::BasicBlock*, llvm::SuccIterator<llvm::TerminatorInst*, llvm::BasicBlock> >, std::allocator<std::pair<llvm::BasicBlock*, llvm::SuccIterator<llvm::TerminatorInst*, llvm::BasicBlock> > > > >, std::pair<llvm::BasicBlock*, llvm::SuccIterator<llvm::TerminatorInst*, llvm::BasicBlock> > const&) + 6988
11 libdyld.dylib     0x00007fff8959c7e1 start + 0
12 libdyld.dylib     0x0000000000000006 start + 1990604837
Stack dump:
0. Program arguments: opt /var/folders/h5/3mmbxydn5qs3w9f3j6mgmhsc0000gn/T/ghc11789_0/ghc11789_0.ll -o /var/folders/h5/3mmbxydn5qs3w9f3j6mgmhsc0000gn/T/ghc11789_0/ghc11789_0.bc -O1 --enable-tbaa=true
llc: /var/folders/h5/3mmbxydn5qs3w9f3j6mgmhsc0000gn/T/ghc11789_0/ghc11789_0.bc: error: Could not open input file: No such file or directory
Failed to install data-default-class-0.0.1
cabal: Error: some packages failed to install:
data-default-class-0.0.1 failed during the building phase. The exception was:
ExitFailure 1

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Dominic Steinitz | 20 Aug 11:13 2013

Re: llvm on macos

Dominic Steinitz <dominic <at> steinitz.org> writes:

Thanks for all the help everyone :-)

Gmane