README 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  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, AMD64, ARM
  34. 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. This will automatically go into the mcs/ tree and build the
  56. binaries there.
  57. This assumes that you have a working mono installation, and that
  58. there's a C# compiler named 'mcs', and a corresponding IL
  59. runtime called 'mono'. You can use two make variables
  60. EXTERNAL_MCS and EXTERNAL_RUNTIME to override these. e.g., you
  61. can say
  62. make EXTERNAL_MCS=/foo/bar/mcs EXTERNAL_RUNTIME=/somewhere/else/mono
  63. If you don't have a working Mono installation
  64. ---------------------------------------------
  65. If you don't have a working Mono installation, an obvious choice
  66. is to install the latest released packages of 'mono' for your
  67. distribution and running autogen.sh; make; make install in the
  68. mono module directory.
  69. You can also try a slightly more risky approach: this may not work,
  70. so start from the released tarball as detailed above.
  71. This works by first getting the latest version of the 'monolite'
  72. distribution, which contains just enough to run the 'mcs'
  73. compiler. You do this with:
  74. make get-monolite-latest
  75. This will download and automatically gunzip and untar the
  76. tarball, and place the files appropriately so that you can then
  77. just run:
  78. make
  79. To ensure that you're using the 'monolite' distribution, you can
  80. also try passing EXTERNAL_MCS=false on the make command-line.
  81. Testing and Installation
  82. ------------------------
  83. You can run (part of) the mono and mcs testsuites with the command:
  84. make check
  85. All tests should pass.
  86. If you want more extensive tests, including those that test the
  87. class libraries, you need to re-run 'configure' with the
  88. '--enable-nunit-tests' flag, and try
  89. make -k check
  90. Expect to find a few testsuite failures. As a sanity check, you
  91. can compare the failures you got with
  92. http://go-mono.com/tests/displayTestResults.php
  93. You can now install mono with:
  94. make install
  95. Failure to follow these steps may result in a broken installation.
  96. d. Common Configuration Options
  97. -------------------------------
  98. The following are the configuration options that someone
  99. building Mono might want to use:
  100. --with-gc=[boehm, included, sgen, none]
  101. Selects the garbage collector engine to use, the
  102. default is the "included" value.
  103. included:
  104. This is the default value, and its
  105. the most feature complete, it will allow Mono
  106. to use typed allocations and support the
  107. debugger.
  108. It is essentially a slightly modified Boehm GC
  109. boehm:
  110. This is used to use a system-install Boehm GC,
  111. it is useful to test new features available in
  112. Boehm GC, but we do not recommend that people
  113. use this, as it disables a few features.
  114. sgen:
  115. The under-development Generational GC for
  116. Mono, do not use this in production.
  117. none:
  118. Disables the inclusion of a garbage
  119. collector.
  120. --with-tls=__thread,pthread
  121. Controls how Mono should access thread local storage,
  122. pthread forces Mono to use the pthread APIs, while
  123. __thread uses compiler-optimized access to it.
  124. Although __thread is faster, it requires support from
  125. the compiler, kernel and libc. Old Linux systems do
  126. not support with __thread.
  127. This value is typically pre-configured and there is no
  128. need to set it, unless you are trying to debug a
  129. problem.
  130. --with-sigaltstack=yes,no
  131. This controls whether Mono will install a special
  132. signal handler to handle stack overflows. If set to
  133. "yes", it will turn stack overflows into the
  134. StackOverflowException. Otherwise when a stack
  135. overflow happens, your program will receive a
  136. segmentation fault.
  137. The configure script will try to detect if your
  138. operating system supports this. Some older Linux
  139. systems do not support this feature, or you might want
  140. to override the auto-detection.
  141. --with-static-mono=yes,no
  142. This controls whether `mono' should link against a
  143. static library (libmono.a) or a shared library
  144. (libmono.so).
  145. This defaults to yes, and will improve the performance
  146. of the `mono' program.
  147. This only affects the `mono' binary, the shared
  148. library libmono.so will always be produced for
  149. developers that want to embed the runtime in their
  150. application.
  151. --with-xen-opt=yes,no
  152. The default value for this is `yes', and it makes Mono
  153. generate code which might be slightly slower on
  154. average systems, but the resulting executable will run
  155. faster under the Xen virtualization system.
  156. --with-large-heap=yes,no
  157. Enable support for GC heaps larger than 3GB.
  158. This value is set to `no' by default.
  159. --with-ikvm-native=yes,no
  160. Controls whether the IKVM JNI interface library is
  161. built or not. This is used if you are planning on
  162. using the IKVM Java Virtual machine with Mono.
  163. This defaults to `yes'.
  164. --with-preview=yes,no
  165. Whether you want to build libraries that are still not
  166. completed (The 2.0 APIs). It defaults to `yes'.
  167. --with-libgdiplus=installed,sibling,<path>
  168. This is used to configure where should Mono look for
  169. libgdiplus when running the System.Drawing tests.
  170. It defaults to `installed', which means that the
  171. library is available to Mono through the regular
  172. system setup.
  173. `sibling' can be used to specify that a libgdiplus
  174. that resides as a sibling of this directory (mono)
  175. should be used.
  176. Or you can specify a path to a libgdiplus.
  177. --enable-minimal=LIST
  178. Use this feature to specify optional runtime
  179. components that you might not want to include. This
  180. is only useful for developers embedding Mono that
  181. require a subset of Mono functionality.
  182. The list is a comma-separated list of components that
  183. should be removed, these are:
  184. aot:
  185. Disables support for the Ahead of Time
  186. compilation.
  187. profiler:
  188. Disables support for the default profiler.
  189. decimal:
  190. Disables support for System.Decimal.
  191. pinvoke:
  192. Support for Platform Invocation services,
  193. disabling this will drop support for any
  194. libraries using DllImport.
  195. debug:
  196. Drop debugging support.
  197. reflection_emit:
  198. Drop System.Reflection.Emit support
  199. large_code:
  200. Disables support for large assemblies.
  201. logging:
  202. Disables support for debug logging.
  203. com:
  204. Disables COM support.
  205. ssa:
  206. Disables compilation for the SSA optimization
  207. framework, and the various SSA-based
  208. optimizations.
  209. generics:
  210. Generics support. Disabling this will not
  211. allow Mono to run any 2.0 libraries or
  212. code that contains generics.
  213. --disable-dev-random
  214. Mono uses /dev/random to obtain good random data for
  215. any source that requires random numbers. If your
  216. system does not support this, you might want to
  217. disable it.
  218. There are a number of runtime options to control this
  219. also, see the man page.
  220. 2. Using Mono
  221. =============
  222. Once you have installed the software, you can run a few programs:
  223. * runtime engine
  224. mono program.exe
  225. * C# compiler
  226. mcs program.cs
  227. * CIL Disassembler
  228. monodis program.exe
  229. See the man pages for mono(1), mint(1), monodis(1) and mcs(2)
  230. for further details.
  231. 3. Directory Roadmap
  232. ====================
  233. docs/
  234. Technical documents about the Mono runtime.
  235. data/
  236. Configuration files installed as part of the Mono runtime.
  237. mono/
  238. The core of the Mono Runtime.
  239. metadata/
  240. The object system and metadata reader.
  241. mini/
  242. The Just in Time Compiler.
  243. dis/
  244. CIL executable Disassembler
  245. cli/
  246. Common code for the JIT and the interpreter.
  247. io-layer/
  248. The I/O layer and system abstraction for
  249. emulating the .NET IO model.
  250. cil/
  251. Common Intermediate Representation, XML
  252. definition of the CIL bytecodes.
  253. interp/
  254. Interpreter for CLI executables (obsolete).
  255. arch/
  256. Architecture specific portions.
  257. man/
  258. Manual pages for the various Mono commands and programs.
  259. scripts/
  260. Scripts used to invoke Mono and the corresponding program.
  261. runtime/
  262. A directory that contains the Makefiles that link the
  263. mono/ and mcs/ build systems.