Re: calendar problem when calling quantlib lib from java

Posted by Tito Ingargiola on
URL: http://quantlib.414.s1.nabble.com/calendar-problem-when-calling-quantlib-lib-from-java-tp5595p5605.html


Hi Pierre,

Your example is unclear to me.  If it's java, then I think you may be not constructing the objects correctly.  Below is a java code fragment and its output which I'm able to build and run.  If you supply a simple example I can see if I can get it to run.  You will likely need to look in the swig .i files to understand how to translate from the c++ into java.  Regards,

    Tito.
--

In java, I'm able to say:

        DayCounter dayCounter = new Actual365Fixed();
        System.out.println(dayCounter);      
        DayCounter actualAct = new ActualActual();
        System.out.println(actualAct);      
        Calendar calendar = new TARGET();
        System.out.println(calendar);      
        Calendar us = new UnitedStates();
        System.out.println(us);

And I get output:

Actual/365 (Fixed) day counter
Actual/Actual (ISDA) day counter
TARGET calendar
US settlement calendar



moloko <[hidden email]> wrote:

Hi I've got a little problem

I'm calling the quantlib library compiled as a shared library on Linux (
using the -fPIC option )
in a java wrapper.
So, the code calling the ql lib is into a java function.

My code crash with some memory allocation problem ( hard to know coz I don't
have each time the message ) when I want to define a calendar :
Calendar calendar = UnitedStates();

On the other hand this :
Calendar calendar = NullCalendar();
is working


I've got a glibc detected malloc() memory corrupt

... and I've the same thing with
DayCounter dDayCounter = ActualActual(ActualActual::ISDA);
but OneDayCounter() is working

Does anybd has an idea ?

Could it come from boots ?

Thanks

Pierre

--
View this message in context: http://www.nabble.com/calendar-problem-when-calling-quantlib-lib-from-java-tp15285518p15285518.html
Sent from the quantlib-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users