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 SVN
79 ---------------------------------
81 If you are building the software from SVN, make sure that you
82 have up-to-date mcs and mono sources:
84 svn co svn+ssh://USER@mono-cvs.ximian.com/source/trunk/mono
85 svn co svn+ssh://USER@mono-cvs.ximian.com/source/trunk/mcs
87 Then, go into the mono directory, and configure:
90 ./autogen.sh --prefix=/usr/local
93 For people with non-standard installations of the auto* utils and of
94 pkg-config (common on misconfigured OSX and windows boxes), you could get
97 ./configure: line 19176: syntax error near unexpected token `PKG_CHECK_MODULES(BASE_DEPENDENCIES,' ...
99 This means that you need to set the ACLOCAL_FLAGS environment var
100 when invoking autogen.sh, like this:
102 ACLOCAL_FLAGS="-I $acprefix/share/aclocal" ./autogen.sh --prefix=/usr/loca
104 where $acprefix is the prefix where aclocal has been installed.
106 This will automatically go into the mcs/ tree and build the
109 This assumes that you have a working mono installation, and that
110 there's a C# compiler named 'mcs', and a corresponding IL
111 runtime called 'mono'. You can use two make variables
112 EXTERNAL_MCS and EXTERNAL_RUNTIME to override these. e.g., you
115 make EXTERNAL_MCS=/foo/bar/mcs EXTERNAL_RUNTIME=/somewhere/else/mono
117 If you don't have a working Mono installation
118 ---------------------------------------------
120 If you don't have a working Mono installation, an obvious choice
121 is to install the latest released packages of 'mono' for your
122 distribution and running autogen.sh; make; make install in the
123 mono module directory.
125 You can also try a slightly more risky approach: this may not work,
126 so start from the released tarball as detailed above.
128 This works by first getting the latest version of the 'monolite'
129 distribution, which contains just enough to run the 'mcs'
130 compiler. You do this with:
132 make get-monolite-latest
134 This will download and automatically gunzip and untar the
135 tarball, and place the files appropriately so that you can then
140 To ensure that you're using the 'monolite' distribution, you can
141 also try passing EXTERNAL_MCS=false on the make command-line.
143 Testing and Installation
144 ------------------------
146 You can run (part of) the mono and mcs testsuites with the command:
150 All tests should pass.
152 If you want more extensive tests, including those that test the
153 class libraries, you need to re-run 'configure' with the
154 '--enable-nunit-tests' flag, and try
158 Expect to find a few testsuite failures. As a sanity check, you
159 can compare the failures you got with
161 http://go-mono.com/tests/displayTestResults.php
163 You can now install mono with:
167 Failure to follow these steps may result in a broken installation.
169 d. Common Configuration Options
170 -------------------------------
172 The following are the configuration options that someone
173 building Mono might want to use:
176 --with-gc=[boehm, included, sgen, none]
178 Selects the garbage collector engine to use, the
179 default is the "included" value.
182 This is the default value, and its
183 the most feature complete, it will allow Mono
184 to use typed allocations and support the
187 It is essentially a slightly modified Boehm GC
190 This is used to use a system-install Boehm GC,
191 it is useful to test new features available in
192 Boehm GC, but we do not recommend that people
193 use this, as it disables a few features.
196 The under-development Generational GC for
197 Mono, do not use this in production.
200 Disables the inclusion of a garbage
203 --with-tls=__thread,pthread
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.
209 Although __thread is faster, it requires support from
210 the compiler, kernel and libc. Old Linux systems do
211 not support with __thread.
213 This value is typically pre-configured and there is no
214 need to set it, unless you are trying to debug a
217 --with-sigaltstack=yes,no
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.
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
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.
235 --with-static_mono=yes,no
237 This controls whether `mono' should link against a
238 static library (libmono.a) or a shared library
241 This defaults to yes, and will improve the performance
242 of the `mono' program.
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
249 --with-xen-opt=yes,no
251 The default value for this is `yes', and it makes Mono
252 generate code which might be slightly slower on
253 average systems, but the resulting executable will run
254 faster under the Xen virtualization system.
256 --with-large-heap=yes,no
258 Enable support for GC heaps larger than 3GB.
260 This value is set to `no' by default.
262 --enable-small-config=yes,no
264 Enable some tweaks to reduce memory usage and disk footprint at
265 the expense of some capabilities. Typically this means that the
266 number of threads that can be created is limited (256), that the
267 maxmimum heap size is also reduced (256 MB) and other such limitations
268 that still make mono useful, but more suitable to embedded devices
269 (like mobile phones).
271 This value is set to `no' by default.
273 --with-ikvm-native=yes,no
275 Controls whether the IKVM JNI interface library is
276 built or not. This is used if you are planning on
277 using the IKVM Java Virtual machine with Mono.
279 This defaults to `yes'.
281 --with-profile4=yes,no
283 Whether you want to build the 4.x profile libraries
286 It defaults to `yes'.
288 --with-moonlight=yes,no
290 Whether you want to generate the Silverlight/Moonlight
291 libraries and toolchain in addition to the default
294 This will produce the `smcs' compiler which will reference
295 the Silverlight modified assemblies (mscorlib.dll,
296 System.dll, System.Code.dll and System.Xml.Core.dll) and turn
297 on the LINQ extensions for the compiler.
299 --with-libgdiplus=installed,sibling,<path>
301 This is used to configure where should Mono look for
302 libgdiplus when running the System.Drawing tests.
304 It defaults to `installed', which means that the
305 library is available to Mono through the regular
308 `sibling' can be used to specify that a libgdiplus
309 that resides as a sibling of this directory (mono)
312 Or you can specify a path to a libgdiplus.
314 --disable-shared-memory
316 Use this option to disable the use of shared memory in
317 Mono (this is equivalent to setting the MONO_DISABLE_SHM
318 environment variable, although this removes the feature
321 Disabling the shared memory support will disable certain
322 features like cross-process named mutexes.
324 --enable-minimal=LIST
326 Use this feature to specify optional runtime
327 components that you might not want to include. This
328 is only useful for developers embedding Mono that
329 require a subset of Mono functionality.
331 The list is a comma-separated list of components that
332 should be removed, these are:
335 Disables support for the Ahead of Time
339 Support for the Mono.Management assembly and the
340 VMAttach API (allowing code to be injected into
344 Disables COM support.
347 Drop debugging support.
350 Disables support for System.Decimal.
353 By default Mono comes with a full table
354 of messages for error codes. This feature
355 turns off uncommon error messages and reduces
359 Generics support. Disabling this will not
360 allow Mono to run any 2.0 libraries or
361 code that contains generics.
364 Removes the JIT engine from the build, this reduces
365 the executable size, and requires that all code
366 executed by the virtual machine be compiled with
367 Full AOT before execution.
370 Disables support for large assemblies.
373 Disables support for debug logging.
376 Support for Platform Invocation services,
377 disabling this will drop support for any
378 libraries using DllImport.
381 Removes support for MONO_IOMAP, the environment
382 variables for simplifying porting applications that
383 are case-insensitive and that mix the Unix and Windows path separators.
386 Disables support for the default profiler.
389 Drop System.Reflection.Emit support
391 reflection_emit_save:
392 Drop support for saving dynamically created
393 assemblies (AssemblyBuilderAccess.Save) in
394 System.Reflection.Emit.
397 Disables support for AppDomain's shadow copies
398 (you can disable this if you do not plan on
402 Disables support for the Mono.SIMD intrinsics
406 Disables compilation for the SSA optimization
407 framework, and the various SSA-based
412 This enables the use of LLVM as a code generation engine
413 for Mono. The LLVM code generator and optimizer will be
414 used instead of Mono's built-in code generator for both
415 Just in Time and Ahead of Time compilations.
417 See the http://www.mono-project.com/Mono_LLVM for the
418 full details and up-to-date information on this feature.
420 You will need to have an LLVM built that Mono can link
425 This enables the use arrays whose indexes are larger
428 By default Mono has the same limitation as .NET on
429 Win32 and Win64 and limits array indexes to 32-bit
430 values (even on 64-bit systems).
432 In certain scenarios where large arrays are required,
433 you can pass this flag and Mono will be built to
434 support 64-bit arrays.
436 This is not the default as it breaks the C embedding
437 ABI that we have exposed through the Mono development
440 --enable-parallel-mark
442 Use this option to enable the garbage collector to use
443 multiple CPUs to do its work. This helps performance
444 on multi-CPU machines as the work is divided across CPUS.
446 This option is not currently the default as we have
447 not done much testing with Mono.
451 On Solaris and MacOS X builds a version of the Mono
452 runtime that contains DTrace probes and can
453 participate in the system profiling using DTrace.
458 Mono uses /dev/random to obtain good random data for
459 any source that requires random numbers. If your
460 system does not support this, you might want to
463 There are a number of runtime options to control this
464 also, see the man page.
470 Once you have installed the software, you can run a few programs:
484 See the man pages for mono(1), mint(1), monodis(1) and mcs(2)
491 Technical documents about the Mono runtime.
494 Configuration files installed as part of the Mono runtime.
497 The core of the Mono Runtime.
500 The object system and metadata reader.
503 The Just in Time Compiler.
506 CIL executable Disassembler
509 Common code for the JIT and the interpreter.
512 The I/O layer and system abstraction for
513 emulating the .NET IO model.
516 Common Intermediate Representation, XML
517 definition of the CIL bytecodes.
520 Interpreter for CLI executables (obsolete).
523 Architecture specific portions.
527 Manual pages for the various Mono commands and programs.
531 Some simple sample programs on uses of the Mono
532 runtime as an embedded library.
536 Scripts used to invoke Mono and the corresponding program.
540 A directory that contains the Makefiles that link the
541 mono/ and mcs/ build systems.
545 If the directory ../olive is present (as an
546 independent checkout) from the Mono module, that
547 directory is automatically configured to share the
548 same prefix than this module gets.