05FebCompiling Mono and IronRuby on OSX Leopard

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


  1. 1 Flavio07 Feb 2008

    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.

  2. 2 Dany11 Feb 2008

    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.

  3. 3 Ivan Porto Carrero11 Feb 2008

    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 :(

  4. 4 Yaz Okulu23 Mar 2008

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

  5. 5 Tobias H. Michaelsen07 May 2008

    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.

  1. 1 rubydoes.net » Blog Archive » IronRuby Links of note 01
  2. 2 the jakbot - Building Mono on Mac Leopard
  3. 3 real tangible » Blog Archive » Silverlight + Python on OS X. Easy.
  4. 4 rubydoes.net » Blog Archive » Building IronRuby with Mono

Recent Flickrs

    Blogroll

    Recent Listening

    Scrobbler
    • Loading...