Changes to compile Java bindings in QuantLib-SWIG module

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

Changes to compile Java bindings in QuantLib-SWIG module

toli
Joe,

In the course of playing with QuantLib we've found some problems with
the Java compilation of the QuantLib-SWIG project.

We've made some modifications to the configuration files, please see
the attached patch.
Would be great if this can be included into the HEAD of the
QuantLib-SWIG project.
The diffs are based on the QuantLib-SWIG-0.3.14 release, and i don't
think there have been any changes to the relevant files since the
release.

The patch file expects there to be a directory QuantLib-SWIG-0.3.14
and the changes to be made in a dir called
QuantLib-SWIG-0.3.14_java_patch.  However, you can just run it with
'patch -p1 < quantlib-swig_java_ver_1.6-head.patch' in the HEAD of
QuantLib-SWIG and it'll apply the changes.

Also, it seems that there's a discrepancy with the SWIG/options.i file
and the way the Option.Type enum is defined. I think the current file
in the HEAD of SWiG/options.i has the values reversed - the
Quantlib option.hpp file has it this way at
http://quantlib.cvs.sourceforge.net/quantlib/QuantLib/ql/option.hpp?revision=1.41&view=markup
      enum Type { Put = -1, Call = 1  };
while the SWIG/options.i is
enum Type { Call = -1, Put = 1};
I took the liberty of flipping it to look like the option.hpp file in
the patch as well.

The patch file also contains a small test program Hello.java that does
a basic sanity check to make sure the created Java library works.
And it expects the variable JAVA_HOME to be declared and pointing to
the location of the JDK, and tries to place the generated java wrapper
library into the lib/ directory under the JRE.

hope this helps. please let me know if you need me to change anything,
or if things don't work for you.

On 1/29/07, Joseph Wang <[hidden email]> wrote:
> The SWIG bindings usually lag the Quantlib libraries a bit, but since I need
> to use them, I've been trying my best to sync them up.  I'm working mainly
> with the Python and R binding, so if there is anything broken in the other
> bindings, let me know and I'll try to fix them.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev

quantlib-swig_java_ver_1.6-head.patch (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Changes to compile Java bindings in QuantLib-SWIG module

Joseph Wang-2
Yikes.  That option problem is nasty.

I've fixed that in HEAD.  It may take me a few days to go through the other
patches.  Thanks!!!


在 Tuesday 30 January 2007 15:20,您写道:

> Joe,
>
> In the course of playing with QuantLib we've found some problems with
> the Java compilation of the QuantLib-SWIG project.
>
> We've made some modifications to the configuration files, please see
> the attached patch.
> Would be great if this can be included into the HEAD of the
> QuantLib-SWIG project.
> The diffs are based on the QuantLib-SWIG-0.3.14 release, and i don't
> think there have been any changes to the relevant files since the
> release.
>
> The patch file expects there to be a directory QuantLib-SWIG-0.3.14
> and the changes to be made in a dir called
> QuantLib-SWIG-0.3.14_java_patch.  However, you can just run it with
> 'patch -p1 < quantlib-swig_java_ver_1.6-head.patch' in the HEAD of
> QuantLib-SWIG and it'll apply the changes.
>
> Also, it seems that there's a discrepancy with the SWIG/options.i file
> and the way the Option.Type enum is defined. I think the current file
> in the HEAD of SWiG/options.i has the values reversed - the
> Quantlib option.hpp file has it this way at
> http://quantlib.cvs.sourceforge.net/quantlib/QuantLib/ql/option.hpp?revisio
>n=1.41&view=markup enum Type { Put = -1, Call = 1  };
> while the SWIG/options.i is
> enum Type { Call = -1, Put = 1};
> I took the liberty of flipping it to look like the option.hpp file in
> the patch as well.
>
> The patch file also contains a small test program Hello.java that does
> a basic sanity check to make sure the created Java library works.
> And it expects the variable JAVA_HOME to be declared and pointing to
> the location of the JDK, and tries to place the generated java wrapper
> library into the lib/ directory under the JRE.
>
> hope this helps. please let me know if you need me to change anything,
> or if things don't work for you.
>
> On 1/29/07, Joseph Wang <[hidden email]> wrote:
> > The SWIG bindings usually lag the Quantlib libraries a bit, but since I
> > need to use them, I've been trying my best to sync them up.  I'm working
> > mainly with the Python and R binding, so if there is anything broken in
> > the other bindings, let me know and I'll try to fix them.
--
-------------------------------------------------------------------------------
Joseph Wang Ph.D. - [hidden email]  
China Derivatives Researcher and Software Developer - QuantLib
http://en.wikiversity.org/wiki/User:Roadrunner






-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: Changes to compile Java bindings in QuantLib-SWIG module

Joseph Wang-2
In reply to this post by toli
Turns out that I had a moment to check the patch the files and check them in
to HEAD.

Thanks.
--
-------------------------------------------------------------------------------
Joseph Wang Ph.D. - [hidden email]  
China Derivatives Researcher and Software Developer - QuantLib
http://en.wikiversity.org/wiki/User:Roadrunner






-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev