Search code examples
monomakefilearmraspberry-piraspbian

Compiling Mono 3.x on Raspberry Pi


To get rid of the soft float vs. hard float ABI problem I tried to install an up-to-date version of mono on my Raspberry Pi with

git clone https://github.com/mono/mono.git
cd mono
git submodule init
git submodule update
./autogen.sh --prefix=/usr/local
make
make install

The make command fails. The errors are as follows:

make[6]: gmcs: Command not found
make[6]: *** [build/deps/basic-profile-check.exe] Error 127
*** The compiler 'gmcs' doesn't appear to be usable.
*** You need Mono version 2.4 or better installed to build MCS
*** Check mono README for information on how to bootstrap a Mono installation.
make[5]: *** [do-profile-check] Error 1
make[4]: *** [profile-do--basic--all] Error 2
make[3]: *** [profiles-do--all] Error 2
make[2]: *** [all-local] Error 2
make[2]: Leaving directory `/home/pi/mono/runtime'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/pi/mono'

To fix this I tried to install mono with "sudo apt-get install mono-runtime" and then start the make again. But the error remains.

Is it possible to get Mono 3.x working on ARM (the Raspberry Pi)?


Solution

  • There are two possible solutions to this:

    1. Compile mono from a tarball, not from git. A tarball is just a compressed package that contains all the sources ready to be compiled in a standalone way. For mono, you can find the tarballs if you go to http://www.go-mono.com/mono-downloads/ and click on the "Mono sources" link, which links to http://download.mono-project.com/sources/mono/. You would need mono 3.2.8 or newer because that is the first version to implement HardFloat support for ARM.
    2. Keep cloning from git, but use make get-monolite-latest command before make. More details here.