LoginSignup
4
2

More than 5 years have passed since last update.

Raspberry Pi にOCaml-4.00.1をソースからインストールする

Last updated at Posted at 2013-05-01

Raspberry Pi (Type B) に最新のOCamlをソースからインストールするためにやったことメモ(最新版にこだわらない人は apt-get install ocaml でOK)

Raspberry Pi のswap領域を増やす

ocamlのビルドにはメモリがたくさん必要な部分があるので、また、今後の開発のためにメモリのswap領域を1GBに増やしました。

参考: http://qapla.blog52.fc2.com/blog-entry-296.html

OCamlソースコードのダウンロード

$ wget http://caml.inria.fr/pub/distrib/ocaml-4.00/ocaml-4.00.1.tar.gz
$ tar xzvf ocaml-4.00.1.tar.gz

Raspberry Pi用のパッチを当てる

もともとOCamlはARM向けのネイティブコンパイラがありますが、そのままだとRaspberry Piではうまくいかない部分があるようです。

Anil Madhavapeddyさんという方がRaspberry Pi用のocaml patchを書いているのでそれを使わさせてもらいましょう。

$ cd ocaml-4.00.1
$ wget https://github.com/avsm/ocaml/commit/dc0776f55108a20dad5a9c06188545dc08dbf462.patch
$ patch -p1 < dc0776f55108a20dad5a9c06188545dc08dbf462.patch

OCamlのビルド・インストール

あとは普通のOCamlと同様です。

$ make world.opt
$ sudo make install

以上でocamlインストールできました。
have fun!

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2