2006-08-18 Aaron Bockover <abockover@novell.com>
[mono.git] / README
1
2 This is Mono.
3
4         1. Installation
5         2. Using Mono
6         3. Directory Roadmap
7
8 1. Compilation and Installation
9 ===============================
10
11    a. Build Requirements
12    ---------------------
13
14         To build Mono, you will need the following components:
15
16                 * pkg-config
17
18                   Available from: http://www.freedesktop.org/Software/pkgconfig
19
20                 * glib 2.4
21
22                   Available from: http://www.gtk.org/
23
24         On Itanium, you must obtain libunwind:
25
26                 http://www.hpl.hp.com/research/linux/libunwind/download.php4
27
28         On Solaris, make sure that you used GNU tar to unpack this package, as
29         Solaris tar will not unpack this correctly, and you will get strange errors.
30
31         On Solaris, make sure that you use the GNU toolchain to build the software.
32
33         Optional dependencies:
34
35                 * libgdiplus
36
37                   If you want to get support for System.Drawing, you will need to get
38                   Libgdiplus.
39
40     b. Building the Software
41     ------------------------
42         
43         If you obtained this package as an officially released tarball,
44         this is very simple, use configure and make:
45
46                 ./configure --prefix=/usr/local
47                 make
48                 make install
49
50         Mono supports a JIT engine on x86, SPARC, SPARCv9, S/390, AMD64, ARM
51         and PowerPC systems.
52
53         If you obtained this as a snapshot, you will need an existing
54         Mono installation.  To upgrade your installation, unpack both
55         mono and mcs:
56
57                 tar xzf mcs-XXXX.tar.gz
58                 tar xzf mono-XXXX.tar.gz
59                 mv mono-XXX mono
60                 mv mcs-XXX mcs
61                 cd mono
62                 ./autogen.sh --prefix=/usr/local
63                 make
64
65     c. Building the software from SVN
66     ---------------------------------
67
68         If you are building the software from SVN, make sure that you
69         have up-to-date mcs and mono sources:
70
71                 svn co svn+ssh://USER@mono-cvs.ximian.com/source/trunk/mono
72                 svn co svn+ssh://USER@mono-cvs.ximian.com/source/trunk/mcs
73
74         Then, go into the mono directory, and configure:
75
76                 cd mono
77                 ./autogen.sh --prefix=/usr/local
78                 make
79
80         This will automatically go into the mcs/ tree and build the
81         binaries there.
82
83         This assumes that you have a working mono installation, and that
84         there's a C# compiler named 'mcs', and a corresponding IL
85         runtime called 'mono'.  You can use two make variables
86         EXTERNAL_MCS and EXTERNAL_RUNTIME to override these.  e.g., you
87         can say
88
89           make EXTERNAL_MCS=/foo/bar/mcs EXTERNAL_RUNTIME=/somewhere/else/mono
90         
91         If you don't have a working Mono installation
92         ---------------------------------------------
93
94         If you don't have a working Mono installation, an obvious choice
95         is to install the latest released packages of 'mono' for your
96         distribution and running autogen.sh; make; make install in the
97         mono module directory.
98
99         You can also try a slightly more risky approach: this may not work,
100         so start from the released tarball as detailed above.
101
102         This works by first getting the latest version of the 'monolite'
103         distribution, which contains just enough to run the 'mcs'
104         compiler.  You do this with:
105
106                 make get-monolite-latest
107
108         This will download and automatically gunzip and untar the
109         tarball, and place the files appropriately so that you can then
110         just run:
111
112                 make
113
114         To ensure that you're using the 'monolite' distribution, you can
115         also try passing EXTERNAL_MCS=false on the make command-line.
116
117         Testing and Installation
118          ------------------------
119
120         You can run (part of) the mono and mcs testsuites with the command:
121
122                 make check
123
124         All tests should pass.  
125
126         If you want more extensive tests, including those that test the
127         class libraries, you need to re-run 'configure' with the
128         '--enable-nunit-tests' flag, and try
129
130                 make -k check
131
132         Expect to find a few testsuite failures.  As a sanity check, you
133         can compare the failures you got with
134
135                 http://go-mono.com/tests/displayTestResults.php
136
137         You can now install mono with:
138
139                 make install
140
141         Failure to follow these steps may result in a broken installation. 
142
143     d. Common Configuration Options
144     -------------------------------
145
146         The following are the configuration options that someone
147         building Mono might want to use:
148         
149
150         --with-gc=[boehm, included, sgen, none]
151
152                 Selects the garbage collector engine to use, the
153                 default is the "included" value.
154         
155                 included: 
156                         This is the default value, and its
157                         the most feature complete, it will allow Mono
158                         to use typed allocations and support the
159                         debugger.
160
161                         It is essentially a slightly modified Boehm GC
162
163                 boehm:
164                         This is used to use a system-install Boehm GC,
165                         it is useful to test new features available in
166                         Boehm GC, but we do not recommend that people
167                         use this, as it disables a few features.
168
169                 sgen:
170                         The under-development Generational GC for
171                         Mono, do not use this in production.
172
173                 none:
174                         Disables the inclusion of a garbage
175                         collector.  
176
177         --with-tls=__thread,pthread
178
179                 Controls how Mono should access thread local storage,
180                 pthread forces Mono to use the pthread APIs, while
181                 __thread uses compiler-optimized access to it.
182
183                 Although __thread is faster, it requires support from
184                 the compiler, kernel and libc.   Old Linux systems do
185                 not support with __thread.
186
187                 This value is typically pre-configured and there is no
188                 need to set it, unless you are trying to debug a
189                 problem.
190
191         --with-sigaltstack=yes,no
192
193                 This controls whether Mono will install a special
194                 signal handler to handle stack overflows.   If set to
195                 "yes", it will turn stack overflows into the
196                 StackOverflowException.  Otherwise when a stack
197                 overflow happens, your program will receive a
198                 segmentation fault.
199
200                 The configure script will try to detect if your
201                 operating system supports this.   Some older Linux
202                 systems do not support this feature, or you might want
203                 to override the auto-detection.
204
205         --with-static-mono=yes,no
206
207                 This controls whether `mono' should link against a
208                 static library (libmono.a) or a shared library
209                 (libmono.so). 
210
211                 This defaults to yes, and will improve the performance
212                 of the `mono' program. 
213
214                 This only affects the `mono' binary, the shared
215                 library libmono.so will always be produced for
216                 developers that want to embed the runtime in their
217                 application.
218
219         --with-xen-opt=yes,no
220
221                 The default value for this is `yes', and it makes Mono
222                 generate code which might be slightly slower on
223                 average systems, but the resulting executable will run
224                 faster under the Xen virtualization system.
225
226         --with-large-heap=yes,no
227
228                 Enable support for GC heaps larger than 3GB.
229
230                 This value is set to `no' by default.
231
232         --with-ikvm-native=yes,no
233
234                 Controls whether the IKVM JNI interface library is
235                 built or not.  This is used if you are planning on
236                 using the IKVM Java Virtual machine with Mono.
237
238                 This defaults to `yes'.
239
240         --with-preview=yes,no
241
242                 Whether you want to build libraries that are still not
243                 completed (The 2.0 APIs).   It defaults to `yes'.
244
245         --with-libgdiplus=installed,sibling,<path>
246
247                 This is used to configure where should Mono look for
248                 libgdiplus when running the System.Drawing tests.
249
250                 It defaults to `installed', which means that the
251                 library is available to Mono through the regular
252                 system setup.
253
254                 `sibling' can be used to specify that a libgdiplus
255                 that resides as a sibling of this directory (mono)
256                 should be used.
257
258                 Or you can specify a path to a libgdiplus.
259
260         --enable-minimal=LIST
261
262                 Use this feature to specify optional runtime
263                 components that you might not want to include.  This
264                 is only useful for developers embedding Mono that
265                 require a subset of Mono functionality.
266
267                 The list is a comma-separated list of components that
268                 should be removed, these are:
269
270                 aot:
271                         Disables support for the Ahead of Time
272                         compilation.
273
274                 profiler:
275                         Disables support for the default profiler.
276
277                 decimal:
278                         Disables support for System.Decimal.
279
280                 pinvoke:
281                         Support for Platform Invocation services,
282                         disabling this will drop support for any
283                         libraries using DllImport.
284
285                 debug:
286                         Drop debugging support.
287
288                 reflection_emit:
289                         Drop System.Reflection.Emit support
290
291                 large_code:
292                         Disables support for large assemblies.
293
294                 logging:
295                         Disables support for debug logging.
296
297                 com:
298                         Disables COM support.
299
300                 ssa:
301                         Disables compilation for the SSA optimization
302                         framework, and the various SSA-based
303                         optimizations.
304
305                 generics:
306                         Generics support.  Disabling this will not
307                         allow Mono to run any 2.0 libraries or
308                         code that contains generics.
309                 
310         --disable-dev-random
311
312                 Mono uses /dev/random to obtain good random data for
313                 any source that requires random numbers.   If your
314                 system does not support this, you might want to
315                 disable it.
316
317                 There are a number of runtime options to control this
318                 also, see the man page.
319
320
321 2. Using Mono
322 =============
323
324         Once you have installed the software, you can run a few programs:
325
326         * runtime engine
327
328                 mono program.exe
329
330         * C# compiler
331
332                 mcs program.cs
333
334         * CIL Disassembler
335
336                 monodis program.exe
337
338         See the man pages for mono(1), mint(1), monodis(1) and mcs(2)
339         for further details.
340
341 3. Directory Roadmap
342 ====================
343
344         docs/
345                 Technical documents about the Mono runtime.
346
347         data/
348                 Configuration files installed as part of the Mono runtime.
349
350         mono/
351                 The core of the Mono Runtime.
352
353                 metadata/
354                         The object system and metadata reader.
355
356                 mini/
357                         The Just in Time Compiler.
358
359                 dis/
360                         CIL executable Disassembler
361
362                 cli/
363                         Common code for the JIT and the interpreter.
364
365                 io-layer/
366                         The I/O layer and system abstraction for 
367                         emulating the .NET IO model.
368
369                 cil/
370                         Common Intermediate Representation, XML
371                         definition of the CIL bytecodes.
372
373                 interp/
374                         Interpreter for CLI executables (obsolete).
375
376                 arch/
377                         Architecture specific portions.
378
379         man/
380
381                 Manual pages for the various Mono commands and programs.
382
383         scripts/
384
385                 Scripts used to invoke Mono and the corresponding program.
386
387         runtime/
388
389                 A directory that contains the Makefiles that link the
390                 mono/ and mcs/ build systems.
391