-
Notifications
You must be signed in to change notification settings - Fork 75
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
ogre formulae don't compile on Macs with M1 arm processor #1628
Comments
potential fix in #1643 |
I can compile ogre1.9, but not for 2.1 & 2.2 because of the same issue. Is this somewhat expected? In file included from /tmp/ogre2.2-20220209-55630-1l82eok/ogre-next-312bf406a77244afe230930e67e3e5d52a119507/OgreMain/src/OgreArchive.cpp:29: |
ogre 2.1, 2.2 were not fixed by #1646 |
I see the following patches on I don't have an m1 machine, so I can't test this |
It's my first time to participate the issue, am I supposed to compile the suggested repo from scratch? |
I can see two ways to test these patches:
|
I tried the second approach and ended up getting this. |
that means the patch did not apply properly |
Can you confirm what I added is correct? |
I still want to test things out but I am not sure how can I get sha256 and use the link from ogre-next -- sorry this is my first time to work on this so I need some input to learn about this :). If I see the patch you made (https://github.com/osrf/homebrew-simulation/pull/1646/files) I can see something like url "https://github.com/scpeters/ogre/commit/c39b6df49618773357da0b54437f351b57168d12.patch?full_index=1" What is a good way of extracting those info. to test out new patches? |
I tried this " # fix for m1 arch -- adapted from OGRECave/ogre-next@ff01338
But ended up getting Error: ogre2.1: SHA256 mismatch The way I tried to get sha256 was
|
I was able to add the patches you suggested but still ended up with errors. Any help will be appreciated.
Although it raises the errors, but ogre2.1/2.2 complies after ignoring those errors. Also after this I can install ignition gazebo 5 but cannot run it with these errors; I cannot find any available 'ign' command: |
Oh cool, I'm on M1 now and I come to the exact same issue as you guys are having.
I think it has to be in your local instead. I'm not too sure, but have you tried that? |
You can check my latest comment but I was able to compile the ogre 2.1 or 2.2 after ignoring some failed patches. |
for those tesing ignition on macOS, there is a wiki from our external contributor that provides more info on how to get Ignition running: |
@tmefmd Were you able to get it run on your computer? If so, what's your secret? |
I was able to compile the ogre 2.1/2.2 but not ignition gazebo, since for now ign gazebo GUI is not supported on Mac. Maybe @iche033 confirm this? |
The gui should work now that gazebosim/gz-gui#323 is merged. However, it still needs the changes from this ign-gazebo PR gazebosim/gz-sim#1225 |
@iche033 (update)
And if I run |
Hold up, you can compiled gazebo 7 on m1? Care to share your secret? ;)
I put a separate path for M1. See here
From this link: gazebosim/gz-sim#1362 (comment) Anyway, I'm sure others will be very grateful if you share your secret about the ign gazebo7. 🙏 |
What I just did is brew install with homebrew-simulation tap being added |
how about trying |
(edit) I revised the link since I was using the wrong one I think the ignition-gazebo7 in the homebrew bottle does not have changes made from this PR, hopefully this is being merged soon https://github.com/ignitionrobotics/ign-gazebo/pull/1225/files I also checked that the current |
I ran brew install Surprisingly, it went through but it end up having an error. Are you familiar with this error?
But this worked when you ran this See here output on ign msg 9 after using colcon build:
What's the difference between msg9 on brew and msg9 on GitHub's Do you know anything about this? @iche033 @srmainwaring @jasonbyun8 I believe that GUI is only thing that is being blocked for others include myself. Physics is actually fixed by gazebosim/gz-sim#1362 (comment) Side note, I'm still dying for gazebo to be on m1 :P haven't tried it once since 3 months ago now |
I don't think the gui brew bottle will work since we haven't made a release with gazebosim/gz-gui#323 yet. So you'll need to build from source. In your build error output, you have
the actual errors should be shown before these lines. Do you see the files / line numbers that are causing the compile errors? |
My apologies, I didn't get this notification until I open my email. Log is a very long one. Looks like it was trying to find gz-gui instead of ign-gui? Not sure if I'm right about this. Here Also, the gui is on main as well the change is already on this as u can see I got it from yday. That PR is merged on March 4 |
@Kakcalu13 it might be a Qt version conflict issue. Some includes are being pulled in from /opt/homebrew/opt/qt@5/lib/QtCore.framework/Headers/ and others /opt/homebrew/include/QtCore/ which could mean you have qt6 (installed as qt) linked. This may cause conflicts as brew will link qt into Check with |
Apparently, I have qt6! I unlinked it and it worked!!! No more errors. It was qt6 all the time! Just ONE more thing...are you familiar with this issue?
|
|
Great! Getting there. Looks like a library search path problem. If you've used the MACOSX_RPATH flags when building, i.e. something like: $ colcon build --merge-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_MACOSX_RPATH=FALSE -DCMAKE_INSTALL_NAME_DIR=$(pwd)/install/lib then in addition to sourcing the #--------------------------------------------------------------------------
# Usage
#
# $ source ./set_gz_env.sh
#
#--------------------------------------------------------------------------
# set environment for Dart and Qt: https://ignitionrobotics.org/docs/fortress/install_osx_src
# dartsim@6.10.0
export CMAKE_PREFIX_PATH=/usr/local/opt/dartsim@6.10.0:${CMAKE_PREFIX_PATH}
export DYLD_FALLBACK_LIBRARY_PATH=${DYLD_FALLBACK_LIBRARY_PATH}:/usr/local/opt/dartsim@6.10.0/lib:/usr/local/opt/octomap/local
export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/local/opt/dartsim@6.10.0/lib/pkgconfig
# qt5
export CMAKE_PREFIX_PATH=/usr/local/opt/qt@5:${CMAKE_PREFIX_PATH}
#--------------------------------------------------------------------------
# Set Ogre environment variables
unset OGRE_RESOURCE_PATH
export OGRE_RESOURCE_PATH=/usr/local/opt/ogre1.9/lib/OGRE
unset OGRE2_RESOURCE_PATH
export OGRE2_RESOURCE_PATH=/usr/local/opt/ogre2.2/lib/OGRE-2.2/OGRE
#--------------------------------------------------------------------------
# Set Ignition environment variables
# Set the render emgine to use when running tests with 'make test'
export RENDER_ENGINE_VALUES=ogre2
# used by ros_ign
export IGNITION_VERSION=garden
# ignition-transport
# if set to 1 this displays all transport messages
export IGN_VERBOSE=0
export IGN_IP=127.0.0.1
export IGN_CONFIG_PATH=\
$HOME/Code/osrf/gz_garden_ws/install/share/ignition
#--------------------------------------------------------------------------
# Use brew version of ruby to avoid SIP issues
export PATH=/usr/local/opt/ruby/bin:$PATH |
Yeah, I used that one. I've updated the
and deleted build/ log/ install/ then re-run it. Looks like it doesn't fix the ogre issue :( |
Hmm. On an intel mac I install my own build of ogre2 into Are the libraries installed into the corresponding placed on an M1, and are all these locations available in the DYLD load path (including the one at /opt/homebrew/lib)? |
Silly question, but which directory do you export for |
@Kakcalu13 I can help you at last with running Gazebo on a M1 mac as I've upgraded my ageing MacBookPro to a newer model. After some tweaking of build settings I have Gazebo Garden running natively on my M1. Both Gazebo and ogre2.2 are built from source (custom build in the case of ogre2.2) I initially used the osrf/simulation ogre2.2.rb patch provided by @iche033. Everything built ok, and I was able to get the examples in gz-rendering running, but kept seeing the issue you raised with # set up variables
name=ogre2.2
version=2.2.6
prefix=/opt/homebrew/Cellar/${name}/${version}
# configure
cmake .. \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DOGRE_GLSUPPORT_USE_GLX:BOOL=FALSE \
-DOGRE_BUILD_LIBS_AS_FRAMEWORKS:BOOL=FALSE \
-DOGRE_FULL_RPATH:BOOL=FALSE \
-DOGRE_BUILD_RENDERSYSTEM_GL3PLUS:BOOL=TRUE \
-DOGRE_BUILD_SAMPLES2:BOOL=TRUE \
-DOGRE_BUILD_SAMPLES_AS_BUNDLES:BOOL=FALSE \
-DOGRE_BUILD_TESTS:BOOL=TRUE \
-DOGRE_BUILD_TOOLS:BOOL=TRUE \
-DOGRE_INSTALL_SAMPLES:BOOL=TRUE \
-DOGRE_INSTALL_TOOLS:BOOL=TRUE \
-DOGRE_PLUGIN_LIB_PREFIX='' \
-DCMAKE_CXX_STANDARD=11 \
-DCMAKE_CXX_FLAGS='-I/opt/homebrew/include -F/Library/Frameworks -Wno-deprecated-copy -Wno-gnu-inline-cpp-without-extern -Wno-deprecated-declarations -Wno-missing-braces -Wno-unused-variable -Wno-cast-qual -Wno-constant-conversion -Wno-unused-private-field -Wno-unused-command-line-argument' \
-DOGRE_LIB_DIRECTORY=lib/OGRE-2.2 \
-DCMAKE_INSTALL_PREFIX=$prefix \
-DCMAKE_FIND_FRAMEWORK=LAST \
-DCMAKE_VERBOSE_MAKEFILE=OFF \
-DCMAKE_MACOSX_RPATH:BOOL=FALSE \
-DCMAKE_INSTALL_NAME_DIR=$prefix/lib The last two flags @jasonbyun8 and @iche033 I'd be interested to understand what you did differently to get Gazebo running on your M1 machines using a brew installed version of ogre2.2. My installation is still a little rough around the edges; there are some segmentation faults on exit and not all the examples are running (however |
🤩 Welcome to the M1 gang!
Is this for I've been using gazebo on docker on M1. I'd like to have to run Gazebo natively one day! Still hasn't gotten it |
The script sets up a number of environment variables. They could go in .zprofile but I prefer to keep them separate so I can switching between different development builds. It's not used during the installation, just for running. We could add a 'getting started on M1 macs' entry on the Gazebo Community project pages, provided we can come back to edit the top entry to keep it current.
I expect that you are very close, and it's probably just the library search path (i.e. rpath issues) that is causing problems if you have the libraries compiling.
Would be interested to know more about your set up, would you mind documenting your environment? (which VM you're running, any config tips and tricks). Did you manage to get hardware acceleration running? Perhaps another good topic for the community pages as we're getting a little off topic for this thread. |
I'm more than happy to share about docker on M1. You just need to use ARM platform, apparently. I can share the Dockerfiles if interested. I made the Dockerfile for FEAGI which is also an open source. I just used the latest docker, see here: I used arm64 platform. This is all you need to install Gazebo Citadel on M1 using docker. I've tested Citadel only though |
hmm I just tried rebuilding everything with the latest branches and seems to be working ok. I didn't have to set these two flags though: my ogre2.2 is built with the patch from my PR, #1823, and also setting here's my colcon build cmd:
|
I start all over and just do few commands:
gui7 returns error but this seems a lot better than before though. If I remember right, I had like 6 unprocessed but now this time, it's just 3 Error below:
This error looks familiar but then I remember we discussed about qt5 and qt6. Check if I have qt6
which I do again. So I unlink qt6
So I tried again by export qt5
And it completed without any issue! So I export all important parts like this,
The result is this: Why isn't export dart working? Do you see something off or missing on my end? |
From https://gazebosim.org/docs/garden/install_osx_src#source-installation-on-macos, you also need: # dartsim@6.10.0
export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:/usr/local/opt/dartsim@6.10.0
export DYLD_FALLBACK_LIBRARY_PATH=${DYLD_FALLBACK_LIBRARY_PATH}:/usr/local/opt/dartsim@6.10.0/lib:/usr/local/opt/octomap/local
export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/local/opt/dartsim@6.10.0/lib/pkgconfig Although I think that |
Before I start with colcon build, I took the set_gz_env.sh which has that:
I tried again using that prior to run colcon after delete install, log, and build folders. I ran now it's giving me a different error
I noticed it tried to run Mac intel path like this: The error is from the I checked my set_gz_env.sh, it doesn't say anything about What is it that I missed the step? What is your full steps? Assuming my M1 is a brand new |
For the server: gz sim -v4 -s -r shapes.sdf For the client: gz sim -v4 -g
export PATH=/opt/homebrew/opt/ruby/bin:$PATH (your list of exports above is using
This is where I had issues once everything was building correctly and the main difference between the compilation flags used by @iche033 and me is that I used
when building ogre2.2. I haven't resolved why this should make a difference, but it solved the problem of the rendering plugins not finding |
Sorry, I tried and followed everything. It's just no luck for me. I'm sorry for giving you some headache lol So, here is my set_gz_env.sh:
I don't see any So the command I use now is:
This results the below error:
Here is the little meme, I hope this cures all headache :P |
There are some mistakes in your build as you have used the Let's try again, being careful:
I am assuming that you have installed ogre following @iche033's instructions, using their
From the error messages I see your workspace is cd $HOME/workspace_new/
# clear out the previous build
rm -rf ./build ./log ./install
# set pre-build exports for dart and qt5
export CMAKE_PREFIX_PATH=/opt/homebrew/opt/dartsim@6.10.0:${CMAKE_PREFIX_PATH}
export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/opt/homebrew/opt/dartsim@6.10.0/lib/pkgconfig
export CMAKE_PREFIX_PATH=/opt/homebrew/opt/qt@5:${CMAKE_PREFIX_PATH}
# build gazebo
colcon build --cmake-args -DBUILD_TESTING=OFF -DCMAKE_MACOSX_RPATH=FALSE -DCMAKE_INSTALL_NAME_DIR=$(pwd)/install/lib --merge-install --packages-up-to gz-sim7 --cmake-clean-cache
% gz sim --version
Gazebo Sim, version 7.0.0~pre1
Copyright (C) 2018 Open Source Robotics Foundation.
Released under the Apache 2.0 License.
% gz sim -v4 -s -r shapes.sdf
[Msg] Gazebo Sim Server v7.0.0~pre1
[Msg] Loading SDF world file[/Users/station1/workspace_new/install/share/ignition/gz-sim7/worlds/shapes.sdf].
[Msg] Loaded level [3]
...
% gz sim -v4 -g
[Msg] Gazebo Sim GUI v7.0.0~pre1
[Dbg] [Application.cc:94] Initializing application.
[Dbg] [Application.cc:102] Qt using Metal graphics interface
[GUI] [Dbg] [Application.cc:562] Create main window
... It's at this point you'll notice if you ogre2.2 build is incorrect as the rendering plugins will not load. |
… this is a well-known issue c.f. osrf/homebrew-simulation#1628)
the ogre2.2 formula should be fixed by #1823, and ogre1.9 and ogre2.3 should already be fixed |
Hello,
|
Hi there! Can you try this steps:
Let me know if it worked for you? The one you are currently trying is kinda rather too complicated. The one I provided is super easy! |
same error as yours, can not find a way out |
Patch doesn't help, didn't complile with error
But this works! |
I tried compiling
ogre1.9
,ogre2.1
, andogre2.2
on a Mac mini with the new M1 processor and it failed to compile. I think we need to apply OGRECave/ogre-next@ff01338 to our formulae.The text was updated successfully, but these errors were encountered: