Reputation: 6794
Will MonoDevelop compile to the ARMv6, mainly so I can get it running on my Raspberry Pi?
I've noted that Debian can run on the Raspberry Pi and Debian has a set of drivers for Mono.
So does this mean we'll be able to develop in Mono?
Upvotes: 41
Views: 24691
Reputation: 505
Mono on the Raspberry Pi is possible and reasonably easy to set up. The following assumes you're on Debian. Create your application in MonoDevelop (or Visual Studio with the Mono libraries) and then send it over to the Raspberry Pi. Once on the Raspberry Pi it will run as standard. Because of the nature of C#, .NET and JIT, you don't have to "compile" as such, just have the runtimes available to interpret the code produced by MonoDevelop. I would try not to develop on the Raspberry Pi itself with MonoDevelop as it is fairly heavy for the device.
This is taken from my blog that offers a number of Raspberry Pi tutorials.
Note: the standard Mono runtime currently available only supports up to .NET 3.5 unless you compile from source yourself.
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.NET and 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 MonoDevelop, you 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.
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.
mono myprogram.exe
Upvotes: 7
Reputation: 193
2013 notes --- F# meets the Raspberry Pi
Trying to get F# working on the Raspberry Pi
Upvotes: 0
Reputation: 331
The Mono project supports ARM, so one should be able to build and use MonoDevelop on the Raspberry Pi. At least that's what I'm hoping!
2012-05-16
I got my Raspberry Pi yesterday (yay!) and can confirm that it is possible to compile and run .NET code (I tested with C#) using Mono and its MCS compiler module. This was all done via the shell and not a GUI. It would be great to get the MonoDevelop IDE running if at all possible though.
For those interested, you can install Mono by typing:
sudo apt-get install mono-complete
This also includes the MCS compiler module, so you can simply compile a .cs file thus:
mcs program.cs
and run it like so:
mono program.exe
Upvotes: 33
Reputation: 64527
Just a note to add to the other answers, it works fine on the Debian install but does not yet work on the Raspbian install because of missing compiler support. More information can be found here:
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=66&t=11634&start=25
Quoted from what appears to be the most informed answer:
As I understand it, Raspbian uses a different "calling convention", so floating point numbers are "transferred" on the CPU in a different way. All compilers must create machine code that uses the Raspbian calling convention. It's no problem for software compiled with GCC, as it is configured to use that calling convention by default.
However, when using less common compilers (like the mono CLI -> machine code just-in-time compiler), things are not quite working yet. The mono JIT compiler apparently uses the old calling convention for everything it compiles, because no one has implemented the new calling convention in mono yet. That's fine as long as the mono code doesn't call into some non-mono code, but breaks as soon as you use a native library.
The details in this are probably wrong, but maybe it describes the problem in general.
Edit: And just to make this clear, the "Raspbian calling convention" is nothing specially created for raspbian. It's the same as in debian armhf and (I think) any other linux that uses armhf.
Upvotes: 12