In Test/System:
[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                 * libzlib
41
42                   This library and the development headers are required for compression
43                   file support in the 2.0 profile.
44
45     b. Building the Software
46     ------------------------
47         
48         If you obtained this package as an officially released tarball,
49         this is very simple, use configure and make:
50
51                 ./configure --prefix=/usr/local
52                 make
53                 make install
54
55         Mono supports a JIT engine on x86, SPARC, SPARCv9, S/390,
56         S/390x, AMD64, ARM and PowerPC systems.   
57
58         If you obtained this as a snapshot, you will need an existing
59         Mono installation.  To upgrade your installation, unpack both
60         mono and mcs:
61
62                 tar xzf mcs-XXXX.tar.gz
63                 tar xzf mono-XXXX.tar.gz
64                 mv mono-XXX mono
65                 mv mcs-XXX mcs
66                 cd mono
67                 ./autogen.sh --prefix=/usr/local
68                 make
69
70     c. Building the software from SVN
71     ---------------------------------
72
73         If you are building the software from SVN, make sure that you
74         have up-to-date mcs and mono sources:
75
76                 svn co svn+ssh://USER@mono-cvs.ximian.com/source/trunk/mono
77                 svn co svn+ssh://USER@mono-cvs.ximian.com/source/trunk/mcs
78
79         Then, go into the mono directory, and configure:
80
81                 cd mono
82                 ./autogen.sh --prefix=/usr/local
83                 make
84
85         For people with non-standard installations of the auto* utils and of
86         pkg-config (common on misconfigured OSX and windows boxes), you could get
87         an error like this:
88
89         ./configure: line 19176: syntax error near unexpected token `PKG_CHECK_MODULES(BASE_DEPENDENCIES,' ...
90
91         This means that you need to set the ACLOCAL_FLAGS environment var
92         when invoking autogen.sh, like this:
93
94                 ACLOCAL_FLAGS="-I $acprefix/share/aclocal" ./autogen.sh --prefix=/usr/loca
95         
96         where $acprefix is the prefix where aclocal has been installed.
97
98         This will automatically go into the mcs/ tree and build the
99         binaries there.
100
101         This assumes that you have a working mono installation, and that
102         there's a C# compiler named 'mcs', and a corresponding IL
103         runtime called 'mono'.  You can use two make variables
104         EXTERNAL_MCS and EXTERNAL_RUNTIME to override these.  e.g., you
105         can say
106
107           make EXTERNAL_MCS=/foo/bar/mcs EXTERNAL_RUNTIME=/somewhere/else/mono
108         
109         If you don't have a working Mono installation
110         ---------------------------------------------
111
112         If you don't have a working Mono installation, an obvious choice
113         is to install the latest released packages of 'mono' for your
114         distribution and running autogen.sh; make; make install in the
115         mono module directory.
116
117         You can also try a slightly more risky approach: this may not work,
118         so start from the released tarball as detailed above.
119
120         This works by first getting the latest version of the 'monolite'
121         distribution, which contains just enough to run the 'mcs'
122         compiler.  You do this with:
123
124                 make get-monolite-latest
125
126         This will download and automatically gunzip and untar the
127         tarball, and place the files appropriately so that you can then
128         just run:
129
130                 make
131
132         To ensure that you're using the 'monolite' distribution, you can
133         also try passing EXTERNAL_MCS=false on the make command-line.
134
135         Testing and Installation
136         ------------------------
137
138         You can run (part of) the mono and mcs testsuites with the command:
139
140                 make check
141
142         All tests should pass.  
143
144         If you want more extensive tests, including those that test the
145         class libraries, you need to re-run 'configure' with the
146         '--enable-nunit-tests' flag, and try
147
148                 make -k check
149
150         Expect to find a few testsuite failures.  As a sanity check, you
151         can compare the failures you got with
152
153                 http://go-mono.com/tests/displayTestResults.php
154
155         You can now install mono with:
156
157                 make install
158
159         Failure to follow these steps may result in a broken installation. 
160
161     d. Common Configuration Options
162     -------------------------------
163
164         The following are the configuration options that someone
165         building Mono might want to use:
166         
167
168         --with-gc=[boehm, included, sgen, none]
169
170                 Selects the garbage collector engine to use, the
171                 default is the "included" value.
172         
173                 included: 
174                         This is the default value, and its
175                         the most feature complete, it will allow Mono
176                         to use typed allocations and support the
177                         debugger.
178
179                         It is essentially a slightly modified Boehm GC
180
181                 boehm:
182                         This is used to use a system-install Boehm GC,
183                         it is useful to test new features available in
184                         Boehm GC, but we do not recommend that people
185                         use this, as it disables a few features.
186
187                 sgen:
188                         The under-development Generational GC for
189                         Mono, do not use this in production.
190
191                 none:
192                         Disables the inclusion of a garbage
193                         collector.  
194
195         --with-tls=__thread,pthread
196
197                 Controls how Mono should access thread local storage,
198                 pthread forces Mono to use the pthread APIs, while
199                 __thread uses compiler-optimized access to it.
200
201                 Although __thread is faster, it requires support from
202                 the compiler, kernel and libc.   Old Linux systems do
203                 not support with __thread.
204
205                 This value is typically pre-configured and there is no
206                 need to set it, unless you are trying to debug a
207                 problem.
208
209         --with-sigaltstack=yes,no
210
211                 Experimental: Use at your own risk, it is known to
212                 cause problems with garbage collection and is hard to
213                 reproduce those bugs.
214
215                 This controls whether Mono will install a special
216                 signal handler to handle stack overflows.   If set to
217                 "yes", it will turn stack overflows into the
218                 StackOverflowException.  Otherwise when a stack
219                 overflow happens, your program will receive a
220                 segmentation fault.
221
222                 The configure script will try to detect if your
223                 operating system supports this.   Some older Linux
224                 systems do not support this feature, or you might want
225                 to override the auto-detection.
226
227         --with-static-mono=yes,no
228
229                 This controls whether `mono' should link against a
230                 static library (libmono.a) or a shared library
231                 (libmono.so). 
232
233                 This defaults to yes, and will improve the performance
234                 of the `mono' program. 
235
236                 This only affects the `mono' binary, the shared
237                 library libmono.so will always be produced for
238                 developers that want to embed the runtime in their
239                 application.
240
241         --with-xen-opt=yes,no
242
243                 The default value for this is `yes', and it makes Mono
244                 generate code which might be slightly slower on
245                 average systems, but the resulting executable will run
246                 faster under the Xen virtualization system.
247
248         --with-large-heap=yes,no
249
250                 Enable support for GC heaps larger than 3GB.
251
252                 This value is set to `no' by default.
253
254         --with-ikvm-native=yes,no
255
256                 Controls whether the IKVM JNI interface library is
257                 built or not.  This is used if you are planning on
258                 using the IKVM Java Virtual machine with Mono.
259
260                 This defaults to `yes'.
261
262         --with-preview=yes,no
263
264                 Whether you want to build libraries that are still not
265                 completed (The 2.0 APIs).   It defaults to `yes'.
266
267         --with-moonlight=yes,no
268
269                 Whether you want to generate the Silverlight/Moonlight
270                 libraries and toolchain in addition to the default
271                 (1.1 and 2.0 APIs).
272
273                 This will produce the `smcs' compiler which will reference
274                 the Silvelright modified assemblies (mscorlib.dll,
275                 System.dll, System.Code.dll and System.Xml.Core.dll) and turn
276                 on the LINQ extensions for the compiler.
277
278                 This option defaults to `no' and it is considered pre-alpha.
279
280         --with-libgdiplus=installed,sibling,<path>
281
282                 This is used to configure where should Mono look for
283                 libgdiplus when running the System.Drawing tests.
284
285                 It defaults to `installed', which means that the
286                 library is available to Mono through the regular
287                 system setup.
288
289                 `sibling' can be used to specify that a libgdiplus
290                 that resides as a sibling of this directory (mono)
291                 should be used.
292
293                 Or you can specify a path to a libgdiplus.
294
295         --disable-shared-memory 
296
297                 Use this option to disable the use of shared memory in
298                 Mono (this is equivalent to setting the MONO_DISABLE_SHM
299                 environment variable, although this removes the feature
300                 completely).
301
302                 Disabling the shared memory support will disable certain
303                 features like cross-process named mutexes.
304
305         --enable-minimal=LIST
306
307                 Use this feature to specify optional runtime
308                 components that you might not want to include.  This
309                 is only useful for developers embedding Mono that
310                 require a subset of Mono functionality.
311
312                 The list is a comma-separated list of components that
313                 should be removed, these are:
314
315                 aot:
316                         Disables support for the Ahead of Time
317                         compilation.
318
319                 profiler:
320                         Disables support for the default profiler.
321
322                 decimal:
323                         Disables support for System.Decimal.
324
325                 pinvoke:
326                         Support for Platform Invocation services,
327                         disabling this will drop support for any
328                         libraries using DllImport.
329
330                 debug:
331                         Drop debugging support.
332
333                 reflection_emit:
334                         Drop System.Reflection.Emit support
335
336                 large_code:
337                         Disables support for large assemblies.
338
339                 logging:
340                         Disables support for debug logging.
341
342                 com:
343                         Disables COM support.
344
345                 ssa:
346                         Disables compilation for the SSA optimization
347                         framework, and the various SSA-based
348                         optimizations.
349
350                 generics:
351                         Generics support.  Disabling this will not
352                         allow Mono to run any 2.0 libraries or
353                         code that contains generics.
354                 
355         --disable-dev-random
356
357                 Mono uses /dev/random to obtain good random data for
358                 any source that requires random numbers.   If your
359                 system does not support this, you might want to
360                 disable it.
361
362                 There are a number of runtime options to control this
363                 also, see the man page.
364
365
366 2. Using Mono
367 =============
368
369         Once you have installed the software, you can run a few programs:
370
371         * runtime engine
372
373                 mono program.exe
374
375         * C# compiler
376
377                 mcs program.cs
378
379         * CIL Disassembler
380
381                 monodis program.exe
382
383         See the man pages for mono(1), mint(1), monodis(1) and mcs(2)
384         for further details.
385
386 3. Directory Roadmap
387 ====================
388
389         docs/
390                 Technical documents about the Mono runtime.
391
392         data/
393                 Configuration files installed as part of the Mono runtime.
394
395         mono/
396                 The core of the Mono Runtime.
397
398                 metadata/
399                         The object system and metadata reader.
400
401                 mini/
402                         The Just in Time Compiler.
403
404                 dis/
405                         CIL executable Disassembler
406
407                 cli/
408                         Common code for the JIT and the interpreter.
409
410                 io-layer/
411                         The I/O layer and system abstraction for 
412                         emulating the .NET IO model.
413
414                 cil/
415                         Common Intermediate Representation, XML
416                         definition of the CIL bytecodes.
417
418                 interp/
419                         Interpreter for CLI executables (obsolete).
420
421                 arch/
422                         Architecture specific portions.
423
424         man/
425
426                 Manual pages for the various Mono commands and programs.
427
428         samples/
429
430                 Some simple sample programs on uses of the Mono
431                 runtime as an embedded library.   
432
433         scripts/
434
435                 Scripts used to invoke Mono and the corresponding program.
436
437         runtime/
438
439                 A directory that contains the Makefiles that link the
440                 mono/ and mcs/ build systems.
441
442         ../olive/
443
444                 If the directory ../olive is present (as an
445                 independent checkout) from the Mono module, that
446                 directory is automatically configured to share the
447                 same prefix than this module gets.