Java wrapper test program using Eclipse 3.1.1

classic Classic list List threaded Threaded
31 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Java wrapper test program using Eclipse 3.1.1

Joe Byers-2
I have compiled quantlib, built and complied the java wrapper, cpp wrapper, and skwash examples from skwash.com.

I am now trying to get the SwapValuation example to work.  The example java application hangs/stops but does not exit the program when executing the system.loadlibrary(("QuantlibCPPWrapper"); line.  I built the example from skwash.com as

package test.org.quantlib.examples;

public class SwapValuation {

    public static void main(String[] args) {
        System.out.println("Start SwapValuation\n");
        try {       
//            System.loadLibrary("/DWork/eclipse/workspace/Quantlib/Debug/Quantlib");
//            System.loadLibrary("/DWork/eclipse/workspace/QuantlibCPPWrapper/Debug/QuantlibCPPWrapper.dll");
            System.loadLibrary("QuantlibCPPWrapper");
            System.out.println("SwapValuation ok\n");
        } catch (Throwable t) {
            System.out.println("SwapValuation failed\n");
            t.printStackTrace();
        }
        System.out.println("SwapValuation Exit\n");
//        System.exit(0);
    }
}

I followed the instructions on running/debuging the program and created an environment variable named PATH as ${env_var:PATH};C:\DWork\eclipse\workspace\Quantlib\Release\;C:\DWork\eclipse\workspace\QuantlibCPPWrapper\Release\.  Note I had to add ${env_var:PATH} to the beginning of the variable to get rid of failure to find cygwin1.dll error.  I am also using the relaease directories instead of the debug shown in the example.  Using debug makes no difference to my problem.

Thank you for your help.

Joe



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous


Brings words and photos together (easily) with
PhotoMail - it's free and works with Yahoo! Mail.
Reply | Threaded
Open this post in threaded view
|

Re: Java wrapper test program using Eclipse 3.1.1

Luigi Ballabio
On 03/08/2006 06:08:31 AM, Joe Byers wrote:
> I have compiled quantlib, built and complied the java wrapper, cpp
> wrapper, and skwash examples from skwash.com.
>
> I followed the instructions on running/debuging the program and
> created an environment variable named PATH as
> ${env_var:PATH};C:\DWork\eclipse\workspace\Quantlib\Release\;C:\DWork\eclipse\workspace\QuantlibCPPWrapper\Release\.
>  Note I had to add ${env_var:PATH} to the beginning of the variable to
> get rid of failure to find cygwin1.dll error.

I'm not very knowledgeable about the Java module, but I was under the  
impression that those who compiled it used MinGW rather than the Cygwin  
compiler. Also, I had reports that the wrapper behaved erratically when  
QuantLib was compiled as a shared library---you might want to try  
building it as a static library instead.

Luigi



----------------------------------------

Blessed is the man who, having nothing to say, abstains from giving
wordy evidence of the fact.
-- George Eliot


Reply | Threaded
Open this post in threaded view
|

Re: Java wrapper test program using Eclipse 3.1.1

Joe Byers-2
Luigi,

Thank you for your suggestions.  I did finally get it to compile (using Mingw) and ran the test suite from Skwash.com.  I had to modify a couple of items in the skwash example and found a problem with eclipse CDT 3.0.2 build options.  I am working on and compilation of the problems and actions to post for future reference for other individuals.

On another note,  I have the algorithm for a calendar of the North American Energy Reliability Council (NERC) holidays.  This is important for pricing derivative on electricity in the US.  Can you point to someone to help develop this for Quantlib calendar module?

Thank you
Joe W. Byers


Luigi Ballabio <[hidden email]> wrote:

On 03/08/2006 06:08:31 AM, Joe Byers wrote:
> I have compiled quantlib, built and complied the java wrapper, cpp
> wrapper, and skwash examples from skwash.com.
>
> I followed the instructions on running/debuging the program and
> created an environment variable named PATH as
> ${env_var:PATH};C:\DWork\eclipse\workspace\Quantlib\Release\;C:\DWork\eclipse\workspace\QuantlibCPPWrapper\Release\.
> Note I had to add ${env_var:PATH} to the beginning of the variable to
> get rid of failure to find cygwin1.dll error.

I'm not very knowledgeable about the Java module, but I was under the
impression that those who compiled it used MinGW rather than the Cygwin
compiler. Also, I had reports that the wrapper behaved erratically when
QuantLib was compiled as a shared library---you might want to try
building it as a static library instead.

Luigi



----------------------------------------

Blessed is the man who, having nothing to say, abstains from giving
wordy evidence of the fact.
-- George Eliot



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous


Brings words and photos together (easily) with
PhotoMail - it's free and works with Yahoo! Mail.
Reply | Threaded
Open this post in threaded view
|

Re: Java wrapper test program using Eclipse 3.1.1

Luigi Ballabio
On 03/20/2006 03:43:26 PM, Joe Byers wrote:
> On another note,  I have the algorithm for a calendar of the North
> American Energy Reliability Council (NERC) holidays.  This is
> important for pricing derivative on electricity in the US.  Can you
> point to someone to help develop this for Quantlib calendar module?

You can send me either the algorithm or the list of rules for the  
holidays.

Luigi


----------------------------------------

An ideal world is left as an exercise to the reader.
-- Paul Graham


Reply | Threaded
Open this post in threaded view
|

spread not used within some of the capfloor engine classes

Toyin Akin
Hi,

Apart from the blackcapfloorengine class, I do not believe that any of the
other capfloor engine classes use the spread value stored with the cashflow
coupons. This is also true for the calculated convexity value that is added
to the indexFixing (line #85 of the floatingratecoupon.hpp file).

For example, from line #60 from the analyticcapfloorengine class, the strike
is taken, but then the rest of the computation for the cap is based purely
on discountfactors. Perhaps the strikes need to be adjusted for the
convexity and spread adjustments within the capfloor class, before being
passed into these engines.

If this is possible, then should we use indexFixing() instead of the rate()
function within the capfloor class when populating the forwards array (ie
line #98 of the capfloor.cpp file).

Best Regards,
Toyin Akin.




Reply | Threaded
Open this post in threaded view
|

RE: Java wrapper test program using Eclipse 3.1.1

Joe Byers-2
In reply to this post by Joe Byers-2
Jerry,

I would be glad to help you.

First, initial questions and posts should be directed to the quantlib-users list.  Direct contact can follow from the initial posting.

This error I saw many times when trying to get the java and cpp wrappers compiled along with running the tests.

did you get the cppwrapper and javawrapper built?  there should be a cppwrapper.dll file in the cppwrapper/debug tree.  If not, you will have to click on the cppwrapper and right click build project or go the the project menu and select build project from there.

When building the swapvaluation test java script skwash.com says to make sure you have the location of the cppwrapper and javawrapper code in a path variable.  Add ${env_var:PATH}; to the beginning of this path variable so the appropriate cygwin and mingw files can be found.

good luck,
joe



Jerry Jie Ji <[hidden email]> wrote:
Hi Joe,
 
My name is Jerry, a new QuantLib user. I hope you don’t mind such a direct mail.
 
I am also following the QuantLib Skwash tutorial but am getting nowhere, it would be greatly appreciated if
you could share your findings. I’m getting the following error when running the example swap java code --
 
SwapValuation failed
java.lang.UnsatisfiedLinkError: no QuantLibCppWrapper in java.library.path
      at java.lang.ClassLoader.loadLibrary(Unknown Source)
      at java.lang.Runtime.loadLibrary0(Unknown Source)
      at java.lang.System.loadLibrary(Unknown Source)
      at org.quantlib.examples.SwapValuation.main(SwapValuation.java:7)
 
My problem must be more primitive than yours. I have successfully build QuantLib 0.3.11 under eclipse (3.1.2)
CDT. I am using Skwash 1.0.2, and I don’t  get anything under the Cpp Wrapper project, because not only do
I not see any instruction in the tutorial on how to build the Cpp Wrapper project, but also I don’t understand
what the Cpp Wrapper place holder is for.
 
Many thanks in advance!
 
P.S. When you reply, could you please “reply to all”, which will also include my personal address.
 
--
Jerry
T&O-RTT
DBS Tower 2
DID 687 85315

From: [hidden email] [mailto:[hidden email]] On Behalf Of Joe Byers
Sent: Monday, March 20, 2006 10:43 PM
To: Luigi Ballabio
Cc: [hidden email]
Subject: Re: [Quantlib-users] Java wrapper test program using Eclipse 3.1.1
 
Luigi,

Thank you for your suggestions.  I did finally get it to compile (using Mingw) and ran the test suite from Skwash.com.  I had to modify a couple of items in the skwash example and found a problem with eclipse CDT 3.0.2 build options.  I am working on and compilation of the problems and actions to post for future reference for other individuals.

On another note,  I have the algorithm for a calendar of the North American Energy Reliability Council (NERC) holidays.  This is important for pricing derivative on electricity in the US.  Can you point to someone to help develop this for Quantlib calendar module?

Thank you
Joe W. Byers


Luigi Ballabio <[hidden email]> wrote:

On 03/08/2006 06:08:31 AM, Joe Byers wrote:
> I have compiled quantlib, built and complie d the java wrapper, cpp
> wrapper, and skwash examples from skwash.com.
>
> I followed the instructions on running/debuging the program and
> created an environment variable named PATH as
> ${env_var:PATH};C:\DWork\eclipse\workspace\Quantlib\Release\;C:\DWork\eclipse\workspace\QuantlibCPPWrapper\Release\.
> Note I had to add ${env_var:PATH} to the beginning of the variable to
> get rid of failure to find cygwin1.dll error.

I'm not very knowledgeable about the Java module, but I was under the
impression that those who compiled it used MinGW rather than the Cygwin
compiler. Also, I had reports that the wrapper behaved erratically when
QuantLib was compiled as a shared library---you might want to try
building it as a static library instead.

Luigi



----------------------------------------

Blessed is the man who, having nothing to say, abstains from giving
wordy evidence of the fact.-- George Eliot



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous

Brings words and photos together (easily) with
PhotoMail - it's free and works with Yahoo! Mail.
CONFIDENTIAL NOTE: The information contained in this email is intended only for the use of the individual or entity named above and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete the mail. Thank you.



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous


Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.
Reply | Threaded
Open this post in threaded view
|

Re: Java wrapper test program using Eclipse 3.1.1

jerryji
Dear Joe,

Thank you very much for your generous help and sorry for being new to mailing list rules.

I'm still stuck. This is what my Eclipse projects look like (images don't show up in mailing lists?) --

Eclipse Skwash Project View

There is indeed nothing under QuantLib Cpp Wrapper project and any attempt to build/rebuild
the project only gets --

Nothing to build for project QuantLib Cpp Wrapper

without generating the Debug directory or anything else. Even though there is a quantlib.cxx under
the QuantLib Cpp Wrapper project directory physically.

Similarly, building of the QuantLib Skwash project returns immediately the following without any
real output files --

C:\swigwin-1.3.27\swig.exe -java -c++ -module quantlib -o D:\jerryji's Documents\eclipse\workspace\QuantLib Cpp Wrapper\quantlib.cxx -outdir D:\jerryji's Documents\eclipse\workspace\QuantLib Java Wrapper\org\quantlib -package org.quantlib swig.i

exit status:    0


I must be having a conceptual problem in understanding how Skwash should work, any hint will be
most welcome.

Many thanks in advance!

--
Jerry

Joe Byers wrote:
Jerry,

I would be glad to help you.

First, initial questions and posts should be directed to the quantlib-users list.  Direct contact can follow from the initial posting.

This error I saw many times when trying to get the java and cpp wrappers compiled along with running the tests.

did you get the cppwrapper and javawrapper built?  there should be a cppwrapper.dll file in the cppwrapper/debug tree.  If not, you will have to click on the cppwrapper and right click build project or go the the project menu and select build project from there.

When building the swapvaluation test java script skwash.com says to make sure you have the location of the cppwrapper and javawrapper code in a path variable.  Add ${env_var:PATH}; to the beginning of this path variable so the appropriate cygwin and mingw files can be found.

good luck,
joe



Jerry Jie Ji [hidden email] wrote:
Hi Joe,
 
My name is Jerry, a new QuantLib user. I hope you don’t mind such a direct mail.
 
I am also following the QuantLib Skwash tutorial but am getting nowhere, it would be greatly appreciated if
you could share your findings. I’m getting the following error when running the example swap java code --
 
SwapValuation failed
java.lang.UnsatisfiedLinkError: no QuantLibCppWrapper in java.library.path
      at java.lang.ClassLoader.loadLibrary(Unknown Source)
      at java.lang.Runtime.loadLibrary0(Unknown Source)
      at java.lang.System.loadLibrary(Unknown Source)
      at org.quantlib.examples.SwapValuation.main(SwapValuation.java:7)
 
My problem must be more primitive than yours. I have successfully build QuantLib 0.3.11 under eclipse (3.1.2)
CDT. I am using Skwash 1.0.2, and I don’t  get anything under the Cpp Wrapper project, because not only do
I not see any instruction in the tutorial on how to build the Cpp Wrapper project, but also I don’t understand
what the Cpp Wrapper place holder is for.
 
Many thanks in advance!
 
P.S. When you reply, could you please “reply to all”, which will also include my personal address.
 
--
Jerry
T&O-RTT
DBS Tower 2
DID 687 85315

From: [hidden email] [[hidden email]] On Behalf Of Joe Byers
Sent: Monday, March 20, 2006 10:43 PM
To: Luigi Ballabio
Cc: [hidden email]
Subject: Re: [Quantlib-users] Java wrapper test program using Eclipse 3.1.1
 
Luigi,

Thank you for your suggestions.  I did finally get it to compile (using Mingw) and ran the test suite from Skwash.com.  I had to modify a couple of items in the skwash example and found a problem with eclipse CDT 3.0.2 build options.  I am working on and compilation of the problems and actions to post for future reference for other individuals.

On another note,  I have the algorithm for a calendar of the North American Energy Reliability Council (NERC) holidays.  This is important for pricing derivative on electricity in the US.  Can you point to someone to help develop this for Quantlib calendar module?

Thank you
Joe W. Byers


Luigi Ballabio [hidden email] wrote:

On 03/08/2006 06:08:31 AM, Joe Byers wrote:
> I have compiled quantlib, built and complie d the java wrapper, cpp
> wrapper, and skwash examples from skwash.com.
>
> I followed the instructions on running/debuging the program and
> created an environment variable named PATH as
> ${env_var:PATH};C:\DWork\eclipse\workspace\Quantlib\Release\;C:\DWork\eclipse\workspace\QuantlibCPPWrapper\Release\.
> Note I had to add ${env_var:PATH} to the beginning of the variable to
> get rid of failure to find cygwin1.dll error.

I'm not very knowledgeable about the Java module, but I was under the
impression that those who compiled it used MinGW rather than the Cygwin
compiler. Also, I had reports that the wrapper behaved erratically when
QuantLib was compiled as a shared library---you might want to try
building it as a static library instead.

Luigi



----------------------------------------

Blessed is the man who, having nothing to say, abstains from giving
wordy evidence of the fact.-- George Eliot



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous

Brings words and photos together (easily) with
PhotoMail - it's free and works with Yahoo! Mail.
CONFIDENTIAL NOTE: The information contained in this email is intended only for the use of the individual or entity named above and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete the mail. Thank you.



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous


Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.
Reply | Threaded
Open this post in threaded view
|

Re: Java wrapper test program using Eclipse 3.1.1

Joe Byers-2
Jerry,

I am new to all of this as well. 
Do you you have a quantlib project that you built the quantlib.dll?

Also, your javawrapper does not look like you created the org.quantlib package.  you might go back throught the steps for creating the javawrapper on skwash.com.

Also, when you build the skwash project you should see java classes in your javawrapper org.quantlib package and a quantlib.cxx in the cppwrapper.  If these are not there after building quantib skwash then the skwash build using swig is not working. 

I had to delete everything and start over from scratch several time before I worked out the problems.  When building the quantlib project or the cppwrapper project be sure and select debug builds not release.  There is a problem with the eclicpe cdt 3.0.2 release build.

Joe


Jerry Ji <[hidden email]> wrote:
Dear Joe,

Thank you very much for your generous help and sorry for being new to mailing list rules.

I'm still stuck. This is what my Eclipse projects look like (images don't show up in mailing lists?) --

Eclipse Skwash Project View

There is indeed nothing under QuantLib Cpp Wrapper project and any attempt to build/rebuild
the project only gets --

Nothing to build for project QuantLib Cpp Wrapper

without generating the Debug directory or anything else. Even though there is a quantlib.cxx under
the QuantLib Cpp Wrapper project directory physically.

Similarly, building of the QuantLib Skwash project returns immediately the following without any
real output files --

C:\swigwin-1.3.27\swig.exe -java -c++ -module quantlib -o D:\jerryji's Documents\eclipse\workspace\QuantLib Cpp Wrapper\quantlib.cxx -outdir D:\jerryji's Documents\eclipse\workspace\QuantLib Java Wrapper\org\quantlib -package org.quantlib swig.i

exit status:    0


I must be having a conceptual problem in understanding how Skwash should work, any hint will be
most welcome.

Many thanks in advance!

--
Jerry

Joe Byers wrote:
Jerry,

I would be glad to help you.

First, initial questions and posts should be directed to the quantlib-users list.  Direct contact can follow from the initial posting.

This error I saw many times when trying to get the java and cpp wrappers compiled along with running the tests.

did you get the cppwrapper and javawrapper built?  there should be a cppwrapper.dll file in the cppwrapper/debug tree.  If not, you will have to click on the cppwrapper and right click build project or go the the project menu and select build project from there.

When building the swapvaluation test java script skwash.com says to make sure you have the location of the cppwrapper and javawrapper code in a path variable.  Add ${env_var:PATH}; to the beginning of this path variable so the appropriate cygwin and mingw files can be found.

good luck,
joe



Jerry Jie Ji [hidden email] wrote:
Hi Joe,
 
My name is Jerry, a new QuantLib user. I hope you don’t mind such a direct mail.
 
I am also following the QuantLib Skwash tutorial but am getting nowhere, it would be greatly appreciated if
you could share your findings. I’m getting the following error when running the example swap java code --
 
SwapValuation failed
java.lang.UnsatisfiedLinkError: no QuantLibCppWrapper in java.library.path
      at java.lang.ClassLoader.loadLibrary(Unknown Source)
      at java.lang.Runtime.loadLibrary0(Unknown Source)
      at java.lang.System.loadLibrary(Unknown Source)
      at org.quantlib.examples.SwapValuation.main(SwapValuation.java:7)
 
My problem must be more primitive than yours. I have successfully build QuantLib 0.3.11 under eclipse (3.1.2)
CDT. I am using Skwash 1.0.2, and I don’t  get anything under the Cpp Wrapper project, because not only do
I not see any instruction in the tutorial on how to build the Cpp Wrapper project, but also I don’t understand
what the Cpp Wrapper place holder is for.
 
Many thanks in advance!
 
P.S. When you reply, could you please “reply to all”, which will also include my personal address.
 
--
Jerry
T&O-RTT
DBS Tower 2
DID 687 85315

From: [hidden email] [[hidden email]] On Behalf Of Joe Byers
Sent: Monday, March 20, 2006 10:43 PM
To: Luigi Ballabio
Cc: [hidden email]
Subject: Re: [Quantlib-users] Java wrapper test program using Eclipse 3.1.1
 
Luigi,

Thank you for your suggestions.  I did finally get it to compile (using Mingw) and ran the test suite from Skwash.com.  I had to modify a couple of items in the skwash example and found a problem with eclipse CDT 3.0.2 build options.  I am working on and compilation of the problems and actions to post for future reference for other individuals.

On another note,  I have the algorithm for a calendar of the North American Energy Reliability Council (NERC) holidays.  This is important for pricing derivative on electricity in the US.  Can you point to someone to help develop this for Quantlib calendar module?

Thank you
Joe W. Byers


Luigi Ballabio [hidden email] wrote:

On 03/08/2006 06:08:31 AM, Joe Byers wrote:
> I have compiled quantlib, built and complie d the java wrapper, cpp
> wrapper, and skwash examples from skwash.com.
>
> I followed the instructions on running/debuging the program and
> created an environment variable named PATH as
> ${env_var:PATH};C:\DWork\eclipse\workspace\Quantlib\Release\;C:\DWork\eclipse\workspace\QuantlibCPPWrapper\Release\.
> Note I had to add ${env_var:PATH} to the beginning of the variable to
> get rid of failure to find cygwin1.dll error.

I'm not very knowledgeable about the Java module, but I was under the
impression that those who compiled it used MinGW rather than the Cygwin
compiler. Also, I had reports that the wrapper behaved erratically when
QuantLib was compiled as a shared library---you might want to try
building it as a static library instead.

Luigi



----------------------------------------

Blessed is the man who, having nothing to say, abstains from giving
wordy evidence of the fact.-- George Eliot



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous

Brings words and photos together (easily) with
PhotoMail - it's free and works with Yahoo! Mail.
CONFIDENTIAL NOTE: The information contained in this email is intended only for the use of the individual or entity named above and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete the mail. Thank you.



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous

Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous


Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.
Reply | Threaded
Open this post in threaded view
|

Re: Java wrapper test program using Eclipse 3.1.1

jerryji
Dear Joe,

Thank you very much again for your help.

I just re-did everything from scratch again but received the same instantaneous return and the same
message without getting anything under either the Cpp Wrapper or the Java Wrapper project --

C:\swigwin-1.3.27\swig.exe -java -c++ -module quantlib -o D:\eclipse\workbench\QuantLib_Cpp_Wrapper\quantlib.cxx -outdir D:\eclipse\workbench\QuantLib_Java_Wrapper\org\quantlib -package org.quantlib swig.i

exit status:    0


I wonder if anyone has a successful story with the following combination of software packages --

Windows XP Professional SP2
mingw GCC 3.4.2
J2SDK 1.4.2_09
Eclipse 3.1.2
CDT 3.0.2
sKWash 1.0.2
swigwin-1.3.27
QuantLib 0.3.11 release
QuantLib-SWIG-0.3.11.zip

One thing I notice is that the swig.i file generated by the Eclipse QuantLib Skwash project (i.e., it does
not exist in QuantLib-SWIG-0.3.11/SWIG/) is empty, does that mean anything?

Many thanks in advance!

--
Jerry

Joe Byers wrote:
Jerry,

I am new to all of this as well. 
Do you you have a quantlib project that you built the quantlib.dll?

Also, your javawrapper does not look like you created the org.quantlib package.  you might go back throught the steps for creating the javawrapper on skwash.com.

Also, when you build the skwash project you should see java classes in your javawrapper org.quantlib package and a quantlib.cxx in the cppwrapper.  If these are not there after building quantib skwash then the skwash build using swig is not working. 

I had to delete everything and start over from scratch several time before I worked out the problems.  When building the quantlib project or the cppwrapper project be sure and select debug builds not release.  There is a problem with the eclicpe cdt 3.0.2 release build.

Joe


Jerry Ji [hidden email] wrote:
Dear Joe,

Thank you very much for your generous help and sorry for being new to mailing list rules.

I'm still stuck. This is what my Eclipse projects look like (images don't show up in mailing lists?) --

Eclipse Skwash Project View

There is indeed nothing under QuantLib Cpp Wrapper project and any attempt to build/rebuild
the project only gets --

Nothing to build for project QuantLib Cpp Wrapper

without generating the Debug directory or anything else. Even though there is a quantlib.cxx under
the QuantLib Cpp Wrapper project directory physically.

Similarly, building of the QuantLib Skwash project returns immediately the following without any
real output files --

C:\swigwin-1.3.27\swig.exe -java -c++ -module quantlib -o D:\jerryji's Documents\eclipse\workspace\QuantLib Cpp Wrapper\quantlib.cxx -outdir D:\jerryji's Documents\eclipse\workspace\QuantLib Java Wrapper\org\quantlib -package org.quantlib swig.i

exit status:    0


I must be having a conceptual problem in understanding how Skwash should work, any hint will be
most welcome.

Many thanks in advance!

--
Jerry

Joe Byers wrote:
Jerry,

I would be glad to help you.

First, initial questions and posts should be directed to the quantlib-users list.  Direct contact can follow from the initial posting.

This error I saw many times when trying to get the java and cpp wrappers compiled along with running the tests.

did you get the cppwrapper and javawrapper built?  there should be a cppwrapper.dll file in the cppwrapper/debug tree.  If not, you will have to click on the cppwrapper and right click build project or go the the project menu and select build project from there.

When building the swapvaluation test java script skwash.com says to make sure you have the location of the cppwrapper and javawrapper code in a path variable.  Add ${env_var:PATH}; to the beginning of this path variable so the appropriate cygwin and mingw files can be found.

good luck,
joe



Jerry Jie Ji [hidden email] wrote:
Hi Joe,
 
My name is Jerry, a new QuantLib user. I hope you don’t mind such a direct mail.
 
I am also following the QuantLib Skwash tutorial but am getting nowhere, it would be greatly appreciated if
you could share your findings. I’m getting the following error when running the example swap java code --
 
SwapValuation failed
java.lang.UnsatisfiedLinkError: no QuantLibCppWrapper in java.library.path
      at java.lang.ClassLoader.loadLibrary(Unknown Source)
      at java.lang.Runtime.loadLibrary0(Unknown Source)
      at java.lang.System.loadLibrary(Unknown Source)
      at org.quantlib.examples.SwapValuation.main(SwapValuation.java:7)
 
My problem must be more primitive than yours. I have successfully build QuantLib 0.3.11 under eclipse (3.1.2)
CDT. I am using Skwash 1.0.2, and I don’t  get anything under the Cpp Wrapper project, because not only do
I not see any instruction in the tutorial on how to build the Cpp Wrapper project, but also I don’t understand
what the Cpp Wrapper place holder is for.
 
Many thanks in advance!
 
P.S. When you reply, could you please “reply to all”, which will also include my personal address.
 
--
Jerry
T&O-RTT
DBS Tower 2
DID 687 85315

From: [hidden email] [[hidden email]] On Behalf Of Joe Byers
Sent: Monday, March 20, 2006 10:43 PM
To: Luigi Ballabio
Cc: [hidden email]
Subject: Re: [Quantlib-users] Java wrapper test program using Eclipse 3.1.1
 
Luigi,

Thank you for your suggestions.  I did finally get it to compile (using Mingw) and ran the test suite from Skwash.com.  I had to modify a couple of items in the skwash example and found a problem with eclipse CDT 3.0.2 build options.  I am working on and compilation of the problems and actions to post for future reference for other individuals.

On another note,  I have the algorithm for a calendar of the North American Energy Reliability Council (NERC) holidays.  This is important for pricing derivative on electricity in the US.  Can you point to someone to help develop this for Quantlib calendar module?

Thank you
Joe W. Byers


Luigi Ballabio [hidden email] wrote:

On 03/08/2006 06:08:31 AM, Joe Byers wrote:
> I have compiled quantlib, built and complie d the java wrapper, cpp
> wrapper, and skwash examples from skwash.com.
>
> I followed the instructions on running/debuging the program and
> created an environment variable named PATH as
> ${env_var:PATH};C:\DWork\eclipse\workspace\Quantlib\Release\;C:\DWork\eclipse\workspace\QuantlibCPPWrapper\Release\.
> Note I had to add ${env_var:PATH} to the beginning of the variable to
> get rid of failure to find cygwin1.dll error.

I'm not very knowledgeable about the Java module, but I was under the
impression that those who compiled it used MinGW rather than the Cygwin
compiler. Also, I had reports that the wrapper behaved erratically when
QuantLib was compiled as a shared library---you might want to try
building it as a static library instead.

Luigi



----------------------------------------

Blessed is the man who, having nothing to say, abstains from giving
wordy evidence of the fact.-- George Eliot



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous

Brings words and photos together (easily) with
PhotoMail - it's free and works with Yahoo! Mail.
CONFIDENTIAL NOTE: The information contained in this email is intended only for the use of the individual or entity named above and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete the mail. Thank you.



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous

Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous


Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.
Reply | Threaded
Open this post in threaded view
|

Re: Java wrapper test program using Eclipse 3.1.1

johan-35

Hi,
 
"One thing I notice is that the swig.i file generated by the Eclipse QuantLib Skwash project (i.e., it does
not exist in QuantLib-SWIG-0.3.11/SWIG/) is empty, does that mean anything? "
 
Yes: that means everything. Please follow the first step of part IV of the tutorial (http://users.telenet.be/johan.witters/website/skwash.com/get/get3apart4.html):

"Before proceeding you need to download the swig interface files of quantlib. These are available from QuantLib CVS Repository. The site explains how to retrieve these files. However, you can use Eclipse for this purpose too. Click here for more info. Make sure you get the Swig Interface Files that match the version of Quantlib which you have downloaded. Also, make sure to download a version of quantlib that supports Java (support available from version 0.3.11). "

I hope this helps.

Cheers,

Johan

----- Original Message -----
Sent: Friday, March 24, 2006 5:13 AM
Subject: Re: [Quantlib-users] Java wrapper test program using Eclipse 3.1.1

Dear Joe,

Thank you very much again for your help.

I just re-did everything from scratch again but received the same instantaneous return and the same
message without getting anything under either the Cpp Wrapper or the Java Wrapper project --

C:\swigwin-1.3.27\swig.exe -java -c++ -module quantlib -o D:\eclipse\workbench\QuantLib_Cpp_Wrapper\quantlib.cxx -outdir D:\eclipse\workbench\QuantLib_Java_Wrapper\org\quantlib -package org.quantlib swig.i

exit status:    0


I wonder if anyone has a successful story with the following combination of software packages --

Windows XP Professional SP2
mingw GCC 3.4.2
J2SDK 1.4.2_09
Eclipse 3.1.2
CDT 3.0.2
sKWash 1.0.2
swigwin-1.3.27
QuantLib 0.3.11 release
QuantLib-SWIG-0.3.11.zip

One thing I notice is that the swig.i file generated by the Eclipse QuantLib Skwash project (i.e., it does
not exist in QuantLib-SWIG-0.3.11/SWIG/) is empty, does that mean anything?

Many thanks in advance!

--
Jerry

Joe Byers wrote:
Jerry,

I am new to all of this as well. 
Do you you have a quantlib project that you built the quantlib.dll?

Also, your javawrapper does not look like you created the org.quantlib package.  you might go back throught the steps for creating the javawrapper on skwash.com.

Also, when you build the skwash project you should see java classes in your javawrapper org.quantlib package and a quantlib.cxx in the cppwrapper.  If these are not there after building quantib skwash then the skwash build using swig is not working. 

I had to delete everything and start over from scratch several time before I worked out the problems.  When building the quantlib project or the cppwrapper project be sure and select debug builds not release.  There is a problem with the eclicpe cdt 3.0.2 release build.

Joe


Jerry Ji [hidden email] wrote:
Dear Joe,

Thank you very much for your generous help and sorry for being new to mailing list rules.

I'm still stuck. This is what my Eclipse projects look like (images don't show up in mailing lists?) --

Eclipse Skwash Project View

There is indeed nothing under QuantLib Cpp Wrapper project and any attempt to build/rebuild
the project only gets --

Nothing to build for project QuantLib Cpp Wrapper

without generating the Debug directory or anything else. Even though there is a quantlib.cxx under
the QuantLib Cpp Wrapper project directory physically.

Similarly, building of the QuantLib Skwash project returns immediately the following without any
real output files --

C:\swigwin-1.3.27\swig.exe -java -c++ -module quantlib -o D:\jerryji's Documents\eclipse\workspace\QuantLib Cpp Wrapper\quantlib.cxx -outdir D:\jerryji's Documents\eclipse\workspace\QuantLib Java Wrapper\org\quantlib -package org.quantlib swig.i

exit status:    0


I must be having a conceptual problem in understanding how Skwash should work, any hint will be
most welcome.

Many thanks in advance!

--
Jerry

Joe Byers wrote:
Jerry,

I would be glad to help you.

First, initial questions and posts should be directed to the quantlib-users list.  Direct contact can follow from the initial posting.

This error I saw many times when trying to get the java and cpp wrappers compiled along with running the tests.

did you get the cppwrapper and javawrapper built?  there should be a cppwrapper.dll file in the cppwrapper/debug tree.  If not, you will have to click on the cppwrapper and right click build project or go the the project menu and select build project from there.

When building the swapvaluation test java script skwash.com says to make sure you have the location of the cppwrapper and javawrapper code in a path variable.  Add ${env_var:PATH}; to the beginning of this path variable so the appropriate cygwin and mingw files can be found.

good luck,
joe



Jerry Jie Ji [hidden email] wrote:
Hi Joe,
My name is Jerry, a new QuantLib user. I hope you don’t mind such a direct mail.
I am also following the QuantLib Skwash tutorial but am getting nowhere, it would be greatly appreciated if
you could share your findings. I’m getting the following error when running the example swap java code --
SwapValuation failed
java.lang.UnsatisfiedLinkError: no QuantLibCppWrapper in java.library.path
      at java.lang.ClassLoader.loadLibrary(Unknown Source)
      at java.lang.Runtime.loadLibrary0(Unknown Source)
      at java.lang.System.loadLibrary(Unknown Source)
      at org.quantlib.examples.SwapValuation.main(SwapValuation.java:7)
My problem must be more primitive than yours. I have successfully build QuantLib 0.3.11 under eclipse (3.1.2)
CDT. I am using Skwash 1.0.2, and I don’t  get anything under the Cpp Wrapper project, because not only do
I not see any instruction in the tutorial on how to build the Cpp Wrapper project, but also I don’t understand
what the Cpp Wrapper place holder is for.
Many thanks in advance!
P.S. When you reply, could you please “reply to all”, which will also include my personal address.
--
Jerry
T&O-RTT
DBS Tower 2
DID 687 85315

From: [hidden email] [[hidden email]] On Behalf Of Joe Byers
Sent: Monday, March 20, 2006 10:43 PM
To: Luigi Ballabio
Cc: [hidden email]
Subject: Re: [Quantlib-users] Java wrapper test program using Eclipse 3.1.1
Luigi,

Thank you for your suggestions.  I did finally get it to compile (using Mingw) and ran the test suite from Skwash.com.  I had to modify a couple of items in the skwash example and found a problem with eclipse CDT 3.0.2 build options.  I am working on and compilation of the problems and actions to post for future reference for other individuals.

On another note,  I have the algorithm for a calendar of the North American Energy Reliability Council (NERC) holidays.  This is important for pricing derivative on electricity in the US.  Can you point to someone to help develop this for Quantlib calendar module?

Thank you
Joe W. Byers


Luigi Ballabio [hidden email] wrote:

On 03/08/2006 06:08:31 AM, Joe Byers wrote:
> I have compiled quantlib, built and complie d the java wrapper, cpp
> wrapper, and skwash examples from skwash.com.
>
> I followed the instructions on running/debuging the program and
> created an environment variable named PATH as
> ${env_var:PATH};C:\DWork\eclipse\workspace\Quantlib\Release\;C:\DWork\eclipse\workspace\QuantlibCPPWrapper\Release\.
> Note I had to add ${env_var:PATH} to the beginning of the variable to
> get rid of failure to find cygwin1.dll error.

I'm not very knowledgeable about the Java module, but I was under the
impression that those who compiled it used MinGW rather than the Cygwin
compiler. Also, I had reports that the wrapper behaved erratically when
QuantLib was compiled as a shared library---you might want to try
building it as a static library instead.

Luigi



----------------------------------------

Blessed is the man who, having nothing to say, abstains from giving
wordy evidence of the fact.-- George Eliot



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous

Brings words and photos together (easily) with
PhotoMail - it's free and works with Yahoo! Mail.
CONFIDENTIAL NOTE: The information contained in this email is intended only for the use of the individual or entity named above and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete the mail. Thank you.



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous

Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous


Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.
Reply | Threaded
Open this post in threaded view
|

Re: Java wrapper test program using Eclipse 3.1.1

jerryji
Dear Johan,

Thank you very much for pointing it out, before which I thought I've read every page of the
Skwash tutorial many times. I just checked out the SWIG CVS branch R000311f0 (sorry to
the text mailing list users for the image of my Eclipse project view) --

Eclipse Projects View

However, there is still no this swig.i file that I was hoping for --

jerryji@SGSW2L8WVLY /cygdrive/d/eclipse/workbench
(Fri Mar 24 17:44:18) $ diff QuantLib\ SWIG\ Interface\ Files\ CVS/ ../../QuantLib/source/QuantLib-SWIG-0.3.11/SWIG/
Only in QuantLib SWIG Interface Files CVS/: .project
Only in QuantLib SWIG Interface Files CVS/: CVS


In fact, the CVS checkout directory is identical to QuantLib-SWIG-0.3.11/SWIG/ in the release
QuantLib-SWIG-0.3.11.zip --

jerryji@SGSW2L8WVLY /cygdrive/d/eclipse/workbench/QuantLib SWIG Interface Files CVS/
(Fri Mar 24 17:58:09) $ for i in *.i ; do diff -wc $i ../../../QuantLib/source/QuantLib-SWIG-0.3.11/SWIG/$i ; done


Man, I must be only one inch away from success, just where do I step?

--
Jerry


Johan Witters wrote:
Hi,
 
"One thing I notice is that the swig.i file generated by the Eclipse QuantLib Skwash project (i.e., it does
not exist in QuantLib-SWIG-0.3.11/SWIG/) is empty, does that mean anything? "
 
Yes: that means everything. Please follow the first step of part IV of the tutorial (http://users.telenet.be/johan.witters/website/skwash.com/get/get3apart4.html):

"Before proceeding you need to download the swig interface files of quantlib. These are available from QuantLib CVS Repository. The site explains how to retrieve these files. However, you can use Eclipse for this purpose too. Click here for more info. Make sure you get the Swig Interface Files that match the version of Quantlib which you have downloaded. Also, make sure to download a version of quantlib that supports Java (support available from version 0.3.11). "

I hope this helps.

Cheers,

Johan

----- Original Message -----
Sent: Friday, March 24, 2006 5:13 AM
Subject: Re: [Quantlib-users] Java wrapper test program using Eclipse 3.1.1

Dear Joe,

Thank you very much again for your help.

I just re-did everything from scratch again but received the same instantaneous return and the same
message without getting anything under either the Cpp Wrapper or the Java Wrapper project --

C:\swigwin-1.3.27\swig.exe -java -c++ -module quantlib -o D:\eclipse\workbench\QuantLib_Cpp_Wrapper\quantlib.cxx -outdir D:\eclipse\workbench\QuantLib_Java_Wrapper\org\quantlib -package org.quantlib swig.i

exit status:    0


I wonder if anyone has a successful story with the following combination of software packages --

Windows XP Professional SP2
mingw GCC 3.4.2
J2SDK 1.4.2_09
Eclipse 3.1.2
CDT 3.0.2
sKWash 1.0.2
swigwin-1.3.27
QuantLib 0.3.11 release
QuantLib-SWIG-0.3.11.zip

One thing I notice is that the swig.i file generated by the Eclipse QuantLib Skwash project (i.e., it does
not exist in QuantLib-SWIG-0.3.11/SWIG/) is empty, does that mean anything?

Many thanks in advance!

--
Jerry

Joe Byers wrote:
Jerry,

I am new to all of this as well. 
Do you you have a quantlib project that you built the quantlib.dll?

Also, your javawrapper does not look like you created the org.quantlib package.  you might go back throught the steps for creating the javawrapper on skwash.com.

Also, when you build the skwash project you should see java classes in your javawrapper org.quantlib package and a quantlib.cxx in the cppwrapper.  If these are not there after building quantib skwash then the skwash build using swig is not working. 

I had to delete everything and start over from scratch several time before I worked out the problems.  When building the quantlib project or the cppwrapper project be sure and select debug builds not release.  There is a problem with the eclicpe cdt 3.0.2 release build.

Joe


Jerry Ji [hidden email] wrote:
Dear Joe,

Thank you very much for your generous help and sorry for being new to mailing list rules.

I'm still stuck. This is what my Eclipse projects look like (images don't show up in mailing lists?) --

Eclipse Skwash Project View

There is indeed nothing under QuantLib Cpp Wrapper project and any attempt to build/rebuild
the project only gets --

Nothing to build for project QuantLib Cpp Wrapper

without generating the Debug directory or anything else. Even though there is a quantlib.cxx under
the QuantLib Cpp Wrapper project directory physically.

Similarly, building of the QuantLib Skwash project returns immediately the following without any
real output files --

C:\swigwin-1.3.27\swig.exe -java -c++ -module quantlib -o D:\jerryji's Documents\eclipse\workspace\QuantLib Cpp Wrapper\quantlib.cxx -outdir D:\jerryji's Documents\eclipse\workspace\QuantLib Java Wrapper\org\quantlib -package org.quantlib swig.i

exit status:    0


I must be having a conceptual problem in understanding how Skwash should work, any hint will be
most welcome.

Many thanks in advance!

--
Jerry

Joe Byers wrote:
Jerry,

I would be glad to help you.

First, initial questions and posts should be directed to the quantlib-users list.  Direct contact can follow from the initial posting.

This error I saw many times when trying to get the java and cpp wrappers compiled along with running the tests.

did you get the cppwrapper and javawrapper built?  there should be a cppwrapper.dll file in the cppwrapper/debug tree.  If not, you will have to click on the cppwrapper and right click build project or go the the project menu and select build project from there.

When building the swapvaluation test java script skwash.com says to make sure you have the location of the cppwrapper and javawrapper code in a path variable.  Add ${env_var:PATH}; to the beginning of this path variable so the appropriate cygwin and mingw files can be found.

good luck,
joe



Jerry Jie Ji [hidden email] wrote:
Hi Joe,
My name is Jerry, a new QuantLib user. I hope you don’t mind such a direct mail.
I am also following the QuantLib Skwash tutorial but am getting nowhere, it would be greatly appreciated if
you could share your findings. I’m getting the following error when running the example swap java code --
SwapValuation failed
java.lang.UnsatisfiedLinkError: no QuantLibCppWrapper in java.library.path
      at java.lang.ClassLoader.loadLibrary(Unknown Source)
      at java.lang.Runtime.loadLibrary0(Unknown Source)
      at java.lang.System.loadLibrary(Unknown Source)
      at org.quantlib.examples.SwapValuation.main(SwapValuation.java:7)
My problem must be more primitive than yours. I have successfully build QuantLib 0.3.11 under eclipse (3.1.2)
CDT. I am using Skwash 1.0.2, and I don’t  get anything under the Cpp Wrapper project, because not only do
I not see any instruction in the tutorial on how to build the Cpp Wrapper project, but also I don’t understand
what the Cpp Wrapper place holder is for.
Many thanks in advance!
P.S. When you reply, could you please “reply to all”, which will also include my personal address.
--
Jerry
T&O-RTT
DBS Tower 2
DID 687 85315

From: [hidden email] [[hidden email]] On Behalf Of Joe Byers
Sent: Monday, March 20, 2006 10:43 PM
To: Luigi Ballabio
Cc: [hidden email]
Subject: Re: [Quantlib-users] Java wrapper test program using Eclipse 3.1.1
Luigi,

Thank you for your suggestions.  I did finally get it to compile (using Mingw) and ran the test suite from Skwash.com.  I had to modify a couple of items in the skwash example and found a problem with eclipse CDT 3.0.2 build options.  I am working on and compilation of the problems and actions to post for future reference for other individuals.

On another note,  I have the algorithm for a calendar of the North American Energy Reliability Council (NERC) holidays.  This is important for pricing derivative on electricity in the US.  Can you point to someone to help develop this for Quantlib calendar module?

Thank you
Joe W. Byers


Luigi Ballabio [hidden email] wrote:

On 03/08/2006 06:08:31 AM, Joe Byers wrote:
> I have compiled quantlib, built and complie d the java wrapper, cpp
> wrapper, and skwash examples from skwash.com.
>
> I followed the instructions on running/debuging the program and
> created an environment variable named PATH as
> ${env_var:PATH};C:\DWork\eclipse\workspace\Quantlib\Release\;C:\DWork\eclipse\workspace\QuantlibCPPWrapper\Release\.
> Note I had to add ${env_var:PATH} to the beginning of the variable to
> get rid of failure to find cygwin1.dll error.

I'm not very knowledgeable about the Java module, but I was under the
impression that those who compiled it used MinGW rather than the Cygwin
compiler. Also, I had reports that the wrapper behaved erratically when
QuantLib was compiled as a shared library---you might want to try
building it as a static library instead.

Luigi



----------------------------------------

Blessed is the man who, having nothing to say, abstains from giving
wordy evidence of the fact.-- George Eliot



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous

Brings words and photos together (easily) with
PhotoMail - it's free and works with Yahoo! Mail.
CONFIDENTIAL NOTE: The information contained in this email is intended only for the use of the individual or entity named above and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete the mail. Thank you.



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous
Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.
Reply | Threaded
Open this post in threaded view
|

Re: Java wrapper test program using Eclipse 3.1.1

johan-35

Open the properties of your skwash project (right click your skwash project and choose project properties from the popup menu). The main swig interfacefile should refer to quantlib.i instead of swig.i. You, I think, missed step http://users.telenet.be/johan.witters/website/skwash.com/get/get3dpart4.html
 
Hope this helpps
 
cheers,
Johan
----- Original Message -----
Sent: Friday, March 24, 2006 10:04 AM
Subject: Re: [Quantlib-users] Java wrapper test program using Eclipse 3.1.1

Dear Johan,

Thank you very much for pointing it out, before which I thought I've read every page of the
Skwash tutorial many times. I just checked out the SWIG CVS branch R000311f0 (sorry to
the text mailing list users for the image of my Eclipse project view) --

Eclipse Projects View

However, there is still no this swig.i file that I was hoping for --

[hidden email] /cygdrive/d/eclipse/workbench
(Fri Mar 24 17:44:18) $ diff QuantLib\ SWIG\ Interface\ Files\ CVS/ ../../QuantLib/source/QuantLib-SWIG-0.3.11/SWIG/
Only in QuantLib SWIG Interface Files CVS/: .project
Only in QuantLib SWIG Interface Files CVS/: CVS


In fact, the CVS checkout directory is identical to QuantLib-SWIG-0.3.11/SWIG/ in the release
QuantLib-SWIG-0.3.11.zip --

jerryji@SGSW2L8WVLY /cygdrive/d/eclipse/workbench/QuantLib SWIG Interface Files CVS/
(Fri Mar 24 17:58:09) $ for i in *.i ; do diff -wc $i ../../../QuantLib/source/QuantLib-SWIG-0.3.11/SWIG/$i ; done


Man, I must be only one inch away from success, just where do I step?

--
Jerry


Johan Witters wrote:
Hi,
 
"One thing I notice is that the swig.i file generated by the Eclipse QuantLib Skwash project (i.e., it does
not exist in QuantLib-SWIG-0.3.11/SWIG/) is empty, does that mean anything? "
 
Yes: that means everything. Please follow the first step of part IV of the tutorial (http://users.telenet.be/johan.witters/website/skwash.com/get/get3apart4.html):

"Before proceeding you need to download the swig interface files of quantlib. These are available from QuantLib CVS Repository. The site explains how to retrieve these files. However, you can use Eclipse for this purpose too. Click here for more info. Make sure you get the Swig Interface Files that match the version of Quantlib which you have downloaded. Also, make sure to download a version of quantlib that supports Java (support available from version 0.3.11). "

I hope this helps.

Cheers,

Johan

----- Original Message -----
Sent: Friday, March 24, 2006 5:13 AM
Subject: Re: [Quantlib-users] Java wrapper test program using Eclipse 3.1.1

Dear Joe,

Thank you very much again for your help.

I just re-did everything from scratch again but received the same instantaneous return and the same
message without getting anything under either the Cpp Wrapper or the Java Wrapper project --

C:\swigwin-1.3.27\swig.exe -java -c++ -module quantlib -o D:\eclipse\workbench\QuantLib_Cpp_Wrapper\quantlib.cxx -outdir D:\eclipse\workbench\QuantLib_Java_Wrapper\org\quantlib -package org.quantlib swig.i

exit status:    0


I wonder if anyone has a successful story with the following combination of software packages --

Windows XP Professional SP2
mingw GCC 3.4.2
J2SDK 1.4.2_09
Eclipse 3.1.2
CDT 3.0.2
sKWash 1.0.2
swigwin-1.3.27
QuantLib 0.3.11 release
QuantLib-SWIG-0.3.11.zip

One thing I notice is that the swig.i file generated by the Eclipse QuantLib Skwash project (i.e., it does
not exist in QuantLib-SWIG-0.3.11/SWIG/) is empty, does that mean anything?

Many thanks in advance!

--
Jerry

Joe Byers wrote:
Jerry,

I am new to all of this as well. 
Do you you have a quantlib project that you built the quantlib.dll?

Also, your javawrapper does not look like you created the org.quantlib package.  you might go back throught the steps for creating the javawrapper on skwash.com.

Also, when you build the skwash project you should see java classes in your javawrapper org.quantlib package and a quantlib.cxx in the cppwrapper.  If these are not there after building quantib skwash then the skwash build using swig is not working. 

I had to delete everything and start over from scratch several time before I worked out the problems.  When building the quantlib project or the cppwrapper project be sure and select debug builds not release.  There is a problem with the eclicpe cdt 3.0.2 release build.

Joe


Jerry Ji [hidden email] wrote:
Dear Joe,

Thank you very much for your generous help and sorry for being new to mailing list rules.

I'm still stuck. This is what my Eclipse projects look like (images don't show up in mailing lists?) --

Eclipse Skwash Project View

There is indeed nothing under QuantLib Cpp Wrapper project and any attempt to build/rebuild
the project only gets --

Nothing to build for project QuantLib Cpp Wrapper

without generating the Debug directory or anything else. Even though there is a quantlib.cxx under
the QuantLib Cpp Wrapper project directory physically.

Similarly, building of the QuantLib Skwash project returns immediately the following without any
real output files --

C:\swigwin-1.3.27\swig.exe -java -c++ -module quantlib -o D:\jerryji's Documents\eclipse\workspace\QuantLib Cpp Wrapper\quantlib.cxx -outdir D:\jerryji's Documents\eclipse\workspace\QuantLib Java Wrapper\org\quantlib -package org.quantlib swig.i

exit status:    0


I must be having a conceptual problem in understanding how Skwash should work, any hint will be
most welcome.

Many thanks in advance!

--
Jerry

Joe Byers wrote:
Jerry,

I would be glad to help you.

First, initial questions and posts should be directed to the quantlib-users list.  Direct contact can follow from the initial posting.

This error I saw many times when trying to get the java and cpp wrappers compiled along with running the tests.

did you get the cppwrapper and javawrapper built?  there should be a cppwrapper.dll file in the cppwrapper/debug tree.  If not, you will have to click on the cppwrapper and right click build project or go the the project menu and select build project from there.

When building the swapvaluation test java script skwash.com says to make sure you have the location of the cppwrapper and javawrapper code in a path variable.  Add ${env_var:PATH}; to the beginning of this path variable so the appropriate cygwin and mingw files can be found.

good luck,
joe



Jerry Jie Ji [hidden email] wrote:
Hi Joe,
My name is Jerry, a new QuantLib user. I hope you don’t mind such a direct mail.
I am also following the QuantLib Skwash tutorial but am getting nowhere, it would be greatly appreciated if
you could share your findings. I’m getting the following error when running the example swap java code --
SwapValuation failed
java.lang.UnsatisfiedLinkError: no QuantLibCppWrapper in java.library.path
      at java.lang.ClassLoader.loadLibrary(Unknown Source)
      at java.lang.Runtime.loadLibrary0(Unknown Source)
      at java.lang.System.loadLibrary(Unknown Source)
      at org.quantlib.examples.SwapValuation.main(SwapValuation.java:7)
My problem must be more primitive than yours. I have successfully build QuantLib 0.3.11 under eclipse (3.1.2)
CDT. I am using Skwash 1.0.2, and I don’t  get anything under the Cpp Wrapper project, because not only do
I not see any instruction in the tutorial on how to build the Cpp Wrapper project, but also I don’t understand
what the Cpp Wrapper place holder is for.
Many thanks in advance!
P.S. When you reply, could you please “reply to all”, which will also include my personal address.
--
Jerry
T&O-RTT
DBS Tower 2
DID 687 85315

From: [hidden email] [[hidden email]] On Behalf Of Joe Byers
Sent: Monday, March 20, 2006 10:43 PM
To: Luigi Ballabio
Cc: [hidden email]
Subject: Re: [Quantlib-users] Java wrapper test program using Eclipse 3.1.1
Luigi,

Thank you for your suggestions.  I did finally get it to compile (using Mingw) and ran the test suite from Skwash.com.  I had to modify a couple of items in the skwash example and found a problem with eclipse CDT 3.0.2 build options.  I am working on and compilation of the problems and actions to post for future reference for other individuals.

On another note,  I have the algorithm for a calendar of the North American Energy Reliability Council (NERC) holidays.  This is important for pricing derivative on electricity in the US.  Can you point to someone to help develop this for Quantlib calendar module?

Thank you
Joe W. Byers


Luigi Ballabio [hidden email] wrote:

On 03/08/2006 06:08:31 AM, Joe Byers wrote:
> I have compiled quantlib, built and complie d the java wrapper, cpp
> wrapper, and skwash examples from skwash.com.
>
> I followed the instructions on running/debuging the program and
> created an environment variable named PATH as
> ${env_var:PATH};C:\DWork\eclipse\workspace\Quantlib\Release\;C:\DWork\eclipse\workspace\QuantlibCPPWrapper\Release\.
> Note I had to add ${env_var:PATH} to the beginning of the variable to
> get rid of failure to find cygwin1.dll error.

I'm not very knowledgeable about the Java module, but I was under the
impression that those who compiled it used MinGW rather than the Cygwin
compiler. Also, I had reports that the wrapper behaved erratically when
QuantLib was compiled as a shared library---you might want to try
building it as a static library instead.

Luigi



----------------------------------------

Blessed is the man who, having nothing to say, abstains from giving
wordy evidence of the fact.-- George Eliot



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous

Brings words and photos together (easily) with
PhotoMail - it's free and works with Yahoo! Mail.
CONFIDENTIAL NOTE: The information contained in this email is intended only for the use of the individual or entity named above and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete the mail. Thank you.



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous
Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.
Reply | Threaded
Open this post in threaded view
|

Re: Java wrapper test program using Eclipse 3.1.1

Joe Byers-2
In reply to this post by jerryji
Jerry,

Your skwash build is not configured correctly, the swig.i should be ql.i.

Check your skwash project properties quantlib skwash properties out.  Right click on quantlib skwash and select properties.  you should have the following (note the italics are for my setup and should be modified to fit your projects)
General tab
main swig interface file --------  ql.i
output directory -----------        C:\DWork\eclipse\workspace\QuantLibJavaWrapper\org\quantlib
module name ----------- quantlib
c-wrapper outputfile ------------ C:\DWork\eclipse\workspace\QuantlibCPPWrapper\quantlib.cxx

Language tab
target language ---------- java
java settings ----------- org.quantlib

Note the output directory and the c-wrappr output file are specific to my projects and you should change the directory location to match your projects.

Joe


Jerry Ji <[hidden email]> wrote:
Dear Joe,

Thank you very much again for your help.

I just re-did everything from scratch again but received the same instantaneous return and the same
message without getting anything under either the Cpp Wrapper or the Java Wrapper project --

C:\swigwin-1.3.27\swig.exe -java -c++ -module quantlib -o D:\eclipse\workbench\QuantLib_Cpp_Wrapper\quantlib.cxx -outdir D:\eclipse\workbench\QuantLib_Java_Wrapper\org\quantlib -package org.quantlib swig.i

exit status:    0


I wonder if anyone has a successful story with the following combination of software packages --

Windows XP Professional SP2
mingw GCC 3.4.2
J2SDK 1.4.2_09
Eclipse 3.1.2
CDT 3.0.2
sKWash 1.0.2
swigwin-1.3.27
QuantLib 0.3.11 release
QuantLib-SWIG-0.3.11.zip

One thing I notice is that the swig.i file generated by the Eclipse QuantLib Skwash project (i.e., it does
not exist in QuantLib-SWIG-0.3.11/SWIG/) is empty, does that mean anything?

Many thanks in advance!

--
Jerry

Joe Byers wrote:
Jerry,

I am new to all of this as well. 
Do you you have a quantlib project that you built the quantlib.dll?

Also, your javawrapper does not look like you created the org.quantlib package.  you might go back throught the steps for creating the javawrapper on skwash.com.

Also, when you build the skwash project you should see java classes in your javawrapper org.quantlib package and a quantlib.cxx in the cppwrapper.  If these are not there after building quantib skwash then the skwash build using swig is not working. 

I had to delete everything and start over from scratch several time before I worked out the problems.  When building the quantlib project or the cppwrapper project be sure and select debug builds not release.  There is a problem with the eclicpe cdt 3.0.2 release build.

Joe


Jerry Ji [hidden email] wrote:
Dear Joe,

Thank you very much for your generous help and sorry for being new to mailing list rules.

I'm still stuck. This is what my Eclipse projects look like (images don't show up in mailing lists?) --

Eclipse Skwash Project View

There is indeed nothing under QuantLib Cpp Wrapper project and any attempt to build/rebuild
the project only gets --

Nothing to build for project QuantLib Cpp Wrapper

without generating the Debug directory or anything else. Even though there is a quantlib.cxx under
the QuantLib Cpp Wrapper project directory physically.

Similarly, building of the QuantLib Skwash project returns immediately the following without any
real output files --

C:\swigwin-1.3.27\swig.exe -java -c++ -module quantlib -o D:\jerryji's Documents\eclipse\workspace\QuantLib Cpp Wrapper\quantlib.cxx -outdir D:\jerryji's Documents\eclipse\workspace\QuantLib Java Wrapper\org\quantlib -package org.quantlib swig.i

exit status:    0


I must be having a conceptual problem in understanding how Skwash should work, any hint will be
most welcome.

Many thanks in advance!

--
Jerry

Joe Byers wrote:
Jerry,

I would be glad to help you.

First, initial questions and posts should be directed to the quantlib-users list.  Direct contact can follow from the initial posting.

This error I saw many times when trying to get the java and cpp wrappers compiled along with running the tests.

did you get the cppwrapper and javawrapper built?  there should be a cppwrapper.dll file in the cppwrapper/debug tree.  If not, you will have to click on the cppwrapper and right click build project or go the the project menu and select build project from there.

When building the swapvaluation test java script skwash.com says to make sure you have the location of the cppwrapper and javawrapper code in a path variable.  Add ${env_var:PATH}; to the beginning of this path variable so the appropriate cygwin and mingw files can be found.

good luck,
joe



Jerry Jie Ji [hidden email] wrote:
Hi Joe,
 
My name is Jerry, a new QuantLib user. I hope you don’t mind such a direct mail.
 
I am also following the QuantLib Skwash tutorial but am getting nowhere, it would be greatly appreciated if
you could share your findings. I’m getting the following error when running the example swap java code --
 
SwapValuation failed
java.lang.UnsatisfiedLinkError: no QuantLibCppWrapper in java.library.path
      at java.lang.ClassLoader.loadLibrary(Unknown Source)
      at java.lang.Runtime.loadLibrary0(Unknown Source)
      at java.lang.System.loadLibrary(Unknown Source)
      at org.quantlib.examples.SwapValuation.main(SwapValuation.java:7)
 
My problem must be more primitive than yours. I have successfully build QuantLib 0.3.11 under eclipse (3.1.2)
CDT. I am using Skwash 1.0.2, and I don’t  get anything under the Cpp Wrapper project, because not only do
I not see any instruction in the tutorial on how to build the Cpp Wrapper project, but also I don’t understand
what the Cpp Wrapper place holder is for.
 
Many thanks in advance!
 
P.S. When you reply, could you please “reply to all�, which will also include my personal address.
 
--
Jerry
T&O-RTT
DBS Tower 2
DID 687 85315

From: [hidden email] [[hidden email]] On Behalf Of Joe Byers
Sent: Monday, March 20, 2006 10:43 PM
To: Luigi Ballabio
Cc: [hidden email]
Subject: Re: [Quantlib-users] Java wrapper test program using Eclipse 3.1.1
 
Luigi,

Thank you for your suggestions.  I did finally get it to compile (using Mingw) and ran the test suite from Skwash.com.  I had to modify a couple of items in the skwash example and found a problem with eclipse CDT 3.0.2 build options.  I am working on and compilation of the problems and actions to post for future reference for other individuals.

On another note,  I have the algorithm for a calendar of the North American Energy Reliability Council (NERC) holidays.  This is important for pricing derivative on electricity in the US.  Can you point to someone to help develop this for Quantlib calendar module?

Thank you
Joe W. Byers


Luigi Ballabio [hidden email] wrote:

On 03/08/2006 06:08:31 AM, Joe Byers wrote:
> I have compiled quantlib, built and complie d the java wrapper, cpp
> wrapper, and skwash examples from skwash.com.
>
> I followed the instructions on running/debuging the program and
> created an environment variable named PATH as
> ${env_var:PATH};C:\DWork\eclipse\workspace\Quantlib\Release\;C:\DWork\eclipse\workspace\QuantlibCPPWrapper\Release\.
> Note I had to add ${env_var:PATH} to the beginning of the variable to
> get rid of failure to find cygwin1.dll error.

I'm not very knowledgeable about the Java module, but I was under the
impression that those who compiled it used MinGW rather than the Cygwin
compiler. Also, I had reports that the wrapper behaved erratically when
QuantLib was compiled as a shared library---you might want to try
building it as a static library instead.

Luigi



----------------------------------------

Blessed is the man who, having nothing to say, abstains from giving
wordy evidence of the fact.-- George Eliot



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous

Brings words and photos together (easily) with
PhotoMail - it's free and works with Yahoo! Mail.
CONFIDENTIAL NOTE: The information contained in this email is intended only for the use of the individual or entity named above and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete the mail. Thank you.



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous

Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous

Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous


Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.
Reply | Threaded
Open this post in threaded view
|

Re: Java wrapper test program using Eclipse 3.1.1

jerryji
Dear Joe,

Thank you very much for the tip. Since quantlib.i ends with the instruction --

%include ql.i

I believe Mr. Witters' advice (of setting main swig interface file to "quantlib.i") is more generic,
although the results should be the same as far as building Java module is concerned because
Java related instructions seem to appear only in ql.i

Now my Cpp Wrapper finally compiles, though with tons of the following errors that are very
greek to me --

C:\DOCUME~1\jerryji\LOCALS~1\Temp/cc4gaaaa.s:924100: Warning: .stabs: description field '114b3' too big, try a different debug format
C:\DOCUME~1\jerryji\LOCALS~1\Temp/cc4gaaaa.s:924101: Warning: .stabs: description field '114b3' too big, try a different debug format
Finished building: ../quantlib.cxx


and (hence) ends with many linker errors --

./quantlib.o(.text$_ZN8QuantLib24DiscretizedVanillaOptionC1ERKNS_14OneAssetOption9argumentsE[QuantLib::DiscretizedVanillaOption::DiscretizedVanillaOption(QuantLib::OneAssetOption::arguments const&)]+0x4c):c:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_algobase.h: variable 'vtable for QuantLib::DiscretizedVanillaOption' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
collect2: ld returned 1 exit status
make: *** [QuantLib_Cpp_Wrapper.dll] Error 1
make: Target `all' not remade because of errors.


Sorry for being the spammer of the day. I am a little desperate, especially when knowing I'm
almost there...

Many thanks in advance.

--
Jerry

Joe Byers wrote:
Jerry,

Your skwash build is not configured correctly, the swig.i should be ql.i.

Check your skwash project properties quantlib skwash properties out.  Right click on quantlib skwash and select properties.  you should have the following (note the italics are for my setup and should be modified to fit your projects)
General tab
main swig interface file --------  ql.i
output directory -----------        C:\DWork\eclipse\workspace\QuantLibJavaWrapper\org\quantlib
module name ----------- quantlib
c-wrapper outputfile ------------ C:\DWork\eclipse\workspace\QuantlibCPPWrapper\quantlib.cxx

Language tab
target language ---------- java
java settings ----------- org.quantlib

Note the output directory and the c-wrappr output file are specific to my projects and you should change the directory location to match your projects.

Joe


Jerry Ji [hidden email] wrote:
Dear Joe,

Thank you very much again for your help.

I just re-did everything from scratch again but received the same instantaneous return and the same
message without getting anything under either the Cpp Wrapper or the Java Wrapper project --

C:\swigwin-1.3.27\swig.exe -java -c++ -module quantlib -o D:\eclipse\workbench\QuantLib_Cpp_Wrapper\quantlib.cxx -outdir D:\eclipse\workbench\QuantLib_Java_Wrapper\org\quantlib -package org.quantlib swig.i

exit status:    0


I wonder if anyone has a successful story with the following combination of software packages --

Windows XP Professional SP2
mingw GCC 3.4.2
J2SDK 1.4.2_09
Eclipse 3.1.2
CDT 3.0.2
sKWash 1.0.2
swigwin-1.3.27
QuantLib 0.3.11 release
QuantLib-SWIG-0.3.11.zip

One thing I notice is that the swig.i file generated by the Eclipse QuantLib Skwash project (i.e., it does
not exist in QuantLib-SWIG-0.3.11/SWIG/) is empty, does that mean anything?

Many thanks in advance!

--
Jerry

Joe Byers wrote:
Jerry,

I am new to all of this as well. 
Do you you have a quantlib project that you built the quantlib.dll?

Also, your javawrapper does not look like you created the org.quantlib package.  you might go back throught the steps for creating the javawrapper on skwash.com.

Also, when you build the skwash project you should see java classes in your javawrapper org.quantlib package and a quantlib.cxx in the cppwrapper.  If these are not there after building quantib skwash then the skwash build using swig is not working. 

I had to delete everything and start over from scratch several time before I worked out the problems.  When building the quantlib project or the cppwrapper project be sure and select debug builds not release.  There is a problem with the eclicpe cdt 3.0.2 release build.

Joe


Jerry Ji [hidden email] wrote:
Dear Joe,

Thank you very much for your generous help and sorry for being new to mailing list rules.

I'm still stuck. This is what my Eclipse projects look like (images don't show up in mailing lists?) --

Eclipse Skwash Project View

There is indeed nothing under QuantLib Cpp Wrapper project and any attempt to build/rebuild
the project only gets --

Nothing to build for project QuantLib Cpp Wrapper

without generating the Debug directory or anything else. Even though there is a quantlib.cxx under
the QuantLib Cpp Wrapper project directory physically.

Similarly, building of the QuantLib Skwash project returns immediately the following without any
real output files --

C:\swigwin-1.3.27\swig.exe -java -c++ -module quantlib -o D:\jerryji's Documents\eclipse\workspace\QuantLib Cpp Wrapper\quantlib.cxx -outdir D:\jerryji's Documents\eclipse\workspace\QuantLib Java Wrapper\org\quantlib -package org.quantlib swig.i

exit status:    0


I must be having a conceptual problem in understanding how Skwash should work, any hint will be
most welcome.

Many thanks in advance!

--
Jerry

Joe Byers wrote:
Jerry,

I would be glad to help you.

First, initial questions and posts should be directed to the quantlib-users list.  Direct contact can follow from the initial posting.

This error I saw many times when trying to get the java and cpp wrappers compiled along with running the tests.

did you get the cppwrapper and javawrapper built?  there should be a cppwrapper.dll file in the cppwrapper/debug tree.  If not, you will have to click on the cppwrapper and right click build project or go the the project menu and select build project from there.

When building the swapvaluation test java script skwash.com says to make sure you have the location of the cppwrapper and javawrapper code in a path variable.  Add ${env_var:PATH}; to the beginning of this path variable so the appropriate cygwin and mingw files can be found.

good luck,
joe



Jerry Jie Ji [hidden email] wrote:
Hi Joe,
 
My name is Jerry, a new QuantLib user. I hope you don’t mind such a direct mail.
 
I am also following the QuantLib Skwash tutorial but am getting nowhere, it would be greatly appreciated if
you could share your findings. I’m getting the following error when running the example swap java code --
 
SwapValuation failed
java.lang.UnsatisfiedLinkError: no QuantLibCppWrapper in java.library.path
      at java.lang.ClassLoader.loadLibrary(Unknown Source)
      at java.lang.Runtime.loadLibrary0(Unknown Source)
      at java.lang.System.loadLibrary(Unknown Source)
      at org.quantlib.examples.SwapValuation.main(SwapValuation.java:7)
 
My problem must be more primitive than yours. I have successfully build QuantLib 0.3.11 under eclipse (3.1.2)
CDT. I am using Skwash 1.0.2, and I don’t  get anything under the Cpp Wrapper project, because not only do
I not see any instruction in the tutorial on how to build the Cpp Wrapper project, but also I don’t understand
what the Cpp Wrapper place holder is for.
 
Many thanks in advance!
 
P.S. When you reply, could you please “reply to all�, which will also include my personal address.
 
--
Jerry
T&O-RTT
DBS Tower 2
DID 687 85315

From: [hidden email] [[hidden email]] On Behalf Of Joe Byers
Sent: Monday, March 20, 2006 10:43 PM
To: Luigi Ballabio
Cc: [hidden email]
Subject: Re: [Quantlib-users] Java wrapper test program using Eclipse 3.1.1
 
Luigi,

Thank you for your suggestions.  I did finally get it to compile (using Mingw) and ran the test suite from Skwash.com.  I had to modify a couple of items in the skwash example and found a problem with eclipse CDT 3.0.2 build options.  I am working on and compilation of the problems and actions to post for future reference for other individuals.

On another note,  I have the algorithm for a calendar of the North American Energy Reliability Council (NERC) holidays.  This is important for pricing derivative on electricity in the US.  Can you point to someone to help develop this for Quantlib calendar module?

Thank you
Joe W. Byers


Luigi Ballabio [hidden email] wrote:

On 03/08/2006 06:08:31 AM, Joe Byers wrote:
> I have compiled quantlib, built and complie d the java wrapper, cpp
> wrapper, and skwash examples from skwash.com.
>
> I followed the instructions on running/debuging the program and
> created an environment variable named PATH as
> ${env_var:PATH};C:\DWork\eclipse\workspace\Quantlib\Release\;C:\DWork\eclipse\workspace\QuantlibCPPWrapper\Release\.
> Note I had to add ${env_var:PATH} to the beginning of the variable to
> get rid of failure to find cygwin1.dll error.

I'm not very knowledgeable about the Java module, but I was under the
impression that those who compiled it used MinGW rather than the Cygwin
compiler. Also, I had reports that the wrapper behaved erratically when
QuantLib was compiled as a shared library---you might want to try
building it as a static library instead.

Luigi



----------------------------------------

Blessed is the man who, having nothing to say, abstains from giving
wordy evidence of the fact.-- George Eliot



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous

Brings words and photos together (easily) with
PhotoMail - it's free and works with Yahoo! Mail.
CONFIDENTIAL NOTE: The information contained in this email is intended only for the use of the individual or entity named above and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete the mail. Thank you.



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous

Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous

Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous


Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.
Reply | Threaded
Open this post in threaded view
|

Re: Java wrapper test program using Eclipse 3.1.1

jerryji
In reply to this post by johan-35
Dear Johan,

You are the hero! (and I'm the stupid)

My Cpp Wrapper project finally compiles fine, but hit the following linker error --

./quantlib.o(.text$_ZN8QuantLib24DiscretizedVanillaOptionC1ERKNS_14OneAssetOption9argumentsE[QuantLib::DiscretizedVanillaOption::DiscretizedVanillaOption(QuantLib::OneAssetOption::arguments const&)]+0x4c):c:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_algobase.h: variable 'vtable for QuantLib::DiscretizedVanillaOption' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
collect2: ld returned 1 exit status
make: *** [QuantLib_Cpp_Wrapper.dll] Error 1
make: Target `all' not remade because of errors.
Build complete for project QuantLib_Cpp_Wrapper


I scanned through the Cpp Wrapper project properties tabs but didn't find anything comes
close to --enable-auto-import. Well, I could have googled deeper, but wonder if that's again
due to some stupid things I did that you (or anyone) takes only two seconds to point out.

Thanks!

--
Jerry

Johan Witters wrote:
Open the properties of your skwash project (right click your skwash project and choose project properties from the popup menu). The main swig interfacefile should refer to quantlib.i instead of swig.i. You, I think, missed step http://users.telenet.be/johan.witters/website/skwash.com/get/get3dpart4.html
 
Hope this helpps
 
cheers,
Johan
----- Original Message -----
Sent: Friday, March 24, 2006 10:04 AM
Subject: Re: [Quantlib-users] Java wrapper test program using Eclipse 3.1.1

Dear Johan,

Thank you very much for pointing it out, before which I thought I've read every page of the
Skwash tutorial many times. I just checked out the SWIG CVS branch R000311f0 (sorry to
the text mailing list users for the image of my Eclipse project view) --

Eclipse Projects View

However, there is still no this swig.i file that I was hoping for --

[hidden email] /cygdrive/d/eclipse/workbench
(Fri Mar 24 17:44:18) $ diff QuantLib\ SWIG\ Interface\ Files\ CVS/ ../../QuantLib/source/QuantLib-SWIG-0.3.11/SWIG/
Only in QuantLib SWIG Interface Files CVS/: .project
Only in QuantLib SWIG Interface Files CVS/: CVS


In fact, the CVS checkout directory is identical to QuantLib-SWIG-0.3.11/SWIG/ in the release
QuantLib-SWIG-0.3.11.zip --

jerryji@SGSW2L8WVLY /cygdrive/d/eclipse/workbench/QuantLib SWIG Interface Files CVS/
(Fri Mar 24 17:58:09) $ for i in *.i ; do diff -wc $i ../../../QuantLib/source/QuantLib-SWIG-0.3.11/SWIG/$i ; done


Man, I must be only one inch away from success, just where do I step?

--
Jerry


Johan Witters wrote:
Hi,
 
"One thing I notice is that the swig.i file generated by the Eclipse QuantLib Skwash project (i.e., it does
not exist in QuantLib-SWIG-0.3.11/SWIG/) is empty, does that mean anything? "
 
Yes: that means everything. Please follow the first step of part IV of the tutorial (http://users.telenet.be/johan.witters/website/skwash.com/get/get3apart4.html):

"Before proceeding you need to download the swig interface files of quantlib. These are available from QuantLib CVS Repository. The site explains how to retrieve these files. However, you can use Eclipse for this purpose too. Click here for more info. Make sure you get the Swig Interface Files that match the version of Quantlib which you have downloaded. Also, make sure to download a version of quantlib that supports Java (support available from version 0.3.11). "

I hope this helps.

Cheers,

Johan

----- Original Message -----
Sent: Friday, March 24, 2006 5:13 AM
Subject: Re: [Quantlib-users] Java wrapper test program using Eclipse 3.1.1

Dear Joe,

Thank you very much again for your help.

I just re-did everything from scratch again but received the same instantaneous return and the same
message without getting anything under either the Cpp Wrapper or the Java Wrapper project --

C:\swigwin-1.3.27\swig.exe -java -c++ -module quantlib -o D:\eclipse\workbench\QuantLib_Cpp_Wrapper\quantlib.cxx -outdir D:\eclipse\workbench\QuantLib_Java_Wrapper\org\quantlib -package org.quantlib swig.i

exit status:    0


I wonder if anyone has a successful story with the following combination of software packages --

Windows XP Professional SP2
mingw GCC 3.4.2
J2SDK 1.4.2_09
Eclipse 3.1.2
CDT 3.0.2
sKWash 1.0.2
swigwin-1.3.27
QuantLib 0.3.11 release
QuantLib-SWIG-0.3.11.zip

One thing I notice is that the swig.i file generated by the Eclipse QuantLib Skwash project (i.e., it does
not exist in QuantLib-SWIG-0.3.11/SWIG/) is empty, does that mean anything?

Many thanks in advance!

--
Jerry

Joe Byers wrote:
Jerry,

I am new to all of this as well. 
Do you you have a quantlib project that you built the quantlib.dll?

Also, your javawrapper does not look like you created the org.quantlib package.  you might go back throught the steps for creating the javawrapper on skwash.com.

Also, when you build the skwash project you should see java classes in your javawrapper org.quantlib package and a quantlib.cxx in the cppwrapper.  If these are not there after building quantib skwash then the skwash build using swig is not working. 

I had to delete everything and start over from scratch several time before I worked out the problems.  When building the quantlib project or the cppwrapper project be sure and select debug builds not release.  There is a problem with the eclicpe cdt 3.0.2 release build.

Joe


Jerry Ji [hidden email] wrote:
Dear Joe,

Thank you very much for your generous help and sorry for being new to mailing list rules.

I'm still stuck. This is what my Eclipse projects look like (images don't show up in mailing lists?) --

Eclipse Skwash Project View

There is indeed nothing under QuantLib Cpp Wrapper project and any attempt to build/rebuild
the project only gets --

Nothing to build for project QuantLib Cpp Wrapper

without generating the Debug directory or anything else. Even though there is a quantlib.cxx under
the QuantLib Cpp Wrapper project directory physically.

Similarly, building of the QuantLib Skwash project returns immediately the following without any
real output files --

C:\swigwin-1.3.27\swig.exe -java -c++ -module quantlib -o D:\jerryji's Documents\eclipse\workspace\QuantLib Cpp Wrapper\quantlib.cxx -outdir D:\jerryji's Documents\eclipse\workspace\QuantLib Java Wrapper\org\quantlib -package org.quantlib swig.i

exit status:    0


I must be having a conceptual problem in understanding how Skwash should work, any hint will be
most welcome.

Many thanks in advance!

--
Jerry

Joe Byers wrote:
Jerry,

I would be glad to help you.

First, initial questions and posts should be directed to the quantlib-users list.  Direct contact can follow from the initial posting.

This error I saw many times when trying to get the java and cpp wrappers compiled along with running the tests.

did you get the cppwrapper and javawrapper built?  there should be a cppwrapper.dll file in the cppwrapper/debug tree.  If not, you will have to click on the cppwrapper and right click build project or go the the project menu and select build project from there.

When building the swapvaluation test java script skwash.com says to make sure you have the location of the cppwrapper and javawrapper code in a path variable.  Add ${env_var:PATH}; to the beginning of this path variable so the appropriate cygwin and mingw files can be found.

good luck,
joe



Jerry Jie Ji [hidden email] wrote:
Hi Joe,
My name is Jerry, a new QuantLib user. I hope you don’t mind such a direct mail.
I am also following the QuantLib Skwash tutorial but am getting nowhere, it would be greatly appreciated if
you could share your findings. I’m getting the following error when running the example swap java code --
SwapValuation failed
java.lang.UnsatisfiedLinkError: no QuantLibCppWrapper in java.library.path
      at java.lang.ClassLoader.loadLibrary(Unknown Source)
      at java.lang.Runtime.loadLibrary0(Unknown Source)
      at java.lang.System.loadLibrary(Unknown Source)
      at org.quantlib.examples.SwapValuation.main(SwapValuation.java:7)
My problem must be more primitive than yours. I have successfully build QuantLib 0.3.11 under eclipse (3.1.2)
CDT. I am using Skwash 1.0.2, and I don’t  get anything under the Cpp Wrapper project, because not only do
I not see any instruction in the tutorial on how to build the Cpp Wrapper project, but also I don’t understand
what the Cpp Wrapper place holder is for.
Many thanks in advance!
P.S. When you reply, could you please “reply to all”, which will also include my personal address.
--
Jerry
T&O-RTT
DBS Tower 2
DID 687 85315

From: [hidden email] [[hidden email]] On Behalf Of Joe Byers
Sent: Monday, March 20, 2006 10:43 PM
To: Luigi Ballabio
Cc: [hidden email]
Subject: Re: [Quantlib-users] Java wrapper test program using Eclipse 3.1.1
Luigi,

Thank you for your suggestions.  I did finally get it to compile (using Mingw) and ran the test suite from Skwash.com.  I had to modify a couple of items in the skwash example and found a problem with eclipse CDT 3.0.2 build options.  I am working on and compilation of the problems and actions to post for future reference for other individuals.

On another note,  I have the algorithm for a calendar of the North American Energy Reliability Council (NERC) holidays.  This is important for pricing derivative on electricity in the US.  Can you point to someone to help develop this for Quantlib calendar module?

Thank you
Joe W. Byers


Luigi Ballabio [hidden email] wrote:

On 03/08/2006 06:08:31 AM, Joe Byers wrote:
> I have compiled quantlib, built and complie d the java wrapper, cpp
> wrapper, and skwash examples from skwash.com.
>
> I followed the instructions on running/debuging the program and
> created an environment variable named PATH as
> ${env_var:PATH};C:\DWork\eclipse\workspace\Quantlib\Release\;C:\DWork\eclipse\workspace\QuantlibCPPWrapper\Release\.
> Note I had to add ${env_var:PATH} to the beginning of the variable to
> get rid of failure to find cygwin1.dll error.

I'm not very knowledgeable about the Java module, but I was under the
impression that those who compiled it used MinGW rather than the Cygwin
compiler. Also, I had reports that the wrapper behaved erratically when
QuantLib was compiled as a shared library---you might want to try
building it as a static library instead.

Luigi



----------------------------------------

Blessed is the man who, having nothing to say, abstains from giving
wordy evidence of the fact.-- George Eliot



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous

Brings words and photos together (easily) with
PhotoMail - it's free and works with Yahoo! Mail.
CONFIDENTIAL NOTE: The information contained in this email is intended only for the use of the individual or entity named above and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete the mail. Thank you.



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous
Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.
Reply | Threaded
Open this post in threaded view
|

Re: Java wrapper test program using Eclipse 3.1.1

Luigi Ballabio
On 03/24/2006 03:17:01 PM, Jerry Ji wrote:
> My Cpp Wrapper project finally compiles fine, but hit the following  
> linker error --

I don't know whether this will solve your problem, but I suggest to  
build QuantLib as a static library instead of a shared one; I've had  
reports of erratical runtime behavior when compiling it as a DLL (for  
details, look for "Euribor1d act/360 history not loaded" in this  
mailing list's archive.)

Johan, may you update your guide so that a static library is built?

Later,
        Luigi


----------------------------------------

Just remember what ol' Jack Burton does when the earth quakes, the
poison arrows fall from the sky, and the pillars of Heaven shake. Yeah,
Jack Burton just looks that big old storm right in the eye and says,
"Give me your best shot. I can take it."
-- Jack Burton, "Big trouble in Little China"


Reply | Threaded
Open this post in threaded view
|

Re: Java wrapper test program using Eclipse 3.1.1

jerryji
Eureka! Thank you all for your generous help, I finally got my
"SwapValuation ok" :)

The key, to me, is indeed to compile QuantLib (0.3.11) as static
library. I couldn't agree with
Luigi more that it would be greatly appreciated by all new comers if
Johan would, when time
permits, update your JQuantLib tutorial site to give them more faith in
QuantLib and sKWash,
both fantastic tools!

Thank you all (Joe, Johan, Luigi) again.

--
Jerry

Luigi Ballabio wrote:

>
> On 03/24/2006 03:17:01 PM, Jerry Ji wrote:
>> My Cpp Wrapper project finally compiles fine, but hit the following
>> linker error --
>
> I don't know whether this will solve your problem, but I suggest to
> build QuantLib as a static library instead of a shared one; I've had
> reports of erratical runtime behavior when compiling it as a DLL (for
> details, look for "Euribor1d act/360 history not loaded" in this
> mailing list's archive.)
>
> Johan, may you update your guide so that a static library is built?
>
> Later,
>     Luigi
>
>
> ----------------------------------------
>
> Just remember what ol' Jack Burton does when the earth quakes, the
> poison arrows fall from the sky, and the pillars of Heaven shake. Yeah,
> Jack Burton just looks that big old storm right in the eye and says,
> "Give me your best shot. I can take it."
> -- Jack Burton, "Big trouble in Little China"
>


Reply | Threaded
Open this post in threaded view
|

Re: Java wrapper test program using Eclipse 3.1.1 -- sample option pricing Java code

jerryji
In reply to this post by johan-35
I have no intention of double-posting, just that my previous message is
being reviewed by
moderator due to its large size.

I wonder if someone could send me a simple European or American option
pricing Java test
code (utilizing QuantLib, of course).

Thanks!

--
Jerry


Reply | Threaded
Open this post in threaded view
|

North American Energy Reliablity Council NERC holidays

Joe Byers-2
In reply to this post by Luigi Ballabio
Luigi,

I am working on a short document covering the rules for holiday in NERC for you.  It will include links to the NERC website documents and other North American ISO's.  The document will also include rules for determining On Peak, Off Peak, and Weekend hours.  This component is a little more of a problem than just the holidays.  I notice that Quantlib DATES do not have hour capabilities.  While this is not a problem for valuing an On Peak forward or other derivative since the On peak price is the average of a 16 hour block, it is a problem for valuing hourly derivatives. 

I just wanted to let you know that I have not forgotten about this project.

Joe Byers



Luigi Ballabio <[hidden email]> wrote:

On 03/20/2006 03:43:26 PM, Joe Byers wrote:
> On another note, I have the algorithm for a calendar of the North
> American Energy Reliability Council (NERC) holidays. This is
> important for pricing derivative on electricity in the US. Can you
> point to someone to help develop this for Quantlib calendar module?

You can send me either the algorithm or the list of rules for the
holidays.

Luigi


----------------------------------------

An ideal world is left as an exercise to the reader.
-- Paul Graham



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous


Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.
Reply | Threaded
Open this post in threaded view
|

Quantlib, OH, QuantlibAddin environment variables.

Joe Byers-2
In reply to this post by jerryji
I am working with the QuantlibAddin and I have questions about the environment variables that we create.  QL_DIR, QUANTLIBADDIN_DIR, and OBJECT_HANDLER_DIR are the variables of interest.  I am working on this on a WinXP machine and do not think I will have these questions on my LINUX machine because LINUX install everything to /usr/XXX/XXXX.

Can I put all the static libraries in one location like \Libraries\QLSTUFF\lib and the addin will work?  For Excel and OO?

Or do I need to have seperate lib directories for each QL module?

I would like to install QL in our Risk Management lab at the University of Tulsa.


Thank you
Joe Byers



A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous


Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.
12