Итак, я получил оттуда костюм отсюда и make
ed it. Тогда я пошел в scipoptsuite-3.1.1/scip-3.1.1/interfaces/jni
и следовали инструкциям в README:Создание файла scip.jar (mac)
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)
Вот НКУ номер версии:
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
Спасибо! Я получил файл .jar. Хотя, когда я хочу запустить пример рюкзака, я получаю следующую ошибку: «Исключение в потоке» main «java.lang.UnsatisfiedLinkError: нет jscip-0.1.darwin.x86_64.gnu.opt.spx в java.library.path \t на java.lang.ClassLoader.loadLibrary (ClassLoader.java:1865) \t на java.lang.Runtime.loadLibrary0 (Runtime.java:870) \t в java.lang.System.loadLibrary (System.java:1122) \t в de.zib.jscip.nativ.jni.JniScipLibraryLoader.loadLibrary (JniScipLibraryLoader.java:7) \t в JniKnapsack.main (JniKnapsack.java:34) ' – Daniel
должен открыть новый вопрос для этого? Я попробовал это на нескольких Mac-системах и получил ту же ошибку. – Daniel