Mono installation guide

xiaoxiao2021-03-06  92

[turn]

Get Mono

The MONO package can be obtained by the following four ways.

• To Mono's official website download release installation package:

This provides a variety of formal distribution or phased release options, and people can freely choose the type of type. The installation packs provided here are generally tested, and can be correctly compiled and run. Download address in: http://www.go-mono.com/download.html

• Daily issued package:

If you want to close track of Mono's development, or you want to see Mono's development history, you can get Mono's day issuings at http://go-mono.com/daily/ this address. The daily issued package includes development progress of the Mono project every day. A total of three different types are divided:

Mono: This is a source of runtime and libraries that can be compiled and all binary controls containing C #. As long as you have a C compiler, you can compile and install it. The latest version can be downloaded directly from http://go-mono.com/daily/mono-latest.tar.gz. MonoCharge: Contains all C # components and executables for compiled MONO. It can be used to fully update the MONO library and tools you have installed. The latest version can be downloaded directly from http://go-mono.com/daily/monocharge-latest.tar.gz. The Monolite: Monolite Package is the same as the Monocharge package, but also provides you update MONO's ability, but it only contains the most basic core library Corlib, System, System.xml, and C # compilers. The latest version can be downloaded directly from http://go-mono.com/daily/monolite-laitest.tar.gz.

• Get the MONO source code through the CVS server.

CVS is a powerful source code management server. If you think that the day issuance package is updated every day or not to meet the needs of your fanatics, then you can also get the source code base in development by accessing Mono's CVS server, because it is possible to get the code. It was previously submitted by Mono's developers who had just been submitted one minute ago.

Access under Linux:

First, you have to confirm that your system has installed CVS client software. If you have not, you can go to http://www.cvshome.org/ to download.

Enter the following command under the console: export cvsroot =

Server: anonymous@anoncvs.go-mono.com: / mono cvs login (System prompt to enter a password, you can go directly) CVS -Z3 CO Mono

The mono is the project name, or can also be replaced with other items, such as MCS and GTK-Sharp. Then you can see downloading files from the server, CVS automatically builds a project file directory that is consistent with the directory structure on the current directory.

• CVS snapshot

Available for Curious Developers Which Do Not Necessarily Want To Install The CVS Source. Baked Daily.

Install on Linux

There are two forms of Mono's distribution package, one is the source package, need to be manually compiled, the other is a binary package, which can be installed directly. The application range of the source package is relatively wide, it can be suitable for almost all Linux, but the steps are more troublesome, and the time required is longer. Instead, the installation of the binary package is relatively simple, but the scope of application is relatively narrow, and can only be installed under certain Linux systems, typically RPM installation packages with Redhat Linux. The core MONO is divided into two parts:

• component C component (included in the Mono package)

All necessary components that run MONO are Mono's operating environment.

• C # components (included in the MCS package)

Contains a class library, a compiler, and the like using C # written.

Source code installation:

Source code installation refers to the source code for downloading Mono, then compile locally,

If you are the downloaded Mono's compressed installation package, you can enter the following command to decompress:

TAR ZXFV MONO-X.XX.TAR.GZ

Where X.xx is the version number of Mono.

After the decompression is complete, you will see a subdirectory in the current directory, the name is usually: Mono-X.xx.

Enter the subdirectory, enter: ./configure

You will see status information like the following:

[root @ localhost mono-1.0] # ./configure checking build system type ... i686-pc-linux-gnu checking host system type ... i686-pc-linux-gnu checking target system type ... i686-pc -Linux-GNU Checking for A BSD-Compatible Install ... / usr / bin / install -c checking WHETER BUILD ENVIRONMENT IS SANE ... YES Checking for Gawk ... Gawk Checking WHETHER MAKE SETS $ (MAKE) ... yes checking whether to enable maintainer-specific portions of Makefiles ... no checking host platform characteristics ... ok checking for gcc ... gcc checking for gcc ... (cached) gcc checking for C compiler default output ... a .out checking whether the C compiler works ... yes checking whether we are cross compiling ... no checking for suffix of executables ... checking for suffix of object files ... o intermediate skip ... config.status: creating Makefile Config.status: Creating Include / Makefile Config.status: Creating Include / Private / Makefile Config.status: Creating Doc / Makefile Config.status: Executing Depfiles Commands Config.sta tus: executing default commands GC: included ICU: no, if you want full i18n support download it from: http://oss.software.ibm.com/icu/index.html NPTL: yes SIGALTSTACK: yes Engine: Building and using The JIT This means that the Configure program is configuring MONO's Makefile file to prepare for the next compile MONO. If there is an abnormal interrupt in this process, and the Makefile file is generated in the directory, it is necessary to find out the cause of the error in accordance with the system prompt, which may generally be because of the lack of software necessary to compile MONO, for example, you don't have installation. If gnome x-window, you need to manually install PKG-Config and GLIB-2.0, both of which can be

http://www.freeDesktop.org/software/pkgconfig and

FTP: //ftp.gtk.org Download.

Next, you can start compiling MONO, enter Make directly on the command line, you can see the following output information:

[root @ localhost mono-1.0] # make make all-recursive make [1]: Entering Directory `/mono/mono-1.0 'Making All in libgc make [2]: Entering Directory` /mono/mono-1.0/libgc' Making All in Include Make [3]: Entering Directory `/mono/mono-1.0/libgc/include 'gcc -dhave_config_h -i. -I. -I ../ .. -i ../ .. -i .. /../libgc/include -i / usr / local / include / glib-2.0 -i / usr / local / lib / glib-2.0 / include -pthread -i / usr / local / include / glib-2.0 -i / usr / local / lib / glib-2.0 / include -DGC_LINUX_THREADS -DMONO_USE_EXC_TABLES -D_GNU_SOURCE -D_REENTRANT -fexceptions -D_FILE_OFFSET_BITS = 64 -g -O2 -fno-strict-aliasing -g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations - Wstrict-prototypes -wnsing-prototypes -wnested-exterNS -WPointer-Arith -wno-cast-qual -wcast-align-wwrite-strings -c-co genmdesc-helpers.o `Test -f 'helpers.c' || echo '.'`Helpers.c / bin / sh ../../libtool --mode = link gcc -g-^ --fno-strict-aliasing -g -wall -wunused ./Genmdesc ./cpu-sparc. MD cpu-sparc.h sparc_desc make all-am where the compilation information generated by configuration scripts It may look very messy, but don't worry, these are very normal. In addition, during the compilation process, depending on the machine, the time that may be needed will be relatively long, please wait patiently.

After compiling, you can enter make install for installation. This step will copy some scripts of Mono to the operating system to the operating system. The default is: / usr / local / bin.

Now you can enter: mono in the command line, if there is any of the following help information (its specific meaning is described in detail in the following chapters):

Usage is: mono [options] assembly Runtime and JIT debugging: --compile METHOD Just compile METHOD in assembly --ncompile N Number of times to compile METHOD (default: 1) --regression Runs the regression test contained in the assembly - print-vtable Print the vtable of all used classes --trace [= EXPR] Enable tracing, use --help-trace for details --compile-all compiles all the methods in the assembly --breakonex Inserts a breakpoint on exceptions - break METHOD Inserts a breakpoint at METHOD entry --debug Enable debugging support --stats Print statistics about the JIT operations Development: --statfile FILE Sets the stat file to FILE --aot compiles the assembly to native code --profile [= profiler ] Runs in profiling mode with the specified profiler module --graph [= TYPE] METHOD Draws a graph of the specified method: cfg Control Flow Graph (CFG) dtree Dominator Tree code CFG showing code ssa CFG showing code after SSA translation optcode CFG showing Code after IR Optimi ZASATIONS Runtime: --Config File Loads File as the mono config --verbose, -v increas the verbosity level - help, -h show usage information --Version, -v show version information --Optimize =

OPT Turns on a specific optimization: peephole Peephole postpass branch Branch optimizations inline Inline method calls cfold Constant folding consprop Constant propagation copyprop Copy propagation deadce Dead code elimination linears Linear scan global reg allocation cmov Conditional moves shared Emit per-domain code sched Instruction scheduling intrins Intrinsic method implementations tailc tail recursion and tail calls loop Loop related optimizations fcmov Fast x86 FP compares leaf Leaf procedures optimizations aot Usage of Ahead of Time compiled code precomp Precompile all methods before executing Main then congratulations, you have the correct installation of the Mono runtime environment, You can run and compile the .NET application under Linux.

Uninstalling MONO is also very simple, just enter Make Uninstall, you will automatically remove all installed executables and scripts. If you want to recompile to install Mono, you can enter: make distclean, then enter: ./configure, make, make install.

Installation on Windows

Mono itself is a cross-platform environment, so it can be run under the Windows platform, maybe you will make such questions: Since the Windows platform already has Microsoft .NET Framework, then why do I have to install Mono under WINDOWS? ?

This is because:

1 . Although Mono and MicrosFot .NET can remain compatible in most cases, Mono has its own extended part, such as a number of database providers far more than Microsoft .NET.

2 . Convenient to debug. Most of the programmers are still used to development on Windows, after all, the development environment of Windows is much better than Linux. For example, you can use Visual Studio under Windows, then directly debug the compatibility problem of MONO, without switching to Linux.

3. You can view the .NET class library source code. Mono is open source project, which means you can see the C # source code of the class library, and Microsoft .NET cannot be seen. It is very helpful for developers to understand the design and implementation of NET class libraries.

First, you need to download the MONO download page to download the Windows installation package, which is actually a self-extracting compressed package, so it does not generate any shortcuts in the start menu program bar, in fact, Mono itself has no graphical interface Currently, you can only use Mono correctly in the console.

The current version of Mono is not very complete. After the installation is complete, if you enter MONO directly into the directory, you will generate some errors that can not find the dynamic connection library, so you need to manually add the path to the path to the path environment variable. , Use the following command: path =% path%; C: / Program files / mono-1.0 / bin; c: / programe files / mono-1.0 / ic / bin

Then go to the bin directory to execute Mono, you can see the correct help message.

转载请注明原文地址:https://www.9cbs.com/read-125039.html

New Post(0)