首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在覆盆子Pi 3上建立Mono

在覆盆子Pi 3上建立Mono
EN

Stack Overflow用户
提问于 2017-11-27 14:09:34
回答 1查看 851关注 0票数 0

我拼命地试图在Raspberry Pi 3上构建Mono,我首先从Repo安装了Mono。然后我试着建造最新的tarball或者git主人。两样都没用。

我总是带着这样的信息结束:

代码语言:javascript
复制
make install-local
make[7]: Entering directory '/home/pi/mono-5.9.0.415/mcs/class/corlib'
CSC     [basic] mscorlib.dll
/home/pi/mono-5.9.0.415/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs(5918,45): error CS0246: The type or namespace name 'Task<>' could not be found (are you missing a using directive or an assembly reference?)
/home/pi/mono-5.9.0.415/external/corefx/src/System.Memory/src/System/ReadOnlySpan.cs(85,42): warning CS3001: Argument type 'void*' is not CLS-compliant
/home/pi/mono-5.9.0.415/external/corefx/src/System.Memory/src/System/Span.cs(90,34): warning CS3001: Argument type 'void*' is not CLS-compliant
../../build/library.make:329: recipe for target '../../class/lib/basic/mscorlib.dll' failed
make[7]: *** [../../class/lib/basic/mscorlib.dll] Error 1
make[7]: Leaving directory '/home/pi/mono-5.9.0.415/mcs/class/corlib'
../../build/rules.make:211: recipe for target 'do-install' failed
make[6]: *** [do-install] Error 2
make[6]: Leaving directory '/home/pi/mono-5.9.0.415/mcs/class/corlib'
../build/rules.make:232: recipe for target 'install-recursive' failed
make[5]: *** [install-recursive] Error 1
make[5]: Leaving directory '/home/pi/mono-5.9.0.415/mcs/class'
build/rules.make:232: recipe for target 'install-recursive' failed
make[4]: *** [install-recursive] Error 1
make[4]: Leaving directory '/home/pi/mono-5.9.0.415/mcs'
Makefile:54: recipe for target 'profile-do--basic--install' failed
make[3]: *** [profile-do--basic--install] Error 2
make[3]: Leaving directory '/home/pi/mono-5.9.0.415/mcs'
Makefile:50: recipe for target 'profiles-do--install' failed
make[2]: *** [profiles-do--install] Error 2
make[2]: Leaving directory '/home/pi/mono-5.9.0.415/mcs'
Makefile:600: recipe for target 'install-exec' failed
make[1]: *** [install-exec] Error 2
make[1]: Leaving directory '/home/pi/mono-5.9.0.415/runtime'
Makefile:541: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1

这是我用于Tarball构建的脚本:

代码语言:javascript
复制
PREFIX=/home/pi/.myMono
VERSION=5.9.0.415
tar xvf mono-$VERSION.tar.bz2
cd mono-$VERSION
./configure --prefix=$PREFIX
make
make install

有人也有同样的问题吗?或者是一些建议,如何使它的建设正确?

EN

回答 1

Stack Overflow用户

发布于 2017-11-29 00:24:52

由于还不清楚这个问题是关于在Raspberry Pi 3或mono上运行的mono版本5.9.0.415,所以我假设这个问题一般是关于mono的。

根据我的经验,mono 5和armv7l平台(armv7l未知-linux-gnueabihf)似乎存在兼容性问题。

我已经尝试构建了以下单版本包:

  • 5.0.0.100
  • 5.0.1.1
  • 5.2.0.104
  • 5.2.0.224
  • 5.9.0.398
  • 5.9.0.415

编译在构建过程尝试使用生成的csc二进制文件时失败。在从NullPointerException发出的调用中,编译部分中似乎有一个CompileMethodBodies。

这个问题首先出现在Mono 5中,随着Roslyn的引入。好消息是mono版本4.8.1不受新的Roslyn代码的影响,并且不会在Raspberry Pi 3上出现重大问题而编译和运行。

您可以像这样编译mono:

代码语言:javascript
复制
wget https://download.mono-project.com/sources/mono/mono-4.8.1.0.tar.bz2
tar xvf mono-4.8.1.0.tar.bz2
cd mono-4.8.1.0
./configure --prefix=/home/pi/.myMono
make
make install

此外,值得一提的是,如果您希望在Raspberry 3上进行单次编译时利用所有4个CPU核心,您可以这样做:make -j4。这将大大缩短编译时间。

如果您希望跳过libmono的生成,可以通过使用--禁用-库参数:./configure --disable-libraries --prefix=/home/pi/.myMono来配置构建。但是因为你需要库来运行任何应用程序..。这只会对mono运行时的连续重建有所帮助(一旦您已经安装了monolib)。

我注意到,但无法证实的是,可能有一些单一的5包Raspberry Pi 3毕竟。这个帖子声称有一个5.2包可供下载。mono 下载页面也是如此。

另外,我要指出,在/home/pi/..myMono中安装mono可能是一个糟糕的选择。但我想它应该还能用..。更经典的方法是/usr/local或/opt文件夹。下面是关于这些交替地点的一些想法。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47512912

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档