1
0

More than 5 years have passed since last update.

MacでSML#のインストール覚書

Posted at

MacでSML#をインストールするには、公式サイトの説明のとおりすれば良いはずなのだが現時点ではエラーがでてインストールできない。

ちょっと調べてみたら、どうやら、

http://www.pllab.riec.tohoku.ac.jp/smlsharp/download/smlsharp.rbの5行目

sha256 "(stdin)= 8dec09e576b987a55915fbe154d5fe5b379399519433f50d3ba28232951c5977"

が、おそらくコピペしたときにでも間違えたらしく動かない。

どうみても(stdin)=が余計なので、これを省いたスクリプトを以下に全文のせておく。

smlsharp.rb
class Smlsharp < Formula
  desc "Standard ML compiler with practical extensions"
  homepage "http://www.pllab.riec.tohoku.ac.jp/smlsharp/"
  url "http://www.pllab.riec.tohoku.ac.jp/smlsharp/download/smlsharp-3.4.0.tar.gz"
  sha256 "8dec09e576b987a55915fbe154d5fe5b379399519433f50d3ba28232951c5977"

  depends_on "llvm37"
  depends_on "gmp"
  depends_on "yajl"
  depends_on "xz" => :build

  def install
    system "./configure",
           "--prefix=#{prefix}",
           "--with-llvm=#{HOMEBREW_PREFIX}/lib/llvm-3.7"
    system "make", "install"
  end

  test do
    assert_match "val it = 0xC : word", shell_output("echo '0w12;' | smlsharp")
  end
end

このスクリプトをsmlsharp.rbの名前で保存しておいて(ファイル名が違うと動かない)、以下のコマンドを実行すると無事インストールできた。

$ brew install http://www.pllab.riec.tohoku.ac.jp/smlsharp/download/massivethreads.rb
$ brew install smlsharp.rb

ちなみにインストールには43分ほどかかった。その時のログが以下。
時間に余裕があるときにしたほうがよさそうです。

/usr/local/Cellar/smlsharp/3.4.0: 698 files, 41.9MB, built in 43 minutes 9 seconds

ドキュメント

ちなみにSML#のドキュメントはこちら

1
0
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
1
0