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.)
勿論、gmp
やXcode 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
なども動きます。