-
Notifications
You must be signed in to change notification settings - Fork 795
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
Enable and fix unit tests in different archs #183
Conversation
cmake/GtsamBuildTypes.cmake
Outdated
# Check for optional compiler flags, if supported: | ||
include(CheckCXXCompilerFlag) | ||
# See https://github.com/borglab/gtsam/issues/21 | ||
check_cxx_compiler_flag(-faligned-new COMPILER_HAS_FALIGNED_NEW) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the minimum compiler versions of gcc, clang, and VS which support this? If it's only very new compilers, I think we should still prefer to address Eigen alignment issues by appropriate placement of EIGEN_MAKE_ALIGNED_OPERATOR_NEW
so we don't abandon users who have no control over the compiler version in their build environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Please note GTSAM is used by many companies on a variety of platforms, including embedded ones where compiler versions might be lagging. Incidentally, This is also why C++17 and std:shared_ptr are not suited for 4.X versions...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: I have removed this commit from the PR, since it was finally solved in a better way in #185
Many thanks BTW! I’ll wait to approve before the discussion above is resolved, but this allows GTSAM to build on more platforms, so awesome! |
bf80e22
to
c5c031b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is ready for merging @jlblancoc @chrisbeall ??
For example, in the SO4 PoC here: https://godbolt.org/z/vdwsbj Even we define
The result with Taylor series is still accurate to |
(misclicked on close...) |
Any advise on how to deal with this PR? I don't actually have much more time to address a more detailed analysis on optimal unit test thresholds... ;-) |
@jlblancoc Have you looked at the PoC I posted? I think some routines in GTSAM are actually not numerically optimal, so we can definitely first test on 32-bit architectures like i386 and arm and see what unit tests fail, and trace the code path to improve the algorithms. It is on my list for quite a while but I haven't got time... |
@ProfFan if your last comment is a "nice to have" then add an issue and merge this PR? If it is a blocker please refresh us on what the way to proceed is. |
@jlblancoc My apologies for leaving this for a long time! My two cents on this PR are:
|
c5c031b
to
c1513d0
Compare
Hi, Will wait until Travis goes over this last commit before merging. |
c1513d0
to
80ccc60
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hate to be a pain in the butt, but I don't understand what the use is of those two defines. They make the code uglier (IMHO) and I'm not getting under what circumstances anyone would change them. I don't see any logic to set them differently for different platforms, but maybe I'm missing it? I'm just afraid we're adding complexity that will never be used by anyone - but I'm happy to be convinced otherwise.
@dellaert On second thoughts, I think the core cause of this is that some of the exotic architectures supported by Debian lacks proper float operations? Because I think |
Hmm... it's totally true that the macros add one "level of indirection" to the reader. They might have a potential utility, though, although the gain may be marginal so I don't have a strong point defending them: this PR started when I detected tests that passed in x64, but failed in other archs like x32 (see #168 and 54b739f ). In those cases, it would have been faster to change the value in one place instead of changing it in many test points. So, that was my motivation, but let me know what's your preference. It's 99% a style thing, not a big deal. |
I'd prefer we did not do it. I'd even go the opposite way: wherever there isa 1e-9, we remove it, as it is the default value for the parameter. Then, if there is a different value, we suspect there was a reason for it. |
202c754
to
2622acb
Compare
@dellaert : rolled back to good old plain numbers ;-) Approve and merge at your convenience. |
# dh_make generated override targets | ||
# This is example for Cmake (See https://bugs.debian.org/641051 ) | ||
override_dh_auto_configure: | ||
dh_auto_configure -- -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DGTSAM_BUILD_TESTS=OFF -DGTSAM_BUILD_WRAP=OFF -DGTSAM_BUILD_DOCS=OFF -DGTSAM_INSTALL_CPPUNITLITE=OFF -DGTSAM_INSTALL_GEOGRAPHICLIB=OFF -DGTSAM_BUILD_TYPE_POSTFIXES=OFF -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF | ||
dh_auto_configure -- -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DGTSAM_BUILD_TESTS=ON -DGTSAM_BUILD_WRAP=OFF -DGTSAM_BUILD_DOCS=OFF -DGTSAM_INSTALL_CPPUNITLITE=OFF -DGTSAM_INSTALL_GEOGRAPHICLIB=OFF -DGTSAM_BUILD_TYPE_POSTFIXES=OFF -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
behavior change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is one of the main reasons of this PR: to run unit tests on the PPA server to have extra feedback on other architectures, additional to Travis ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PS: We didn't enable tests from the beginning due to some errors, if I recall correctly, but this should be the preferred state
This PR does:
This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)