Linux 树莓派上的单声道
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10213600/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Mono on Raspberry Pi
提问by AngryHacker
I've seen a lot of talk about running Mono/.NET code on the Raspberry Pi. Has there been any success in actually running any Mono code on a Raspberry Pi?
我已经看到很多关于在 Raspberry Pi 上运行 Mono/.NET 代码的讨论。在 Raspberry Pi 上实际运行任何 Mono 代码是否成功?
On their site, they list several Linux distributions that work on the device and some of these distributions include Mono. However, none detail whether Mono works on it.
在他们的网站上,他们列出了在设备上运行的几个 Linux 发行版,其中一些发行版包括 Mono。但是,没有详细说明 Mono 是否适用于它。
Is there a working implementation?
是否有工作实施?
采纳答案by AngryHacker
The folks on the Raspberri Pi board are reporting that Mono does indeed work, at least for simple applications.
Raspberri Pi 板上的人报告说 Mono 确实有效,至少对于简单的应用程序。
回答by vbocan
I have managed to run my Delta Forth .NETcompiler on Debian 6.0 (Squeeze) and Mono. It worked flawlessly with full binary compatibility, the only thing I had to do was to recompile the code to target .NET 3.5 (instead of 4.0) since Mono on Debian lags a bit regarding .NET versions.
我已经设法在 Debian 6.0 (Squeeze) 和 Mono 上运行我的Delta Forth .NET编译器。它在完全二进制兼容的情况下完美运行,我唯一需要做的就是重新编译代码以面向 .NET 3.5(而不是 4.0),因为 Debian 上的 Mono 在 .NET 版本方面有点滞后。
The compiler is not a trivial .NET application so I was happy to actually see the compiler in action on my tiny Raspberry Pi.
编译器不是一个简单的 .NET 应用程序,所以我很高兴看到编译器在我的小树莓派上运行。
The actual steps I took to make the magic happen were (I recall from memory):
我为使魔法发生而采取的实际步骤是(我从记忆中回忆):
- Install the Mono runtime using: sudo apt-get install mono
- Invoke the compiler itself using: mono DeltaForth.exe file_to_compile.4th
- 使用以下命令安装 Mono 运行时:sudo apt-get install mono
- 使用以下命令调用编译器本身:mono DeltaForth.exe file_to_compile.4th
That is all. The most challenging part of this endeavor was to transfer the files from my Windows machine to Raspberry Pi using a flash drive :-)
就这些。这项工作中最具挑战性的部分是使用闪存驱动器将文件从我的 Windows 机器传输到 Raspberry Pi :-)
回答by S_BatMan
Mono on the Raspberry Pi is possible and reasonably easy to set up. The following assumes you're on Debian. This is taken from my blogthat offers a number of Raspberry Pi tutorials
Raspberry Pi 上的 Mono 是可能的,而且设置起来相当容易。以下假设您使用的是 Debian。这是摘自我的博客,该博客提供了许多 Raspberry Pi 教程
A note: the standard Mono runtime currently available only supports up to .NET 3.5 unless you compile from source yourself.
注意:除非您自己从源代码编译,否则当前可用的标准 Mono 运行时最多只支持 .NET 3.5。
So you want to start developing some applications for your Raspberry Pi but your knowledge of programming is limited to the modern .NET languages such as VB.NETand C#. Not a problem!! Welcome to the world of Mono, an open source cross-platform and compatible version of the .NET framework. By using a development IDE such as Visual studio, or even better MonoDevelopyou can produce EXE files that will run on your Raspberry Pi. All you need to do is to install the Mono run times on the Raspberry Pi. To do that we enter the following lines.
因此,您想开始为 Raspberry Pi 开发一些应用程序,但您的编程知识仅限于现代 .NET 语言,例如VB.NET和C#。没问题!!欢迎来到 Mono 的世界,它是 .NET 框架的开源跨平台兼容版本。通过使用诸如 Visual Studio 或更好的MonoDevelop 之类的开发 IDE,您可以生成可在您的 Raspberry Pi 上运行的 EXE 文件。您需要做的就是在 Raspberry Pi 上安装 Mono 运行时。为此,我们输入以下几行。
sudo apt-get update
sudo apt-get install mono-runtime
As mentioned in other tutorials the first line is used to update the APT-GET package manager to ensure it is using the latest sources for downloading your packages. The second line installs and prepares the runtimes for use. That's it, now to run a Mono developed EXE file. Just simply prefix the command with the word
mono
as shown below.
正如其他教程中提到的,第一行用于更新 APT-GET 包管理器,以确保它使用最新的源来下载您的包。第二行安装并准备运行时以供使用。就是这样,现在运行一个 Mono 开发的 EXE 文件。只需简单地用单词
mono
作为命令前缀,如下所示。
mono myprogram.exe
回答by S_BatMan
On my Raspberry Pi running the Fedora 18 remix, all I needed was:
在运行 Fedora 18 remix 的 Raspberry Pi 上,我只需要:
# yum -y install mono-devel
To Check:
去检查:
# csharp
Mono C# Shell, type "help;" for help
Enter statements below.
csharp> Console.WriteLine("Hello, I am PI");
Hello, I am PI
csharp>
回答by amazedsaint
Yes. I've successfully run Mono based Winforms and Webforms apps (XSP). Detailed How to is available in my blog
是的。我已经成功运行了基于 Mono 的 Winforms 和 Webforms 应用程序 (XSP)。详细的操作方法可在我的博客中找到
http://www.amazedsaint.com/2013/04/hack-raspberry-pi-how-to-build.html
http://www.amazedsaint.com/2013/04/hack-raspberry-pi-how-to-build.html
回答by r03
Hard float support is now in mono 3.2.7:
http://www.raspberrypi.org/phpBB3/viewtopic.php?t=62496&p=468500
硬浮点支持现在是单声道 3.2.7:http://www.raspberrypi.org/phpBB3/viewtopic.php?t =62496&p =468500
The latest source can be installed from git.
It should be something like this:
(remove previous mono installations first)
可以从 git 安装最新的源代码。它应该是这样的:(
先删除以前的单声道安装)
sudo apt-get update
sudo apt-get install git build-essential automake autoconf libtool gettext
git clone git://github.com/mono/mono.git
cd mono
./autogen.sh --prefix=/usr/local
make get-monolite-latest
make EXTERNAL_MCS="${PWD}/mcs/class/lib/monolite/gmcs.exe"
sudo make install
This is how "mono -V" looks like on my raspberry:
这就是“mono -V”在我的树莓上的样子:
Mono JIT compiler version 3.4.0 (master/ae165c5 Thu Mar 13 01:20:37 UTC 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: normal
Notifications: epoll
Architecture: armel,vfp+hard
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen
A quick test seems to work fine:
快速测试似乎工作正常:
csharp> Math.Pow(2,4);
16
回答by Rolwin Crasta
I was able to run my .NET exe on raspberry pi (debian).
我能够在 raspberry pi (debian) 上运行我的 .NET exe。
Install mono - http://logicalgenetics.com/raspberry-pi-and-mono-hello-world/
安装单声道 - http://logicalgenetics.com/raspberry-pi-and-mono-hello-world/
then run your exe as mono something.exe
然后运行你的exe mono something.exe
回答by vadik_lyutiy
You can run x86 version of Mono on Raspberry Pi using ExaGear Desktopsoftware.
您可以使用ExaGear 桌面软件在 Raspberry Pi 上运行 x86 版本的 Mono 。
It allow to run almost all x86 apps and even install Wine to run Windows apps.
它允许运行几乎所有 x86 应用程序,甚至可以安装 Wine 来运行 Windows 应用程序。
They say that Firefox works faster than even native ...
他们说 Firefox 的运行速度甚至比原生的还要快……