
                          Charm++ for Win32/64

       Copyright (C) 1989-2004 Regents of the University of Illinois

You can compile charm++ under Windows9x/2000/NT with VC++ plus Cygwin.
Cygwin are ports of the popular GNU development tools and utilities for 
Windows 9x/2K and NT, which emulates a UNIX environment under Windows.

Note that since November 2005, Windows98 is not supported with VC++.
Support for WindowsNT/XP is improved to take advantage of the creation of
symbolic link under WindowsNT. In addition, the Microsoft Visual Studio Express
edition (which is free for download and registeration) doesn't include 64-bit 
compiler and other 64-bit tools, therefore, to build charm++ for 64-bit windows, a standard Microsoft Visual Studio is required.
 
Please read the FAQ at end of this file.


                       Setup and Compilation
                    ===========================
(Note: building charm++ for 64-bit windows follows the exact way of building
 for 32-bit windows. Therefore, changing "win32" to "win64" in the following 
 paragraphs gives you the guide to build charm++ for 64-bit windows.)

To compile charm with VC++:
1. install cygwin from: http://sourceware.cygnus.com/cygwin
   Remember to choose default file type as "unix" at the beginning of 
   cygwin installation.

2. Start a Cygwin's Bash Shell window, type "cl" to make sure VC++ compiler 
   command line mode is correctly set. If it is not correctly set, you need to 
   run the VCVARS32.BAT, or vcvarsall.bat (after VC++ 8.0) at Windows startup 
   time. 
   VCVARS32.BAT can be located in your VC++ install directory, usually at: 
   /Program Files/Microsoft Visual Studio/VC98/Bin
   For Microsoft Visual C++ 8.0 and beyond, it is usually located at:
   C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat

   Note that VCVARS32.BAT, or vcvarsall.bat (a DOS Batch) cannot be executed 
   under Bash Shell, you have to: 
   for Win8x: put it into AUTOEXEC.BAT; 
   for WinNT/WindowsXP/Vista: you have to call VCVARS32.BAT in cygwin.bat 
              which is the target of the Cygwin icon on your desktop. 
              For example, if cygwin is installed under c:\cygwin,
              modify c:\cygwin\cygwin.bat to something like:

   >>>>>>>>>>>>>>>>>>>
   @echo off

   call "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall"

   C:
   chdir D:\cygwin\bin

   bash --login -i
   >>>>>>>>>>>>>>>>>>>>

   NOTE, for VC++ 64 bit, change the above line to:

   call "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall" amd64

3. This step is optional if you have installed Microsoft Visual Studio under 
   the following (default) location: 
     /Program Files/Microsoft Visual Studio 8\VC
   In case it is not at this directory, edit the following (text) files to 
   modify VCC_DIR and SDK_DIR to point to your visual studio c++ and 
          Microsoft SDK directories:
    src\arch\win32\unix2nt_ar
    src\arch\win32\unix2nt_cc  

4. Now you can compile Charm++ like Unix, for example:

   ./build charm++ net-win32

   this will build all Charm++ executables under net-win32/bin and all libs
   under net-win32/lib



                     Compile and Run Charm++ Programs
                  ======================================

1. After Charm++ compilation is complete, you can try some sample programs under
   net-win32\pgms. For example, 
   cd net-win32/pgms/charm++/megatest, and type "make",
   it will invoke Charm++'s "charmc"(VC++ wrapper) to compile the test 
   programs and generates an executable "pgm.exe" and a charm++'s parallel
   run utility program - "charmrun.exe".
   Now you have two choices of running the executable:
   (1) locally on your desktop, using:
       ./charmrun +p1 ./pgm ++local
       this will fork one copy of node program on your local machine. You can 
       choose using more than one virtual processors, e.g. using +p3  option.
       Starting from Charm 5.4R2, You can also run, simply type executable and 
       command line options:
       ./pgm 
       This will run only one copy of program locally.

   (2) run in parallel across machines:
       In this case, you need to write a .nodelist file under your home
       directory(~) in bash terminal, here is an example:

group main
host hostname1
host hostname2 

       Next, you need to start charmd.exe, which is under net-win32/bin on
       all the nodes as listed in the .nodelist file.
       Now run the Charm++ program, for example:
       ./charmrun +p2 ./pgm


   For details of Charm++ compilation options and charmrun comman line options
explanation, please check the manuals on charm.cs.illinois.edu web site manual 
section.
   If you have any problem or suggestion, please let me know by sending
email to (charm@cs.illinois.edu).



                                    FAQ
			      ==============


 1. I don't like Cygwin, can I compile Charm++ without Cygwin?

   Yes, there is an un-documented way to compile Charm++ under MS-DOS windows 
   with VC++ and nmake. However, this is only occasionally maintained and not 
   guarranteed to always work.
   Follow this steps:
   1 open a MS-DOS windows, cd to Charm++ directory, and mkdir net-win32\tmp;
   2 cd to net-win32\tmp, copy Makefile.win32 from 
     charm\src\Common\scripts\Makefile.win32 to current directory;
   3 type: nmake /f Makefile.win32
   4 To compile Charm++ programs, see the Makefile.win32 examples under
     net-win32\pgms\charm++\megatest\Makefile.win32
     The command to use is: nmake /f Makefile.win32
     Basically you need to specify all the charm++ libraries to link against,
     because shell script charmc is not available,

 2. I just downloaded Charm++ net-win32 binaries from your website, how to use it?

   The recommended way to run windows binary is under Cygwin.
   First, unzip the binary packages to desired location; Set PATH environment
   varaible to include the charm bin/ directory. That's it, you can now cd 
   to Charm++ testsuite directory, for example: pgms/charm++/megatest, to 
   compile your first Charm++ program using "make".
   If you don't want to use Cygwin, you have to use "nmake" to compile Charm++
   programs, see the Makefile example under: 
   pgms/charm++/megatest/Makefile.win32.

 3. How to compile under Windows98?

   Compiling Charm++ with cygwin/gnu compiler (net-cygwin) under Windows98 
   is still supported. However, we don't support VC++ with Windows98 any more.
   To compile Charm++ under Windows98, one can check out Charm++ version
   before November 2005. 
