Ricky Stewart
Ricky Stewart

Reputation: 1142

cabal installation failure for llvm-general

I am attempting to install the llvm-general Cabal package on OS X. When I do, I get the following error:

$ cabal install llvm-general
Resolving dependencies...
[1 of 1] Compiling Main             ( /var/folders/PP/PP+wAuBcGWuqzt-Iekiipk+++TI/-Tmp-/llvm-general-3.4.4.2-38424/llvm-general-3.4.4.2/Setup.hs, /var/folders/PP/PP+wAuBcGWuqzt-Iekiipk+++TI/-Tmp-/llvm-general-3.4.4.2-38424/llvm-general-3.4.4.2/dist/setup/Main.o )
Linking /var/folders/PP/PP+wAuBcGWuqzt-Iekiipk+++TI/-Tmp-/llvm-general-3.4.4.2-38424/llvm-general-3.4.4.2/dist/setup/setup ...
setup: The program llvm-config version ==3.4.* is required but the version
found at /usr/local/bin/llvm-config is version 3.2
cabal: Error: some packages failed to install:
llvm-general-3.4.4.2 failed during the configure step. The exception was:
ExitFailure 1

What it's doing is running /usr/local/bin/llvm-config; this, I believe, is the version of LLVM installed by the OS X developer tools that I installed a while ago. I do have the current version of LLVM, but it's installed with Homebrew as a local (keg-only) installation. Is there any way I can point cabal to that version of LLVM for the purposes of this installation?

Upvotes: 2

Views: 781

Answers (1)

ErikR
ErikR

Reputation: 52029

I believe that cabal simply looks in your PATH for llvm-config, so just adjust your path accordingly. Otherwise you can try:

  • modify the file llvm-general.cabal to reference an absolute path for llvm-config (line 52)
  • temporarily move aside /usr/local/bin/llvm-config and replace it with the llvm-config for the llvm installation you want to use

For reference, I found llvm-config for version 3.4 at /usr/local/Cellar/llvm34/3.4.2/lib/llvm-3.4/bin/llvm-config on my OSX system.

Upvotes: 3

Related Questions