Skip to content

fix maybe unitialized warning#2033

Merged
dellaert merged 1 commit intoborglab:developfrom
jmackay2:fix_maybe_uninitialized
Feb 27, 2025
Merged

fix maybe unitialized warning#2033
dellaert merged 1 commit intoborglab:developfrom
jmackay2:fix_maybe_uninitialized

Conversation

@jmackay2
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

ProfFan commented Feb 25, 2025

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

@jmackay2
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@jmackay2 jmackay2 deleted the fix_maybe_uninitialized branch March 20, 2025 02:25
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