8 1. Compilation and Installation
9 ===============================
14 To build Mono, you will need the following components:
18 Available from: http://www.freedesktop.org/Software/pkgconfig
22 Available from: http://www.gtk.org/
24 On Itanium, you must obtain libunwind:
26 http://www.hpl.hp.com/research/linux/libunwind/download.php4
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.
31 On Solaris, make sure that you use the GNU toolchain to build the software.
33 Optional dependencies:
37 If you want to get support for System.Drawing, you will need to get
42 This library and the development headers are required for compression
43 file support in the 2.0 profile.
45 b. Building the Software
46 ------------------------
48 If you obtained this package as an officially released tarball,
49 this is very simple, use configure and make:
51 ./configure --prefix=/usr/local
55 Mono supports a JIT engine on x86, SPARC, SPARCv9, S/390,
56 S/390x, AMD64, ARM and PowerPC systems.
58 If you obtained this as a snapshot, you will need an existing
59 Mono installation. To upgrade your installation, unpack both
62 tar xzf mcs-XXXX.tar.gz
63 tar xzf mono-XXXX.tar.gz
67 ./autogen.sh --prefix=/usr/local
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:
78 c. Building the software from GIT
79 ---------------------------------
81 If you are building the software from GIT, make sure that you
82 have up-to-date mcs and mono sources:
84 If you are an anonymous user:
85 git clone git://github.com/mono/mono.git
87 If you are a Mono contributors with read/write privileges:
88 git clone git@github.com:mono/mono.git
91 Then, go into the mono directory, and configure:
94 ./autogen.sh --prefix=/usr/local
97 For people with non-standard installations of the auto* utils and of
98 pkg-config (common on misconfigured OSX and windows boxes), you could get
101 ./configure: line 19176: syntax error near unexpected token `PKG_CHECK_MODULES(BASE_DEPENDENCIES,' ...
103 This means that you need to set the ACLOCAL_FLAGS environment var
104 when invoking autogen.sh, like this:
106 ACLOCAL_FLAGS="-I $acprefix/share/aclocal" ./autogen.sh --prefix=/usr/loca
108 where $acprefix is the prefix where aclocal has been installed.
110 This will automatically go into the mcs/ tree and build the
113 This assumes that you have a working mono installation, and that
114 there's a C# compiler named 'mcs', and a corresponding IL
115 runtime called 'mono'. You can use two make variables
116 EXTERNAL_MCS and EXTERNAL_RUNTIME to override these. e.g., you
119 make EXTERNAL_MCS=/foo/bar/mcs EXTERNAL_RUNTIME=/somewhere/else/mono
121 If you don't have a working Mono installation
122 ---------------------------------------------
124 If you don't have a working Mono installation, an obvious choice
125 is to install the latest released packages of 'mono' for your
126 distribution and running autogen.sh; make; make install in the
127 mono module directory.
129 You can also try a slightly more risky approach: this may not work,
130 so start from the released tarball as detailed above.
132 This works by first getting the latest version of the 'monolite'
133 distribution, which contains just enough to run the 'mcs'
134 compiler. You do this with:
136 # Run the following line after ./autogen.sh
137 make get-monolite-latest
139 This will download and automatically gunzip and untar the
140 tarball, and place the files appropriately so that you can then
143 make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/gmcs.exe
145 And that will use the files downloaded by 'make get-monolite-latest.
147 Testing and Installation
148 ------------------------
150 You can run (part of) the mono and mcs testsuites with the command:
154 All tests should pass.
156 If you want more extensive tests, including those that test the
157 class libraries, you need to re-run 'configure' with the
158 '--enable-nunit-tests' flag, and try
162 Expect to find a few testsuite failures. As a sanity check, you
163 can compare the failures you got with
165 http://go-mono.com/tests/displayTestResults.php
167 You can now install mono with:
171 Failure to follow these steps may result in a broken installation.
173 d. Common Configuration Options
174 -------------------------------
176 The following are the configuration options that someone
177 building Mono might want to use:
181 Generational GC support: Used to enable or disable the
182 compilation of a Mono runtime with the SGen garbage collector.
184 On platforms that support it, after building Mono, you
185 will have both a mono binary and a mono-sgen binary.
186 Mono uses Boehm, while mono-sgen uses the Simple
189 --with-gc=[boehm, included, sgen, none]
191 Selects the default Boehm garbage collector engine to
192 use, the default is the "included" value.
195 This is the default value, and its
196 the most feature complete, it will allow Mono
197 to use typed allocations and support the
200 It is essentially a slightly modified Boehm GC
203 This is used to use a system-install Boehm GC,
204 it is useful to test new features available in
205 Boehm GC, but we do not recommend that people
206 use this, as it disables a few features.
209 Disables the inclusion of a garbage
212 --with-tls=__thread,pthread
214 Controls how Mono should access thread local storage,
215 pthread forces Mono to use the pthread APIs, while
216 __thread uses compiler-optimized access to it.
218 Although __thread is faster, it requires support from
219 the compiler, kernel and libc. Old Linux systems do
220 not support with __thread.
222 This value is typically pre-configured and there is no
223 need to set it, unless you are trying to debug a
226 --with-sigaltstack=yes,no
228 Experimental: Use at your own risk, it is known to
229 cause problems with garbage collection and is hard to
230 reproduce those bugs.
232 This controls whether Mono will install a special
233 signal handler to handle stack overflows. If set to
234 "yes", it will turn stack overflows into the
235 StackOverflowException. Otherwise when a stack
236 overflow happens, your program will receive a
239 The configure script will try to detect if your
240 operating system supports this. Some older Linux
241 systems do not support this feature, or you might want
242 to override the auto-detection.
244 --with-static_mono=yes,no
246 This controls whether `mono' should link against a
247 static library (libmono.a) or a shared library
250 This defaults to yes, and will improve the performance
251 of the `mono' program.
253 This only affects the `mono' binary, the shared
254 library libmono.so will always be produced for
255 developers that want to embed the runtime in their
258 --with-xen-opt=yes,no
260 The default value for this is `yes', and it makes Mono
261 generate code which might be slightly slower on
262 average systems, but the resulting executable will run
263 faster under the Xen virtualization system.
265 --with-large-heap=yes,no
267 Enable support for GC heaps larger than 3GB.
269 This value is set to `no' by default.
271 --enable-small-config=yes,no
273 Enable some tweaks to reduce memory usage and disk footprint at
274 the expense of some capabilities. Typically this means that the
275 number of threads that can be created is limited (256), that the
276 maxmimum heap size is also reduced (256 MB) and other such limitations
277 that still make mono useful, but more suitable to embedded devices
278 (like mobile phones).
280 This value is set to `no' by default.
282 --with-ikvm-native=yes,no
284 Controls whether the IKVM JNI interface library is
285 built or not. This is used if you are planning on
286 using the IKVM Java Virtual machine with Mono.
288 This defaults to `yes'.
290 --with-profile4=yes,no
292 Whether you want to build the 4.x profile libraries
295 It defaults to `yes'.
297 --with-moonlight=yes,no
299 Whether you want to generate the Silverlight/Moonlight
300 libraries and toolchain in addition to the default
303 This will produce the `smcs' compiler which will reference
304 the Silverlight modified assemblies (mscorlib.dll,
305 System.dll, System.Code.dll and System.Xml.Core.dll) and turn
306 on the LINQ extensions for the compiler.
308 --with-libgdiplus=installed,sibling,<path>
310 This is used to configure where should Mono look for
311 libgdiplus when running the System.Drawing tests.
313 It defaults to `installed', which means that the
314 library is available to Mono through the regular
317 `sibling' can be used to specify that a libgdiplus
318 that resides as a sibling of this directory (mono)
321 Or you can specify a path to a libgdiplus.
323 --disable-shared-memory
325 Use this option to disable the use of shared memory in
326 Mono (this is equivalent to setting the MONO_DISABLE_SHM
327 environment variable, although this removes the feature
330 Disabling the shared memory support will disable certain
331 features like cross-process named mutexes.
333 --enable-minimal=LIST
335 Use this feature to specify optional runtime
336 components that you might not want to include. This
337 is only useful for developers embedding Mono that
338 require a subset of Mono functionality.
340 The list is a comma-separated list of components that
341 should be removed, these are:
344 Disables support for the Ahead of Time
348 Support for the Mono.Management assembly and the
349 VMAttach API (allowing code to be injected into
353 Disables COM support.
356 Drop debugging support.
359 Disables support for System.Decimal.
362 By default Mono comes with a full table
363 of messages for error codes. This feature
364 turns off uncommon error messages and reduces
368 Generics support. Disabling this will not
369 allow Mono to run any 2.0 libraries or
370 code that contains generics.
373 Removes the JIT engine from the build, this reduces
374 the executable size, and requires that all code
375 executed by the virtual machine be compiled with
376 Full AOT before execution.
379 Disables support for large assemblies.
382 Disables support for debug logging.
385 Support for Platform Invocation services,
386 disabling this will drop support for any
387 libraries using DllImport.
390 Removes support for MONO_IOMAP, the environment
391 variables for simplifying porting applications that
392 are case-insensitive and that mix the Unix and Windows path separators.
395 Disables support for the default profiler.
398 Drop System.Reflection.Emit support
400 reflection_emit_save:
401 Drop support for saving dynamically created
402 assemblies (AssemblyBuilderAccess.Save) in
403 System.Reflection.Emit.
406 Disables support for AppDomain's shadow copies
407 (you can disable this if you do not plan on
411 Disables support for the Mono.SIMD intrinsics
415 Disables compilation for the SSA optimization
416 framework, and the various SSA-based
422 This enables the use of LLVM as a code generation engine
423 for Mono. The LLVM code generator and optimizer will be
424 used instead of Mono's built-in code generator for both
425 Just in Time and Ahead of Time compilations.
427 See the http://www.mono-project.com/Mono_LLVM for the
428 full details and up-to-date information on this feature.
430 You will need to have an LLVM built that Mono can link
433 The --enable-loadedllvm variant will make the llvm backend
434 into a runtime-loadable module instead of linking it directly
435 into the main mono binary.
439 This enables the use arrays whose indexes are larger
442 By default Mono has the same limitation as .NET on
443 Win32 and Win64 and limits array indexes to 32-bit
444 values (even on 64-bit systems).
446 In certain scenarios where large arrays are required,
447 you can pass this flag and Mono will be built to
448 support 64-bit arrays.
450 This is not the default as it breaks the C embedding
451 ABI that we have exposed through the Mono development
454 --enable-parallel-mark
456 Use this option to enable the garbage collector to use
457 multiple CPUs to do its work. This helps performance
458 on multi-CPU machines as the work is divided across CPUS.
460 This option is not currently the default as we have
461 not done much testing with Mono.
465 On Solaris and MacOS X builds a version of the Mono
466 runtime that contains DTrace probes and can
467 participate in the system profiling using DTrace.
472 Mono uses /dev/random to obtain good random data for
473 any source that requires random numbers. If your
474 system does not support this, you might want to
477 There are a number of runtime options to control this
478 also, see the man page.
482 This configures the Mono compiler to generate code
483 suitable to be used by Google's Native Client:
485 http://code.google.com/p/nativeclient/
487 Currently this is used with Mono's AOT engine as
488 Native Client does not support JIT engines yet.
493 Once you have installed the software, you can run a few programs:
507 See the man pages for mono(1), mint(1), monodis(1) and mcs(2)
514 Technical documents about the Mono runtime.
517 Configuration files installed as part of the Mono runtime.
520 The core of the Mono Runtime.
523 The object system and metadata reader.
526 The Just in Time Compiler.
529 CIL executable Disassembler
532 Common code for the JIT and the interpreter.
535 The I/O layer and system abstraction for
536 emulating the .NET IO model.
539 Common Intermediate Representation, XML
540 definition of the CIL bytecodes.
543 Interpreter for CLI executables (obsolete).
546 Architecture specific portions.
550 Manual pages for the various Mono commands and programs.
554 Some simple sample programs on uses of the Mono
555 runtime as an embedded library.
559 Scripts used to invoke Mono and the corresponding program.
563 A directory that contains the Makefiles that link the
564 mono/ and mcs/ build systems.
568 If the directory ../olive is present (as an
569 independent checkout) from the Mono module, that
570 directory is automatically configured to share the
571 same prefix than this module gets.