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, AMD64, ARM
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 c. Building the software from SVN
71 ---------------------------------
73 If you are building the software from SVN, make sure that you
74 have up-to-date mcs and mono sources:
76 svn co svn+ssh://USER@mono-cvs.ximian.com/source/trunk/mono
77 svn co svn+ssh://USER@mono-cvs.ximian.com/source/trunk/mcs
79 Then, go into the mono directory, and configure:
82 ./autogen.sh --prefix=/usr/local
85 This will automatically go into the mcs/ tree and build the
88 This assumes that you have a working mono installation, and that
89 there's a C# compiler named 'mcs', and a corresponding IL
90 runtime called 'mono'. You can use two make variables
91 EXTERNAL_MCS and EXTERNAL_RUNTIME to override these. e.g., you
94 make EXTERNAL_MCS=/foo/bar/mcs EXTERNAL_RUNTIME=/somewhere/else/mono
96 If you don't have a working Mono installation
97 ---------------------------------------------
99 If you don't have a working Mono installation, an obvious choice
100 is to install the latest released packages of 'mono' for your
101 distribution and running autogen.sh; make; make install in the
102 mono module directory.
104 You can also try a slightly more risky approach: this may not work,
105 so start from the released tarball as detailed above.
107 This works by first getting the latest version of the 'monolite'
108 distribution, which contains just enough to run the 'mcs'
109 compiler. You do this with:
111 make get-monolite-latest
113 This will download and automatically gunzip and untar the
114 tarball, and place the files appropriately so that you can then
119 To ensure that you're using the 'monolite' distribution, you can
120 also try passing EXTERNAL_MCS=false on the make command-line.
122 Testing and Installation
123 ------------------------
125 You can run (part of) the mono and mcs testsuites with the command:
129 All tests should pass.
131 If you want more extensive tests, including those that test the
132 class libraries, you need to re-run 'configure' with the
133 '--enable-nunit-tests' flag, and try
137 Expect to find a few testsuite failures. As a sanity check, you
138 can compare the failures you got with
140 http://go-mono.com/tests/displayTestResults.php
142 You can now install mono with:
146 Failure to follow these steps may result in a broken installation.
148 d. Common Configuration Options
149 -------------------------------
151 The following are the configuration options that someone
152 building Mono might want to use:
155 --with-gc=[boehm, included, sgen, none]
157 Selects the garbage collector engine to use, the
158 default is the "included" value.
161 This is the default value, and its
162 the most feature complete, it will allow Mono
163 to use typed allocations and support the
166 It is essentially a slightly modified Boehm GC
169 This is used to use a system-install Boehm GC,
170 it is useful to test new features available in
171 Boehm GC, but we do not recommend that people
172 use this, as it disables a few features.
175 The under-development Generational GC for
176 Mono, do not use this in production.
179 Disables the inclusion of a garbage
182 --with-tls=__thread,pthread
184 Controls how Mono should access thread local storage,
185 pthread forces Mono to use the pthread APIs, while
186 __thread uses compiler-optimized access to it.
188 Although __thread is faster, it requires support from
189 the compiler, kernel and libc. Old Linux systems do
190 not support with __thread.
192 This value is typically pre-configured and there is no
193 need to set it, unless you are trying to debug a
196 --with-sigaltstack=yes,no
198 This controls whether Mono will install a special
199 signal handler to handle stack overflows. If set to
200 "yes", it will turn stack overflows into the
201 StackOverflowException. Otherwise when a stack
202 overflow happens, your program will receive a
205 The configure script will try to detect if your
206 operating system supports this. Some older Linux
207 systems do not support this feature, or you might want
208 to override the auto-detection.
210 --with-static-mono=yes,no
212 This controls whether `mono' should link against a
213 static library (libmono.a) or a shared library
216 This defaults to yes, and will improve the performance
217 of the `mono' program.
219 This only affects the `mono' binary, the shared
220 library libmono.so will always be produced for
221 developers that want to embed the runtime in their
224 --with-xen-opt=yes,no
226 The default value for this is `yes', and it makes Mono
227 generate code which might be slightly slower on
228 average systems, but the resulting executable will run
229 faster under the Xen virtualization system.
231 --with-large-heap=yes,no
233 Enable support for GC heaps larger than 3GB.
235 This value is set to `no' by default.
237 --with-ikvm-native=yes,no
239 Controls whether the IKVM JNI interface library is
240 built or not. This is used if you are planning on
241 using the IKVM Java Virtual machine with Mono.
243 This defaults to `yes'.
245 --with-preview=yes,no
247 Whether you want to build libraries that are still not
248 completed (The 2.0 APIs). It defaults to `yes'.
250 --with-libgdiplus=installed,sibling,<path>
252 This is used to configure where should Mono look for
253 libgdiplus when running the System.Drawing tests.
255 It defaults to `installed', which means that the
256 library is available to Mono through the regular
259 `sibling' can be used to specify that a libgdiplus
260 that resides as a sibling of this directory (mono)
263 Or you can specify a path to a libgdiplus.
265 --enable-minimal=LIST
267 Use this feature to specify optional runtime
268 components that you might not want to include. This
269 is only useful for developers embedding Mono that
270 require a subset of Mono functionality.
272 The list is a comma-separated list of components that
273 should be removed, these are:
276 Disables support for the Ahead of Time
280 Disables support for the default profiler.
283 Disables support for System.Decimal.
286 Support for Platform Invocation services,
287 disabling this will drop support for any
288 libraries using DllImport.
291 Drop debugging support.
294 Drop System.Reflection.Emit support
297 Disables support for large assemblies.
300 Disables support for debug logging.
303 Disables COM support.
306 Disables compilation for the SSA optimization
307 framework, and the various SSA-based
311 Generics support. Disabling this will not
312 allow Mono to run any 2.0 libraries or
313 code that contains generics.
317 Mono uses /dev/random to obtain good random data for
318 any source that requires random numbers. If your
319 system does not support this, you might want to
322 There are a number of runtime options to control this
323 also, see the man page.
329 Once you have installed the software, you can run a few programs:
343 See the man pages for mono(1), mint(1), monodis(1) and mcs(2)
350 Technical documents about the Mono runtime.
353 Configuration files installed as part of the Mono runtime.
356 The core of the Mono Runtime.
359 The object system and metadata reader.
362 The Just in Time Compiler.
365 CIL executable Disassembler
368 Common code for the JIT and the interpreter.
371 The I/O layer and system abstraction for
372 emulating the .NET IO model.
375 Common Intermediate Representation, XML
376 definition of the CIL bytecodes.
379 Interpreter for CLI executables (obsolete).
382 Architecture specific portions.
386 Manual pages for the various Mono commands and programs.
390 Scripts used to invoke Mono and the corresponding program.
394 A directory that contains the Makefiles that link the
395 mono/ and mcs/ build systems.