Build dqrobotics from a pinned submodule, statically, into _core - #10
Merged
Merged
Conversation
Add dqrobotics/cpp as submodules/dqrobotics_cpp, pinned to 674eae4, the commit the required dqrobotics 26.4.0a7 Python release was built from (its cpp submodule at dqrobotics/python e8f43c1 = v26.04.0 + 7 commits). _core links it statically with hidden visibility, as working-needlemanipulation does; DQ and DQ_SerialManipulator objects are still the dqrobotics package's, through pybind11's shared type registry, so the two copies must keep the same class layouts. sas_cpp is bumped to the branch that uses a parent's dqrobotics::dqrobotics target (MarinhoLab/sas_cpp#12). Its headers no longer bring Eigen's names into scope, so sas_robot_driver_py.cpp uses Eigen::VectorXd explicitly. The workflow no longer installs the DQ Robotics PPA or builds dqrobotics on macOS and Windows, and no longer repairs the macOS and Windows wheels with delocate and delvewheel (auditwheel still sets the manylinux tag). The Docker pipeline drops the PPA and checks dqrobotics interop and that _core links no libdqrobotics. The Eigen include shim is gone: no header of the pinned dqrobotics includes <eigen3/Eigen/Dense>. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With this change,
_corecompiles the dqrobotics C++ library from a pinned git submodule and links it statically, the same way working-needlemanipulation does. It no longer links a system-installed libdqrobotics that the wheel repair tools then had to bundle. So the build no longer needs the DQ Robotics PPA, a dqrobotics build from source on macOS and Windows, delocate or delvewheel.The pinned dqrobotics commit
submodules/dqrobotics_cppis pinned to dqrobotics/cpp 674eae4d8804baca6dc22bbbe3afc3b323c05cdf ("[debian] Created docker files to test, identified causes of #73 and modified debian/rules.", 2026-04-08). This is the commit the requireddqrobotics==26.4.0a7was built from. It was found as follows:dev_template = "{tag}.a{ccount}".26.4.0a7is therefore the 7th commit after tagv26.04.0, which ise8f43c1("Fixing stubs and a few wrong py::args.", 2026-09-28).e8f43c1on master started at 13:04 UTC, and PyPI received 26.4.0a7 at 13:08 UTC.git submodule update --init --recursivewithout--remote, so it builds thecppsubmodule exactly ase8f43c1records it:674eae4. The two commits before it (caa197e= a6,9282a59= a5) record the same commit.674eae4already hasDQ_JointType, whichSerialManipulatorSimulatorFriendlyneeds, so no newer commit was required.Why the pin matters:
_coreand thedqroboticsPython package's extension now each contain their own copy of dqrobotics. pybind11's type registry is shared between extension modules, soDQandDQ_SerialManipulatorobjects pass between the two copies:SerialManipulatorSimulatorFriendlyis built by_core, and its inheritedfkm,pose_jacobian,set_base_frame, ... run in thedqroboticspackage's copy.DQarguments and results come from thedqroboticspackage.So the two copies must have identical class layouts. Keep this submodule at the cpp commit of the
dqroboticsrelease inpyproject.toml, and whendqroboticsis raised, move both together. The requirement stays atdqrobotics>=26.4.0a7. Only dqrobotics/cppd4fd283(documentation only) is newer than the pin today.Changes
add_subdirectory(submodules/dqrobotics_cpp EXCLUDE_FROM_ALL)withBUILD_SHARED_LIBS OFFandCMAKE_POSITION_INDEPENDENT_CODE ON.dqrobotics::dqroboticsis anALIASof the static target, and it is defined beforeadd_subdirectory(submodules/sas_cpp)._core.MARINHO_LAB_SAS_CORE_INSTALL OFF: sas_cpp'sinstall(EXPORT)cannot export a dependency on a non-installed target.find_package(Eigen3): Homebrew viaCMAKE_PREFIX_PATH, vcpkg via the toolchain,libeigen3-devon Linux. It has no hard-coded Homebrew path at this commit.CMAKE_CXX_VISIBILITY_PRESET hidden,CMAKE_VISIBILITY_INLINES_HIDDEN) for the static libraries._corethen exports onlyPyInit__core(checked withnm -gU), so none of its dqrobotics symbols can interpose with the copy in thedqroboticsextension. Cross-module type lookup is unaffected, because pybind11 matches types by their type-name strings.<eigen3/Eigen/Dense>, but no file of the pinned commit (or of sas_cpp, or ofsrc/) has that include.b25253b). That PR makes sas_cpp use a parent'sdqrobotics::dqroboticsand addsMARINHO_LAB_SAS_CORE_INSTALL. The bump also brings sas_cpp main's "Remove 'using namespace Eigen' from public headers", hence theusing Eigen::VectorXd;added tosrc/sas_robot_driver_py.cpp. After sas_cpp#12 is merged, this submodule should be moved to sas_cpp main (I can push that bump to this branch).MACOSX_DEPLOYMENT_TARGET,ARCHFLAGS,_PYTHON_HOST_PLATFORM, and the smoke test.fkm/pose_jacobian(which run in thedqroboticspackage) agree withraw_fkm/raw_pose_jacobian.build.shadds interop checks: inheritedfkm/pose_jacobian,set_base_frame/set_reference_frame, andDQ_Kinematics.translation_jacobianon the_coreobject.build.shalso adds anlddcheck that_corelinks no dqrobotics shared library.Testing
python -m build --wheel, then installed in a clean venv with--pre dqrobotics(26.4.0a7).otool -L _core*.solists only libc++ and libSystem.cd docker && docker compose run --rm --build marinholab_sas_core): all checks pass, andlddshows no libdqrobotics.publishis skipped on PRs.Wheel sizes for cp314, from 26.9.11 on PyPI to this PR's CI artifacts:
🤖 Generated with Claude Code