|
From: Tapas B. <ta...@ao...> - 2019-07-02 01:55:53
|
Hi Luigi & experts, I need urgent help to build Quantlib SWIG for Java Using the step mentioned here https://sourceforge.net/p/quantlib/mailman/message/19608067/I could build libQuantLibJNI.so, libQuantLib.so, QuantLib.jar suecssfully But while running example file, I am getting below error.. Any idea - what I am doing wrong and how to fix? _ZNK8QuantLib13TermStructure13referenceDateEv ...... when I load System.loadLibrary("QuantLibJNI"); I created below simple example call stripping all Quantlib include, still getting error -----bash-4.1$ java -cp ./QuantLib.jar:. -Djava.library.path=/home/v574933/quantlib/qlib/lib ex.TestException in thread "main" java.lang.UnsatisfiedLinkError: /home/v574933/quantlib/qlib/lib/libQuantLibJNI.so: /home/v574933/quantlib/qlib/lib/libQuantLibJNI.so: undefined symbol:_ZNK8QuantLib13TermStructure13referenceDateEv at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1938) same error I get Quantlib examples filelavac -cp /home/v574933/quantlib/qlib/QuantLib-SWIG-1.15/Java/QuantLib.jar examples/FRA.javajava -cp /home/v574933/quantlib/qlib/QuantLib-SWIG-1.15/Java/QuantLib.jar -Djava.library.path=/home/v574933/quantlib/qlib/lib examples.FRA ---- C++ build –./configure --disable-static CXXFLAGS=-O3 --enable-sessions --with-boost-include=/home/v574933/quantlib/qlib/boost_1_68_0 --with-boost-lib=/home/v574933/quantlib/qlib/boost_1_68_0/libs --prefix=/home/v574933/quantlib/qlib - Test.java -----package ex;public class Test { static { // Load QuantLib try{ //System.loadLibrary("QuantLib"); System.loadLibrary("QuantLibJNI"); } catch (RuntimeException e) { System.err.println("Unable to load library .."); e.printStackTrace(); } } public static void main(String[] args) throws Exception { System.out.println("Test Pacakage.."); }} /home/v574933/quantlib/qlib/lib> #location of libbash-4.1$ ls -l lib*-rw-r--r-- 1 v574933 im_ad 1189200922 Jun 25 15:33 libQuantLib.a-rwxr-xr-x 1 v574933 im_ad 20580938 Jun 26 11:04 libQuantLibJNI.so-rwxr-xr-x 1 v574933 im_ad 996 Jun 27 11:27 libQuantLib.lalrwxrwxrwx 1 v574933 im_ad 20 Jun 27 11:27 libQuantLib.so -> libQuantLib.so.0.0.0-rwxr-xr-x 1 v574933 im_ad 42251344 Jun 27 11:27 libQuantLib.so.0.0.0 Let me know if any other questions from my end. Thanks, Tapas ta...@ao... |