-
Notifications
You must be signed in to change notification settings - Fork 29
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
remove boost dependency as much as possible #241
Comments
Actually, @rijobro how useful was |
I think my changes to the geometry pulled in boost for linear algebra. I could use something else. |
I should have said “dependency on compiled boost libraries”. Include-only ones are fine as far as I can see.
|
I can get rid of it pretty easily. How do I know if each aspect of boost that I'm using is just from the header, or requires the compiled Boost libraries? If I remove all CMake lines akin to |
not sure if there's an easy way to find out if it's header-only, except by checking... I'm somewhat amazed that you don't need to link to Obviously, or we can get Mathworks to do the proper thing and link privately/statically... |
Ok. Well I've removed linking to the boost libs (58f4f55). If this becomes a problem as the boost version changes, I'll cross that bridge when I get to it. |
Another motivation is at SyneRBI/SIRF-SuperBuild#161 |
@evgueni-ovtchinnikov could you check if we actually need |
At present, our CMake files force linking with Of course, even if we don't really need to link with Seems that we can get rid of |
|
let's
but leave the rest as-is for now ( |
* started replacing boost::iequals with sirf::iequals * finished replacing boost::iequals with sirf::iequals * removed obsolete sources from cGadgetron * removed obsolete headers from cGadgetron * replaced boost::mutex with std::mutex * removed unused #include <boost/shared_ptr.hpp> from JacobiCG.h * removed includes of obsolete ismrmrd_fftw.h * small amendment in JacobiCG.h * added missing #include<cstring> (for std::memcpy) * added missing #include<memory> (for std::shared_ptr) * sorted out de-boost build on linux, fixes #241 * [ci skip] small amendments * [ci skip] doxygen comments in iequals.h corrected
We're having problems with conflicts with boost versions. This is a serious problem for the boost libraries that are compiled (i.e. not header-only), see e.g. #240, although header-only libraries could still throw up surprising things.
Doing this completely might be hard, but we should at least aim to get rid of explicit includes of boost in our .h files. That way, the boost dependency could be made private. But far better would be to get rid of it completely.
It seems to me that there are at present only few places where we use boost. For instance, in our .h files.
Quite a few of these seem to be left-overs from the past. Most can and should be replaced by their
std
versions, in particular uses ofboost/shared_ptr.hpp
. Hopefullymutex
as well.SIRFReg depends on
boost/filesystem
. Sadly,std::filesystem
exists from C++-14 only. I'm a bit reluctant to require C++-14, although Gadgetron does it now anyway. I suggest to do a CMake check on existence ofstd::filesystem
, and only useboost::filesystem
if we need to.If we cannot remove the dependency completely, a trick to get rid of it in the .h files is to use pre-declaration in the .h, and include it in the .cpp. This works for pointers and references. So, as opposed to have a
boost::filesystem
member, we could have astd::shared_ptr<boost::filesystem>
. That's a bit ugly though.The text was updated successfully, but these errors were encountered: