Building v5.34/00 w/ ruby (1.9.1?)

Hi,

To build v5.34/00 (using CMake) with ruby, I had to modifiy bindings/ruby/src/drr.cxx as the following:

--- drr.cxx.orig	2012-06-05 22:31:22.000000000 +0900
+++ drr.cxx	2012-07-11 18:30:51.423110207 +0900
@@ -46,8 +46,8 @@
 #include "dlfcn.h"
 #endif
 
-#if ((R__RUBY_MAJOR<1) || (R__RUBY_MAJOR==1)&&(R__RUBY_MINOR<=8))
-#  define rb_frame_this_func rb_frame_last_func
+#if ((R__RUBY_MAJOR<1) || (R__RUBY_MAJOR==1)&&(R__RUBY_MINOR<=9))
+#  define rb_frame_last_func rb_frame_this_func
 #endif

#define identifier replacement-token-list
??? reversed ??? :question:

On Fedora 17 machines (i386 as well as x86_64), and the version of ruby packages is ruby{,-devel}-1.9.3.194-13. (though ruby -rrbconfig -e 'puts RbConfig::CONFIG["ruby_version"]' prints 1.9.1)

Kazuyoshi

Hi,

What was the error without the change?

Philippe.

Hi,

[quote=“pcanal”]Hi,

What was the error without the change?

Philippe.[/quote]

I got the following:

[ 45%] Building CXX object bindings/ruby/CMakeFiles/Ruby.dir/src/TRuby.o [ 45%] Building CXX object bindings/ruby/CMakeFiles/Ruby.dir/src/drr.o Scanning dependencies of target Minuit2 [ 45%] Building CXX object proof/proofplayer/CMakeFiles/ProofPlayer.dir/src/TProofPlayerLite.o [ 45%] Building CXX object math/minuit2/CMakeFiles/Minuit2.dir/G__Minuit2.o /home/furutaka/work/root/root_v5.34.00/bindings/ruby/src/drr.cxx: In function ‘void* rr_parse_void(VALUE)’: /home/furutaka/work/root/root_v5.34.00/bindings/ruby/src/drr.cxx:189:47: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘char*’ [-Wformat] /home/furutaka/work/root/root_v5.34.00/bindings/ruby/src/drr.cxx: In function ‘VALUE drr_generic_method(int, VALUE*, VALUE)’: /home/furutaka/work/root/root_v5.34.00/bindings/ruby/src/drr.cxx:910:60: error: ‘rb_frame_last_func’ was not declared in this scope make[2]: *** [bindings/ruby/CMakeFiles/Ruby.dir/src/drr.o] Error 1 make[1]: *** [bindings/ruby/CMakeFiles/Ruby.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 46%] Building CXX object math/minuit2/CMakeFiles/Minuit2.dir/src/MPIProcess.o [ 46%] Building CXX object graf2d/graf/CMakeFiles/Graf.dir/src/TGraphPolargram.o [ 46%] Building CXX object geom/gdml/CMakeFiles/Gdml.dir/src/TGDMLParse.o

Kazuyoshi

Hi,

I am a bit confused, the patch you propose undo a patch that was added to support … ruby 1.9 on Fedora 17 (See root.cern.ch/viewvc/trunk/bindin … g#rev43004). Combined with the fact:[quote] the version of ruby packages is ruby{,-devel}-1.9.3.194-13. (though ruby -rrbconfig -e 'puts RbConfig::CONFIG["ruby_version"]' prints 1.9.1)[/quote]I wonder if in your case (or Matthias’ case) there was an installation problem for the ruby package?

Cheers,
Philipp.e

Hi,

Well, I looked into an old version of ruby (1.8.7) on a FreeBSD-9R machine and observed that there’re both

ID rb_frame_last_func _((void)); ID rb_frame_this_func _((void));
in /usr/local/lib/ruby/1.8/i386-freebsd9/intern.h.
I also confirmed the existence of the two in ruby-1.8.7 and the disappearance of the rb_frame_last_func in ruby-1.9.x by browsing rxr.whitequark.org/mri/ident?v=1 … _last_func and
root.cern.ch/viewvc?view=rev&revision=16173 , and its correction by Matthias are correct and mine was nonsense… :blush:

I’ve also checked that the version-number pickup in the configure script and saw that it works fine. :confused: ; a build with the configure script (./configure linuxx8664gcc --enable ruby) finished succesfully :exclamation:

Well, this was my first build of ROOT using CMake :exclamation: and now I suspect the trouble might be due to CMake, although I know almost nothing about CMake…

My CMakeCache.txt contains the following lines; are these correct ("…: PATH=1" etc.)? How can I check that the version numbers are properly passed to bindings/ruby/src/drr.cxx etc?:

[code]//The Ruby major version
RUBY_VERSION_MAJOR:PATH=1

//The Ruby minor version
RUBY_VERSION_MINOR:PATH=9

//The Ruby patch version
RUBY_VERSION_PATCH:PATH=1[/code]

Kazuyoshi

Hi,

The problem should now be resolved in the trunk and the v5.34 patch branch.

Cheers,
Philippe.

Hi,

Compiled successfully! =D>

Thanks, Pere and Phillipe!

Kazuyoshi