Mono Compatibility

Jul 24, 2013 at 12:29 AM
Hi All,

I just noticed that Mark put together a Bio.Mono project (awesome!) and also that at least a few people have seemed to try out .NET Bio on mono. I know there had been some discussion before about using mono with .NET Bio, and I wanted to share a bit of my experiences and make a suggestion about code changes to the trunk to get this to work.

Using .NET Bio and Mono.

The Broad has a CentOS cluster and I also have a mac available to me there, these experiences are based on these platforms.
  • Runtime/Compilation issues. In general, the library is completely cross platform provided that a mono version >3.00 is installed. Versions <2.10 do not compile the complete code base and run in to a few problems. Unfortunately, I think this 2.10 versus >3.00 issue might be problematic for neophytes. CentOS ships with a 1.0 version of Mono, which conflicts with an overlapping code if you install mono in a local directory. Similarly, Xamarin studio for some reason ships with 2.12 as the default, and so can't completely compile it as is.
This means that to get good performance and to compile the code, one has to config/make/install mono from source, which leads to all the nonsense with gcc that I have been able to avoid for so many years by working in C#. On the plus side, once mono >3.0 is installed it works just great in Xamarin studio and in Mac/Linux, and most institutes that have linux clusters have a paid staff to load/compile gcc stuff.
  • Performance is MUCH improved in mono with the --gc=sgen option.
  • Graphics - a total nightmare in mono, I have been trying to get all my code in one runtime lately, and have tried to port Oxyplot over to make visualizations of my assemblies and avoid calling R all the time. However, there are a lot of issues with fonts, rendering, etc. It showed me why Xamarin seems to be pushing a C# backend but a different front-end across platforms. For this reason, I have basically given up making visualizations in mono, and tend to only do it in pure .NET. Similarly, I don't think things like Sho, which is awesome, would work very well in mono.
Which brings me to the suggestion/discussion part of this post. I think it might be nice to have a namespace like Bio.CrossPlatform that just has some basic methods such as an IsRunningInMono method, or anything else that comes up. I use this for example to decided if my analysis will output a PDF with charts when done.

Mark, I know you made a separate Bio.Mono solution for .NET Bio (thanks!). But wasn't sure how you decided what to put in there. It seems to me we could either have separate mono/.net builds, or have one build but use flags where appropriate (.NET Bio doesn't seem to have many win32 system calls so I actually think it is largely compatible, and may not need a separate build).

Thoughts? Separate build versus single? The value of a Bio.CrossPlatform namespace with one method and perhaps more as issues crop up?

I gather C# will always be better on Windows, but since it can work on other platforms and seems to be getting better by the day, I think it would be useful to take advantage of this.

Jul 24, 2013 at 5:59 PM
I agree - it would be far better to have a MONO cross-platform story; if anyone expects to run a selection of the best bioinformatics tools, they will need Linux/OSX support alongside Windows. The issue we have had until now is a lack of MONO experience among those involved in this project, which limited our explorations, and our willingness to add - and therefore have to maintain - specific cross-platform code.

This is a volunteer project of course, and so if these are aspects of the project that you need, or which appeal to you, it would be great to see more work in this area, I can see it would be of tremendous benefit. As a first step, if you were able to write a short 'how-to' guide for getting up and running on MONO, we could include it under the documentation section?


Jul 25, 2013 at 1:24 PM
I can't think of anything Mono can't do as of today - they just announced async/await support so they are even ready with .NET 4.5. I took a bare minimum just as an example, but I could spend another hour and I bet I could get almost everything up and running under Mono.


Mark Smith

[email removed] | @marksm | 214-774-4749 |

Jul 25, 2013 at 3:31 PM
Ah, indeed, looks like Xamarin studio now ships with Mono 3.2! That pretty much takes care of the compilation issues on Mac OSX.

Come to think of it though, most newbies would probably not be recompiling .NET bio. And as far as I can tell the IL assemblies work just fine assuming mono is installed, so the current file hould work fine.

The only issue that leaves is allowing people to install ironpython on linux/OSX. Perhaps we should just make a download and if I find time on an airplane I can write up a quick guide to running some example scripts using ipy/mono/.net bio.
Jul 25, 2013 at 5:02 PM
I run a Mac most of the time - it's actually where I build the current version. I'll take the full library and port it and post my results.