0

I built llvm 3.0, downloaded from here. I did:

./configure CC=gcc CXX=g++ --enable-shared

sudo make -j5 -s install

Next, I cloned the LLVM bindings from here. I am trying:

runhaskell Setup configure

But I get:

Configuring llvm-3.0.0.0...

Setup.lhs: At least the following dependencies are missing:

llvm-base ==3.0.*, type-level -any

I am running Linux Mint 64-bit (equivalent to Ubuntu 11.0). GHC is 6.12.3. I tried a cabal install but apparently the llvm version is too old to run some examples (am I mistaken?).

What am I doing wrong?

Community
  • 1
  • 1
aelguindy
  • 3,703
  • 24
  • 31

1 Answers1

2

Bryan recently split the llvm package in two, that split has not yet made it to hackage. So if you don't want to simply cabal install the hackage version,

  1. install the type-level package (cabal install should work fine)
  2. cd into the base subdirectory of the llvm-repo, install llvm-base
  3. cd into the llvm directory, install

I have not tried it, so it might not work, but usually Bryan's repos are buildable, so there's a good chance that it does.

Daniel Fischer
  • 181,706
  • 17
  • 308
  • 431
  • I am not sure if it's appropriate to post a follow-up here. But I'll do. I tried building llvm-base and I got a compilation error requiring the macro __STDC_CONSTANT_MACROS to be defined before including DataTypes. Even if I add -D option manually to gcc (by redefining gcc as a bash script.. I know it's horrible), I get "Could not find module `LLVM.Target.TARGET':" in LLVM/Target/Native.hs:8:7. – aelguindy Jan 04 '12 at 12:30
  • `TARGET` is a macro specifying the architecture. That must be defined somewhere to choose the correct module, a quick look didn't reveal where exactly. I doubt it would work with adding `-DTARGET=X86` (for example) to the `-cpp-options` in the .cabal file. It's probably best to just install the latest hackage version. – Daniel Fischer Jan 04 '12 at 12:40
  • I did try that.. It gives a bunch of link errors when I try to compile any of the examples. – aelguindy Jan 04 '12 at 13:05
  • Not surprising. After a look in `configure.ac`, you might have a better chance with `export target=YOUR_PLATFORM` before installing, but I'm not too optimistic. Why don't you just install the hackage version? – Daniel Fischer Jan 04 '12 at 13:21
  • No I meant I tried installing the hackage version (not I tried the options). It fails to compile the examples.. Maybe I am doing something wrong.. A lot of linking errors! – aelguindy Jan 04 '12 at 13:22
  • Ah, current version is compatible with llvm 2.9 and 2.8, probably it's incompatible with 3.0. Have you tried simply `cabal install` inside `llvm/base` (and then `llvm`)? According to `INSTALL.md` that should likely work if llvm is in a standard place. But that again doesn't speak of 3.0 yet. You could try the mailing list - haskell-llvm@projects.haskellorg - for expert help. – Daniel Fischer Jan 04 '12 at 13:40
  • So I removed llvm-3.0 and installed llvm-2.8. I ran cabal install from inside base.. I am getting some type error. Thanks for the great help so far :) but I quit! – aelguindy Jan 04 '12 at 15:49