QuantLib in Java

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

QuantLib in Java

Tanvi Tiwari
Hello everyone,

I am trying to understand how to use QuantLib in Java, but have been confused as to the process for a few weeks. I found QuantLib-SWIG-1.5.zip on SourceForge, which seems to have all the .i and the .java, files, as well as a file called quantlib_wrap.cpp. 

The README says to follow these instructions, but it is a bit confusing. Do I need to even tough SWIG or sKWash, because I already have the .java files?

In addition, on SWIG's website, it says under the "Building a Java Module" to do the following commands: 
 $ swig -java example.i
 $ gcc -c example.c example_wrap.c -I/c/jdk1.3.1/include -I/c/jdk1.3.1/include/win32
 $ gcc -shared example.o  example_wrap.o -mno-cygwin -Wl,--add-stdcall-alias  -o example.dll
This makes me think that for each .cpp file in QuantLib, we'd need a wrap.cpp file to correspond and compile it with. Instead, I notice one huge quantlib_wrap.cpp (and quantlib_wrap.h) files. What commands need to be typed in? 
Basically, if someone could provide me with a detailed guide on how to take the materials in QuantLib-SWIG-1.5.zip and turn it into a functioning QuantLib in Java, I would really appreciate it!
Thanks,
Tanvi

--
Tanvi Tiwari
[hidden email]
914-519-7138

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib in Java

Tanvi Tiwari
Sorry to double e-mail, but I forgot to mention I'm using a 64-bit machine and can use Microsoft Visual Studio or Eclipse easily.

Thanks,
Tanvi

On Wed, Jun 24, 2015 at 3:54 PM, Tanvi Tiwari <[hidden email]> wrote:
Hello everyone,

I am trying to understand how to use QuantLib in Java, but have been confused as to the process for a few weeks. I found QuantLib-SWIG-1.5.zip on SourceForge, which seems to have all the .i and the .java, files, as well as a file called quantlib_wrap.cpp. 

The README says to follow these instructions, but it is a bit confusing. Do I need to even tough SWIG or sKWash, because I already have the .java files?

In addition, on SWIG's website, it says under the "Building a Java Module" to do the following commands: 
 $ swig -java example.i
 $ gcc -c example.c example_wrap.c -I/c/jdk1.3.1/include -I/c/jdk1.3.1/include/win32
 $ gcc -shared example.o  example_wrap.o -mno-cygwin -Wl,--add-stdcall-alias  -o example.dll
This makes me think that for each .cpp file in QuantLib, we'd need a wrap.cpp file to correspond and compile it with. Instead, I notice one huge quantlib_wrap.cpp (and quantlib_wrap.h) files. What commands need to be typed in? 
Basically, if someone could provide me with a detailed guide on how to take the materials in QuantLib-SWIG-1.5.zip and turn it into a functioning QuantLib in Java, I would really appreciate it!
Thanks,
Tanvi

--
Tanvi Tiwari
[hidden email]
<a href="tel:914-519-7138" value="+19145197138" target="_blank">914-519-7138



--
Tanvi Tiwari
[hidden email]
914-519-7138

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib in Java

Luigi Ballabio
I have never compiled the Java module on Windows, so I can't give detailed instructions (if someone did, by all means please step in). However:
- no, you don't need SWIG or sKWash. The Java files are already generated.
- yes, there's one single quantlib_wrap.cpp file that should be compiled into a DLL. The instructions you linked are for Linux or Cygwin, so they're not the ones you;re looking for, But right above them there's a link to the SWIG wiki for help with other systems, so I suggest you to have a look there.

Hope this helps,
   Luigi


On Wed, Jun 24, 2015 at 10:05 PM Tanvi Tiwari <[hidden email]> wrote:
Sorry to double e-mail, but I forgot to mention I'm using a 64-bit machine and can use Microsoft Visual Studio or Eclipse easily.

Thanks,
Tanvi

On Wed, Jun 24, 2015 at 3:54 PM, Tanvi Tiwari <[hidden email]> wrote:
Hello everyone,

I am trying to understand how to use QuantLib in Java, but have been confused as to the process for a few weeks. I found QuantLib-SWIG-1.5.zip on SourceForge, which seems to have all the .i and the .java, files, as well as a file called quantlib_wrap.cpp. 

The README says to follow these instructions, but it is a bit confusing. Do I need to even tough SWIG or sKWash, because I already have the .java files?

In addition, on SWIG's website, it says under the "Building a Java Module" to do the following commands: 
 $ swig -java example.i
 $ gcc -c example.c example_wrap.c -I/c/jdk1.3.1/include -I/c/jdk1.3.1/include/win32
 $ gcc -shared example.o  example_wrap.o -mno-cygwin -Wl,--add-stdcall-alias  -o example.dll
This makes me think that for each .cpp file in QuantLib, we'd need a wrap.cpp file to correspond and compile it with. Instead, I notice one huge quantlib_wrap.cpp (and quantlib_wrap.h) files. What commands need to be typed in? 
Basically, if someone could provide me with a detailed guide on how to take the materials in QuantLib-SWIG-1.5.zip and turn it into a functioning QuantLib in Java, I would really appreciate it!
Thanks,
Tanvi

--
Tanvi Tiwari
[hidden email]
<a href="tel:914-519-7138" value="+19145197138" target="_blank">914-519-7138



--
Tanvi Tiwari
[hidden email]
914-519-7138
------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
--

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users