Mac(Mavericks)にgnu-prologをインストールする

今[７つの言語 ７つの世界](http://amazon.jp/dp/4274068579/takc923-22)を読んでて、Prologなる言語が出てきたので触ってみようと思い自分のMacにインストールしようとしたら失敗した。

```
$ brew install gnu-prolog
==> Downloading http://gprolog.univ-paris1.fr/gprolog-1.4.4.tar.gz
######################################################################## 100.0%
==> Downloading patches
######################################################################## 100.0%
==> Patching
patching file examples/ExamplesFD/langford.pl
patching file src/BipsPl/arith_inl_c.c
patching file src/BipsPl/scan_supp.c
patching file src/BipsPl/stream_c.c
patching file src/EnginePl/engine1.c
patching file src/Linedit/terminal.c
==> ./configure --prefix=/usr/local/Cellar/gnu-prolog/1.4.4 --with-doc-dir=/usr/local/Cellar/gnu-prolog/1.4.4/share/doc/gnu-prolog
==> make
as:file(/var/folders/sv/0m72rddx6_39qr64ygd7msx40000gn/T/gplcku4icd.s) Can't open source file for input! No such file or directory.
compilation failed
make[1]: *** [first_arg.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [all] Error 1

READ THIS: https://github.com/Homebrew/homebrew/wiki/troubleshooting

These open issues may also help:
    https://github.com/Homebrew/homebrew/issues/19427
    https://github.com/Homebrew/homebrew/issues/18871
    https://github.com/Homebrew/homebrew/pull/4728
    https://github.com/Homebrew/homebrew/issues/14062
    https://github.com/Homebrew/homebrew/issues/13145
    https://github.com/Homebrew/homebrew/issues/24191
    https://github.com/Homebrew/homebrew/issues/6653
```

ぐぐるとコンパイルにapple-gcc42を使ったら良さそうな気がしたので、apple-gcc42をインストールする。

```
$ brew install apple-gcc42
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/apple-gcc42-4.2.1-5666.3.mavericks.bottle.2.tar.gz
######################################################################## 100.0%
==> Pouring apple-gcc42-4.2.1-5666.3.mavericks.bottle.2.tar.gz
==> Caveats
NOTE:
This formula provides components that were removed from XCode in the 4.2
release. There is no reason to install this formula if you are using a
version of XCode prior to 4.2.

This formula contains compilers built from Apple's GCC sources, build
5666.3, available from:

  http://opensource.apple.com/tarballs/gcc

All compilers have a `-4.2` suffix. A GFortran compiler is also included.
==> Summary
?  /usr/local/Cellar/apple-gcc42/4.2.1-5666.3: 104 files, 75M
```

で、再チャレンジ

```
$ brew install gnu-prolog
==> Downloading http://gprolog.univ-paris1.fr/gprolog-1.4.4.tar.gz
Already downloaded: /Library/Caches/Homebrew/gnu-prolog-1.4.4.tar.gz
==> Downloading patches
######################################################################## 100.0%
==> Patching
patching file examples/ExamplesFD/langford.pl
patching file src/BipsPl/arith_inl_c.c
patching file src/BipsPl/scan_supp.c
patching file src/BipsPl/stream_c.c
patching file src/EnginePl/engine1.c
patching file src/Linedit/terminal.c
==> ./configure --prefix=/usr/local/Cellar/gnu-prolog/1.4.4 --with-doc-dir=/usr/local/Cellar/gnu-prolog/1.4.4/share/doc/gnu-prolog
==> make
==> make install
?  /usr/local/Cellar/gnu-prolog/1.4.4: 183 files, 13M, built in 17 seconds
```

うまくいった。
ちなみに、[Ruby1.8.7をインストールする](http://qiita.com/takc923/items/412d7d6b7ea045d66a3f)時も似たような問題があった。