Hi, all,
I have searched extensively on this forum and the web, and haven’t been able to find a solution to my problem.
Has anyone found a work-around for building ROOT with Ruby enabled in Mac OS? If I understand the problem correctly, the Ruby that ships in OS 10.5 is not 64-bit compatible. I have tried rebuilding ruby from source and then building ROOT, but no luck.
Can anyone advise, or am I stuck waiting for a 64-bit Ruby? I did find a thread about PYROOT that suggested the same problem, only with python.
If you use the ROOT trunk you will get now a $ROOTSYS/bin/ruby64 which is a 64-bit version (like python64). When building Ruby make sure you use
–enable-explicitlink, see root.cern.ch/root/HowtoRuby.html
I just built the ruby bindings for Root in my Mac. There are two main issues you have to look after:
(a) The target architecture. By default, at least Leopard, comes with Ruby for PPC and i386, so you should use macosx in Root and not macosx64. You can also try with the Mac ports and install a 64-bit enabled Ruby.
(b) You should link libRuby as a bundle. Apparently, Ruby can not load C extensions as a dylib. This is very weird, but I confirmed it using dtruss. Ruby is looking only for files ending in .rb and .bundle. So, the actual command I used was:
I had configured initially Root with: ./configure macosx --enable-ruby
I don’t know if Root’s build system is flexible enough to support a patch that will allow only libRuby and only for Mac OS X to build as a bundle. I will certainly have a look, though.
we could make a link from the libRuby.so to libRuby.bundle so ruby can load it, but really ruby should be fixed to also support .so as Mac OS’s .so’s can now be used as what used to be bundles. Can you report this to the ruby developers.
Dear Fons, unfortunately, I am afraid that making a symlink to point to libRuby.so will not work. Apparently, ruby is refusing to load a binary that is not a bundle.
I will try to further investigate with the Ruby developers the reason for this.
In principle we do not support creating (or rather I very much avoid) creating bundles now that it is not needed anymore in OS X (already since 10.4) so Ruby developers have had ample opportunity to fix their code.