* SML# 0.90をMinGWでビルドしよう [#dd97bbc7] - 前提 -- 最新のMinGWとMSYSをmingw-getでインストール (gcc,c++,msys,...も) 参照 http://www.mingw.org/wiki/Getting_Started -- GMP 4.1 MinGWバイナリ http://www.cs.nyu.edu/exact/core/gmp/ - 手順 -- http://www.pllab.riec.tohoku.ac.jp/smlsharp/?HowToBuild * ダウンロード [#f0a92fa0] - http://www.pllab.riec.tohoku.ac.jp/smlsharp/?Download * コンパイル [#bca04739] ./configure make ** コンパイル失敗1: MEM_UNCOMMIT [#c88d53ab] gcc -g -O -DHAVE_CONFIG_H -DHOST_CPU_i386 -DMAXALIGN=16 -I../.. -DMINOR_GC -c - o heap_bitmap.o heap_bitmap.c heap_bitmap.c: 関数 'free_segment' 内: heap_bitmap.c:1393:2: エラー: 'MEM_UNCOMMIT' が宣言されていません (この関数内で の最初の使用) heap_bitmap.c:1393:2: 備考: 未宣言の識別子は出現した各関数内で一回のみ報告されま す make[2]: *** [heap_bitmap.o] Error 1 make[2]: Leaving directory `/home/keigoi/smlsharp-0.90/SMLSharp/src/nativeruntim e' make[1]: *** [all-subdirs] Error 2 make[1]: Leaving directory `/home/keigoi/smlsharp-0.90/SMLSharp/src' make: *** [all-subdirs] Error 2 - 修正: SMLSharp/src/nativeruntime/heap_bitmap.c, l.1242 #define UncommitPage(addr, size) \ VirtualFree(addr, size, MEM_UNCOMMIT) を #define UncommitPage(addr, size) \ VirtualFree(addr, size, MEM_DECOMMIT) に (参考 http://msdn.microsoft.com/en-us/library/windows/desktop/aa366892(v=vs.85).aspx ) ** コンパイル失敗2: OS.syserror unimplemented [#n57450b9] make[2]: Entering directory `/home/keigoi/smlsharp-0.90/SMLSharp/src/lib2' ../../src/compiler/smlsharp -B ../../src/nativeruntime -nostdpath -c basis/main/General.sml -o basis/main/General.o uncaught exception: Fail: Fail: OS.syserror unimplemented raised at: Basis/Implementation/Win32/os.sml:21.28-21.60 handled at: ..\loadfile\main\LoadFile.sml:128.59 ..\toplevel2\main\Top.sml:747.33-747.36 ..\toplevel2\main\Top.sml:836.37 main\SimpleMain.sml:368.53 make[2]: *** [basis/main/General.o] Error 1 make[2]: Leaving directory `/home/keigoi/smlsharp-0.90/SMLSharp/src/lib2' make[1]: *** [all-subdirs] Error 2 make[1]: Leaving directory `/home/keigoi/smlsharp-0.90/SMLSharp/src' make: *** [all-subdirs] Error 2 - 色々試した - 直接の原因は openFile (Filename.TextIO.openIn) で Fail例外が発生していること -- このエラーは、openInがIO例外を投げるかわりにFail "OS.syserror: unimplemented" しているのが原因か [[参考:http://mit.edu/~firebird/arch/sun4x_59/bin/sml/sml-nj/boot/Win32/os.sml]] -- ファイルの存在確認を、 Filename.TextIO.openIn がIO例外を投げるかどうかでなく、事前にチェックすればOK?