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