您好,登錄后才能下訂單哦!
本文小編為大家詳細(xì)介紹“ubuntu怎么編譯安裝mono環(huán)境”,內(nèi)容詳細(xì),步驟清晰,細(xì)節(jié)處理妥當(dāng),希望這篇“ubuntu怎么編譯安裝mono環(huán)境”文章能幫助大家解決疑惑,下面跟著小編的思路慢慢深入,一起來學(xué)習(xí)新知識吧。
準(zhǔn)備工作
一個全新安裝的ubuntu13.10系統(tǒng)
下載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++而無法繼續(xù):
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 ==============>省略了很多<==============
安裝成功。
設(shè)置path環(huán)境變量
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:~$
安裝成功。
讀到這里,這篇“ubuntu怎么編譯安裝mono環(huán)境”文章已經(jīng)介紹完畢,想要掌握這篇文章的知識點還需要大家自己動手實踐使用過才能領(lǐng)會,如果想了解更多相關(guān)內(nèi)容的文章,歡迎關(guān)注億速云行業(yè)資訊頻道。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。