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

Error when compiling on OSX 10.11 with clang-3.8svn #1458

Closed
jcar87 opened this issue Dec 1, 2015 · 2 comments
Closed

Error when compiling on OSX 10.11 with clang-3.8svn #1458

jcar87 opened this issue Dec 1, 2015 · 2 comments

Comments

@jcar87
Copy link

jcar87 commented Dec 1, 2015

Compiler: clang-3.8 (from llvm svn. This one supports OpenMP as opposed to Apple's one)
OSX : 10.11.1 El Capitan
Eigen version: 3.2.0

Build error happens with both 1.7.2 versions and up-to-date git

[ 35%] Building CXX object features/CMakeFiles/pcl_features.dir/src/narf.cpp.o
/Users/jcc/dev/pcl-git/features/src/narf.cpp:383:22: error: no viable
      conversion from 'Map<Matrix<[3 * ...]>>' to 'const Map<const Matrix<[3
      * ...]>>'
  ...point = interest_points.points[interest_point_idx].getVector3fMap ();
     ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/Map.h:104:79: note: candidate
      constructor (the implicit copy constructor) not viable: no known
      conversion from 'pcl::Vector3fMap' (aka 'Map<Matrix<float, 3, 1> >') to
      'const Eigen::Map<const Eigen::Matrix<float, 3, 1, 0, 3, 1>, 0,
      Eigen::Stride<0, 0> > &' for 1st argument
  ...PlainObjectType, int MapOptions, typename StrideType> class Map
                                                                 ^
/usr/local/include/eigen3/Eigen/src/Core/Map.h:139:12: note: candidate
      constructor not viable: no known conversion from 'pcl::Vector3fMap' (aka
      'Map<Matrix<float, 3, 1> >') to 'PointerArgType' (aka 'const float *') for
      1st argument
    inline Map(PointerArgType dataPtr, const StrideType& a_stride = Stri...
           ^
1 error generated.
make[2]: *** [features/CMakeFiles/pcl_features.dir/src/narf.cpp.o] Error 1
make[1]: *** [features/CMakeFiles/pcl_features.dir/all] Error 2
make: *** [all] Error 2
@SergioRAgostinho
Copy link
Member

Useful sidenote, clang-omp is working as intended, and its included in homebrew. It could be a good workaround in the meantime.

brew install clang-omp

If you want to contribute with a PR it should be enough, to replace

point = interest_points.points[interest_point_idx].getVector3fMap ()`

with

point = interest_points.points[interest_point_idx].getVector3fMapConst ()`

I tried to reproduce this compilation error in llvm-clang 3.6 (the one in homebrew) but its still not throwing these errors in that version.

@jcar87
Copy link
Author

jcar87 commented Dec 2, 2015

I guess I can give clang-omp a go. I went with a recent one because as far as I know clang-omp hasn't been updated for a while and won't be anymore.

I've tried compiling with:
clang-3.8svn (current svn revision), same error
clang-3.7 (official release), same error
Apple's clang (bundled with Xcode 7) - builds fine. This version of clang was built from clang-3.7svn. But no OpenMP support on this one

Replacing that line unfortunately failed:
/features/src/narf.cpp:383:73: error: no member named 'getVector3fMapConst' in 'pcl::InterestPoint' Vector3fMapConst point = interest_points.points[interest_point_idx].getVector3fMapConst ();

r9y9 added a commit to r9y9/pcl that referenced this issue Feb 16, 2016
openmp-enabled clang

Fixes PointCloudLibrary#1458

Verified that it works openmp-enabled clang trunk (clang version
3.9.0 (https://github.com/llvm-mirror/clang.git
93de2a0297b6b058f67fe1b622f2a084ea752291)) and Xcode-bundled
clang (Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM
3.6.0svn))
r9y9 added a commit to r9y9/pcl that referenced this issue Feb 16, 2016
openmp-enabled clang

Fixes PointCloudLibrary#1458

Verified that it works openmp-enabled clang trunk (clang version
3.9.0 (https://github.com/llvm-mirror/clang.git
93de2a0297b6b058f67fe1b622f2a084ea752291)) and Xcode-bundled
clang (Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM
3.6.0svn))
SergioRAgostinho pushed a commit to SergioRAgostinho/pcl that referenced this issue Aug 19, 2016
openmp-enabled clang

Fixes PointCloudLibrary#1458

Verified that it works openmp-enabled clang trunk (clang version
3.9.0 (https://github.com/llvm-mirror/clang.git
93de2a0297b6b058f67fe1b622f2a084ea752291)) and Xcode-bundled
clang (Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM
3.6.0svn))
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

No branches or pull requests

2 participants