Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sudo cmake --install . doesn't install the libraries libminisat.so.2 and libcryptominisat5.so.5.11 #473

Open
Tc14Hd opened this issue Nov 30, 2023 · 2 comments

Comments

@Tc14Hd
Copy link

Tc14Hd commented Nov 30, 2023

I tried to install STP on Ubuntu 20.04 by following the instructions in the README. Afterwards, I typed import stp into Python (3.8.10) and was greeted with the following error message:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/stp/__init__.py", line 26, in <module>
    from .stp import (
  File "/usr/lib/python3/dist-packages/stp/stp.py", line 51, in <module>
    _lib = cdll.LoadLibrary(path)
  File "/usr/lib/python3.8/ctypes/__init__.py", line 451, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python3.8/ctypes/__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libminisat.so.2: cannot open shared object file: No such file or directory

Apparently, the library libminisat.so.2 is not found. After some investigating, I found out that this can be fixed by copying the library from stp/build/lib stp/deps/install/lib to /usr/local/lib. After doing the same thing for libcryptominisat5.so.5.11, the import finally works.

Looking at the output of sudo cmake --install ., you can see the problem:

-- Install configuration: "RelWithDebInfo"
-- Up-to-date: /usr/local/lib/cmake/STP/STPConfig.cmake
-- Up-to-date: /usr/local/lib/cmake/STP/STPConfigVersion.cmake
-- Up-to-date: /usr/local/lib/cmake/STP/STPTargets.cmake
-- Up-to-date: /usr/local/lib/cmake/STP/STPTargets-relwithdebinfo.cmake
-- Up-to-date: /usr/local/lib/libstp.so.2.3
-- Up-to-date: /usr/local/lib/libstp.so
-- Up-to-date: /usr/local/include/stp/c_interface.h
-- Up-to-date: /usr/local/bin/stp
-- Up-to-date: /usr/local/bin/stp_simple
-- Up-to-date: /usr/lib/python3/dist-packages/stp/stp.py
-- Up-to-date: /usr/lib/python3/dist-packages/stp/__init__.py
-- Up-to-date: /usr/lib/python3/dist-packages/stp/library_path.py

The two libraries are never copied. Maybe I'm missing something, but this seems like a bug to me.

@aytey
Copy link
Member

aytey commented Nov 30, 2023

MiniSat and CMS are dependencies of STP; they should be installed by doing cmake --install . in the build folder of the dependency rather than STP’s build.

To be honest: I’m actually surprised they’re even in the STP build folder, but 🤷🏻‍♂️

@Tc14Hd
Copy link
Author

Tc14Hd commented Nov 30, 2023

Thank you for your quick reply! You are right, I copied the library files from stp/deps/install/lib and not from stp/build/lib. I actually tried to do cmake --install . in the MiniSat folder, but it only "installed" the library to stp/deps/install/lib. After some googling, I found the "trick": first I changed the install folder with cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local .. and then I did sudo cmake --install .. After doing the same for CMS and running ldconfig, it worked.
Wow, that took way more time than I thought it would. Maybe you could change the commands in quick install so that it works "out of the box"? Or maybe I should read the docs more thoroughly...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants