Comments (10)
@chrisbeall do you remember the reason we allowed this unsafe behavior? We have optional Matrix& everywhere, but that's non-const. Hoping it's only an issue for const & as that is easier to fix (less of them).
from gtsam.
Update: if I remove
if(NOT (${Boost_VERSION} LESS 105600))
message("Ignoring Boost restriction on optional lvalue assignment from rvalues")
list(APPEND GTSAM_COMPILE_DEFINITIONS_PUBLIC BOOST_OPTIONAL_ALLOW_BINDING_TO_RVALUES BOOST_OPTIONAL_CONFIG_ALLOW_BINDING_TO_RVALUES)
endif()
from cmake files, all tests still succeed, which is surprising. Maybe not fully understanding....
from gtsam.
We already had the troublesome usage of boost::optional
in the code, and we did not run into trouble until I upgraded to the latest version of Boost which introduced the warnings and BOOST_OPTIONAL_ALLOW_BINDING_TO_RVALUES
. Issue: Can't build GTSAM with Boost 1.56 with C++11.
It looks like the code here hasn't really changed since then:
gtsam/gtsam/inference/EliminateableFactorGraph-inst.h
Lines 73 to 78 in 823c8bd
Why does it work without
BOOST_OPTIONAL_ALLOW_BINDING_TO_RVALUES
now?
- I don't recall whether we saw this issue on every platform.
- Better compiler? (docs mention wrong behavior with reference to integral types, so not relevant here)
- Boost changes?
Relevant documentation:
- https://www.boost.org/doc/libs/1_70_0/libs/optional/doc/html/boost_optional/dependencies_and_portability/optional_reference_binding.html
- https://www.boost.org/doc/libs/1_70_0/libs/optional/doc/html/boost_optional/optional_references.html
from gtsam.
@dellaert Hi, when I built my own project using CMake, it failed and showed redeclaration error as follow:
In file included from /usr/local/include/gtsam/base/timing.h:118:0,
from /usr/local/include/gtsam/inference/VariableIndex-inl.h:21,
from /usr/local/include/gtsam/inference/VariableIndex.h:195,
from /usr/local/include/gtsam/inference/Ordering.h:24,
from /usr/local/include/gtsam/inference/EliminateableFactorGraph.h:26,
from /usr/local/include/gtsam/linear/GaussianFactorGraph.h:25,
from /usr/local/include/gtsam/nonlinear/NonlinearOptimizerParams.h:24,
from /usr/local/include/gtsam/nonlinear/NonlinearOptimizer.h:22,
from /usr/local/include/gtsam/nonlinear/LevenbergMarquardtOptimizer.h:23,
from /home/lee/experiment/6-phd_program/include/factor_graph_optimization.h:20,
from /home/lee/experiment/6-phd_program/include/system.h:40,
from /home/lee/experiment/6-phd_program/src/system.cpp:1:
/usr/include/boost/timer/timer.hpp:32:1: error: ‘namespace boost::timer { }’ redeclared as different kind of symbol
{
^
In file included from /usr/include/boost/progress.hpp:22:0,
from /home/lee/experiment/6-phd_program/include/surfel_map/synchronized_circular_buffer.h:11,
from /home/lee/experiment/6-phd_program/include/local_map.h:24,
from /home/lee/experiment/6-phd_program/include/mapping.h:33,
from /home/lee/experiment/6-phd_program/include/map_drawer.h:18,
from /home/lee/experiment/6-phd_program/include/system.h:34,
from /home/lee/experiment/6-phd_program/src/system.cpp:1:
/usr/include/boost/timer.hpp:44:7: note: previous declaration ‘class boost::timer’
class timer
^
In file included from /usr/local/include/gtsam/base/timing.h:118:0,
from /usr/local/include/gtsam/inference/VariableIndex-inl.h:21,
from /usr/local/include/gtsam/inference/VariableIndex.h:195,
from /usr/local/include/gtsam/inference/Ordering.h:24,
from /usr/local/include/gtsam/inference/EliminateableFactorGraph.h:26,
from /usr/local/include/gtsam/linear/GaussianFactorGraph.h:25,
from /usr/local/include/gtsam/nonlinear/NonlinearOptimizerParams.h:24,
from /usr/local/include/gtsam/nonlinear/NonlinearOptimizer.h:22,
from /usr/local/include/gtsam/nonlinear/LevenbergMarquardtOptimizer.h:23,
from /home/lee/experiment/6-phd_program/include/factor_graph_optimization.h:20,
from /home/lee/experiment/6-phd_program/include/system.h:40,
from /home/lee/experiment/6-phd_program/src/system.cpp:1:
/usr/include/boost/timer/timer.hpp: In member function ‘std::__cxx11::string boost::timer::cpu_timer::format(short int, const string&) const’:
/usr/include/boost/timer/timer.hpp:68:34: error: ‘format’ is not a member of ‘boost::timer’
{ return ::boost::timer::format(elapsed(), places, format); }
^
/usr/include/boost/timer/timer.hpp: In member function ‘std::__cxx11::string boost::timer::cpu_timer::format(short int) const’:
/usr/include/boost/timer/timer.hpp:70:34: error: ‘format’ is not a member of ‘boost::timer’
{ return ::boost::timer::format(elapsed(), places); }
^
In file included from /usr/local/include/gtsam/inference/VariableIndex-inl.h:21:0,
from /usr/local/include/gtsam/inference/VariableIndex.h:195,
from /usr/local/include/gtsam/inference/Ordering.h:24,
from /usr/local/include/gtsam/inference/EliminateableFactorGraph.h:26,
from /usr/local/include/gtsam/linear/GaussianFactorGraph.h:25,
from /usr/local/include/gtsam/nonlinear/NonlinearOptimizerParams.h:24,
from /usr/local/include/gtsam/nonlinear/NonlinearOptimizer.h:22,
from /usr/local/include/gtsam/nonlinear/LevenbergMarquardtOptimizer.h:23,
from /home/lee/experiment/6-phd_program/include/factor_graph_optimization.h:20,
from /home/lee/experiment/6-phd_program/include/system.h:40,
from /home/lee/experiment/6-phd_program/src/system.cpp:1:
/usr/local/include/gtsam/base/timing.h: At global scope:
/usr/local/include/gtsam/base/timing.h:166:21: error: ‘cpu_timer’ in ‘class boost::timer’ does not name a type
boost::timer::cpu_timer timer_;
^
In file included from /usr/local/include/gtsam/base/timing.h:118:0,
from /usr/local/include/gtsam/inference/VariableIndex-inl.h:21,
from /usr/local/include/gtsam/inference/VariableIndex.h:195,
from /usr/local/include/gtsam/inference/Ordering.h:24,
from /usr/local/include/gtsam/inference/EliminateableFactorGraph.h:26,
from /usr/local/include/gtsam/linear/GaussianFactorGraph.h:25,
from /usr/local/include/gtsam/nonlinear/NonlinearOptimizerParams.h:24,
from /usr/local/include/gtsam/nonlinear/NonlinearOptimizer.h:22,
from /usr/local/include/gtsam/nonlinear/LevenbergMarquardtOptimizer.h:23,
from /home/lee/experiment/6-phd_program/include/factor_graph_optimization.h:20,
from /home/lee/experiment/6-phd_program/include/system.h:40,
from /home/lee/experiment/6-phd_program/include/mapping.h:22,
from /home/lee/experiment/6-phd_program/src/mapping.cpp:1:
/usr/include/boost/timer/timer.hpp:32:1: error: ‘namespace boost::timer { }’ redeclared as different kind of symbol
{
^
In file included from /usr/include/boost/progress.hpp:22:0,
from /home/lee/experiment/6-phd_program/include/surfel_map/synchronized_circular_buffer.h:11,
from /home/lee/experiment/6-phd_program/include/local_map.h:24,
from /home/lee/experiment/6-phd_program/include/map_drawer.h:20,
from /home/lee/experiment/6-phd_program/include/system.h:34,
from /home/lee/experiment/6-phd_program/include/mapping.h:22,
from /home/lee/experiment/6-phd_program/src/mapping.cpp:1:
/usr/include/boost/timer.hpp:44:7: note: previous declaration ‘class boost::timer’
class timer
^
In file included from /usr/local/include/gtsam/base/timing.h:118:0,
from /usr/local/include/gtsam/inference/VariableIndex-inl.h:21,
from /usr/local/include/gtsam/inference/VariableIndex.h:195,
from /usr/local/include/gtsam/inference/Ordering.h:24,
from /usr/local/include/gtsam/inference/EliminateableFactorGraph.h:26,
from /usr/local/include/gtsam/linear/GaussianFactorGraph.h:25,
from /usr/local/include/gtsam/nonlinear/NonlinearOptimizerParams.h:24,
from /usr/local/include/gtsam/nonlinear/NonlinearOptimizer.h:22,
from /usr/local/include/gtsam/nonlinear/LevenbergMarquardtOptimizer.h:23,
from /home/lee/experiment/6-phd_program/include/factor_graph_optimization.h:20,
from /home/lee/experiment/6-phd_program/include/system.h:40,
from /home/lee/experiment/6-phd_program/include/mapping.h:22,
from /home/lee/experiment/6-phd_program/src/mapping.cpp:1:
/usr/include/boost/timer/timer.hpp: In member function ‘std::__cxx11::string boost::timer::cpu_timer::format(short int, const string&) const’:
/usr/include/boost/timer/timer.hpp:68:34: error: ‘format’ is not a member of ‘boost::timer’
{ return ::boost::timer::format(elapsed(), places, format); }
^
/usr/include/boost/timer/timer.hpp: In member function ‘std::__cxx11::string boost::timer::cpu_timer::format(short int) const’:
/usr/include/boost/timer/timer.hpp:70:34: error: ‘format’ is not a member of ‘boost::timer’
{ return ::boost::timer::format(elapsed(), places); }
^
In file included from /usr/local/include/gtsam/inference/VariableIndex-inl.h:21:0,
from /usr/local/include/gtsam/inference/VariableIndex.h:195,
from /usr/local/include/gtsam/inference/Ordering.h:24,
from /usr/local/include/gtsam/inference/EliminateableFactorGraph.h:26,
from /usr/local/include/gtsam/linear/GaussianFactorGraph.h:25,
from /usr/local/include/gtsam/nonlinear/NonlinearOptimizerParams.h:24,
from /usr/local/include/gtsam/nonlinear/NonlinearOptimizer.h:22,
from /usr/local/include/gtsam/nonlinear/LevenbergMarquardtOptimizer.h:23,
from /home/lee/experiment/6-phd_program/include/factor_graph_optimization.h:20,
from /home/lee/experiment/6-phd_program/include/system.h:40,
from /home/lee/experiment/6-phd_program/include/mapping.h:22,
from /home/lee/experiment/6-phd_program/src/mapping.cpp:1:
/usr/local/include/gtsam/base/timing.h: At global scope:
/usr/local/include/gtsam/base/timing.h:166:21: error: ‘cpu_timer’ in ‘class boost::timer’ does not name a type
boost::timer::cpu_timer timer_;
^
The building environment is Ubuntu 16.04 with boost 1.58. I'm not familiar with boost, so could you please take a look on this issue.
from gtsam.
Getting this into 4.1.
from gtsam.
from gtsam.
I think as #156 is merged this can be closed?
from gtsam.
I think we still need to tell cmake about having boost disallow it, I did not see that in the PR. Would be nice as that is frequently the only warning.
from gtsam.
Great, I'll make a PR to remove the flag.
from gtsam.
Closed by #201.
from gtsam.
Related Issues (20)
- Marginalizing in IncrementalFixedLagSmoother sometime leaves the marginalized key in the BayesTree
- python error HOT 3
- Is the NonlinearFactorGraph addPrior function deprecated? HOT 3
- Assertion `SizeAtCompileTime == Dynamic || SizeAtCompileTime == dim' failed.
- terminate called after throwing an instance of 'gtsam::IndeterminantLinearSystemException'
- compile gtsam on the ios using conan failing with a bug HOT 6
- Compiling gtsam using aarch64-linux-android clang++ failed
- Unable to build GTSAM w/ MATLAB toolbox on Windows (stable only) HOT 1
- build failed on Win11 with Visual Studio 2022 (Caused by Eigen3 static_assert) HOT 1
- GTSAM detect wrong data type with Point3 in *windows* HOT 2
- sudo make install gives cxx11 error HOT 10
- Jacobian calculate in Pose3 translation function is correct? HOT 4
- Will the new GTSAM 4.3 be binary compatible with earlier versions of GTSAM 4.x? HOT 3
- Included cephes code should contain a provenance and license HOT 9
- How about implement gtsam::KeyValueMap with hashable container? HOT 4
- Factor between two landmarks HOT 2
- Cephes requires Cmake 3.12, breaks build on Ubuntu Bionic HOT 1
- Cannont build target ALL_BUILD with VS2022 / MSVC v143
- GTSAM was built against a different version of Eigen HOT 12
- Cannot build target gtsam on Windows 10 and CLion with bundled MinGW64 and CMake
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gtsam.