scipopt / JSCIPOpt

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

A question of using JSCIPOpt #3

Closed waldstein1983 closed 8 years ago

waldstein1983 commented 8 years ago

Dear, I am happy to find this java interface for SCIP and cannot wait to try. I have successfully built the source code and got scip.jar and libjscipopt.so I am using IntelliJ Idea on Mac. What I do is: (1) add the ship.jar to dependency (2) add the ../lib directory to dependency (3) Run the Linear.java under /examples Unfortunately, I got following error: Exception in thread "main" java.lang.UnsatisfiedLinkError: no jscip in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867) at java.lang.Runtime.loadLibrary0(Runtime.java:870) at java.lang.System.loadLibrary(System.java:1122) at com.amazon.etr.scip.Linear.main(Linear.java:11) It seems that IDE does not find libjscipopt.so in dependency…..But actually it is there. Did I forget something? baohua

mueldgog commented 8 years ago

Dear Baohua,

today we investigated your issue and could run JSCIPopt on MacOS but the following steps were necessary. This is a temporary workaround and we will try to improve the Makefiles such that things should become much easier.

Apply the following steps to make the interface work on MacOS:

diff --git a/Makefile b/Makefile
index d8e6f9a..1d0d987 100644
--- a/Makefile
+++ b/Makefile
@@ -1053,14 +1053,10 @@ endif

 .PHONY: dll
 dll: $(SCIPLIBOBJFILES) $(MAINOBJFILES) $(LPILIBOBJFILES) $(NLPILIBOBJFILES) $(OBJSCIPLIBOBJFILES) | $(LIBOBJSUBDIRS) $(LIBDIR)
-ifeq ($(COMP),msvc)
        @echo "-> generating library $@"
        $(LINKCC) $(LIBBUILDFLAGS) $(LINKCC_L)$(LIBDIR) -dll $(LIBBUILD_o)$(LIBDIR)/$(DLLFILENAME) \
            $(SCIPLIBOBJFILES) $(OBJSCIPLIBOBJFILES) $(NLPILIBOBJFILES) $(LPILIBOBJFILES) \
            $(LPSLDFLAGS) $(LDFLAGS)
-else
-       @echo "can not use 'make dll' without MSVC"
-endif

 .PHONY: touchexternal
 touchexternal: $(ZLIBDEP) $(GMPDEP) $(READLINEDEP) $(ZIMPLDEP) $(GAMSDEP) $(LPSCHECKDEP) $(PARASCIPDEP) | $(LIBOBJDIR)

this step creates a dll and puts it to your lib directory of SCIP. Copy this library to <JSCIPOpt>/lib.

Note that you need to remove the startin 'lib' and the ending '.dll' for SCIPOPTLIB=<SCIP library>.

Hope this works for now. The problem is that I do not have a Mac system and thus can not really work on this right now.

Please report any issue which might pop up.

Regards, Benny

waldstein1983 commented 8 years ago

Dear, thanks! May I know how to apply this patch to the Makefile? What I do is: 1 Save the patch as 'patch.diff' 2 Run 'patch -p0 < patch.diff ' at the directory which contains Makefile But it reports:

9801a7b319bb:scip-3.2.1 baohuaw$ patch -p0 < patch.diff can't find file to patch at input line 5 Perhaps you used the wrong -p or --strip option? The text leading up to this was: |diff --git a/Makefile b/Makefile |index d8e6f9a..1d0d987 100644 |--- a/Makefile |+++ b/Makefile File to patch:

mueldgog commented 8 years ago

git apply patch.diff should work.

Anyway, you can just look for

 .PHONY: dll
 dll: $(SCIPLIBOBJFILES) $(MAINOBJFILES) $(LPILIBOBJFILES) $(NLPILIBOBJFILES) $(OBJSCIPLIBOBJFILES) | $(LIBOBJSUBDIRS) $(LIBDIR)
ifeq ($(COMP),msvc)
        @echo "-> generating library $@"
        $(LINKCC) $(LIBBUILDFLAGS) $(LINKCC_L)$(LIBDIR) -dll $(LIBBUILD_o)$(LIBDIR)/$(DLLFILENAME) \
            $(SCIPLIBOBJFILES) $(OBJSCIPLIBOBJFILES) $(NLPILIBOBJFILES) $(LPILIBOBJFILES) \
            $(LPSLDFLAGS) $(LDFLAGS)
else
       @echo "can not use 'make dll' without MSVC"
endif

in <SCIP directory>/Makefile and change it to

 .PHONY: dll
 dll: $(SCIPLIBOBJFILES) $(MAINOBJFILES) $(LPILIBOBJFILES) $(NLPILIBOBJFILES) $(OBJSCIPLIBOBJFILES) | $(LIBOBJSUBDIRS) $(LIBDIR)
 @echo "-> generating library $@"
 $(LINKCC) $(LIBBUILDFLAGS) $(LINKCC_L)$(LIBDIR) -dll $(LIBBUILD_o)$(LIBDIR)/$(DLLFILENAME) \
            $(SCIPLIBOBJFILES) $(OBJSCIPLIBOBJFILES) $(NLPILIBOBJFILES) $(LPILIBOBJFILES) \
            $(LPSLDFLAGS) $(LDFLAGS)
waldstein1983 commented 8 years ago

Dear, thanks! This works. But at the step "go to the SCIP directory and call make READLINE=false GMP=false ZLIB=false ZIMPL=false dll this step creates a dll and puts it to your lib directory of SCIP." I got following errors:

9801a7b319bb:scip-3.2.1 baohuaw$ make READLINE=false GMP=false ZLIB=false ZIMPL=false dll -> generating library dll gcc crs -Llib -dll lib/libscip-3.2.1.darwin.x86_64.gnu.opt.spx.dll \ obj/O.darwin.x86_64.gnu.opt/lib/scip/branch_allfullstrong.o obj/O.darwin.x86_64.gnu.opt/lib/scip/branch_cloud.o obj/O.darwin.x86_64.gnu.opt/lib/scip/branch_distribution.o obj/O.darwin.x86_64.gnu.opt/lib/scip/branch_fullstrong.o obj/O.darwin.x86_64.gnu.opt/lib/scip/branch_inference.o obj/O.darwin.x86_64.gnu.opt/lib/scip/branch_leastinf.o obj/O.darwin.x86_64.gnu.opt/lib/scip/branch_mostinf.o obj/O.darwin.x86_64.gnu.opt/lib/scip/branch_multaggr.o obj/O.darwin.x86_64.gnu.opt/lib/scip/branch_nodereopt.o obj/O.darwin.x86_64.gnu.opt/lib/scip/branch_pscost.o obj/O.darwin.x86_64.gnu.opt/lib/scip/branch_random.o obj/O.darwin.x86_64.gnu.opt/lib/scip/branch_relpscost.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_abspower.o obj/O.darwin.x86_64.gnu.opt/lib/scip/compr_largestrepr.o obj/O.darwin.x86_64.gnu.opt/lib/scip/compr_weakcompr.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_and.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_bivariate.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_bounddisjunction.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_conjunction.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_countsols.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_cumulative.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_disjunction.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_indicator.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_integral.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_knapsack.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_linear.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_linking.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_logicor.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_nonlinear.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_or.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_orbitope.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_pseudoboolean.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_quadratic.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_setppc.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_soc.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_sos1.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_sos2.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_superindicator.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_varbound.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons_xor.o obj/O.darwin.x86_64.gnu.opt/lib/scip/dialog_default.o obj/O.darwin.x86_64.gnu.opt/lib/scip/event_softtimelimit.o obj/O.darwin.x86_64.gnu.opt/lib/scip/disp_default.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_actconsdiving.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_bound.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_clique.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_coefdiving.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_crossover.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_dins.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_distributiondiving.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_dualval.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_feaspump.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_fixandinfer.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_fracdiving.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_guideddiving.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_indicator.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_intdiving.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_intshifting.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_linesearchdiving.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_localbranching.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_mutation.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_nlpdiving.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_objpscostdiving.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_octane.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_ofins.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_oneopt.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_proximity.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_pscostdiving.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_reoptsols.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_randrounding.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_rens.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_rins.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_rootsoldiving.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_rounding.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_shiftandpropagate.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_shifting.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_simplerounding.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_subnlp.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_trivial.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_trivialnegation.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_trysol.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_twoopt.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_undercover.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_vbounds.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_veclendiving.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_zeroobj.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur_zirounding.o obj/O.darwin.x86_64.gnu.opt/lib/scip/message_default.o obj/O.darwin.x86_64.gnu.opt/lib/scip/nodesel_bfs.o obj/O.darwin.x86_64.gnu.opt/lib/scip/nodesel_breadthfirst.o obj/O.darwin.x86_64.gnu.opt/lib/scip/nodesel_dfs.o obj/O.darwin.x86_64.gnu.opt/lib/scip/nodesel_estimate.o obj/O.darwin.x86_64.gnu.opt/lib/scip/nodesel_hybridestim.o obj/O.darwin.x86_64.gnu.opt/lib/scip/nodesel_restartdfs.o obj/O.darwin.x86_64.gnu.opt/lib/scip/nodesel_uct.o obj/O.darwin.x86_64.gnu.opt/lib/scip/presol_boundshift.o obj/O.darwin.x86_64.gnu.opt/lib/scip/presol_components.o obj/O.darwin.x86_64.gnu.opt/lib/scip/presol_convertinttobin.o obj/O.darwin.x86_64.gnu.opt/lib/scip/presol_domcol.o obj/O.darwin.x86_64.gnu.opt/lib/scip/presol_dualagg.o obj/O.darwin.x86_64.gnu.opt/lib/scip/presol_dualinfer.o obj/O.darwin.x86_64.gnu.opt/lib/scip/presol_gateextraction.o obj/O.darwin.x86_64.gnu.opt/lib/scip/presol_implfree.o obj/O.darwin.x86_64.gnu.opt/lib/scip/presol_implics.o obj/O.darwin.x86_64.gnu.opt/lib/scip/presol_inttobinary.o obj/O.darwin.x86_64.gnu.opt/lib/scip/presol_redvub.o obj/O.darwin.x86_64.gnu.opt/lib/scip/presol_trivial.o obj/O.darwin.x86_64.gnu.opt/lib/scip/presol_tworowbnd.o obj/O.darwin.x86_64.gnu.opt/lib/scip/presol_stuffing.o obj/O.darwin.x86_64.gnu.opt/lib/scip/prop_dualfix.o obj/O.darwin.x86_64.gnu.opt/lib/scip/prop_genvbounds.o obj/O.darwin.x86_64.gnu.opt/lib/scip/prop_obbt.o obj/O.darwin.x86_64.gnu.opt/lib/scip/prop_probing.o obj/O.darwin.x86_64.gnu.opt/lib/scip/prop_pseudoobj.o obj/O.darwin.x86_64.gnu.opt/lib/scip/prop_redcost.o obj/O.darwin.x86_64.gnu.opt/lib/scip/prop_rootredcost.o obj/O.darwin.x86_64.gnu.opt/lib/scip/prop_vbounds.o obj/O.darwin.x86_64.gnu.opt/lib/scip/reader_bnd.o obj/O.darwin.x86_64.gnu.opt/lib/scip/reader_ccg.o obj/O.darwin.x86_64.gnu.opt/lib/scip/reader_cip.o obj/O.darwin.x86_64.gnu.opt/lib/scip/reader_cnf.o obj/O.darwin.x86_64.gnu.opt/lib/scip/reader_diff.o obj/O.darwin.x86_64.gnu.opt/lib/scip/reader_fix.o obj/O.darwin.x86_64.gnu.opt/lib/scip/reader_fzn.o obj/O.darwin.x86_64.gnu.opt/lib/scip/reader_gms.o obj/O.darwin.x86_64.gnu.opt/lib/scip/reader_lp.o obj/O.darwin.x86_64.gnu.opt/lib/scip/reader_mps.o obj/O.darwin.x86_64.gnu.opt/lib/scip/reader_opb.o obj/O.darwin.x86_64.gnu.opt/lib/scip/reader_osil.o obj/O.darwin.x86_64.gnu.opt/lib/scip/reader_pip.o obj/O.darwin.x86_64.gnu.opt/lib/scip/reader_pbm.o obj/O.darwin.x86_64.gnu.opt/lib/scip/reader_ppm.o obj/O.darwin.x86_64.gnu.opt/lib/scip/reader_rlp.o obj/O.darwin.x86_64.gnu.opt/lib/scip/reader_sol.o obj/O.darwin.x86_64.gnu.opt/lib/scip/reader_wbo.o obj/O.darwin.x86_64.gnu.opt/lib/scip/reader_zpl.o obj/O.darwin.x86_64.gnu.opt/lib/scip/sepa_cgmip.o obj/O.darwin.x86_64.gnu.opt/lib/scip/sepa_clique.o obj/O.darwin.x86_64.gnu.opt/lib/scip/sepa_closecuts.o obj/O.darwin.x86_64.gnu.opt/lib/scip/sepa_cmir.o obj/O.darwin.x86_64.gnu.opt/lib/scip/sepa_disjunctive.o obj/O.darwin.x86_64.gnu.opt/lib/scip/sepa_eccuts.o obj/O.darwin.x86_64.gnu.opt/lib/scip/sepa_flowcover.o obj/O.darwin.x86_64.gnu.opt/lib/scip/sepa_gomory.o obj/O.darwin.x86_64.gnu.opt/lib/scip/sepa_impliedbounds.o obj/O.darwin.x86_64.gnu.opt/lib/scip/sepa_intobj.o obj/O.darwin.x86_64.gnu.opt/lib/scip/sepa_mcf.o obj/O.darwin.x86_64.gnu.opt/lib/scip/sepa_oddcycle.o obj/O.darwin.x86_64.gnu.opt/lib/scip/sepa_rapidlearning.o obj/O.darwin.x86_64.gnu.opt/lib/scip/sepa_strongcg.o obj/O.darwin.x86_64.gnu.opt/lib/scip/sepa_zerohalf.o obj/O.darwin.x86_64.gnu.opt/lib/scip/branch.o obj/O.darwin.x86_64.gnu.opt/lib/scip/clock.o obj/O.darwin.x86_64.gnu.opt/lib/scip/conflict.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cons.o obj/O.darwin.x86_64.gnu.opt/lib/scip/cutpool.o obj/O.darwin.x86_64.gnu.opt/lib/scip/debug.o obj/O.darwin.x86_64.gnu.opt/lib/scip/dialog.o obj/O.darwin.x86_64.gnu.opt/lib/scip/disp.o obj/O.darwin.x86_64.gnu.opt/lib/scip/dive.o obj/O.darwin.x86_64.gnu.opt/lib/scip/event.o obj/O.darwin.x86_64.gnu.opt/lib/scip/fileio.o obj/O.darwin.x86_64.gnu.opt/lib/scip/heur.o obj/O.darwin.x86_64.gnu.opt/lib/scip/compr.o obj/O.darwin.x86_64.gnu.opt/lib/scip/history.o obj/O.darwin.x86_64.gnu.opt/lib/scip/implics.o obj/O.darwin.x86_64.gnu.opt/lib/scip/interrupt.o obj/O.darwin.x86_64.gnu.opt/lib/scip/intervalarith.o obj/O.darwin.x86_64.gnu.opt/lib/scip/lp.o obj/O.darwin.x86_64.gnu.opt/lib/scip/matrix.o obj/O.darwin.x86_64.gnu.opt/lib/scip/mem.o obj/O.darwin.x86_64.gnu.opt/lib/scip/misc.o obj/O.darwin.x86_64.gnu.opt/lib/scip/nlp.o obj/O.darwin.x86_64.gnu.opt/lib/scip/nodesel.o obj/O.darwin.x86_64.gnu.opt/lib/scip/paramset.o obj/O.darwin.x86_64.gnu.opt/lib/scip/presol.o obj/O.darwin.x86_64.gnu.opt/lib/scip/presolve.o obj/O.darwin.x86_64.gnu.opt/lib/scip/pricestore.o obj/O.darwin.x86_64.gnu.opt/lib/scip/pricer.o obj/O.darwin.x86_64.gnu.opt/lib/scip/primal.o obj/O.darwin.x86_64.gnu.opt/lib/scip/prob.o obj/O.darwin.x86_64.gnu.opt/lib/scip/prop.o obj/O.darwin.x86_64.gnu.opt/lib/scip/reader.o obj/O.darwin.x86_64.gnu.opt/lib/scip/relax.o obj/O.darwin.x86_64.gnu.opt/lib/scip/reopt.o obj/O.darwin.x86_64.gnu.opt/lib/scip/retcode.o obj/O.darwin.x86_64.gnu.opt/lib/scip/scip.o obj/O.darwin.x86_64.gnu.opt/lib/scip/scipdefplugins.o obj/O.darwin.x86_64.gnu.opt/lib/scip/scipgithash.o obj/O.darwin.x86_64.gnu.opt/lib/scip/scipshell.o obj/O.darwin.x86_64.gnu.opt/lib/scip/sepa.o obj/O.darwin.x86_64.gnu.opt/lib/scip/sepastore.o obj/O.darwin.x86_64.gnu.opt/lib/scip/set.o obj/O.darwin.x86_64.gnu.opt/lib/scip/sol.o obj/O.darwin.x86_64.gnu.opt/lib/scip/solve.o obj/O.darwin.x86_64.gnu.opt/lib/scip/stat.o obj/O.darwin.x86_64.gnu.opt/lib/scip/tree.o obj/O.darwin.x86_64.gnu.opt/lib/scip/var.o obj/O.darwin.x86_64.gnu.opt/lib/scip/visual.o obj/O.darwin.x86_64.gnu.opt/lib/tclique/tclique_branch.o obj/O.darwin.x86_64.gnu.opt/lib/tclique/tclique_coloring.o obj/O.darwin.x86_64.gnu.opt/lib/tclique/tclique_graph.o obj/O.darwin.x86_64.gnu.opt/lib/dijkstra/dijkstra.o obj/O.darwin.x86_64.gnu.opt/lib/xml/xmlparse.o obj/O.darwin.x86_64.gnu.opt/lib/objscip/objbranchrule.o obj/O.darwin.x86_64.gnu.opt/lib/objscip/objconshdlr.o obj/O.darwin.x86_64.gnu.opt/lib/objscip/objdialog.o obj/O.darwin.x86_64.gnu.opt/lib/objscip/objdisp.o obj/O.darwin.x86_64.gnu.opt/lib/objscip/objeventhdlr.o obj/O.darwin.x86_64.gnu.opt/lib/objscip/objheur.o obj/O.darwin.x86_64.gnu.opt/lib/objscip/objmessagehdlr.o obj/O.darwin.x86_64.gnu.opt/lib/objscip/objnodesel.o obj/O.darwin.x86_64.gnu.opt/lib/objscip/objpresol.o obj/O.darwin.x86_64.gnu.opt/lib/objscip/objpricer.o obj/O.darwin.x86_64.gnu.opt/lib/objscip/objprobdata.o obj/O.darwin.x86_64.gnu.opt/lib/objscip/objprop.o obj/O.darwin.x86_64.gnu.opt/lib/objscip/objreader.o obj/O.darwin.x86_64.gnu.opt/lib/objscip/objrelax.o obj/O.darwin.x86_64.gnu.opt/lib/objscip/objsepa.o obj/O.darwin.x86_64.gnu.opt/lib/objscip/objvardata.o obj/O.darwin.x86_64.gnu.opt/lib/nlpi/nlpi.o obj/O.darwin.x86_64.gnu.opt/lib/nlpi/nlpioracle.o obj/O.darwin.x86_64.gnu.opt/lib/nlpi/expr.o obj/O.darwin.x86_64.gnu.opt/lib/nlpi/nlpi_ipopt_dummy.o obj/O.darwin.x86_64.gnu.opt/lib/nlpi/intervalarithext.o obj/O.darwin.x86_64.gnu.opt/lib/nlpi/exprinterpret_cppad.o obj/O.darwin.x86_64.gnu.opt/lib/lpi/lpi_spx.o obj/O.darwin.x86_64.gnu.opt/lib/scip/bitencode.o obj/O.darwin.x86_64.gnu.opt/lib/blockmemshell/memory.o obj/O.darwin.x86_64.gnu.opt/lib/scip/message.o \ -lsoplex.darwin.x86_64.gnu.opt -lm -m64 -Wl,-rpath,/Users/baohuaw/Documents/software/SCIP/scipoptsuite-3.2.1/scip-3.2.1/lib clang: error: no such file or directory: 'crs' clang: error: no such file or directory: 'lib/libscip-3.2.1.darwin.x86_64.gnu.opt.spx.dll' make: *\ [dll] Error 1

mueldgog commented 8 years ago

Ah, I am sorry. I forgot to add SHARED=true to the make ... dll command. Do not add this to the previous make ... command in the SCIPOPTSUITE directory.

waldstein1983 commented 8 years ago

Dear, thanks! Now I have rebuilt successfully. -> generating library lib/libjscip.dylib -> compiling all java files -> generate lib/scip.jar

But unfortunately, ./run.sh Linear does not work. It reports the same error as before: 9801a7b319bb:JSCIPOpt-master baohuaw$ cd examples/ 9801a7b319bb:examples baohuaw$ ln -s ../lib lib 9801a7b319bb:examples baohuaw$ javac -cp ../lib/scip.jar *.java 9801a7b319bb:examples baohuaw$ ./run.sh Linear Exception in thread "main" java.lang.UnsatisfiedLinkError: no jscip in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867) at java.lang.Runtime.loadLibrary0(Runtime.java:870) at java.lang.System.loadLibrary(System.java:1122) at Linear.main(Linear.java:9)

But when I run Linear.java in my IDE (Intellij Idea). It reports: Exception in thread "main" java.lang.UnsatisfiedLinkError: /Users/baohuaw/Documents/software/SCIP/JSCIPOpt/JSCIPOpt-master/lib/libjscip.dylib: dlopen(/Users/baohuaw/Documents/software/SCIP/JSCIPOpt/JSCIPOpt-master/lib/libjscip.dylib, 1): Library not loaded: lib/libscip-3.2.1.darwin.x86_64.gnu.opt.spx.dll Referenced from: /Users/baohuaw/Documents/software/SCIP/JSCIPOpt/JSCIPOpt-master/lib/libjscip.dylib Reason: image not found at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857) at java.lang.Runtime.loadLibrary0(Runtime.java:870) at java.lang.System.loadLibrary(System.java:1122) at com.amazon.etr.scip.Linear.main(Linear.java:11)

Sorry that I am also not familiar with this error. Did that mean the jsciplib has been found already? What does the new error indicate?

mueldgog commented 8 years ago

I guess, you didn't pull my latest changes. I have added -Djava.library.path="../lib"to run.sh which should solve your current problem.

waldstein1983 commented 8 years ago

Thanks! It works for the "./run.sh Linear" But the error in my IDE still exists....

mueldgog commented 8 years ago

The issue is that your ide can not find the dll anymore. This was also the reason why you needed to put the symbolic link into the examples directory. I assume that you can solve the problem by adding a symbolic link pointing to the JSCIP lib directory (ln -s <JSCIP directory>/lib lib) to the directory where your ide stores the java class files. If this does not work just try some other ones as well.

The way how SCIP creates shared libraries on MacOS is a mess, sorry for that. We will revise this in the near future.

waldstein1983 commented 8 years ago

Dear, thanks! I am not very familiar with this error. But I think maybe IDE has already found the lib because it does not report "no jscip in java.library.path" "Image not found" is also a common error in stackoverflow. I am going to figure it out

mueldgog commented 8 years ago

Could you figure out how to use the JAR and the library files in your IDE?