Login  Register

Problem with QL-Swing and Ruby 1.9 or 2.0

Posted by Dirk Eddelbuettel on Dec 30, 2013; 4:40pm
URL: http://quantlib.414.s1.nabble.com/Problem-with-QL-Swing-and-Ruby-1-9-or-2-0-tp14792.html


I have been building QuantLib-SWIG for Debian using Ruby 1.8. As Debian is
phasing out Ruby 1.8, I have been asked to update this to 1.9.1 or 2.0.

However, I was unable to do so with the current files. First, I had to
comment-out

   #require 'ftools'

in setup.rb to get things to build, but after that the unit testing framework
croaked.

(cd Ruby && \
                        CC="g++" \
                        CXX="g++" \
                        CFLAGS="-O2 -Wall -Wno-strict-aliasing" \
                        CXXFLAGS="-O2 -Wall -Wno-strict-aliasing" \
                        ruby setup.rb build )
setup.rb:62: Use RbConfig instead of obsolete and deprecated Config.
creating Makefile
make[1]: Entering directory `/tmp/buildd/quantlib-swig-1.3/Ruby'
compiling quantlib_wrap.cpp
quantlib_wrap.cpp: In function 'VALUE _wrap_new_Array__SWIG_3(int, VALUE*, VALUE)':
quantlib_wrap.cpp:46062:36: error: 'struct RArray' has no member named 'len'
       Size size = RARRAY(argv[0])->len;
                                    ^
quantlib_wrap.cpp:46066:36: error: 'struct RArray' has no member named 'ptr'
         VALUE o = RARRAY(argv[0])->ptr[i];
                                    ^
quantlib_wrap.cpp: In function 'VALUE _wrap_Array___len__(int, VALUE*, VALUE)':
quantlib_wrap.cpp:46190:33: error: 'struct RArray' has no member named 'len'
       Size size = RARRAY(self)->len;
                                 ^
quantlib_wrap.cpp:46194:33: error: 'struct RArray' has no member named 'ptr'
         VALUE o = RARRAY(self)->ptr[i];
                                 ^
and LOTS more of these errors.

Later:

(cd Ruby && ruby setup.rb test )
setup.rb:62: Use RbConfig instead of obsolete and deprecated Config.
creating Makefile
make[1]: Entering directory `/tmp/buildd/quantlib-swig-1.3/Ruby'
compiling quantlib_wrap.cpp
quantlib_wrap.cpp: In function 'VALUE _wrap_new_Array__SWIG_3(int, VALUE*, VALUE)':
quantlib_wrap.cpp:46062:36: error: 'struct RArray' has no member named 'len'
       Size size = RARRAY(argv[0])->len;
                                    ^
quantlib_wrap.cpp:46066:36: error: 'struct RArray' has no member named 'ptr'
         VALUE o = RARRAY(argv[0])->ptr[i];
                                    ^
quantlib_wrap.cpp: In function 'VALUE _wrap_Array___len__(int, VALUE*, VALUE)':
quantlib_wrap.cpp:46190:33: error: 'struct RArray' has no member named 'len'
       Size size = RARRAY(self)->len;
                                 ^
quantlib_wrap.cpp:46194:33: error: 'struct RArray' has no member named 'ptr'
         VALUE o = RARRAY(self)->ptr[i];
                                 ^
ending in

quantlib_wrap.cpp:245180:36: error: 'struct RArray' has no member named 'ptr'
         VALUE o = RARRAY(argv[0])->ptr[i];
                                    ^
make[1]: *** [quantlib_wrap.o] Error 1
make[1]: Leaving directory `/tmp/buildd/quantlib-swig-1.3/Ruby'
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- test/unit/testsuite (LoadError)
        from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from QuantLibTestSuite.rb:20:in `<top (required)>'
        from setup.rb:134:in `load'
        from setup.rb:134:in `block in <main>'
        from setup.rb:70:in `call'
        from setup.rb:70:in `execute'
        from setup.rb:173:in `<main>'
Testing QuantLib-Ruby 1.3...
make: *** [test-stamp] Error 1


Any Ruby or Swig experts here who could lend a helping hand?

Thanks,  Dirk

--
Dirk Eddelbuettel | [hidden email] | http://dirk.eddelbuettel.com

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev