Skip to content

Commit

Permalink
Try pointing cmake to the root directory of the Python installation
Browse files Browse the repository at this point in the history
  • Loading branch information
makaimann committed Feb 19, 2025
1 parent 3db3d12 commit c124e55
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,11 @@ jobs:
glibc-devel \
gmp-devel \
java-1.8.0-openjdk-devel \
make \
python3-devel
make
# Show what we installed for debugging
gcc --version
cmake --version
# Check Python development files
echo "Checking Python development files:"
ls -l /usr/include/python*
CIBW_BEFORE_ALL_MACOS: |
brew update
brew install gperf ninja
Expand Down
7 changes: 6 additions & 1 deletion ci-scripts/cibw_build_before.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
./contrib/setup-cvc5.sh
./contrib/setup-z3.sh

./configure.sh --bitwuzla --cvc5 --z3 --python --python-executable=$(which python3)
# Find the Python root directory for the current Python version
# This is important for the manylinux infrastructure, which is in
# a nonstandard location that CMake has trouble finding
PYTHON_ROOT=$(dirname $(dirname $(realpath $(which python3))))

./configure.sh --bitwuzla --cvc5 --z3 --python --python-root-dir=${PYTHON_ROOT}
cd build
make -j
16 changes: 8 additions & 8 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Configures the CMAKE build environment.
--without-tests build without the smt-switch test suite (default: off)
--no-system-gtest do not use system GTest sources; forces download (default: off)
--python compile with python bindings (default: off)
--python-executabe use this version of Python
--python-root-dir point to the base directory of your preferred Python
--smtlib-reader include the smt-lib reader - requires bison/flex (default:off)
--bison-dir=STR custom bison installation directory
--flex-dir=STR custom flex installation directory
Expand Down Expand Up @@ -180,13 +180,13 @@ do
--python)
python=yes
;;
--python-executable=*)
python_executable=${1##*=}
# Check if python_executable is an absolute path and if not, make it
--python-root-dir=*)
python_root_dir=${1##*=}
# Check if python_root_dir is an absolute path and if not, make it
# absolute.
case $python_executable in
case $python_root_dir in
/*) ;; # absolute path
*) python_executable=$(pwd)/$python_executable ;; # make absolute path
*) python_root_dir=$(pwd)/$python_root_dir ;; # make absolute path
esac
;;
--smtlib-reader)
Expand Down Expand Up @@ -293,8 +293,8 @@ cmake_opts="$cmake_opts -DCMAKE_BUILD_TYPE=$build_type"
[ $python != default ] \
&& cmake_opts="$cmake_opts -DBUILD_PYTHON_BINDINGS=ON"

[ $python_executable != default ] \
&& cmake_opts="$cmake_opts -DPython_EXECUTABLE=$python_executable"
[ $python_root_dir != default ] \
&& cmake_opts="$cmake_opts -DPython_ROOT_DIR=$python_root_dir"

[ $smtlib_reader != default ] \
&& cmake_opts="$cmake_opts -DSMTLIB_READER=ON"
Expand Down

0 comments on commit c124e55

Please sign in to comment.