Jun 30 2014

SGeoS Add Mono to provide MS .NET compatibility – Module 5 of 9

Published by at 0944h under SL In General

Add Mono to provide MS .NET compatibility

Build steps for configuration Module-stage-5

1) Start from completed system Module-stage-4

2) Install from binary (ease of install is most important) Or go to next step
Mono is  a compromise, running a Microsoft .NET environment built for cross-platform use—but it provides a C# compiler and runs CIL in a way that will satisfy the needs of many .NET 4.5 applications.  For over 10 years, Mono developers worked to bring .NET to all manner of platforms, but in 2011 they formed a San Francisco-based startup Xamarin and have focused on producing commercial development tools that unify Windows, iOS and Android.  The platform has moved forward through version 3.2.8 of 2014.02.19 and yet with a mobile focus, the Xamarin startup may be headed toward acquisition, potentially even by Microsoft, weakening its long-term credibility for Open Source.  None the less, here’s how to add this component from binary to the Geospatial Hybrid Device.

Start with a tarball download

yum -y install glib2-devel libpng-devel libexif-devel libX11-devel fontconfig-devel
su – postgres
cd /opt/installs
wget http://download.mono-project.com/sources/mono/mono-3.2.8.tar.bz2
tar xvf mono-3.2.8.tar.bz2
cd mono-3.2.8
./configure --prefix=/usr/local

mono_autogen0

make
sudo make install
./configure --enable-nunit-tests
make -k check

Perhaps because the code base now includes iOS, Android, and Windows, it is expected that a few of the tests will not work.  A trivial C# program can be compiled and executed to validate:
cs_test_code

cs_test_code2

 
3) Clone Mono from git (less convenient; anticipates most current Mono version) These steps are repeated in Module 9 for the Open Simulator install, but placed here in case one prefers to emphasize most current Mono, at some extra effort.  Cloning a git repository is at the edge; if it doesn’t work one day, try again in a day or two when the developers have patched it up.

These steps are adapted from a blend of build descriptions
http://stackoverflow.com/questions/13184384/mono-3-0-0-build-on-centos-6
https://www.bluewhaleseo.com/blog/asp-netc-linux-centos6-apache2-ispconfig3-mono3/
http://stackoverflow.com/questions/22844569/build-error-mono-3-4-0-centos
http://stackoverflow.com/questions/11410020/compile-install-mono-on-centos-cant-get-past-make
while it’s compiling, mono looks like a mess of warnings for 20 minutes.

Building seems to work in the end, but it does evoke a certain Microsoft-like cloud of doubt while watching mono build.  When working, mono can be a very cool capability in the eyes of those invested in .NET apps and a lever for mitigating anti-Linux attitude among Windows developers.

cd /opt/installs
git clone  https://github.com/mono/mono.git
cd mono
./autogen.sh --prefix=/usr/local

mono_autogen0

The next step is the  intriguing “Use mono to make mono” step.  Monolite is the spartan build that only has enough to run the old gmcs.exe compiler, from which the real mono can be bootstrapped.

make get-monolite-latest
make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/gmcs.exe -j 4
make check -j 4

Mono should pass all checks

make install
mono -V

mono_361_version

For future updates of Mono, if desired

cd /opt/installs/mono
git pull
./autogen.sh --prefix-/usr/local
make
make install

No responses yet

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.