在Centos 6.6上编译mono 3.10.0失败

在Centos 6.6上编译mono 3.10.0失败,mono,centos,Mono,Centos,我正试图在干净的Centos服务器上编译mono 3.10.0版。我不想尝试大师级,每次我看它的时候,它的构建都失败了 所以我试着像这样编译mono: wget https://github.com/mono/mono/archive/mono-3.10.0.tar.gz tar xvfz mono-3.10.0.tar.gz cd mono-mono-3.10.0/ ./autogen.sh make get-monolite-latest 这是当我得到一个关于一个丢失的单一站点tarbal

我正试图在干净的Centos服务器上编译mono 3.10.0版。我不想尝试大师级,每次我看它的时候,它的构建都失败了

所以我试着像这样编译mono:

wget https://github.com/mono/mono/archive/mono-3.10.0.tar.gz
tar xvfz mono-3.10.0.tar.gz
cd mono-mono-3.10.0/
./autogen.sh
make get-monolite-latest
这是当我得到一个关于一个丢失的单一站点tarball的错误时(更多信息如下:)

所以我找到了一个有效的url(根据前面的链接,它应该可以与mono 3.10.0一起使用),我就是这样继续的:

make get-monolite-latest monolite_url=http://storage.bos.xamarin.com/mono-dist-master/1b/1b41fd76350367453c8100f8bd0e7242105c6d39/monolite-111-latest.tar.gz
make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/basic.exe
无论如何,这导致了错误:

/usr/local/src/mono-mono-3.10.0/mcs/class/lib/monolite/basic.exe: /usr/local/src/mono-mono-3.10.0/mcs/class/lib/monolite/basic.exe: cannot execute binary file
make[6]: *** [build/deps/basic-profile-check.exe] Error 126
*** The compiler '/usr/local/src/mono-mono-3.10.0/mcs/class/lib/monolite/basic.exe' doesn't appear to be usable.
*** Trying the 'monolite' directory.
Bootstrap compiler: Mono C# compiler version 3.6.1.0
./../jay/jay: 7 shift/reduce conflicts.
mkdir -p -- ../class/lib/basic/
make[7]: *** No rule to make target `../../external/ikvm/reflect/*.cs', needed by `../class/lib/basic/basic.exe'.  Stop.
make[6]: *** [do-all] Error 2
make[5]: *** [all-recursive] Error 1
make[4]: *** [profile-do--basic--all] Error 2
make[3]: *** [profiles-do--all] Error 2
make[2]: *** [all-local] Error 2
make[2]: Leaving directory `/usr/local/src/mono-mono-3.10.0/runtime'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/mono-mono-3.10.0'
make: *** [all] Error 2
那么,为什么“无法执行二进制文件”以及我可以对此做些什么?我以root用户身份运行,因此不应该存在任何权限问题。此外:

# ls -la /usr/local/src/mono-mono-3.10.0/mcs/class/lib/monolite/
total 8048
drwxr-xr-x 2 root root    4096 Jun  2  2014 .
drwxr-xr-x 3 root root    4096 Jan  9 16:21 ..
-rwxr-xr-x 1 root root  298496 Jun  2  2014 Mono.Security.dll
-rwxr-xr-x 1 root root  126464 Jun  2  2014 System.Configuration.dll
-rwxr-xr-x 1 root root  283136 Jun  2  2014 System.Core.dll
-rwxr-xr-x 1 root root  131072 Jun  2  2014 System.Security.dll
-rwxr-xr-x 1 root root 1291264 Jun  2  2014 System.Xml.dll
-rwxr-xr-x 1 root root 1681408 Jun  2  2014 System.dll
-rwxr-xr-x 1 root root 1743360 Jun  2  2014 basic.exe
-rwxr-xr-x 1 root root 2631168 Jun  2  2014 mscorlib.dll
这里怎么了


编辑:

通过一些改进,我实现了一个几乎可以正常工作的mono安装。我需要执行以下步骤:

git clone -b mono-3.10.0-branch https://github.com/mono/mono.git
git submodule init
git submodule update
./autogen.sh --with-ikvm-native=no
make get-monolite-latest monolite_url=http://storage.bos.xamarin.com/mono-dist-master/1b/1b41fd76350367453c8100f8bd0e7242105c6d39/monolite-111-latest.tar.gz
make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/basic.exe
克隆3.10.0分支时,克隆不完整,某些子模块丢失。您需要运行git submodule init和git submodule update来获得mono编译

这些步骤在编译和安装mono时没有出现错误,但运行.Net软件则完全是另一回事。我在尝试运行控制台应用程序时仍会遇到异常:

System.InvalidProgramException: Invalid IL code in System.ComponentModel.Composition.Hosting.DirectoryCatalog:.ctor (string): method body is empty.

好了,问题的编译部分已经解决了,所以我想这可以标记为已回答。

根据我在问题中的编辑得到了mono编译。我想我把文件权限搞砸了,或者根本就没有basic.exe

我在编辑中给出的步骤使我的安装工作正常