stack-of-tasks / pinocchio

A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
http://stack-of-tasks.github.io/pinocchio/
BSD 2-Clause "Simplified" License
1.7k stars 366 forks source link

Building 3.0.0 on OSX fails #2250

Closed budzianowski closed 1 month ago

budzianowski commented 1 month ago

Bug description

Building from source on python 3.12 gives error: pinocchio/src/parsers/mjcf/mjcf-graph.cpp:41:42: error: call to deleted member function 'get_child' and error: no viable conversion from 'void' to 'ptree' (aka 'basic_ptree<basic_string, basic_string>')

I'm not sure if it's latest version issue or my setup is wrong.

Reproduction steps

Steps to reproduce the behavior: Running according to the instructions: cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local make -j$(nproc)

System

jorisv commented 1 month ago

Hello,

Can you give me :

Pinocchio 3 is building well on the macos CI agent that run macOS 14 Arm64.

budzianowski commented 1 month ago

Hi @jorisv - yes, I saw the building and that puzzles me. I can build the package successfully if I delete all mjcf parser source code. My setup is: cmake version 3.29.3 all dependencies (eigen boost) installed from brew mac3 pro chip arm

Do you mean python dependencies?

budzianowski commented 1 month ago

Building without mjcf ends up with architecture complaints:

import pinocchio Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.12/site-packages/pinocchio/init.py", line 18, in from .pinocchio_pywrap_default import * ImportError: dlopen(/usr/local/lib/python3.12/site-packages/pinocchio/pinocchio_pywrap_default.cpython-312-darwin.so, 0x0002): tried: '/usr/local/lib/python3.12/site-packages/pinocchio/pinocchio_pywrap_default.cpython-312-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/python3.12/site-packages/pinocchio/pinocchio_pywrap_default.cpython-312-darwin.so' (no such file), '/usr/local/lib/python3.12/site-packages/pinocchio/pinocchio_pywrap_default.cpython-312-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/usr/local/lib/python3.12/site-packages/pinocchio/pinocchio_pywrap_default.3.0.0.cpython-312-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/python3.12/site-packages/pinocchio/pinocchio_pywrap_default.3.0.0.cpython-312-darwin.so' (no such file), '/usr/local/lib/python3.12/site-packages/pinocchio/pinocchio_pywrap_default.3.0.0.cpython-312-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))

Do you have some documentation how to build 3.0.0 cause I'm trying to follow: https://stack-of-tasks.github.io/pinocchio/download.html

jorisv commented 1 month ago

@budzianowski Can you try to build from this PR ?

budzianowski commented 1 month ago

The PR solves the issue.

budzianowski commented 1 month ago

I think the documentation (https://stack-of-tasks.github.io/pinocchio/download.html) should be updated to the latest version of the workflow @jorisv I wanted to make a PR for it but I believe the docs are handled in the separate repo?:

conda env create -f environment.yaml cmake .. \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ -DBUILD_WITH_COLLISION_SUPPORT=ON \ -DBUILD_WITH_CASADI_SUPPORT=ON \ -DBUILD_WITH_AUTODIFF_SUPPORT=ON cmake --build . -j2 ctest --output-on-failure cmake --install .

jorisv commented 1 month ago

Right now the documentation is kind of fragmented and out dated, we are aware of it and we will work on it soon.

nim65s commented 1 month ago

I believe the docs are handled in the separate repo?

No, they are in this repo, in the gh-pages branch