ibex-team / ibex-lib

IBEX is a C++ library for constraint processing over real numbers.
http://ibex-team.github.io/ibex-lib/
GNU Lesser General Public License v3.0
69 stars 51 forks source link

LinkingError Choco solver with ibex (Windows) #457

Closed Nepomuk1999 closed 4 years ago

Nepomuk1999 commented 4 years ago

Hi i try to get ibex working with the choco-solver. the installation seems to be fine and the The Test from compiling a test program from http://www.ibex-lib.org/doc/install.html#uninstall works as well.

But when i try to start the program from Intelij i get the following:

Task :Main.main() FAILED Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\MinGW\msys\1.0\home\bau\Ibex\ibex-2.8.7\lib\ibex-java.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1934) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1850) at java.lang.Runtime.loadLibrary0(Runtime.java:870) at java.lang.System.loadLibrary(System.java:1122) at org.chocosolver.solver.constraints.real.Ibex.(Ibex.java:62) at org.chocosolver.solver.constraints.real.IbexHandler.createInstance(IbexHandler.java:298) at org.chocosolver.solver.constraints.real.IbexHandler.getIbexInstance(IbexHandler.java:218) at org.chocosolver.solver.constraints.real.IbexHandler.contract(IbexHandler.java:122) at org.chocosolver.solver.constraints.real.RealPropagator.propagate(RealPropagator.java:85) at org.chocosolver.solver.propagation.PropagationEngine.execute(PropagationEngine.java:216) at org.chocosolver.solver.propagation.PropagationEngine.activatePropagators(PropagationEngine.java:200) at org.chocosolver.solver.propagation.PropagationEngine.propagate(PropagationEngine.java:164) at org.chocosolver.solver.search.loop.propagate.PropagateBasic.execute(PropagateBasic.java:46) at org.chocosolver.solver.Solver.initialize(Solver.java:377) at org.chocosolver.solver.Solver.solve(Solver.java:264) at KnapsackNotNormalized.createKnapsackModel(KnapsackNotNormalized.java:76) at KnapsackNotNormalized.(KnapsackNotNormalized.java:16) at Main.main(Main.java:4)

Execution failed for task ':Main.main()'.

Process 'command 'C:/Java/jdk1.8.0_251/bin/java.exe'' finished with non-zero exit value 1

I am working on a win7 Machine installed 32 bit MinGW and java jdk 1.8.0_251.

ChocoSolver 4.10.2 imported with gradle as mentioned on their getingStarted page.

InteliJ Run/Debug Config: image

During the waf-configuration i used the "--prefix=/c/MinGW/msys/1.0/home/bau/Ibex/ibex-2.8.7" instead of [...].

Hopefully somebody can help me. Best wishes.

Nepomuk1999 commented 4 years ago

Update these are the files and folders in

bin: image

lib: image image

gchabert commented 4 years ago

@Nepomuk1999 Try to add C:\MinGW\bin in -Djava.library.path (use semicolon to separate the two paths). Tell me if it works.

Nepomuk1999 commented 4 years ago

Thanks for the quick answere, i still get this error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\MinGW\msys\1.0\home\bau\Ibex\ibex-2.8.7\lib\ibex-java.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1934) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1850) at java.lang.Runtime.loadLibrary0(Runtime.java:870) at java.lang.System.loadLibrary(System.java:1122) at org.chocosolver.solver.constraints.real.Ibex.(Ibex.java:62) at org.chocosolver.solver.constraints.real.IbexHandler.createInstance(IbexHandler.java:298) at org.chocosolver.solver.constraints.real.IbexHandler.getIbexInstance(IbexHandler.java:218) at org.chocosolver.solver.constraints.real.IbexHandler.contract(IbexHandler.java:122) at org.chocosolver.solver.constraints.real.RealPropagator.propagate(RealPropagator.java:85) at org.chocosolver.solver.propagation.PropagationEngine.execute(PropagationEngine.java:216) at org.chocosolver.solver.propagation.PropagationEngine.activatePropagators(PropagationEngine.java:200) at org.chocosolver.solver.propagation.PropagationEngine.propagate(PropagationEngine.java:164) at org.chocosolver.solver.search.loop.propagate.PropagateBasic.execute(PropagateBasic.java:46) at org.chocosolver.solver.Solver.initialize(Solver.java:377) at org.chocosolver.solver.Solver.solve(Solver.java:264) at KnapsackNotNormalized.createKnapsackModel(KnapsackNotNormalized.java:76) at KnapsackNotNormalized.(KnapsackNotNormalized.java:16) at Main.main(Main.java:4)

Execution failed for task ':Main.main()'.

Process 'command 'C:/Java/jdk1.8.0_251/bin/java.exe'' finished with non-zero exit value 1

image

gchabert commented 4 years ago

Someone recently experienced exactly the same problem, see https://github.com/ibex-team/ibex-lib/issues/430. The solution was to clean up the PATH variable and to include only the necessary paths. Can you look at that post?

Nepomuk1999 commented 4 years ago

Thanks for the lead, i deleted the following from Path :

C:\MinGW\msys\1.0\home\bau\Ibex\ibex-2.8.7; C:\MinGW\bin; C:\Python27; %IBEX_PATH%\lib

in Intelij i kept the following VM options: image

now its working thanks a lot

gchabert commented 4 years ago

You're welcome, thanks for reporting how you fixed it.