[System] Throw IOE in more cases when dealing with an invalid Process object. Fixes...
[mono-project.git] / README.md
blob07c950004d70bc09294b11f4656a3964d4534ca0
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. [Contributing to Mono] (#contributing-to-mono) 
8 5. [Git submodules maintenance](#git-submodules-maintenance)
9 6. [Reporting bugs](#reporting-bugs)
11 Compilation and Installation
12 ============================
14 a. Build Requirements
15 ---------------------
17 * On Itanium, you must obtain libunwind: http://www.hpl.hp.com/research/linux/libunwind/download.php4
19 * On Solaris
21  1. Make sure that you used GNU tar to unpack this package, as
22  Solaris tar will not unpack this correctly, and you will get strange errors.
24  2. Make sure that you use the GNU toolchain to build the software.
26  3. Optional dependencies
28   * libgdiplus - Required for System.Drawing. This library in turn requires glib and pkg-config
30   * pkg-config - Available at: http://www.freedesktop.org/Software/pkgconfig
32   * glib 2.4 - Available at: http://www.gtk.org/
34   * libzlib - This library and the development headers are required for compression
35 file support in the 2.0 profile.
37 b. Building the Software
38 ------------------------
40 If you obtained this package as an officially released tarball,
41 this is very simple, use configure and make:
43 `./configure --prefix=/usr/local ; make ; make install`
45 Mono supports a JIT engine on x86, SPARC, SPARCv9, S/390,
46 S/390x, AMD64, ARM and PowerPC systems.   
48 If you obtained this as a snapshot, you will need an existing
49 Mono installation.  To upgrade your installation, unpack both
50 mono and mcs:
52         tar xzf mcs-XXXX.tar.gz
53         tar xzf mono-XXXX.tar.gz
54         mv mono-XXX mono
55         mv mcs-XXX mcs
56         cd mono
57         ./autogen.sh --prefix=/usr/local
58         make
60 The Mono build system is silent for most compilation commands.
61 To enable a more verbose compile (for example, to pinpoint
62 problems in your makefiles or your system) pass the V=1 flag to make, like this:
64 ` make V=1`
67 c. Building the software from GIT
68 ---------------------------------
70 If you are building the software from GIT, make sure that you
71 have up-to-date mcs and mono sources:
73  * If you are an anonymous user: `git clone git://github.com/mono/mono.git`
75  * If you are a Mono contributor with read/write privileges: `git clone git@github.com:mono/mono.git`
77 Then, go into the mono directory, and configure:
79         cd mono
80         ./autogen.sh --prefix=/usr/local
81         make
83 For people with non-standard installations of the auto* utils and of
84 pkg-config (common on misconfigured OSX and windows boxes), you could get
85 an error like this:
87         ./configure: line 19176: syntax error near unexpected token 'PKG_CHECK_MODULES(BASE_DEPENDENCIES,' ...
89 This means that you need to set the ACLOCAL_FLAGS environment variable
90 when invoking autogen.sh, like this: 
92         ACLOCAL_FLAGS="-I $acprefix/share/aclocal" ./autogen.sh --prefix=/usr/local
94 where $acprefix is the prefix where aclocal has been installed.
95 This will automatically go into the mcs/ tree and build the
96 binaries there.
98 This assumes that you have a working mono installation, and that
99 there's a C# compiler named 'mcs', and a corresponding IL
100 runtime called 'mono'.  You can use two make variables
101 EXTERNAL_MCS and EXTERNAL_RUNTIME to override these.  e.g., you
102 can say:
104         make EXTERNAL_MCS=/foo/bar/mcs EXTERNAL_RUNTIME=/somewhere/else/mono
106 If you don't have a working Mono installation
107 ---------------------------------------------
109 If you don't have a working Mono installation, an obvious choice
110 is to install the latest released packages of 'mono' for your
111 distribution and running `autogen.sh; make; make install` in the
112 mono module directory.
114 You can also try a slightly more risky approach: this may not work,
115 so start from the released tarball as detailed above.
117 This works by first getting the latest version of the 'monolite'
118 distribution, which contains just enough to run the 'mcs'
119 compiler. You do this with:
121         # Run the following line after ./autogen.sh
122         make get-monolite-latest
124 This will download and automatically gunzip and untar the
125 tarball, and place the files appropriately so that you can then
126 just run: `make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/gmcs.exe`
128 That will use the files downloaded by 'make get-monolite-latest.
130 Testing and Installation
131 ------------------------
133 You can run *(part of)* the mono and mcs test suites with the command: `make check`.
134 All tests should pass.  
136 If you want more *extensive* tests, including those that test the
137 class libraries, you need to re-run 'configure' with the
138 '--enable-nunit-tests' flag, and try: `make -k check`
140 Expect to find a few test suite failures. As a sanity check, you
141 can compare the failures you got with
143     https://wrench.mono-project.com/Wrench/
145 You can now install mono with: `make install`
147 You can verify your installation by using the mono-test-install
148 script, it can diagnose some common problems with Mono's install.
149 Failure to follow these steps may result in a broken installation. 
151 d. Configuration Options
152 ------------------------
154 The following are the configuration options that someone
155 building Mono might want to use:
157 * `--with-sgen=yes,no` - Generational GC support: Used to enable or disable the
158 compilation of a Mono runtime with the SGen garbage collector.
160   * On platforms that support it, after building Mono, you will have
161 both a mono binary and a mono-sgen binary.  Mono uses Boehm, while
162 mono-sgen uses the Simple Generational GC.
164 * `--with-gc=[boehm, included, sgen, none]` - Selects the default Boehm garbage
165 collector engine to use.
167   * *included*: (*slighty modified Boehm GC*)
168 This is the default value, and its
169 the most feature complete, it will allow Mono
170 to use typed allocations and support the
171 debugger.
173   * *boehm*:
174 This is used to use a system-install Boehm GC,
175 it is useful to test new features available in
176 Boehm GC, but we do not recommend that people
177 use this, as it disables a few features.
179   * *none*:
180 Disables the inclusion of a garbage collector.
182   * This defaults to `included`.
184 * `--with-tls=__thread,pthread`
186   * Controls how Mono should access thread local storage,
187 pthread forces Mono to use the pthread APIs, while
188 __thread uses compiler-optimized access to it.
190   * Although __thread is faster, it requires support from
191 the compiler, kernel and libc. Old Linux systems do
192 not support with __thread.
194   * This value is typically pre-configured and there is no
195 need to set it, unless you are trying to debug a problem.
197 * `--with-sigaltstack=yes,no`
199   * **Experimental**: Use at your own risk, it is known to
200 cause problems with garbage collection and is hard to
201 reproduce those bugs.
203   * This controls whether Mono will install a special
204 signal handler to handle stack overflows. If set to
205 `yes`, it will turn stack overflows into the
206 StackOverflowException. Otherwise when a stack
207 overflow happens, your program will receive a
208 segmentation fault.
210   * The configure script will try to detect if your
211 operating system supports this. Some older Linux
212 systems do not support this feature, or you might want
213 to override the auto-detection.
215 * `--with-static_mono=yes,no`
217   * This controls whether `mono` should link against a
218 static library (libmono.a) or a shared library
219 (libmono.so). 
221   * This defaults to `yes`, and will improve the performance
222 of the `mono` program. 
224   * This only affects the `mono' binary, the shared
225 library libmono.so will always be produced for
226 developers that want to embed the runtime in their
227 application.
229 * `--with-xen-opt=yes,no` - Optimize code for Xen virtualization.
231   * It makes Mono generate code which might be slightly
232 slower on average systems, but the resulting executable will run
233 faster under the Xen virtualization system.
235   * This defaults to `yes`.
237 * `--with-large-heap=yes,no` - Enable support for GC heaps larger than 3GB.
239   * This defaults to `no`.
241 * `--enable-small-config=yes,no` - Enable some tweaks to reduce memory usage
242 and disk footprint at the expense of some capabilities.
244   * Typically this means that the number of threads that can be created
245 is limited (256), that the maximum heap size is also reduced (256 MB)
246 and other such limitations that still make mono useful, but more suitable
247 to embedded devices (like mobile phones).
249   * This defaults to `no`.
251 * `--with-ikvm-native=yes,no` - Controls whether the IKVM JNI interface library is
252 built or not.
254   * This is used if you are planning on
255 using the IKVM Java Virtual machine with Mono.
257   * This defaults to `yes`.
259 * `--with-profile4=yes,no` - Whether you want to build the 4.x profile libraries
260 and runtime.
262   * This defaults to `yes`.
264 * `--with-moonlight=yes,no`
266   * Whether you want to generate the Silverlight/Moonlight
267 libraries and toolchain in addition to the default
268 (1.1 and 2.0 APIs).
270   * This will produce the `smcs` compiler which will reference
271 the Silverlight modified assemblies (mscorlib.dll,
272 System.dll, System.Code.dll and System.Xml.Core.dll) and turn
273 on the LINQ extensions for the compiler.
275 * `--with-moon-gc=boehm,sgen` - Select the GC to use for Moonlight.
277   * *boehm*:
278 Selects the Boehm Garbage Collector, with the same flags
279 as the regular Mono build. This is the default.
281   * *sgen*:
282 Selects the new SGen Garbage Collector, which provides
283 Generational GC support, using the same flags as the
284 mono-sgen build.
286   * This defaults to `boehm`.
288 * `--with-libgdiplus=installed,sibling,<path>` - Configure where Mono
289 searches for libgdiplus when running System.Drawing tests.
291   * It defaults to `installed`, which means that the
292 library is available to Mono through the regular
293 system setup.
295   * `sibling' can be used to specify that a libgdiplus
296 that resides as a sibling of this directory (mono)
297 should be used.
299  * Or you can specify a path to a libgdiplus.
301 * `--disable-shared-memory`
303   * Use this option to disable the use of shared memory in
304 Mono (this is equivalent to setting the MONO_DISABLE_SHM
305 environment variable, although this removes the feature
306 completely).
308   * Disabling the shared memory support will disable certain
309 features like cross-process named mutexes.
311 * `--enable-minimal=LIST`
313   * Use this feature to specify optional runtime
314 components that you might not want to include.  This
315 is only useful for developers embedding Mono that
316 require a subset of Mono functionality.
317   * The list is a comma-separated list of components that
318 should be removed, these are:
320     * `aot`:
321 Disables support for the Ahead of Time compilation.
323     * `attach`:
324 Support for the Mono.Management assembly and the
325 VMAttach API (allowing code to be injected into
326 a target VM)
328     * `com`:
329 Disables COM support.
331     * `debug`:
332 Drop debugging support.
334     * `decimal`:
335 Disables support for System.Decimal.
337     * `full_messages`:
338 By default Mono comes with a full table
339 of messages for error codes. This feature
340 turns off uncommon error messages and reduces
341 the runtime size.
343     * `generics`:
344 Generics support.  Disabling this will not
345 allow Mono to run any 2.0 libraries or
346 code that contains generics.
348     * `jit`:
349 Removes the JIT engine from the build, this reduces
350 the executable size, and requires that all code
351 executed by the virtual machine be compiled with
352 Full AOT before execution.
354     * `large_code`:
355 Disables support for large assemblies.
357     * `logging`:
358 Disables support for debug logging.
360     * `pinvoke`:
361 Support for Platform Invocation services,
362 disabling this will drop support for any
363 libraries using DllImport.
365     * `portability`:
366 Removes support for MONO_IOMAP, the environment
367 variables for simplifying porting applications that 
368 are case-insensitive and that mix the Unix and Windows path separators.
370     * `profiler`:
371 Disables support for the default profiler.
373     * `reflection_emit`:
374 Drop System.Reflection.Emit support
376     * `reflection_emit_save`:
377 Drop support for saving dynamically created
378 assemblies (AssemblyBuilderAccess.Save) in
379 System.Reflection.Emit.
381     * `shadow_copy`:
382 Disables support for AppDomain's shadow copies
383 (you can disable this if you do not plan on 
384 using appdomains).
386     * `simd`:
387 Disables support for the Mono.SIMD intrinsics
388 library.
390     * `ssa`:
391 Disables compilation for the SSA optimization
392 framework, and the various SSA-based optimizations.
394 * `--enable-llvm`
395 * `--enable-loadedllvm`
397   * This enables the use of LLVM as a code generation engine
398 for Mono.  The LLVM code generator and optimizer will be 
399 used instead of Mono's built-in code generator for both
400 Just in Time and Ahead of Time compilations.
402   * See the http://www.mono-project.com/Mono_LLVM for the 
403 full details and up-to-date information on this feature.
405   * You will need to have an LLVM built that Mono can link
406 against.
408   * The --enable-loadedllvm variant will make the LLVM backend
409 into a runtime-loadable module instead of linking it directly
410 into the main mono binary.
412 * `--enable-big-arrays` - Enable use of arrays with indexes larger
413 than Int32.MaxValue.
415   * By default Mono has the same limitation as .NET on
416 Win32 and Win64 and limits array indexes to 32-bit
417 values (even on 64-bit systems).
419   * In certain scenarios where large arrays are required,
420 you can pass this flag and Mono will be built to
421 support 64-bit arrays.
423   * This is not the default as it breaks the C embedding
424 ABI that we have exposed through the Mono development
425 cycle.
427 * `--enable-parallel-mark`
429   * Use this option to enable the garbage collector to use
430 multiple CPUs to do its work.  This helps performance
431 on multi-CPU machines as the work is divided across CPUS.
433   * This option is not currently the default as we have
434 not done much testing with Mono.
436 * `--enable-dtrace`
438   * On Solaris and MacOS X builds a version of the Mono
439 runtime that contains DTrace probes and can
440 participate in the system profiling using DTrace.
443 * `--disable-dev-random`
445   * Mono uses /dev/random to obtain good random data for
446 any source that requires random numbers.   If your
447 system does not support this, you might want to
448 disable it.
450   * There are a number of runtime options to control this
451 also, see the man page.
453 * `--enable-nacl`
455   * This configures the Mono compiler to generate code
456 suitable to be used by Google's Native Client:
457 http://code.google.com/p/nativeclient/
459   * Currently this is used with Mono's AOT engine as
460 Native Client does not support JIT engines yet.
462 Using Mono
463 ==========
465 Once you have installed the software, you can run a few programs:
467 * `mono program.exe` runtime engine
469 * `mcs program.cs` C# compiler 
471 * `monodis program.exe` CIL Disassembler
473 See the man pages for mono(1), mint(1), monodis(1) and mcs(2)
474 for further details.
476 Directory Roadmap
477 =================
479 * `docs/` - Technical documents about the Mono runtime.
481 * `data/` - Configuration files installed as part of the Mono runtime.
483 * `mono/` - The core of the Mono Runtime.
485   * `metadata/` - The object system and metadata reader.
487   * `mini/` - The Just in Time Compiler.
489   * `dis/` - CIL executable Disassembler
491   * `cli/` - Common code for the JIT and the interpreter.
493   * `io-layer/` - The I/O layer and system abstraction for 
494 emulating the .NET IO model.
496   * `cil/` - Common Intermediate Representation, XML
497 definition of the CIL bytecodes.
499  * `interp/` - Interpreter for CLI executables (obsolete).
501  * `arch/` - Architecture specific portions.
503 * `man/` - Manual pages for the various Mono commands and programs.
505 * `samples/` -Some simple sample programs on uses of the Mono
506 runtime as an embedded library.   
508 * `scripts/` - Scripts used to invoke Mono and the corresponding program.
510 * `runtime/` - A directory that contains the Makefiles that link the
511 mono/ and mcs/ build systems.
513 * `../olive/`
515   * If the directory ../olive is present (as an
516 independent checkout) from the Mono module, that
517 directory is automatically configured to share the
518 same prefix than this module gets.
520 Contributing to Mono
521 ====================
522 Before submitting changes to Mono, please review the contribution guidelines at http://mono-project.com/Contributing. Please pay particular attention to the [Important Rules](http://mono-project.com/Contributing#Important_Rules) section.
525 Git submodules maintenance
526 ==========================
528 Read documentation at http://mono-project.com/Git_Submodule_Maintenance
530 Maintainer
531 ==========
533 Mono is maintained by miguel@xamarin.com
535 Reporting bugs
536 ==============
538 To submit bug reports, please use Xamarin's Bugzilla:
540 https://bugzilla.xamarin.com/
542 Please use the search facility to ensure the same bug hasn't already
543 been submitted and follow our guidelines on how to make a good bug
544 report:
546 http://mono-project.com/Bugs#How_to_make_a_good_bug_report