正在生成 scip.jar 文件(mac)

Generating scip.jar file (mac)

所以我从这里得到了 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 soplex,我看到以下错误。任何的想法?

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libsoplex-2.0.1.darwin.x86_64.gnu.opt.so] Error 1
make[1]: [makelibfile] Error 2 (ignored)
-> generating library lib/libsoplex-2.0.1.darwin.x86_64.gnu.opt.so
Undefined symbols for architecture x86_64:
  "___gmp_version", referenced from:
      soplex::SoPlex::printVersion() const in soplex.o
  "___gmpq_add", referenced from:
      soplex::Rational::operator+(soplex::Rational const&) const in rational.o
      soplex::Rational::operator+=(soplex::Rational const&) const in rational.o
      soplex::Rational::operator+(double const&) const in rational.o
      soplex::Rational::operator+=(double const&) const in rational.o
      soplex::operator+(double const&, soplex::Rational const&) in rational.o
  "___gmpq_canonicalize", referenced from:
      soplex::Rational::readString(char const*) in rational.o
      soplex::readStringRational(char const*, soplex::Rational&) in rational.o
  "___gmpq_clear", referenced from:
      soplex::Rational::~Rational() in rational.o
      soplex::Rational::~Rational() in rational.o
      soplex::Rational::freeListMem() in rational.o
      soplex::Rational::disableListMem() in rational.o
      soplex::Rational::operator+(soplex::Rational const&) const in rational.o
      soplex::Rational::operator+(double const&) const in rational.o
      soplex::Rational::operator+=(double const&) const in rational.o
      ...
  "___gmpq_cmp", referenced from:
      soplex::Rational::isNextTo(double const&) in rational.o
      soplex::operator<(soplex::Rational const&, soplex::Rational const&) in rational.o
      soplex::Rational::isAdjacentTo(double const&) in rational.o
      soplex::operator<=(soplex::Rational const&, soplex::Rational const&) in rational.o
      soplex::Rational const& soplex::operator>(soplex::Rational const&) in rational.o
      soplex::operator>=(soplex::Rational const&, soplex::Rational const&) in rational.o
      soplex::operator<(soplex::Rational const&, double const&) in rational.o
      ...
  "___gmpq_div", referenced from:
      soplex::Rational::operator/(soplex::Rational const&) const in rational.o
      soplex::Rational::operator/=(soplex::Rational const&) const in rational.o
      soplex::Rational::operator/(double const&) const in rational.o
      soplex::Rational::operator/=(double const&) const in rational.o
      soplex::Rational::readString(char const*) in rational.o
      soplex::readStringRational(char const*, soplex::Rational&) in rational.o
      soplex::operator/(double const&, soplex::Rational const&) in rational.o
      ...
  "___gmpq_equal", referenced from:
      soplex::operator==(soplex::Rational const&, soplex::Rational const&) in rational.o
      soplex::operator!=(soplex::Rational const&, soplex::Rational const&) in rational.o
      soplex::operator==(soplex::Rational const&, double const&) in rational.o
      soplex::operator!=(soplex::Rational const&, double const&) in rational.o
      soplex::operator==(double const&, soplex::Rational const&) in rational.o
      soplex::operator!=(double const&, soplex::Rational const&) in rational.o
  "___gmpq_get_d", referenced from:
      soplex::Rational::operator double() const in rational.o
      soplex::Rational::operator long double() const in rational.o
      soplex::Rational::isNextTo(double const&) in rational.o
      soplex::Rational::isAdjacentTo(double const&) in rational.o
      soplex::rationalToString(soplex::Rational const&, bool) in rational.o
  "___gmpq_get_str", referenced from:
      soplex::rationalToString(soplex::Rational const&, bool) in rational.o
      soplex::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, soplex::Rational const&) in rational.o
  "___gmpq_init", referenced from:
      soplex::Rational::Rational() in rational.o
      soplex::Rational::Rational() in rational.o
      soplex::Rational::Rational(soplex::Rational const&) in rational.o
      soplex::Rational::Rational(long double const&) in rational.o
      soplex::Rational::Rational(double const&) in rational.o
      soplex::Rational::Rational(int const&) in rational.o
      soplex::Rational::Rational(__mpq_struct const (&) [1]) in rational.o
      ...
  "___gmpq_mul", referenced from:
      soplex::Rational::operator*(soplex::Rational const&) const in rational.o
      soplex::Rational::operator*=(soplex::Rational const&) const in rational.o
      soplex::Rational::operator*(double const&) const in rational.o
      soplex::Rational::operator*=(double const&) const in rational.o
      soplex::Rational::readString(char const*) in rational.o
      soplex::readStringRational(char const*, soplex::Rational&) in rational.o
      soplex::operator*(double const&, soplex::Rational const&) in rational.o
      ...
  "___gmpq_set", referenced from:
      soplex::Rational::Rational(soplex::Rational const&) in rational.o
      soplex::Rational::Rational(__mpq_struct const (&) [1]) in rational.o
      soplex::Rational::operator=(soplex::Rational const&) in rational.o
      soplex::Rational::operator=(__mpq_struct const (&) [1]) in rational.o
      soplex::abs(soplex::Rational const&) in rational.o
      soplex::Rational::readString(char const*) in rational.o
      soplex::operator-(soplex::Rational const&) in rational.o
      ...
  "___gmpq_set_d", referenced from:
      soplex::Rational::Rational(long double const&) in rational.o
      soplex::Rational::Rational(double const&) in rational.o
      soplex::Rational::Rational(int const&) in rational.o
      soplex::Rational::operator=(long double const&) in rational.o
      soplex::Rational::operator=(double const&) in rational.o
      soplex::Rational::operator=(int const&) in rational.o
      soplex::Rational::operator+=(double const&) const in rational.o
      ...
  "___gmpq_set_str", referenced from:
      soplex::Rational::readString(char const*) in rational.o
      soplex::readStringRational(char const*, soplex::Rational&) in rational.o
  "___gmpq_set_z", referenced from:
      soplex::Rational::readString(char const*) in rational.o
      soplex::readStringRational(char const*, soplex::Rational&) in rational.o
  "___gmpq_sub", referenced from:
      soplex::Rational::operator-(soplex::Rational const&) const in rational.o
      soplex::Rational::operator-=(soplex::Rational const&) const in rational.o
      soplex::Rational::operator-(double const&) const in rational.o
      soplex::Rational::operator-=(double const&) const in rational.o
      soplex::Rational::isNextTo(double const&) in rational.o
      soplex::operator-(double const&, soplex::Rational const&) in rational.o
  "___gmpz_clear", referenced from:
      soplex::Rational::readString(char const*) in rational.o
      soplex::readStringRational(char const*, soplex::Rational&) in rational.o
  "___gmpz_init", referenced from:
      soplex::Rational::readString(char const*) in rational.o
      soplex::readStringRational(char const*, soplex::Rational&) in rational.o
  "___gmpz_sizeinbase", referenced from:
      soplex::rationalToString(soplex::Rational const&, bool) in rational.o
      soplex::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, soplex::Rational const&) in rational.o
  "___gmpz_ui_pow_ui", referenced from:
      soplex::Rational::readString(char const*) in rational.o
      soplex::readStringRational(char const*, soplex::Rational&) in rational.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libsoplex-2.0.1.darwin.x86_64.gnu.opt.so] Error 1
make[1]: [all] Error 2 (ignored)
Install SoPlex library into lib directory
install: illegal option -- t
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 file2
       install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 ... fileN directory
       install -d [-v] [-g group] [-m mode] [-o owner] directory ...
make: [soplex] Error 64 (ignored)

这里是 GCC 版本号:

MacBook-Pro-7:jni i-danielk$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.3.0

问题是您的系统缺少 "gmp"。您有两个选择:

  1. 安装 gmp 库
  2. 不使用 gmp 编译 SoPlex。做这个电话: make soplex GMP=false

zlib 可能会出现类似的问题。如果您的系统上未安装此库。如果是这种情况,您可以使用 make soplex GMP=false ZLIB=false

下一步会要求你编译SCIP。如果没有安装gmp,需要使用如下命令:make scip GMP=false ZIMPL=false