「Tinkerコンパイル」の編集履歴(バックアップ)一覧はこちら
Tinkerコンパイル - (2010/05/26 (水) 18:28:55) の1つ前との変更点
追加された行は緑色になります。
削除された行は赤色になります。
* CygwinでTinkerをコンパイルする
http://dasher.wustl.edu/tinker/downloads/
から、tinker最新版(現在 tinker-5.1.07.tar.gz)と、mmff.tar.gzをダウンロードし、/tmpに置く。
/tmpに移動して、
tar zxvf tinker-5.1.07.tar.gz
cd tinker
cp mmff/*.[fi] source
cp makefile/Makefile source
cd source/
rm *.c
Makefileの修正
注意点:precise.fは-ffast-mathオプションを付けてコンパイルしてはならない。
それを踏まえて、Cygwin/gfortran用に書き直したMakefileが下のファイル。
ktors.fの410行目でコンパイルエラーが出るので、次のように書き換える。
旧 if (skipring.eq..true.) then
新 if (skipring) then
Makeして実行。segmentation faultが出る…
-fbounds-checkを付けてコンパイルし、実行してみると
At line 168 of file cluster.f
Fortran runtime error: Array reference out of bounds for
array 'kgrp', lower bound of dimension 1 exceeded (0 < 1)
cluster.fの168行を修正することで対処する。
旧 call sort (size(i),kgrp(igrp(1,i)))
新 if (size(i) > 1) then
call sort (size(i),kgrp(igrp(1,i)))
end if
実行。今度は、
At line 115 of file switch.f
Fortran runtime error: Substring out of bounds:
upper bound (6) of 'mode' exceeds string length (3)
サブルーチンswitchの引数を文字列ではなく整数に換えれば解決。
下の、trans_switch.rbをtinker/に置き、
ruby trans_switch.rb source/*.f
とする。そして、source/switch.fで、modeの型をintegerに書き換える。あとは
make
make rename
で終了。
* CygwinでTinkerをコンパイルする
http://dasher.wustl.edu/tinker/downloads/
から、tinker最新版(現在 tinker-5.1.07.tar.gz)と、mmff.tar.gzをダウンロードし、/tmpに置く。
/tmpに移動して、
tar zxvf tinker-5.1.07.tar.gz
cd tinker
cp mmff/*.[fi] source
cp makefile/Makefile source
cd source/
rm *.c
Makefileの修正
注意点:precise.fは-ffast-mathオプションを付けてコンパイルしてはならない。
それを踏まえて、Cygwin/gfortran用に書き直したMakefileが下のファイル。
ktors.fの410行目でコンパイルエラーが出るので、次のように書き換える。
旧 if (skipring.eq..true.) then
新 if (skipring) then
Makeして実行。segmentation faultが出る…
-fbounds-checkを付けてコンパイルし、実行してみると
At line 168 of file cluster.f
Fortran runtime error: Array reference out of bounds for
array 'kgrp', lower bound of dimension 1 exceeded (0 < 1)
cluster.fの168行を修正することで対処する。
旧 call sort (size(i),kgrp(igrp(1,i)))
新 if (size(i) > 1) then
call sort (size(i),kgrp(igrp(1,i)))
end if
実行。今度は、
At line 115 of file switch.f
Fortran runtime error: Substring out of bounds:
upper bound (6) of 'mode' exceeds string length (3)
サブルーチンswitchの引数を文字列ではなく整数に換えれば解決。
下の、trans_switch.rbをtinker/に置き、
ruby trans_switch.rb source/*.f
とする。そして、source/switch.fで、modeの型をintegerに書き換える。あとは
make
make rename
で終了。
追記
環境によってはSegmentation faultが出て落ちるようだ。最適化オプションを-O2にしたら動くようになった。原因不明。