|
From: Luigi B. <lui...@gm...> - 2019-07-02 08:59:33
|
Try setting the environment variable LD_LIBRARY_PATH to /home/v574933/quantlib/qlib/lib Luigi On Tue, Jul 2, 2019 at 3:56 AM Tapas Banerjee via QuantLib-dev < qua...@li...> wrote: > > 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.Test > Exception 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 file > lavac -cp > /home/v574933/quantlib/qlib/QuantLib-SWIG-1.15/Java/QuantLib.jar > examples/FRA.java > java -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 lib > bash-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.la > lrwxrwxrwx 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... > _______________________________________________ > QuantLib-dev mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-dev > |