SWIGging the LMC Code
- Copy your entire LMC directory, so we don't destroy
your originals!
- Copy LMCPython from the server into your directory.
- 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.
- 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!
- Edit your .h files.
- 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
- SWIG doesn't understand pragmas. Put
#ifndef SWIG
...
#endif // SWIG
around the #if _MSC_VER stuff.
- For neatness, some of the #include directories
can be edited to remove ../LMCFILES/
- Edit your new .cpp files.
- Remove "Lmc.h" and "stdafx.h"
- Comment out the line saying #define new DEBUG_NEW
- Make sure it still compiles and runs in the
Microsoft world. Make sure to check all three
algorithms!
- In the directory LMCPython, edit MD.i and Makefile.msc,
putting in the right directory and giving the names of
your files.
- 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.
- 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).