quantlib - SWIG failing

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

quantlib - SWIG failing

Die Optimisten
Hi,
compiling and installing (make install -C Ruby) quantlib-swig worked
without error.
running tests/* and examples/* leads to many errors:

=> Has the swig*tgz to be extracted to a special place (dependent an
extracted quantlib.tgz ?
=> What has to be done after make -C Ruby; make -C Ruby install
=> I assume the swig-Packages builds a new Quantlib-library
(QuantLibc.so) (using libQuantLib.so built from Quantlib.tgz) adding the
swig-interface.

What can I do?
Thank you
Andrew

Here the logs:
  # running 3.2.0-4-amd64 #1 SMP Debian 3.2.81-1 x86_64 GNU/Linux
  # using ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]

$ ## all tests/* work, except two:
$ ruby QuantLibTestSuite.rb
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/console/testrunner.rb:37:in
`initialize': wrong number of arguments (given 3, expected 1..2)
(ArgumentError)
     from QuantLibTestSuite.rb:40:in `new'
     from QuantLibTestSuite.rb:40:in `<main>'
             # looks like this is mostly written for ruby 1.8, perhaps
s.o. Ruby-expert can have a look on it?
================
# The following look like failures in the Quantlib-library.
## May I strip the library, before doing ? , But failures are still there

$ ruby termstructures.rb   Loaded suite TermStructureTest
Started
termstructures.rb:60: [BUG] Segmentation fault at 0x00000000000021
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0026 p:---- s:0118 e:000117 CFUNC  :initialize
c:0025 p:---- s:0116 e:000115 CFUNC  :new
c:0024 p:0091 s:0106 e:000105 BLOCK  termstructures.rb:60 [FINISH]
c:0023 p:---- s:0102 e:000101 CFUNC  :map
c:0022 p:0170 s:0099 e:000098 METHOD termstructures.rb:59
c:0021 p:0033 s:0090 e:000089 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/fixture.rb:275
c:0020 p:0019 s:0084 E:0004f8 BLOCK
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/fixture.rb:263
[FINISH]
c:0019 p:0034 s:0081 E:000478 BLOCK
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/fixture.rb:267
[FINISH]
c:0018 p:0069 s:0078 e:000077 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/fixture.rb:248
c:0017 p:0013 s:0070 e:000069 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/fixture.rb:283
c:0016 p:0009 s:0066 E:000798 BLOCK
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/testcase.rb:471
[FINISH]
c:0015 p:---- s:0063 e:000062 CFUNC  :catch
c:0014 p:0064 s:0060 E:001a00 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/testcase.rb:470
c:0013 p:0029 s:0055 E:000708 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/testsuite.rb:124
c:0012 p:0097 s:0047 e:000046 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/testsuite.rb:53
c:0011 p:0035 s:0041 E:0005a8 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/testrunnermediator.rb:67
c:0010 p:0052 s:0037 e:000036 BLOCK
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/testrunnermediator.rb:45
c:0009 p:0084 s:0035 E:000818 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/testrunnermediator.rb:102
c:0008 p:0022 s:0027 E:000778 BLOCK
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/testrunnermediator.rb:41
[FINISH]
c:0007 p:---- s:0024 e:000023 CFUNC  :catch
c:0006 p:0067 s:0021 E:002008 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/testrunnermediator.rb:39
c:0005 p:0011 s:0015 e:000014 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/testrunner.rb:40
c:0004 p:0033 s:0012 e:000011 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/testrunner.rb:25
c:0003 p:0021 s:0009 e:000008 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/testrunnerutilities.rb:24
c:0002 p:0085 s:0004 E:001bb0 EVAL   termstructures.rb:120 [FINISH]
c:0001 p:0000 s:0002 E:001cf0 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
termstructures.rb:120:in `<main>'
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/testrunnerutilities.rb:24:in
`run'
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/testrunner.rb:25:in
`start'
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/testrunner.rb:40:in
`start_mediator'
/home/Rubymine/.gem/ruby/2.3
.... [cut]

==============

$ cd examples/
$ ## ALL examples fail, here an example
$ ruby swap.rb
swap.rb:90: [BUG] Segmentation fault at 0x00000000000021
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0008 p:---- s:0076 e:000075 CFUNC  :initialize
c:0007 p:---- s:0074 e:000073 CFUNC  :new
c:0006 p:0067 s:0064 e:000063 BLOCK  swap.rb:90 [FINISH]
c:0005 p:---- s:0058 e:000057 IFUNC
c:0004 p:---- s:0056 e:000055 CFUNC  :each
c:0003 p:---- s:0054 e:000053 CFUNC  :map
c:0002 p:0807 s:0051 E:002238 EVAL   swap.rb:89 [FINISH]
c:0001 p:0000 s:0002 E:001600 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
swap.rb:89:in `<main>'
swap.rb:89:in `map'
swap.rb:89:in `each'
swap.rb:90:in `block in <main>'
swap.rb:90:in `new'
swap.rb:90:in `initialize'

-- Machine register context ------------------------------------------------
  RIP: 0x00007f7b0563d859 RBP: 0x00007f7b0802a880 RSP: 0x00007ffeb9a5e598
  RAX: 0x00007f7b05a5c490 RBX: 0x00007ffeb9a5f040 RCX: 0x00000000000007d0
  RDX: 0x00000000000092c0 RDI: 0x0000000000000021 RSI: 0x00007f7b0802a8e8
   R8: 0x0000000000000004  R9: 0x0000000000000000 R10: 0x0000000000000000
  R11: 0x00007f7b03ac13a0 R12: 0x0000000000000002 R13: 0x00007f7b0802a8f8
  R14: 0x00007ffeb9a5f088 R15: 0x0000000000000004 EFL: 0x0000000000010206

-- C level backtrace information -------------------------------------------
ruby [0x7f7b070a3490]
ruby [0x7f7b0707c4b0]
ruby [0x7f7b06f844ae]
/lib/x86_64-linux-gnu/libpthread.so.0 [0x7f7b06a720a0]
/usr/local/lib/ruby/site_ruby/2.3.0/x86_64-linux/QuantLibc.so(_ZN5boost6detail17sp_counted_impl_pIN8QuantLib12NullCalendar4ImplEE7disposeEv+0x9)
[0x7f7b0563d859]
/usr/local/lib/libQuantLib.so.0(_ZN8QuantLib8ScheduleC2ENS_4DateERKS1_RKNS_6PeriodERKNS_8CalendarENS_21BusinessDayConventionESA_NS_14DateGeneration4RuleEbS3_S3_+0x294f)
[0x7f7b03abe91f]
.... [cut]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: quantlib - SWIG failing

Luigi Ballabio

Hi,
    as you say, I think the wrappers haven't been updated since Ruby 1.8, and we're missing a resident Ruby expert.  As for building the module,  `make` and `make install` should be enough.

If I were to investigate, I'd try to get a simple Ruby example to work (the SWIG distribution probably includes a few) and then I'd check that we're using the same SWIG and compiler settings. I'd also check if simpler classes such as `Date` also cause a segmentation fault in the module you compiled. Do you think you can find some time to do it?

Later,
    Luigi


On Sun, Oct 9, 2016, 23:17 Die Optimisten <[hidden email]> wrote:
Hi,
compiling and installing (make install -C Ruby) quantlib-swig worked
without error.
running tests/* and examples/* leads to many errors:

=> Has the swig*tgz to be extracted to a special place (dependent an
extracted quantlib.tgz ?
=> What has to be done after make -C Ruby; make -C Ruby install
=> I assume the swig-Packages builds a new Quantlib-library
(QuantLibc.so) (using libQuantLib.so built from Quantlib.tgz) adding the
swig-interface.

What can I do?
Thank you
Andrew

Here the logs:
  # running 3.2.0-4-amd64 #1 SMP Debian 3.2.81-1 x86_64 GNU/Linux
  # using ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]

$ ## all tests/* work, except two:
$ ruby QuantLibTestSuite.rb
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/console/testrunner.rb:37:in
`initialize': wrong number of arguments (given 3, expected 1..2)
(ArgumentError)
     from QuantLibTestSuite.rb:40:in `new'
     from QuantLibTestSuite.rb:40:in `<main>'
             # looks like this is mostly written for ruby 1.8, perhaps
s.o. Ruby-expert can have a look on it?
================
# The following look like failures in the Quantlib-library.
## May I strip the library, before doing ? , But failures are still there

$ ruby termstructures.rb   Loaded suite TermStructureTest
Started
termstructures.rb:60: [BUG] Segmentation fault at 0x00000000000021
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0026 p:---- s:0118 e:000117 CFUNC  :initialize
c:0025 p:---- s:0116 e:000115 CFUNC  :new
c:0024 p:0091 s:0106 e:000105 BLOCK  termstructures.rb:60 [FINISH]
c:0023 p:---- s:0102 e:000101 CFUNC  :map
c:0022 p:0170 s:0099 e:000098 METHOD termstructures.rb:59
c:0021 p:0033 s:0090 e:000089 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/fixture.rb:275
c:0020 p:0019 s:0084 E:0004f8 BLOCK
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/fixture.rb:263
[FINISH]
c:0019 p:0034 s:0081 E:000478 BLOCK
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/fixture.rb:267
[FINISH]
c:0018 p:0069 s:0078 e:000077 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/fixture.rb:248
c:0017 p:0013 s:0070 e:000069 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/fixture.rb:283
c:0016 p:0009 s:0066 E:000798 BLOCK
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/testcase.rb:471
[FINISH]
c:0015 p:---- s:0063 e:000062 CFUNC  :catch
c:0014 p:0064 s:0060 E:001a00 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/testcase.rb:470
c:0013 p:0029 s:0055 E:000708 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/testsuite.rb:124
c:0012 p:0097 s:0047 e:000046 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/testsuite.rb:53
c:0011 p:0035 s:0041 E:0005a8 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/testrunnermediator.rb:67
c:0010 p:0052 s:0037 e:000036 BLOCK
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/testrunnermediator.rb:45
c:0009 p:0084 s:0035 E:000818 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/testrunnermediator.rb:102
c:0008 p:0022 s:0027 E:000778 BLOCK
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/testrunnermediator.rb:41
[FINISH]
c:0007 p:---- s:0024 e:000023 CFUNC  :catch
c:0006 p:0067 s:0021 E:002008 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/testrunnermediator.rb:39
c:0005 p:0011 s:0015 e:000014 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/testrunner.rb:40
c:0004 p:0033 s:0012 e:000011 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/testrunner.rb:25
c:0003 p:0021 s:0009 e:000008 METHOD
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/testrunnerutilities.rb:24
c:0002 p:0085 s:0004 E:001bb0 EVAL   termstructures.rb:120 [FINISH]
c:0001 p:0000 s:0002 E:001cf0 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
termstructures.rb:120:in `<main>'
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/testrunnerutilities.rb:24:in
`run'
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/testrunner.rb:25:in
`start'
/home/Rubymine/.gem/ruby/2.3.0/gems/test-unit-3.2.1/lib/test/unit/ui/testrunner.rb:40:in
`start_mediator'
/home/Rubymine/.gem/ruby/2.3
.... [cut]

==============

$ cd examples/
$ ## ALL examples fail, here an example
$ ruby swap.rb
swap.rb:90: [BUG] Segmentation fault at 0x00000000000021
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0008 p:---- s:0076 e:000075 CFUNC  :initialize
c:0007 p:---- s:0074 e:000073 CFUNC  :new
c:0006 p:0067 s:0064 e:000063 BLOCK  swap.rb:90 [FINISH]
c:0005 p:---- s:0058 e:000057 IFUNC
c:0004 p:---- s:0056 e:000055 CFUNC  :each
c:0003 p:---- s:0054 e:000053 CFUNC  :map
c:0002 p:0807 s:0051 E:002238 EVAL   swap.rb:89 [FINISH]
c:0001 p:0000 s:0002 E:001600 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
swap.rb:89:in `<main>'
swap.rb:89:in `map'
swap.rb:89:in `each'
swap.rb:90:in `block in <main>'
swap.rb:90:in `new'
swap.rb:90:in `initialize'

-- Machine register context ------------------------------------------------
  RIP: 0x00007f7b0563d859 RBP: 0x00007f7b0802a880 RSP: 0x00007ffeb9a5e598
  RAX: 0x00007f7b05a5c490 RBX: 0x00007ffeb9a5f040 RCX: 0x00000000000007d0
  RDX: 0x00000000000092c0 RDI: 0x0000000000000021 RSI: 0x00007f7b0802a8e8
   R8: 0x0000000000000004  R9: 0x0000000000000000 R10: 0x0000000000000000
  R11: 0x00007f7b03ac13a0 R12: 0x0000000000000002 R13: 0x00007f7b0802a8f8
  R14: 0x00007ffeb9a5f088 R15: 0x0000000000000004 EFL: 0x0000000000010206

-- C level backtrace information -------------------------------------------
ruby [0x7f7b070a3490]
ruby [0x7f7b0707c4b0]
ruby [0x7f7b06f844ae]
/lib/x86_64-linux-gnu/libpthread.so.0 [0x7f7b06a720a0]
/usr/local/lib/ruby/site_ruby/2.3.0/x86_64-linux/QuantLibc.so(_ZN5boost6detail17sp_counted_impl_pIN8QuantLib12NullCalendar4ImplEE7disposeEv+0x9)
[0x7f7b0563d859]
/usr/local/lib/libQuantLib.so.0(_ZN8QuantLib8ScheduleC2ENS_4DateERKS1_RKNS_6PeriodERKNS_8CalendarENS_21BusinessDayConventionESA_NS_14DateGeneration4RuleEbS3_S3_+0x294f)
[0x7f7b03abe91f]
.... [cut]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: quantlib - SWIG failing

ryantaylor
In reply to this post by Die Optimisten
Try compiling QuantLib and the SWIG bindings with clang instead of g++. I was getting similar segfaults before I switched to using clang.
Loading...