MacでC4.5を使う
決定木を生成するアルゴリズムの C4.5 を実装したアプリケーションを
Macで使えるようにするためのメモ.
ファイルの修正
R8/Srcにある
- defns.i
- average.c
の2つを修正します.
まず,
- defns.i
# define cfree free
の1行を加えます.
次に
- average.c
51: if ( i != Numbers ) exit(); ↓ 51: if ( i != Numbers ) exit(1);
これで修正は完了
環境変数の設定
export CFLAGS="-arch x86_64 -arch i386" export LDFLAGS="-arch x86_64 -arch i386" export CXXFLAGS="-arch x86_64 -arch i386"
これでOK.
インストール
ここまで来たらReadMeにある通りに.
make all # R8/Src で
あとのコマンドは別に必要無いですね.
これでc4.5が使えるようになるはずです.
注意
Xcodeが最新でgccがllvm-gccになっているとうまくmakeが通らないようです.
古いバージョンのXcodeをインストールするかなんかしてgccを入れ直しましょう.
参考にインストールに成功したときのものを.
gcc -v Using built-in specs. Target: i686-apple-darwin10 Configured with: /var/tmp/gcc/gcc-5666.3~6/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1 Thread model: posix gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)