Skip to content

fix(cmake): Add missing Eigen3 dependency for PCL#10

Open
qza36 wants to merge 1 commit intoMIT-SPARK:mainfrom
qza36:fix/missing-eigen-dependency
Open

fix(cmake): Add missing Eigen3 dependency for PCL#10
qza36 wants to merge 1 commit intoMIT-SPARK:mainfrom
qza36:fix/missing-eigen-dependency

Conversation

@qza36
Copy link
Copy Markdown

@qza36 qza36 commented Aug 11, 2025

When building the project on Ubuntu 22.04 with ROS 2 Humble, the compilation failed with the error "fatal error: Eigen/Core: No such file or directory".

This issue occurs because the Point Cloud Library (PCL) has a hard dependency on the Eigen library for linear algebra operations, but this dependency was not declared in our project's CMake configuration.

This commit resolves the build failure by:

  1. Adding find_package(Eigen3 REQUIRED) to locate the Eigen library on the system.
  2. Linking the executable against the Eigen3::Eigen imported target in target_link_libraries. This is the modern CMake approach that also handles include directories automatically.

NOTE: To build this project, developers must have the Eigen library installed. For the specified environment (Ubuntu 22.04), this can be installed by running: sudo apt-get install libeigen3-dev

When building the project on Ubuntu 22.04 with ROS 2 Humble, the compilation failed with the error "fatal error: Eigen/Core: No such file or directory".

This issue occurs because the Point Cloud Library (PCL) has a hard dependency on the Eigen library for linear algebra operations, but this dependency was not declared in our project's CMake configuration.

This commit resolves the build failure by:
1.  Adding `find_package(Eigen3 REQUIRED)` to locate the Eigen library on the system.
2.  Linking the executable against the `Eigen3::Eigen` imported target in `target_link_libraries`. This is the modern CMake approach that also handles include directories automatically.

NOTE: To build this project, developers must have the Eigen library installed. For the specified environment (Ubuntu 22.04), this can be installed by running:
`sudo apt-get install libeigen3-dev`
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.

1 participant