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

Geographiclib cannot be located on ROS Jazzy #10

Open
3 tasks done
Timple opened this issue Jun 14, 2024 · 1 comment
Open
3 tasks done

Geographiclib cannot be located on ROS Jazzy #10

Timple opened this issue Jun 14, 2024 · 1 comment

Comments

@Timple
Copy link

Timple commented Jun 14, 2024

Checklist

  • I've read the contribution guidelines.
  • I've searched other issues and no duplicate issues were found.
  • I'm convinced that this is not my fault but a bug.

Description

Geographiclib cannot be located

Expected behavior

Compilation succeeds

Actual behavior

63.08 Starting >>> lanelet2_projection
64.45 --- stderr: lanelet2_projection
64.45 CMake Error at /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
64.45   Could NOT find GeographicLib (missing: GeographicLib_LIBRARIES)
64.45 Call Stack (most recent call first):
64.45   /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
64.45   /opt/ros/jazzy/share/mrt_cmake_modules/cmake/Modules/FindGeographicLib.cmake:16 (find_package_handle_standard_args)
64.45   /ws/install/lanelet2_core/share/lanelet2_core/cmake/lanelet2_coreAutoDepsConfig.cmake:198 (find_package)
64.45   /opt/ros/jazzy/share/mrt_cmake_modules/cmake/Modules/FindAutoDeps.cmake:253 (_find_dep)
64.45   CMakeLists.txt:21 (find_package)

Steps to reproduce

Dockerfile:

FROM ros:jazzy
SHELL [ "/bin/bash", "-c" ]
RUN apt-get update -qq && apt-get install -qqy python3-colcon-core
RUN mkdir -p /ws/src
WORKDIR /ws
RUN git clone https://github.com/autowarefoundation/autoware_msgs /ws/src/autoware_msgs
RUN git clone https://github.com/fzi-forschungszentrum-informatik/lanelet2 /ws/src/lanelet2
RUN git clone https://github.com/autowarefoundation/autoware_lanelet2_extension /ws/src/autoware_lanelet2_extension
RUN rosdep update && rosdep install --from-paths src --ignore-src -y
RUN source /opt/ros/jazzy/setup.bash && colcon build --packages-up-to autoware_lanelet2_extension

Versions

Latest

Possible causes

No response

Additional context

No response

@wagler
Copy link

wagler commented Sep 30, 2024

It looks like they changed the lanelet2_extension/CMakeLists.txt file now, so that it doesn't look for GeographicLib.
However, the version of autoware_lanelet2_extension that had this issue is still floating around, so I'll answer here.

Problem
The issue is that GeographicLib package on Ubuntu 24.04 (used for Jazzy) is installed as geographiclib, not GeographicLib.
Confirm this by running pkg-config --libs GeographicLib and pkg-config --libs geographiclib. You'll see the first one reports an error, while the second one shows -lGeographicLib.

Fix
Go into lanelet2_extension/CMakeLists.txt and replace these lines:

find_path(GeographicLib_INCLUDE_DIR GeographicLib/Config.h
  PATH_SUFFIXES GeographicLib
)
set(GeographicLib_INCLUDE_DIRS ${GeographicLib_INCLUDE_DIR})

find_library(GeographicLib_LIBRARIES
  NAMES Geographic
) 

with this instead:
pkg_check_modules(GeographicLib REQUIRED geographiclib)

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

2 participants