scipopt / JSCIPOpt

Java interface for the SCIP Optimization Suite
MIT License
62 stars 35 forks source link

Exception in thread "Thread-1" java.lang.UnsatisfiedLinkError: 'void jscip.SCIPJNIJNI.swig_module_init()' #51

Closed hulizong closed 3 weeks ago

hulizong commented 3 weeks ago

SCIP Optimization Suite:scipoptsuite-8.0.0.tgz

Execute command ‘make’ ,found libscip.so in build/lib

use libscip.so in java and deploy the jar on Ubuntu 22.04.5 LTS

An error occurred when I called the following code scip = new Scip(); System.load(JScip_Path); scip.create("Test");

Exception in thread "Thread-1" java.lang.UnsatisfiedLinkError: 'void jscip.SCIPJNIJNI.swig_module_init()' at jscip.SCIPJNIJNI.swig_module_init(Native Method) at jscip.SCIPJNIJNI.(SCIPJNIJNI.java:234) at jscip.SCIPJNI.createSCIP(SCIPJNI.java:461) at jscip.Scip.create(Scip.java:24)

kkofler commented 3 weeks ago

The JNI library that you need is libjscip.so. libscip.so has only the C and (if enabled) C++ interface and does not (by itself) support Java. libjscip.so is linked either statically or dynamically to libscip and provides the Java JNI interface.

hulizong commented 3 weeks ago

I just started ,I don't quite understand what you mean How can I use this in Java on Linux? i see the document : https://github.com/scipopt/JSCIPOpt/blob/master/INSTALL.md How should I use the compiled file correctly? I only found libscip.so in the scipoptsuite-8.0.0/build/lib image

kkofler commented 3 weeks ago

I just started ,I don't quite understand what you mean How can I use this in Java on Linux?

This is an issue tracker, not a support forum.

How should I use the compiled file correctly? I only found libscip.so in the scipoptsuite-8.0.0/build/lib

You compiled scipoptsuite (step 1 in the document you linked), now you need to compile JSCIPOpt (step 2).