SWIGging the LMC Code

  1. Copy your entire LMC directory, so we don't destroy your originals!
  2. Copy LMCPython from the server into your directory.
  3. Move all "your" files into the directory LMCFiles. (Microsoft by default adds new class files to LMCWin.) In particular, you'll want your two new algorithms and the magnetization observer files copied.
  4. Start up LMC.dsw, use File View to remove the files you moved, and then add them back again in their new places. Make sure the program compiles and runs!
  5. Edit your .h files.
    1. SWIG doesn't like "if !defined", so change #if !defined(XXX) to #ifndef XXX You might shorten the XXX to just (e.g.) WOLFFDYNAMICS_H
    2. SWIG doesn't understand pragmas. Put
      #ifndef SWIG
      ...
      #endif // SWIG
      around the #if _MSC_VER stuff.
    3. For neatness, some of the #include directories can be edited to remove ../LMCFILES/
  6. Edit your new .cpp files.
    1. Remove "Lmc.h" and "stdafx.h"
    2. Comment out the line saying #define new DEBUG_NEW
    3. Make sure it still compiles and runs in the Microsoft world. Make sure to check all three algorithms!
  7. In the directory LMCPython, edit MD.i and Makefile.msc, putting in the right directory and giving the names of your files.
  8. Launch a DOS window (Command Prompt). Change directory into C:\Program Files\Microsoft Visual Studio\ VC98\bin, and run vcvars32. (This sets up paths and stuff for compiling.) Don't exit the DOS window.
  9. Change directory into your LMCPython directory, and type
    nmake /f Makefile.msc You should get one warning, that the base class Subject is undefined. Ask questions when you get errors...

Statistical Mechanics: Entropy, Order Parameters, and Complexity, now available at Oxford University Press (USA, Europe).