Yesterday, Alex Petersen checked in the arm hard float support for Mono 3.2.7 to the official Mono git repository. I was able to compile and install Mono 3.2.7 without any issues on a Raspbian system, and as I write this message the unit tests for Mono are nearly complete without error.
This is a big step forward allowing developers to target the .Net 4 and 4.5 runtime engines on the Mono platform.
dkingsley@raspberrypi ~ $ mono --version
Mono Runtime Engine version 3.2.7 (master/1cf4b6f Tue Dec 3 21:09:40 EST 2013)
Copyright (C) 2002-2013 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
-
- Posts: 12
- Joined: Wed Dec 04, 2013 12:39 pm
Re: Mono 3.2.7 with hard float
Good news - thanks for the heads up.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.
Working in the Applications Team.
Re: Mono 3.2.7 with hard float
This is amazing news!!!
Re: Mono 3.2.7 with hard float
This is bloody awesome mates!!!
Did you have to cross compile? Or can you compile everything right on the device itself??
Did you have to cross compile? Or can you compile everything right on the device itself??
Re: Mono 3.2.7 with hard float
Any tips on compiling?
Re: Mono 3.2.7 with hard float
Try the instructions on this page:
http://www.mono-project.com/Compiling_Mono_From_Git
http://www.mono-project.com/Compiling_Mono_From_Git
Re: Mono 3.2.7 with hard float
I was told by Alex you can just compile on the device... which I plan on trying very soon.
It would rock to get Mono part of the main repo now. Or at least plan on it when the next official version of mono that supports it comes out.
It would rock to get Mono part of the main repo now. Or at least plan on it when the next official version of mono that supports it comes out.
-
- Posts: 12
- Joined: Wed Dec 04, 2013 12:39 pm
Re: Mono 3.2.7 with hard float
I have a pretty well developed script that I use on my work Cluster that I was able to use nearly unmodified to compile Mono from the Git repository. I am building directly on my first generation Pi, it takes about 6 hours. I have it setup as a cron job that runs every night now. If your network does not support the git:// protocol, you will have to let the script fail then cd into the mono directory and modify the .gitmodules file and change the git:// to https:// and in the mono/.git directory the config file and perform the same change.
The script has been included below, and at the bottom I have a portion of my .bashrc file that shows how we adjust the path to run the new mono instead of the one from raspbian.
You will need a approximately 2 GB of flash/disk space for the compile operation.
Edited to fix the script.
in my .bashrc I have setup paths to find the newly installed Mono
The script has been included below, and at the bottom I have a portion of my .bashrc file that shows how we adjust the path to run the new mono instead of the one from raspbian.
You will need a approximately 2 GB of flash/disk space for the compile operation.
Edited to fix the script.
Code: Select all
#!/bin/sh
# setup some variables, monodir is where Mono will be installed, topDir is where Mono will be cloned to.
export monodir=`pwd`/mono3.2.7
export topdir=`pwd`
# if gcc48 is not the default gcc set these variables
#export CC=gcc48
#export CXX=g++48
#export CFLAGS="-I$monodir/include -m64"
#export LDFLAGS="-L/$monodir/lib -m64 -L/<gcc48Libs>/lib64"
# libgdi
cd $topdir
# get and build libgdi first.
git clone http://github.com/mono/libgdiplus.git
cd libgdiplus
./autogen.sh --prefix=$monodir --enable-shared=yes --with-libgif=$monodir
make
make install
# git mono sources
cd $topdir
# get clone the mono repo, if ./mono exists this will fail and the git pull will take over.
git clone http://github.com/mono/mono
cd mono
git pull
git checkout master
# on my systems the -Wnone flag is not supported by autotools
# find all the -Wnone macros and remove them
sed -i 's/-Wnone/ /g' ./libgc/autogen.sh
sed -i 's/-Wnone/ /g' ./autogen.sh
echo "Install mono into: $monodir"
echo "TopDir: $topdir"
./autogen.sh --prefix=$monodir --with-sgen=yes --with-large-heap=yes --with-xen_opt=no --enable-parallel-mark --with-libgdiplus=$monodir/lib
# get the mono-lite to perform bootstrap builds
make get-monolite-latest
cd $topdir/mono
# use the following line to use the new boot strap code.
make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/gmcs.exe
make
make install
Code: Select all
export MyMonoBin=/home/<username>/mono3.2.7/bin:
export MyMonoLib=/home/<username>/mono3.2.7/lib:
export MyMonoMan=/home/<username>/mono3.2.7/man:
# notice we poke the new mono path in front of the existing path so that the new mono is found first.
export PATH=$MyMonoBin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MyMonoLib
export LD_RUN_PATH=$LD_RUN_PATH:$MyMonoLib
export MANPATH=$MANPATH:$MyMonoMan
Re: Mono 3.2.7 with hard float
Just did a build, took very long to do(All night).
You can just build normally on the Pi via. "config, make, make install"...
In my benchmark this mono version is consistently faster about 10 sec faster then 2.11.4.
https://github.com/zezba9000/RayTraceBenchmark
You can just build normally on the Pi via. "config, make, make install"...
In my benchmark this mono version is consistently faster about 10 sec faster then 2.11.4.
https://github.com/zezba9000/RayTraceBenchmark
-
- Posts: 12
- Joined: Wed Dec 04, 2013 12:39 pm
Re: Mono 3.2.7 with hard float
"config, make, make install" will do if you have a working mono installed on the system. Otherwise you have to go through the bootstrap process as done in my script. Also, the script I provided installs the newly compiled Mono in the users account and does not over-write the system installed version if it exists.zezba9000 wrote:Just did a build, took very long to do(All night).
You can just build normally on the Pi via. "config, make, make install"...
In my benchmark this mono version is consistently faster about 10 sec faster then 2.11.4.
https://github.com/zezba9000/RayTraceBenchmark
Most of the performance gains you are seeing are likely related to garbage collection were serious efforts were made by the mono developers early in 3.x.
Re: Mono 3.2.7 with hard float
*shameless plug*
I managed to build this on a clean raspbian install, but there were a couple of gaps in the install instructions, so I wrote my findings here - http://neildanson.wordpress.com/2013/12 ... ard-float/
Hopefully of use to someone (at least until it gets put in the packages repo
)
I managed to build this on a clean raspbian install, but there were a couple of gaps in the install instructions, so I wrote my findings here - http://neildanson.wordpress.com/2013/12 ... ard-float/
Hopefully of use to someone (at least until it gets put in the packages repo

Re: Mono 3.2.7 with hard float
I successfully built the 3.2.7 source code on the Pi, but am having trouble building the libgdiplus. The error that I get when i run ./autogen.sh --prefix=/usr/local (according to the mono web page) is pkg-config doesn't like glib-2.0. Says it is missing.
So I did sudo apt-get install glib-2.0 and it installed the package. I still get the error, however.
The error message talks about setting up pkg-config, but I can't find a glib-2.0.pc file anywhere on the system. Not sure what apt-get install glib-2.0 installed, but if I run it again it says it is already installed, so I don't know what to do now.
Suggestions?
So I did sudo apt-get install glib-2.0 and it installed the package. I still get the error, however.
The error message talks about setting up pkg-config, but I can't find a glib-2.0.pc file anywhere on the system. Not sure what apt-get install glib-2.0 installed, but if I run it again it says it is already installed, so I don't know what to do now.
Suggestions?
-
- Posts: 12
- Joined: Wed Dec 04, 2013 12:39 pm
Re: Mono 3.2.7 with hard float
When I run "pkg-config --modversion glib-2.0" I get 2.36.4 and I am able to build libgdiplus. Are you cloning the Git repository for libgdiplus at http://github.com/mono/libgdiplus.git, I had tried with a tar ball of libgdiplus earlier and had trouble.tpitman wrote:I successfully built the 3.2.7 source code on the Pi, but am having trouble building the libgdiplus. The error that I get when i run ./autogen.sh --prefix=/usr/local (according to the mono web page) is pkg-config doesn't like glib-2.0. Says it is missing.
So I did sudo apt-get install glib-2.0 and it installed the package. I still get the error, however.
The error message talks about setting up pkg-config, but I can't find a glib-2.0.pc file anywhere on the system. Not sure what apt-get install glib-2.0 installed, but if I run it again it says it is already installed, so I don't know what to do now.
Suggestions?
Re: Mono 3.2.7 with hard float
I am cloning from there. I will try it all again from scratch to see what happens.
When I type pkg-config --modversion glib-2.0 I get:
Package glib-2.0 was not found int he pkg-config search path.
Perhaps you should add the directory containing 'glib-2.0.pc' to the PKG_CONFIG_PATH environment variable
No package 'glib-2.0' found
I search the entire file system and didn't find any glib-2.0.pc file anywhere.
If you look in my original post I also indicated that I had done a sudo apt-get glib-2.0 and it installed. If I do it again I am told it already exists and is the latest version.
When I type pkg-config --modversion glib-2.0 I get:
Package glib-2.0 was not found int he pkg-config search path.
Perhaps you should add the directory containing 'glib-2.0.pc' to the PKG_CONFIG_PATH environment variable
No package 'glib-2.0' found
I search the entire file system and didn't find any glib-2.0.pc file anywhere.
If you look in my original post I also indicated that I had done a sudo apt-get glib-2.0 and it installed. If I do it again I am told it already exists and is the latest version.
-
- Posts: 12
- Joined: Wed Dec 04, 2013 12:39 pm
Re: Mono 3.2.7 with hard float
The glib-2.0.pc on my machine is found in "/usr/lib/arm-linux-gnueabihf/pkgconfig/glib-2.0.pc", you might want to use the -f option on apt-get. I have never had the need to use it but it sounds like it might work "-f Attempt to correct a system with broken dependencies in place"
Re: Mono 3.2.7 with hard float
What command did you use to install glib-2.0 in the first place? I started with a clean install of the latest NOOBS and chose Raspbian.
I tried to build libgdi once right away and got the missing glib-2.0 error.
I then ran sudo apt-get install glib-2.0. It found several things that were already at the latest and then installed 1 more.
I looked in that same folder and have a couple of .pc files, but no glib like yours.
Is it a special pkg-config install for glib that I have to do or is it a apt-get install?
Thanks for your help.
I tried to build libgdi once right away and got the missing glib-2.0 error.
I then ran sudo apt-get install glib-2.0. It found several things that were already at the latest and then installed 1 more.
I looked in that same folder and have a couple of .pc files, but no glib like yours.
Is it a special pkg-config install for glib that I have to do or is it a apt-get install?
Thanks for your help.
Re: Mono 3.2.7 with hard float
Hello
Same config (NOOBS+Raspbian 3.10.23+) and same issue thant tpitman with lidgdiplus
Plus that I haven't gcc48 install on it but only gcc4.7 (and 4.6's the default).
Thx for your help
Same config (NOOBS+Raspbian 3.10.23+) and same issue thant tpitman with lidgdiplus
Plus that I haven't gcc48 install on it but only gcc4.7 (and 4.6's the default).
Thx for your help
jmn - Grenoble, France
-
- Posts: 12
- Joined: Wed Dec 04, 2013 12:39 pm
Re: Mono 3.2.7 with hard float
I started with the very first Raspbian image that was released and updated it ever since, so I have no experience with NOOBs.
Have you installed the dev package for glib-2.0? If you have then I am not sure where to point you to. Building glib from source is a real pain to get all the dependencies correct.
With respect gcc48, I believe its the default: "gcc (Raspbian 4.8.2-1+rpi1) 4.8.2". I usually need to build gcc48 on my other machines I was pleasantly surprised to find it already installed. Gcc47 works fine for the most part, I found Mono ran 5-10% faster when compiled with gcc48 on my other machines.
Have you installed the dev package for glib-2.0? If you have then I am not sure where to point you to. Building glib from source is a real pain to get all the dependencies correct.
With respect gcc48, I believe its the default: "gcc (Raspbian 4.8.2-1+rpi1) 4.8.2". I usually need to build gcc48 on my other machines I was pleasantly surprised to find it already installed. Gcc47 works fine for the most part, I found Mono ran 5-10% faster when compiled with gcc48 on my other machines.
Re: Mono 3.2.7 with hard float
I did a fresh install of the RPi using NOOBS and Raspbian. The gcc version is 4.6.3-14+rpil when I do gcc --version.
Re: Mono 3.2.7 with hard float
I figured it out. This is going to show what a noob I am to linus dev.
Turns out I needed to sudo apt-get install libglib2.0-dev (note the -dev). I was poking around and read a post on how when you install libraries often you need to install the -dev version of the library if you are trying to build stuff. Now I know...
I am now running into additional errors. The latest is:
./configure: line 13442: test: too many arguments
configure: error: "Failed to compile with X11/xlib.h include. You must fix your complier paths"
Turns out I needed to sudo apt-get install libglib2.0-dev (note the -dev). I was poking around and read a post on how when you install libraries often you need to install the -dev version of the library if you are trying to build stuff. Now I know...
I am now running into additional errors. The latest is:
./configure: line 13442: test: too many arguments
configure: error: "Failed to compile with X11/xlib.h include. You must fix your complier paths"
-
- Posts: 12
- Joined: Wed Dec 04, 2013 12:39 pm
Re: Mono 3.2.7 with hard float
This is the same type of problem, you will need the dev libraries for x11 and several others.
Re: Mono 3.2.7 with hard float
I just created a web page on my web site with the details of all the packages you have to install in order to build the libgdiplus stuff for Mono. Here is a link:
http://www.shatalmic.com/raspberry-pi-mono-libgdiplus
http://www.shatalmic.com/raspberry-pi-mono-libgdiplus
Re: Mono 3.2.7 with hard float
Tried to get a working Mono on my newly installed Rasperry by running:
git clone https://github.com/mono/mono.git
cd mono
git submodule init
git submodule update
sudo apt-get install mono-complete
sudo apt-get install automake
sudo apt-get install libtool
sudo apt-get install gettext
./autogen.sh --prefix=/usr/local
make
make install
(a couple of hours later it was done...)
Now I was hoping to see an updated version of mono so I run:
mono -V
...but it still shows I'm running 2.10.8.1?!? What am I doing wrong here?
Thanks in advance!
// Tony H
git clone https://github.com/mono/mono.git
cd mono
git submodule init
git submodule update
sudo apt-get install mono-complete
sudo apt-get install automake
sudo apt-get install libtool
sudo apt-get install gettext
./autogen.sh --prefix=/usr/local
make
make install
(a couple of hours later it was done...)
Now I was hoping to see an updated version of mono so I run:
mono -V
...but it still shows I'm running 2.10.8.1?!? What am I doing wrong here?
Thanks in advance!
// Tony H
-
- Posts: 12
- Joined: Wed Dec 04, 2013 12:39 pm
Re: Mono 3.2.7 with hard float
You need to adjust your path so that the newly installed mono will be found first, and 2 other shell variables. I have a snippet of my .bashrc file at the bottom of this post http://www.raspberrypi.org/forum/viewto ... 63#p466363.tonyhtp wrote: ./autogen.sh --prefix=/usr/local
make
make install
(a couple of hours later it was done...)
Now I was hoping to see an updated version of mono so I run:
mono -V
...but it still shows I'm running 2.10.8.1?!? What am I doing wrong here?
Re: Mono 3.2.7 with hard float
So, on my side, I can run the procedure of djkingsley until the "make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/gmcs.exe"
Unfortunately, after 4 hours, I get this:
--------
mkdir -p -- build/deps
make[6]: /home/pi/monobuild/mono/mcs/class/lib/monolite/gmcs.exe : commande introuvable
make[6]: *** [build/deps/basic-profile-check.exe] Erreur 127
*** The compiler '/home/pi/monobuild/mono/mcs/class/lib/monolite/gmcs.exe' doesn't appear to be usable.
*** Trying the 'monolite' directory.
Bootstrap compiler: Mono C# compiler version 3.2.7.0
./../jay/jay: 7 shift/reduce conflicts.
mkdir -p -- ../class/lib/basic/
MCS [basic] basic.exe
warning CS8001: SDK path could not be resolved
Compilation succeeded - 1 warning(s)
mkdir -p -- ../../class/lib/basic/tmp/
MCS [basic] mscorlib.dll
System/BitConverter.cs(45,17): error CS0589: Internal compiler error during parsingSystem.FormatException: Input string was not in the correct format
at System.Double.Parse (System.String s, NumberStyles style, IFormatProvider provider) [0x00000] in <filename unknown>:0
at Mono.CSharp.Tokenizer.adjust_real (TypeCode t, Location loc) [0x00000] in <filename unknown>:0
at Mono.CSharp.Tokenizer.is_number (Int32 c, Boolean dotLead) [0x00000] in <filename unknown>:0
at Mono.CSharp.Tokenizer.xtoken () [0x00000] in <filename unknown>:0
at Mono.CSharp.Tokenizer.token () [0x00000] in <filename unknown>:0
at Mono.CSharp.CSharpParser.yyparse (yyInput yyLex) [0x00000] in <filename unknown>:0
at Mono.CSharp.CSharpParser.parse () [0x00000] in <filename unknown>:0
System/Convert.cs(887,14): error CS0589: Internal compiler error during parsingSystem.FormatException: Input string was not in the correct format
...
----------
Did I forget something? Any idea?
The gmcs.exe is really not in /home/pi/monobuild/mono/mcs/class/lib/monolite.
In this directory, I only have:
basic.exe Mono.Security.dll mscorlib.dll System.Core.dll System.dll System.Xml.dll
Unfortunately, after 4 hours, I get this:
--------
mkdir -p -- build/deps
make[6]: /home/pi/monobuild/mono/mcs/class/lib/monolite/gmcs.exe : commande introuvable
make[6]: *** [build/deps/basic-profile-check.exe] Erreur 127
*** The compiler '/home/pi/monobuild/mono/mcs/class/lib/monolite/gmcs.exe' doesn't appear to be usable.
*** Trying the 'monolite' directory.
Bootstrap compiler: Mono C# compiler version 3.2.7.0
./../jay/jay: 7 shift/reduce conflicts.
mkdir -p -- ../class/lib/basic/
MCS [basic] basic.exe
warning CS8001: SDK path could not be resolved
Compilation succeeded - 1 warning(s)
mkdir -p -- ../../class/lib/basic/tmp/
MCS [basic] mscorlib.dll
System/BitConverter.cs(45,17): error CS0589: Internal compiler error during parsingSystem.FormatException: Input string was not in the correct format
at System.Double.Parse (System.String s, NumberStyles style, IFormatProvider provider) [0x00000] in <filename unknown>:0
at Mono.CSharp.Tokenizer.adjust_real (TypeCode t, Location loc) [0x00000] in <filename unknown>:0
at Mono.CSharp.Tokenizer.is_number (Int32 c, Boolean dotLead) [0x00000] in <filename unknown>:0
at Mono.CSharp.Tokenizer.xtoken () [0x00000] in <filename unknown>:0
at Mono.CSharp.Tokenizer.token () [0x00000] in <filename unknown>:0
at Mono.CSharp.CSharpParser.yyparse (yyInput yyLex) [0x00000] in <filename unknown>:0
at Mono.CSharp.CSharpParser.parse () [0x00000] in <filename unknown>:0
System/Convert.cs(887,14): error CS0589: Internal compiler error during parsingSystem.FormatException: Input string was not in the correct format
...
----------
Did I forget something? Any idea?
The gmcs.exe is really not in /home/pi/monobuild/mono/mcs/class/lib/monolite.
In this directory, I only have:
basic.exe Mono.Security.dll mscorlib.dll System.Core.dll System.dll System.Xml.dll
jmn - Grenoble, France