done is better than perfect

自分が学んだことや、作成したプログラムの記事を書きます。すべての記載は他に定める場合を除き個人的なものです。

OS Χ (Mavericks)でbrew install haskell-platformが失敗する

Mountain LionからアップグレードしたMavericksで、brew install haskell-platformが失敗しました。

$ brew install haskell-platform
==> Downloading http://lambda.haskell.org/platform/download/2013.2.0.0/haskell-p
Already downloaded: /Library/Caches/Homebrew/haskell-platform-2013.2.0.0.tar.gz
==> ./configure --prefix=/usr/local/Cellar/haskell-platform/2013.2.0.0
configure: error: Your installation of ghc does not appear to work.
  It cannot compile a simple program (see config.log for the details).
  If you installed ghc from a generic binary tarball then it is worth
  checking that you have the 'gmp' C library and header files installed.
  (On Debian-based systems this package is called libgmp3-dev.)

勿論、gmpXcode Command Line Toolsなどはインストール済みです。

ghciを起動しようとすると、以下のエラーが出ました。

$ ghci
GHCi, version 7.6.3: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
ghc: could not execute: /usr/local/bin/gcc-4.2

/usr/local/bin/gcc-4.2を探したらありませんでした。何故だ…

結果として、別の場所にあったgcc-4.2に対してsymlinkを貼ったら取り敢えず動きました。

$ ln -s /usr/bin/gcc-4.2 /usr/local/bin/gcc-4.2

これで、haskell-platformなども動きます。