Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Linux上构建JSCIPOpt(用于Scip的Java接口)_Java_Linux_Cmake_Java Native Interface_Scip - Fatal编程技术网

在Linux上构建JSCIPOpt(用于Scip的Java接口)

在Linux上构建JSCIPOpt(用于Scip的Java接口),java,linux,cmake,java-native-interface,scip,Java,Linux,Cmake,Java Native Interface,Scip,我正在尝试使用JSCIOPT“SCIP优化套件的Java接口(请参见链接[1])。按照INSTALL.md文件中的步骤,我被困在3a)这个命令行” **cmake。。[-DCMAKE\u BUILD\u TYPE=]** 我得到了这个信息: cmake .. [-DCMAKE_BUILD_TYPE=<"Debug" or "Release", default: "Release">] **CMake Error:** The source directory "/h

我正在尝试使用JSCIOPT“SCIP优化套件的Java接口(请参见链接[1])。按照INSTALL.md文件中的步骤,我被困在3a)这个命令行”

**cmake。。[-DCMAKE\u BUILD\u TYPE=]**
我得到了这个信息:

    cmake .. [-DCMAKE_BUILD_TYPE=<"Debug" or "Release", default: "Release">]
    **CMake Error:** The source directory "/home/soukaina/JSCIPOpt-master/build/Release" does not exist.
    Specify --help for usage, or press the help button on the CMake GUI.
cmake。。[-DCMAKE\u BUILD\u TYPE=]
**CMake错误:*源目录“/home/soukaina/jsciopt master/build/Release”不存在。
指定--help的用法,或按CMake GUI上的“帮助”按钮。
然后我做了这个,这次我得到了这个消息:

soukaina@soukaina-Aspire-5250:~/JSCIPOpt-master$ rm -rf build
soukaina@soukaina-Aspire-5250:~/JSCIPOpt-master$ mkdir build
soukaina@soukaina-Aspire-5250:~/JSCIPOpt-master$ cd build
soukaina@soukaina-Aspire-5250:~/JSCIPOpt-master/build$ cmake ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found JNI: /usr/lib/jvm/default-java/jre/lib/amd64/libjawt.so 
-- Java version 1.7.0.85 configured successfully!
-- Found Java: /usr/bin/java (found version "1.7.0.85")
CMake Error at CMakeLists.txt:18 (include):
  include could not find load file:    
    UseJava    

-- Could NOT find SWIG (missing:  SWIG_EXECUTABLE SWIG_DIR) 
found SCIP library: SCIPOPT_LIBRARIES-NOTFOUND
CMake Error at CMakeLists.txt:96 (add_jar):
  Unknown CMake command "add_jar".


CMake Error: **The following variables are used in this project, but they are set to NOTFOUND.**
Please set them or make sure they are set and tested correctly in the CMake files:
SCIPOPT_LIBRARIES
    linked by target "jscip" in directory /home/soukaina/JSCIPOpt-master

-- Configuring incomplete, errors occurred!}


>  The INSTALL.md look like :....to use/extend the Java interface, you need:  
 - SCIP optimization suite
 - Java JDK
 - C compiler
 - CMake
 - SWIG (optional)

The following steps need to be done before compiling the Java interface.   
1) Create a shared library of the [SCIP optimization suite](http://scip.zib.de/#download) by executing     
    make SHARED=true scipoptlib     
in the SCIP optimization suite directory. Afterwards, you will find the library (*.so) in the ./lib directory of the
optimization suite.

2) Create a symbolic link in JSCIPOpt to the library compiled in 1) and to the source directory of SCIP (in the
optimization suite)

    mkdir -p lib;
    cd lib;
    ln -s <SCIP source directory> scipinc
    ln -s <SCIP opt suite directory>/lib/<scip opt library> libscipopt.so

**3a)** Building JSCIPOpt on Linux.

Compile the interface by executing the following commands:

 - mkdir build
 - cd build
 **- cmake .. [-DCMAKE_BUILD_TYPE=<"Debug" or "Release", default:** "Release">]
 - make

Execute the examples via

 - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./
 - java -cp scip.jar:examples.jar <"Linear" or "Quadratic" or "Read">


  [1]: https://github.com/SCIP-Interfaces/JSCIPOpt
soukaina@soukaina-Aspire-5250:~/JSCIPOpt主机$rm-射频构建
soukaina@soukaina-Aspire-5250:~/jsciopt主控$mkdir构建
soukaina@soukaina-Aspire-5250:~/JSCIOPT主控$cd构建
soukaina@soukaina-Aspire-5250:~/jsciopt主控/构建$cmake。。
--C编译器标识为GNU
--CXX编译器标识为GNU
--检查C编译器是否工作:/usr/bin/gcc
--检查C编译器是否正常工作:/usr/bin/gcc--works
--检测C编译器ABI信息
--检测C编译器ABI信息-完成
--检查CXX编译器是否工作:/usr/bin/c++
--检查CXX编译器是否正常工作:/usr/bin/c++--正常工作
--检测CXX编译器ABI信息
--检测CXX编译器ABI信息-完成
--找到JNI:/usr/lib/jvm/default java/jre/lib/amd64/libjawt.so
--Java版本1.7.0.85配置成功!
--找到的Java:/usr/bin/Java(找到的版本为“1.7.0.85”)
CMakeLists.txt处的CMake错误:18(包括):
include找不到加载文件:
UseJava
--找不到SWIG(缺少:SWIG\u可执行文件SWIG\u DIR)
已找到SCIP库:SCIPOP_库-未找到
CMakeLists.txt:96处的CMake错误(添加jar):
未知的CMake命令“add_jar”。
CMake Error:*此项目中使用了以下变量,但它们被设置为NOTFOUND**
请设置或确保在CMake文件中正确设置和测试:
SCIPOPT_图书馆
由目录/home/soukaina/JSCIPOpt master中的目标“jscip”链接
--配置不完整,出现错误!}
>INSTALL.md看起来像:……要使用/扩展Java接口,您需要:
-SCIP优化套件
-Java JDK
-C编译器
-克马克
-SWIG(可选)
在编译Java接口之前,需要执行以下步骤。
1) 创建[SCIP优化套件]的共享库(http://scip.zib.de/#download)通过执行
使共享=真正的scipoptlib
在SCIP优化套件目录中。之后,您将在的./lib目录中找到库(*.so)
优化套件。
2) 在JSCIOPT中创建一个符号链接,指向在1)中编译的库和SCIP的源目录(在
优化套件)
mkdir-p-lib;
光盘库;
ln-s scipinc
ln-s/lib/libscipopt.so
**3a)**在Linux上构建JSCIPOpt。
通过执行以下命令编译接口:
-mkdir构建
-光盘制作
**-克马克。。[-DCMAKE\u BUILD\u TYPE=]
-制造
通过以下方式执行示例:
-导出LD\u库路径=$LD\u库路径:/
-java-cp scip.jar:examples.jar
[1]: https://github.com/SCIP-Interfaces/JSCIPOpt

非常感谢您的帮助…请记住,在回答时,我不是一个成熟的开发人员。提前感谢

您的
jsciopt/lib
目录的内容是什么样子的?您是否有指向SCIP源目录的符号链接和指向
libscipot.so
的其他符号链接?您能下载并安装最新版本的Java JDK吗

我还认为你误解了

cmake .. [-DCMAKE_BUILD_TYPE=<"Debug" or "Release", default: "Release">]
编辑:

soukaina@soukaina-Aspire-5250:~/JSCIPOpt-master$ rm -rf build
soukaina@soukaina-Aspire-5250:~/JSCIPOpt-master$ mkdir build
soukaina@soukaina-Aspire-5250:~/JSCIPOpt-master$ cd build
soukaina@soukaina-Aspire-5250:~/JSCIPOpt-master/build$ cmake ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found JNI: /usr/lib/jvm/default-java/jre/lib/amd64/libjawt.so 
-- Java version 1.7.0.85 configured successfully!
-- Found Java: /usr/bin/java (found version "1.7.0.85")
CMake Error at CMakeLists.txt:18 (include):
  include could not find load file:    
    UseJava    

-- Could NOT find SWIG (missing:  SWIG_EXECUTABLE SWIG_DIR) 
found SCIP library: SCIPOPT_LIBRARIES-NOTFOUND
CMake Error at CMakeLists.txt:96 (add_jar):
  Unknown CMake command "add_jar".


CMake Error: **The following variables are used in this project, but they are set to NOTFOUND.**
Please set them or make sure they are set and tested correctly in the CMake files:
SCIPOPT_LIBRARIES
    linked by target "jscip" in directory /home/soukaina/JSCIPOpt-master

-- Configuring incomplete, errors occurred!}


>  The INSTALL.md look like :....to use/extend the Java interface, you need:  
 - SCIP optimization suite
 - Java JDK
 - C compiler
 - CMake
 - SWIG (optional)

The following steps need to be done before compiling the Java interface.   
1) Create a shared library of the [SCIP optimization suite](http://scip.zib.de/#download) by executing     
    make SHARED=true scipoptlib     
in the SCIP optimization suite directory. Afterwards, you will find the library (*.so) in the ./lib directory of the
optimization suite.

2) Create a symbolic link in JSCIPOpt to the library compiled in 1) and to the source directory of SCIP (in the
optimization suite)

    mkdir -p lib;
    cd lib;
    ln -s <SCIP source directory> scipinc
    ln -s <SCIP opt suite directory>/lib/<scip opt library> libscipopt.so

**3a)** Building JSCIPOpt on Linux.

Compile the interface by executing the following commands:

 - mkdir build
 - cd build
 **- cmake .. [-DCMAKE_BUILD_TYPE=<"Debug" or "Release", default:** "Release">]
 - make

Execute the examples via

 - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./
 - java -cp scip.jar:examples.jar <"Linear" or "Quadratic" or "Read">


  [1]: https://github.com/SCIP-Interfaces/JSCIPOpt
您没有正确设置符号链接。基本上,您需要执行以下命令:

cd JSCIPOpt
mkdir lib; cd lib
ln -s /home/soukaina/scipoptsuite-4.0.0/scip-4.0.0/src scipinc
ln -s /home/soukaina/scipoptsuite-4.0.0/lib/libscipopt.so libscipopt.so
cd ..
mkdir build; cd build
cmake ..
make

好的,在格式化输出后,我看到cmake在
JSCIPOpt/lib
目录中找不到libscipopt.so。请确保您已遵循1。二,。JSCIPOpt中INSTALL.md文件的要点。首先,非常感谢您的回复。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。然后,当我放置“make SHARED=true scipptlib”时,我得到了两个文件:libscipot.so&libscipopt-4.0.0.linux.x86_64.gnu.opt.so…….PLZ,当你说指向源目录时,这是不是意味着路径“sciptsuite-4.0.0/scip-4.0.0/src”,,,,,,,,,,,,,,,,,,,,,,指向libscipopt的第二个符号链接。所以我这样键入:“ln-s/home/soukaina/scipoptsite-4.0.0/lib/libscippt libscippt.so”我在上面的回答中添加了您需要执行的命令。
cd JSCIPOpt
mkdir lib; cd lib
ln -s /home/soukaina/scipoptsuite-4.0.0/scip-4.0.0/src scipinc
ln -s /home/soukaina/scipoptsuite-4.0.0/lib/libscipopt.so libscipopt.so
cd ..
mkdir build; cd build
cmake ..
make