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

Get rid of boost::assign #1375

Merged
merged 38 commits into from
Jan 10, 2023
Merged

Get rid of boost::assign #1375

merged 38 commits into from
Jan 10, 2023

Conversation

dellaert
Copy link
Member

@dellaert dellaert commented Jan 8, 2023

We used boost::assign heavily before c++11. In 4.3 we want to make boost optional (no pun intended) and hence getting rid of this old cruft is good prep.

Massive PR, with help of copilot and some ChatGPT advice. Most difficult was the use of list_of in the Symbolic unit tests. I created "chaining" constructor/operators in SymbolicBayesNet and SymbolicFactorGraph to ease the pain, and perhaps this would also be nice in BayesTree, but perfection is the enemy of the good...

@dellaert dellaert requested a review from gchenfc January 8, 2023 08:04
@dellaert
Copy link
Member Author

dellaert commented Jan 8, 2023

Hmmm, don't understand why CI keeps failing. Seems to be a Github issue?.

@dellaert
Copy link
Member Author

dellaert commented Jan 8, 2023

@kartikarcot FYI

@dellaert
Copy link
Member Author

dellaert commented Jan 8, 2023

@gchenfc @ProfFan still have a windows issue that I can't parse. Help?

@ProfFan
Copy link
Collaborator

ProfFan commented Jan 8, 2023

@dellaert maybe a missing include in FactorGraph-inst.h?

Copy link
Member

@gchenfc gchenfc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from some small things, I just want to clarify that in some places the changes are just too tiresome so you left them be, e.g. the instances of ListOf, and that there's not some other reasoning.

Otherwise, this is exciting that lots of places look much cleaner and more c++'ish, e.g. all the Ordering o{1, 2, 3} type things :)

gtsam/base/tests/testVerticalBlockMatrix.cpp Outdated Show resolved Hide resolved
gtsam/geometry/CameraSet.h Outdated Show resolved Hide resolved
gtsam/inference/Ordering.h Show resolved Hide resolved
gtsam/inference/FactorGraph.h Show resolved Hide resolved
gtsam/inference/tests/testOrdering.cpp Outdated Show resolved Hide resolved
gtsam/symbolic/tests/testSymbolicEliminationTree.cpp Outdated Show resolved Hide resolved
@gchenfc gchenfc self-requested a review January 9, 2023 00:19
@gchenfc
Copy link
Member

gchenfc commented Jan 9, 2023

You probably already knew these, but sharing in case it helps:

I think tbb failure (ubuntu special cases) is because overload needs to be defined with the correct allocator. i.e. only the overload is defined ChainedVector<Key> -> std::vector<Key>, but KeyVector is std::vector<Key, tbb::tbb_allocator>.
So I think changing the overload function in ChainedVector to:

      operator std::vector<T>() { return result; }  // old
      operator std::vector<T, internal::FastDefaultAllocator::type>() { return result; }  // new

should fix it. Or there may be some additional copying logic needed if there isn't an implicit conversion between vectors of different allocators.

For windows, I'm not smart enough to figure out, but at least I'll try to share what I can: I gathered that it's complaining that std::list<T> requires that T has a comparator (operator<) for the merge implementation, so Errors : FastList<gtsam::Vector> needs Vector to have a comparator. Probably you already knew this, but just thought I'd share in case.

@dellaert dellaert mentioned this pull request Jan 10, 2023
@dellaert
Copy link
Member Author

One more TBB issue which I’ll fix. But, @ProfFan , I’m wondering why we install LLVM in a gcc CI run?

@ProfFan
Copy link
Collaborator

ProfFan commented Jan 10, 2023

One more TBB issue which I’ll fix. But, @ProfFan , I’m wondering why we install LLVM in a gcc CI run?

I think it's just because it's in the common part of CI scripts

@ProfFan
Copy link
Collaborator

ProfFan commented Jan 10, 2023

Appears that GitHub is having a bad time

@dellaert dellaert merged commit f7c6f2b into develop Jan 10, 2023
@dellaert dellaert deleted the feature/Ordering_initializers branch January 10, 2023 23:19
@jlblancoc
Copy link
Member

Great move, and great PR! :-)

Is boost::shared_ptr also in the TO-DO list?

@dellaert
Copy link
Member Author

Thanks !The goal is to get rid of boost in 4.3 altogether.

@mikesheffler
Copy link
Contributor

Hell, yeah.

@dellaert dellaert added this to the Remove BOOST milestone Feb 6, 2023
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.

5 participants