pybind / pybind/pybind11

macos: C++11 flag not added, build errors

Open
#2,949 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
18k
Forks
2.3k
Avg merge
5d 17h
Merged PRs (30d)
10

Description

I've now converted some of my projects to the new Pybind11Extension. This saves me so much code, thank you!

I hit a wall with https://github.com/pyamg/pyamg/pull/272 though: It works well for builds on ubuntu-latest, but for macos-latest (10.15.*) the C++11 flag isn't added, resulting in build errors like

 /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pip-build-env-qjkoia6h/overlay/lib/python3.6/site-packages/pybind11/include/pybind11/detail/common.h:392:15: error: unknown type name 'constexpr'
    inline static constexpr int log2(size_t n, int k = 0) { return (n <= 1) ? k : log2(n >> 1, k + 1); }
                  ^

Any hint on how to avoid those?

Contributor guide

Open the contributing guide

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.

Research direction

Start with the Pybind11Extension build configuration and reproduce the macos-latest failure described in pyamg/pull/272. Check how the C++11 flag is selected on macOS; done means the flag is passed and the affected build checks no longer report constexpr errors.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.