GithubHelp home page GithubHelp logo

Comments (9)

mpreiner avatar mpreiner commented on July 21, 2024

Thanks for bringing this up! I had similar issues with the cmake build for CVC4. I'll look up what I did back then to fix the issue and will also fix it for Boolector. I think that I went with option 1.

from boolector.

mpreiner avatar mpreiner commented on July 21, 2024

Ok I checked, option 1 is indeed already the case (FindPythonExtensions.cmake first calls PythonInterp and then PythonLibs). In CVC4 I explicitly checked that Python libs are the same version as the interpreter (https://github.com/CVC4/CVC4/blob/master/src/bindings/python/CMakeLists.txt#L6).

I've commited a fix on branch cmake-improvements (https://github.com/Boolector/boolector/tree/cmake-improvements). Can you check if this fixes your problem?

from boolector.

marcogario avatar marcogario commented on July 21, 2024

In general, that is a good fix. For Travis CI this still does not work for two reasons:

  1. python 3.7: The libpython is actually under /opt, and this does not seem to be in the search path of cmake. I am unsure how specific this is to Travis, and therefore I am currently working around it by copying the libpython in a location that is in the cmake search path (i.e., within the virtual environment).
  2. python 2.7: The difference is in the release version, and this patch does not account for that:
-- Found PythonInterp: /home/travis/virtualenv/python2.7.15/bin/python (found version "2.7.15") 
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so (found suitable version "2.7.12", minimum required is "2.7")

I am now trying to copy the libpython within the virtualenv, to avoid this problem also for python 2.7. I will let you know if this works.

from boolector.

mpreiner avatar mpreiner commented on July 21, 2024

The release version is now also checked (pushed to master).

from boolector.

mpreiner avatar mpreiner commented on July 21, 2024

However, this now breaks the mac OS build, since the release version can't be found:

-- Found PythonInterp: /usr/local/bin/python (found version "2.7.15") 
CMake Error at /usr/local/Cellar/cmake/3.11.4/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find PythonLibs: Found unsuitable version "2.7.10", but required
  is at least "2.7.15" (found /usr/lib/libpython2.7.dylib)

from boolector.

mpreiner avatar mpreiner commented on July 21, 2024

It works with Python3 on Travis osx. Seems to be a Python 2.7 configuration issue on Travis osx. @marcogario let me know if this issue is now resolved for you.

from boolector.

marcogario avatar marcogario commented on July 21, 2024

We resolved (well, @mikand did) this in pysmt/pysmt#514 (see [1]) to patch the call to cmake and be explicit about the versions of python that we need.

The cases in which is needed seem to be very few, and mainly when there are multiple versions of python installed with minor mismatches. It might not be valuable to have a fix in boolector for this. In my opinion, this can be closed.

  1. https://github.com/pysmt/pysmt/pull/514/files#diff-f1ce7e387e59207202a494f0e81c3d5cR60

from boolector.

mikand avatar mikand commented on July 21, 2024

@marcogario I agree that a complicated machinery to search python is unnecessary, but it would be useful to expose in the configure script a parameter to force (and possibly override) the cmake configuration. My patch practically rewrites the configure script to pass the correct python directory to cmake, and allowing this override directly as a parameter could be useful.

from boolector.

marcogario avatar marcogario commented on July 21, 2024

This has been fixed in 4c578d4.
It is now possible to define CMAKE_OPTS prior to calling configure.sh to set additional flags in CMake. pySMT now uses this instead of hot-patching the configure.sh (See pysmt/pysmt#577.)

from boolector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.