0

所以我从这里得到了 scip 套装并make编辑了它。然后我去了scipoptsuite-3.1.1/scip-3.1.1/interfaces/jni并按照自述文件中的说明进行操作:

1) doxygen jniinterface.dxy
   - generates xml documentation
2) ./createJniInterface.py xml/*
   - uses the xml documentation and creates JNI interface
3) create softlinks to soplex and scip in "lib" folder:
   mkdir ./lib
   cd lib
   ln -s ../../../../soplex-2.0.0 soplex
   ln -s ../../.. scip
   cd ..
4) make soplex
   - creates shared library of Soplex
   - use options (e.g., ZLIB=false GMP=false) as required
5) make scip
   - creates shared library of SCIP
   - use options (e.g., ZIMPL=false READLINE=false ZLIB=false GMP=false)
     as required
6) make
7) test your installation:
   cd examples/JniKnapsack
   make
   make run

最后,当我这样做时make run,我得到以下错误:

ubuntu@kanga:~/solvers/scipoptsuite-3.1.1/scip-3.1.1/interfaces/jni/examples/JniKnapsack$ make run
./run.sh
java: symbol lookup error: /home/ubuntu/solvers/scipoptsuite-3.1.1/scip-3.1.1/interfaces/jni/lib/libjscip-0.1.linux.x86_64.gnu.opt.spx.so: undefined symbol: SCIPcreate
make: *** [run] Error 127

知道如何解决这个问题吗?

在某些时候,我遇到了一些问题make。我必须将包含 jni.h 的文件夹作为“-I”选项添加到 Makefile 中的 gcc。

ubuntu@kanga:~/solvers/scipoptsuite-3.1.1/scip-3.1.1/interfaces/jni$ diff Makefile-ORIG Makefile
55c55,56
< FLAGS     +=  -I$(LIBDIR)/jniinc
---
> #FLAGS        +=  -I$(LIBDIR)/jniinc
> FLAGS     +=  -I/usr/lib/jvm/java-7-openjdk-amd64/include



ubuntu@kanga:~/solvers/scipoptsuite-3.1.1/scip-3.1.1/interfaces/jni$ uname -a
Linux ec2mln0r 3.13.0-49-generic #83-Ubuntu SMP Fri Apr 10 20:11:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

这是 GCC 版本号:

ubuntu@kanga:~/solvers/scipoptsuite-3.1.1/scip-3.1.1/interfaces/jni$ gcc --version
gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
4

1 回答 1

1

请尝试更改 interfaces/jni/Makefile 中的规则 $(JNILIBFILE)

$(JNILIBFILE):  $(OBJDIR) $(JNILIBHEADERS) $(JNILIBDEP) $(JNILIBOBJFILES)
            @echo "-> generating library $@"
            -rm -f $@
            $(LIBBUILD) $(LIBBUILDFLAGS) $(LIBBUILD_o)$@ \
            $(JNILIBOBJFILES) \
            $(LINKCC_L)$(LIBDIR)/ $(LINKCC_l)$(SCIPLIB)$(LINKLIBSUFFIX) \
            $(LINKCC_l)$(LPILIB)$(LINKLIBSUFFIX) \
            $(LINKCC_l)$(NLPILIB)$(LINKLIBSUFFIX) \
            $(LPSLDFLAGS) $(LDFLAGS)
ifneq ($(RANLIB),)
            $(RANLIB) $@
endif
于 2015-06-09T04:38:27.900 回答