Compiling Mono and IronRuby on OSX Leopard

Compiling Mono and IronRuby on OSX Leopard
by admin
Posted February 5th, 2008 at 4:32 am

I tried to compile IronRuby on OS X (leopard) with the dmg I downloaded from the mono website, and that didn’t work.

I then uninstalled that mono version by running monoUninstall.sh and proceeded to get mono from subversion. I’m putting these steps on my blog more for future reference when I decide to reinstall my box for some reason.

Download gettext, pkgconfig and glib2.0

extract the archives and build them in the following order gettext, pkgconfig, glib2.0

./configure –prefix=/opt/local
make
sudo make install

At this point it would be wise to set the PKG_CONFIG_PATH environment variable. I added the following line to ~/.bash_profile

export PKG_CONFIG_PATH=”/usr/local/lib/pkgconfig:/opt/local/lib/pkgconfig”

next it’s time to check out the mono sources from their repositories

cd ~/
mkdir tools
mkdir mono
svn co svn://anonsvn.mono-project.com/source/trunk/mono
svn co svn://anonsvn.mono-project.com/source/trunk/mcs
svn co svn://anonsvn.mono-project.com/source/trunk/libgdiplus
svn co svn://anonsvn.mono-project.com/source/trunk/moon
svn co svn://anonsvn.mono-project.com/source/trunk/olive
svn co svn://anonsvn.mono-project.com/source/trunk/gtk-sharp

checking those out will take a while

now go into the mono directory and build mono

cd mono
./autogen.sh –prefix=/opt/local/mono –with-preview=yes –with-moonlight=yes

–with-preview enables the .NET 3.5 features that have been implemented so far
–with-moonlight enables support for moonlight

make
sudo make install

This will also take some time and when it completes you can check if mono is installed by typing mono -V

That’s it for mono, now onto IronRuby

cd ~/tools

svn co http://ironruby.rubyforge.org/svn/trunk ironruby

sudo gem install pathname2

rake compile mono=1

And that should be all :)

UPDATE: I’ve got new instructions for building IronRuby

Tags:
9 ResponsesLeave a comment
  • Flavio
    February 7, 2008 at 12:31

    I’ve tried the procedure above on Tiger 10.4.8 and it didn’t work. I had to manually set the include and lib folders when building glib2.0 because it wouldn’t look into /opt/local even if the –prefix option was specified, and that in the end worked.
    The autogen command for building mono failed miserably:

    Running automake –gnu …
    aclocal.m4:1078: required file `./ltmain.sh’ not found
    mono/profiler/Makefile.am:22: invalid unused variable name: `libmono_profiler_logging_la_LIBADD’
    mono/profiler/Makefile.am:21: invalid unused variable name: `libmono_profiler_logging_la_SOURCES’
    **Error**: automake failed.

  • Dany
    February 11, 2008 at 23:22

    Hi Ivan,

    How did you get gettext successfully on Leopard? I keep failing on some kind of emacs dependency. It seems this is a common error too – I have found a few references to this so far. It’s a “Fatal malloc_jumpstart()” error.

    Did you not encounter this? If you did, how did you get around it?

    D.

  • Ivan Porto Carrero
    February 11, 2008 at 23:25

    I think the only other thing I have done is to install the XCode tools.
    I may have installed gettext once before using ports so that might have solved some of the dependencies I needed.
    Otherwise i really can’t say :(

  • [...] Ivan Porto Carrero posted an update on his upcoming book, IronRuby in Action. Ivan also posts about a good looking IDE theme for Ruby in Steel, and building IronRuby and Mono in Leopard. [...]

  • Yaz Okulu
    March 23, 2008 at 11:45

    does anyone knows if there is any other information about this subject in other languages?

  • Tobias H. Michaelsen
    May 7, 2008 at 04:56

    I got it working with the packaged version of Mono (v1.9.1) by adding the following to my ~/.bash_profile

    export PKG_CONFIG_PATH=”/Library/Frameworks/Mono.framework/Libraries/pkgconfig/”

    Notice that the current version of IronRuby (rev. 101) wont compile, so you will have to fetch rev. 98 for now.

  • [...] Ivan Porto Carrero: Compiling Mono and IronRuby on OSX Leopard [...]

  • [...] for sure. I downloaded and compiled mono, which was a bit of a pain but I basically followed this post. I recommend you just download the dmg instead (more on that later). Then I got the SDK, which is [...]

  • [...] It won’t work with the latest release of mono. I’m using the trunk version of mono to build ironruby. I’ve got instructions that could show you how to compile mono here. [...]

Add a commentGet a Gravatar

* Name

* Email Address

Website Address

You can usethese tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Around The Site
Categories
Archives
Tags