簡體   English   中英

在Raspberry Pi 3上構建Mono

[英]Build Mono on Raspberry Pi 3

我拼命嘗試在Raspberry Pi 3上構建Mono。我首先從Repo安裝了Mono。 然后,我嘗試構建最新的tarball或git master。 兩者都不起作用。

我總是以以下信息結束:

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構建的腳本:

PREFIX=/home/pi/.myMono
VERSION=5.9.0.415
tar xvf mono-$VERSION.tar.bz2
cd mono-$VERSION
./configure --prefix=$PREFIX
make
make install

有人有同樣的問題嗎? 或有關如何使其正確構建的一些建議?

由於尚不清楚該問題是否特別涉及要在Raspberry Pi 3上運行單聲道版本5.9.0.415還是在一般情況下運行單聲道,因此我認為該問題通常是在單聲道上。

根據我的經驗,單聲道5和armv7l平台(armv7l-unknown-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二進制文件的地方,編譯失敗。 在通過CompileMethodBodies進行的調用中,編譯部分的某處似乎存在NullPointerException。

該問題首先出現在Mono 5中,並引入了Roslyn。 好消息是,單聲道版本4.8.1不受新的Roslyn代碼的影響,並且將在Raspberry Pi 3上編譯並運行而沒有重大問題。

您可以像這樣編譯mono:

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 Pi 3上進行單編譯時充分利用所有4個CPU內核,則可以通過如下所示啟動make來實現: make -j4 這將大大減少編譯時間。

而且,如果您希望跳過libmono的生成,可以通過使用--disable-libraries參數配置構建: ./configure --disable-libraries --prefix=/home/pi/.myMono 但是,由於您將需要這些庫來運行任何應用程序...這僅有助於連續重建Mono運行時(一旦您已經安裝過monolib)。

我注意到了,但無法驗證的是,畢竟可能有一些適用於Raspberry Pi 3的mono 5軟件包。 帖子聲稱有一個5.2軟件包可供下載。 單聲道下載頁面也是如此

附帶一提,我想提到將Mono安裝到/home/pi/.myMono可能是一個不好的選擇。 但是我想它應該仍然可以工作...一種更經典的方法是/ usr / local或/ opt文件夾。 這是關於這些備用位置的一些想法。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM