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
40 b. Building the Software
41 ------------------------
43 If you obtained this package as an officially released tarball,
44 this is very simple, use configure and make:
46 ./configure --prefix=/usr/local
50 Mono supports a JIT engine on x86, SPARC, SPARCv9, S/390, AMD64, ARM
53 If you obtained this as a snapshot, you will need an existing
54 Mono installation. To upgrade your installation, unpack both
57 tar xzf mcs-XXXX.tar.gz
58 tar xzf mono-XXXX.tar.gz
62 ./autogen.sh --prefix=/usr/local
65 c. Building the software from SVN
66 ---------------------------------
68 If you are building the software from SVN, make sure that you
69 have up-to-date mcs and mono sources:
71 svn co svn+ssh://USER@mono-cvs.ximian.com/source/trunk/mono
72 svn co svn+ssh://USER@mono-cvs.ximian.com/source/trunk/mcs
74 Then, go into the mono directory, and configure:
77 ./autogen.sh --prefix=/usr/local
80 This will automatically go into the mcs/ tree and build the
83 This assumes that you have a working mono installation, and that
84 there's a C# compiler named 'mcs', and a corresponding IL
85 runtime called 'mono'. You can use two make variables
86 EXTERNAL_MCS and EXTERNAL_RUNTIME to override these. e.g., you
89 make EXTERNAL_MCS=/foo/bar/mcs EXTERNAL_RUNTIME=/somewhere/else/mono
91 If you don't have a working Mono installation
92 ---------------------------------------------
94 If you don't have a working Mono installation, an obvious choice
95 is to install the latest released packages of 'mono' for your
96 distribution and running autogen.sh; make; make install in the
97 mono module directory.
99 You can also try a slightly more risky approach: this may not work,
100 so start from the released tarball as detailed above.
102 This works by first getting the latest version of the 'monolite'
103 distribution, which contains just enough to run the 'mcs'
104 compiler. You do this with:
106 make get-monolite-latest
108 This will download and automatically gunzip and untar the
109 tarball, and place the files appropriately so that you can then
114 To ensure that you're using the 'monolite' distribution, you can
115 also try passing EXTERNAL_MCS=false on the make command-line.
117 Testing and Installation
118 ------------------------
120 You can run (part of) the mono and mcs testsuites with the command:
124 All tests should pass.
126 If you want more extensive tests, including those that test the
127 class libraries, you need to re-run 'configure' with the
128 '--enable-nunit-tests' flag, and try
132 Expect to find a few testsuite failures. As a sanity check, you
133 can compare the failures you got with
135 http://go-mono.com/tests/displayTestResults.php
137 You can now install mono with:
141 Failure to follow these steps may result in a broken installation.
143 d. Common Configuration Options
144 -------------------------------
146 The following are the configuration options that someone
147 building Mono might want to use:
150 --with-gc=[boehm, included, sgen, none]
152 Selects the garbage collector engine to use, the
153 default is the "included" value.
156 This is the default value, and its
157 the most feature complete, it will allow Mono
158 to use typed allocations and support the
161 It is essentially a slightly modified Boehm GC
164 This is used to use a system-install Boehm GC,
165 it is useful to test new features available in
166 Boehm GC, but we do not recommend that people
167 use this, as it disables a few features.
170 The under-development Generational GC for
171 Mono, do not use this in production.
174 Disables the inclusion of a garbage
177 --with-tls=__thread,pthread
179 Controls how Mono should access thread local storage,
180 pthread forces Mono to use the pthread APIs, while
181 __thread uses compiler-optimized access to it.
183 Although __thread is faster, it requires support from
184 the compiler, kernel and libc. Old Linux systems do
185 not support with __thread.
187 This value is typically pre-configured and there is no
188 need to set it, unless you are trying to debug a
191 --with-sigaltstack=yes,no
193 This controls whether Mono will install a special
194 signal handler to handle stack overflows. If set to
195 "yes", it will turn stack overflows into the
196 StackOverflowException. Otherwise when a stack
197 overflow happens, your program will receive a
200 The configure script will try to detect if your
201 operating system supports this. Some older Linux
202 systems do not support this feature, or you might want
203 to override the auto-detection.
205 --with-static-mono=yes,no
207 This controls whether `mono' should link against a
208 static library (libmono.a) or a shared library
211 This defaults to yes, and will improve the performance
212 of the `mono' program.
214 This only affects the `mono' binary, the shared
215 library libmono.so will always be produced for
216 developers that want to embed the runtime in their
219 --with-xen-opt=yes,no
221 The default value for this is `yes', and it makes Mono
222 generate code which might be slightly slower on
223 average systems, but the resulting executable will run
224 faster under the Xen virtualization system.
226 --with-large-heap=yes,no
228 Enable support for GC heaps larger than 3GB.
230 This value is set to `no' by default.
232 --with-ikvm-native=yes,no
234 Controls whether the IKVM JNI interface library is
235 built or not. This is used if you are planning on
236 using the IKVM Java Virtual machine with Mono.
238 This defaults to `yes'.
240 --with-preview=yes,no
242 Whether you want to build libraries that are still not
243 completed (The 2.0 APIs). It defaults to `yes'.
245 --with-libgdiplus=installed,sibling,<path>
247 This is used to configure where should Mono look for
248 libgdiplus when running the System.Drawing tests.
250 It defaults to `installed', which means that the
251 library is available to Mono through the regular
254 `sibling' can be used to specify that a libgdiplus
255 that resides as a sibling of this directory (mono)
258 Or you can specify a path to a libgdiplus.
260 --enable-minimal=LIST
262 Use this feature to specify optional runtime
263 components that you might not want to include. This
264 is only useful for developers embedding Mono that
265 require a subset of Mono functionality.
267 The list is a comma-separated list of components that
268 should be removed, these are:
271 Disables support for the Ahead of Time
275 Disables support for the default profiler.
278 Disables support for System.Decimal.
281 Support for Platform Invocation services,
282 disabling this will drop support for any
283 libraries using DllImport.
286 Drop debugging support.
289 Drop System.Reflection.Emit support
292 Disables support for large assemblies.
295 Disables support for debug logging.
298 Disables COM support.
301 Disables compilation for the SSA optimization
302 framework, and the various SSA-based
306 Generics support. Disabling this will not
307 allow Mono to run any 2.0 libraries or
308 code that contains generics.
312 Mono uses /dev/random to obtain good random data for
313 any source that requires random numbers. If your
314 system does not support this, you might want to
317 There are a number of runtime options to control this
318 also, see the man page.
324 Once you have installed the software, you can run a few programs:
338 See the man pages for mono(1), mint(1), monodis(1) and mcs(2)
345 Technical documents about the Mono runtime.
348 Configuration files installed as part of the Mono runtime.
351 The core of the Mono Runtime.
354 The object system and metadata reader.
357 The Just in Time Compiler.
360 CIL executable Disassembler
363 Common code for the JIT and the interpreter.
366 The I/O layer and system abstraction for
367 emulating the .NET IO model.
370 Common Intermediate Representation, XML
371 definition of the CIL bytecodes.
374 Interpreter for CLI executables (obsolete).
377 Architecture specific portions.
381 Manual pages for the various Mono commands and programs.
385 Scripts used to invoke Mono and the corresponding program.
389 A directory that contains the Makefiles that link the
390 mono/ and mcs/ build systems.