Can't build Boost Python 3 on macOS

Open
#399 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp, python
Domain
build-system

Research direction

Start by reproducing the reported commands, ./bootstrap.sh --with-libraries=python --with-python=python3 and ./b2 --debug-configuration --debug-building --debug-generator install, on macOS with the official Python 3 installer. Inspect how bootstrap.sh passes the Python root to b2 and why b2 checks bin/python rather than the available bin/python3. Done means Boost Python 3 builds successfully with this installation.

Written by the indexing model from the issue text.

Description

Made a report https://github.com/boostorg/python/issues/401 in the boostorg/boost repo so I am transfering here to be more relevant.

Using official Python at python.org, building Boost Python 3 (Boost 1.80.0) with

./bootstrap.sh --with-libraries=python --with-python=python3
./b2 --debug-configuration --debug-building --debug-generator install

does not work: bootstrap.sh seems to work as it detected the right Python root location

Detecting Python version... 3.10
Detecting Python root... /Library/Frameworks/Python.framework/Versions/3.10

However, b2 then reports

notice: [python-cfg] Configuring python...
notice: [python-cfg]   user-specified version: "3.10"
notice: [python-cfg]   user-specified cmd-or-prefix: "/Library/Frameworks/Python.framework/Versions/3.10"
notice: [python-cfg] Checking interpreter command "/Library/Frameworks/Python.framework/Versions/3.10/bin/python"...
notice: [python-cfg] running command '/Library/Frameworks/Python.framework/Versions/3.10/bin/python -c "from sys import *; print('version=%d.%d\nplatform=%s\nprefix=%s\nexec_prefix=%s\nexecutable=%s' % (version_info[0],version_info[1],platform,prefix,exec_prefix,executable))" 2>&1'
notice: [python-cfg] ...does not invoke a working interpreter

Apparently, the Python 3 installer on macOS does not created bin/python, only bin/python3. Shouldn't it take into account the suggested name for the Python executable in bootstrap instead of ignoring it? (It builds perfectly for Python 2.7 included in macOS.)

Dominant language
C++
Stars
537
Forks
223
Avg merge
11h 22m
Merged PRs (30d)
2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/python

All issues in boostorg/python

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.