-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Add necessary boost headers to pcl/io to build in CUDA mode #2025
Add necessary boost headers to pcl/io to build in CUDA mode #2025
Conversation
What exactly is the compilation error you're getting by not including these? |
1>------ Build started: Project: pcl_io, Configuration: Release x64 ------ |
|
So the problem between Boost and CUDA seem to be related to this https://stackoverflow.com/questions/7399688/cuda-with-boost . Nevertheless, recent boost versions started to take into account CUDA and NVCC. The solution you propose is a workaround which might work only for your particular development environment, but we'll need other users to report problems to fully know. Nevertheless your include lines must be added to pcl/io/boost.h outside the |
Thanks for the feedback, Sergio. I moved the headers into pcl/io/boost.h. Please let me know of any other suggestions. |
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.
We can save some if guards by doing the following: the current header file structure is something like this
#ifndef __CUDACC__
#ifndef Q_MOC_RUN
[...]
<the headers you need came from this level>
[...]
#if BOOST_VERSION >= 104700
[...]
#endif
[...]
#if BOOST_VERSION >= 104900
[...]
#endif
#endif /* Q_MOC_RUN */
#endif /* __CUDACC__*/
In order to reduce the number of if guards and account for your changes, you need to interchange Q_MOC_RUN
and __CUDACC__
indentation levels, like this
#ifndef Q_MOC_RUN
#ifndef __CUDACC__
[...]
<the headers you need came from this level ... (see below)>
[...]
#if BOOST_VERSION >= 104700
[...]
#endif
[...]
#if BOOST_VERSION >= 104900
[...]
#endif
#else /* __CUDACC__*/
<(cont.) ... and they are placed at this level>
#endif /* __CUDACC__*/
#endif /* Q_MOC_RUN */
Please delete also lines 67 and 69. They're useless.
io/include/pcl/io/boost.h
Outdated
@@ -83,5 +82,9 @@ | |||
#include <boost/signals2/slot.hpp> | |||
#endif | |||
#endif | |||
#ifndef Q_MOC_RUN | |||
#include <boost/algorithm/string.hpp> | |||
#include <boost/interprocess/sync/file_lock.hpp> |
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.
You need to erase the copy of this in line 66.
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.
Fixed
Thanks for the detailed instruction. Just updated accordingly. I also added indentation and comments on |
So... I appreciate the intention 😅 but we have this policy of not changing the indentation of the code, unless your changes actually affect those lines. We do this to make sure that our git blame is not "polluted" with authors which were not responsible for those lines. Therefore I need to ask only change what is really necessary. One again my apologies. |
No problem. Just removed the indentation and keep changes to minimum. |
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.
Thanks 👍
Comment to maintainers: squash commits
…udLibrary#2025) Restructure io/include/pcl/io/boost.h to fix compilation in CUDA mode
Currently all boost headers are disabled in pcl/io/boost.h when building in CUDA mode. However, boost is used in file_io.h and pcd_io.h. This PR adds the boost headers to make sure they can build when CUDA is enabled.