0

`dfg@dfg:~/prog/scipoptsuite-4.0.1/build$ cmake .. -DREADLINE=off -- Build type: Release -- Build shared libraries: ON -- Build type: Release -- LEGACY mode for old compilers: OFF -- Could NOT find IPOPT (missing: IPOPT_LIBRARIES) -- Could NOT find CRITERION (missing: CRITERION_LIBRARY CRITERION_INCLUDE_DIR) -- The following OPTIONAL packages have been found:

  • ZLIB
  • GMP

-- The following REQUIRED packages have been found:

  • BISON
  • FLEX
  • SOPLEX
  • SCIP

-- The following OPTIONAL packages have not been found:

  • IPOPT
  • Criterion

-- Configuring done -- Generating done -- Build files have been written to: /home/dfg/prog/scipoptsuite-4.0.1/build`

error : libscip.so not foundI am trying to run the 'atsp.py' example provided in github but I encountered an error:

/home/dfg/thesis/programming/python_envs/scip_env/bin/python3.6 atsp.py
Traceback (most recent call last):
  File "atsp.py", line 10, in <module>
    from pyscipopt import Model, quicksum, multidict
  File "/home/dfg/thesis/programming/python_envs/scip_env/lib/python3.6/site-packages/pyscipopt/__init__.py", line 3, in <module>
    from pyscipopt.scip      import Model
ImportError: /opt/scipoptsuite-4.0.1/lib/libscip.so: undefined symbol: history_length

My machine is Ubuntu 16.04 64 bits with SCIP Optimization 4.0.1 installed in /opt/scipoptsuite-4.0.1

I am using a virtualenv Python environment with Python 3.6 and the Python editor Pycharm.

I am really stuck.

enter image description here

I re-installed scipoptsuite with CMake Then make test within scipoptdir works fine. I also have the sub-directories lib and include as mentioned at [https://github.com/SCIP-Interfaces/PySCIPOpt/blob/master/INSTALL.rst] . I also run this command make install INSTALLDIR=$SCIPOPTDIR SHARED=true . Then I obtained the following error (scip_env) dfg@dfg:~/thesis/programming/scip-pfd$ python3.6 atsp.py Traceback (most recent call last): File "atsp.py", line 10, in <module> from pyscipopt import Model, quicksum, multidict File "/home/dfg/thesis/programming/python_envs/scip_env/lib/python3.6/site-packages/pyscipopt/__init__.py", line 3, in <module> from pyscipopt.scip import Model ImportError: libscip.so: cannot open shared object file: No such file or directory Do I have to make some link or export a variable ? Thank You very much ! Regards

Derrick
  • 11
  • 4
  • 2
    How did you install the SCIP library? Most likely it's trying to usethe wrong header files. Did you also work with an older SCIP version before? – mattmilten Sep 24 '17 at 14:14
  • Dear MattMillen, Thank You very much for your reply. I downloaded the the scipsuite-4.0.1 from http://scip.zib.de/#download. When installing scip I have done make install INSTALLDIR=$SCIPOPTDIR SHARED=true as recommended by pyscipopt. Do I have to reinstall my scip ? Actually in command line , > make test is working within the scipopt directory. Thank You very much – Derrick Sep 24 '17 at 14:29
  • 1
    Huh, weird. And I suppose you also specified the SCIPOPTDIR during the setup.py execution? As a last resort, you might want to give CMake a try for installing SCIP. – mattmilten Sep 24 '17 at 14:38
  • I used pip install pyscipopt to install the Python interface. How can I do CMake a try to install SCIP ? – Derrick Sep 24 '17 at 14:58
  • http://scip.zib.de/doc/html/CMAKE.php – mattmilten Sep 24 '17 at 15:39
  • I re-install with CMake scipoptsuite-4.0.1 Then make test within scipoptdir works fine. I also have the sub-directories lib and include as mentioned at https://github.com/SCIP-Interfaces/PySCIPOpt/blob/master/INSTALL.rst . I also run this command make install INSTALLDIR=$SCIPOPTDIR SHARED=true . Then I obtain the following error – Derrick Sep 25 '17 at 14:28
  • can you verify that the directory `$SCIPOPTDIR` contains `lib` and `include` and that those also contain the relevant libs and headers? – mattmilten Sep 25 '17 at 15:00
  • I verified. Yes the directory `$SCIPOPTDIR` contains `lib` and `include` repositories, with relevant libs and headers. I have also added these line to `~\.bashrc` file : `export SCIP_HOME="/home/dfg/prog/scipoptsuite-4.0.1" export PATH="${PATH}:${SCIP_HOME}/bin" export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${SCIP_HOME}/lib"` And after that. It comes back to the primaty error, which is `history_length` – Derrick Sep 25 '17 at 17:38
  • I probably know what's the root of the problem: `history_length` belongs to readline. Try installing SCIP without readline, i.e. `make READLINE=false` for the Makefile or `cmake -DREADLINE=off´ for CMake. Python comes with it's own readline lib that is incompatible to the one that your system provides. The joy of library dependencies! – mattmilten Sep 25 '17 at 19:29
  • Thank you @mattmilten. I run this command within the scipoptsuite repository `make install INSTALLDIR=$SCIPOPTDIR SHARED=true READLINE=false`. But now, the lib `libscip.so` is not found – Derrick Sep 26 '17 at 12:25
  • Please use CMake. The lib generated by the pure Makefile might have another name that is not recognized by PySCIPOpt. – mattmilten Sep 26 '17 at 12:33
  • Please do you know how to share library when using `cmake`. Here is what I have done and obtain : – Derrick Sep 26 '17 at 13:32
  • You need to run make afterwards in the build directory. PLEASE read the manual properly before asking questions. – mattmilten Sep 26 '17 at 13:37
  • Thank You @mattmillen, I have done what you advised. I have deleted my previous `scipsuiteopt` then re-install with `cmake` with `readline` off. – Derrick Oct 04 '17 at 19:36
  • Thank You @mattmillen, I have done what you advised. I have deleted my previous `scipsuiteopt` then re-install with `cmake` and `readline` off. That works fine in command line `(scip_env) dfg@dfg:~/thesis/programming/scip-pfd$ python atsp.py Miller-Tucker-Zemlin's model: Optimal value: 330.0 x(1,4) = 1.0 x(2,3) = 1.0 x(3,5) = 1.0 x(4,2) = 1.0 x(5,1) = 1.0 u(5) = 4.0 u(2) = 2.0 ` – Derrick Oct 04 '17 at 19:42
  • However, I think one problem come from my editor `PyCharm` which doesn't recognize `Model` and `quicksum` – Derrick Oct 04 '17 at 19:44
  • Maybe you need to activate the scip_env virtual environment? PySCIPOpt is probably not installed in your global PYTHONPATH – mattmilten Oct 04 '17 at 20:19
  • 1
    Moreover, I copied `libscip.so` located at `./scipoptsuite/build/lib/libscip.so` to `/usr/local/lib/libscip.so`. Then that also work with the editor PyCharm :) – Derrick Oct 04 '17 at 20:21

1 Answers1

1

Thank You @mattmillen, I have done what you advised. I have deleted my previous scipsuiteopt then re-install with cmake and readline off. That works fine in command line (scip_env) dfg@dfg:~/thesis/programming/scip-pfd$ python atsp.py Miller-Tucker-Zemlin's model: Optimal value: 330.0 x(1,4) = 1.0 x(2,3) = 1.0 x(3,5) = 1.0 x(4,2) = 1.0 x(5,1) = 1.0 u(5) = 4.0 u(2) = 2.0

Moreover, I copied libscip.so located at ./scipoptsuite/build/lib/libscip.so to /usr/local/lib/libscip.so. Then that also works with the editor PyCharm :)

Derrick
  • 11
  • 4