-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Build issue on max OS #2295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is just building pybind11's own tests? I don't see where the error is happening, though. Could you please:
Hopefully that will make things more clear! |
After clear out the build directory and run CMake again, the output is as follows
Then I run make command as follows and get the output:
|
Huh, weird. I still don't see how. But could you now run again without parallelism ( |
|
I can actually reproduce the error. Something weird seems to be going on. I'll get back to you if I figure out more. |
Sounds great. Thank you. |
One step closer: it happens during the Errors are dumped to a file
So for some reason, this test build is running without C++11 support. |
Please let me know if you have any suggestions to fix this. I don't really have any clue about this. |
|
I'm working on it, yes. Just some update on what's going wrong and why there's no output showing the error. |
Yes, but normally, pybind11 sets a minimum standard, no? |
This should fix it: diff --git a/tests/test_cmake_build/CMakeLists.txt b/tests/test_cmake_build/CMakeLists.txt
index c9b5fcb..cf9a9ca 100644
--- a/tests/test_cmake_build/CMakeLists.txt
+++ b/tests/test_cmake_build/CMakeLists.txt
@@ -13,6 +13,7 @@ function(pybind11_add_build_test name)
set(build_options "-DCMAKE_PREFIX_PATH=${PROJECT_BINARY_DIR}/mock_install"
"-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
"-DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE}"
+ "-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}"
"-DPYBIND11_CPP_STANDARD=${PYBIND11_CPP_STANDARD}")
if(NOT ARG_INSTALL)
list(APPEND build_options "-DPYBIND11_PROJECT_DIR=${PROJECT_SOURCE_DIR}") |
What the version of CMake you are using @Jeff-avatar ? It could also be that CMake is a bit old and does not yet use the new logic that sets this automatically: pybind11/tools/pybind11Tools.cmake Lines 21 to 34 in c4fd1fd
|
(This also happens on CMake 3.17 in GHA) |
This really should be done via compile-features, not CMAKE_CXX_STANDARD - you can't actually impose a CXX standard through a target, but you can require compile features. But for now, passing through the variable above fixes this test. |
I managed to reproduce it 1.5 weeks ago, with the latest version of CMake brew had to offer
Huh, wait, why does it not detect In the debug output, from last week, I saw it first being detected and set, then somehow disappear:
|
Yes, I was surprised @chuckatkins did not add compile features in #1428 / #2184 as well, but it could be related to the very old CMake version we are still supporting.
Oh wow, I see. |
That single line does fix it, so ... why not add it, then, I suppose. (EDIT: Still not entirely happy to not understand why it failed before. But then I never perfectly understood parts of CMake...) |
I think the |
It actually does get used, since that's where this
debug output is: diff --git a/tools/pybind11Tools.cmake b/tools/pybind11Tools.cmake
index a3603ab..df15900 100644
--- a/tools/pybind11Tools.cmake
+++ b/tools/pybind11Tools.cmake
@@ -146,7 +146,11 @@ function(pybind11_add_module target_name)
set(exclude_from_all "")
endif()
+message(PYBIND11_CPP_STANDARD=${PYBIND11_CPP_STANDARD})
+message(CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD})
add_library(${target_name} ${lib_type} ${exclude_from_all} ${ARG_UNPARSED_ARGUMENTS})
+get_target_property(TEST ${target_name} CXX_STANDARD)
+message(TEST=${TEST})
if(ARG_SYSTEM)
set(inc_isystem SYSTEM) |
Issue description
I downloaded pybind11 and ran the following steps as mentioned in the document - http://pybind11.readthedocs.io/en/master/basics.html
mkdir build
cd build
cmake ..
make check -j 4
Then I have the following make errors:
Any body has an idea to solve this problem? Thank you very much. I am on a macbook pro with MacOS Catalina Version 10.15.4. And I have python 2.7 and python 3.7 installed on my Mac.
The text was updated successfully, but these errors were encountered: