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

Fix Eigen::allocator_type for std::map #1497

Merged
merged 1 commit into from
Jan 13, 2016

Conversation

r9y9
Copy link
Contributor

@r9y9 r9y9 commented Jan 13, 2016

This was causing a static assert while building the PCL with the latest openmp-enabled clang/libcxx (3.8.0-trunk) on osx 10.10.

ref: http://eigen.tuxfamily.org/dox/classEigen_1_1aligned__allocator.html

CMake build options I used:

% cmake -DPCL_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release ..

build result:

% make
...
[ 27%] Building CXX object features/CMakeFiles/pcl_features.dir/src/cppf.cpp.o
In file included from /Users/ryuyamamoto/cv/pcl/features/src/cppf.cpp:40:
In file included from /Users/ryuyamamoto/cv/pcl/features/include/pcl/features/impl/cppf.hpp:44:
In file included from /Users/ryuyamamoto/cv/pcl/features/include/pcl/features/cppf.h:43:
In file included from /Users/ryuyamamoto/cv/pcl/features/include/pcl/features/feature.h:498:
In file included from /Users/ryuyamamoto/cv/pcl/features/include/pcl/features/impl/feature.hpp:44:
In file included from /Users/ryuyamamoto/cv/pcl/search/include/pcl/search/pcl_search.h:44:
In file included from /Users/ryuyamamoto/cv/pcl/search/include/pcl/search/kdtree.h:44:
In file included from /Users/ryuyamamoto/cv/pcl/kdtree/include/pcl/kdtree/kdtree_flann.h:45:
In file included from /Users/ryuyamamoto/cv/pcl/kdtree/include/pcl/kdtree/flann.h:50:
In file included from /usr/local/Cellar/flann/1.8.4_1/include/flann/flann.hpp:41:
In file included from /usr/local/Cellar/flann/1.8.4_1/include/flann/util/matrix.h:35:
In file included from /usr/local/Cellar/flann/1.8.4_1/include/flann/util/serialization.h:5:
/usr/local/bin/../include/c++/v1/map:837:5: error: implicit instantiation of undefined template '__static_assert_test<false>'
    static_assert((is_same<typename allocator_type::value_type, value_type>::value),
    ^
/usr/local/bin/../include/c++/v1/__config:632:35: note: expanded from macro 'static_assert'
    typedef __static_assert_check<sizeof(__static_assert_test<(__b)>)> \
                                  ^
/Users/ryuyamamoto/cv/pcl/features/include/pcl/features/pfh.h:211:131: note: in instantiation of template class 'std::__1::map<std::__1::pair<int, int>, Eigen::Matrix<float, 4, 1, 0, 4, 1>,
      std::__1::less<std::__1::pair<int, int> >, Eigen::aligned_allocator<Eigen::Matrix<float, 4, 1, 0, 4, 1> > >' requested here
      std::map<std::pair<int, int>, Eigen::Vector4f, std::less<std::pair<int, int> >, Eigen::aligned_allocator<Eigen::Vector4f> > feature_map_;
                                                                                                                                  ^
/usr/local/bin/../include/c++/v1/__config:627:24: note: template is declared here
template <bool> struct __static_assert_test;
                       ^
1 error generated.
make[2]: *** [features/CMakeFiles/pcl_features.dir/src/cppf.cpp.o] Error 1
make[1]: *** [features/CMakeFiles/pcl_features.dir/all] Error 2
make: *** [all] Error 2

This patch fixes the above build failure. Also I confirmed that the patch doesn't affect builds with osx default clang (based on llvm3.6.0) on my local environment.

This was causing a static assert while building the PCL with the latest
openmp-enabled clang/libcxx (3.8.0-trunk) on osx 10.10.

CMake build options I used:

```
cmake -DPCL_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release ..
```

ref:
http://eigen.tuxfamily.org/dox/classEigen_1_1aligned__allocator.html
taketwo added a commit that referenced this pull request Jan 13, 2016
Fix Eigen::allocator_type for std::map
@taketwo taketwo merged commit 2d89313 into PointCloudLibrary:master Jan 13, 2016
@taketwo
Copy link
Member

taketwo commented Jan 13, 2016

Thanks!

@r9y9 r9y9 deleted the fix-stdmap-aligned-allocator branch January 14, 2016 01:43
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

Successfully merging this pull request may close these issues.

2 participants