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

fix maybe unitialized warning #2033

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

jmackay2
Copy link
Contributor

This fixes the maybe uninitialized warning by checking the output of svd.

@jmackay2 jmackay2 marked this pull request as ready for review February 25, 2025 04:52
@ProfFan
Copy link
Collaborator

ProfFan commented Feb 25, 2025

Hmm, actually I wonder if this would actually fix the problem? Is GCC that smart?

@jmackay2
Copy link
Contributor Author

Hmm, actually I wonder if this would actually fix the problem? Is GCC that smart?

I was able to test on two different computers with Ubuntu 24.04. I get the warning without the GCC preamble. With the code addition, it builds successfully with no warning.

@dellaert dellaert merged commit a83c50d into borglab:develop Feb 27, 2025
36 checks passed
@berndpfrommer
Copy link
Collaborator

This commit seems to break the build of our nightly packages:

/<<PKGBUILDDIR>>/gtsam/geometry/FundamentalMatrix.cpp: In constructor ‘gtsam::FundamentalMatrix::FundamentalMatrix(const Matrix3&)’:
/<<PKGBUILDDIR>>/gtsam/geometry/FundamentalMatrix.cpp:39:11: error: ‘class Eigen::JacobiSVD<Eigen::Matrix<double, 3, 3>, 2>’ has no member named ‘info’
   39 |   if (svd.info() != Eigen::ComputationInfo::Success) {
      |           ^~~~

@berndpfrommer
Copy link
Collaborator

The broken build is on an arm64 device running Ubuntu 20.04 (focal fossey). Not sure why I have not seen broken build messages for amd64, but that could still come.
It looks like the Eigen library does not provide the info() method for this case. The version of Eigen that is running on Ubuntu 20.04 is 3.3.7-2.
It turns out the info() method was added to JacobiSVD "only" 3 years ago.

@jmackay2
Copy link
Contributor Author

jmackay2 commented Mar 1, 2025

The broken build is on an arm64 device running Ubuntu 20.04 (focal fossey). Not sure why I have not seen broken build messages for amd64, but that could still come. It looks like the Eigen library does not provide the info() method for this case. The version of Eigen that is running on Ubuntu 20.04 is 3.3.7-2. It turns out the info() method was added to JacobiSVD "only" 3 years ago.

Yes, this can happen if you chose not to use the Eigen version that comes with gtsam. I'll put in a PR to fix this issue soon.

@jmackay2 jmackay2 mentioned this pull request Mar 1, 2025
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.

4 participants