Merge branch 'master' of http://github.com/mono/mono
[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         The Mono build system is silent for most compilation commands.
71         To enable a more verbose compile (for example, to pinpoint
72         problems in your makefiles or your system) pass the V=1 flag to make, like this:
73
74                  make V=1
75
76
77
78     c. Building the software from SVN
79     ---------------------------------
80
81         If you are building the software from SVN, make sure that you
82         have up-to-date mcs and mono sources:
83
84                 svn co svn+ssh://USER@mono-cvs.ximian.com/source/trunk/mono
85                 svn co svn+ssh://USER@mono-cvs.ximian.com/source/trunk/mcs
86
87         Then, go into the mono directory, and configure:
88
89                 cd mono
90                 ./autogen.sh --prefix=/usr/local
91                 make
92
93         For people with non-standard installations of the auto* utils and of
94         pkg-config (common on misconfigured OSX and windows boxes), you could get
95         an error like this:
96
97         ./configure: line 19176: syntax error near unexpected token `PKG_CHECK_MODULES(BASE_DEPENDENCIES,' ...
98
99         This means that you need to set the ACLOCAL_FLAGS environment var
100         when invoking autogen.sh, like this:
101
102                 ACLOCAL_FLAGS="-I $acprefix/share/aclocal" ./autogen.sh --prefix=/usr/loca
103         
104         where $acprefix is the prefix where aclocal has been installed.
105
106         This will automatically go into the mcs/ tree and build the
107         binaries there.
108
109         This assumes that you have a working mono installation, and that
110         there's a C# compiler named 'mcs', and a corresponding IL
111         runtime called 'mono'.  You can use two make variables
112         EXTERNAL_MCS and EXTERNAL_RUNTIME to override these.  e.g., you
113         can say
114
115           make EXTERNAL_MCS=/foo/bar/mcs EXTERNAL_RUNTIME=/somewhere/else/mono
116         
117         If you don't have a working Mono installation
118         ---------------------------------------------
119
120         If you don't have a working Mono installation, an obvious choice
121         is to install the latest released packages of 'mono' for your
122         distribution and running autogen.sh; make; make install in the
123         mono module directory.
124
125         You can also try a slightly more risky approach: this may not work,
126         so start from the released tarball as detailed above.
127
128         This works by first getting the latest version of the 'monolite'
129         distribution, which contains just enough to run the 'mcs'
130         compiler.  You do this with:
131
132                 make get-monolite-latest
133
134         This will download and automatically gunzip and untar the
135         tarball, and place the files appropriately so that you can then
136         just run:
137
138                 make
139
140         To ensure that you're using the 'monolite' distribution, you can
141         also try passing EXTERNAL_MCS=false on the make command-line.
142
143         Testing and Installation
144         ------------------------
145
146         You can run (part of) the mono and mcs testsuites with the command:
147
148                 make check
149
150         All tests should pass.  
151
152         If you want more extensive tests, including those that test the
153         class libraries, you need to re-run 'configure' with the
154         '--enable-nunit-tests' flag, and try
155
156                 make -k check
157
158         Expect to find a few testsuite failures.  As a sanity check, you
159         can compare the failures you got with
160
161                 http://go-mono.com/tests/displayTestResults.php
162
163         You can now install mono with:
164
165                 make install
166
167         Failure to follow these steps may result in a broken installation. 
168
169     d. Common Configuration Options
170     -------------------------------
171
172         The following are the configuration options that someone
173         building Mono might want to use:
174         
175         --with-sgen=yes,no
176
177                 Generational GC support: Used to enable or disable the
178                 compilation of a Mono runtime with the SGen garbage collector.
179
180                 On platforms that support it, after building Mono, you
181                 will have both a mono binary and a mono-sgen binary.
182                 Mono uses Boehm, while mono-sgen uses the Simple
183                 Generational GC.
184
185         --with-gc=[boehm, included, sgen, none]
186
187                 Selects the default Boehm garbage collector engine to
188                 use, the default is the "included" value.
189         
190                 included: 
191                         This is the default value, and its
192                         the most feature complete, it will allow Mono
193                         to use typed allocations and support the
194                         debugger.
195
196                         It is essentially a slightly modified Boehm GC
197
198                 boehm:
199                         This is used to use a system-install Boehm GC,
200                         it is useful to test new features available in
201                         Boehm GC, but we do not recommend that people
202                         use this, as it disables a few features.
203
204                 none:
205                         Disables the inclusion of a garbage
206                         collector.  
207
208         --with-tls=__thread,pthread
209
210                 Controls how Mono should access thread local storage,
211                 pthread forces Mono to use the pthread APIs, while
212                 __thread uses compiler-optimized access to it.
213
214                 Although __thread is faster, it requires support from
215                 the compiler, kernel and libc.   Old Linux systems do
216                 not support with __thread.
217
218                 This value is typically pre-configured and there is no
219                 need to set it, unless you are trying to debug a
220                 problem.
221
222         --with-sigaltstack=yes,no
223
224                 Experimental: Use at your own risk, it is known to
225                 cause problems with garbage collection and is hard to
226                 reproduce those bugs.
227
228                 This controls whether Mono will install a special
229                 signal handler to handle stack overflows.   If set to
230                 "yes", it will turn stack overflows into the
231                 StackOverflowException.  Otherwise when a stack
232                 overflow happens, your program will receive a
233                 segmentation fault.
234
235                 The configure script will try to detect if your
236                 operating system supports this.   Some older Linux
237                 systems do not support this feature, or you might want
238                 to override the auto-detection.
239
240         --with-static_mono=yes,no
241
242                 This controls whether `mono' should link against a
243                 static library (libmono.a) or a shared library
244                 (libmono.so). 
245
246                 This defaults to yes, and will improve the performance
247                 of the `mono' program. 
248
249                 This only affects the `mono' binary, the shared
250                 library libmono.so will always be produced for
251                 developers that want to embed the runtime in their
252                 application.
253
254         --with-xen-opt=yes,no
255
256                 The default value for this is `yes', and it makes Mono
257                 generate code which might be slightly slower on
258                 average systems, but the resulting executable will run
259                 faster under the Xen virtualization system.
260
261         --with-large-heap=yes,no
262
263                 Enable support for GC heaps larger than 3GB.
264
265                 This value is set to `no' by default.
266
267         --enable-small-config=yes,no
268
269                 Enable some tweaks to reduce memory usage and disk footprint at
270                 the expense of some capabilities. Typically this means that the
271                 number of threads that can be created is limited (256), that the
272                 maxmimum heap size is also reduced (256 MB) and other such limitations
273                 that still make mono useful, but more suitable to embedded devices
274                 (like mobile phones).
275
276                 This value is set to `no' by default.
277
278         --with-ikvm-native=yes,no
279
280                 Controls whether the IKVM JNI interface library is
281                 built or not.  This is used if you are planning on
282                 using the IKVM Java Virtual machine with Mono.
283
284                 This defaults to `yes'.
285
286         --with-profile4=yes,no
287
288                 Whether you want to build the 4.x profile libraries
289                 and runtime.
290
291                 It defaults to `yes'.
292
293         --with-moonlight=yes,no
294
295                 Whether you want to generate the Silverlight/Moonlight
296                 libraries and toolchain in addition to the default
297                 (1.1 and 2.0 APIs).
298
299                 This will produce the `smcs' compiler which will reference
300                 the Silverlight modified assemblies (mscorlib.dll,
301                 System.dll, System.Code.dll and System.Xml.Core.dll) and turn
302                 on the LINQ extensions for the compiler.
303
304         --with-libgdiplus=installed,sibling,<path>
305
306                 This is used to configure where should Mono look for
307                 libgdiplus when running the System.Drawing tests.
308
309                 It defaults to `installed', which means that the
310                 library is available to Mono through the regular
311                 system setup.
312
313                 `sibling' can be used to specify that a libgdiplus
314                 that resides as a sibling of this directory (mono)
315                 should be used.
316
317                 Or you can specify a path to a libgdiplus.
318
319         --disable-shared-memory 
320
321                 Use this option to disable the use of shared memory in
322                 Mono (this is equivalent to setting the MONO_DISABLE_SHM
323                 environment variable, although this removes the feature
324                 completely).
325
326                 Disabling the shared memory support will disable certain
327                 features like cross-process named mutexes.
328
329         --enable-minimal=LIST
330
331                 Use this feature to specify optional runtime
332                 components that you might not want to include.  This
333                 is only useful for developers embedding Mono that
334                 require a subset of Mono functionality.
335
336                 The list is a comma-separated list of components that
337                 should be removed, these are:
338
339                 aot:
340                         Disables support for the Ahead of Time
341                         compilation.
342
343                 attach:
344                         Support for the Mono.Management assembly and the
345                         VMAttach API (allowing code to be injected into
346                         a target VM)
347
348                 com:
349                         Disables COM support.
350
351                 debug:
352                         Drop debugging support.
353
354                 decimal:
355                         Disables support for System.Decimal.
356
357                 full_messages:
358                         By default Mono comes with a full table
359                         of messages for error codes.   This feature
360                         turns off uncommon error messages and reduces
361                         the runtime size.
362
363                 generics:
364                         Generics support.  Disabling this will not
365                         allow Mono to run any 2.0 libraries or
366                         code that contains generics.
367
368                 jit:
369                         Removes the JIT engine from the build, this reduces
370                         the executable size, and requires that all code
371                         executed by the virtual machine be compiled with
372                         Full AOT before execution.
373
374                 large_code:
375                         Disables support for large assemblies.
376
377                 logging:
378                         Disables support for debug logging.
379
380                 pinvoke:
381                         Support for Platform Invocation services,
382                         disabling this will drop support for any
383                         libraries using DllImport.
384
385                 portability:
386                         Removes support for MONO_IOMAP, the environment
387                         variables for simplifying porting applications that 
388                         are case-insensitive and that mix the Unix and Windows path separators.
389
390                 profiler:
391                         Disables support for the default profiler.
392
393                 reflection_emit:
394                         Drop System.Reflection.Emit support
395
396                 reflection_emit_save:
397                         Drop support for saving dynamically created
398                         assemblies (AssemblyBuilderAccess.Save) in
399                         System.Reflection.Emit.
400
401                 shadow_copy:
402                         Disables support for AppDomain's shadow copies
403                         (you can disable this if you do not plan on 
404                         using appdomains).
405
406                 simd:
407                         Disables support for the Mono.SIMD intrinsics
408                         library.
409
410                 ssa:
411                         Disables compilation for the SSA optimization
412                         framework, and the various SSA-based
413                         optimizations.
414
415         --enable-llvm
416         --enable-loadedllvm
417
418                 This enables the use of LLVM as a code generation engine
419                 for Mono.  The LLVM code generator and optimizer will be 
420                 used instead of Mono's built-in code generator for both
421                 Just in Time and Ahead of Time compilations.
422
423                 See the http://www.mono-project.com/Mono_LLVM for the 
424                 full details and up-to-date information on this feature.
425
426                 You will need to have an LLVM built that Mono can link
427                 against,
428
429                 The --enable-loadedllvm variant will make the llvm backend
430                 into a runtime-loadable module instead of linking it directly
431                 into the main mono binary.
432
433         --enable-big-arrays
434
435                 This enables the use arrays whose indexes are larger
436                 than Int32.MaxValue.   
437
438                 By default Mono has the same limitation as .NET on
439                 Win32 and Win64 and limits array indexes to 32-bit
440                 values (even on 64-bit systems).
441
442                 In certain scenarios where large arrays are required,
443                 you can pass this flag and Mono will be built to
444                 support 64-bit arrays.
445
446                 This is not the default as it breaks the C embedding
447                 ABI that we have exposed through the Mono development
448                 cycle.
449
450         --enable-parallel-mark
451
452                 Use this option to enable the garbage collector to use
453                 multiple CPUs to do its work.  This helps performance
454                 on multi-CPU machines as the work is divided across CPUS.
455
456                 This option is not currently the default as we have
457                 not done much testing with Mono.
458
459         --enable-dtrace
460
461                 On Solaris and MacOS X builds a version of the Mono
462                 runtime that contains DTrace probes and can
463                 participate in the system profiling using DTrace.
464
465
466         --disable-dev-random
467
468                 Mono uses /dev/random to obtain good random data for
469                 any source that requires random numbers.   If your
470                 system does not support this, you might want to
471                 disable it.
472
473                 There are a number of runtime options to control this
474                 also, see the man page.
475
476
477 2. Using Mono
478 =============
479
480         Once you have installed the software, you can run a few programs:
481
482         * runtime engine
483
484                 mono program.exe
485
486         * C# compiler
487
488                 mcs program.cs
489
490         * CIL Disassembler
491
492                 monodis program.exe
493
494         See the man pages for mono(1), mint(1), monodis(1) and mcs(2)
495         for further details.
496
497 3. Directory Roadmap
498 ====================
499
500         docs/
501                 Technical documents about the Mono runtime.
502
503         data/
504                 Configuration files installed as part of the Mono runtime.
505
506         mono/
507                 The core of the Mono Runtime.
508
509                 metadata/
510                         The object system and metadata reader.
511
512                 mini/
513                         The Just in Time Compiler.
514
515                 dis/
516                         CIL executable Disassembler
517
518                 cli/
519                         Common code for the JIT and the interpreter.
520
521                 io-layer/
522                         The I/O layer and system abstraction for 
523                         emulating the .NET IO model.
524
525                 cil/
526                         Common Intermediate Representation, XML
527                         definition of the CIL bytecodes.
528
529                 interp/
530                         Interpreter for CLI executables (obsolete).
531
532                 arch/
533                         Architecture specific portions.
534
535         man/
536
537                 Manual pages for the various Mono commands and programs.
538
539         samples/
540
541                 Some simple sample programs on uses of the Mono
542                 runtime as an embedded library.   
543
544         scripts/
545
546                 Scripts used to invoke Mono and the corresponding program.
547
548         runtime/
549
550                 A directory that contains the Makefiles that link the
551                 mono/ and mcs/ build systems.
552
553         ../olive/
554
555                 If the directory ../olive is present (as an
556                 independent checkout) from the Mono module, that
557                 directory is automatically configured to share the
558                 same prefix than this module gets.
559
560
561