Boolector / boolector

A Satisfiability Modulo Theories (SMT) solver for the theories of fixed-size bit-vectors, arrays and uninterpreted functions.
http://boolector.github.io
Other
324 stars 63 forks source link

PyBoolector install via PIP fails on x86_64 MacOS #191

Open lwerdna opened 2 years ago

lwerdna commented 2 years ago

After pip install boolector, setup.py is unable to find CMakeLists.txt:

$ pip install pyboolector==3.2.1.20210527.1
Collecting pyboolector==3.2.1.20210527.1
  Using cached PyBoolector-3.2.1.20210527.1.tar.gz (20 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/_t/pb7h4_cs2lg6jp92mwz3d7f80000gn/T/pip-install-kzvrzpv6/pyboolector_070a369af29b4226954644dd43fe006a/setup.py", line 14, in <module>
          with open(cmakelists_txt, "r") as f:
      FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/_t/pb7h4_cs2lg6jp92mwz3d7f80000gn/T/pip-install-kzvrzpv6/CMakeLists.txt'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I've tried older versions too (pip install pyboolector==3.2.1.20210527.1, etc.) without success.

Here's this machine's info:

Darwin ThisMachine 20.5.0 Darwin Kernel Version 20.5.0: Sat May  8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64
uwesimm commented 2 years ago

same here on linux

pip3 install --no-clean pyboolector==3.2.2.20210617.2
Collecting pyboolector==3.2.2.20210617.2
  Downloading https://files.pythonhosted.org/packages/9d/d2/4b244e2d3100b1d7af0e68b0181538d33d4a84e75305e296080eb74f26f2/PyBoolector-3.2.2.20210617.2.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-x4lre52z/pyboolector/setup.py", line 14, in <module>
        with open(cmakelists_txt, "r") as f:
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-build-x4lre52z/CMakeLists.txt'
uwesimm commented 2 years ago

all pyboolector 3.2.2* fail this way. earlier version seem to install fine

lwerdna commented 2 years ago

@uwesimm What version(s) did you get to install ok? I reached back a year (pip install pyboolector==3.2.1.20200410.3) without luck :(

uwesimm commented 2 years ago

i thought i tried 3.0.0.... and some 3.2.0 version

mpreiner commented 2 years ago

Hmm I can't reproduce this on my linux machine (in a fresh virtual env):

$ pip install pyboolector
Collecting pyboolector
  Downloading PyBoolector-3.2.2.20220125.14-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (2.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.3/2.3 MB 4.2 MB/s eta 0:00:00
Installing collected packages: pyboolector
Successfully installed pyboolector-3.2.2.20220125.14

@lwerdna Building the python package from source is currently not supported, your issue might be related to https://github.com/Boolector/boolector/issues/180

@uwesimm what OS are you using?

uwesimm commented 2 years ago

Collecting pyboolector>=3.2.2 (from pyvsc->-r requirements.txt (line 10)) Using cached https://files.pythonhosted.org/packages/fa/89/c6f53acc54d9b04cbdd1e47b20cc5f73f6e1f1fbb6f0e6a291dfa24d6243/PyBoolector-3.2.2.20220125.14.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in File "/tmp/pip-build-6m0q_ub7/pyboolector/setup.py", line 14, in with open(cmakelists_txt, "r") as f: FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-build-6m0q_ub7/CMakeLists.txt'

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-6m0q_ub7/pyboolector/ You are using pip version 9.0.1, however version 22.0.4 is available. You should consider upgrading via the 'pip install --upgrade pip' command. [venv] uwes@vlptk-uwes[none]~/src/riscv-dv$ lsb_release -a LSB Version: :base-4.0-amd64:base-4.0-ia32:base-4.0-noarch:core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch Distributor ID: RedHatEnterpriseWorkstation Description: Red Hat Enterprise Linux Workstation release 6.5 (Santiago) Release: 6.5 Codename: Santiago [venv] uwes@vlptk-uwes[none]~/src/riscv-dv$

uwesimm commented 2 years ago

Python 3.6.3 (default, Jul 24 2018, 04:37:02) [GCC 6.3.0] on linux

mpreiner commented 2 years ago

Can you try updating pip (pip install --upgrade pip) as suggested in your output above?

uwesimm commented 2 years ago

upgrading pip seems to cure the issue at hand on linux

hmih commented 2 years ago

Currently fails for me with this exact same error. I hacked around the pypi/build.sh script to generate a .whl which I put in the requirements.txt of the top-level package that requires boolector. Here's my reverse engineered script:

#!/usr/bin/env bash
set -e -o pipefail

#mkdir -p build
#cd build
#
echo "Hello from PyPi build.sh"

BUILD_DIR=`pwd`
N_CORES=`nproc`

cp -r ~/work/riscv-sims/boolector .

# Setup dependencies
cd boolector
/bin/sh ./contrib/setup-btor2tools.sh
/bin/sh ./contrib/setup-cadical.sh
/bin/sh ./contrib/setup-lingeling.sh

#********************************************************************
#* boolector
#********************************************************************
cd ${BUILD_DIR}

cd boolector

./configure.sh --python --shared --prefix output

cd build

make -j${N_CORES}

make install

#********************************************************************
#* pyboolector
#********************************************************************
cd ${BUILD_DIR}
rm -rf pyboolector

export CC=gcc
export CXX=g++
# Specify path to CmakeLists.txt so setup.py can extract the version
export CMAKELISTS_TXT=~/work/riscv-sims/boolector/CMakeLists.txt

cp -r ~/work/riscv-sims/boolector/pypi pyboolector

# Grab the main license file
cp ~/work/riscv-sims/boolector/COPYING pyboolector/LICENSE

cd pyboolector

for py in /opt/python/cp3*; do
  echo "Python: ${py}"
  cd ${BUILD_DIR}/pyboolector
  rm -rf src
  cp -r ~/work/riscv-sims/boolector/src/api/python src
  gsed -i -e 's/override//g' \
     -e 's/noexcept/_GLIBCXX_USE_NOEXCEPT/g' \
     -e 's/\(BoolectorException (const.*\)/\1\n    virtual ~BoolectorException() _GLIBCXX_USE_NOEXCEPT {}/' \
       src/pyboolector_abort.cpp
  mkdir -p src/utils
  cp ~/work/riscv-sims/boolector/src/*.h src
  cp ~/work/riscv-sims/boolector/src/utils/*.h src/utils
  python3 ./src/mkenums.py ./src/btortypes.h ./src/pyboolector_enums.pxd
  python3 setup.py sdist bdist_wheel
done

#for whl in dist/*.whl; do
#  auditwheel repair $whl
#done

rm -rf ./result
mkdir -p ./result

#cp -r wheelhouse dist ./result