Skip to content
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

Cannot compile on macOS Ventura (Intel) #19

Open
JayStolzenwald opened this issue Mar 17, 2023 · 8 comments
Open

Cannot compile on macOS Ventura (Intel) #19

JayStolzenwald opened this issue Mar 17, 2023 · 8 comments

Comments

@JayStolzenwald
Copy link

JayStolzenwald commented Mar 17, 2023

I'm getting this when I try to compile on macOS Ventura (Intel):

 stderr: python_orocos_kdl_vendor                                                    
In file included from /Users/janis/ros2_humble/build/python_orocos_kdl_vendor/_deps/python_orocos_kdl-src/python_orocos_kdl/PyKDL/PyKDL.cpp:27:
In file included from /Users/janis/ros2_humble/build/python_orocos_kdl_vendor/_deps/python_orocos_kdl-src/python_orocos_kdl/PyKDL/PyKDL.h:26:
In file included from /Users/janis/ros2_humble/install/pybind11_vendor/include/pybind11_vendor/pybind11/pybind11.h:13:
In file included from /Users/janis/ros2_humble/install/pybind11_vendor/include/pybind11_vendor/pybind11/attr.h:13:
In file included from /Users/janis/ros2_humble/install/pybind11_vendor/include/pybind11_vendor/pybind11/cast.h:16:
/Users/janis/ros2_humble/install/pybind11_vendor/include/pybind11_vendor/pybind11/detail/type_caster_base.h:482:26: error: member access into incomplete type 'PyFrameObject' (aka '_frame')
            frame = frame->f_back;
                         ^
/usr/local/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11/pytypedefs.h:22:16: note: forward declaration of '_frame'
typedef struct _frame PyFrameObject;
               ^
1 error generated.
make[2]: *** [_deps/python_orocos_kdl-build/CMakeFiles/PyKDL.dir/PyKDL/PyKDL.cpp.o] Error 1
make[1]: *** [_deps/python_orocos_kdl-build/CMakeFiles/PyKDL.dir/all] Error 2
make: *** [all] Error 2
make: INTERNAL: Exiting with 13 jobserver tokens available; should be 12!

Failed   <<< python_orocos_kdl_vendor [17.1s, exited with code 2]
@Yadunund
Copy link
Member

It might be helpful to provide more details of your setup for others to be able to reproduce this problem. In this case

  1. Which branch/commit are you building off? ( One can assume latest humble based on your folder structure but best if this can be made explicit)
  2. Version of xcode
  3. Build command invoked

Anyways the error might be due to your default version of python3 which seems to be 3.11.
Maybe try with python3.10 which is the default version in Ubuntu Jammy (Tier 1 supported platform).

I've had no issues compiling rolling version on macOS Ventura with an older version of python3.

@JayStolzenwald
Copy link
Author

Hi @Yadunund , thanks for your reply. this is what I used

  1. Yes, I try to build lates humble
  2. Xcode v14.2 (latest)
  3. I tried this command:
    colcon build --symlink-install --packages-skip-by-dep python_qt_binding
    from the step-by-step guide

I will try with python3.10 and report again

@JayStolzenwald
Copy link
Author

JayStolzenwald commented Mar 19, 2023

I can confirm building from rolling does not solve the issue (same Error).

Also, I cannot remove 3.11 because brew packages ansible opencv sip theharvester vtkdepend on it, i.e., installing those also triggers python@3.11 installation. So building with 3.10 is not really an option :/

@Yadunund
Copy link
Member

From my experience relying on brew version of dependencies (like opencv, vtk, etc) will actually cause other deps to be updated and prevent compilation of the ROS 2 source code. Eg, I think installing vtk from brew will bump the version of libboost such that rmw_fastrtps will fail to compile. So one needs to be mindful to ensure the dependency versions (including python3) match those used in Ubuntu/Windows builds. I was planning to update the MacOS build instructions on docs.ros.org with some pointers and this ticket is a good reminder for that.

In the meanwhile, this PR just got merged which aims to support python3.11. Maybe you could pull the changes and try again?

@JayStolzenwald
Copy link
Author

JayStolzenwald commented Mar 22, 2023

Hi @Yadunund, thanks for your consideration. the mentioned PR actually solves this issue. But now I fail at kdl_parser


Starting >>> rosidl_typesupport_fastrtps_c
--- stderr: kdl_parser                                                                                                    
/Users/janis/ros2_rolling/src/ros/kdl_parser/kdl_parser/test/test_inertia_rpy.cpp:35:10: fatal error: 'kdl/chainidsolver_recursive_newton_euler.hpp' file not found
#include "kdl/chainidsolver_recursive_newton_euler.hpp"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/test_inertia_rpy.dir/test/test_inertia_rpy.cpp.o] Error 1
make[1]: *** [CMakeFiles/test_inertia_rpy.dir/all] Error 2
make: *** [all] Error 2
make: INTERNAL: Exiting with 13 jobserver tokens available; should be 12!

Failed   <<< kdl_parser [18.2s, exited with code 2]

At this point, I'm basically your human macOS build pipeline 😛

@CursedRock17
Copy link

@JayStolzenwald I have been working on building ROS 2 rolling on MacOS Ventura as well, I have the ARM chip opposed to the intel, but it shouldn't matter. I have this repo which I've been documenting what it takes for me to get a stable environment on MacOS without just using Docker. I've been trying to get most of these changes merged to the main repository chain because most of the changes have been small version changes, which makes me surprised that MacOS is placed in tier 3 due to the small differences between it and Ubuntu. But if you use the the README it should explain how I've been doing it in the mean time.

@clalancette
Copy link
Contributor

which makes me surprised that MacOS is placed in tier 3 due to the small differences between it and Ubuntu

It is mostly a question of what we have time and money to develop, support, and test on. macOS was Tier 1 up until 2020, but it became increasingly difficult to make things work (between the lack of OpenGL, headaches with SIP, and headaches with homebrew). And simultaneously, the number of people who actually use macOS for ROS development is small (it is not zero, but it is small). So we were spending a lot of time fighting macOS things for very little gain. We put out a call for volunteers to support it in https://discourse.ros.org/t/macos-support-in-ros-2-galactic-and-beyond/17891 , but nobody was willing to put in the time.

All of that is to say is that you are doing the right thing for a Tier 3 platform; testing it out, and fixing the bugs as you come across them. Thanks for your work here.

@JayStolzenwald
Copy link
Author

@CursedRock17 , thanks for the reference, I will have a look.

@clalancette , thanks for your feedback. I will keep you posted about bugs and solutions then :)

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

No branches or pull requests

4 participants