macOS Sonoma ではPHYLIP のインストールで詰まるため、強制的なインストール方法を載せる。
Kakusan4 は問題なく使えますが、PHYLIP 内蔵ソフトが一部使えなくなります。自己責任でお願いします。
上記サイトからinstallMolPhyPack_macOSHomebrew.sh をダウンロードする
テキストエディットでinstallMolPhyPack_macOSHomebrew.sh ファイルを開き、下記の部分を削除する。
# download and install JRE8
if ! test -e .java; then
wget -c https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u282-b08/OpenJDK8U-jre_x64_mac_hotspot_8u282b08.tar.gz || exit $?
tar -xzf OpenJDK8U-jre_x64_mac_hotspot_8u282b08.tar.gz || exit $?
mkdir -p $PREFIX/share/molphypack || exit $?
mv jdk8u282-b08-jre/Contents/Home/* $PREFIX/share/molphypack/ || exit $?
rm -rf jdk8u282-b08-jre OpenJDK8U-jre_x64_mac_hotspot_8u282b08.tar.gz || exit $?
touch .java || exit $?
fi
JRE8 は別個インストールしないとエラーが起きる
以下をterminal で実行
brew tap AdoptOpenJDK/openjdk
brew install adoptopenjdk8
terminal を開き下記を実行
chmod 755 installMolPhyPack_macOSHomebrew.sh
bash installMolPhyPack_macOSHomebrew.sh
terminal でkakusan4 を入力すると起動する。
installmolphypack_macoshomebrew.sh をテキストエディットで開き以下を削除
# download, compile, and install MAFFT
if ! test -e .mafft; then
wget -c https://mafft.cbrc.jp/alignment/software/mafft-7.475-without-extensions-src.tgz || exit $?
gtar -xzf mafft-7.475-without-extensions-src.tgz || exit $?
cd mafft-7.475-without-extensions/core || exit $?
perl -i -npe 's/^CFLAGS *= */$& -mtune=native /' Makefile || exit $?
gmake PREFIX=$PREFIX -j4 || exit $?
gmake PREFIX=$PREFIX install || exit $?
cd ../.. || exit $?
rm -rf mafft-7.475-without-extensions mafft-7.475-without-extensions-src.tgz || exit $?
touch .mafft || exit $?
fi
homebrew などでmafft を別個インストールすれば良い (要するに/usr/local/bin フォルダにあれば良い)。
brew install mafft
これでOK
自分は以下のエラーがでてコンパイルに失敗することを確認した。
gcc -O3 -mtune=native -c drawgram.c
drawgram.c:2111:9: error: call to undeclared function 'makebox'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
makebox(fontname,&xoffset,&yoffset,&scale,spp);
^
1 error generated.
Kakusan4 の計算ではdrawgram + drawtree は不要のため、強制的にインストールする。
まずinstallmolphypack_macoshomebrew.sh をテキストエディットで開き以下を削除
# download, compile, and install PHYLIP
if ! test -e .phylip; then
wget -c https://phylipweb.github.io/phylip/download/phylip-3.697.tar.gz || exit $?
gtar -xzf phylip-3.697.tar.gz || exit $?
cd phylip-3.697/src || exit $?
perl -i -npe 's/^CFLAGS *= */$& -O3 -mtune=native /' Makefile.unx || exit $?
gmake -j4 -f Makefile.unx all || exit $?
gmake -f Makefile.unx install || exit $?
cd ../exe || exit $?
mkdir -p $PREFIX/bin || exit $?
mv * $PREFIX/bin/ || exit $?
cd ../.. || exit $?
rm -rf phylip-3.697 phylip-3.697.tar.gz || exit $?
touch .phylip || exit $?
fi
echo 'Installation finished correctly!'
echo "You might need to add \"$PREFIX\" to PATH environment variable."
ここで一度installmolphypack_macoshomebrew.sh を完遂させる
※この時点ではKakusan4 は起動するが計算時にdnadist、dnapars、neighbor が無いためエラーがでる
そこで、暫定的な対処法としてソースコードを改変する
https://phylipweb.github.io/phylip/download/phylip-3.697.tar.gz をダウンロード
ダウンロードしたphylip-3.697.tar.gz をファインダーで解凍(仮にフォルダを/Users/@/phylip-3.697/とする)
src フォルダを開く
drawgram.c
drawtree.c
それぞれをテキストエディットで開き、2行目に以下を追記
// 強制的にインストール makebox エラーを無視する
void makebox(const char *fontname, int *xoffset, int *yoffset, double *scale, int spp);
保存後、/Users/@/phylip-3.697/src フォルダをterminal で開く
cd /Users/@/phylip-3.697/src
make -f Makefile.unx install
これで/Users/@/phylip-3.697/exe フォルダにコンパイルされたファイルが展開される
次にFinder で/Users/@/phylip-3.697/exe を開く
コンパイルされた実行ファイルをファインダーの「ウインドウ→フォルダへ移動」から「/usr/local/bin/」を指定
開かれた/usr/local/bin フォルダへコンパイルされたファイルを移動
terminal でkakusan4 を入力するとkakusan4 が起動する
起動後はfasta ファイルをドラッグアンドドロップすればフルパスが入力される