# Compiling GP Ruby.NET Compiler on Mono

**URL:** <https://www.ruby-forum.com/t/compiling-gp-ruby-net-compiler-on-mono/64005>\
**Category:** Ruby\
**Created:** [June 21, 2006, 9:38am UTC](https://www.ruby-forum.com/t/compiling-gp-ruby-net-compiler-on-mono/64005 "2006-06-21T09:38:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 21, 2006, 9:38am UTC](https://www.ruby-forum.com/t/compiling-gp-ruby-net-compiler-on-mono/64005/1 "2006-06-21T09:38:51Z")

</div>

Hi,

Recently Gardens Point [Ruby.NET](http://Ruby.NET) Compiler was released. It’s available  
here:  
[http://plas.fit.qut.edu.au/Ruby.NET/](http://plas.fit.qut.edu.au/Ruby.NET/)

This post is a walkthrough on how to compile it on Mono.

First, you need to get Mono from SVN trunk. The latest release is  
1.1.15 but it won’t do. (Missing property in System.IO.StreamReader.)  
Get SVN revision later than 60046.

Next, you need to patch Mono C# compiler. GP [Ruby.NET](http://Ruby.NET) Compiler is  
beaten by Mono bug #77963, which causes deriving class from generic  
type whose generic argument is its nested class to fail. Unfortunately  
this is the case for Ruby.Dictionary class which derives from  
System.Collections.Generic.Dictionary\<Ruby.Dictionary.Key, object\>.  
This is obviously Mono’s fault, but it would be great if [Ruby.NET](http://Ruby.NET) team  
can move Key class out of Dictionary class to avoid this.

So get the workaround patch by Atsushi Emoto from Mono bugzilla. Patch  
is a bit old, but you should have no problem finding where it is  
patching (it’s one-liner):  
[http://bugzilla.ximian.com/show\_bug.cgi?id=77963](http://bugzilla.ximian.com/show_bug.cgi?id=77963)

And build Mono. It will take some time.

As [Ruby.NET](http://Ruby.NET) uses MSBuild as its build system which is not yet supported  
in Mono, I prepared a simple Makefile. It would be nice if [Ruby.NET](http://Ruby.NET)  
team can include this in the next release.

CSC=gmcs

all: …/Bin/QUT.ShiftReduceParser.dll …/Bin/QUT.PERWAPI.dll  
…/Bin/QUT.RubyRuntime.dll …/Bin/RubyCompiler.exe

…/Bin/QUT.ShiftReduceParser.dll:  
$(CSC) -t:library -out:…/Bin/QUT.ShiftReduceParser.dll  
-recurse:GPPG/ShiftReduceParser/\*.cs

…/Bin/QUT.PERWAPI.dll:  
$(CSC) -t:library -out:…/Bin/QUT.PERWAPI.dll  
-recurse:PERWAPI/\*.cs

…/Bin/QUT.RubyRuntime.dll:  
$(CSC) -t:library -r:…/Bin/QUT.ShiftReduceParser.dll  
-r:…/Bin/QUT.PERWAPI.dll -out:…/Bin/QUT.RubyRuntime.dll  
-recurse:RubyRuntime/\*.cs

…/Bin/RubyCompiler.exe:  
$(CSC) -t:exe -r:…/Bin/QUT.PERWAPI.dll  
-r:…/Bin/QUT.RubyRuntime.dll -out:…/Bin/RubyCompiler.exe  
-recurse:RubyCompiler/\*.cs

After that, [Ruby.NET](http://Ruby.NET)’s runtime library makes use of some API not yet  
implemented in Mono. Namely, they correspond to following Ruby methods:  
File.readable? File.readable\_real? File.writable? File.writable\_real?  
File.executable? File.executable\_real? File.owned? File.expand\_path,  
Dir.glob, IO.reopen.

You can find this out by performing compile-delete cycle, which feels  
like a big waste of time, so I did it for you. Get it here:  
[http://sparcs.kaist.ac.kr/~tinuviel/download/patch-ruby.net](http://sparcs.kaist.ac.kr/~tinuviel/download/patch-ruby.net)

Now,

1. Unpack Ruby.NET.beta0.5.src.zip (Be sure to get source  
distribution!)
2. Apply [patch-ruby.net](http://patch-ruby.net)
3. cd to [ruby.net at Directnic](http://Ruby.NET/Src)
4. Type make (Be sure that gmcs points to patched gmcs, edit Makefile  
if necessary)
5. ?
6. Profit!

Thanks to #mono people on GIMPNet for help.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 22, 2006, 1:19am UTC](https://www.ruby-forum.com/t/compiling-gp-ruby-net-compiler-on-mono/64005/2 "2006-06-22T01:19:03Z")

</div>

At 05:36 PM 21/06/2006, you wrote:

> Hi,  
>   
> Recently Gardens Point Ruby.NET Compiler was released. It's available  
> here:  
> [http://plas.fit.qut.edu.au/Ruby.NET/](http://plas.fit.qut.edu.au/Ruby.NET/)  
>   
> This post is a walkthrough on how to compile it on Mono.

  
Excellent, thank you!  
  

> This is obviously Mono's fault, but it would be great if Ruby.NET team  
> can move Key class out of Dictionary class to avoid this.

  
Will do.  
  

> As Ruby.NET uses MSBuild as its build system which is not yet supported  
> in Mono, I prepared a simple Makefile. It would be nice if Ruby.NET  
> team can include this in the next release.

  
Will do.  
  
Thanks, please say in contact.  
  
  
Cheers, Wayne.  
  

* * *
Dr Wayne Kelly&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Senior Lecturer  
Email: removed\_email\_address@domain.invalid &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;School of Software Engineering and DC   
Phone: +61 7 3864 9336&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Faculty of Information Technology   
Fax: +61 7 3864 9390&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Queensland University of Technology

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 22, 2006, 7:36pm UTC](https://www.ruby-forum.com/t/compiling-gp-ruby-net-compiler-on-mono/64005/3 "2006-06-22T19:36:02Z")

</div>

On Wed, 2006-06-21 at 16:36 +0900, removed\_email\_address@domain.invalid wrote:

> This post is a walkthrough on how to compile it on Mono.

Oh how I wish I had some time for this … how is the performance?  
Workable or a little slow?
