Skip to content

fix(pybind): nanobind make_iterator compile errors#346

Draft
Copilot wants to merge 16 commits intomainfrom
copilot/upgrade-pybind11-to-nanobind-again
Draft

fix(pybind): nanobind make_iterator compile errors#346
Copilot wants to merge 16 commits intomainfrom
copilot/upgrade-pybind11-to-nanobind-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 2, 2026

All 8 CI wheel builds fail with 'make_iterator' is not a member of 'pyuipc::py' due to incomplete pybind11→nanobind migration.

Two issues:

  • Missing include: nanobind/make_iterator.h is not transitively included by nanobind/nanobind.h — added to span.h and attribute_slot.cpp
  • Wrong call signature: attribute_slot.cpp used pybind11-style make_iterator(first, last) instead of nanobind's make_iterator(scope, name, first, last)
// before (pybind11)
py::make_iterator(v.begin(), v.end())

// after (nanobind)
py::make_iterator(py::type<span<T>>(), "iterator", v.begin(), v.end())

Also includes the prior fix replacing ndarray::operator() with raw pointer arithmetic in affine_body.cpp, since nanobind requires shape<>/ndim<> template annotations for indexed access.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • gitlab.com
    • Triggering command: /usr/local/share/vcpkg/vcpkg /usr/local/share/vcpkg/vcpkg x-download libeigen-eigen-3.4.0.tar.gz --url=REDACTED --sha512=ba75ecb760e32acf4ceaf27115468e65d4f77c44f8d519b5a13e7940af2c03a304ad433368cb6d55431f307c5c39e2666ab41d34442db3cf441638e51f5c3b6a .clean/include /v1.0.2-4c425645-o .clean/src inux-dbg/includeas /usr/local/share-I kg_installed/x64/usr/local/share/vcpkg/buildtrees/cpptrace/src/v1.0.2-4c42564507.clean/include o --64�� .clean/include ees/cpptrace/src-o .clean/src s/cpptrace/x64-lsh -I c/build_test/vcp/usr/local/bin/ninja --version u/13/cc1plus (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 5 commits March 2, 2026 08:37
…bgen

- Replace pybind11 includes with nanobind equivalents across all source files
- Replace PYBIND11_MODULE with NB_MODULE macro
- Replace py::return_value_policy with py::rv_policy
- Remove S<T> holder types from py::class_ declarations (nanobind uses #include <nanobind/stl/shared_ptr.h>)
- Rewrite as_numpy.h for nanobind's ndarray API
- Rewrite json.h type_caster for nanobind's API
- Update pyengine.h trampoline class with NB_TRAMPOLINE/NB_OVERRIDE_PURE
- Update span.h for nanobind's make_iterator API
- Update CMake build files for nanobind
- Update XMake build files for nanobind
- Update stubgen script to use nanobind.stubgen

Co-authored-by: MuGdxy <52098265+MuGdxy@users.noreply.github.com>
- Fix .cast<T>() method calls to py::cast<T>() in utils.cpp and feature_collection.cpp
- Fix py::type parameter to py::handle in feature_collection.cpp
- Replace def_readwrite with def_rw for nanobind compatibility
- Fix make_numpy_empty dtype handling using string literals
- Remove duplicate nanobind include in usd/module.cpp
- Update documentation references from pybind11 to nanobind

Co-authored-by: MuGdxy <52098265+MuGdxy@users.noreply.github.com>
Co-authored-by: MuGdxy <52098265+MuGdxy@users.noreply.github.com>
Co-authored-by: MuGdxy <52098265+MuGdxy@users.noreply.github.com>
Co-authored-by: MuGdxy <52098265+MuGdxy@users.noreply.github.com>
Copilot AI changed the title [WIP] Upgrade Pybind11 to Nanobind with build system changes Upgrade Pybind11 to Nanobind Mar 2, 2026
@MuGdxy
Copy link
Copy Markdown
Member

MuGdxy commented Mar 2, 2026

@copilot fix the CI problem

The previous commit incorrectly replaced .venv/ with
.venv/_codeql_detected_source_root. This fixes it by keeping .venv/
and adding _codeql_detected_source_root as a separate entry.
Also removes the tracked _codeql_detected_source_root symlink.

Co-authored-by: MuGdxy <52098265+MuGdxy@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 2, 2026

@copilot fix the CI problem

Investigated the CI. The initial runs had action_required status (needed approval for bot-authored PRs, not actual build failures). After approval, the builds are now running:

  • ✅ cmake Ubuntu 22.04: passed
  • ✅ xmake Ubuntu 24.04: passed
  • 🔄 cmake Windows 2022: still building (MSVC+CUDA is slow)
  • 🔄 xmake Windows 2025: still building

Note: the pybind module is not built in CI (cmake uses UIPC_BUILD_PYBIND=OFF, xmake doesn't enable --pybind=y), so the nanobind binding changes are not tested in these workflows.

Also fixed a .gitignore corruption from a prior commit in f419d0b - the .venv/ pattern was accidentally overwritten. The latest runs on f419d0b will need approval again from a repo maintainer.

@MuGdxy
Copy link
Copy Markdown
Member

MuGdxy commented Mar 2, 2026

@copilot
Fix the problem.

dylib provides pkg-config modules:

# C++ cross-platform wrapper around dynamic loading of shared libraries
dylib

eigen3 provides CMake targets:

# this is heuristically generated, and may not be correct
find_package(Eigen3 CONFIG REQUIRED)
target_link_libraries(main PRIVATE Eigen3::Eigen)

eigen3 provides pkg-config modules:

# A C++ template library for linear algebra: vectors, matrices, and related algorithms
eigen3

The package fmt provides CMake targets:

  find_package(fmt CONFIG REQUIRED)
  target_link_libraries(main PRIVATE fmt::fmt)

  # Or use the header-only version
  find_package(fmt CONFIG REQUIRED)
  target_link_libraries(main PRIVATE fmt::fmt-header-only)

libigl provides CMake targets:

# this is heuristically generated, and may not be correct
find_package(libigl CONFIG REQUIRED)
target_link_libraries(main PRIVATE igl::igl_core igl_copyleft::igl_copyleft_core)

magic-enum provides CMake targets:

  find_package(magic_enum CONFIG REQUIRED)
  target_link_libraries(main PRIVATE magic_enum::magic_enum)

The package nlohmann-json provides CMake targets:

  find_package(nlohmann_json CONFIG REQUIRED)
  target_link_libraries(main PRIVATE nlohmann_json::nlohmann_json)

The package nlohmann-json can be configured to not provide implicit conversions via a custom triplet file:

  set(nlohmann-json_IMPLICIT_CONVERSIONS OFF)

For more information, see the docs here:

  https://json.nlohmann.me/api/macros/json_use_implicit_conversions/

Octree provides CMake targets:

  find_package(Octree CONFIG REQUIRED)
  target_link_libraries(main PRIVATE Octree::Octree)

The package spdlog provides CMake targets:

  find_package(spdlog CONFIG REQUIRED)
  target_link_libraries(main PRIVATE spdlog::spdlog)

  # Or use the header-only version
  find_package(spdlog CONFIG REQUIRED)
  target_link_libraries(main PRIVATE spdlog::spdlog_header_only)

tbb provides CMake targets:

# this is heuristically generated, and may not be correct
find_package(TBB CONFIG REQUIRED)
target_link_libraries(main PRIVATE TBB::tbb TBB::tbbmalloc)

tbb provides pkg-config modules:

# C++ library for parallel programming on multi-core processors.
tbb

tinygltf is header-only and can be used from CMake via:

find_path(TINYGLTF_INCLUDE_DIRS "tiny_gltf.h")
target_include_directories(main PRIVATE ${TINYGLTF_INCLUDE_DIRS})

urdfdom provides CMake targets:

# this is heuristically generated, and may not be correct
find_package(urdfdom CONFIG REQUIRED)
# note: 1 additional targets are not displayed.
target_link_libraries(main PRIVATE urdfdom::urdf_parser urdfdom::urdfdom_model urdfdom::urdfdom_world urdfdom::urdfdom_sensor)

urdfdom provides pkg-config modules:

# Unified Robot Description Format
urdfdom

Completed submission of console-bridge:x64-linux@1.0.2 to 1 binary cache(s) in 12.4 ms
Waiting for 1 remaining binary cache submissions...
Completed submission of urdfdom:x64-linux@3.1.1 to 1 binary cache(s) in 291 ms (1/1)
All requested installations completed successfully in: 3.1 min
-- Running vcpkg install - done
-- The C compiler identification is GNU 14.2.1
-- The CXX compiler identification is GNU 14.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for execinfo.h
-- Looking for execinfo.h - found
-- Looking for getline
-- Looking for getline - found
-- Looking for regex.h
-- Looking for regex.h - found
-- Performing Test HAVE_TLS
-- Performing Test HAVE_TLS - Success
Submodule 'external/muda' (https://github.com/MuGdxy/muda.git) registered for path 'muda'
Cloning into '/project/external/muda'...
Submodule path 'muda': checked out '09f8a0beca898b5325c7b0c1e4cf67ea4781f3b9'
-- [libuipc] Submodule muda is initialized
-- The CUDA compiler identification is NVIDIA 12.8.93 with host compiler GNU 14.2.1
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Found CUDAToolkit: /usr/local/cuda/targets/x86_64-linux/include (found version "12.8.93")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found nlohmann_json: /tmp/tmpe_yit7v7/build/vcpkg_installed/x64-linux/share/nlohmann_json/nlohmann_jsonConfig.cmake (found version "3.12.0")
-- Found ZLIB: optimized;/tmp/tmpe_yit7v7/build/vcpkg_installed/x64-linux/lib/libz.a;debug;/tmp/tmpe_yit7v7/build/vcpkg_installed/x64-linux/debug/lib/libz.a (found version "1.3.1")
-- [libuipc] Adding backend: [none]
-- [libuipc] CMAKE_CUDA_ARCHITECTURES: 89.
-- [libuipc] Adding backend: [cuda]
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'pip'
-- [libuipc] pip not available, trying ensurepip...
Looking in links: /tmp/tmp8wkitjee
Requirement already satisfied: setuptools in /tmp/build-env-37qmklnt/lib/python3.10/site-packages (82.0.0)
Processing /tmp/tmp8wkitjee/pip-23.0.1-py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-23.0.1
-- [libuipc] Check python module [nanobind] with [/tmp/build-env-37qmklnt/bin/python]
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'nanobind'
-- [libuipc] nanobind not found, try installing nanobind...
Collecting nanobind
Downloading nanobind-2.12.0-py3-none-any.whl (249 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 249.5/249.5 kB 15.5 MB/s eta 0:00:00
Installing collected packages: nanobind
Successfully installed nanobind-2.12.0
-- [libuipc] [nanobind] installed successfully with [/tmp/build-env-37qmklnt/bin/python].
-- [libuipc] Nanobind cmake dir: /tmp/build-env-37qmklnt/lib/python3.10/site-packages/nanobind/cmake
CMake Error at /tmp/build-env-37qmklnt/lib/python3.10/site-packages/nanobind/cmake/nanobind-config.cmake:4 (message):
You must invoke 'find_package(Python COMPONENTS Interpreter Development
REQUIRED)' prior to including nanobind.
Call Stack (most recent call first):
vcpkg/scripts/buildsystems/vcpkg.cmake:908 (_find_package)
src/pybind/CMakeLists.txt:18 (find_package)

-- Configuring incomplete, errors occurred!

*** CMake configuration failed

ERROR Backend subprocess exited when trying to invoke build_wheel

nanobind-config.cmake requires find_package(Python COMPONENTS Interpreter
Development.Module REQUIRED) to be called before find_package(nanobind).
The original pybind11 code used PYBIND11_FINDPYTHON=ON which handled
Python finding internally, but nanobind requires it to be done explicitly.

Co-authored-by: MuGdxy <52098265+MuGdxy@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 2, 2026

@copilot
Fix the problem.

...

The CI failure in the "Build Python Wheels" workflow was caused by a missing find_package(Python) call before find_package(nanobind).

The error was:

CMake Error at nanobind-config.cmake:4 (message):
  You must invoke 'find_package(Python COMPONENTS Interpreter Development
  REQUIRED)' prior to including nanobind.

The original pybind11 code used PYBIND11_FINDPYTHON=ON which handled Python finding internally. Nanobind requires it to be done explicitly.

Fixed in 6181955 by adding find_package(Python COMPONENTS Interpreter Development.Module REQUIRED) before find_package(nanobind) in src/pybind/CMakeLists.txt.

…e conversion

nanobind types (bool_, int_, float_, str, list, tuple, dict) have
explicit constructors unlike pybind11. The MAKE_NLJSON_SERIALIZER_DESERIALIZER
macro's from_json returns py::object which cannot implicitly convert to
these types. Use py::borrow<T>() for the explicit conversion.

Co-authored-by: MuGdxy <52098265+MuGdxy@users.noreply.github.com>
Copilot AI changed the title Upgrade Pybind11 to Nanobind Migrate pybind11 to nanobind Mar 2, 2026
@MuGdxy
Copy link
Copy Markdown
Member

MuGdxy commented Mar 2, 2026

@copilot fix

[443/541] /usr/local/bin/g++ -DCPPTRACE_STATIC_DEFINE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DUIPC_PROJECT_DIR="R"(/project)"" -DUIPC_RUNTIME_CHECK=1 -DUIPC_VERSION_MAJOR=0 -DUIPC_VERSION_MINOR=1 -DUIPC_VERSION_PATCH=0 -Dpyuipc_EXPORTS -DUIPC_RELATIVE_SOURCE_FILE="R"(src/pybind/pyuipc/exception.cpp)"" -I/project/src/pybind/pyuipc/.. -I/opt/python/cp310-cp310/include/python3.10 -I/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include -I/project/include -I/project/src/sanity_check -isystem /tmp/tmp4p_ir4hl/build/vcpkg_installed/x64-linux/include/eigen3 -isystem /tmp/tmp4p_ir4hl/build/vcpkg_installed/x64-linux/include -O3 -DNDEBUG -std=gnu++20 -fPIC -fvisibility=hidden -fno-stack-protector -Os -ffunction-sections -fdata-sections -MD -MT src/pybind/pyuipc/CMakeFiles/pyuipc.dir/exception.cpp.o -MF src/pybind/pyuipc/CMakeFiles/pyuipc.dir/exception.cpp.o.d -o src/pybind/pyuipc/CMakeFiles/pyuipc.dir/exception.cpp.o -c /project/src/pybind/pyuipc/exception.cpp
[444/541] /usr/local/bin/g++ -DCPPTRACE_STATIC_DEFINE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DUIPC_PROJECT_DIR="R"(/project)"" -DUIPC_RUNTIME_CHECK=1 -DUIPC_VERSION_MAJOR=0 -DUIPC_VERSION_MINOR=1 -DUIPC_VERSION_PATCH=0 -Dpyuipc_EXPORTS -DUIPC_RELATIVE_SOURCE_FILE="R"(src/pybind/pyuipc/pyuipc.cpp)"" -I/project/src/pybind/pyuipc/.. -I/opt/python/cp310-cp310/include/python3.10 -I/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include -I/project/include -I/project/src/sanity_check -isystem /tmp/tmp4p_ir4hl/build/vcpkg_installed/x64-linux/include/eigen3 -isystem /tmp/tmp4p_ir4hl/build/vcpkg_installed/x64-linux/include -O3 -DNDEBUG -std=gnu++20 -fPIC -fvisibility=hidden -fno-stack-protector -Os -ffunction-sections -fdata-sections -MD -MT src/pybind/pyuipc/CMakeFiles/pyuipc.dir/pyuipc.cpp.o -MF src/pybind/pyuipc/CMakeFiles/pyuipc.dir/pyuipc.cpp.o.d -o src/pybind/pyuipc/CMakeFiles/pyuipc.dir/pyuipc.cpp.o -c /project/src/pybind/pyuipc/pyuipc.cpp
[445/541] /usr/local/bin/g++ -DCPPTRACE_STATIC_DEFINE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DUIPC_PROJECT_DIR="R"(/project)"" -DUIPC_RUNTIME_CHECK=1 -DUIPC_VERSION_MAJOR=0 -DUIPC_VERSION_MINOR=1 -DUIPC_VERSION_PATCH=0 -Dpyuipc_EXPORTS -DUIPC_RELATIVE_SOURCE_FILE="R"(src/pybind/pyuipc/module.cpp)"" -I/project/src/pybind/pyuipc/.. -I/opt/python/cp310-cp310/include/python3.10 -I/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include -I/project/include -I/project/src/sanity_check -isystem /tmp/tmp4p_ir4hl/build/vcpkg_installed/x64-linux/include/eigen3 -isystem /tmp/tmp4p_ir4hl/build/vcpkg_installed/x64-linux/include -O3 -DNDEBUG -std=gnu++20 -fPIC -fvisibility=hidden -fno-stack-protector -Os -ffunction-sections -fdata-sections -MD -MT src/pybind/pyuipc/CMakeFiles/pyuipc.dir/module.cpp.o -MF src/pybind/pyuipc/CMakeFiles/pyuipc.dir/module.cpp.o.d -o src/pybind/pyuipc/CMakeFiles/pyuipc.dir/module.cpp.o -c /project/src/pybind/pyuipc/module.cpp
[446/541] /usr/local/bin/g++ -DCPPTRACE_STATIC_DEFINE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DUIPC_PROJECT_DIR="R"(/project)"" -DUIPC_RUNTIME_CHECK=1 -DUIPC_VERSION_MAJOR=0 -DUIPC_VERSION_MINOR=1 -DUIPC_VERSION_PATCH=0 -Dpyuipc_EXPORTS -DUIPC_RELATIVE_SOURCE_FILE="R"(src/pybind/pyuipc/common/logger.cpp)"" -I/project/src/pybind/pyuipc/.. -I/opt/python/cp310-cp310/include/python3.10 -I/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include -I/project/include -I/project/src/sanity_check -isystem /tmp/tmp4p_ir4hl/build/vcpkg_installed/x64-linux/include/eigen3 -isystem /tmp/tmp4p_ir4hl/build/vcpkg_installed/x64-linux/include -O3 -DNDEBUG -std=gnu++20 -fPIC -fvisibility=hidden -fno-stack-protector -Os -ffunction-sections -fdata-sections -MD -MT src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/logger.cpp.o -MF src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/logger.cpp.o.d -o src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/logger.cpp.o -c /project/src/pybind/pyuipc/common/logger.cpp
[447/541] /usr/local/bin/g++ -DCPPTRACE_STATIC_DEFINE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DUIPC_PROJECT_DIR="R"(/project)"" -DUIPC_RUNTIME_CHECK=1 -DUIPC_VERSION_MAJOR=0 -DUIPC_VERSION_MINOR=1 -DUIPC_VERSION_PATCH=0 -Dpyuipc_EXPORTS -DUIPC_RELATIVE_SOURCE_FILE="R"(src/pybind/pyuipc/common/resident_thread.cpp)"" -I/project/src/pybind/pyuipc/.. -I/opt/python/cp310-cp310/include/python3.10 -I/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include -I/project/include -I/project/src/sanity_check -isystem /tmp/tmp4p_ir4hl/build/vcpkg_installed/x64-linux/include/eigen3 -isystem /tmp/tmp4p_ir4hl/build/vcpkg_installed/x64-linux/include -O3 -DNDEBUG -std=gnu++20 -fPIC -fvisibility=hidden -fno-stack-protector -Os -ffunction-sections -fdata-sections -MD -MT src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/resident_thread.cpp.o -MF src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/resident_thread.cpp.o.d -o src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/resident_thread.cpp.o -c /project/src/pybind/pyuipc/common/resident_thread.cpp
[448/541] /usr/local/bin/g++ -DCPPTRACE_STATIC_DEFINE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DUIPC_PROJECT_DIR="R"(/project)"" -DUIPC_RUNTIME_CHECK=1 -DUIPC_VERSION_MAJOR=0 -DUIPC_VERSION_MINOR=1 -DUIPC_VERSION_PATCH=0 -Dpyuipc_EXPORTS -DUIPC_RELATIVE_SOURCE_FILE="R"(src/pybind/pyuipc/common/timer.cpp)"" -I/project/src/pybind/pyuipc/.. -I/opt/python/cp310-cp310/include/python3.10 -I/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include -I/project/include -I/project/src/sanity_check -isystem /tmp/tmp4p_ir4hl/build/vcpkg_installed/x64-linux/include/eigen3 -isystem /tmp/tmp4p_ir4hl/build/vcpkg_installed/x64-linux/include -O3 -DNDEBUG -std=gnu++20 -fPIC -fvisibility=hidden -fno-stack-protector -Os -ffunction-sections -fdata-sections -MD -MT src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/timer.cpp.o -MF src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/timer.cpp.o.d -o src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/timer.cpp.o -c /project/src/pybind/pyuipc/common/timer.cpp
[449/541] /usr/local/bin/g++ -DCPPTRACE_STATIC_DEFINE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DUIPC_PROJECT_DIR="R"(/project)"" -DUIPC_RUNTIME_CHECK=1 -DUIPC_VERSION_MAJOR=0 -DUIPC_VERSION_MINOR=1 -DUIPC_VERSION_PATCH=0 -Dpyuipc_EXPORTS -DUIPC_RELATIVE_SOURCE_FILE="R"(src/pybind/pyuipc/common/transform.cpp)"" -I/project/src/pybind/pyuipc/.. -I/opt/python/cp310-cp310/include/python3.10 -I/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include -I/project/include -I/project/src/sanity_check -isystem /tmp/tmp4p_ir4hl/build/vcpkg_installed/x64-linux/include/eigen3 -isystem /tmp/tmp4p_ir4hl/build/vcpkg_installed/x64-linux/include -O3 -DNDEBUG -std=gnu++20 -fPIC -fvisibility=hidden -fno-stack-protector -Os -ffunction-sections -fdata-sections -MD -MT src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/transform.cpp.o -MF src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/transform.cpp.o.d -o src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/transform.cpp.o -c /project/src/pybind/pyuipc/common/transform.cpp
FAILED: [code=1] src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/transform.cpp.o
/usr/local/bin/g++ -DCPPTRACE_STATIC_DEFINE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DUIPC_PROJECT_DIR="R"(/project)"" -DUIPC_RUNTIME_CHECK=1 -DUIPC_VERSION_MAJOR=0 -DUIPC_VERSION_MINOR=1 -DUIPC_VERSION_PATCH=0 -Dpyuipc_EXPORTS -DUIPC_RELATIVE_SOURCE_FILE="R"(src/pybind/pyuipc/common/transform.cpp)"" -I/project/src/pybind/pyuipc/.. -I/opt/python/cp310-cp310/include/python3.10 -I/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include -I/project/include -I/project/src/sanity_check -isystem /tmp/tmp4p_ir4hl/build/vcpkg_installed/x64-linux/include/eigen3 -isystem /tmp/tmp4p_ir4hl/build/vcpkg_installed/x64-linux/include -O3 -DNDEBUG -std=gnu++20 -fPIC -fvisibility=hidden -fno-stack-protector -Os -ffunction-sections -fdata-sections -MD -MT src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/transform.cpp.o -MF src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/transform.cpp.o.d -o src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/transform.cpp.o -c /project/src/pybind/pyuipc/common/transform.cpp
/project/src/pybind/pyuipc/common/transform.cpp: In constructor ‘pyuipc::PyTransform::PyTransform(nanobind::module_&)’:
/project/src/pybind/pyuipc/common/transform.cpp:30:31: error: no matching function for call to ‘nanobind::init<>::init(pyuipc::PyTransform::PyTransform(nanobind::module_&)::<lambda(pyuipc::numpy_array)>)’
30 | }),
| ^
In file included from /tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nanobind.h:61,
from /project/src/pybind/pyuipc/../pyuipc/pyuipc.h:2,
from /project/src/pybind/pyuipc/../pyuipc/common/transform.h:2,
from /project/src/pybind/pyuipc/common/transform.cpp:1:
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:350:15: note: candidate: ‘nanobind::init::init() [with Args = {}]’
350 | NB_INLINE init() {}
| ^~~~
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:350:15: note: candidate expects 0 arguments, 1 provided
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: candidate: ‘constexpr nanobind::init<>::init(const nanobind::init<>&)’
348 | template <typename... Args> struct init : def_visitor<init<Args...>> {
| ^~~~
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: no known conversion for argument 1 from ‘pyuipc::PyTransform::PyTransform(nanobind::module_&)::<lambda(pyuipc::numpy_array)>’ to ‘const nanobind::init<>&’
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: candidate: ‘constexpr nanobind::init<>::init(nanobind::init<>&&)’
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: no known conversion for argument 1 from ‘pyuipc::PyTransform::PyTransform(nanobind::module_&)::<lambda(pyuipc::numpy_array)>’ to ‘nanobind::init<>&&’
/project/src/pybind/pyuipc/common/transform.cpp:72:63: error: no matching function for call to ‘nanobind::init<>::init(pyuipc::PyTransform::PyTransform(nanobind::module_&)::<lambda(const AngleAxis&)>)’
72 | { return Quaternion(ax); }),
| ^
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:350:15: note: candidate: ‘nanobind::init::init() [with Args = {}]’
350 | NB_INLINE init() {}
| ^~~~
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:350:15: note: candidate expects 0 arguments, 1 provided
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: candidate: ‘constexpr nanobind::init<>::init(const nanobind::init<>&)’
348 | template <typename... Args> struct init : def_visitor<init<Args...>> {
| ^~~~
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: no known conversion for argument 1 from ‘pyuipc::PyTransform::PyTransform(nanobind::module_&)::<lambda(const AngleAxis&)>’ to ‘const nanobind::init<>&’
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: candidate: ‘constexpr nanobind::init<>::init(nanobind::init<>&&)’
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: no known conversion for argument 1 from ‘pyuipc::PyTransform::PyTransform(nanobind::module_&)::<lambda(const AngleAxis&)>’ to ‘nanobind::init<>&&’
/project/src/pybind/pyuipc/common/transform.cpp:91:30: error: no matching function for call to ‘nanobind::init<>::init(pyuipc::PyTransform::PyTransform(nanobind::module_&)::<lambda(uipc::Float, pyuipc::numpy_array)>)’
91 | }),
| ^
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:350:15: note: candidate: ‘nanobind::init::init() [with Args = {}]’
350 | NB_INLINE init() {}
| ^~~~
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:350:15: note: candidate expects 0 arguments, 1 provided
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: candidate: ‘constexpr nanobind::init<>::init(const nanobind::init<>&)’
348 | template <typename... Args> struct init : def_visitor<init<Args...>> {
| ^~~~
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: no known conversion for argument 1 from ‘pyuipc::PyTransform::PyTransform(nanobind::module_&)::<lambda(uipc::Float, pyuipc::numpy_array)>’ to ‘const nanobind::init<>&’
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: candidate: ‘constexpr nanobind::init<>::init(nanobind::init<>&&)’
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: no known conversion for argument 1 from ‘pyuipc::PyTransform::PyTransform(nanobind::module_&)::<lambda(uipc::Float, pyuipc::numpy_array)>’ to ‘nanobind::init<>&&’
/project/src/pybind/pyuipc/common/transform.cpp:100:60: error: no matching function for call to ‘nanobind::init<>::init(pyuipc::PyTransform::PyTransform(nanobind::module_&)::<lambda(const Quaternion&)>)’
100 | { return AngleAxis(q); }),
| ^
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:350:15: note: candidate: ‘nanobind::init::init() [with Args = {}]’
350 | NB_INLINE init() {}
| ^~~~
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:350:15: note: candidate expects 0 arguments, 1 provided
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: candidate: ‘constexpr nanobind::init<>::init(const nanobind::init<>&)’
348 | template <typename... Args> struct init : def_visitor<init<Args...>> {
| ^~~~
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: no known conversion for argument 1 from ‘pyuipc::PyTransform::PyTransform(nanobind::module_&)::<lambda(const Quaternion&)>’ to ‘const nanobind::init<>&’
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: candidate: ‘constexpr nanobind::init<>::init(nanobind::init<>&&)’
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: no known conversion for argument 1 from ‘pyuipc::PyTransform::PyTransform(nanobind::module_&)::<lambda(const Quaternion&)>’ to ‘nanobind::init<>&&’
/project/src/pybind/pyuipc/common/transform.cpp:179:30: error: no matching function for call to ‘nanobind::init<>::init(pyuipc::PyTransform::PyTransform(nanobind::module_&)::<lambda(pyuipc::numpy_array)>)’
179 | }),
| ^
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:350:15: note: candidate: ‘nanobind::init::init() [with Args = {}]’
350 | NB_INLINE init() {}
| ^~~~
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:350:15: note: candidate expects 0 arguments, 1 provided
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: candidate: ‘constexpr nanobind::init<>::init(const nanobind::init<>&)’
348 | template <typename... Args> struct init : def_visitor<init<Args...>> {
| ^~~~
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: no known conversion for argument 1 from ‘pyuipc::PyTransform::PyTransform(nanobind::module_&)::<lambda(pyuipc::numpy_array)>’ to ‘const nanobind::init<>&’
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: candidate: ‘constexpr nanobind::init<>::init(nanobind::init<>&&)’
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: no known conversion for argument 1 from ‘pyuipc::PyTransform::PyTransform(nanobind::module_&)::<lambda(pyuipc::numpy_array)>’ to ‘nanobind::init<>&&’
In file included from /project/src/pybind/pyuipc/../pyuipc/as_numpy.h:4,
from /project/src/pybind/pyuipc/../pyuipc/pyuipc.h:9:
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/ndarray.h: In instantiation of ‘int64_t nanobind::ndarray::byte_offset(Args2 ...) const [with Args2 = {int, int}; Args = {nanobind::numpy, double}; int64_t = long int]’:
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/ndarray.h:457:40: required from ‘auto& nanobind::ndarray::operator()(Args2 ...) const [with Args2 = {int, int}; Args = {nanobind::numpy, double}]’
457 | byte_offset(indices...));
| ~~~~~~~~~~~^~~~~~~~~~~~
/project/src/pybind/pyuipc/../pyuipc/as_numpy.h:324:30: required from ‘MatrixT pyuipc::to_matrix(numpy_array) requires requires(MatrixT) {(MatrixT::RowsAtCompileTime) > 0;(MatrixT::ColsAtCompileTime) > 0;} [with MatrixT = Eigen::Matrix<double, 4, 1>; numpy_array = nanobind::ndarray<nanobind::numpy, double>; typename MatrixT::Scalar = double]’
324 | m(i, j) = arr(i, j);
| ~~~^~~~~~
/project/src/pybind/pyuipc/common/transform.cpp:28:65: required from here
28 | Vector4 v4 = to_matrix(wxyz);
| ~~~~~~~~~~~~~~~~~~^~~~~~
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/ndarray.h:501:23: error: static assertion failed: To use ndarray::operator(), you must add a shape<> or ndim<> annotation to the ndarray template parameters.
501 | static_assert(has_shape,
| ^~~~~~~~~
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/ndarray.h:501:23: note: ‘has_shape’ evaluates to false
[450/541] /usr/local/bin/g++ -DCPPTRACE_STATIC_DEFINE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DUIPC_PROJECT_DIR="R"(/project)"" -DUIPC_RUNTIME_CHECK=1 -DUIPC_VERSION_MAJOR=0 -DUIPC_VERSION_MINOR=1 -DUIPC_VERSION_PATCH=0 -Dpyuipc_EXPORTS -DUIPC_RELATIVE_SOURCE_FILE="R"(src/pybind/pyuipc/common/uipc_type.cpp)"" -I/project/src/pybind/pyuipc/.. -I/opt/python/cp310-cp310/include/python3.10 -I/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include -I/project/include -I/project/src/sanity_check -isystem /tmp/tmp4p_ir4hl/build/vcpkg_installed/x64-linux/include/eigen3 -isystem /tmp/tmp4p_ir4hl/build/vcpkg_installed/x64-linux/include -O3 -DNDEBUG -std=gnu++20 -fPIC -fvisibility=hidden -fno-stack-protector -Os -ffunction-sections -fdata-sections -MD -MT src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/uipc_type.cpp.o -MF src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/uipc_type.cpp.o.d -o src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/uipc_type.cpp.o -c /project/src/pybind/pyuipc/common/uipc_type.cpp
FAILED: [code=1] src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/uipc_type.cpp.o
/usr/local/bin/g++ -DCPPTRACE_STATIC_DEFINE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DUIPC_PROJECT_DIR="R"(/project)"" -DUIPC_RUNTIME_CHECK=1 -DUIPC_VERSION_MAJOR=0 -DUIPC_VERSION_MINOR=1 -DUIPC_VERSION_PATCH=0 -Dpyuipc_EXPORTS -DUIPC_RELATIVE_SOURCE_FILE="R"(src/pybind/pyuipc/common/uipc_type.cpp)"" -I/project/src/pybind/pyuipc/.. -I/opt/python/cp310-cp310/include/python3.10 -I/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include -I/project/include -I/project/src/sanity_check -isystem /tmp/tmp4p_ir4hl/build/vcpkg_installed/x64-linux/include/eigen3 -isystem /tmp/tmp4p_ir4hl/build/vcpkg_installed/x64-linux/include -O3 -DNDEBUG -std=gnu++20 -fPIC -fvisibility=hidden -fno-stack-protector -Os -ffunction-sections -fdata-sections -MD -MT src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/uipc_type.cpp.o -MF src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/uipc_type.cpp.o.d -o src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/uipc_type.cpp.o -c /project/src/pybind/pyuipc/common/uipc_type.cpp
In file included from /project/src/pybind/pyuipc/../pyuipc/as_numpy.h:4,
from /project/src/pybind/pyuipc/../pyuipc/pyuipc.h:9,
from /project/src/pybind/pyuipc/../pyuipc/common/uipc_type.h:2,
from /project/src/pybind/pyuipc/common/uipc_type.cpp:1:
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/ndarray.h: In instantiation of ‘int64_t nanobind::ndarray::byte_offset(Args2 ...) const [with Args2 = {int, int}; Args = {nanobind::numpy, double}; int64_t = long int]’:
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/ndarray.h:457:40: required from ‘auto& nanobind::ndarray::operator()(Args2 ...) const [with Args2 = {int, int}; Args = {nanobind::numpy, double}]’
457 | byte_offset(indices...));
| ~~~~~~~~~~~^~~~~~~~~~~~
/project/src/pybind/pyuipc/../pyuipc/as_numpy.h:324:30: required from ‘MatrixT pyuipc::to_matrix(numpy_array) requires requires(MatrixT) {(MatrixT::RowsAtCompileTime) > 0;(MatrixT::ColsAtCompileTime) > 0;} [with MatrixT = Eigen::Matrix<double, 2, 1>; numpy_array = nanobind::ndarray<nanobind::numpy, double>; typename MatrixT::Scalar = double]’
324 | m(i, j) = arr(i, j);
| ~~~^~~~~~
/project/src/pybind/pyuipc/common/uipc_type.cpp:144:60: required from ‘void pyuipc::def_matrix(nanobind::module_&, Eigen::Matrix<T, M, N>, const char*) [with T = double; int M = 2; int N = 1]’
144 | { return as_numpy(to_matrix<Eigen::Matrix<T, M, N>>(value)); },
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/project/src/pybind/pyuipc/common/uipc_type.cpp:301:5: required from here
288 | #define DEF_MATRIX(Type) def_matrix(m, Type{}, #Type)
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/ndarray.h:501:23: error: static assertion failed: To use ndarray::operator(), you must add a shape<> or ndim<> annotation to the ndarray template parameters.
501 | static_assert(has_shape,
| ^~~~~~~~~
/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include/nanobind/ndarray.h:501:23: note: ‘has_shape’ evaluates to false
[451/541] /usr/local/bin/g++ -DCPPTRACE_STATIC_DEFINE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DUIPC_PROJECT_DIR="R"(/project)"" -DUIPC_RUNTIME_CHECK=1 -DUIPC_VERSION_MAJOR=0 -DUIPC_VERSION_MINOR=1 -DUIPC_VERSION_PATCH=0 -Dpyuipc_EXPORTS -DUIPC_RELATIVE_SOURCE_FILE="R"(src/pybind/pyuipc/common/unit.cpp)"" -I/project/src/pybind/pyuipc/.. -I/opt/python/cp310-cp310/include/python3.10 -I/tmp/build-env-yn72o_gg/lib/python3.10/site-packages/nanobind/include -I/project/include -I/project/src/sanity_check -isystem /tmp/tmp4p_ir4hl/build/vcpkg_installed/x64-linux/include/eigen3 -isystem /tmp/tmp4p_ir4hl/build/vcpkg_installed/x64-linux/include -O3 -DNDEBUG -std=gnu++20 -fPIC -fvisibility=hidden -fno-stack-protector -Os -ffunction-sections -fdata-sections -MD -MT src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/unit.cpp.o -MF src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/unit.cpp.o.d -o src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/unit.cpp.o -c /project/src/pybind/pyuipc/common/unit.cpp
ninja: build stopped: subcommand failed.

*** CMake build failed

ERROR Backend subprocess exited when trying to invoke build_wheel

Two compilation fixes:
1. as_numpy.h: Replace arr(i,j) with raw pointer access since nanobind
   ndarray::operator() requires shape<>/ndim<> annotations.
2. transform.cpp, simplicial_complex_io.cpp: Change py::init<>(lambda)
   to py::init(lambda) - nanobind factory init uses py::init() without
   empty template args (py::init<>() is only for default constructors).

Co-authored-by: MuGdxy <52098265+MuGdxy@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 2, 2026

@copilot fix

[443/541] /usr/local/bin/g++ -DCPPTRACE_STATIC_DEFINE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DUIPC_PROJECT_DIR="R"(/project)"" -DUIPC_RUNTIME_CHECK=1 -DUIPC_V...

Fixed in d969f1f. Two compilation errors:

  1. as_numpy.h: nanobind's ndarray::operator() requires shape<> or ndim<> template annotation. Replaced arr(i, j) with raw data pointer access data[i * Cols + j].

  2. transform.cpp + simplicial_complex_io.cpp: nanobind's py::init<>() with empty template args is for default constructors only. Factory init with lambdas needs py::init(lambda) without the <>.

@MuGdxy
Copy link
Copy Markdown
Member

MuGdxy commented Mar 2, 2026

@copilot fix it

[445/541] /usr/local/bin/g++ -DCPPTRACE_STATIC_DEFINE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DUIPC_PROJECT_DIR="R"(/project)"" -DUIPC_RUNTIME_CHECK=1 -DUIPC_VERSION_MAJOR=0 -DUIPC_VERSION_MINOR=1 -DUIPC_VERSION_PATCH=0 -Dpyuipc_EXPORTS -DUIPC_RELATIVE_SOURCE_FILE="R"(src/pybind/pyuipc/pyuipc.cpp)"" -I/project/src/pybind/pyuipc/.. -I/opt/python/cp313-cp313/include/python3.13 -I/tmp/build-env-_0yot813/lib/python3.13/site-packages/nanobind/include -I/project/include -I/project/src/sanity_check -isystem /tmp/tmpecslhels/build/vcpkg_installed/x64-linux/include/eigen3 -isystem /tmp/tmpecslhels/build/vcpkg_installed/x64-linux/include -O3 -DNDEBUG -std=gnu++20 -fPIC -fvisibility=hidden -fno-stack-protector -Os -ffunction-sections -fdata-sections -MD -MT src/pybind/pyuipc/CMakeFiles/pyuipc.dir/pyuipc.cpp.o -MF src/pybind/pyuipc/CMakeFiles/pyuipc.dir/pyuipc.cpp.o.d -o src/pybind/pyuipc/CMakeFiles/pyuipc.dir/pyuipc.cpp.o -c /project/src/pybind/pyuipc/pyuipc.cpp
[446/541] /usr/local/bin/g++ -DCPPTRACE_STATIC_DEFINE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DUIPC_PROJECT_DIR="R"(/project)"" -DUIPC_RUNTIME_CHECK=1 -DUIPC_VERSION_MAJOR=0 -DUIPC_VERSION_MINOR=1 -DUIPC_VERSION_PATCH=0 -Dpyuipc_EXPORTS -DUIPC_RELATIVE_SOURCE_FILE="R"(src/pybind/pyuipc/module.cpp)"" -I/project/src/pybind/pyuipc/.. -I/opt/python/cp313-cp313/include/python3.13 -I/tmp/build-env-_0yot813/lib/python3.13/site-packages/nanobind/include -I/project/include -I/project/src/sanity_check -isystem /tmp/tmpecslhels/build/vcpkg_installed/x64-linux/include/eigen3 -isystem /tmp/tmpecslhels/build/vcpkg_installed/x64-linux/include -O3 -DNDEBUG -std=gnu++20 -fPIC -fvisibility=hidden -fno-stack-protector -Os -ffunction-sections -fdata-sections -MD -MT src/pybind/pyuipc/CMakeFiles/pyuipc.dir/module.cpp.o -MF src/pybind/pyuipc/CMakeFiles/pyuipc.dir/module.cpp.o.d -o src/pybind/pyuipc/CMakeFiles/pyuipc.dir/module.cpp.o -c /project/src/pybind/pyuipc/module.cpp
[447/541] /usr/local/bin/g++ -DCPPTRACE_STATIC_DEFINE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DUIPC_PROJECT_DIR="R"(/project)"" -DUIPC_RUNTIME_CHECK=1 -DUIPC_VERSION_MAJOR=0 -DUIPC_VERSION_MINOR=1 -DUIPC_VERSION_PATCH=0 -Dpyuipc_EXPORTS -DUIPC_RELATIVE_SOURCE_FILE="R"(src/pybind/pyuipc/common/resident_thread.cpp)"" -I/project/src/pybind/pyuipc/.. -I/opt/python/cp313-cp313/include/python3.13 -I/tmp/build-env-_0yot813/lib/python3.13/site-packages/nanobind/include -I/project/include -I/project/src/sanity_check -isystem /tmp/tmpecslhels/build/vcpkg_installed/x64-linux/include/eigen3 -isystem /tmp/tmpecslhels/build/vcpkg_installed/x64-linux/include -O3 -DNDEBUG -std=gnu++20 -fPIC -fvisibility=hidden -fno-stack-protector -Os -ffunction-sections -fdata-sections -MD -MT src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/resident_thread.cpp.o -MF src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/resident_thread.cpp.o.d -o src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/resident_thread.cpp.o -c /project/src/pybind/pyuipc/common/resident_thread.cpp
[448/541] /usr/local/bin/g++ -DCPPTRACE_STATIC_DEFINE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DUIPC_PROJECT_DIR="R"(/project)"" -DUIPC_RUNTIME_CHECK=1 -DUIPC_VERSION_MAJOR=0 -DUIPC_VERSION_MINOR=1 -DUIPC_VERSION_PATCH=0 -Dpyuipc_EXPORTS -DUIPC_RELATIVE_SOURCE_FILE="R"(src/pybind/pyuipc/common/timer.cpp)"" -I/project/src/pybind/pyuipc/.. -I/opt/python/cp313-cp313/include/python3.13 -I/tmp/build-env-_0yot813/lib/python3.13/site-packages/nanobind/include -I/project/include -I/project/src/sanity_check -isystem /tmp/tmpecslhels/build/vcpkg_installed/x64-linux/include/eigen3 -isystem /tmp/tmpecslhels/build/vcpkg_installed/x64-linux/include -O3 -DNDEBUG -std=gnu++20 -fPIC -fvisibility=hidden -fno-stack-protector -Os -ffunction-sections -fdata-sections -MD -MT src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/timer.cpp.o -MF src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/timer.cpp.o.d -o src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/timer.cpp.o -c /project/src/pybind/pyuipc/common/timer.cpp
[449/541] /usr/local/bin/g++ -DCPPTRACE_STATIC_DEFINE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DUIPC_PROJECT_DIR="R"(/project)"" -DUIPC_RUNTIME_CHECK=1 -DUIPC_VERSION_MAJOR=0 -DUIPC_VERSION_MINOR=1 -DUIPC_VERSION_PATCH=0 -Dpyuipc_EXPORTS -DUIPC_RELATIVE_SOURCE_FILE="R"(src/pybind/pyuipc/common/transform.cpp)"" -I/project/src/pybind/pyuipc/.. -I/opt/python/cp313-cp313/include/python3.13 -I/tmp/build-env-0yot813/lib/python3.13/site-packages/nanobind/include -I/project/include -I/project/src/sanity_check -isystem /tmp/tmpecslhels/build/vcpkg_installed/x64-linux/include/eigen3 -isystem /tmp/tmpecslhels/build/vcpkg_installed/x64-linux/include -O3 -DNDEBUG -std=gnu++20 -fPIC -fvisibility=hidden -fno-stack-protector -Os -ffunction-sections -fdata-sections -MD -MT src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/transform.cpp.o -MF src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/transform.cpp.o.d -o src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/transform.cpp.o -c /project/src/pybind/pyuipc/common/transform.cpp
FAILED: [code=1] src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/transform.cpp.o
/usr/local/bin/g++ -DCPPTRACE_STATIC_DEFINE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DUIPC_PROJECT_DIR="R"(/project)"" -DUIPC_RUNTIME_CHECK=1 -DUIPC_VERSION_MAJOR=0 -DUIPC_VERSION_MINOR=1 -DUIPC_VERSION_PATCH=0 -Dpyuipc_EXPORTS -DUIPC_RELATIVE_SOURCE_FILE="R"(src/pybind/pyuipc/common/transform.cpp)"" -I/project/src/pybind/pyuipc/.. -I/opt/python/cp313-cp313/include/python3.13 -I/tmp/build-env-0yot813/lib/python3.13/site-packages/nanobind/include -I/project/include -I/project/src/sanity_check -isystem /tmp/tmpecslhels/build/vcpkg_installed/x64-linux/include/eigen3 -isystem /tmp/tmpecslhels/build/vcpkg_installed/x64-linux/include -O3 -DNDEBUG -std=gnu++20 -fPIC -fvisibility=hidden -fno-stack-protector -Os -ffunction-sections -fdata-sections -MD -MT src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/transform.cpp.o -MF src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/transform.cpp.o.d -o src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/transform.cpp.o -c /project/src/pybind/pyuipc/common/transform.cpp
/project/src/pybind/pyuipc/common/transform.cpp: In constructor ‘pyuipc::PyTransform::PyTransform(nanobind::module
&)’:
/project/src/pybind/pyuipc/common/transform.cpp:30:31: error: class template argument deduction failed:
30 | }),
| ^
/project/src/pybind/pyuipc/common/transform.cpp:30:31: error: no matching function for call to ‘init(pyuipc::PyTransform::PyTransform(nanobind::module
&)::<lambda(pyuipc::numpy_array)>)’
In file included from /tmp/build-env-_0yot813/lib/python3.13/site-packages/nanobind/include/nanobind/nanobind.h:61,
from /project/src/pybind/pyuipc/../pyuipc/pyuipc.h:2,
from /project/src/pybind/pyuipc/../pyuipc/common/transform.h:2,
from /project/src/pybind/pyuipc/common/transform.cpp:1:
/tmp/build-env-_0yot813/lib/python3.13/site-packages/nanobind/include/nanobind/nb_class.h:350:15: note: candidate: ‘template<class ... Args> init()-> nanobind::init’
350 | NB_INLINE init() {}
| ^~~~
/tmp/build-env-_0yot813/lib/python3.13/site-packages/nanobind/include/nanobind/nb_class.h:350:15: note: candidate expects 0 arguments, 1 provided
/tmp/build-env-0yot813/lib/python3.13/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: candidate: ‘template<class ... Args> init(nanobind::init)-> nanobind::init’
348 | template <typename... Args> struct init : def_visitor<init<Args...>> {
| ^~~~
/tmp/build-env-0yot813/lib/python3.13/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: template argument deduction/substitution failed:
/project/src/pybind/pyuipc/common/transform.cpp:30:31: note: ‘pyuipc::PyTransform::PyTransform(nanobind::module
&)::<lambda(pyuipc::numpy_array)>’ is not derived from ‘nanobind::init’
30 | }),
| ^
/project/src/pybind/pyuipc/common/transform.cpp:72:63: error: class template argument deduction failed:
72 | { return Quaternion(ax); }),
| ^
/project/src/pybind/pyuipc/common/transform.cpp:72:63: error: no matching function for call to ‘init(pyuipc::PyTransform::PyTransform(nanobind::module
&)::<lambda(const AngleAxis&)>)’
/tmp/build-env-_0yot813/lib/python3.13/site-packages/nanobind/include/nanobind/nb_class.h:350:15: note: candidate: ‘template<class ... Args> init()-> nanobind::init’
350 | NB_INLINE init() {}
| ^~~~
/tmp/build-env-_0yot813/lib/python3.13/site-packages/nanobind/include/nanobind/nb_class.h:350:15: note: candidate expects 0 arguments, 1 provided
/tmp/build-env-0yot813/lib/python3.13/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: candidate: ‘template<class ... Args> init(nanobind::init)-> nanobind::init’
348 | template <typename... Args> struct init : def_visitor<init<Args...>> {
| ^~~~
/tmp/build-env-0yot813/lib/python3.13/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: template argument deduction/substitution failed:
/project/src/pybind/pyuipc/common/transform.cpp:72:63: note: ‘pyuipc::PyTransform::PyTransform(nanobind::module
&)::<lambda(const AngleAxis&)>’ is not derived from ‘nanobind::init’
72 | { return Quaternion(ax); }),
| ^
/project/src/pybind/pyuipc/common/transform.cpp:91:30: error: class template argument deduction failed:
91 | }),
| ^
/project/src/pybind/pyuipc/common/transform.cpp:91:30: error: no matching function for call to ‘init(pyuipc::PyTransform::PyTransform(nanobind::module
&)::<lambda(uipc::Float, pyuipc::numpy_array)>)’
/tmp/build-env-_0yot813/lib/python3.13/site-packages/nanobind/include/nanobind/nb_class.h:350:15: note: candidate: ‘template<class ... Args> init()-> nanobind::init’
350 | NB_INLINE init() {}
| ^~~~
/tmp/build-env-_0yot813/lib/python3.13/site-packages/nanobind/include/nanobind/nb_class.h:350:15: note: candidate expects 0 arguments, 1 provided
/tmp/build-env-0yot813/lib/python3.13/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: candidate: ‘template<class ... Args> init(nanobind::init)-> nanobind::init’
348 | template <typename... Args> struct init : def_visitor<init<Args...>> {
| ^~~~
/tmp/build-env-0yot813/lib/python3.13/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: template argument deduction/substitution failed:
/project/src/pybind/pyuipc/common/transform.cpp:91:30: note: ‘pyuipc::PyTransform::PyTransform(nanobind::module
&)::<lambda(uipc::Float, pyuipc::numpy_array)>’ is not derived from ‘nanobind::init’
91 | }),
| ^
/project/src/pybind/pyuipc/common/transform.cpp:100:60: error: class template argument deduction failed:
100 | { return AngleAxis(q); }),
| ^
/project/src/pybind/pyuipc/common/transform.cpp:100:60: error: no matching function for call to ‘init(pyuipc::PyTransform::PyTransform(nanobind::module
&)::<lambda(const Quaternion&)>)’
/tmp/build-env-_0yot813/lib/python3.13/site-packages/nanobind/include/nanobind/nb_class.h:350:15: note: candidate: ‘template<class ... Args> init()-> nanobind::init’
350 | NB_INLINE init() {}
| ^~~~
/tmp/build-env-_0yot813/lib/python3.13/site-packages/nanobind/include/nanobind/nb_class.h:350:15: note: candidate expects 0 arguments, 1 provided
/tmp/build-env-0yot813/lib/python3.13/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: candidate: ‘template<class ... Args> init(nanobind::init)-> nanobind::init’
348 | template <typename... Args> struct init : def_visitor<init<Args...>> {
| ^~~~
/tmp/build-env-0yot813/lib/python3.13/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: template argument deduction/substitution failed:
/project/src/pybind/pyuipc/common/transform.cpp:100:60: note: ‘pyuipc::PyTransform::PyTransform(nanobind::module
&)::<lambda(const Quaternion&)>’ is not derived from ‘nanobind::init’
100 | { return AngleAxis(q); }),
| ^
/project/src/pybind/pyuipc/common/transform.cpp:179:30: error: class template argument deduction failed:
179 | }),
| ^
/project/src/pybind/pyuipc/common/transform.cpp:179:30: error: no matching function for call to ‘init(pyuipc::PyTransform::PyTransform(nanobind::module
&)::<lambda(pyuipc::numpy_array)>)’
/tmp/build-env-_0yot813/lib/python3.13/site-packages/nanobind/include/nanobind/nb_class.h:350:15: note: candidate: ‘template<class ... Args> init()-> nanobind::init’
350 | NB_INLINE init() {}
| ^~~~
/tmp/build-env-_0yot813/lib/python3.13/site-packages/nanobind/include/nanobind/nb_class.h:350:15: note: candidate expects 0 arguments, 1 provided
/tmp/build-env-_0yot813/lib/python3.13/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: candidate: ‘template<class ... Args> init(nanobind::init)-> nanobind::init’
348 | template <typename... Args> struct init : def_visitor<init<Args...>> {
| ^~~~
/tmp/build-env-0yot813/lib/python3.13/site-packages/nanobind/include/nanobind/nb_class.h:348:36: note: template argument deduction/substitution failed:
/project/src/pybind/pyuipc/common/transform.cpp:179:30: note: ‘pyuipc::PyTransform::PyTransform(nanobind::module
&)::<lambda(pyuipc::numpy_array)>’ is not derived from ‘nanobind::init’
179 | }),
| ^
[450/541] /usr/local/bin/g++ -DCPPTRACE_STATIC_DEFINE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DUIPC_PROJECT_DIR="R"(/project)"" -DUIPC_RUNTIME_CHECK=1 -DUIPC_VERSION_MAJOR=0 -DUIPC_VERSION_MINOR=1 -DUIPC_VERSION_PATCH=0 -Dpyuipc_EXPORTS -DUIPC_RELATIVE_SOURCE_FILE="R"(src/pybind/pyuipc/common/unit.cpp)"" -I/project/src/pybind/pyuipc/.. -I/opt/python/cp313-cp313/include/python3.13 -I/tmp/build-env-_0yot813/lib/python3.13/site-packages/nanobind/include -I/project/include -I/project/src/sanity_check -isystem /tmp/tmpecslhels/build/vcpkg_installed/x64-linux/include/eigen3 -isystem /tmp/tmpecslhels/build/vcpkg_installed/x64-linux/include -O3 -DNDEBUG -std=gnu++20 -fPIC -fvisibility=hidden -fno-stack-protector -Os -ffunction-sections -fdata-sections -MD -MT src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/unit.cpp.o -MF src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/unit.cpp.o.d -o src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/unit.cpp.o -c /project/src/pybind/pyuipc/common/unit.cpp
[451/541] /usr/local/bin/g++ -DCPPTRACE_STATIC_DEFINE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DUIPC_PROJECT_DIR="R"(/project)"" -DUIPC_RUNTIME_CHECK=1 -DUIPC_VERSION_MAJOR=0 -DUIPC_VERSION_MINOR=1 -DUIPC_VERSION_PATCH=0 -Dpyuipc_EXPORTS -DUIPC_RELATIVE_SOURCE_FILE="R"(src/pybind/pyuipc/common/uipc_type.cpp)"" -I/project/src/pybind/pyuipc/.. -I/opt/python/cp313-cp313/include/python3.13 -I/tmp/build-env-_0yot813/lib/python3.13/site-packages/nanobind/include -I/project/include -I/project/src/sanity_check -isystem /tmp/tmpecslhels/build/vcpkg_installed/x64-linux/include/eigen3 -isystem /tmp/tmpecslhels/build/vcpkg_installed/x64-linux/include -O3 -DNDEBUG -std=gnu++20 -fPIC -fvisibility=hidden -fno-stack-protector -Os -ffunction-sections -fdata-sections -MD -MT src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/uipc_type.cpp.o -MF src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/uipc_type.cpp.o.d -o src/pybind/pyuipc/CMakeFiles/pyuipc.dir/common/uipc_type.cpp.o -c /project/src/pybind/pyuipc/common/uipc_type.cpp
ninja: build stopped: subcommand failed.

…placement new

Nanobind doesn't support pybind11's py::init(factory_lambda) pattern.
Nanobind's init<Args...> is a class template, not a function accepting
callables. Convert all factory constructors to __init__ with placement
new, which is nanobind's documented pattern for custom constructors.

Files fixed:
- transform.cpp: 5 factory inits (Quaternion, AngleAxis, Transform)
- simplicial_complex_io.cpp: 2 factory inits
- buffer.cpp: 1 factory init

Co-authored-by: MuGdxy <52098265+MuGdxy@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 2, 2026

@copilot fix it

[445/541] /usr/local/bin/g++ -DCPPTRACE_STATIC_DEFINE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DUIPC_PROJECT_DIR="R"(/project)"" -DUIPC_RUNTIME_CHECK=1 -DU...

Fixed in 58c08b8. The root cause: nanobind doesn't support pybind11's py::init(lambda) factory pattern — init<Args...> is a class template, not a function accepting callables. Converted all 8 factory constructors to nanobind's documented __init__ + placement new pattern across transform.cpp, simplicial_complex_io.cpp, and buffer.cpp.

…args

1. pyuipc.h: Add #include <nanobind/trampoline.h> to provide
   NB_TRAMPOLINE and NB_OVERRIDE_PURE macros for the trampoline class.

2. engine.cpp: Fix second Engine constructor py::init<> template args
   from <string_view, string_view, Json&> to
   <string_view, S<IEngine>, string_view, Json&> to match the actual
   C++ constructor that takes an overrider parameter.

Co-authored-by: MuGdxy <52098265+MuGdxy@users.noreply.github.com>
Copilot AI and others added 2 commits March 12, 2026 19:53
- Fix py::module& → py::module_& in new binding headers and sources
- Fix #include <pybind11/stl.h> → nanobind/stl/vector.h in animator.cpp
- Fix py::array_t<T> → numpy_array<T> in new/modified binding files
- Fix py::doc(R"(...)") → R"(...)" (nanobind uses raw const char*)
- Fix return types from numpy_array<Float> to py::object

Co-authored-by: MuGdxy <52098265+MuGdxy@users.noreply.github.com>
Copilot AI changed the title Migrate pybind11 to nanobind Merge main and convert new pybind files to nanobind syntax Mar 12, 2026
Copilot AI requested a review from MuGdxy March 12, 2026 20:10
nanobind's ndarray::operator() requires shape<> or ndim<> template
annotations which numpy_array<T> (nb::ndarray<nb::numpy, T>) lacks.
Use data() pointer arithmetic instead, consistent with existing
pattern in as_numpy.h helpers.

Co-authored-by: MuGdxy <52098265+MuGdxy@users.noreply.github.com>
Copilot AI changed the title Merge main and convert new pybind files to nanobind syntax fix(pybind): merge main, convert new bindings to nanobind, fix ndarray operator() error Mar 13, 2026
Add #include <nanobind/make_iterator.h> to span.h and attribute_slot.cpp.
Fix make_iterator call in attribute_slot.cpp from pybind11-style
(first, last) to nanobind-style (scope, name, first, last).

Fixes CI error: 'make_iterator' is not a member of 'pyuipc::py'

Co-authored-by: MuGdxy <52098265+MuGdxy@users.noreply.github.com>
Copilot AI changed the title fix(pybind): merge main, convert new bindings to nanobind, fix ndarray operator() error fix(pybind): nanobind make_iterator compile errors Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants