在 Centos 6.6 上编译 mono 3.10.0 失败

compiling mono 3.10.0 on Centos 6.6 fails

我正在尝试将单声道版本 3.10.0 编译到干净的 Centos 服务器上。我宁愿不尝试大师,看起来每次我看它的构建都失败了。

所以我试着像这样编译单声道:

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

这是我收到有关缺少 monolite tarball 的错误消息(更多信息:https://bugzilla.xamarin.com/show_bug.cgi?id=16687

所以我找到了一个可用的 url(根据之前的 link,它应该可以与 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

那么,为什么 "cannot execute binary file" 以及我能做些什么呢?我 运行ning 是 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

这是怎么回事?


编辑:

一些进步,我能够实现几乎可以工作的单声道安装。我需要执行以下步骤:

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 子模块初始化和 git 子模块更新才能进行单声道编译。

这些步骤单声道编译安装没有错误,但是运行宁.Net软件是完全不同的事情。我在尝试 运行 我的控制台应用程序时仍然遇到异常:

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

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

根据我在问题中的编辑进行了单声道编译。我想我弄乱了文件权限,或者 basic.exe 一开始就不存在。

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