ubuntu13.10编译安装mono环境(一)

准备工作

一个全新安装的ubuntu13.10系统

下载Mono源代码并编译

nike@NIKE-PC:~$ ls
Desktop Downloads Music Public Videos
Documents examples.desktop Pictures Templates
nike@NIKE-PC:~$ mkdir src
nike@NIKE-PC:~$ cd src
nike@NIKE-PC:~/src$ wget http://download.mono-project.com/sources/mono/mono-3.2.8.tar.bz2
--2014-03-27 21:24:30-- http://download.mono-project.com/sources/mono/mono-3.2.8.tar.bz2
Resolving download.mono-project.com (download.mono-project.com)... 54.240.168.102, 54.230.156.158, 54.230.157.116, ...
Connecting to download.mono-project.com (download.mono-project.com)|54.240.168.102|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 77515552 (74M) [application/x-bzip2]
Saving to: ‘mono-3.2.8.tar.bz2'

100%[======================================>] 77,515,552 189K/s in 10m 50s

nike@NIKE-PC:~/src$ ls
mono-3.2.8.tar.bz2
nike@NIKE-PC:~/src$ tar -xjf mono-3.2.8.tar.bz2
nike@NIKE-PC:~/src$ cd mono-3.2.8/
nike@NIKE-PC:~/src/mono-3.2.8$ ./configure --prefix=/opt/mono-3.2.8
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 a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive... gnutar
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether ln -s works... yes
checking whether make supports nested variables... yes
checking host platform characteristics... ok
checking for gcc... gcc
checking for gcc... (cached) gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking dependency style of g++... none
checking dependency style of gcc... gcc3
checking for gawk... (cached) mawk
checking whether gcc and cc understand -c and -o together... yes
configure: error: You need to install g++

因为没有安装g++而无法继续:

nike@NIKE-PC:~/src/mono-3.2.8$ sudo apt-get install g++
[sudo] password for nike:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
cpp-4.8 g++-4.8 gcc-4.8 gcc-4.8-base libasan0 libatomic1 libgcc-4.8-dev
libgcc1 libgomp1 libitm1 libquadmath0 libstdc++-4.8-dev libstdc++6
Suggested packages:
gcc-4.8-locales g++-multilib g++-4.8-multilib gcc-4.8-doc libstdc++6-4.8-dbg
gcc-4.8-multilib libmudflap0-4.8-dev libgcc1-dbg libgomp1-dbg libitm1-dbg
libatomic1-dbg libasan0-dbg libtsan0-dbg libbacktrace1-dbg libquadmath0-dbg
libmudflap0-dbg libstdc++-4.8-doc
The following NEW packages will be installed:
g++ g++-4.8 libstdc++-4.8-dev
The following packages will be upgraded:
cpp-4.8 gcc-4.8 gcc-4.8-base libasan0 libatomic1 libgcc-4.8-dev libgcc1
libgomp1 libitm1 libquadmath0 libstdc++6
11 upgraded, 3 newly installed, 0 to remove and 275 not upgraded.
Need to get 25.9 MB of archives.
After this operation, 28.2 MB of additional disk space will be used.
Do you want to continue [Y/n]?
==============>省略了很多<==============

重新初始化mono安装配置文件:

nike@NIKE-PC:~/src/mono-3.2.8$ ./configure --prefix=/opt/mono-3.2.8
==============>省略了很多<==============
Engine:
GC: sgen and bundled Boehm GC with typed GC and parallel mark
TLS: __thread
SIGALTSTACK: yes
Engine: Building and using the JIT
oprofile: no
BigArrays: no
DTrace: no
LLVM Back End: no (dynamically loaded: no)

Libraries:
.NET 2.0/3.5: yes
.NET 4.0: yes
.NET 4.5: yes
MonoDroid: no
MonoTouch: no
JNI support: IKVM Native
libgdiplus: assumed to be installed
zlib:
nike@NIKE-PC:~/src/mono-3.2.8$

./configure通过。

编译Mono源代码

nike@NIKE-PC:~/src/mono-3.2.8$ make
==============>漫长的编译~<==============
nike@NIKE-PC:~/src/mono-3.2.8$ sudo make install
==============>省略了很多<==============

安装成功。

设置PATH环境变量

nike@NIKE-PC:~/src/mono-3.2.8$ cd ~
nike@NIKE-PC:~$ vim .bashrc

在该文件末尾追加以下语句:

if [ -d /opt/mono-3.2.8/bin ]; then
export PATH=/opt/mono-3.2.8/bin:$PATH
fi

然后:

nike@NIKE-PC:~$ . .bashrc
nike@NIKE-PC:~$ echo $PATH
/opt/mono-3.2.8/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
nike@NIKE-PC:~$

验证Mono是否安装正确

nike@NIKE-PC:~$ mono --version
Mono JIT compiler version 3.2.8 (tarball 2014年 03月 27日 星期四 21:55:30 CST)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: x86
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen
nike@NIKE-PC:~$ dmcs --version
Mono C# compiler version 3.2.8.0
nike@NIKE-PC:~$

安装成功。

(0)

相关推荐

  • 在CentOS 7.2下安装Mono 5.0的方法教程

    前言 微软Build2017大会期间.NET领域的.NET core之外,就是Visual Studio For Mac,大家都知道Visual Studio For Mac 是基于Mono运行的,Mono 5.0也是闪亮登场,Mono 5.0是一个非常重要的里程碑版本,支持Windows 64位部署,还有支持PowerPC等,Mono 5.0 和微软的.NET 的可操作性,兼容性也得到了更好的统一,还有很多特性为C#的游戏之王Unity准备,今年的Unity平台会有全面的升级. Mono 5.

  • CentOS上搭建Nginx+Mono运行asp.net环境的配置方法

    安装步骤: 一.获取开源相关程序: 1.利用CentOS Linux系统自带的yum命令安装.升级所需的程序库: sudo -s LANG=C yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bz

  • linux操作系统安装MONO执行C#程序的详解步骤

    第一步 环境(UBUNTU系统下) 复制代码 代码如下: sudo apt-get install mono-gmcs mono 第二步 建立example.cs 复制代码 代码如下: class X {static void Main () {System.Console.Write("My first mono app worked!/n"):}} 第三步 编译 复制代码 代码如下: gmcs example.cs 第四步 执行 复制代码 代码如下: ./example.exe 在

  • ubuntu 13.10编译安装mono环境(二)

    准备工作 先在VS2012上编译一个winform,代码如下: using System; using System.Windows.Forms; namespace FormsTest { static class Program { /// <summary> /// 应用程序的主入口点. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.S

  • ubuntu13.10编译安装mono环境(一)

    准备工作 一个全新安装的ubuntu13.10系统 下载Mono源代码并编译 nike@NIKE-PC:~$ ls Desktop Downloads Music Public Videos Documents examples.desktop Pictures Templates nike@NIKE-PC:~$ mkdir src nike@NIKE-PC:~$ cd src nike@NIKE-PC:~/src$ wget http://download.mono-project.com/s

  • PHP7.3.10编译安装教程

    php7.3.10编译安装 配置安装环境(裸机): centos7.2 下载指定PHP版本源码包 github https://github.com/php/php-src.git download https://www.php.net/downloads.php su - root && cd ~/ wget https://www.php.net/distributions/php-7.3.10.tar.gz # 解压源码包 tar -xzvf php-7.3.10.tar.gz c

  • CentOS 6.3编译安装LAMP环境笔记

    最近抽空在虚拟机上测试成功了LAMP各个最新版本的整合编译安装,算是把之前的博文整合精简,以下内容均在CENTOS6.3(安装minimal desktop和默认开发包)下测试安装成功,并做了相应优化配置,如有遗漏,还请留言指教.   LINUX操作系统:centOS6.3 64bit(安装了系统默认开发包) APACHE:httpd-2.4.4 MYSQL:mysql-5.6.10 PHP:php-5.4.13 注:推荐安装centos6.3系统时,在系统安装向导中.将默认开发包勾上,避免后期

  • Centos 6.8编译安装LNMP环境(Nginx+MySQL+PHP)教程

    前言 对于新手的一点建议: 最好熟悉一下linux 的基本命令,vim的常用命令 千万不要无脑复制,先看一下命令,特别是路径要注意 学会排查错误 本篇安装的软件版本为: Linux:Centos6.8 Nginx:1.10.3 MySQL:5.7.17 PHP:7.0.16 最近研究了Linux系统下的PHP环境搭建,个人感觉最好最好不要用yum默认的程序包安装,因为版本都比较低,下载最新的稳定版自行安装比较好.现在网上教程很多,之所以还记这篇,原因有一点,当你重复网上的教程自行安装时,90%还

  • CentOS6.5 编译安装lnmp环境

    网上搜来的教程如下 复制代码 代码如下: yum -y install gcc gcc-c++ automake autoconf libtool glibc make libmcrypt安装 mkdir /usr/local/source && cd /usr/local/source #创建并进入源文件目录 [root@localhost source ]# wget "http://downloads.sourceforge.net/mcrypt/libmcrypt-2.5

  • CentOS 7.x编译安装Nginx1.10.3+MySQL5.7.16+PHP5.2 5.3 5.4 5.5 5.6 7.0 7.1多版本全能环境

    前传: 1.CentOS 7.3.1611系统安装配置图解教程 http://www.osyunwei.com/archives/10003.html 2.CentOS服务器初始化设置 http://www.osyunwei.com/archives/9034.html 准备篇 一.防火墙配置 CentOS 7.x默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewalld.service #停止firew

  • CentOS 7.3.1611编译安装Nginx1.10.3+MySQL5.7.16+PHP7.1.2

    前传: 1.CentOS 7.3.1611系统安装配置图解教程 http://www.jb51.net/os/RedHat/597874.html 2.CentOS服务器初始化设置 http://www.jb51.net/article/133839.htm 准备篇 一.防火墙配置 CentOS 7.x默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewalld.service #停止firewall sy

  • 在lnmp环境中的nginx编译安装

    我用的linux系统是 centos7.1. 如果linux系统没有预先安装 gcc 等编译软件可以用yum源安装.安装nginx,首先需要安装依赖模块pcre.zlib.openssl. gzip 模块需要 zlib 库 rewrite 模块需要 pcre 库 ssl 功能需要 openssl库 1.安装pcre依赖 下载 pcre-8.38 wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz

  • CentOS 7.2.1511 编译安装Nginx1.10.1+MySQL5.6.33+PHP5.6.26运行环境

    准备篇 一.防火墙配置 CentOS 7.x默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动 2.安装iptables防火墙 yum install iptables-services #安装 vi /etc/sysconfig/iptables #编辑

随机推荐