The monotouch_runtime profile needs the DISABLE_COM flag too.
[mono-project.git] / README.md
blob5ffe56a63d22bf31ae3abb93131d0a89b9f52203
1 Mono is a software platform designed to allow developers to easily create cross platform applications.
2 Mono is an open source implementation of Microsoft's .NET Framework based on the ECMA standards for C# and the Common Language Runtime.
4 1. [Installation](#compilation-and-installation)
5 2. [Using Mono](#using-mono)
6 3. [Directory Roadmap](#directory-roadmap)
7 4. [Git submodules maintenance](#git-submodules-maintenance)
8 5. [Reporting bugs](#reporting-bugs)
10 Compilation and Installation
11 ============================
13 a. Build Requirements
14 ---------------------
16 * On Itanium, you must obtain libunwind: http://www.hpl.hp.com/research/linux/libunwind/download.php4
18 * On Solaris
20  1. Make sure that you used GNU tar to unpack this package, as
21  Solaris tar will not unpack this correctly, and you will get strange errors.
23  2. Make sure that you use the GNU toolchain to build the software.
25  3. Optional dependencies
27   * libgdiplus - Required for System.Drawing. This library in turn requires glib and pkg-config
29   * pkg-config - Available at: http://www.freedesktop.org/Software/pkgconfig
31   * glib 2.4 - Available at: http://www.gtk.org/
33   * libzlib - This library and the development headers are required for compression
34 file support in the 2.0 profile.
36 b. Building the Software
37 ------------------------
39 If you obtained this package as an officially released tarball,
40 this is very simple, use configure and make:
42 `./configure --prefix=/usr/local ; make ; make install`
44 Mono supports a JIT engine on x86, SPARC, SPARCv9, S/390,
45 S/390x, AMD64, ARM and PowerPC systems.   
47 If you obtained this as a snapshot, you will need an existing
48 Mono installation.  To upgrade your installation, unpack both
49 mono and mcs:
51         tar xzf mcs-XXXX.tar.gz
52         tar xzf mono-XXXX.tar.gz
53         mv mono-XXX mono
54         mv mcs-XXX mcs
55         cd mono
56         ./autogen.sh --prefix=/usr/local
57         make
59 The Mono build system is silent for most compilation commands.
60 To enable a more verbose compile (for example, to pinpoint
61 problems in your makefiles or your system) pass the V=1 flag to make, like this:
63 ` make V=1`
66 c. Building the software from GIT
67 ---------------------------------
69 If you are building the software from GIT, make sure that you
70 have up-to-date mcs and mono sources:
72  * If you are an anonymous user: `git clone git://github.com/mono/mono.git`
74  * If you are a Mono contributor with read/write privileges: `git clone git@github.com:mono/mono.git`
76 Then, go into the mono directory, and configure:
78         cd mono
79         ./autogen.sh --prefix=/usr/local
80         make
82 For people with non-standard installations of the auto* utils and of
83 pkg-config (common on misconfigured OSX and windows boxes), you could get
84 an error like this:
86 `./configure: line 19176: syntax error near unexpected token 'PKG_CHECK_MODULES(BASE_DEPENDENCIES,' ...`
88 This means that you need to set the ACLOCAL_FLAGS environment variable
89 when invoking autogen.sh, like this: `ACLOCAL_FLAGS="-I $acprefix/share/aclocal" ./autogen.sh --prefix=/usr/local`
90 where $acprefix is the prefix where aclocal has been installed.
91 This will automatically go into the mcs/ tree and build the
92 binaries there.
94 This assumes that you have a working mono installation, and that
95 there's a C# compiler named 'mcs', and a corresponding IL
96 runtime called 'mono'.  You can use two make variables
97 EXTERNAL_MCS and EXTERNAL_RUNTIME to override these.  e.g., you
98 can say:
100 `make EXTERNAL_MCS=/foo/bar/mcs EXTERNAL_RUNTIME=/somewhere/else/mono`
102 If you don't have a working Mono installation
103 ---------------------------------------------
105 If you don't have a working Mono installation, an obvious choice
106 is to install the latest released packages of 'mono' for your
107 distribution and running `autogen.sh; make; make install` in the
108 mono module directory.
110 You can also try a slightly more risky approach: this may not work,
111 so start from the released tarball as detailed above.
113 This works by first getting the latest version of the 'monolite'
114 distribution, which contains just enough to run the 'mcs'
115 compiler. You do this with:
117         # Run the following line after ./autogen.sh
118         make get-monolite-latest
120 This will download and automatically gunzip and untar the
121 tarball, and place the files appropriately so that you can then
122 just run: `make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/gmcs.exe`
124 That will use the files downloaded by 'make get-monolite-latest.
126 Testing and Installation
127 ------------------------
129 You can run *(part of)* the mono and mcs test suites with the command: `make check`.
130 All tests should pass.  
132 If you want more *extensive* tests, including those that test the
133 class libraries, you need to re-run 'configure' with the
134 '--enable-nunit-tests' flag, and try: `make -k check`
136 Expect to find a few test suite failures. As a sanity check, you
137 can compare the failures you got with
139 `https://wrench.mono-project.com/Wrench/`
141 You can now install mono with: `make install`
143 You can verify your installation by using the mono-test-install
144 script, it can diagnose some common problems with Mono's install.
145 Failure to follow these steps may result in a broken installation. 
147 d. Configuration Options
148 ------------------------
150 The following are the configuration options that someone
151 building Mono might want to use:
153 * `--with-sgen=yes,no` - Generational GC support: Used to enable or disable the
154 compilation of a Mono runtime with the SGen garbage collector.
156   * On platforms that support it, after building Mono, you
157 will have both a mono binary and a mono-sgen binary.
158 Mono uses Boehm, while mono-sgen uses the Simple
159 Generational GC.
161 * `--with-gc=[boehm, included, sgen, none]` - Selects the default Boehm garbage
162 collector engine to use.
164   * *included*: (*slighty modified Boehm GC*)
165 This is the default value, and its
166 the most feature complete, it will allow Mono
167 to use typed allocations and support the
168 debugger.
170   * *boehm*:
171 This is used to use a system-install Boehm GC,
172 it is useful to test new features available in
173 Boehm GC, but we do not recommend that people
174 use this, as it disables a few features.
176   * *none*:
177 Disables the inclusion of a garbage collector.
179   * This defaults to `included`.
181 * `--with-tls=__thread,pthread`
183   * Controls how Mono should access thread local storage,
184 pthread forces Mono to use the pthread APIs, while
185 __thread uses compiler-optimized access to it.
187   * Although __thread is faster, it requires support from
188 the compiler, kernel and libc. Old Linux systems do
189 not support with __thread.
191   * This value is typically pre-configured and there is no
192 need to set it, unless you are trying to debug a problem.
194 * `--with-sigaltstack=yes,no`
196   * **Experimental**: Use at your own risk, it is known to
197 cause problems with garbage collection and is hard to
198 reproduce those bugs.
200   * This controls whether Mono will install a special
201 signal handler to handle stack overflows. If set to
202 `yes`, it will turn stack overflows into the
203 StackOverflowException. Otherwise when a stack
204 overflow happens, your program will receive a
205 segmentation fault.
207   * The configure script will try to detect if your
208 operating system supports this. Some older Linux
209 systems do not support this feature, or you might want
210 to override the auto-detection.
212 * `--with-static_mono=yes,no`
214   * This controls whether `mono` should link against a
215 static library (libmono.a) or a shared library
216 (libmono.so). 
218   * This defaults to `yes`, and will improve the performance
219 of the `mono` program. 
221   * This only affects the `mono' binary, the shared
222 library libmono.so will always be produced for
223 developers that want to embed the runtime in their
224 application.
226 * `--with-xen-opt=yes,no` - Optimize code for Xen virtualization.
228   * It makes Mono generate code which might be slightly
229 slower on average systems, but the resulting executable will run
230 faster under the Xen virtualization system.
232   * This defaults to `yes`.
234 * `--with-large-heap=yes,no` - Enable support for GC heaps larger than 3GB.
236   * This defaults to `no`.
238 * `--enable-small-config=yes,no` - Enable some tweaks to reduce memory usage
239 and disk footprint at the expense of some capabilities.
241   * Typically this means that the number of threads that can be created
242 is limited (256), that the maximum heap size is also reduced (256 MB)
243 and other such limitations that still make mono useful, but more suitable
244 to embedded devices (like mobile phones).
246   * This defaults to `no`.
248 * `--with-ikvm-native=yes,no` - Controls whether the IKVM JNI interface library is
249 built or not.
251   * This is used if you are planning on
252 using the IKVM Java Virtual machine with Mono.
254   * This defaults to `yes`.
256 * `--with-profile4=yes,no` - Whether you want to build the 4.x profile libraries
257 and runtime.
259   * This defaults to `yes`.
261 * `--with-moonlight=yes,no`
263   * Whether you want to generate the Silverlight/Moonlight
264 libraries and toolchain in addition to the default
265 (1.1 and 2.0 APIs).
267   * This will produce the `smcs` compiler which will reference
268 the Silverlight modified assemblies (mscorlib.dll,
269 System.dll, System.Code.dll and System.Xml.Core.dll) and turn
270 on the LINQ extensions for the compiler.
272 * `--with-moon-gc=boehm,sgen` - Select the GC to use for Moonlight.
274   * *boehm*:
275 Selects the Boehm Garbage Collector, with the same flags
276 as the regular Mono build. This is the default.
278   * *sgen*:
279 Selects the new SGen Garbage Collector, which provides
280 Generational GC support, using the same flags as the
281 mono-sgen build.
283   * This defaults to `boehm`.
285 * `--with-libgdiplus=installed,sibling,<path>` - Configure where Mono
286 searches for libgdiplus when running System.Drawing tests.
288   * It defaults to `installed`, which means that the
289 library is available to Mono through the regular
290 system setup.
292   * `sibling' can be used to specify that a libgdiplus
293 that resides as a sibling of this directory (mono)
294 should be used.
296  * Or you can specify a path to a libgdiplus.
298 * `--disable-shared-memory`
300   * Use this option to disable the use of shared memory in
301 Mono (this is equivalent to setting the MONO_DISABLE_SHM
302 environment variable, although this removes the feature
303 completely).
305   * Disabling the shared memory support will disable certain
306 features like cross-process named mutexes.
308 * `--enable-minimal=LIST`
310   * Use this feature to specify optional runtime
311 components that you might not want to include.  This
312 is only useful for developers embedding Mono that
313 require a subset of Mono functionality.
314   * The list is a comma-separated list of components that
315 should be removed, these are:
317     * `aot`:
318 Disables support for the Ahead of Time compilation.
320     * `attach`:
321 Support for the Mono.Management assembly and the
322 VMAttach API (allowing code to be injected into
323 a target VM)
325     * `com`:
326 Disables COM support.
328     * `debug`:
329 Drop debugging support.
331     * `decimal`:
332 Disables support for System.Decimal.
334     * `full_messages`:
335 By default Mono comes with a full table
336 of messages for error codes. This feature
337 turns off uncommon error messages and reduces
338 the runtime size.
340     * `generics`:
341 Generics support.  Disabling this will not
342 allow Mono to run any 2.0 libraries or
343 code that contains generics.
345     * `jit`:
346 Removes the JIT engine from the build, this reduces
347 the executable size, and requires that all code
348 executed by the virtual machine be compiled with
349 Full AOT before execution.
351     * `large_code`:
352 Disables support for large assemblies.
354     * `logging`:
355 Disables support for debug logging.
357     * `pinvoke`:
358 Support for Platform Invocation services,
359 disabling this will drop support for any
360 libraries using DllImport.
362     * `portability`:
363 Removes support for MONO_IOMAP, the environment
364 variables for simplifying porting applications that 
365 are case-insensitive and that mix the Unix and Windows path separators.
367     * `profiler`:
368 Disables support for the default profiler.
370     * `reflection_emit`:
371 Drop System.Reflection.Emit support
373     * `reflection_emit_save`:
374 Drop support for saving dynamically created
375 assemblies (AssemblyBuilderAccess.Save) in
376 System.Reflection.Emit.
378     * `shadow_copy`:
379 Disables support for AppDomain's shadow copies
380 (you can disable this if you do not plan on 
381 using appdomains).
383     * `simd`:
384 Disables support for the Mono.SIMD intrinsics
385 library.
387     * `ssa`:
388 Disables compilation for the SSA optimization
389 framework, and the various SSA-based optimizations.
391 * `--enable-llvm`
392 * `--enable-loadedllvm`
394   * This enables the use of LLVM as a code generation engine
395 for Mono.  The LLVM code generator and optimizer will be 
396 used instead of Mono's built-in code generator for both
397 Just in Time and Ahead of Time compilations.
399   * See the http://www.mono-project.com/Mono_LLVM for the 
400 full details and up-to-date information on this feature.
402   * You will need to have an LLVM built that Mono can link
403 against.
405   * The --enable-loadedllvm variant will make the LLVM backend
406 into a runtime-loadable module instead of linking it directly
407 into the main mono binary.
409 * `--enable-big-arrays` - Enable use of arrays with indexes larger
410 than Int32.MaxValue.
412   * By default Mono has the same limitation as .NET on
413 Win32 and Win64 and limits array indexes to 32-bit
414 values (even on 64-bit systems).
416   * In certain scenarios where large arrays are required,
417 you can pass this flag and Mono will be built to
418 support 64-bit arrays.
420   * This is not the default as it breaks the C embedding
421 ABI that we have exposed through the Mono development
422 cycle.
424 * `--enable-parallel-mark`
426   * Use this option to enable the garbage collector to use
427 multiple CPUs to do its work.  This helps performance
428 on multi-CPU machines as the work is divided across CPUS.
430   * This option is not currently the default as we have
431 not done much testing with Mono.
433 * `--enable-dtrace`
435   * On Solaris and MacOS X builds a version of the Mono
436 runtime that contains DTrace probes and can
437 participate in the system profiling using DTrace.
440 * `--disable-dev-random`
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.
447   * There are a number of runtime options to control this
448 also, see the man page.
450 * `--enable-nacl`
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/
456   * Currently this is used with Mono's AOT engine as
457 Native Client does not support JIT engines yet.
459 Using Mono
460 ==========
462 Once you have installed the software, you can run a few programs:
464 * `mono program.exe` runtime engine
466 * `mcs program.cs` C# compiler 
468 * `monodis program.exe` CIL Disassembler
470 See the man pages for mono(1), mint(1), monodis(1) and mcs(2)
471 for further details.
473 Directory Roadmap
474 =================
476 * `docs/` - Technical documents about the Mono runtime.
478 * `data/` - Configuration files installed as part of the Mono runtime.
480 * `mono/` - The core of the Mono Runtime.
482   * `metadata/` - The object system and metadata reader.
484   * `mini/` - The Just in Time Compiler.
486   * `dis/` - CIL executable Disassembler
488   * `cli/` - Common code for the JIT and the interpreter.
490   * `io-layer/` - The I/O layer and system abstraction for 
491 emulating the .NET IO model.
493   * `cil/` - Common Intermediate Representation, XML
494 definition of the CIL bytecodes.
496  * `interp/` - Interpreter for CLI executables (obsolete).
498  * `arch/` - Architecture specific portions.
500 * `man/` - Manual pages for the various Mono commands and programs.
502 * `samples/` -Some simple sample programs on uses of the Mono
503 runtime as an embedded library.   
505 * `scripts/` - Scripts used to invoke Mono and the corresponding program.
507 * `runtime/` - A directory that contains the Makefiles that link the
508 mono/ and mcs/ build systems.
510 * `../olive/`
512   * If the directory ../olive is present (as an
513 independent checkout) from the Mono module, that
514 directory is automatically configured to share the
515 same prefix than this module gets.
518 Git submodules maintenance
519 ==========================
521 Read documentation at http://mono-project.com/Git_Submodule_Maintenance
523 Maintainer
524 ==========
526 Mono is maintained by miguel@xamarin.com
528 Reporting bugs
529 ==============
531 To submit bug reports, please use Xamarin's Bugzilla:
533 https://bugzilla.xamarin.com/
535 Please use the search facility to ensure the same bug hasn't already
536 been submitted and follow our guidelines on how to make a good bug
537 report:
539 http://mono-project.com/Bugs#How_to_make_a_good_bug_report