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

Constrained depends on Boost even when building GTSAM without Boost #1982

Closed
thorstink opened this issue Jan 17, 2025 · 1 comment · Fixed by #1984
Closed

Constrained depends on Boost even when building GTSAM without Boost #1982

thorstink opened this issue Jan 17, 2025 · 1 comment · Fixed by #1984

Comments

@thorstink
Copy link
Contributor

Description

There's a boost function reference missing and that is preventing compilation of gtsam, even though I want to compile without Boost. If I checkout d6581cdef98ed6acb263afca14d9ce579038ed47, the latest development before #1789 compilation progresses beyond the constrained-folder.

Steps to reproduce

cmake \
    -DGTSAM_ALLOW_DEPRECATED_SINCE_V43:BOOL="0" \
    -DGTSAM_SLOW_BUT_CORRECT_BETWEENFACTOR:BOOL="1" \
    -DGTSAM_USE_BOOST_FEATURES:BOOL="0" \
    -DGTSAM_UNSTABLE_BUILD_PYTHON:BOOL="0" \
    -DGTSAM_BUILD_UNSTABLE:BOOL="0" \
    -DGTSAM_BUILD_WITH_CCACHE:BOOL="0" \
    -DGTSAM_BUILD_EXAMPLES_ALWAYS:BOOL="0" \
    -DGTSAM_USE_SYSTEM_EIGEN:BOOL="1" \
    -DGTSAM_BUILD_TESTS:BOOL="0" \
    -DGTSAM_SLOW_BUT_CORRECT_EXPMAP:BOOL="1" \
    -DGTSAM_WITH_TBB:BOOL="0" \
    -DGTSAM_ENABLE_BOOST_SERIALIZATION:BOOL="0" \
    -DGTSAM_DT_MERGING:BOOL="1" \
    -DGTSAM_LIBRARY_TYPE:STRING="SHARED" \
    -DCMAKE_CXX_STANDARD=20 \
    ..
make -j4 install

Expected behavior

A clean build

Environment

Ubuntu 24.04, GCC 13, no Boost installed systemwide.

Additional information

actual output:

[ 44%] Building CXX object gtsam/CMakeFiles/gtsam.dir/basis/Chebyshev.cpp.o
[ 46%] Building CXX object gtsam/CMakeFiles/gtsam.dir/basis/Chebyshev2.cpp.o
[ 46%] Building CXX object gtsam/CMakeFiles/gtsam.dir/constrained/InequalityPenaltyFunction.cpp.o
[ 46%] Building CXX object gtsam/CMakeFiles/gtsam.dir/constrained/NonlinearEqualityConstraint.cpp.o
In file included from /home/thomas/libs/gtsam/gtsam/constrained/NonlinearEqualityConstraint.h:20,
                 from /home/thomas/libs/gtsam/gtsam/constrained/NonlinearEqualityConstraint.cpp:18:
/home/thomas/libs/gtsam/gtsam/constrained/NonlinearConstraint.h: In member function ‘void gtsam::NonlinearConstraint::serialize(ARCHIVE&, unsigned int)’:
/home/thomas/libs/gtsam/gtsam/constrained/NonlinearConstraint.h:85:31: error: ‘make_nvp’ is not a member of ‘boost::serialization’
   85 |     ar& boost::serialization::make_nvp("NonlinearConstraint",
      |                               ^~~~~~~~
/home/thomas/libs/gtsam/gtsam/constrained/NonlinearEqualityConstraint.h: In member function ‘void gtsam::NonlinearEqualityConstraint::serialize(ARCHIVE&, unsigned int)’:
/home/thomas/libs/gtsam/gtsam/constrained/NonlinearEqualityConstraint.h:47:31: error: ‘make_nvp’ is not a member of ‘boost::serialization’
   47 |     ar& boost::serialization::make_nvp("NonlinearEqualityConstraint",
      |                               ^~~~~~~~
/home/thomas/libs/gtsam/gtsam/constrained/NonlinearEqualityConstraint.h: In member function ‘void gtsam::ExpressionEqualityConstraint<T>::serialize(ARCHIVE&, unsigned int)’:
/home/thomas/libs/gtsam/gtsam/constrained/NonlinearEqualityConstraint.h:93:31: error: ‘make_nvp’ is not a member of ‘boost::serialization’
   93 |     ar& boost::serialization::make_nvp("ExpressionEqualityConstraint",
      |                               ^~~~~~~~
/home/thomas/libs/gtsam/gtsam/constrained/NonlinearEqualityConstraint.h:97:9: error: there are no arguments to ‘BOOST_SERIALIZATION_NVP’ that depend on a template parameter, so a declaration of ‘BOOST_SERIALIZATION_NVP’ must be available [-fpermissive]
   97 |     ar& BOOST_SERIALIZATION_NVP(dims_);
      |         ^~~~~~~~~~~~~~~~~~~~~~~
/home/thomas/libs/gtsam/gtsam/constrained/NonlinearEqualityConstraint.h:97:9: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/home/thomas/libs/gtsam/gtsam/constrained/NonlinearEqualityConstraint.h: In member function ‘void gtsam::ZeroCostConstraint::serialize(ARCHIVE&, unsigned int)’:
/home/thomas/libs/gtsam/gtsam/constrained/NonlinearEqualityConstraint.h:139:31: error: ‘make_nvp’ is not a member of ‘boost::serialization’
  139 |     ar& boost::serialization::make_nvp("ZeroCostConstraint",
      |                               ^~~~~~~~
/home/thomas/libs/gtsam/gtsam/constrained/NonlinearEqualityConstraint.h:141:9: error: there are no arguments to ‘BOOST_SERIALIZATION_NVP’ that depend on a template parameter, so a declaration of ‘BOOST_SERIALIZATION_NVP’ must be available [-fpermissive]
  141 |     ar& BOOST_SERIALIZATION_NVP(factor_);
      |         ^~~~~~~~~~~~~~~~~~~~~~~
/home/thomas/libs/gtsam/gtsam/constrained/NonlinearEqualityConstraint.h: In member function ‘void gtsam::NonlinearEqualityConstraints::serialize(ARCHIVE&, unsigned int)’:
/home/thomas/libs/gtsam/gtsam/constrained/NonlinearEqualityConstraint.h:174:31: error: ‘make_nvp’ is not a member of ‘boost::serialization’
  174 |     ar& boost::serialization::make_nvp("NonlinearEqualityConstraints",
      |                               ^~~~~~~~

@varunagrawal
Copy link
Collaborator

This is because @yetongumich is using the older #ifdef instead of the correct #if.

@varunagrawal varunagrawal mentioned this issue Jan 20, 2025
@varunagrawal varunagrawal linked a pull request Jan 20, 2025 that will close this issue
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 a pull request may close this issue.

2 participants