Opened 3 weeks ago

Last modified 3 weeks ago

#70648 assigned defect

py-contourpy @1.3.0 fails to build: error: 'PYBIND11_MODULE' does not name a type

Reported by: barracuda156 Owned by: reneeotten (Renee Otten)
Priority: Normal Milestone:
Component: ports Version: 2.10.1
Keywords: Cc: stromnov (Andrey Stromnov), MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: py-contourpy, py-pybind11, pybind11

Description

[11/15] /opt/local/bin/g++-mp-14 -Isrc/_contourpy.cpython-311-darwin.so.p -Isrc -I../src -I/include -I/opt/local/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -fvisibility=hidden -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -arch ppc -D_GLIBCXX_USE_CXX11_ABI=0 -isysroot/ -DCONTOURPY_VERSION=1.3.0 -MD -MQ src/_contourpy.cpython-311-darwin.so.p/wrap.cpp.o -MF src/_contourpy.cpython-311-darwin.so.p/wrap.cpp.o.d -o src/_contourpy.cpython-311-darwin.so.p/wrap.cpp.o -c ../src/wrap.cpp
FAILED: src/_contourpy.cpython-311-darwin.so.p/wrap.cpp.o 
/opt/local/bin/g++-mp-14 -Isrc/_contourpy.cpython-311-darwin.so.p -Isrc -I../src -I/include -I/opt/local/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -fvisibility=hidden -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -arch ppc -D_GLIBCXX_USE_CXX11_ABI=0 -isysroot/ -DCONTOURPY_VERSION=1.3.0 -MD -MQ src/_contourpy.cpython-311-darwin.so.p/wrap.cpp.o -MF src/_contourpy.cpython-311-darwin.so.p/wrap.cpp.o.d -o src/_contourpy.cpython-311-darwin.so.p/wrap.cpp.o -c ../src/wrap.cpp
../src/wrap.cpp:21:54: error: macro "PYBIND11_MODULE" passed 3 arguments, but takes just 2
   21 | PYBIND11_MODULE(_contourpy, m, py::mod_gil_not_used()) {
      |                                                      ^
In file included from /opt/local/include/pybind11/attr.h:13,
                 from /opt/local/include/pybind11/detail/class.h:12,
                 from /opt/local/include/pybind11/pybind11.h:13,
                 from ../src/common.h:4,
                 from ../src/output_array.h:4,
                 from ../src/chunk_local.h:4,
                 from ../src/base.h:13,
                 from ../src/base_impl.h:4,
                 from ../src/wrap.cpp:1:
/opt/local/include/pybind11/detail/common.h:467:9: note: macro "PYBIND11_MODULE" defined here
  467 | #define PYBIND11_MODULE(name, variable)                                                           \
      |         ^~~~~~~~~~~~~~~
../src/wrap.cpp:21:1: error: 'PYBIND11_MODULE' does not name a type
   21 | PYBIND11_MODULE(_contourpy, m, py::mod_gil_not_used()) {
      | ^~~~~~~~~~~~~~~
../src/wrap.cpp:19:28: warning: 'mpl20xx_fill_type' defined but not used [-Wunused-variable]
   19 | static contourpy::FillType mpl20xx_fill_type = contourpy::FillType::OuterCode;
      |                            ^~~~~~~~~~~~~~~~~
../src/wrap.cpp:18:28: warning: 'mpl20xx_line_type' defined but not used [-Wunused-variable]
   18 | static contourpy::LineType mpl20xx_line_type = contourpy::LineType::SeparateCode;
      |                            ^~~~~~~~~~~~~~~~~
[12/15] /opt/local/bin/g++-mp-14 -Isrc/_contourpy.cpython-311-darwin.so.p -Isrc -I../src -I/include -I/opt/local/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -fvisibility=hidden -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -arch ppc -D_GLIBCXX_USE_CXX11_ABI=0 -isysroot/ -DCONTOURPY_VERSION=1.3.0 -MD -MQ src/_contourpy.cpython-311-darwin.so.p/util.cpp.o -MF src/_contourpy.cpython-311-darwin.so.p/util.cpp.o.d -o src/_contourpy.cpython-311-darwin.so.p/util.cpp.o -c ../src/util.cpp
[13/15] /opt/local/bin/g++-mp-14 -Isrc/_contourpy.cpython-311-darwin.so.p -Isrc -I../src -I/include -I/opt/local/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -fvisibility=hidden -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -arch ppc -D_GLIBCXX_USE_CXX11_ABI=0 -isysroot/ -DCONTOURPY_VERSION=1.3.0 -MD -MQ src/_contourpy.cpython-311-darwin.so.p/serial.cpp.o -MF src/_contourpy.cpython-311-darwin.so.p/serial.cpp.o.d -o src/_contourpy.cpython-311-darwin.so.p/serial.cpp.o -c ../src/serial.cpp
[14/15] /opt/local/bin/g++-mp-14 -Isrc/_contourpy.cpython-311-darwin.so.p -Isrc -I../src -I/include -I/opt/local/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -fvisibility=hidden -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -arch ppc -D_GLIBCXX_USE_CXX11_ABI=0 -isysroot/ -DCONTOURPY_VERSION=1.3.0 -MD -MQ src/_contourpy.cpython-311-darwin.so.p/threaded.cpp.o -MF src/_contourpy.cpython-311-darwin.so.p/threaded.cpp.o.d -o src/_contourpy.cpython-311-darwin.so.p/threaded.cpp.o -c ../src/threaded.cpp
ninja: build stopped: subcommand failed.

ERROR Backend subprocess exited when trying to invoke build_wheel
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-contourpy/py311-contourpy/work/contourpy-1.3.0" && /opt/local/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11 -m build --no-isolation --wheel --outdir /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-contourpy/py311-contourpy/work 
Exit code: 1

Previous version installed fine.

Attachments (1)

main.log (23.0 KB) - added by barracuda156 3 weeks ago.

Download all attachments as: .zip

Change History (4)

Changed 3 weeks ago by barracuda156

Attachment: main.log added

comment:1 Changed 3 weeks ago by barracuda156

comment:2 Changed 3 weeks ago by barracuda156

Looks like pybind11 was not updated. How was this even supposed to work?

comment:3 in reply to:  2 Changed 3 weeks ago by reneeotten (Renee Otten)

Cc: stromnov MarcusCalhoun-Lopez added
Port: py-pybind11 pybind11 added

Replying to barracuda156:

Looks like pybind11 was not updated. How was this even supposed to work?

You answered your own question in the upstream ticket: there is both a py-pybind11 and pybind11 port (the lattes one uses Python 3.11). Most likely you had the {{{pybind11}} port installed and that caused the confusion of headers.

I see two options:

  1. remove the pybind11 port and migrate dependents to the pyXY-pybind11 (sub)port
  2. do the same thing as for py-meson, meson and have the pybind11 port depend on the subport for MacPorts' default Python versions (i.e., currently py312-pybind11) and create the necessary symlinks

I would be in favor of options 1 given the very few dependents and am willing to look into doing this, unless there are clear objections and/or considerations I am missing.

Note: See TracTickets for help on using tickets.