第一次尝试SCIP。无法完全理解如何在MacOS上使用SCIP 8.x.x版本的JNI。
我从网站上下载了scipoptsuite-8.0.4,然后按照说明编译它:
mkdir build
cd build
cmake .. -DAUTOBUILD=on
make
make install
字符串
在我验证之后,创建了共享库:
➜ ls /usr/local/lib/libscip.dylib
/usr/local/lib/libscip.dylib
型
然后,我按照Or-Tools的指示,这样做:
System.loadLibrary("scip"); // added to verify, that shared lib is accessible
MPSolver mpSolver = MPSolver.createSolver("SCIP");
型
我得到了这个错误:
Exception in thread "main" java.lang.UnsatisfiedLinkError: 'long com.google.ortools.linearsolver.mainJNI.MPSolver_createSolver(java.lang.String)'
at com.google.ortools.linearsolver.mainJNI.MPSolver_createSolver(Native Method)
at com.google.ortools.linearsolver.MPSolver.createSolver(MPSolver.java:140)
at org.example.Solver.solve(Solver.java:58)
at org.example.Solver.main(Solver.java:24)
型
遗憾的是,我没有任何C++相关的背景知识来进一步研究。
1条答案
按热度按时间mkh04yzy1#
它是如此的碰巧,经过两个小时的挖掘,我发现,我完全忘记了包括:
第一个月
在实际加载这个库之前。
希望将来有人会花更少的时间来调查这样的事情。