2
votes

I am trying to install packages from haskell's Hackage using Cabal.

In particular, I am trying to download the gloss package:

cabal install gloss

Comes up with this error:

binary-0.7.1.0 failed during the building phase. 
The exception was:
ExitFailure 1
bmp-1.2.5.2 depends on binary-0.7.1.0 which failed to install.
gloss-1.8.1.1 depends on binary-0.7.1.0 which failed to install.

I also tried binary-0.6.0.0. Because cabal install is not working, I am trying:

runhaskell Setup configure
runhaskell Setup build
runhaskell Setup install

...in the directory of the package, and I get the same error for every package:

Setup: Error: Could not find module: Data.Binary with any suffix: ["hi"] in 
the search path: ["dist/build"]

I am also having trouble installing the newest version of Cabal.

  • cabal-install version 1.16.0.2
  • using version 1.16.0 of the Cabal library
  • The Glorious Glasgow Haskell Compilation System, version 7.6.3
  • Mac OSX 10.8 on MacBook Pro Retina
2
What package are you trying to install? Have you tried just doing cabal install package-name? - bheklilr
The correct way to do it is to type cabal install binary. You don't have to download the package to do this as cabal will auto-download it for you. - Gabriella Gonzalez
I updated my question. I was using cabal install in the first place. - samedson93
The binary package fails to install on latest versions of osx because osx uses clang instead of gcc, and 'gcc' is usually just a symlink to clang. gcc is used in the pre-processor stage (haskell supports c-like macros) but clang does not support all the features for the pre-processor stage that gcc supports. To know if this is your problem, type 'gcc' in the terminal. If it says 'clang' somewhere, then this is the issue. The solution is to get gcc, and replace the symlink to gcc with real gcc. - user2407038

2 Answers

3
votes

The binary package fails to install on latest versions of osx because osx uses clang instead of gcc, and 'gcc' is usually just a symlink to clang. gcc is used in the pre-processor stage (haskell supports c-like macros) but clang does not support all the features for the pre-processor stage that gcc supports.

To know if this is your problem, type 'gcc' in the terminal. If it says 'clang' somewhere, then this is the issue.

The solution is to get gcc, and replace the symlink to gcc with real gcc. Using 'runhaskell' will still have the same issue. For the most part, you should never try to install packages without cabal, it is by far the easiest way.

2
votes

This is not an answer.

If you have downloaded package binary-0.7.1.0, you can untar it first, and go into that folder, and run

cabal configure
cabal build
cabal install

There must be more error message, such as line number, but I didn't see it.