Changes to compile Java bindings in QuantLib-SWIG module

classic Classic list List threaded Threaded
1 message 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: quantlib-swig_java_ver_1.6-head.patch
Type: application/octet-stream
Size: 4367 bytes
Desc: not available
Url : http://sourceforge.net/mailarchive/forum.php?forum=quantlib-users/attachments/20070130/284f3795/attachment.obj 
-------------------------------------------------------------------------
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-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users