README 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  1. This is Mono.
  2. 1. Installation
  3. 2. Using Mono
  4. 3. Directory Roadmap
  5. 1. Compilation and Installation
  6. ===============================
  7. a. Build Requirements
  8. ---------------------
  9. To build Mono, you will need the following components:
  10. * pkg-config
  11. Available from: http://www.freedesktop.org/Software/pkgconfig
  12. * glib 2.4
  13. Available from: http://www.gtk.org/
  14. On Itanium, you must obtain libunwind:
  15. http://www.hpl.hp.com/research/linux/libunwind/download.php4
  16. On Solaris, make sure that you used GNU tar to unpack this package, as
  17. Solaris tar will not unpack this correctly, and you will get strange errors.
  18. On Solaris, make sure that you use the GNU toolchain to build the software.
  19. Optional dependencies:
  20. * libgdiplus
  21. If you want to get support for System.Drawing, you will need to get
  22. Libgdiplus.
  23. * libzlib
  24. This library and the development headers are required for compression
  25. file support in the 2.0 profile.
  26. b. Building the Software
  27. ------------------------
  28. If you obtained this package as an officially released tarball,
  29. this is very simple, use configure and make:
  30. ./configure --prefix=/usr/local
  31. make
  32. make install
  33. Mono supports a JIT engine on x86, SPARC, SPARCv9, S/390,
  34. S/390x, AMD64, ARM and PowerPC systems.
  35. If you obtained this as a snapshot, you will need an existing
  36. Mono installation. To upgrade your installation, unpack both
  37. mono and mcs:
  38. tar xzf mcs-XXXX.tar.gz
  39. tar xzf mono-XXXX.tar.gz
  40. mv mono-XXX mono
  41. mv mcs-XXX mcs
  42. cd mono
  43. ./autogen.sh --prefix=/usr/local
  44. make
  45. c. Building the software from SVN
  46. ---------------------------------
  47. If you are building the software from SVN, make sure that you
  48. have up-to-date mcs and mono sources:
  49. svn co svn+ssh://[email protected]/source/trunk/mono
  50. svn co svn+ssh://[email protected]/source/trunk/mcs
  51. Then, go into the mono directory, and configure:
  52. cd mono
  53. ./autogen.sh --prefix=/usr/local
  54. make
  55. For people with non-standard installations of the auto* utils and of
  56. pkg-config (common on misconfigured OSX and windows boxes), you could get
  57. an error like this:
  58. ./configure: line 19176: syntax error near unexpected token `PKG_CHECK_MODULES(BASE_DEPENDENCIES,' ...
  59. This means that you need to set the ACLOCAL_FLAGS environment var
  60. when invoking autogen.sh, like this:
  61. ACLOCAL_FLAGS="-I $acprefix/share/aclocal" ./autogen.sh --prefix=/usr/loca
  62. where $acprefix is the prefix where aclocal has been installed.
  63. This will automatically go into the mcs/ tree and build the
  64. binaries there.
  65. This assumes that you have a working mono installation, and that
  66. there's a C# compiler named 'mcs', and a corresponding IL
  67. runtime called 'mono'. You can use two make variables
  68. EXTERNAL_MCS and EXTERNAL_RUNTIME to override these. e.g., you
  69. can say
  70. make EXTERNAL_MCS=/foo/bar/mcs EXTERNAL_RUNTIME=/somewhere/else/mono
  71. If you don't have a working Mono installation
  72. ---------------------------------------------
  73. If you don't have a working Mono installation, an obvious choice
  74. is to install the latest released packages of 'mono' for your
  75. distribution and running autogen.sh; make; make install in the
  76. mono module directory.
  77. You can also try a slightly more risky approach: this may not work,
  78. so start from the released tarball as detailed above.
  79. This works by first getting the latest version of the 'monolite'
  80. distribution, which contains just enough to run the 'mcs'
  81. compiler. You do this with:
  82. make get-monolite-latest
  83. This will download and automatically gunzip and untar the
  84. tarball, and place the files appropriately so that you can then
  85. just run:
  86. make
  87. To ensure that you're using the 'monolite' distribution, you can
  88. also try passing EXTERNAL_MCS=false on the make command-line.
  89. Testing and Installation
  90. ------------------------
  91. You can run (part of) the mono and mcs testsuites with the command:
  92. make check
  93. All tests should pass.
  94. If you want more extensive tests, including those that test the
  95. class libraries, you need to re-run 'configure' with the
  96. '--enable-nunit-tests' flag, and try
  97. make -k check
  98. Expect to find a few testsuite failures. As a sanity check, you
  99. can compare the failures you got with
  100. http://go-mono.com/tests/displayTestResults.php
  101. You can now install mono with:
  102. make install
  103. Failure to follow these steps may result in a broken installation.
  104. d. Common Configuration Options
  105. -------------------------------
  106. The following are the configuration options that someone
  107. building Mono might want to use:
  108. --with-gc=[boehm, included, sgen, none]
  109. Selects the garbage collector engine to use, the
  110. default is the "included" value.
  111. included:
  112. This is the default value, and its
  113. the most feature complete, it will allow Mono
  114. to use typed allocations and support the
  115. debugger.
  116. It is essentially a slightly modified Boehm GC
  117. boehm:
  118. This is used to use a system-install Boehm GC,
  119. it is useful to test new features available in
  120. Boehm GC, but we do not recommend that people
  121. use this, as it disables a few features.
  122. sgen:
  123. The under-development Generational GC for
  124. Mono, do not use this in production.
  125. none:
  126. Disables the inclusion of a garbage
  127. collector.
  128. --with-tls=__thread,pthread
  129. Controls how Mono should access thread local storage,
  130. pthread forces Mono to use the pthread APIs, while
  131. __thread uses compiler-optimized access to it.
  132. Although __thread is faster, it requires support from
  133. the compiler, kernel and libc. Old Linux systems do
  134. not support with __thread.
  135. This value is typically pre-configured and there is no
  136. need to set it, unless you are trying to debug a
  137. problem.
  138. --with-sigaltstack=yes,no
  139. Experimental: Use at your own risk, it is known to
  140. cause problems with garbage collection and is hard to
  141. reproduce those bugs.
  142. This controls whether Mono will install a special
  143. signal handler to handle stack overflows. If set to
  144. "yes", it will turn stack overflows into the
  145. StackOverflowException. Otherwise when a stack
  146. overflow happens, your program will receive a
  147. segmentation fault.
  148. The configure script will try to detect if your
  149. operating system supports this. Some older Linux
  150. systems do not support this feature, or you might want
  151. to override the auto-detection.
  152. --with-static-mono=yes,no
  153. This controls whether `mono' should link against a
  154. static library (libmono.a) or a shared library
  155. (libmono.so).
  156. This defaults to yes, and will improve the performance
  157. of the `mono' program.
  158. This only affects the `mono' binary, the shared
  159. library libmono.so will always be produced for
  160. developers that want to embed the runtime in their
  161. application.
  162. --with-xen-opt=yes,no
  163. The default value for this is `yes', and it makes Mono
  164. generate code which might be slightly slower on
  165. average systems, but the resulting executable will run
  166. faster under the Xen virtualization system.
  167. --with-large-heap=yes,no
  168. Enable support for GC heaps larger than 3GB.
  169. This value is set to `no' by default.
  170. --with-ikvm-native=yes,no
  171. Controls whether the IKVM JNI interface library is
  172. built or not. This is used if you are planning on
  173. using the IKVM Java Virtual machine with Mono.
  174. This defaults to `yes'.
  175. --with-preview=yes,no
  176. Whether you want to build libraries that are still not
  177. completed (The 2.0 APIs). It defaults to `yes'.
  178. --with-moonlight=yes,no
  179. Whether you want to generate the Silverlight/Moonlight
  180. libraries and toolchain in addition to the default
  181. (1.1 and 2.0 APIs).
  182. This will produce the `smcs' compiler which will reference
  183. the Silvelright modified assemblies (mscorlib.dll,
  184. System.dll, System.Code.dll and System.Xml.Core.dll) and turn
  185. on the LINQ extensions for the compiler.
  186. This option defaults to `no' and it is considered pre-alpha.
  187. --with-libgdiplus=installed,sibling,<path>
  188. This is used to configure where should Mono look for
  189. libgdiplus when running the System.Drawing tests.
  190. It defaults to `installed', which means that the
  191. library is available to Mono through the regular
  192. system setup.
  193. `sibling' can be used to specify that a libgdiplus
  194. that resides as a sibling of this directory (mono)
  195. should be used.
  196. Or you can specify a path to a libgdiplus.
  197. --disable-shared-memory
  198. Use this option to disable the use of shared memory in
  199. Mono (this is equivalent to setting the MONO_DISABLE_SHM
  200. environment variable, although this removes the feature
  201. completely).
  202. Disabling the shared memory support will disable certain
  203. features like cross-process named mutexes.
  204. --enable-minimal=LIST
  205. Use this feature to specify optional runtime
  206. components that you might not want to include. This
  207. is only useful for developers embedding Mono that
  208. require a subset of Mono functionality.
  209. The list is a comma-separated list of components that
  210. should be removed, these are:
  211. aot:
  212. Disables support for the Ahead of Time
  213. compilation.
  214. profiler:
  215. Disables support for the default profiler.
  216. decimal:
  217. Disables support for System.Decimal.
  218. pinvoke:
  219. Support for Platform Invocation services,
  220. disabling this will drop support for any
  221. libraries using DllImport.
  222. debug:
  223. Drop debugging support.
  224. reflection_emit:
  225. Drop System.Reflection.Emit support
  226. large_code:
  227. Disables support for large assemblies.
  228. logging:
  229. Disables support for debug logging.
  230. com:
  231. Disables COM support.
  232. ssa:
  233. Disables compilation for the SSA optimization
  234. framework, and the various SSA-based
  235. optimizations.
  236. generics:
  237. Generics support. Disabling this will not
  238. allow Mono to run any 2.0 libraries or
  239. code that contains generics.
  240. --disable-dev-random
  241. Mono uses /dev/random to obtain good random data for
  242. any source that requires random numbers. If your
  243. system does not support this, you might want to
  244. disable it.
  245. There are a number of runtime options to control this
  246. also, see the man page.
  247. 2. Using Mono
  248. =============
  249. Once you have installed the software, you can run a few programs:
  250. * runtime engine
  251. mono program.exe
  252. * C# compiler
  253. mcs program.cs
  254. * CIL Disassembler
  255. monodis program.exe
  256. See the man pages for mono(1), mint(1), monodis(1) and mcs(2)
  257. for further details.
  258. 3. Directory Roadmap
  259. ====================
  260. docs/
  261. Technical documents about the Mono runtime.
  262. data/
  263. Configuration files installed as part of the Mono runtime.
  264. mono/
  265. The core of the Mono Runtime.
  266. metadata/
  267. The object system and metadata reader.
  268. mini/
  269. The Just in Time Compiler.
  270. dis/
  271. CIL executable Disassembler
  272. cli/
  273. Common code for the JIT and the interpreter.
  274. io-layer/
  275. The I/O layer and system abstraction for
  276. emulating the .NET IO model.
  277. cil/
  278. Common Intermediate Representation, XML
  279. definition of the CIL bytecodes.
  280. interp/
  281. Interpreter for CLI executables (obsolete).
  282. arch/
  283. Architecture specific portions.
  284. man/
  285. Manual pages for the various Mono commands and programs.
  286. samples/
  287. Some simple sample programs on uses of the Mono
  288. runtime as an embedded library.
  289. scripts/
  290. Scripts used to invoke Mono and the corresponding program.
  291. runtime/
  292. A directory that contains the Makefiles that link the
  293. mono/ and mcs/ build systems.
  294. ../olive/
  295. If the directory ../olive is present (as an
  296. independent checkout) from the Mono module, that
  297. directory is automatically configured to share the
  298. same prefix than this module gets.