PointCloudLibrary / pcl

Point Cloud Library (PCL)
https://pointclouds.org/
Other
10.01k stars 4.62k forks source link

error: variable 'Dynamic' must have explicitly specified data sharing attributes #5902

Closed yurivict closed 11 months ago

yurivict commented 11 months ago

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):

mvieth commented 11 months ago

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?)

yurivict commented 11 months ago

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.

mvieth commented 11 months ago

@yurivict Thanks for the update :slightly_smiling_face: I created a pull request to fix this: https://github.com/PointCloudLibrary/pcl/pull/5903

mvieth commented 11 months ago

@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.

yurivict commented 11 months ago

Thank you for fixing it!