Mono Installation Guide

Source: Internet
Author: User
Tags gtk

Http://nluyan.vicp.net/showdetails.aspx? Postid = 190

Get started with mono-mono Installation Guide

Currently, you can obtain the mono software package in the following four ways.

ToMonoDownload the release version of the installation package from the official website:

Different types of official releases or phased releases are provided. You can select the desired type as needed. The installation packages provided here are generally tested and can be correctly compiled and run.
In: http://www.go-mono.com/download.html

Daily release package:

If you want to closely track mono development progress, or you want to see mono development history, you can get mono's daily release package at the http://go-mono.com/daily/ address. The daily release package includes the development progress of the Mono Project every day. There are three different types:

  • Mono: This is a runtime that can be compiled and the source code package of the Class Library (including all the binary controls of C ). You can compile and install a C compiler. The latest version can be downloaded directly through the http://go-mono.com/daily/mono-latest.tar.gz.
  • Monocharge: contains all compiled mono C # components and executable programs. You can use it to Comprehensively update your installed mono class libraries and tools.
    The latest version can be downloaded directly through the http://go-mono.com/daily/monocharge-latest.tar.gz.
  • Monolite: like the monocharge package, the monolite package also provides the ability for you to update mono. However, it only contains the most basic core class libraries corlib, system, and system. XML and C # compilers.
    The latest version can be downloaded directly through the http://go-mono.com/daily/monolite-latest.tar.gz.

PassCVSServer acquisitionMonoSource code.

CVS is a powerful source code management server. If you think that the daily release package that is updated once a day cannot meet your avid demand for the latest code, you can access the Mono's CVS server to directly obtain the source code library under development, it is possible that the code you get was submitted by mono one minute ago.

Access in Linux:

First make sure that you have installed the CVS client on your system, if not, you can go to http://www.cvshome.org/to download.

Enter the following command in the console:

Export cvsroot = server: anonymous@anoncvs.go-mono.com:/mono cvs login (the system prompts you to enter a password, you can press Enter) CVs-Z3 Co mono

Mono is the project name or can be changed to another project, such as MCS and GTK-sharp. Then we can see that the file is being downloaded from the server. CVs will automatically create a project file directory consistent with the directory structure on the server under the current directory.

CVSSnapshots

Available for curious developers which do not necessarily want to install the CVS source. Baked daily.

Install on Linux

The mono distribution package has two forms: one is the source code package, which needs to be compiled manually, and the other is the Binary Package which can be directly installed. The source code package has a wide range of applicability and can be suitable for almost all Linux systems, but the steps are troublesome and take a long time. On the contrary, the installation of Binary packages is relatively simple, but the application scope is relatively narrow. It can only be installed in some specific Linux systems. A typical RPM installation package for Redhat Linux is available.

The core Mono is divided into two parts:

• C components (included in Mono Software Package)

It contains all the necessary components for running mono and is the runtime environment of Mono.

• C # components (included in the MCS package)

Contains the class library, compiler, and other content written in C.

Source code installation:

Source code installation refers to downloading the mono source code and then compiling it locally,

If you are downloading the mono compressed installation package, you can run the following command to decompress the package:

Tar zxfv mono-X.XX.tar.gz.

X. XX indicates the version number of Mono.

After decompression, you will see a sub-directory under the current directory, the name is generally: mono-X.XX.

Enter this subdirectory and enter:./configure

You will see the following status information:

[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 whether 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

Skipped...

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. Status: executing default commands

GC: sorted DED

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 indicates that the configure program is configuring the MAKEFILE file of Mono to prepare for the next compilation of Mono. If an exception or interruption occurs during this process and the MAKEFILE file is not generated in the directory, you need to find out the cause of the error according to the system prompt, which may be due to the lack of software required to compile mono, for example, if you do not have gnome X-window installed, You need to manually install PKG-config and glib-2.0, which can be downloaded separately at the http://www.freedesktop.org/Software/pkgconfig and ftp://ftp.gtk.org.

Next, you can start to compile mono and directly input make in the command line. You can see output information similar to the following:

[Root @ localhost mono-1.0] # Make

Make all-recursive

Make [1]: Entering directory '/MONO/mono-100'

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-runtime-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-wmissing-prototypes-wnested-externs-wpointer-Arith-wno-Cast-qual-wcast -align-wwrite-strings-c-o genmdesc-helpers.o 'test-F' helpers. c' | echo '. /''helpers. c

/Bin/sh.../libtool -- mode = link GCC-g-O2-fno-strict-aliasing-g-wall-wunused

./Genmdesc./cpu-sparc.md cpu-sparc.h sparc_desc

Make all-AM

The compilation information generated by the configuration script may look messy, but you don't have to worry about it. This is a normal phenomenon. In addition, it may take a long time to compile a machine that depends on different performance. Please be patient.

After the compilation is complete, enter make install to install mono. In this step, some mono scripts and executable programs will be copied to what can be found in the operating system. The default situation is: /usr/local/bin.

Now, you can enter mono in the command line, for example, the following help information (the specific meaning is detailed in the following sections ):

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 Optimizations

Runtime:

-- Config file loads file as the mono config

-- Verbose,-V increases 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 CILS

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 CILS

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

Congratulations! You have correctly installed the mono runtime environment. You can run and compile the. NET application in Linux.

It is also easy to uninstall mono. As long as you enter make uninstall, all installed executable programs and scripts will be automatically deleted. If you want to re-compile and install mono, You can first enter: Make distclean, and then enter:./configure, make, make install in the order you just entered.

Install on Windows

Mono itself is a cross-platform environment, so it can be fully run on a Windows platform. You may have the following question: Since Microsoft already exists on Windows.. NET Framework. Why should I install mono in windows?

This is because:

1. Although mono and microsfot. NET are compatible in most cases, Mono also has its own extensions, such as a database provider that far exceeds Microsoft. NET.

2. Easy debugging. Most programmers are still used to developing software on Windows. After all, the development environment of Windows is much better than that of Linux. For example, you can use Visual Studio in Windows for development, and then directly debug mono compatibility issues, instead of switching to Linux.

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

First, you need to go to the mono download page to download the Windows Installation Package. It is actually a self-extracting compressed package, so no shortcuts will be generated in the Start Menu program bar. In fact, mono itself does not have any graphical interface. Currently, you can only use mono correctly on the console.

Currently, this version of Mono is not perfect. After installation is complete, if you enter mono directly in the directory, it will produce some errors that cannot find the dynamic Connection Library, therefore, you also need to manually add the path of the dynamic Connection Library to the PATH environment variable and use the following command:

Path = % PATH %; C:/programe files/mono-1.0/bin; C:/programe files/mono-1.0/ICU/bin

Then run mono in the bin directory to view the correct help prompt.

Lu Yan
2004-7-4

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.