Cleanup #960: Replace CmiEnforce(0) calls in verbs and net layer
[charm.git] / README.cygwin
blob8d4e24de9410123148ebfd107a955c606e2162c2
1                            Charm++ for Cygwin
3        Copyright (C) 1989-2000 Regents of the University of Illinois
5 Now you can compile charm++ under Windows9x/2000/NT/XP with Cygwin using its 
6 GNU compiler. The generated executables require cygwin1.dll, and have to run
7 under cygwin environment. To build Charm++ program that do not depend on 
8 Cygwin DLL and only depend on runtime libraries distributed as part of the 
9 OS (Win9x/NT), one needs to compile Charm++ using Mingw.
10 Note: This version of cygwin is still under testing.
11 Check the FAQ at end of this file for more help.
14                        Setup and Compilation
15                     ===========================
17 To compile charm on cygwin:
18 1. install cygwin from: http://www.cygwin.com/mirrors.html
19    download inetutils, openssh, w32api packages and gcc of course. Remember to
20    choose default file type as "unix" at the beginning of cygwin installation.
22 2. before compiling, make sure you have /bin/sh correctly installed, otherwise
23    make a link from /bin/bash.exe:  ln -s /bin/bash.exe /bin/sh.exe
24    compile charm++:    
25      ./build charm++ net-cygwin
27 3. set up environment:
28      There are several ways to do this, using rsh or ssh. 
29    Under Windows2000/NT, ssh is recommended, I once had difficulty to have 
30    inetd working.
31      Starting from Charm++ version 5.4, ++local option is added to start
32    node programs directly on your desktop machine. You no longer need rshd or 
33    sshd to start charm program on local machine. This is for testing purpose 
34    or small job run though, for best performance, launch one process per 
35    processor with rsh daemons.
36    Starting from Charm++ V5.4R2, you can also run Charm++ program in standalone
37    mode without charmrun.
39  ** RSH method **
40    setup /etc/inetd.conf and /etc/services to start rshd, 
41    Here is an example of /etc/inetd.conf:
43 ###
44 shell stream tcp nowait.1000  root /usr/sbin/in.rshd  in.rshd
45 ###
47    and an example of /etc/services:
49 ###   
50 shell     514/tcp    cmd
51 ###
53    before running charm program, start 'inetd' first to get rshd running.
54    Run debug mode 'inetd -d' to see the debug information.
56  ** SSH method **
57      Check /etc/passwd, make sure your home directory is correct. (it may be
58    empty there!)
59    run "/usr/bin/ssh-config" to setup all ssh config files.
60      Since openssh version 2.5.1p2, you have to run /usr/bin/ssh-host-config
61    for the first time to generate global config files and server keys; and 
62    run /usr/bin/ssh-user-config creates the private and public keys for a user.
63    You may need to modify /etc/sshd_config or /etc/ssh_config for your needs.
64    
65      Setup ~/.shosts, or add your public key to your ~/.ssh/authorized_keys to 
66    allow you to login without password authentication. You can test if your
67    setting works by:   
68        ssh localhost date
69    
70    Now you can start sshd and run charm programs. To tell Charmrun to use ssh
71    instead of rsh(default), you need to add ++shell option in ~/.nodelist file:
73 group main ++shell /bin/ssh
74 host localhost 
76  ** run only on local machine with ++local **
77      This allows a user to run charm program on his/her desktop machine for 
78    testing purpose or running a small job without the hassle of setting up any 
79    rsh deamons. To launch a charm++ program on your local machine, use 
80    "++local" option via:
81   
82      ./charmrun +p4 ++local ./pgm
84  ** run in standalone mode **
85      You can run Charm++ program without charmrun after Charm++ V5.4R2.
86    Simply type executable and command line options:
87    ./pgm 
88    This will run only one copy of program locally.
90 4. If you have any problem with it, please check the FAQ below for help.
91    Let me know if it works or not by sending email to (charm@cs.illinois.edu).
96                                     FAQ
97                               ==============
99  * Why would I use net-cygwin version?
101    First cygwin is free, it comes with free gcc compiler, cvs and openSSH.
102    You don't need expensive Visual C++ compiler to get work done. For unix 
103    fans, it is also a good idea to just turn your windows box to a unix 
104    workspace, and learn and run charm++ program uniformly on all platforms.
106  * How to get your latest version of Charm++?
108    You can use anonymous cvs login to checkout the latest version of charm.
109    (It may not be the latest stable version though)
110    1. login the cvs server:
112       cvs -d :pserver:checkout@thrift.cs.illinois.edu:/expand6/cvsroot login
114       when CVS passwd is prompted, just type <Enter>.
115    2. checkout charm
117       cvs co -P charm
119       You should get latest charm source tree.
120    3. logout the cvs server
122       cvs logout
124  * How to compile Charm++ executable using Mingw?
126    Make sure mingw-runtime is installed using Cygwin setup program. 
128    Download "MinGW API for MS-Windows" from mingw website: 
129       http://www.mingw.org/download.shtml 
130    The downloaded file should be named as w32api-3.11.tar.gz.
131    Install the file under /usr/local/mingw
133    Now build charm++ with "mingw" option:
134      ./build charm++ net-cygwin mingw
136    One can then compile Charm++ application using mingw support and run 
137    applications outside of Cygwin. However, note that one can not use 
138    ssh mode in charmrun to start a parallel job. Instead, use charmd which 
139    is a daemon process that listen charm command and start processes.
141  * Problem: Charm++ build script stops when it compile "ckfutures.ci", with 
142    error message: "Syntax error at line 1: parse error"
144    This happens when the .ci files have strange characters like '^M' at end
145    of each line. Don't use WinCVS to checkout charm because it will append
146    '^M' for each line. Use the cvs that comes free from cygwin.
147    After charm++ version 5.4, this bug is fixed.
149  * Problem: I got a runtime error "CthCreate failed to create fiber!".
151      net-cygwin uses Win32 Fiber in its user threads implementation. However, 
152    there is a limit upon the number of Fibers you can create at one time in 
153    the w32api of cygwin. The current limit (as I tested) is between 50-52. You 
154    have to reduce the number of processors or the number of charm++ threads
155    you create in the program to run the program under cygwin.