2003-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / man / mono.1
1 .\" 
2 .\" mini manual page.
3 .\" (C) 2003 Ximian, Inc. 
4 .\" Author:
5 .\"   Miguel de Icaza (miguel@gnu.org)
6 .\"
7 .TH Mono "Mono 1.0"
8 .SH NAME
9 mini \- Mono new's code ECMA-CLI code generator (Just-in-Time and Ahead-of-Time)
10 .SH SYNOPSIS
11 .PP
12 .B mini
13 [\-\-aot]
14 [\-\-break METHOD] 
15 [\-\-breakonex]
16 [\-\-compile name] 
17 [\-\-compileall] 
18 [\-\-config filename]
19 [\-\-coverage]
20 [\-\-debug] 
21 [\-\-graph[=TYPE] METHOD]
22 [\-\-help] 
23 [\-\-trace]
24 [\-\-ncompile num]  
25 [\-\-optimize=MODE]
26 [\-O=mode]
27 [\-\-profile]
28 [\-\-regression]
29 [\-\-statfile FILE]
30 [\-v]
31 [\-\-verbose]
32 file [arguments...]
33 .SH DESCRIPTION
34 The \fImini\fP program is a runtime implementation of the ECMA Common
35 Language Infrastructure.  The runtime contains a native code generator
36 that transforms the Common Intermediate Language into native code.
37 .PP
38 The code generator can operate in two modes: just in time compilation
39 (JIT) or ahead of time compilation (AOT).  Since code can be
40 dynamically loaded, the runtime environment and the JIT are always
41 present, even if code is compiled ahead of time.  
42 .PP
43 The runtime loads ths specified
44 .I file
45 and optionally passes
46 the
47 .I arguments
48 to it.  The 
49 .I file
50 is an ECMA assembly.  They typically have a .exe or .dll extension.
51 .PP
52 The runtime provides a number of configuration options for running
53 applications, for developping and debugging, and for testing and
54 debugging the runtime itself.
55 .SH RUNTIME OPTIONS
56 .TP
57 .I "--aot"
58 This option is used to precompile the CIL code in the specified
59 assembly to native code.  The generated code is stored in a file with
60 the extension .so.  This file will be automatically picked up by the
61 runtime when the assembly is executed.  
62 .TP
63 This pre-compiles the methods, but the original assembly is still
64 required to execute as this one contains the metadata and exception
65 information which is not availble on the generated file.  When
66 precompiling code, you might want to compile with all optimizations
67 (-O=all).  Pre-compiled code is position independent code.
68 .TP
69 Pre compilation is just a mechanism to reduce startup time, and avoid
70 just-in-time compilation costs.  The original assembly must still be
71 present, as the metadata is contained there.
72 .TP
73 .I "--config filename"
74 Load the specified configuration file instead of the default one(s).
75 The default files are /etc/mono/config and ~/.mono/config or the file
76 specified in the MONO_CONFIG environment variable, if set.  See the
77 mono-config(5) man page for details on the format of this file.
78 .TP
79 .I "--help", "-h"
80 Displays usage instructions.
81 .TP
82 .I "--optimize=MODE", "-O=mode"
83 MODE is a comma separated list of optimizations.  They also allow
84 optimizations to be turned off by prefixing the optimization name with
85 a minus sign.
86 .TP
87 The following optimizations are implemented:
88 .nf
89              peephole   Peephole postpass
90              branch     Branch optimizations
91              inline     Inline method calls
92              cfold      Constant folding
93              consprop   Constant propagation
94              copyprop   Copy propagation
95              deadce     Dead code elimination
96              linears    Linear scan global reg allocation
97              cmov       Conditional moves
98              shared     Emit per-domain code
99              sched      Instruction scheduling
100              instrins   Intrinsic method implementations
101              tailc      Tail recursion and tail calls
102              loop       Loop related optimizations
103 .fi
104 .TP
105 For example, to enable all the optimization but dead code
106 elimination and inlining, you can use:
107 .nf
108         -O=all,-deadce,-inline
109 .fi
110
111 .SH DEVELOPMENT OPTIONS
112 .I "--break method"
113 Inserts a breakpoint before the method whose name is `method'
114 (namespace.class:methodname).  Use `Main' as method name to insert a
115 breakpoint on the application's main method.
116 .TP
117 .I "--breakonex"
118 Inserts a breakpoint on exceptions.  This allows you to debug your
119 application with a native debugger when an exception is thrown.
120 .TP
121 .I "--coverage"
122 Performs coverage analysis on the underlying IL code.
123 .TP
124 .I "--trace"
125 Shows method names as they are invoked.
126
127
128
129 .SH DEVELOPMENT OPTIONS
130 The following options are used to debug a JITed application.  They're
131 only useful when running the JIT in a debugger:
132 .TP
133 .I "--debug"
134 Turns on the debugging mode in the runtime.  If an assembly was
135 compiled with debugging information, it will produce line number
136 information for stack traces. 
137 .TP
138 .I "--profile"
139 Instructs the runtime to collect profiling information about execution
140 times and memory allocation, and dump it at the end of the execution.
141
142
143
144 .SH MAINTAINER OPTIONS
145 The maintainer options are only used by those developing the runtime
146 itself, and not typically of interest to runtime users or developers.
147 .TP
148 .I "--compile name"
149 This compiles a method (namespace.name:methodname), this is used for
150 testing the compiler performance or to examine the output of the code
151 generator. 
152 .TP
153 .I "--compileall"
154 Compiles all the methods in an assembly.  This is used to test the
155 compiler performance or to examine the output of the code generator
156 .TP 
157 .I "--graph=TYPE METHOD"
158 This generates a postscript file with a graph with the details about
159 the specified method (namespace.name:methodname).  This requires `dot'
160 and ghostview to be installed (it expects Ghostview to be called
161 "gv"). 
162 .TP
163 The following graphs are available:
164 .nf
165           cfg        Control Flow Graph (CFG)
166           dtree      Dominator Tree
167           code       CFG showing code
168           ssa        CFG showing code after SSA translation
169           optcode    CFG showing code after IR optimizations
170 .fi
171 Some graphs will only be available if certain optimizations are turned
172 on.
173 .TP
174 .I "--ncompile"
175 Instruct the runtime on the number of times that the method specified
176 by --compile (or all the methods if --compileall is used) to be
177 compiled.  This is used for testing the code generator performance. 
178 .TP
179 .I "-v", "--verbose"
180 Increases the verbosity level, each time it is listed, increases the
181 verbosity level to include more information.
182
183
184 .SH ENVIRONMENT VARIABLES
185 .TP
186 .I "GC_DONT_GC"
187 Turns off the garbage collection in Mono.  This should be only used
188 for debugging purposes
189 .TP
190 .I "MONO_PATH"
191 Provides a search path to mono and mint where to look for library files.
192 Directories are separated by the platform path separator (colons on unix). Example:
193 .B /home/username/lib:/usr/local/mono/lib
194 .TP
195 .I "MONO_DISABLE_SHM"
196 If this variable is set, it disables the Windows I/O Emulation layer,
197 and handles (files, events, mutexes, pipes) will not be shared across
198 processes.  This option is only available on Unix.
199 .TP
200 .I "MONO_CFG_DIR"
201 If set, this variable overrides the default system configuration directory
202 ($PREFIX/etc). It's used to locate machine.config file.
203 .TP
204 .I "MONO_CONFIG"
205 If set, this variable overrides the default runtime configuration file
206 ($PREFIX/etc/mono/config). The --config command line options overrides the
207 environment variable.
208 .SH FILES
209 On Unix assemblies are loaded from the installation lib directory.  If you set
210 `prefix' to /usr, the assemblies will be located in /usr/lib.  On
211 Windows, the assemblies are loaded from the directory where mono and
212 mint live.
213 .PP
214 /etc/mono/config, ~/.mono/config
215 .IP
216 Mono runtime configuration file.  See the mono-config(5) manual page
217 for more information.
218 .SH MAILING LISTS
219 Visit http://mail.ximian.com/mailman/mono-list for details.
220 .SH WEB SITE
221 Visit: http://www.go-mono.com for details
222 .SH SEE ALSO
223 .BR mcs(1), mint(1), monodis(1), mono-config(5)
224
225