Raspbian vs Wheezy (beta) Mono support


211 posts   Page 4 of 9   1, 2, 3, 4, 5, 6, 7 ... 9
by EdwinJ85 » Tue Nov 06, 2012 11:35 am
Actually, there might be a small sliver of hope:

http://comments.gmane.org/gmane.linux.d ... s.mono/885

PS: I didn't find this and don't take credit for it, I'm just sharing the wealth.
Getting doom to run is my "Hello World".
Posts: 208
Joined: Wed Feb 01, 2012 4:44 pm
by C_W » Tue Nov 06, 2012 11:54 am
I was under the impression that Mono worked on the Arch image. Was there an older soft float version of Arch?
Posts: 5
Joined: Mon Oct 15, 2012 10:04 am
by emg » Tue Nov 06, 2012 12:00 pm
C_W wrote:I was under the impression that Mono worked on the Arch image. Was there an older soft float version of Arch?

Don't know about Arch, but it works on the last soft-float Debian Wheezy beta. That is what I use now. Download here: http://www.raspberrypi.org/archives/1435
Posts: 87
Joined: Wed Jan 11, 2012 11:01 pm
by C_W » Tue Nov 06, 2012 12:11 pm
emg wrote:
C_W wrote:I was under the impression that Mono worked on the Arch image. Was there an older soft float version of Arch?

Don't know about Arch, but it works on the last soft-float Debian Wheezy beta. That is what I use now. Download here: http://www.raspberrypi.org/archives/1435


Thanks, I have tried that one. I was after a quicker boot time, and need fast floating point.

The Arch version also seems to open applications and refresh the screen quicker in X.

It looks like I will have to go back to the Wheezy image until it is sorted.
Posts: 5
Joined: Mon Oct 15, 2012 10:04 am
by MattSwarbrick » Fri Nov 09, 2012 11:53 am
Has anyone tried compiling mono 3.0 from source. I heard there was a patch that enabled hf support... seems interesting, going to give building a try today. Does anyone know how to use the patch?

I'm going to download mono 3.0 source from here:
http://download.mono-project.com/sources/mono/mono-3.0.1.tar.bz2
it was released last night,
I'm running wheezy, i'll let you know how I get on,
Posts: 27
Joined: Thu Oct 04, 2012 3:15 pm
by MattSwarbrick » Fri Nov 09, 2012 3:35 pm
Ok so, got building up to a point and then I received the following:
Code: Select all
/tmp/cceJq7Zc.s: Assembler messages:
/tmp/cceJq7Zc.s:307: Error: selected processor does not support ARM mode `dmb'
/tmp/cceJq7Zc.s:316: Error: selected processor does not support ARM mode `dmb'
/tmp/cceJq7Zc.s:329: Error: selected processor does not support ARM mode `dmb'
/tmp/cceJq7Zc.s:338: Error: selected processor does not support ARM mode `dmb'
/tmp/cceJq7Zc.s:354: Error: selected processor does not support ARM mode `dmb'
/tmp/cceJq7Zc.s:363: Error: selected processor does not support ARM mode `dmb'
/tmp/cceJq7Zc.s:501: Error: selected processor does not support ARM mode `dmb'
/tmp/cceJq7Zc.s:509: Error: selected processor does not support ARM mode `dmb'
/tmp/cceJq7Zc.s:540: Error: selected processor does not support ARM mode `dmb'
/tmp/cceJq7Zc.s:548: Error: selected processor does not support ARM mode `dmb'
/tmp/cceJq7Zc.s:696: Error: selected processor does not support ARM mode `dmb'
/tmp/cceJq7Zc.s:705: Error: selected processor does not support ARM mode `dmb'
/tmp/cceJq7Zc.s:767: Error: selected processor does not support ARM mode `dmb'
/tmp/cceJq7Zc.s:776: Error: selected processor does not support ARM mode `dmb'
make[4]: *** [lock-free-queue.lo] Error 1
make[4]: Leaving directory `/home/pi/mono-3.0.1/mono/utils'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/pi/mono-3.0.1/mono/utils'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/pi/mono-3.0.1/mono'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/pi/mono-3.0.1'
make: *** [all] Error 2
I believe some of you have experienced this too. Did anyone get anywhere with it?
Posts: 27
Joined: Thu Oct 04, 2012 3:15 pm
by plugwash » Fri Nov 09, 2012 4:06 pm
Try doing "export CFLAGS=-march=armv6k" before building.

But iirc plain upstream 3.0.0 doesn't have the hardfloat fix. There is supposedly a patch but I haven't seen it posted publically yet.
Forum Moderator
Forum Moderator
Posts: 2244
Joined: Wed Dec 28, 2011 11:45 pm
by MattSwarbrick » Fri Nov 09, 2012 4:37 pm
Ok yeah because dmb is an instruction for armv7 not armv6 which the pi runs right? I'm kinda hoping that this release might include the patch... unlikely but at least i'll be half way there
Posts: 27
Joined: Thu Oct 04, 2012 3:15 pm
by MattSwarbrick » Fri Nov 09, 2012 5:55 pm
Did not work:
Code: Select all
mini-arm.h:17:2: error: #error "hardfp-abi not yet supported."
make[3]: *** [genmdesc-genmdesc.o] Error 1
make[3]: Leaving directory `/home/pi/mono-3.0.1/mono/mini'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/pi/mono-3.0.1/mono'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/pi/mono-3.0.1'
make: *** [all] Error 2
So guess we are still waiting
Posts: 27
Joined: Thu Oct 04, 2012 3:15 pm
by jkommeren » Fri Nov 16, 2012 9:13 am
Currently doing an internship assignment on this, been following this thread for a while now

I had a look for the armhf patch, found this:

https://github.com/directhex/mono-1/com ... f0dbef4f28

Is this it? :twisted: I'm too nervous to give it a try lol xd
Posts: 9
Joined: Fri Nov 16, 2012 9:01 am
by MattSwarbrick » Fri Nov 16, 2012 12:19 pm
I've seen this too, the code needs to be tweaked before compilation. I'm no expert in this at all, but first it needs to build using armv6 instructions not armv7, this can be done from the source or using:
Code: Select all
export CFLAGS=-march=armv6k
Then I believe that it assumes armhf == armv7 in various places and these need to be tweaked. I'm looking through the source now for the following instances:
"arm"
"ARM"
There will be a lot of instances but I'm sure one will contain the place in source that needs to change
To search you can use:
Code: Select all
grep -H -r "arm" /home/pi/mono-1/ | more
This will search all the files looking to see if they contain the string "arm", if found it will print out the name and path of the file and the line of text where the string is found
Posts: 27
Joined: Thu Oct 04, 2012 3:15 pm
by jkommeren » Fri Nov 16, 2012 5:20 pm
I'm on a Pandaboard though haha, don't seem to be having this issue (though the mono hardfp gets a lot more attention here than on the pandaboard forums, which is why I'm here :D)

Unfortunately this build fails for me too, it still says "hardfp abi not supported yet" in mini-arm.h. Still hardcoded check it seems. Hmm.

EDIT: Oops it seems I don't have the newest version. Retrying :D
Posts: 9
Joined: Fri Nov 16, 2012 9:01 am
by jkommeren » Sat Nov 17, 2012 1:11 pm
jkommeren wrote:I'm on a Pandaboard though haha, don't seem to be having this issue (though the mono hardfp gets a lot more attention here than on the pandaboard forums, which is why I'm here :D)

Unfortunately this build fails for me too, it still says "hardfp abi not supported yet" in mini-arm.h. Still hardcoded check it seems. Hmm.

EDIT: Oops it seems I don't have the newest version. Retrying :D

Update: building succeeded! Well for the non-managed code at least :o

Steps performed:
checked out the armhf-port tree with git after cloning the "mono-1" repo:
git checkout remotes/origin/armhf-port

Ran autogen for non-managed code only (build of one of the managed code files failed):
./autogen --prefix=/usr/local --disable-mcs-build

Started build (needed the cflag, or it would give an error that no architecture was defined):
make CFLAGS=-DARM_FPU_VFP_HARD

Finished with no errors :D Now fiddling around to get the managed code on another platform, and transfer it to this board if that does succeed and we'll see what happens :D

Hope this useful to others. Will keep you guys posted.
Posts: 9
Joined: Fri Nov 16, 2012 9:01 am
by jkommeren » Sat Nov 17, 2012 2:18 pm
UPDATE: Success! Did a vanilla build on PC and copied it to the board. Mono says it's working :D mono -V showed version 11.4, "armel / vfp(hard-abi)" unfortunately I can't get to the board itself atm (it's at work, I'm using VNC), and because I didn't connect a monitor, I can't run my test program until Monday. Boo!

Anyone got a quick test file I can run which would fail on the previous broken armhf mono thing? (checking the thread in a bit)

EDIT: Found this
https://bugzilla.xamarin.com/show_bug.cgi?id=7938

And yes it did show the proper time and date! :D At least this bit seems good! Step-by-step guide of what I did;

1. clone git and checkout the arm-hf port on a Ubuntu pc (see my previous posts)
2. run "./autogen.sh --prefix=/usr/local" in mono-1 dir
3. run "make"
4. run "make install DESTDIR=<empty destination dir of your choice>" (i.e. /home/joris/Downloads/PandaboardCC in my case)
5. Open folder in nautilus, compress the "usr" dir you'll find there to "usr.tar.gz"
6. On the board: clone git and checkout the arm-hf port here too (see my previous posts)
7. Build unmanaged code in mono-1 dir:
./autogen.sh --prefix=/usr/local --disable-mcs-build
make CFLAGS=-DARM_FPU_VFP_HARD

7. copy "usr.tar.gz" to root of board
8. extract contents, overwriting all existing files:
sudo tar zxvf usr.tar.gz
9. enter the mono-1 dir again
10. run "make install"

Done! To test:
Run "csharp" to enter mono shell
Run "DateTime.Now;"
A valid date should appear! :D
Posts: 9
Joined: Fri Nov 16, 2012 9:01 am
by jkommeren » Sat Nov 17, 2012 2:58 pm
jkommeren wrote:UPDATE: Success! Did a vanilla build on PC and copied it to the board. Mono says it's working :D mono -V showed version 11.4, "armel / vfp(hard-abi)" unfortunately I can't get to the board itself atm (it's at work, I'm using VNC), and because I didn't connect a monitor, I can't run my test program until Monday. Boo!

Anyone got a quick test file I can run which would fail on the previous broken armhf mono thing? (checking the thread in a bit)

EDIT: Found this
https://bugzilla.xamarin.com/show_bug.cgi?id=7938

And yes it did show the proper time and date! :D At least this bit seems good! Step-by-step guide of what I did;

1. clone git and checkout the arm-hf port on a Ubuntu pc (see my previous posts)
2. run "./autogen.sh --prefix=/usr/local" in mono-1 dir
3. run "make"
4. run "make install DESTDIR=<empty destination dir of your choice>" (i.e. /home/joris/Downloads/PandaboardCC in my case)
5. Open folder in nautilus, compress the "usr" dir you'll find there to "usr.tar.gz"
6. On the board: clone git and checkout the arm-hf port here too (see my previous posts)
7. Build unmanaged code in mono-1 dir:
./autogen.sh --prefix=/usr/local --disable-mcs-build
make CFLAGS=-DARM_FPU_VFP_HARD

7. copy "usr.tar.gz" to root of board
8. extract contents, overwriting all existing files:
sudo tar zxvf usr.tar.gz
9. enter the mono-1 dir again
10. run "make install"

Done! To test:
Run "csharp" to enter mono shell
Run "DateTime.Now;"
A valid date should appear! :D


Be careful though, this is a very rough method, some binaries in usr.tar.gz at least are not needed, and won't even run because they're built for the wrong platform. Most of these are replaced by running "make install" in the mono-1 dir, but I'm not sure that applies for all files.

Also some commands I used may be inaccurate: e.g. I'm not sure what the effect of the CFLAGS thing would have been had I applied it to the "autogen.sh" script instead of adding it to the make command (or both)

I'm just a novice user! If someone could verify the steps I'd appreciate it :geek:

P.s. after trying to run "quit" without ";" the csharp shell thingy seems to have crashed. Now I really have to wait until Monday before I can do some more testing :cry:
Posts: 9
Joined: Fri Nov 16, 2012 9:01 am
by MattSwarbrick » Mon Nov 19, 2012 10:56 am
sounds interesting! shame its not for the pi, but the insight is useful, I'm going to take a look at your steps and apply it to the pi, i guess the results will be similar. Did you have an existing installation of mono prior to building?
Posts: 27
Joined: Thu Oct 04, 2012 3:15 pm
by jkommeren » Mon Nov 19, 2012 1:22 pm
MattSwarbrick wrote:sounds interesting! shame its not for the pi, but the insight is useful, I'm going to take a look at your steps and apply it to the pi, i guess the results will be similar. Did you have an existing installation of mono prior to building?

Yeah, I think once you've got the armv7 compatibility problem (or something) out of the way, you should be able to get Mono to work with the steps I posted :)

I had mono 10.8 installed on the board previously, which is the one that's available in the 12.04.1 LTS ubu repo (probably installed by default)

Did some additional testing with EmguCV (C# wrapper around OpenCV), previous bugs which caused the system to crash (with the 10.8 build) are no longer there! Performance isn't on par with expectations yet unfortunately (about half of the soft-float build) but this could be because of the cluttered install.

Will keep you updated :) hope you Pi users can get on the Mono train too soon :D
Posts: 9
Joined: Fri Nov 16, 2012 9:01 am
by jkommeren » Wed Nov 21, 2012 3:44 pm
Update: Clean image with no mono preinstalled (extracted straight from the tar.gz): Performance: on par with expectations :mrgreen:

I can upload the archive, maybe it just works out of the box for you guys? Seems like it's worth a try at least :)
Posts: 9
Joined: Fri Nov 16, 2012 9:01 am
by cri » Wed Nov 21, 2012 5:05 pm
jkommeren wrote:Update: Clean image with no mono preinstalled (extracted straight from the tar.gz): Performance: on par with expectations :mrgreen:

I can upload the archive, maybe it just works out of the box for you guys? Seems like it's worth a try at least :)

Great news !
Could you post an explanation on how to proceed?
Posts: 2
Joined: Sun Sep 23, 2012 8:36 pm
by MattSwarbrick » Wed Nov 21, 2012 5:20 pm
yes please do!

Did you cross compile to get your usr.tar.gz.. Not sure why/how this would work on an arm device if not!
Posts: 27
Joined: Thu Oct 04, 2012 3:15 pm
by MattSwarbrick » Fri Nov 23, 2012 1:42 pm
OK, so I've tried building the arm hard float patch for mono a couple times. I've had to tweak the source code so that it doesn't use armv7 instructions to build, but has been a bit experimental and not really sure if I've done it right.
My steps are as follows (this is with no previous version of mono installed):
Code: Select all
//this installs all the required packages for building
sudo apt-get install autoconf -y
sudo apt-get install automake -y
sudo apt-get install libtool -y
sudo apt-get install gettext -y

cd
git clone git://github.com/directhex/mono-1.git
cd ~/mono-1
git checkout remotes/origin/armhf-port

export CFLAGS=-march=armv6k

./autogen.sh --prefix=/usr/local --disable-mcs-build
make CFLAGS=-DARM_FPU_VFP_HARD
make install
This succeeds and if I type mono -V I get the following:
Code: Select all
pi@raspberrypi ~/mono-1 $ mono -V
Mono JIT compiler version 2.11.4 ((no/50bb5e4 Fri Nov 23 13:04:25 UTC 2012)
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
 TLS:           __thread
 SIGSEGV:       normal
 Notifications: epoll
 Architecture:  armel,vfp(hardfp-abi)
 Disabled:      none
 Misc:          softdebug
 LLVM:          supported, not enabled.
 GC:            Included Boehm (with typed GC and Parallel Mark)
As you can see is picking up vfp(hardfp-abi)
Since I had disabled the mcs build it is now missing the required dlls, such as mscorlib.dll, so performing the build on a ubuntu machine with:
Code: Select all
sudo apt-get install autoconf -y
sudo apt-get install automake -y
sudo apt-get install libtool -y
sudo apt-get install gettext -y

cd
git clone git://github.com/directhex/mono-1.git
cd ~/mono-1
git checkout remotes/origin/armhf-port

./autogen.sh --prefix=/usr/local
make
make install DESTDIR=/home/matt/monoPiBuild
Then copying these folders onto the pi and merging them, providing the dlls. If I test with csharp I get:
Code: Select all
pi@raspberrypi ~/mono-1 $ csharp
Illegal instruction
So am now stuck... if I try mono test.exe with --verbose I get:
Code: Select all
mono --verbose test.exe
converting method System.OutOfMemoryException:.ctor (string)
Method System.OutOfMemoryException:.ctor (string) emitted at 0x40714b68 to 0x40714b9c (code length 52) [test.exe]
converting method (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object (object,intptr,intptr,intptr)
Method (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object (object,intptr,intptr,intptr) emitted at 0x40714bb8 to 0x40714c88 (code length 208) [test.exe]
converting method System.ExecutionEngineException:.ctor ()
Method System.ExecutionEngineException:.ctor () emitted at 0x40714c88 to 0x40714cac (code length 36) [test.exe]
converting method (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
Method (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr) emitted at 0x40714cb0 to 0x40714d70 (code length 192) [test.exe]
Illegal instruction
Any suggestions?
Posts: 27
Joined: Thu Oct 04, 2012 3:15 pm
by plugwash » Fri Nov 23, 2012 2:36 pm
Reading through https://github.com/directhex/mono-1/com ... f0dbef4f28 I notice the following peice of code

https://github.com/directhex/mono-1/com ... f0dbef4f28

#elif defined(ARM_FPU_VFP_HARD)
v6_supported = TRUE;
v7_supported = TRUE;
thumb_supported = TRUE;
#else

If that chunk of code is in your version of the source you might want to change it ;)
Forum Moderator
Forum Moderator
Posts: 2244
Joined: Wed Dec 28, 2011 11:45 pm
by EdwinJ85 » Tue Nov 27, 2012 11:49 am
Keep up the good work guys, I am glad people are still working on this.
Getting doom to run is my "Hello World".
Posts: 208
Joined: Wed Feb 01, 2012 4:44 pm
by EdwinJ85 » Tue Dec 04, 2012 3:20 pm
Is there any news on the progress with this issue?

It seems Ubuntu for arm suffers the same issue, on the new Series 3 samsung arm chromebook at least:

http://mono.1490590.n4.nabble.com/Mono- ... 57617.html

Maybe we should contact canonical and see if they want to pool resources? I'm not very technical but if we get arm v6 debian mono implementation working that should work fine on an arm v7 running ubuntu right due to backwards compatibility?

Arm is the future after all...
Getting doom to run is my "Hello World".
Posts: 208
Joined: Wed Feb 01, 2012 4:44 pm
by jkommeren » Thu Dec 06, 2012 10:23 am
Sorry Matt and others for very late response, didn't have any time! :(

I'll post what I have (for the pandaboard, which is armv7 and should be compatible with all other armv7+) hang on :mrgreen:

By the way, even with just the mono build installed compiled via this way, I wasn't able to succesfully compile the *whole* package on the board. (same error) It appears the code needed for that part on the board hasn't been added (yet).
Which is very likely true for the Raspberry Pie bit too.

Update: Here we go!

https://dl.dropbox.com/u/15188774/Mono% ... usr.tar.gz

(this is the merged folder with half compiled on pc, other half on pandaboard)


If you want just the pc part for some reason, this is it:

https://dl.dropbox.com/u/15188774/Mono% ... usr.tar.gz

(It's bigger than the first, the merge overwrote some with smaller files apparently)
Posts: 9
Joined: Fri Nov 16, 2012 9:01 am