error: variable 'Dynamic' must have explicitly specified data sharing attributes
yurivict opened this issue · comments
Describe the bug
Build fails:
In file included from /wrkdirs/usr/ports/graphics/pcl-pointclouds/work/pcl/common/src/range_image.cpp:38:
In file included from /wrkdirs/usr/ports/graphics/pcl-pointclouds/work/pcl/common/include/pcl/PCLPointCloud2.h:9:
In file included from /wrkdirs/usr/ports/graphics/pcl-pointclouds/work/pcl/common/include/pcl/PCLHeader.h:3:
In file included from /wrkdirs/usr/ports/graphics/pcl-pointclouds/work/pcl/common/include/pcl/memory.h:48:
In file included from /usr/local/include/eigen3/Eigen/Core:163:
/usr/local/include/eigen3/Eigen/src/Core/util/ForwardDeclarations.h:81:42: error: variable 'Dynamic' must have explicitly specified data sharing attributes
81 | template<typename XprType, int BlockRows=Dynamic, int BlockCols=Dynamic, bool InnerPanel = false> class Block;
| ^~~~~~~
/wrkdirs/usr/ports/graphics/pcl-pointclouds/work/pcl/common/src/range_image.cpp:871:11: note: explicit data sharing attribute requested here
871 | default(none) \
| ^
1 error generated.
A clear and concise description of what the bug is.
Context
The FreeBSD port fails to build on FreeBSD.
Your Environment (please complete the following information):
- OS: FreeBSD 15 CURRENT
- Compiler: clang-16
- PCL Version: 1.13.1
Which Clang version is that, exactly? I tested with Clang 16.0.6 and do not have this problem. Also, which Eigen version? 3.4.0 or another version?
Dynamic
is defined as const int Dynamic = -1;
in Eigen. Usually const variables do not need an explicit data sharing attribute (see e.g. https://stackoverflow.com/questions/76957430 , however maybe that is different in newer OpenMP versions?)
eigen-3.4.0 is used.
On the system where the breakage occurs the exact llvm version is llvmorg-17.0.6-0-g6009708b4367
I am sorry for providing a wrong clang version above.
Please also note that C++ libraries are installed separately and can also affect results of compilation.
@yurivict The pull request is merged, so all problems of this kind should be fixed now (at least all problems I found while reproducing). Thanks for reporting this, by the way! In case I overlooked anything, feel free to comment here or open a new issue.
Thank you for fixing it!