[readme] Clarify --enable-parallel-mark description
[mono.git] / README.md
1 Mono is a software platform designed to allow developers to easily
2 create cross platform applications.  It is an open source
3 implementation of Microsoft's .NET Framework based on the ECMA
4 standards for C# and the Common Language Runtime.
5
6 [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mono/mono?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
7
8 1. [Compilation and Installation](#compilation-and-installation)
9 2. [Using Mono](#using-mono)
10 3. [Directory Roadmap](#directory-roadmap)
11 4. [Contributing to Mono](#contributing-to-mono)
12 5. [Reporting bugs](#reporting-bugs)
13 6. [Configuration Options](#configuration-options)
14 7. [Working with Submodules](#working-with-submodules)
15
16 **Build Status**
17
18 Officially supported architectures:
19
20 | debian-amd64            | debian-i386            | debian-armel            | debian-armhf            | windows-amd64             |
21 |-------------------------|------------------------|-------------------------|-------------------------|---------------------------|
22 | [![debian-amd64][1]][2] | [![debian-i386][3]][4] | [![debian-armel][5]][6] | [![debian-armhf][7]][8] | [![windows-amd64][9]][10] |
23
24 Community supported architectures:
25
26 | centos-s390x              |
27 |---------------------------|
28 | [![centos-s390x][11]][12] |
29
30 [1]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-amd64/badge/icon
31 [2]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-amd64/
32 [3]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-i386/badge/icon
33 [4]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-i386/
34 [5]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-armel/badge/icon
35 [6]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-armel/
36 [7]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-armhf/badge/icon
37 [8]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-armhf/
38 [9]: https://ci.appveyor.com/api/projects/status/1e61ebdfpbiei58v/branch/master?svg=true
39 [10]: https://ci.appveyor.com/project/ajlennon/mono-817/branch/master
40 [11]: https://jenkins.mono-project.com/job/z/label=centos-s390x/badge/icon
41 [12]: https://jenkins.mono-project.com/job/z/label=centos-s390x
42
43 Compilation and Installation
44 ============================
45
46 Building the Software
47 ---------------------
48
49 Please see our guides for building Mono on
50 [Mac OS X](http://www.mono-project.com/docs/compiling-mono/mac/),
51 [Linux](http://www.mono-project.com/docs/compiling-mono/linux/) and 
52 [Windows](http://www.mono-project.com/docs/compiling-mono/windows/).
53
54 Note that building from Git assumes that you already have Mono installed,
55 so please download and [install the latest Mono release](http://www.mono-project.com/download/)
56 before trying to build from Git. This is required because the Mono build
57 relies on a working Mono C# compiler to compile itself
58 (also known as [bootstrapping](http://en.wikipedia.org/wiki/Bootstrapping_(compilers))).
59
60 If you don't have a working Mono installation
61 ---------------------------------------------
62
63 If you don't have a working Mono installation, you can try a slightly
64 more risky approach: getting the latest version of the 'monolite' distribution,
65 which contains just enough to run the 'mcs' compiler. You do this with:
66
67     # Run the following line after ./autogen.sh
68     make get-monolite-latest
69
70 This will download and place the files appropriately so that you can then
71 just run:
72
73     make
74
75 The build will then use the files downloaded by `make get-monolite-latest`.
76
77 Testing and Installation
78 ------------------------
79
80 You can run the mono and mcs test suites with the command: `make check`.
81
82 Expect to find a few test suite failures. As a sanity check, you
83 can compare the failures you got with [https://jenkins.mono-project.com/](https://jenkins.mono-project.com/).
84
85 You can now install mono with: `make install`
86
87 You can verify your installation by using the mono-test-install
88 script, it can diagnose some common problems with Mono's install.
89 Failure to follow these steps may result in a broken installation. 
90
91 Using Mono
92 ==========
93
94 Once you have installed the software, you can run a few programs:
95
96 * `mono program.exe` runtime engine
97
98 * `mcs program.cs` C# compiler 
99
100 * `monodis program.exe` CIL Disassembler
101
102 See the man pages for mono(1), mcs(1) and monodis(1) for further details.
103
104 Directory Roadmap
105 =================
106
107 * `data/` - Configuration files installed as part of the Mono runtime.
108
109 * `docs/` - Technical documents about the Mono runtime.
110
111 * `external/` - Git submodules for external libraries (Newtonsoft.Json, ikvm, etc).
112
113 * `man/` - Manual pages for the various Mono commands and programs.
114
115 * `mcs/` - The class libraries, compiler and tools
116
117   * `class/` - The class libraries (like System.*, Microsoft.Build, etc.)
118
119   * `mcs/` - The Mono C# compiler written in C#
120
121   * `tools/` - Tools like gacutil, ikdasm, mdoc, etc.
122
123 * `mono/` - The core of the Mono Runtime.
124
125   * `arch/` - Architecture specific portions.
126
127   * `cil/` - Common Intermediate Representation, XML
128 definition of the CIL bytecodes.
129
130   * `dis/` - CIL executable Disassembler
131
132   * `io-layer/` - The I/O layer and system abstraction for 
133 emulating the .NET IO model.
134
135   * `metadata/` - The object system and metadata reader.
136
137   * `mini/` - The Just in Time Compiler.
138
139 * `runtime/` - A directory that contains the Makefiles that link the
140 mono/ and mcs/ build systems.
141
142 * `samples/` -Some simple sample programs on uses of the Mono
143 runtime as an embedded library.   
144
145 * `scripts/` - Scripts used to invoke Mono and the corresponding program.
146
147 Contributing to Mono
148 ====================
149
150 Before submitting changes to Mono, please review the [contribution
151 guidelines](http://www.mono-project.com/community/contributing/).
152 Please pay particular attention to the [Important
153 Rules](http://www.mono-project.com/community/contributing/#important-rules)
154 section.
155
156 Reporting bugs
157 ==============
158
159 To submit bug reports, please use [Xamarin's
160 Bugzilla](https://bugzilla.xamarin.com/)
161
162 Please use the search facility to ensure the same bug hasn't already
163 been submitted and follow our
164 [guidelines](http://www.mono-project.com/community/bugs/make-a-good-bug-report/)
165 on how to make a good bug report.
166
167 Configuration Options
168 =====================
169
170 The following are the configuration options that someone building Mono
171 might want to use:
172
173 * `--with-sgen=yes,no` - Generational GC support: Used to enable or
174 disable the compilation of a Mono runtime with the SGen garbage
175 collector.
176
177   * On platforms that support it, after building Mono, you will have
178 both a `mono` binary and a `mono-sgen` binary. `mono` uses Boehm,
179 while `mono-sgen` uses the Simple Generational GC.
180
181 * `--with-gc=[included, boehm, none]` - Selects the default Boehm
182 garbage collector engine to use.
183
184   * *included*: (*slighty modified Boehm GC*) This is the default
185 value for the Boehm GC, and it's the most feature complete, it will
186 allow Mono to use typed allocations and support the debugger.
187
188   * *boehm*: This is used to use a system-install Boehm GC, it is
189 useful to test new features available in Boehm GC, but we do not
190 recommend that people use this, as it disables a few features.
191
192   * *none*:
193 Disables the inclusion of a garbage collector.
194
195   * This defaults to `included`.
196
197 * `--with-cooperative-gc`
198
199   * If you pass this flag the Mono runtime is configured to only use
200   the cooperative mode of the garbage collector.  If you do not pass
201   this flag, then you can control at runtime the use of the
202   cooperative GC mode by setting the `MONO_ENABLE_COOP` flag.
203   
204 * `--with-tls=__thread,pthread`
205
206   * Controls how Mono should access thread local storage,
207 pthread forces Mono to use the pthread APIs, while
208 __thread uses compiler-optimized access to it.
209
210   * Although __thread is faster, it requires support from
211 the compiler, kernel and libc. Old Linux systems do
212 not support with __thread.
213
214   * This value is typically pre-configured and there is no
215 need to set it, unless you are trying to debug a problem.
216
217 * `--with-sigaltstack=yes,no`
218
219   * **Experimental**: Use at your own risk, it is known to
220 cause problems with garbage collection and is hard to
221 reproduce those bugs.
222
223   * This controls whether Mono will install a special
224 signal handler to handle stack overflows. If set to
225 `yes`, it will turn stack overflows into the
226 StackOverflowException. Otherwise when a stack
227 overflow happens, your program will receive a
228 segmentation fault.
229
230   * The configure script will try to detect if your
231 operating system supports this. Some older Linux
232 systems do not support this feature, or you might want
233 to override the auto-detection.
234
235 * `--with-static_mono=yes,no`
236
237   * This controls whether `mono` should link against a
238 static library (libmono.a) or a shared library
239 (libmono.so). 
240
241   * This defaults to `yes`, and will improve the performance
242 of the `mono` program. 
243
244   * This only affects the `mono' binary, the shared
245 library libmono.so will always be produced for
246 developers that want to embed the runtime in their
247 application.
248
249 * `--with-xen-opt=yes,no` - Optimize code for Xen virtualization.
250
251   * It makes Mono generate code which might be slightly
252 slower on average systems, but the resulting executable will run
253 faster under the Xen virtualization system.
254
255   * This defaults to `yes`.
256
257 * `--with-large-heap=yes,no` - Enable support for GC heaps larger than 3GB.
258
259   * This defaults to `no`.
260
261 * `--enable-small-config=yes,no` - Enable some tweaks to reduce memory usage
262 and disk footprint at the expense of some capabilities.
263
264   * Typically this means that the number of threads that can be created
265 is limited (256), that the maximum heap size is also reduced (256 MB)
266 and other such limitations that still make mono useful, but more suitable
267 to embedded devices (like mobile phones).
268
269   * This defaults to `no`.
270
271 * `--with-ikvm-native=yes,no` - Controls whether the IKVM JNI interface library is
272 built or not.
273
274   * This is used if you are planning on
275 using the IKVM Java Virtual machine with Mono.
276
277   * This defaults to `yes`.
278
279 * `--with-profile4=yes,no` - Whether you want to build the 4.x profile libraries
280 and runtime.
281
282   * This defaults to `yes`.
283
284 * `--with-libgdiplus=installed,sibling,<path>` - Configure where Mono
285 searches for libgdiplus when running System.Drawing tests.
286
287   * It defaults to `installed`, which means that the
288 library is available to Mono through the regular
289 system setup.
290
291   * `sibling` can be used to specify that a libgdiplus
292 that resides as a sibling of this directory (mono)
293 should be used.
294
295  * Or you can specify a path to a libgdiplus.
296
297 * `--disable-shared-memory`
298
299   * Use this option to disable the use of shared memory in
300 Mono (this is equivalent to setting the MONO_DISABLE_SHM
301 environment variable, although this removes the feature
302 completely).
303
304   * Disabling the shared memory support will disable certain
305 features like cross-process named mutexes.
306
307 * `--enable-minimal=LIST`
308
309   * Use this feature to specify optional runtime
310 components that you might not want to include.  This
311 is only useful for developers embedding Mono that
312 require a subset of Mono functionality.
313   * The list is a comma-separated list of components that
314 should be removed, these are:
315
316     * `aot`:
317 Disables support for the Ahead of Time compilation.
318
319     * `attach`:
320 Support for the Mono.Management assembly and the
321 VMAttach API (allowing code to be injected into
322 a target VM)
323
324     * `com`:
325 Disables COM support.
326
327     * `debug`:
328 Drop debugging support.
329
330     * `decimal`:
331 Disables support for System.Decimal.
332
333     * `full_messages`:
334 By default Mono comes with a full table
335 of messages for error codes. This feature
336 turns off uncommon error messages and reduces
337 the runtime size.
338
339     * `generics`:
340 Generics support.  Disabling this will not
341 allow Mono to run any 2.0 libraries or
342 code that contains generics.
343
344     * `jit`:
345 Removes the JIT engine from the build, this reduces
346 the executable size, and requires that all code
347 executed by the virtual machine be compiled with
348 Full AOT before execution.
349
350     * `large_code`:
351 Disables support for large assemblies.
352
353     * `logging`:
354 Disables support for debug logging.
355
356     * `pinvoke`:
357 Support for Platform Invocation services,
358 disabling this will drop support for any
359 libraries using DllImport.
360
361     * `portability`:
362 Removes support for MONO_IOMAP, the environment
363 variables for simplifying porting applications that 
364 are case-insensitive and that mix the Unix and Windows path separators.
365
366     * `profiler`:
367 Disables support for the default profiler.
368
369     * `reflection_emit`:
370 Drop System.Reflection.Emit support
371
372     * `reflection_emit_save`:
373 Drop support for saving dynamically created
374 assemblies (AssemblyBuilderAccess.Save) in
375 System.Reflection.Emit.
376
377     * `shadow_copy`:
378 Disables support for AppDomain's shadow copies
379 (you can disable this if you do not plan on 
380 using appdomains).
381
382     * `simd`:
383 Disables support for the Mono.SIMD intrinsics
384 library.
385
386     * `ssa`:
387 Disables compilation for the SSA optimization
388 framework, and the various SSA-based optimizations.
389
390 * `--enable-llvm`
391 * `--enable-loadedllvm`
392
393   * This enables the use of LLVM as a code generation engine
394 for Mono.  The LLVM code generator and optimizer will be 
395 used instead of Mono's built-in code generator for both
396 Just in Time and Ahead of Time compilations.
397
398   * See http://www.mono-project.com/docs/advanced/mono-llvm/ for the 
399 full details and up-to-date information on this feature.
400
401   * You will need to have an LLVM built that Mono can link
402 against.
403
404   * The `--enable-loadedllvm` variant will make the LLVM backend
405 into a runtime-loadable module instead of linking it directly
406 into the main mono binary.
407
408 * `--enable-big-arrays` - Enable use of arrays with indexes larger
409 than Int32.MaxValue.
410
411   * By default Mono has the same limitation as .NET on
412 Win32 and Win64 and limits array indexes to 32-bit
413 values (even on 64-bit systems).
414
415   * In certain scenarios where large arrays are required,
416 you can pass this flag and Mono will be built to
417 support 64-bit arrays.
418
419   * This is not the default as it breaks the C embedding
420 ABI that we have exposed through the Mono development
421 cycle.
422
423 * `--enable-parallel-mark`
424
425   * Use this option to enable the garbage collector to use
426 multiple CPUs to do its work.  This helps performance
427 on multi-CPU machines as the work is divided across CPUS.
428
429   * This option is not currently the default on OSX
430 as it runs into issues there.
431
432   * This option only applies to the Boehm GC.
433
434 * `--enable-dtrace`
435
436   * On Solaris and MacOS X builds a version of the Mono
437 runtime that contains DTrace probes and can
438 participate in the system profiling using DTrace.
439
440 * `--disable-dev-random`
441
442   * Mono uses /dev/random to obtain good random data for
443 any source that requires random numbers.   If your
444 system does not support this, you might want to
445 disable it.
446
447   * There are a number of runtime options to control this
448 also, see the man page.
449
450 * `--enable-nacl`
451
452   * This configures the Mono compiler to generate code
453 suitable to be used by Google's Native Client:
454 http://code.google.com/p/nativeclient/
455
456   * Currently this is used with Mono's AOT engine as
457 Native Client does not support JIT engines yet.
458
459 Working With Submodules
460 =======================
461
462 Mono references several external git submodules, for example
463 a fork of Microsoft's reference source code that has been altered
464 to be suitable for use with the Mono runtime.
465
466 This section describes how to use it.
467
468 An initial clone should be done recursively so all submodules will also be
469 cloned in a single pass:
470
471         $ git clone --recursive git@github.com:mono/mono
472
473 Once cloned, submodules can be updated to pull down the latest changes.
474 This can also be done after an initial non-recursive clone:
475
476         $ git submodule update --init --recursive
477
478 To pull external changes into a submodule:
479
480         $ cd <submodule>
481         $ git pull origin <branch>
482         $ cd <top-level>
483         $ git add <submodule>
484         $ git commit
485
486 By default, submodules are detached because they point to a specific commit.
487 Use `git checkout` to move back to a branch before making changes:
488
489         $ cd <submodule>
490         $ git checkout <branch>
491         # work as normal; the submodule is a normal repo
492         $ git commit/push new changes to the repo (submodule)
493
494         $ cd <top-level>
495         $ git add <submodule> # this will record the new commits to the submodule
496         $ git commit
497
498 To switch the repo of a submodule (this should not be a common or normal thing
499 to do at all), first edit `.gitmodules` to point to the new location, then:
500
501         $ git submodule sync -- <path of the submodule>
502         $ git submodule update --recursive
503         $ git checkout <desired new hash or branch>
504
505 The desired output diff is a change in `.gitmodules` to reflect the
506 change in the remote URL, and a change in /<submodule> where you see
507 the desired change in the commit hash.