Ruby SWIG - Errors on build

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Ruby SWIG - Errors on build

curt
This post was updated on .
Building the ruby version on mac osx 10.10.5:

ruby 2.2.2
quantlib 1.6.1 (installed via 'brew install quantlib' and via the quantlib.org instructions)
swig 3.0.7
Not sure if there's an error on my side or it's not compatible with the versions I'm using. To isolate the issue I installed the RQuantLib package for R and it works within R. I also did the test compile for BermudanSwaption.cpp and it worked.

CODE BELOW:

ruby setup.rb wrap

swig -ruby -c++ -I../SWIG -o ./quantlib_wrap.cpp quantlib.i
SWIG:1: Warning 125: Use of the include path to find the input file is deprecated and will not work with ccache. Please include the path when specifying the input file.

ruby setup.rb build

creating Makefile
compiling quantlib_wrap.cpp
quantlib_wrap.cpp:2652:6: error: using an old version of QuantLib, please update
    #error using an old version of QuantLib, please update
     ^
In file included from quantlib_wrap.cpp:2649:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/quantlib.hpp:47:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/math/all.hpp:35:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/math/matrixutilities/all.hpp:4:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/math/matrixutilities/basisincompleteordered.hpp:25:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/valarray:4035:59: error:
      'value_type' is a private member of
      'boost::iterators::detail::operator_brackets_proxy<QuantLib::step_iterator<double
      *> >'
    __val_expr<_BinaryOp<__bit_shift_left<typename _Expr::value_type>,
                                                          ^
quantlib_wrap.cpp:8230:23: note: while substituting deduced template arguments
      into function template 'operator<<' [with _Expr =
      boost::iterators::detail::operator_brackets_proxy<QuantLib::step_iterator<double
      *> >]
                    s << (*self)[i][j];
                      ^
In file included from quantlib_wrap.cpp:2649:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/quantlib.hpp:47:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/math/all.hpp:35:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/math/matrixutilities/all.hpp:4:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/math/matrixutilities/basisincompleteordered.hpp:25:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/valarray:4036:46: error:
      'value_type' is a private member of
      'boost::iterators::detail::operator_brackets_proxy<QuantLib::step_iterator<double
      *> >'
               __scalar_expr<typename _Expr::value_type>, _Expr> >
                                             ^
quantlib_wrap.cpp:71997:13: error: no member named 'Israel' in namespace
      'QuantLib'
  QuantLib::Israel::Market arg1 ;
  ~~~~~~~~~~^
quantlib_wrap.cpp:72000:13: error: no type named 'Israel' in namespace
      'QuantLib'
  QuantLib::Israel *result = 0 ;
  ~~~~~~~~~~^
quantlib_wrap.cpp:72009:33: error: no member named 'Israel' in namespace
      'QuantLib'
  arg1 = static_cast< QuantLib::Israel::Market >(val1);
                      ~~~~~~~~~~^
quantlib_wrap.cpp:72012:27: error: no member named 'Israel' in namespace
      'QuantLib'
      result = (QuantLib::Israel *)new QuantLib::Israel(arg1);
                ~~~~~~~~~~^
quantlib_wrap.cpp:72012:35: error: expected expression
      result = (QuantLib::Israel *)new QuantLib::Israel(arg1);
                                  ^
quantlib_wrap.cpp:72047:13: error: no type named 'Israel' in namespace
      'QuantLib'
  QuantLib::Israel *result = 0 ;
  ~~~~~~~~~~^
quantlib_wrap.cpp:72054:27: error: no member named 'Israel' in namespace
      'QuantLib'
      result = (QuantLib::Israel *)new QuantLib::Israel();
                ~~~~~~~~~~^
quantlib_wrap.cpp:72054:35: error: expected expression
      result = (QuantLib::Israel *)new QuantLib::Israel();
                                  ^
quantlib_wrap.cpp:72104:32: error: no type named 'Israel' in namespace
      'QuantLib'
free_QuantLib_Israel(QuantLib::Israel *arg1) {
                     ~~~~~~~~~~^
quantlib_wrap.cpp:72670:13: error: no type named 'Romania' in namespace
      'QuantLib'
  QuantLib::Romania *result = 0 ;
  ~~~~~~~~~~^
quantlib_wrap.cpp:72677:27: error: no member named 'Romania' in namespace
      'QuantLib'
      result = (QuantLib::Romania *)new QuantLib::Romania();
                ~~~~~~~~~~^
quantlib_wrap.cpp:72677:36: error: expected expression
      result = (QuantLib::Romania *)new QuantLib::Romania();
                                   ^
quantlib_wrap.cpp:72694:33: error: no type named 'Romania' in namespace
      'QuantLib'
free_QuantLib_Romania(QuantLib::Romania *arg1) {
                      ~~~~~~~~~~^
quantlib_wrap.cpp:274968:47: error: no member named 'Israel' in namespace
      'QuantLib'
    return (void *)((Calendar *)  ((QuantLib::Israel *) x));
                                    ~~~~~~~~~~^
quantlib_wrap.cpp:274968:55: error: expected expression
    return (void *)((Calendar *)  ((QuantLib::Israel *) x));
                                                      ^
quantlib_wrap.cpp:275037:47: error: no member named 'Romania' in namespace
      'QuantLib'
    return (void *)((Calendar *)  ((QuantLib::Romania *) x));
                                    ~~~~~~~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [quantlib_wrap.o] Error 1