0

I'm trying to use the JSCIPOpt "The Java interface for the SCIP Optimization Suite". Following the steps in the INSTALL.md file, I got stuck at 3a) this command line:

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

I got this message:

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.

and then I did this and this time I got this message:

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 looks 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">
mkrieger1
  • 19,194
  • 5
  • 54
  • 65
Soukaina
  • 9
  • 3
  • Okay, after you formated your output I have seen that cmake does not find the libscipopt.so in your `JSCIPOpt/lib` directory. Please make sure that you have followed the 1. and 2. point of the INSTALL.md file in JSCIPOpt. – mueldgog Aug 02 '17 at 15:39

1 Answers1

1

How does the content of your JSCIPOpt/lib directory looks like? Do you have the symbolic link pointing to the source directory of SCIP and the other symbolic link pointing to libscipopt.so? Could you download and install the latest version of Java JDK?

I also think that you misunderstood the

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

For example, compiling JSCIPOpt in debug mode requires to execute this command:

cmake .. -DCMAKE_BUILD_TYPE=Debug

EDIT:

You did not set the symbolic links correctly. Basically, you need to execute these commands:

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
mueldgog
  • 383
  • 1
  • 7
  • First, thanks a lot for yr reply! ...................................................................then, when I put " make SHARED=true scipoptlib", I got 2 files: libscipopt.so & libscipopt-4.0.0.linux.x86_64.gnu.opt.so.......PLZ, when you say pointing to the source directory, is this mean this path "scipoptsuite-4.0.0/scip-4.0.0/src",,,,,,,,,,,,,,the second symolic link to libscipopt.so I type like this : "ln -s /home/soukaina/scipoptsuite-4.0.0/lib/libscipopt libscipopt.so" – Soukaina Aug 02 '17 at 17:35
  • I added commands that you need to execute to my answer above. – mueldgog Aug 02 '17 at 18:34