It’s hard to ignore Mono these days, and like many I have played around with it using Xamarin Developer. However, my excitement grew when I noticed that Mono now supports the Hardware Floating Point of the Raspberry Pi, meaning that I can now write/re-use C# code on my collection of Raspberry Pis running Rasbian.
Assuming Debian/Raspian, the following command adds the latest version of Mono to the Pi.
$ sudo apt_get install mono-complete
Once this has completed, the following command will confirm the installation.
$ mono --version
Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-4+rpi1)
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
To test the mono installation, I simply copied the Visual Studio 2013 compiled binaries (TravelingSalesman.exe and GAF.dll) from the Traveling Salesman example project to the Raspberry Pi. Using the SCP command using the Mac Terminal program, I simply navigate to the bin folder where the binaries live and execute the scp command to copy the files over. I used the Mac Terminal program, but any SSH client should work.
$ scp *.exe pi@10.0.1.66:mono
$ scp *.dll pi@10.0.1.66:mono
Once the copy is complete, all that is required is to run the EXE on the Raspberry Pi, e.g.:
$ mono TravellingSalesman.exe
The results are shown below:
To see a .NET managed library, compiled for Windows, running perfectly on a Raspberry Pi is awesome.