- Notifications
You must be signed in to change notification settings - Fork3.8k
Mono open source ECMA CLI, C# and .NET implementation.
License
Unknown, Unknown licenses found
Licenses found
mono/mono
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Mono is a software platform designed to allow developers to easilycreate cross platform applications. It is an open sourceimplementation of Microsoft's .NET Framework based on the ECMAstandards for C# and the Common Language Runtime.
The Mono project is part of the.NET Foundation
- Compilation and Installation
- Using Mono
- Directory Roadmap
- Contributing to Mono
- Reporting bugs
- Configuration Options
- Working with Submodules
| OS | Architecture | Status |
|---|---|---|
| Debian 9 | amd64 | |
| Debian 9 | i386 | |
| Debian 9 | armel | |
| Debian 9 | armhf | |
| Debian 9 | arm64 | |
| OS X | amd64 | |
| OS X | i386 | |
| Windows | amd64 | |
| Windows | i386 | |
| CentOS | s390x (cs) | |
| Debian 9 | ppc64el (cs) | |
| AIX | ppc64 (cs) |
(cs) = community supported architecture
Please see our guides for building Mono onMac OS X,Linux andWindows.
Note that building from Git assumes that you already have Mono installed,so please download andinstall the latest Mono releasebefore trying to build from Git. This is required because the Mono buildrelies on a working Mono C# compiler to compile itself(also known asbootstrapping).
If you don't have a working Mono installation, you can try a slightlymore risky approach: getting the latest version of the 'monolite' distribution,which contains just enough to run the 'mcs' compiler. You do this with:
# Run the following line after ./autogen.shmake get-monolite-latestThis will download and place the files appropriately so that you can thenjust run:
makeThe build will then use the files downloaded bymake get-monolite-latest.
You can run the mono and mcs test suites with the command:make check.
Expect to find a few test suite failures. As a sanity check, youcan compare the failures you got withhttps://jenkins.mono-project.com/.
You can now install mono with:make install
You can verify your installation by using the mono-test-installscript, it can diagnose some common problems with Mono's install.Failure to follow these steps may result in a broken installation.
Once you have installed the software, you can run a few programs:
mono program.exeruntime enginemcs program.csC# compilermonodis program.exeCIL Disassembler
See the man pages for mono(1), mcs(1) and monodis(1) for further details.
acceptance-tests/- Optional third party test suites used to validate Mono against a wider range of test cases.data/- Configuration files installed as part of the Mono runtime.docs/- Technical documents about the Mono runtime.external/- Git submodules for external libraries (Newtonsoft.Json, ikvm, etc).ikvm-native/- Glue code for ikvm.libgc/- The (deprecated) Boehm GC implementation.llvm/- Utility Makefiles for integrating the Mono LLVM fork.m4/- General utility Makefiles.man/- Manual pages for the various Mono commands and programs.mcs/- The class libraries, compiler and toolsclass/- The class libraries (like System.*, Microsoft.Build, etc.)mcs/- The Mono C# compiler written in C#tools/- Tools like gacutil, ikdasm, mdoc, etc.
mono/- The core of the Mono Runtime.arch/- Architecture specific portions.benchmark/- A collection of benchmarks.btls/- Build files for the BTLS library which incorporates BoringSSL.cil/- Common Intermediate Representation, XMLdefinition of the CIL bytecodes.dis/- CIL executable Disassembler.eglib/- Independent implementation of the glib API.metadata/- The object system and metadata reader.mini/- The Just in Time Compiler.profiler/- The profiler implementation.sgen/- The SGen Garbage Collector implementation.tests/- The main runtime tests.unit-tests/- Additional runtime unit tests.utils/- Utility functions used across the runtime codebase.
msvc/- Logic for the MSVC / Visual Studio based runtime and BCL build system.The latter is experimental at the moment.packaging/- Packaging logic for the OS X and Windows Mono packages.po/- Translation files.runtime/- A directory that contains the Makefiles that link themono/ and mcs/ build systems.samples/- Some simple sample programs on uses of the Monoruntime as an embedded library.scripts/- Scripts used to invoke Mono and the corresponding program.sdks/- A new way of embedding Mono into Xamarin.iOS, Xamarin.Android and other products.support/- Various support libraries.tools/- A collection of tools, mostly used during Mono development.
Before submitting changes to Mono, please review thecontributionguidelines.Please pay particular attention to theImportantRulessection.
To submit bug reports, pleaseopen an issue on the mono GitHub repo.
Please use the search facility to ensure the same bug hasn't alreadybeen submitted and follow ourguidelineson how to make a good bug report.
The following are the configuration options that someone building Monomight want to use:
--with-sgen=yes,no- Generational GC support: Used to enable ordisable the compilation of a Mono runtime with the SGen garbagecollector.- On platforms that support it, after building Mono, you will haveboth a
mono-boehmbinary and amono-sgenbinary.mono-boehmuses Boehm,whilemono-sgenuses the Simple Generational GC.
- On platforms that support it, after building Mono, you will haveboth a
--with-libgc=[included, none]- Selects the default Boehmgarbage collector engine to use.included: (slightly modified Boehm GC) This is the defaultvalue for the Boehm GC, and it's the most feature complete, it willallow Mono to use typed allocations and support the debugger.
none:Disables the inclusion of a Boehm garbage collector.
This defaults to
included.
--enable-cooperative-suspend- If you pass this flag the Mono runtime is configured to only usethe cooperative mode of the garbage collector. If you do not passthis flag, then you can control at runtime the use of thecooperative GC mode by setting the
MONO_ENABLE_COOP_SUSPENDflag.
- If you pass this flag the Mono runtime is configured to only usethe cooperative mode of the garbage collector. If you do not passthis flag, then you can control at runtime the use of thecooperative GC mode by setting the
--with-tls=__thread,pthreadControls how Mono should access thread local storage,pthread forces Mono to use the pthread APIs, while__thread uses compiler-optimized access to it.
Although __thread is faster, it requires support fromthe compiler, kernel and libc. Old Linux systems donot support with __thread.
This value is typically pre-configured and there is noneed to set it, unless you are trying to debug a problem.
--with-sigaltstack=yes,noExperimental: Use at your own risk, it is known tocause problems with garbage collection and is hard toreproduce those bugs.
This controls whether Mono will install a specialsignal handler to handle stack overflows. If set to
yes, it will turn stack overflows into theStackOverflowException. Otherwise when a stackoverflow happens, your program will receive asegmentation fault.The configure script will try to detect if youroperating system supports this. Some older Linuxsystems do not support this feature, or you might wantto override the auto-detection.
--with-static_mono=yes,noThis controls whether
monoshould link against astatic library (libmono.a) or a shared library(libmono.so).This defaults to
yes, and will improve the performanceof themonoprogram.This only affects the `mono' binary, the sharedlibrary libmono.so will always be produced fordevelopers that want to embed the runtime in theirapplication.
--with-xen-opt=yes,no- Optimize code for Xen virtualization.It makes Mono generate code which might be slightlyslower on average systems, but the resulting executable will runfaster under the Xen virtualization system.
This defaults to
yes.
--with-large-heap=yes,no- Enable support for GC heaps larger than 3GB.- This defaults to
no.
- This defaults to
--enable-small-config=yes,no- Enable some tweaks to reduce memory usageand disk footprint at the expense of some capabilities.Typically this means that the number of threads that can be createdis limited (256), that the maximum heap size is also reduced (256 MB)and other such limitations that still make mono useful, but more suitableto embedded devices (like mobile phones).
This defaults to
no.
--with-ikvm-native=yes,no- Controls whether the IKVM JNI interface library isbuilt or not.This is used if you are planning onusing the IKVM Java Virtual machine with Mono.
This defaults to
yes.
--with-profile4=yes,no- Whether you want to build the 4.x profile librariesand runtime.- This defaults to
yes.
- This defaults to
--with-libgdiplus=installed,sibling,<path>- Configure where Monosearches for libgdiplus when running System.Drawing tests.It defaults to
installed, which means that thelibrary is available to Mono through the regularsystem setup.siblingcan be used to specify that a libgdiplusthat resides as a sibling of this directory (mono)should be used.
Or you can specify a path to a libgdiplus.
--enable-minimal=LISTUse this feature to specify optional runtimecomponents that you might not want to include. Thisis only useful for developers embedding Mono thatrequire a subset of Mono functionality.
The list is a comma-separated list of components thatshould be removed, these are:
aot:Disables support for the Ahead of Time compilation.attach:Support for the Mono.Management assembly and theVMAttach API (allowing code to be injected intoa target VM)com:Disables COM support.debug:Drop debugging support.decimal:Disables support for System.Decimal.full_messages:By default Mono comes with a full tableof messages for error codes. This featureturns off uncommon error messages and reducesthe runtime size.generics:Generics support. Disabling this will notallow Mono to run any 2.0 libraries orcode that contains generics.jit:Removes the JIT engine from the build, this reducesthe executable size, and requires that all codeexecuted by the virtual machine be compiled withFull AOT before execution.large_code:Disables support for large assemblies.logging:Disables support for debug logging.pinvoke:Support for Platform Invocation services,disabling this will drop support for anylibraries using DllImport.portability:Removes support for MONO_IOMAP, the environmentvariables for simplifying porting applications thatare case-insensitive and that mix the Unix and Windows path separators.profiler:Disables support for the default profiler.reflection_emit:Drop System.Reflection.Emit supportreflection_emit_save:Drop support for saving dynamically createdassemblies (AssemblyBuilderAccess.Save) inSystem.Reflection.Emit.shadow_copy:Disables support for AppDomain's shadow copies(you can disable this if you do not plan onusing appdomains).simd:Disables support for the Mono.SIMD intrinsicslibrary.ssa:Disables compilation for the SSA optimizationframework, and the various SSA-based optimizations.
--enable-llvm--enable-loadedllvmThis enables the use of LLVM as a code generation enginefor Mono. The LLVM code generator and optimizer will beused instead of Mono's built-in code generator for bothJust in Time and Ahead of Time compilations.
Seehttps://www.mono-project.com/docs/advanced/mono-llvm/ for thefull details and up-to-date information on this feature.
You will need to have an LLVM built that Mono can linkagainst.
The
--enable-loadedllvmvariant will make the LLVM backendinto a runtime-loadable module instead of linking it directlyinto the main mono binary.
--enable-big-arrays- Enable use of arrays with indexes largerthan Int32.MaxValue.By default Mono has the same limitation as .NET onWin32 and Win64 and limits array indexes to 32-bitvalues (even on 64-bit systems).
In certain scenarios where large arrays are required,you can pass this flag and Mono will be built tosupport 64-bit arrays.
This is not the default as it breaks the C embeddingABI that we have exposed through the Mono developmentcycle.
--enable-parallel-markUse this option to enable the garbage collector to usemultiple CPUs to do its work. This helps performanceon multi-CPU machines as the work is divided across CPUS.
This option is not currently the default on OSXas it runs into issues there.
This option only applies to the Boehm GC.
--enable-dtrace- On Solaris and MacOS X builds a version of the Monoruntime that contains DTrace probes and canparticipate in the system profiling using DTrace.
--disable-dev-randomMono uses /dev/random to obtain good random data forany source that requires random numbers. If yoursystem does not support this, you might want todisable it.
There are a number of runtime options to control thisalso, see the man page.
--with-csc=roslyn,mcs,defaultUse this option to configure which C# compiler to use. By defaultthe configure script will pick Roslyn, except on platforms whereRoslyn does not work (Big Endian systems) where it will pick mcs.
If you specify "mcs", then Mono's C# compiler will be used. Thisalso allows for a complete bootstrap of Mono's core compiler andcore libraries from source.
If you specify "roslyn", then Roslyn's C# compiler will be used.This currently uses Roslyn binaries.
--enable-naclThis configures the Mono compiler to generate codesuitable to be used by Google's Native Client:https://code.google.com/p/nativeclient/
Currently this is used with Mono's AOT engine asNative Client does not support JIT engines yet.
--enable-wasmUse this option to configure mono to run on WebAssembly. It willset both host and target to the WebAssembly triplet. This overridesthe values passed to
--hostor--targetand ignored what config.sub guesses.This is a workaround to enable usage of old automake versions that don'trecognize the wasm triplet.
Mono references several external git submodules, for examplea fork of Microsoft's reference source code that has been alteredto be suitable for use with the Mono runtime.
This section describes how to use it.
An initial clone should be done recursively so all submodules will also becloned in a single pass:
$ git clone --recursive git@github.com:mono/monoOnce cloned, submodules can be updated to pull down the latest changes.This can also be done after an initial non-recursive clone:
$ git submodule update --init --recursiveTo pull external changes into a submodule:
$ cd <submodule>$ git pull origin <branch>$ cd <top-level>$ git add <submodule>$ git commitBy default, submodules are detached because they point to a specific commit.Usegit checkout to move back to a branch before making changes:
$ cd <submodule>$ git checkout <branch># work as normal; the submodule is a normal repo$ git commit/push new changes to the repo (submodule)$ cd <top-level>$ git add <submodule> # this will record the new commits to the submodule$ git commitTo switch the repo of a submodule (this should not be a common or normal thingto do at all), first edit.gitmodules to point to the new location, then:
$ git submodule sync -- <path of the submodule>$ git submodule update --recursive$ git checkout <desired new hash or branch>The desired output diff is a change in.gitmodules to reflect thechange in the remote URL, and a change in / where you seethe desired change in the commit hash.
See the LICENSE file for licensing information, and the PATENTS.TXTfile for information about Microsoft's patent grant.
The use of trademarks and logos for Mono can be foundhere.
Mono now ships with a solution file that can be used to build theassemblies from an IDE. Either by opening the topmostnet_4_x.slnfile, or to by loading one of the individualcsproj files located ineach directory.
These are maintained by extracting the configuration information fromour Makefiles, which as of May 2016 remain the canonical location forconfiguration information.
When changes are made to the Makefiles, a user would need to run thefollowing command to re-generate the solution files at the top level:
$ make update-solution-filesAbout
Mono open source ECMA CLI, C# and .NET implementation.
Topics
Resources
License
Unknown, Unknown licenses found
Licenses found
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.