pybind / pybind/pybind11

[BUG]: cannot compile example/run tests on docs on arm64 macOS

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

Nobody has claimed this yet.

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

Description

Required prerequisites
What version (or hash if on master) of pybind11 are you using?

2.10.3

Problem description

I am following along in the getting started section in the docs

when i run,

make check -j 4

I get the following error:

  "__Py_FalseStruct", referenced from:
      pybind11::detail::type_caster<bool, void>& pybind11::detail::load_type<bool, void>(pybind11::detail::type_caster<bool, void>&, pybind11::handle const&) in embed.cpp.o
  "__Py_NoneStruct", referenced from:
      _pybind11_init_impl_test_cmake_build in embed.cpp.o
      pybind11::detail::type_caster<bool, void>& pybind11::detail::load_type<bool, void>(pybind11::detail::type_caster<bool, void>&, pybind11::handle const&) in embed.cpp.o
      pybind11::cpp_function::initialize_generic(std::__1::unique_ptr<pybind11::detail::function_record, pybind11::cpp_function::InitializingFunctionRecordDeleter>&&, char const*, std::type_info const* const*, unsigned long) in embed.cpp.o
      void pybind11::cpp_function::initialize<pybind11::detail::all_type_info_get_cache(_typeobject*)::'lambda'(pybind11::handle), void, pybind11::handle>(pybind11::detail::all_type_info_get_cache(_typeobject*)::'lambda'(pybind11::handle)&&, void (*)(pybind11::handle))::'lambda'(pybind11::detail::function_call&)::__invoke(pybind11::detail::function_call&) in embed.cpp.o
      pybind11::cpp_function::dispatcher(_object*, _object*, _object*) in embed.cpp.o
      pybind11::detail::type_caster<char, void>::cast(char const*, pybind11::return_value_policy, pybind11::handle) in embed.cpp.o
  "__Py_NotImplementedStruct", referenced from:
      pybind11::cpp_function::dispatcher(_object*, _object*, _object*) in embed.cpp.o
  "__Py_TrueStruct", referenced from:
      pybind11::detail::type_caster<bool, void>& pybind11::detail::load_type<bool, void>(pybind11::detail::type_caster<bool, void>&, pybind11::handle const&) in embed.cpp.o
  "__Py_fopen_obj", referenced from:
      pybind11::object pybind11::eval_file<(pybind11::eval_mode)2>(pybind11::str, pybind11::object, pybind11::object) in embed.cpp.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[7]: *** [test_cmake_build] Error 1
make[6]: *** [CMakeFiles/test_subdirectory_embed.dir/all] Error 2
make[5]: *** [CMakeFiles/check_subdirectory_embed.dir/rule] Error 2
make[4]: *** [check_subdirectory_embed] Error 2

make[3]: *** [tests/test_cmake_build/CMakeFiles/test_build_subdirectory_embed] Error 1
make[2]: *** [tests/test_cmake_build/CMakeFiles/test_build_subdirectory_embed.dir/all] Error 2
make[1]: *** [tests/CMakeFiles/check.dir/rule] Error 2
make: *** [check] Error 2

Reproducible example code
# clone the repo
git clone git@github.com:pybind/pybind11.git

# go to that folder
cd pybind11

# make build folder as in docs and go there
mkdir build
cd build

# this is from the docs here
# https://pybind11.readthedocs.io/en/stable/basics.html
cmake ..
make check -j 4
Is this a regression? Put the last known working version here if it is.

Not a regression

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 by reproducing the documented build in a fresh pybind11 checkout with cmake .. followed by make check -j 4 on arm64 macOS. Inspect the failing tests/test_cmake_build target and its subdirectory embed checks, then verify that the complete check target links and runs successfully on that platform.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.