fix(cmake): Add missing Eigen3 dependency for PCL#10
Open
qza36 wants to merge 1 commit intoMIT-SPARK:mainfrom
Open
fix(cmake): Add missing Eigen3 dependency for PCL#10qza36 wants to merge 1 commit intoMIT-SPARK:mainfrom
qza36 wants to merge 1 commit intoMIT-SPARK:mainfrom
Conversation
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`
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.
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:
find_package(Eigen3 REQUIRED)to locate the Eigen library on the system.Eigen3::Eigenimported target intarget_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