Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cabal fails to install Idris language on OSX Lion

I'm trying to install the Idris language in an OSX Lion using the installation guide provided on the official tutorial. I have alraedy installed GMP. This is the error I get:

$ cabal install idris
Resolving dependencies...
Configuring libffi-0.1...
cabal: The pkg-config package libffi is required but it could not be found.
[1 of 1] Compiling Main             ( /var/folders/f0/dlx6tl5x18z4k4_vq0fkqtb80000gn/T/llvm-general-3.3.5.0-61662/llvm-general-3.3.5.0/Setup.hs, /var/folders/f0/dlx6tl5x18z4k4_vq0fkqtb80000gn/T/llvm-general-3.3.5.0-61662/llvm-general-3.3.5.0/dist/setup/Main.o )
Linking /var/folders/f0/dlx6tl5x18z4k4_vq0fkqtb80000gn/T/llvm-general-3.3.5.0-61662/llvm-general-3.3.5.0/dist/setup/setup ...
setup: The program llvm-config version ==3.3.* is required but it could not be
found.
cabal: Error: some packages failed to install:
idris-0.9.9 depends on llvm-general-3.3.5.0 which failed to install.
libffi-0.1 failed during the configure step. The exception was:
ExitFailure 1
llvm-general-3.3.5.0 failed during the configure step. The exception was:
ExitFailure 1

Trying to install Idris without LLVM produces this error:

$ cabal install idris -f-LLVM
Resolving dependencies...
Configuring libffi-0.1...
cabal: The pkg-config package libffi is required but it could not be found.
cabal: Error: some packages failed to install:
idris-0.9.9 depends on libffi-0.1 which failed to install.
libffi-0.1 failed during the configure step. The exception was:
ExitFailure 1
like image 935
MaiaVictor Avatar asked Sep 04 '13 00:09

MaiaVictor


2 Answers

I was having this same problem on OSX Mavericks. To get Idris to compile, I used homebrew to install gmp, then I had to do 'export PKG_CONFIG_PATH=/usr/local/Cellar/libffi/3.0.13/lib/pkgconfig', and then 'cabal install idris -f-LLVM'. I got the tip to export the PKG_CONFIG_PATH variable from this site:

https://groups.google.com/d/msg/idris-lang/gxcdvRIA2OI/NqKSd4zHkI4J

Mavericks already had libffi installed, and I didn't want to install a second copy from source, which is what the PKG_CONFIG_PATH trick helped me avoid. Do 'brew info libffi' to find the correct path to export. Hopefully someone will create a homebrew formula for Idris soon...

like image 185
Mike McClurg Avatar answered Oct 29 '22 15:10

Mike McClurg


The first error indicates you should install the LLVM development packages of your distribution (not through cabal) and the second indicates you should install the development package for the GCC libffi library. What Linux distribution are you using? Or are you on Windows/Mac?

like image 36
Dominique Devriese Avatar answered Oct 29 '22 16:10

Dominique Devriese