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

More Idiomatic Use of CMake #164

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

schrieveslaach
Copy link
Contributor

@schrieveslaach schrieveslaach commented Sep 16, 2024

This commit makes sure that pthreads will be linked by CMake in the idiomatic way (sse https://stackoverflow.com/a/29871891 as reference). Also the linking options won't be set via CXX flags because this caused lead to weird effects on some Linux distros (undefined reference to `hci_get_route' on my system). See the CMake documenation: https://cmake.org/cmake/help/latest/command/target_link_libraries.html

Finally, this commit also makes sure that build artifacts won't show up in Git commands in the idiomatic way.

FYI: Issues discovered in #163

This commit makes sure that pthreads will be linked by CMake in the
idiomatic way (sse https://stackoverflow.com/a/29871891 as reference).
Also the linking options won't be set via CXX flags because this caused
lead to weird effects on some Linux distros (undefined reference to
`hci_get_route' on my system). See the CMake documenation:
https://cmake.org/cmake/help/latest/command/target_link_libraries.html

Finally, this commit also makes sure that build artifacts won't show up
in Git commands in the idiomatic way.
@greymfm greymfm merged commit bf1e6ac into Ardumower:master Sep 16, 2024
@greymfm
Copy link
Member

greymfm commented Sep 16, 2024

CMake Error at CMakeLists.txt:92 (target_link_libraries):
Cannot specify link libraries for target "sunray" which is not built by
this project.

cmake version 3.18.4 (I'm on Ubuntu 18.04 as this is my target system for serveral Docker systems including ROS for Sunray)

@schrieveslaach
Copy link
Contributor Author

@greymfm, that is a bummer… Is the reliance on such an old distro related to the fact that the Bananapi M4 has no compatible, up to date kernel verions? If this is the case, is there a way to support something like armbian/build#7158 from your end?

@greymfm
Copy link
Member

greymfm commented Sep 17, 2024

No, Sunray can be compiled as ROS node (https://github.com/Ardumower/Sunray?tab=readme-ov-file#sunray_ros and https://www.ros.org/), and ROS (with a full robotics LiDAR driver and LiDAR localization ecosystem) and those drivers and localization packages are often compiled for ROS Melodic (they are working on newer ROS versions but it will take time...) - and ROS Melodic only runs on Ubuntu 18.04 - and because of that we use Docker :-)

@schrieveslaach schrieveslaach deleted the build-env-improvement branch October 12, 2024 18:49
@schrieveslaach
Copy link
Contributor Author

Not sure if I can follow you because I'm not familiar with ROS. Just digged into the space of ROS a bit and it seems that ROS Melodic is out of maintenance and one should switch to ROS 2 Jazzy Jalisco. What is blocking you to switch to this more recent version? Is it the Livox SDK not being compatible? For Livox-SDK/Livox-SDK2#76 there is already a fix available which you could test: Livox-SDK/Livox-SDK2#85

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

Successfully merging this pull request may close these issues.

2 participants