stanford-centaur / smt-switch

A generic C++ API for SMT solving. It provides abstract classes which can be implemented by different SMT solvers.
Other
103 stars 40 forks source link

Installation issue: unwanted skbuild printout #322

Closed cterrill26 closed 1 year ago

cterrill26 commented 1 year ago

When i import skbuild with python3 on my system I get the following printouts:

>>> import skbuild
Generating grammar tables from /usr/lib/python3.8/lib2to3/Grammar.txt
Generating grammar tables from /usr/lib/python3.8/lib2to3/PatternGrammar.txt

This causes issues in python/CMakeLists.txt since line 48 is not expecting this extra printout.

Locally, I have fixed this by replacing the import skbuild at line 39 of the script with import sys; temp = sys.stdout; sys.stdout = open(os.devnull,\"w\"); import skbuild; sys.stdout = temp to silence the output.

yoni206 commented 1 year ago

Hi, and thanks for posting this issue. Could you share the error that you are getting? Also, perhaps you could try this solution and let us know if it helps?

https://syntaxfix.com/question/8758/cmake-is-not-able-to-find-python-libraries

cterrill26 commented 1 year ago

The error message is:

CMake Error at python/CMakeLists.txt:49 (message):
  Expected CMake module path from

                         scikit-build at Generating grammar tables from /usr/lib/python3.8/lib2to3/Grammar.txt

  Generating grammar tables from
  /usr/lib/python3.8/lib2to3/PatternGrammar.txt

  /aha/lib/python3.8/site-packages/skbuild/resources/cmake

As I said, this is due to the extra printout of

Generating grammar tables from /usr/lib/python3.8/lib2to3/Grammar.txt
Generating grammar tables from /usr/lib/python3.8/lib2to3/PatternGrammar.txt

when importing skbuild, which can be seen in the error message. When silencing this output the installation works fine.

yoni206 commented 1 year ago

Thanks. The fix looks reasonable, as we would not miss errors, just stdout. Would you be willing to submit a PR with this fix?

yoni206 commented 1 year ago

solved by #323