README 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  1. This is Mono.
  2. 1. Installation
  3. 2. Using Mono
  4. 3. Directory Roadmap
  5. 4. git submodules maintenance
  6. 1. Compilation and Installation
  7. ===============================
  8. a. Build Requirements
  9. ---------------------
  10. On Itanium, you must obtain libunwind:
  11. http://www.hpl.hp.com/research/linux/libunwind/download.php4
  12. On Solaris, make sure that you used GNU tar to unpack this package, as
  13. Solaris tar will not unpack this correctly, and you will get strange errors.
  14. On Solaris, make sure that you use the GNU toolchain to build the software.
  15. Optional dependencies:
  16. * libgdiplus
  17. If you want to get support for System.Drawing, you will need to get
  18. Libgdiplus. This library in turn requires glib and pkg-config:
  19. * pkg-config
  20. Available from: http://www.freedesktop.org/Software/pkgconfig
  21. * glib 2.4
  22. Available from: http://www.gtk.org/
  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. The Mono build system is silent for most compilation commands.
  46. To enable a more verbose compile (for example, to pinpoint
  47. problems in your makefiles or your system) pass the V=1 flag to make, like this:
  48. make V=1
  49. c. Building the software from GIT
  50. ---------------------------------
  51. If you are building the software from GIT, make sure that you
  52. have up-to-date mcs and mono sources:
  53. If you are an anonymous user:
  54. git clone git://github.com/mono/mono.git
  55. If you are a Mono contributors with read/write privileges:
  56. git clone [email protected]:mono/mono.git
  57. Then, go into the mono directory, and configure:
  58. cd mono
  59. ./autogen.sh --prefix=/usr/local
  60. make
  61. For people with non-standard installations of the auto* utils and of
  62. pkg-config (common on misconfigured OSX and windows boxes), you could get
  63. an error like this:
  64. ./configure: line 19176: syntax error near unexpected token `PKG_CHECK_MODULES(BASE_DEPENDENCIES,' ...
  65. This means that you need to set the ACLOCAL_FLAGS environment var
  66. when invoking autogen.sh, like this:
  67. ACLOCAL_FLAGS="-I $acprefix/share/aclocal" ./autogen.sh --prefix=/usr/loca
  68. where $acprefix is the prefix where aclocal has been installed.
  69. This will automatically go into the mcs/ tree and build the
  70. binaries there.
  71. This assumes that you have a working mono installation, and that
  72. there's a C# compiler named 'mcs', and a corresponding IL
  73. runtime called 'mono'. You can use two make variables
  74. EXTERNAL_MCS and EXTERNAL_RUNTIME to override these. e.g., you
  75. can say
  76. make EXTERNAL_MCS=/foo/bar/mcs EXTERNAL_RUNTIME=/somewhere/else/mono
  77. If you don't have a working Mono installation
  78. ---------------------------------------------
  79. If you don't have a working Mono installation, an obvious choice
  80. is to install the latest released packages of 'mono' for your
  81. distribution and running autogen.sh; make; make install in the
  82. mono module directory.
  83. You can also try a slightly more risky approach: this may not work,
  84. so start from the released tarball as detailed above.
  85. This works by first getting the latest version of the 'monolite'
  86. distribution, which contains just enough to run the 'mcs'
  87. compiler. You do this with:
  88. # Run the following line after ./autogen.sh
  89. make get-monolite-latest
  90. This will download and automatically gunzip and untar the
  91. tarball, and place the files appropriately so that you can then
  92. just run:
  93. make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/gmcs.exe
  94. And that will use the files downloaded by 'make get-monolite-latest.
  95. Testing and Installation
  96. ------------------------
  97. You can run (part of) the mono and mcs testsuites with the command:
  98. make check
  99. All tests should pass.
  100. If you want more extensive tests, including those that test the
  101. class libraries, you need to re-run 'configure' with the
  102. '--enable-nunit-tests' flag, and try
  103. make -k check
  104. Expect to find a few testsuite failures. As a sanity check, you
  105. can compare the failures you got with
  106. https://wrench.mono-project.com/Wrench/
  107. You can now install mono with:
  108. make install
  109. You can verify your installation by using the mono-test-install
  110. script, it can diagnose some common problems with Mono's install.
  111. Failure to follow these steps may result in a broken installation.
  112. d. Configuration Options
  113. ------------------------
  114. The following are the configuration options that someone
  115. building Mono might want to use:
  116. --with-sgen=yes,no
  117. Generational GC support: Used to enable or disable the
  118. compilation of a Mono runtime with the SGen garbage collector.
  119. On platforms that support it, after building Mono, you
  120. will have both a mono binary and a mono-sgen binary.
  121. Mono uses Boehm, while mono-sgen uses the Simple
  122. Generational GC.
  123. --with-gc=[boehm, included, sgen, none]
  124. Selects the default Boehm garbage collector engine to
  125. use, the default is the "included" value.
  126. included:
  127. This is the default value, and its
  128. the most feature complete, it will allow Mono
  129. to use typed allocations and support the
  130. debugger.
  131. It is essentially a slightly modified Boehm GC
  132. boehm:
  133. This is used to use a system-install Boehm GC,
  134. it is useful to test new features available in
  135. Boehm GC, but we do not recommend that people
  136. use this, as it disables a few features.
  137. none:
  138. Disables the inclusion of a garbage
  139. collector.
  140. --with-tls=__thread,pthread
  141. Controls how Mono should access thread local storage,
  142. pthread forces Mono to use the pthread APIs, while
  143. __thread uses compiler-optimized access to it.
  144. Although __thread is faster, it requires support from
  145. the compiler, kernel and libc. Old Linux systems do
  146. not support with __thread.
  147. This value is typically pre-configured and there is no
  148. need to set it, unless you are trying to debug a
  149. problem.
  150. --with-sigaltstack=yes,no
  151. Experimental: Use at your own risk, it is known to
  152. cause problems with garbage collection and is hard to
  153. reproduce those bugs.
  154. This controls whether Mono will install a special
  155. signal handler to handle stack overflows. If set to
  156. "yes", it will turn stack overflows into the
  157. StackOverflowException. Otherwise when a stack
  158. overflow happens, your program will receive a
  159. segmentation fault.
  160. The configure script will try to detect if your
  161. operating system supports this. Some older Linux
  162. systems do not support this feature, or you might want
  163. to override the auto-detection.
  164. --with-static_mono=yes,no
  165. This controls whether `mono' should link against a
  166. static library (libmono.a) or a shared library
  167. (libmono.so).
  168. This defaults to yes, and will improve the performance
  169. of the `mono' program.
  170. This only affects the `mono' binary, the shared
  171. library libmono.so will always be produced for
  172. developers that want to embed the runtime in their
  173. application.
  174. --with-xen-opt=yes,no
  175. The default value for this is `yes', and it makes Mono
  176. generate code which might be slightly slower on
  177. average systems, but the resulting executable will run
  178. faster under the Xen virtualization system.
  179. --with-large-heap=yes,no
  180. Enable support for GC heaps larger than 3GB.
  181. This value is set to `no' by default.
  182. --enable-small-config=yes,no
  183. Enable some tweaks to reduce memory usage and disk footprint at
  184. the expense of some capabilities. Typically this means that the
  185. number of threads that can be created is limited (256), that the
  186. maxmimum heap size is also reduced (256 MB) and other such limitations
  187. that still make mono useful, but more suitable to embedded devices
  188. (like mobile phones).
  189. This value is set to `no' by default.
  190. --with-ikvm-native=yes,no
  191. Controls whether the IKVM JNI interface library is
  192. built or not. This is used if you are planning on
  193. using the IKVM Java Virtual machine with Mono.
  194. This defaults to `yes'.
  195. --with-profile4=yes,no
  196. Whether you want to build the 4.x profile libraries
  197. and runtime.
  198. It defaults to `yes'.
  199. --with-moonlight=yes,no
  200. Whether you want to generate the Silverlight/Moonlight
  201. libraries and toolchain in addition to the default
  202. (1.1 and 2.0 APIs).
  203. This will produce the `smcs' compiler which will reference
  204. the Silverlight modified assemblies (mscorlib.dll,
  205. System.dll, System.Code.dll and System.Xml.Core.dll) and turn
  206. on the LINQ extensions for the compiler.
  207. --with-moon-gc=boehm,sgen
  208. Select the GC to use for Moonlight.
  209. boehm:
  210. Selects the Boehm Garbage Collector, with the same flags
  211. as the regular Mono build. This is the default.
  212. sgen:
  213. Selects the new SGen Garbage Collector, which provides
  214. Generational GC support, using the same flags as the
  215. mono-sgen build.
  216. This defaults to `boehm'.
  217. --with-libgdiplus=installed,sibling,<path>
  218. This is used to configure where should Mono look for
  219. libgdiplus when running the System.Drawing tests.
  220. It defaults to `installed', which means that the
  221. library is available to Mono through the regular
  222. system setup.
  223. `sibling' can be used to specify that a libgdiplus
  224. that resides as a sibling of this directory (mono)
  225. should be used.
  226. Or you can specify a path to a libgdiplus.
  227. --disable-shared-memory
  228. Use this option to disable the use of shared memory in
  229. Mono (this is equivalent to setting the MONO_DISABLE_SHM
  230. environment variable, although this removes the feature
  231. completely).
  232. Disabling the shared memory support will disable certain
  233. features like cross-process named mutexes.
  234. --enable-minimal=LIST
  235. Use this feature to specify optional runtime
  236. components that you might not want to include. This
  237. is only useful for developers embedding Mono that
  238. require a subset of Mono functionality.
  239. The list is a comma-separated list of components that
  240. should be removed, these are:
  241. aot:
  242. Disables support for the Ahead of Time
  243. compilation.
  244. attach:
  245. Support for the Mono.Management assembly and the
  246. VMAttach API (allowing code to be injected into
  247. a target VM)
  248. com:
  249. Disables COM support.
  250. debug:
  251. Drop debugging support.
  252. decimal:
  253. Disables support for System.Decimal.
  254. full_messages:
  255. By default Mono comes with a full table
  256. of messages for error codes. This feature
  257. turns off uncommon error messages and reduces
  258. the runtime size.
  259. generics:
  260. Generics support. Disabling this will not
  261. allow Mono to run any 2.0 libraries or
  262. code that contains generics.
  263. jit:
  264. Removes the JIT engine from the build, this reduces
  265. the executable size, and requires that all code
  266. executed by the virtual machine be compiled with
  267. Full AOT before execution.
  268. large_code:
  269. Disables support for large assemblies.
  270. logging:
  271. Disables support for debug logging.
  272. pinvoke:
  273. Support for Platform Invocation services,
  274. disabling this will drop support for any
  275. libraries using DllImport.
  276. portability:
  277. Removes support for MONO_IOMAP, the environment
  278. variables for simplifying porting applications that
  279. are case-insensitive and that mix the Unix and Windows path separators.
  280. profiler:
  281. Disables support for the default profiler.
  282. reflection_emit:
  283. Drop System.Reflection.Emit support
  284. reflection_emit_save:
  285. Drop support for saving dynamically created
  286. assemblies (AssemblyBuilderAccess.Save) in
  287. System.Reflection.Emit.
  288. shadow_copy:
  289. Disables support for AppDomain's shadow copies
  290. (you can disable this if you do not plan on
  291. using appdomains).
  292. simd:
  293. Disables support for the Mono.SIMD intrinsics
  294. library.
  295. ssa:
  296. Disables compilation for the SSA optimization
  297. framework, and the various SSA-based
  298. optimizations.
  299. --enable-llvm
  300. --enable-loadedllvm
  301. This enables the use of LLVM as a code generation engine
  302. for Mono. The LLVM code generator and optimizer will be
  303. used instead of Mono's built-in code generator for both
  304. Just in Time and Ahead of Time compilations.
  305. See the http://www.mono-project.com/Mono_LLVM for the
  306. full details and up-to-date information on this feature.
  307. You will need to have an LLVM built that Mono can link
  308. against,
  309. The --enable-loadedllvm variant will make the llvm backend
  310. into a runtime-loadable module instead of linking it directly
  311. into the main mono binary.
  312. --enable-big-arrays
  313. This enables the use arrays whose indexes are larger
  314. than Int32.MaxValue.
  315. By default Mono has the same limitation as .NET on
  316. Win32 and Win64 and limits array indexes to 32-bit
  317. values (even on 64-bit systems).
  318. In certain scenarios where large arrays are required,
  319. you can pass this flag and Mono will be built to
  320. support 64-bit arrays.
  321. This is not the default as it breaks the C embedding
  322. ABI that we have exposed through the Mono development
  323. cycle.
  324. --enable-parallel-mark
  325. Use this option to enable the garbage collector to use
  326. multiple CPUs to do its work. This helps performance
  327. on multi-CPU machines as the work is divided across CPUS.
  328. This option is not currently the default as we have
  329. not done much testing with Mono.
  330. --enable-dtrace
  331. On Solaris and MacOS X builds a version of the Mono
  332. runtime that contains DTrace probes and can
  333. participate in the system profiling using DTrace.
  334. --disable-dev-random
  335. Mono uses /dev/random to obtain good random data for
  336. any source that requires random numbers. If your
  337. system does not support this, you might want to
  338. disable it.
  339. There are a number of runtime options to control this
  340. also, see the man page.
  341. --enable-nacl
  342. This configures the Mono compiler to generate code
  343. suitable to be used by Google's Native Client:
  344. http://code.google.com/p/nativeclient/
  345. Currently this is used with Mono's AOT engine as
  346. Native Client does not support JIT engines yet.
  347. 2. Using Mono
  348. =============
  349. Once you have installed the software, you can run a few programs:
  350. * runtime engine
  351. mono program.exe
  352. * C# compiler
  353. mcs program.cs
  354. * CIL Disassembler
  355. monodis program.exe
  356. See the man pages for mono(1), mint(1), monodis(1) and mcs(2)
  357. for further details.
  358. 3. Directory Roadmap
  359. ====================
  360. docs/
  361. Technical documents about the Mono runtime.
  362. data/
  363. Configuration files installed as part of the Mono runtime.
  364. mono/
  365. The core of the Mono Runtime.
  366. metadata/
  367. The object system and metadata reader.
  368. mini/
  369. The Just in Time Compiler.
  370. dis/
  371. CIL executable Disassembler
  372. cli/
  373. Common code for the JIT and the interpreter.
  374. io-layer/
  375. The I/O layer and system abstraction for
  376. emulating the .NET IO model.
  377. cil/
  378. Common Intermediate Representation, XML
  379. definition of the CIL bytecodes.
  380. interp/
  381. Interpreter for CLI executables (obsolete).
  382. arch/
  383. Architecture specific portions.
  384. man/
  385. Manual pages for the various Mono commands and programs.
  386. samples/
  387. Some simple sample programs on uses of the Mono
  388. runtime as an embedded library.
  389. scripts/
  390. Scripts used to invoke Mono and the corresponding program.
  391. runtime/
  392. A directory that contains the Makefiles that link the
  393. mono/ and mcs/ build systems.
  394. ../olive/
  395. If the directory ../olive is present (as an
  396. independent checkout) from the Mono module, that
  397. directory is automatically configured to share the
  398. same prefix than this module gets.
  399. 4. Git submodules maintenance
  400. =============================
  401. Read documentation at http://mono-project.com/Git_Submodule_Maintenance