OSDN Git Service

Version 0.5.4
authortoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Thu, 6 May 2010 15:29:52 +0000 (15:29 +0000)
committertoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Thu, 6 May 2010 15:29:52 +0000 (15:29 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/molby/trunk@48 a2be9bc6-48de-4e38-9406-05402d4bc13c

Documents/src/doc_source.html
Documents/src/molby_rb/Kernel.html
README
Version
memo.txt
msw-build/molby.iss
wxSources/MyVersion.c
xcode-build/Info.plist
xcode-build/Molby.xcodeproj/project.pbxproj

index 1df8b72..14732fc 100644 (file)
 <div class="centered" lang="en">
 <h1>Molby</h1>
 <h2>An Interactive Molecular Modeling Software<br />with Integrated Ruby Interpreter</h2>
-<h3>Version 0.5.3 build 20100425</h3> <!-- version -->
+<h3>Version 0.5.4 build 20100507</h3> <!-- version -->
 <h3>Toshi Nagata</h3>
 </div>
 <div class="centered" lang="ja">
 <h1>Molby</h1>
 <h2>対話型分子モデリングソフトウェア<br />(Ruby インタプリタ内蔵)</h2>
-<h3>Version 0.5.3 build 20100425</h3> <!-- version -->
+<h3>Version 0.5.4 build 20100507</h3> <!-- version -->
 <h3>永田 央</h3>
 </div>
 <hr />
index 0797c8f..9034dc9 100644 (file)
@@ -33,6 +33,23 @@ The methods described here are the extension of the standard "Kernel" module. Th
 </p>
 </div>
 
+<div id="constants">
+<h3 class="section-bar">Constant</h3>
+
+<div class="method-detail">
+<a name="molbyresourcepath"></a>
+<div class="method-heading">
+<span class="method-name">MolbyResourcePath</span>
+</div>
+<div class="method-description">
+<p>
+A String describing the full path of the directory containing <code>Scripts</code> and <code>amber11</code> resources. On Windows, it is something like <code>"C:\\Program Files\\Molby"</code>. On Mac, it is something like <code>"/Applications/Molby/Molby.app/Contents/Resources"</code>.
+</p>
+</div>
+</div>
+
+</div>
+
 <div id="methods">
 <h3 class="section-bar">Public Instance methods</h3>
 
@@ -50,6 +67,19 @@ Open a modal dialog and get a line of text.
 </div>
 
 <div id="method-M000375" class="method-detail">
+<a name="call_subprocess"></a>
+<div class="method-heading">
+<span class="method-name">call_subprocess(cmdline, cmdname) &rarr; Integer<br />
+</span>
+</div>
+<div class="method-description">
+<p>
+Call a subprocess by the given command line. A progress window is shown, and the argument <code>cmdname</code> is used to show an appropriate message. Returns an integer value with the same meaning as <code>Kernel.system</code>.
+</p>
+</div>
+</div>
+
+<div id="method-M000375" class="method-detail">
 <a name="M000375"></a>
 <div class="method-heading">
 <span class="method-name">check_interrupt &rarr; Integer<br />
diff --git a/README b/README
index 381e7ca..e942cbc 100644 (file)
--- a/README
+++ b/README
@@ -5,7 +5,7 @@
     An Interactive Molecular Modeling Software
         with Integrated Ruby Interpreter
   
-          Version 0.5.3 build 20100425
+          Version 0.5.4 build 20100507
 
                   Toshi Nagata
 
@@ -52,10 +52,12 @@ Building Molby is somewhat complicated because you need static libraries of wxWi
 
 (1) Mac OS X
 
-(i) Xcode
+(i) Xcode, gfortran
 
 Install Xcode, if you have not done so yet. The Xcode project included in the source distribution is for Xcode 3.0 and later, thus you need Mac OS 10.5. It may work with Xcode 2.5 on Mac OS 10.4, but this have not been tested.
 
+To build AmberTools, you need to have gfortran installed. The author uses a binary build available at the "R for Mac OS X" website (http://r.research.att.com/tools/).
+
 (ii) wxWidgets
 
 Get wxMac-2.8.9.tar.gz from the wxWidgets page in sourceforge.net (http://sourceforge.net/projects/wxwindows/files/). Newer versions may work, but they are not tested.
@@ -104,9 +106,11 @@ Open xcode-build/Molby.xcodeproj, and build. Note that there are two configurati
 
 The Windows binary is built by using MinGW/MSYS. If you use VC++ or Cygwin, you need to help yourself. I use Windows only occasionally, so there may be errors and misunderstandings in the following descriptions. Feedback is welcome!
 
-(i) MinGW and MSYS
+(i) MinGW, MSYS, gfortran
+
+Install MinGW and MSYS. The author uses MinGW-5.1.4 and MSYS-1.0.11.
 
-Install MinGW and MSYS. The default configuration should be sufficient.
+To build AmberTools, you need to have gfortran installed. The author has experienced problems with the gfortran of MinGW, and instead is using the binary build taken from http://quatramaran.ens.fr/~coudert/gfortran/ (version 4.5.0, 20090421, trunk revision 146519).
 
 (ii) wxWidgets
 
@@ -121,7 +125,7 @@ Build wxMSW. The commands will be as follows. Take care of the configure options
 $ cd $HOME/wxMSW-2.8.9
 $ mkdir msw-build
 $ cd msw-build
-$ ../configure --with-msw --with-opengl --disable-shared --enable-unicode --with-libjpeg-builtin --with-zlib=builtin
+$ ../configure --with-msw --with-opengl --disable-shared --enable-unicode --with-libjpeg=builtin --with-zlib=builtin
 $ make
 (You do not need to do "sudo make install".)
 
@@ -183,5 +187,6 @@ $ make setup  #  To make the installer
 
 2010.1.21.
 2010.1.31. Added notice on AmberTools1.3
+2010.4.29. Update description for MinGW/MSYS
 
 Toshi Nagata
diff --git a/Version b/Version
index 31a67b3..197822a 100644 (file)
--- a/Version
+++ b/Version
@@ -1,2 +1,2 @@
-version = "0.5.3"
-date = "20100425"
+version = "0.5.4"
+date = "20100507"
index f8fb3b6..756ce2b 100755 (executable)
--- a/memo.txt
+++ b/memo.txt
@@ -31,4 +31,85 @@ OS 10.4 用のユニバーサルバイナリは、export ISYSROOT='-isysroot /De
   DialogItem の action 属性は今までと同様だが、引数としてはアイテム番号でなく DialogItem オブジェクトそのものが渡される。
 
 2010.3.21.
-  Pressure control を使えるようにしたい。フレームごとに unit cell パラメータを保持できるようにしないといけない。
+  Pressure control を使えるようにしたい。フレームごとに unit cell パラメータを保持できるようにしないといけない。→ 一応実装した。
+
+2010.4.25.
+  SVN メモ。タグの付け方。
+svn copy svn+ssh://toshinagata1964@svn.sourceforge.jp/svnroot/molby/trunk svn+ssh://toshinagata1964@svn.sourceforge.jp/svnroot/molby/tags/version_x_y_z -m "version x.y.z"
+
+2010.4.25.
+  wxWidgets 絡みの厄介なバグをいくつか退治したのでメモ。
+・wxDocument::Close() が二重に呼ばれる問題。メニューから Close コマンドを選ぶと、普通は wxDocManager::CloseDocument() が呼び出される。これは、最初に wxDocument::Close() を呼び、成功したら wxDocument::DeleteAllViews() を呼ぶのだが、この中から wxView::Close() -> wxView::OnClose() -> wxDocument::Close() という呼び出しがあるため、wxDocument::Close() が2回呼ばれてしまう。2回目に何もしないで true を返せばいいのだが、下手なコーディングをするとおかしくなってしまう。今回は、MoleculeView::OnClose() を修正して、wxDocument::Close() の呼び出しをスキップした。
+  参考: http://trac.wxwidgets.org/ticket/11367 
+・wxDocument::Close() をオーバーライドしたら、元の wxDocument::Close() を呼ばないといけない。こんな感じ。
+bool
+MyDocument::Close()
+{
+       if (mol != NULL && mol->mutex != NULL) {
+               return false;  /*  クローズを拒否  */
+       }
+       return wxDocument::Close();
+}
+ 理由は、wxDocument::Close() の中で、未保存のドキュメントを保存するかどうか尋ねる処理があるため。これを忘れて "return true;" としてしまうと、未保存のドキュメントの場合は wxDocument のデストラクタからこの処理が呼ばれてしまい、変なことになる。
+・wxMac で wxMDIParentFrame を使うとき、frame->Move(-10000, -10000); frame->Show(false); などとして不可視にするが、すべてのウィンドウが閉じられている状態でアプリケーションをバックグラウンドからフォアグラウンドに持って来た時など、何かの拍子にこのウィンドウが可視化されて Window メニューに現れてしまうことがある。これを防ぐ方法:
+(1) wxMDIParentFrame のコンストラクタ中で、
+#if defined(__WXMAC__)
+       OSStatus sts;
+       sts = ChangeWindowAttributes((WindowRef)m_macWindow, 0, kWindowInWindowMenuAttribute);
+#endif
+ ChangeWindowAttributes には <Carbon/Carbon.h> が必要。ちなみに、Ruby のヘッダと同時に #include すると T_DATA が二重定義になるので、#include <Carbon/Carbon.h> の前に #undef T_DATA を置く。
+(2) wxApp で Activate Event をつかまえて、そのたびに wxMDIParentFrame を不可視にする。なんとも強引だが、確実。
+EVT_ACTIVATE(MyApp::OnActivate)
+void
+MyApp::OnActivate(wxActivateEvent &event)
+{
+#if defined(__WXMAC__)
+       MyFrame *frame = GetMainFrame();
+       frame->Show(false);
+#endif
+       event.Skip();
+}
+
+2010.4.25.
+バージョン0.5.3をリリースしました。
+・フレームごとに可変な単位格子を設定可能。
+・パラメータテーブルのコピー/カット/ペーストを改善。
+・Mac 版で、隠れウィンドウの "Molby" がときどき Window メニューに現れる不具合を修正。
+・テーブルの編集時の不具合(Windows はクラッシュ、Mac はテキストフィールドが残ってしまう)の修正。
+Version 0.5.3 is out.
+* Frames can now have variable unit cell parameters.
+* Improved handling of copy/cut/paste in the parameter table.
+* Fix the problem in the Mac version in which the hidden top-level window gets sometimes visible in the Window menu.
+* Bugs in the list control were (hopefully) fixed.
+
+2010.4.29.
+  4/25 に修正した wxDocument::Close() 二重呼び出しの件、どうも修正の仕方がまずいみたいで、Windows でクラッシュを起こす。元に戻した。
+
+2010.5.4.
+  いろいろ変なクラッシュが起きる。malloc/free 関係のバグくさいのだが、なかなか特定できない。Mac 上では GuardMalloc を使い、MolAction.c:562 の
+-                              usave = *up;
++                              ParameterCopyOneWithType(&usave, up, i);
+が原因と特定できた。つまり、up は BondPar/AnglePar/etc. の配列へのポインタを UnionPar * にキャストしたものなので、up が配列の最後の要素を指しているときに *up をアクセスすると、存在しないメモリ領域を読み出すことになってしまう。(これでバスエラーが起きるのは相当不運なケースだが)。
+  Windows の方は本当に困ってしまった。開発ツールへの投資をけちるとこういうところでつまづくんだな。チェック用ツールをいろいろ探して、kmmalloc (http://www.vector.co.jp/soft/dos/prog/se026997.html) を使うことにした。使い方は同梱の kmmalloc.txt に全部書いてあるのだが、少し手こずってしまったのでメモしておく。
+・インストールの仕方:
+(1) kmmalloc-2.5.3.zip をダウンロード、解凍。
+(2) $ cd kmmalloc-2.5.3
+(3) patch -c < mingw.dif
+(4) xalloc.h を編集して、次の5行を追加。
+#define EFREEP 120
+#define EFREEBLK 121
+#define EALLOCBLK 122
+#define EFREEWRT 123
+#define ETRAILWRT 124
+(5) mingw.mak を編集する。
+-LIBDIR = /usr/local/lib
++LIBDIR = /mingw/lib
+(6) make PACKAGE=KMMALLOC _MEM_DEBUG=1 -f mingw.mak
+ 途中で一回「問題が発生したため、test_mem.exe を終了します。」というダイアログが出る。仕様なのか不具合なのか不明。
+(7) mkdir /mingw/include/kmmalloc; cp xalloc.h yalloc.h /mingw/include/kmmalloc
+・使い方
+(1) ビルド時に -lkmmalloc_debug フラグをリンカに渡す。これで malloc/free/realloc が kmmalloc のものと置き換わる。
+(2) 問題のソースに #include <kmmalloc/xalloc.h> を入れておくと、malloc/free/realloc のコール時に __FILE__, __LINE__ を渡すようにしてくれるが、これをしなくてもデバッガを使えば何とかなる。
+(3) export MEMCHECK=2  #  kmmalloc のデバッグ機能を有効にする。ログを書き出すなら export MEMCHECK=4; export MEMFP=ファイル名 とする。
+(4) デバッガで mem_error() 関数にブレークポイントを指定して実行。実行は非常に遅くなる場合がある(それほどでもない場合もある)。
+(5) strdup, wcsdup 中の malloc はこの方法では置き換えられないようなので、自前で malloc を使うバージョンを用意して使う。(Missing.c 参照) → どうも wxWidgets の中の strdup コールはこれでは置き換わってくれないらしく、かえって変なことが起きているような気がする。kmmalloc.a をリンクする条件で wxWidgets を再コンパイルしないとだめか? → マルチスレッドに未対応? 無理かも…
index f90ec6a..a07dcfc 100755 (executable)
@@ -1,6 +1,6 @@
 [Setup]
 AppName = Molby
-AppVerName = Molby (v0.5.3 build 20100425)
+AppVerName = Molby (v0.5.4 build 20100507)
 DefaultDirName = {pf}\Molby
 DefaultGroupName = Molby
 UninstallDisplayIcon = {app}\Molby.exe
index 2a07b41..983cab3 100644 (file)
@@ -15,5 +15,5 @@
  GNU General Public License for more details.
  */
 
-const char *gVersionString = "v0.5.3 build 20100425";
+const char *gVersionString = "v0.5.4 build 20100507";
 const char *gCopyrightString = "Copyright (c) 2008-2010 Toshi Nagata";
index 1a79a64..ef24310 100755 (executable)
@@ -36,6 +36,6 @@
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
-       <string>v0.5.3 build 20100425</string>
+       <string>v0.5.4 build 20100507</string>
 </dict>
 </plist>
index 3ec5bd2..c0e8bcb 100755 (executable)
@@ -48,6 +48,7 @@
                E4A02341106B652F0094DBF8 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = E4A0233F106B652F0094DBF8 /* InfoPlist.strings */; };
                E4A02347106B65640094DBF8 /* molby_icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = E4A02346106B65640094DBF8 /* molby_icon.icns */; };
                E4A02357106B657D0094DBF8 /* Scripts in Resources */ = {isa = PBXBuildFile; fileRef = E4A0234A106B657D0094DBF8 /* Scripts */; };
+               E4A1802811897F8600B394E7 /* wxKillAddition.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4A1802711897F8600B394E7 /* wxKillAddition.cpp */; };
                E4A4667610C15B4300E40A9D /* listctrl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4A4667410C15B4300E40A9D /* listctrl.cpp */; };
                E4C0C4960F25734B00161EC2 /* Dcd.c in Sources */ = {isa = PBXBuildFile; fileRef = E4C0C4950F25734B00161EC2 /* Dcd.c */; };
                E4C8CBDF10B83060006C4692 /* MyDocManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4C8CBDE10B83060006C4692 /* MyDocManager.cpp */; };
                E4A02340106B652F0094DBF8 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
                E4A02346106B65640094DBF8 /* molby_icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = molby_icon.icns; path = ../bitmaps/molby_icon.icns; sourceTree = SOURCE_ROOT; };
                E4A0234A106B657D0094DBF8 /* Scripts */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Scripts; path = ../Scripts; sourceTree = SOURCE_ROOT; };
+               E4A1802711897F8600B394E7 /* wxKillAddition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = wxKillAddition.cpp; path = ../wxSources/wxKillAddition.cpp; sourceTree = SOURCE_ROOT; };
                E4A4667410C15B4300E40A9D /* listctrl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = listctrl.cpp; path = ../wxSources/listctrl.cpp; sourceTree = SOURCE_ROOT; };
                E4C0C4940F25734B00161EC2 /* Dcd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Dcd.h; sourceTree = "<group>"; };
                E4C0C4950F25734B00161EC2 /* Dcd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Dcd.c; sourceTree = "<group>"; };
                                E44CEED5100E1E9C0040BD51 /* ProgressFrame.h */,
                                E44CEED4100E1E9C0040BD51 /* ProgressFrame.cpp */,
                                E472B7C41087F63200F931F3 /* MyVersion.c */,
+                               E4A1802711897F8600B394E7 /* wxKillAddition.cpp */,
                                E43CCD8E0EB20BC800108D2D /* MolLib */,
                        );
                        name = wxSources;
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                        shellPath = /bin/sh;
-                       shellScript = "export TARGET_PLATFORM=MAC\nexport PATH=/usr/local/bin:$PATH\nif [ \"$BUILD_STYLE\" = \"Release\" ]; then\n  cd $PROJECT_DIR/..\n  /usr/bin/ruby \"update_version.rb\"\n  cd Documents\n  /usr/bin/ruby \"makedoc.rb\"\nfi\n(cd $PROJECT_DIR; make -f ../Makefile_amber11)\n";
+                       shellScript = "export TARGET_PLATFORM=MAC\nexport PATH=/usr/local/bin:$PATH\n#if [ \"$BUILD_STYLE\" = \"Release\" ]; then\n#  cd $PROJECT_DIR/..\n#  /usr/bin/ruby \"update_version.rb\"\n#  cd Documents\n#  /usr/bin/ruby \"makedoc.rb\"\n#fi\n(cd $PROJECT_DIR; make -f ../Makefile_amber11)\n";
                };
 /* End PBXShellScriptBuildPhase section */
 
                                E4E470C910AE6F8600F72B68 /* GlobalParameterFilesFrame.cpp in Sources */,
                                E4C8CBDF10B83060006C4692 /* MyDocManager.cpp in Sources */,
                                E4A4667610C15B4300E40A9D /* listctrl.cpp in Sources */,
+                               E4A1802811897F8600B394E7 /* wxKillAddition.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };