LoginSignup
2
3

More than 5 years have passed since last update.

windowsにopam2をインストールする

Last updated at Posted at 2018-12-25

動機

SATySFiの環境構築に必要だったのでインストール手順を残しておく

Cygwin環境

windows上でlinux環境を楽しむためのもの
windowsの場合opamはこのCygwin上で動かすことになるが
すでにCygwin環境がある人とない人でインストール手順が変わってくる

インストール手順

基本的に以下のリンク先に従うだけ
http://fdopen.github.io/opam-repository-mingw/installation/

上記のリンクを開くと以下の画像のようになってるはず
fig1.jpg

上の「Graphical Installer」がCygwin環境のない人用で
下の「Manual Installation」がすでにCygwin環境がある人用の項目となる

Cygwin環境がない人

Graphical Installerのところに置いてあるインストーラをダウンロードして実行するだけ
これでopamが入ったCygwin環境が構築されるはず(自分はCygwin環境がすでにあったのでこっちは試してない)

Cygwin環境がある人

Cygwin環境がすでにある人はインストールして終わりとはならない(と言ってもやることは簡単だが)
1. まずCygwin環境に以下のパッケージを揃える
- rsync
- patch
- diffutils
- curl
- make
- unzip
- git
- m4
- perl
- mingw64-i686-gcc-core か mingw64-x86_64-gcc-core.
2.「Manual Installation」のDownload links:に置かれているファイルをダウンロードする(このとき32bit版,64bit版どちらをダウンロードしたかで,あとの処理が分岐する)
3. ダウンロードされたファイルが存在するディレクトリでCygwin環境のターミナルを開く
4-1.32bit版をダウンロードした人はターミナル上で以下の4つのコマンドを上から順番に実行する

[user]$ tar -xf 'opam32.tar.xz' 
[user]$ ./opam32/install.sh  /usr/local
[user]$ opam init default "https://github.com/fdopen/opam-repository- mingw.git#opam2" -c "ocaml-variants.4.07.1+mingw32c" --disable-sandboxing
[user]$ eval $(opam config env) 

4-2. 64bit版をダウンロードした人は以下の4つのコマンドを上から順番に実行する

[user]$ tar -xf 'opam64.tar.xz' 
[user]$ bash opam64/install.sh  /usr/local
[user]$ opam init default "https://github.com/fdopen/opam-repository-[user]$ mingw.git#opam2" -c "ocaml-variants.4.07.1+mingw64c" --disable-sandboxing
[user]$ eval $(opam config env)

どちらもやることは同じ
5. ターミナル上で以下を実行して

[user]$ opam --version

ちゃんとopamのバージョンが返ってきたらインストール成功

注意

opamのCygwinとの連携はログイン起動したシェルで行われる.

最後に

ドキュメントがちゃんとしててよかった

2
3
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
2
3