2

I have spent an evening until some ridiculous time in the morning trying to figure out how to get Haskell's GHC to work correctly and to have Cabal install the gloss library.

After reading through every bit of documentation/error reports imaginable, even with old installs of ghc, gcc binary (instead of a symlink to clang), and brewing llvm no matter what happened one fix resolved one issue, only to then present another.

So I have a simple solution that worked for me for Yosemite and I will post it below (I wish someone else had posted it here)

Nate Uni
  • 933
  • 1
  • 12
  • 26

1 Answers1

2

Ok here is the easy solution to the headache:

  1. Go here http://ghcformacosx.github.io/ and download the app and put it in the app directory and run it.
  2. Add the stuff to the .bash_profile (you will see what I mean when you run it)
  3. Run brew install llvm34 (note there was an issue with using a newer version)
  4. Then symlink to llvm so that ghc can find it (I tried editing the ghc settings file but it didn't help. Maybe after all the stuffing around, it was the wrong version of ghc that I was editing)

Brew gave me symlinks at /user/local/bin to llvm BUT NOTE they were not called plain old llc & opt as ghc was looking for.. they were called llc-3.4 & opt-3.4, hence why it couldn't find them. Again their location can be specified in the ghc settings file, but as I had some issues with that I just created some more symlinks.

I went to /usr/bin and ran:

sudo ln -s /usr/local/bin/opt-3.4 opt 
sudo ln -s /usr/local/bin/llc-3.4 llc 

Which created the generic opt, generic llc that symlinked to the brew installion of the associated v3.4.2 llvm files.

Hope that saves someone an evening.

Nate Uni
  • 933
  • 1
  • 12
  • 26