Repository navigation
Enable realsense2_camera and realsense2_description on macOS - #80
Merged
Merged
Conversation
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.
Goal
Enable the
realsense2_cameraandrealsense2_descriptionpackages on macOS in the robostack-lyrical distribution.Description
realsense2_cameraandrealsense2_descriptionwere previously built only on Linux. The underlyinglibrealsenselibrary is available on conda-forge for macOS, so the only blocker was a build failure ofrealsense2_cameraon macOS.During local testing on macOS (
osx-arm64), the build failed at the linking stage with:ld: unknown option: -z. The root cause is in the "Compiler Defense Flags" block of upstreamCMakeLists.txt: for theClangcompiler it unconditionally adds-Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now. These are GNU ELF linker options and are not supported by the Apple linker (ld64). Conda-forge's clang on macOS reports itself asClang, so it enters that branch.Solution
This PR includes a one-line patch that skips the
-zlinker flags on Apple:This ensures:
osx-64andosx-arm64),patch/ros-lyrical-realsense2-camera.patch(same approach asapriltag_ros).Changes
realsense2_cameraandrealsense2_descriptionfrom the Linux-only section to thenot winsection invinca.yaml.patch/ros-lyrical-realsense2-camera.patchskipping the-zlinker flags on Apple.License
realsense2_camerais licensed under the Apache-2.0 license.This PR does not modify upstream functionality beyond RoboStack packaging integration and a minimal build-system portability fix.
Notes
Build tested locally on osx-arm64 (
ros2-realsense2-camera,ros2-realsense2-camera-msgs,ros2-realsense2-description), all tests passed. Linux and osx-64 will be verified by CI.The proper upstream fix would be to guard the
-zflags withNOT APPLEinrealsense-rositself.