Omake をソースからビルド、インストールする。
はじめに
ソースからビルドしなくたって、omake が使えればいいっていう人は、「sudo apt-get install omake」を実行すれば、OKだと思う。
また、今回インストールした場所には、あらかじめパスを切ってあるので、そこのところヨロシク。
環境
準備
- ocaml のインストール
- omake ビルドエラーへの対処
手順
- コンパイラの指定
- prefix の設定
- ビルド
- インストール
準備
ocaml のインストール
ソースからインストールは面倒だったので、「sudo apt-get install ocaml」を実行で。
andre@andre-VirtualBox:~$ ocaml -version
The Objective Caml toplevel, version 3.12.0
omake ビルドエラーへの対処
ビルド中にコケたので、原因を探っていたら、ドンピシャの解決方法があった。
【参考サイト】
omakeをocaml-3.12.1でビルドする- yoshihiro503の関数的日記 - ocaml-nagoyaグループ
【エラー】
Error: Error-enabled warnings (3 occurrences)
omake: 656/1203 targets are up to date
omake: failed (2 min 13.51 sec, 153/153 scans, 131/144 rules, 354/1442 digests)
omake: targets were not rebuilt because of errors:
src/libmojave/lm_debug.cmx
src/libmojave/lm_debug.o
make: *** [all] エラー 2
手順
コンパイラの指定
この手順は飛ばしてもOK。
自分でビルドしたコンパイラを使いたかったので、それを指定した。
src/Makefile を下に示すとおりに変更した。
andre@andre-VirtualBox:~/work/omake/build/omake-0.9.8.6$ gcc --version
gcc (GCC) 4.7.0
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
デフォルトのコンパイラ
スレッドモデル: posix
gcc バージョン 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
ビルドしたコンパイラ
prefix の設定
デフォルトでは、/usr/local に prefix が設定されている。変えたい場合はどうするか。
configure があれば、--prefix=/xx と設定できるが、それがない。どうするか。
ソースツリーのトップ(omake-x.x.x)の .config ファイルを変更し、その中のPREFIXを「PREFIX=/xx」に変更する。
ビルド
「make all」を実行する。10分あれば、終わると思う。
インストール
「make install」を実行する。
andre@andre-VirtualBox:~/work/omake/build/omake-0.9.8.6$ ls ~/local/bin
ccmake cmake cpack ctest cvs_realclean omake osh
( デフォルトの omake が動くので、端末再起動 )
andre@andre-VirtualBox:~$ omake --version
OMake 0.9.8.6 (release candidate 1):
build [Sat Jun 9 14:29:27 2012]
on andre-VirtualBoxDefault library directory : /home/andre/local/lib/omake