Quantcast

Compiling PCL 1.8 with visual studio 2013

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Compiling PCL 1.8 with visual studio 2013

tePer
This post has NOT been accepted by the mailing list yet.
Hey all

I compiled PCL 1.8 on a windows 8.1 machine with vs2013, in 64 bit against the latest versions of the various dependencies, especially
- boost 1.62
- Eigen 3.3

It mostly went smoothly but at the end I hit two Eigen/Boost bumps. I'm only superficially familiar with both boost and eigen - so I'm not sure if the workarounds I used to get PCL to compile make sense or if I badly broke something, so I would value your opinions.

1. When compiling the pcl_ndt2d subproject (e.g. ndt2d.cpp) I got a C2039 compiler error: (see full error in next post)
d:\lib\eigen_3_3\eigen\src/Core/util/XprHelper.h(64): error C2039: 'Literal' : is not a member of 'Eigen::NumTraits<pcl::ndt2d::NormalDist<PointT>>'

Workaround: In ndt_2d.hpp I had to add the typedef "typedef double Literal;" to the numTraits specialization therein to make the error go away. But I'm not entirely sure what the effect of this is.
namespace Eigen
{
  /* This NumTraits specialisation is necessary because NormalDist is used as
   * the element type of an Eigen Matrix.
   */
  template<typename PointT> struct NumTraits<pcl::ndt2d::NormalDist<PointT> >
  {
    typedef double Real;
    typedef double Literal; //<-ADDED THIS
    static Real dummy_precision () { return 1.0; }
    enum {
      IsComplex = 0,
      IsInteger = 0,
      IsSigned = 0,
      RequireInitialization = 1,
      ReadCost = 1,
      AddCost = 1,
      MulCost = 1
    };
  };
}

2. While compiling grid_projection.cpp I got a convoluted C2664 error (see full error message in later post):
D:\lib\boost_1_62_0\boost/unordered/detail/allocate.hpp(497): error C2664: 'Eigen::aligned_allocator<U>::aligned_allocator(const Eigen::aligned_allocator<U> &)' : cannot convert argument 1 from 'std::allocator<T>' to 'const Eigen::aligned_allocator<U> &'
1>          with
1>          [
1>              U=boost::unordered::detail::ptr_node<std::pair<const int,pcl::GridProjection<pcl::PointNormal>::Leaf>>
1>          ]
1>          and
1>          [
1>              T=boost::unordered::detail::ptr_node<std::pair<const int,pcl::GridProjection<pcl::PointNormal>::Leaf>>
1>          ]....

workaround: I could bypass it by removing the allocator template argument when the used boost HashMap is typedefed in grid_projection.h:
// typedef boost::unordered_map<int, Leaf, boost::hash<int>, std::equal_to<int>, Eigen::aligned_allocator<int> > HashMap; //<- Original
typedef boost::unordered_map<int, Leaf, boost::hash<int>, std::equal_to<int> > HashMap; //<-changed

Yes - I feel unconfortable randomly dropping template arguments without understanding the full implications.

So thanks for your replies/comments!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Compiling PCL 1.8 with visual studio 2013

tePer
This post has NOT been accepted by the mailing list yet.
The full error messages:

Full error message error 1

d:\lib\eigen_3_3\eigen\src/Core/util/XprHelper.h(64): error C2039: 'Literal' : is not a member of 'Eigen::NumTraits<pcl::ndt2d::NormalDist<PointT>>'
1>          with
1>          [
1>              PointT=PointType
1>          ]
1>          D:\lib\pcl-pcl-1.8.0_source\pcl-pcl-1.8.0\registration\include\pcl/registration/impl/ndt_2d.hpp(177) : see reference to class template instantiation 'Eigen::internal::promote_scalar_arg<pcl::ndt2d::NormalDist<PointT>,Eigen::Transpose<const Derived>,false>' being compiled
1>          with
1>          [
1>              PointT=PointType
1>  ,            Derived=Eigen::Matrix<double,2,1,0,2,1>
1>          ]
1>          D:\lib\pcl-pcl-1.8.0_source\pcl-pcl-1.8.0\registration\include\pcl/registration/impl/ndt_2d.hpp(168) : while compiling class template member function 'pcl::ndt2d::ValueAndDerivatives<3,double> pcl::ndt2d::NormalDist<PointT>::test(const PointT &,const double &,const double &) const'
1>          with
1>          [
1>              PointT=PointType
1>          ]
1>          D:\lib\pcl-pcl-1.8.0_source\pcl-pcl-1.8.0\registration\include\pcl/registration/impl/ndt_2d.hpp(266) : see reference to function template instantiation 'pcl::ndt2d::ValueAndDerivatives<3,double> pcl::ndt2d::NormalDist<PointT>::test(const PointT &,const double &,const double &) const' being compiled
1>          with
1>          [
1>              PointT=PointType
1>          ]
1>          D:\lib\pcl-pcl-1.8.0_source\pcl-pcl-1.8.0\registration\include\pcl/registration/impl/ndt_2d.hpp(266) : see reference to class template instantiation 'pcl::ndt2d::NormalDist<PointT>' being compiled
1>          with
1>          [
1>              PointT=PointType
1>          ]
1>          D:\lib\pcl-pcl-1.8.0_source\pcl-pcl-1.8.0\registration\include\pcl/registration/impl/ndt_2d.hpp(261) : while compiling class template member function 'pcl::ndt2d::ValueAndDerivatives<3,double> pcl::ndt2d::NDTSingleGrid<PointT>::test(const PointT &,const double &,const double &) const'
1>          with
1>          [
1>              PointT=PointType
1>          ]
1>          D:\lib\pcl-pcl-1.8.0_source\pcl-pcl-1.8.0\registration\include\pcl/registration/impl/ndt_2d.hpp(342) : see reference to function template instantiation 'pcl::ndt2d::ValueAndDerivatives<3,double> pcl::ndt2d::NDTSingleGrid<PointT>::test(const PointT &,const double &,const double &) const' being compiled
1>          with
1>          [
1>              PointT=PointType
1>          ]
1>          D:\lib\pcl-pcl-1.8.0_source\pcl-pcl-1.8.0\registration\include\pcl/registration/impl/ndt_2d.hpp(342) : see reference to class template instantiation 'pcl::ndt2d::NDTSingleGrid<PointT>' being compiled
1>          with
1>          [
1>              PointT=PointType
1>          ]
1>          D:\lib\pcl-pcl-1.8.0_source\pcl-pcl-1.8.0\registration\include\pcl/registration/impl/ndt_2d.hpp(339) : while compiling class template member function 'pcl::ndt2d::ValueAndDerivatives<3,double> pcl::ndt2d::NDT2D<PointTarget>::test(const PointT &,const double &,const double &) const'
1>          with
1>          [
1>              PointTarget=PointType
1>  ,            PointT=PointType
1>          ]
1>          D:\lib\pcl-pcl-1.8.0_source\pcl-pcl-1.8.0\registration\include\pcl/registration/impl/ndt_2d.hpp(416) : see reference to function template instantiation 'pcl::ndt2d::ValueAndDerivatives<3,double> pcl::ndt2d::NDT2D<PointTarget>::test(const PointT &,const double &,const double &) const' being compiled
1>          with
1>          [
1>              PointTarget=PointType
1>  ,            PointT=PointType
1>          ]
1>          D:\lib\pcl-pcl-1.8.0_source\pcl-pcl-1.8.0\registration\include\pcl/registration/impl/ndt_2d.hpp(389) : see reference to class template instantiation 'pcl::ndt2d::NDT2D<PointTarget>' being compiled
1>          with
1>          [
1>              PointTarget=PointType
1>          ]
1>          D:\lib\pcl-pcl-1.8.0_source\pcl-pcl-1.8.0\registration\include\pcl/registration/impl/ndt_2d.hpp(379) : while compiling class template member function 'void pcl::NormalDistributionsTransform2D<PointType,PointType>::computeTransformation(pcl::PointCloud<PointType> &,const Eigen::Matrix4f &)'
1>          D:\lib\pcl-pcl-1.8.0_source\pcl-pcl-1.8.0\tools\ndt2d.cpp(75) : see reference to class template instantiation 'pcl::NormalDistributionsTransform2D<PointType,PointType>' being compiled




Full Error 2:

D:\lib\boost_1_62_0\boost/unordered/detail/allocate.hpp(497): error C2664: 'Eigen::aligned_allocator<U>::aligned_allocator(const Eigen::aligned_allocator<U> &)' : cannot convert argument 1 from 'std::allocator<T>' to 'const Eigen::aligned_allocator<U> &'
1>          with
1>          [
1>              U=boost::unordered::detail::ptr_node<std::pair<const int,pcl::GridProjection<pcl::PointNormal>::Leaf>>
1>          ]
1>          and
1>          [
1>              T=boost::unordered::detail::ptr_node<std::pair<const int,pcl::GridProjection<pcl::PointNormal>::Leaf>>
1>          ]
1>          and
1>          [
1>              U=boost::unordered::detail::ptr_node<std::pair<const int,pcl::GridProjection<pcl::PointNormal>::Leaf>>
1>          ]
1>          Reason: cannot convert from 'std::allocator<T>' to 'const Eigen::aligned_allocator<U>'
1>          with
1>          [
1>              T=boost::unordered::detail::ptr_node<std::pair<const int,pcl::GridProjection<pcl::PointNormal>::Leaf>>
1>          ]
1>          and
1>          [
1>              U=boost::unordered::detail::ptr_node<std::pair<const int,pcl::GridProjection<pcl::PointNormal>::Leaf>>
1>          ]
1>          No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>          D:\lib\boost_1_62_0\boost/unordered/detail/allocate.hpp(704) : see reference to function template instantiation 'Alloc boost::unordered::detail::func::call_select_on_container_copy_construction<Alloc>(const Alloc &,void *)' being compiled
1>          with
1>          [
1>              Alloc=Eigen::aligned_allocator<boost::unordered::detail::ptr_node<std::pair<const int,pcl::GridProjection<pcl::PointNormal>::Leaf>>>
1>          ]
1>          D:\lib\boost_1_62_0\boost/unordered/detail/allocate.hpp(702) : while compiling class template member function 'Eigen::aligned_allocator<U> boost::unordered::detail::allocator_traits<Eigen::aligned_allocator<U>>::select_on_container_copy_construction(const Alloc &)'
1>          with
1>          [
1>              U=boost::unordered::detail::ptr_node<std::pair<const int,pcl::GridProjection<pcl::PointNormal>::Leaf>>
1>  ,            Alloc=Eigen::aligned_allocator<boost::unordered::detail::ptr_node<std::pair<const int,pcl::GridProjection<pcl::PointNormal>::Leaf>>>
1>          ]
1>          D:\lib\boost_1_62_0\boost/unordered/detail/unique.hpp(163) : see reference to function template instantiation 'Eigen::aligned_allocator<U> boost::unordered::detail::allocator_traits<Eigen::aligned_allocator<U>>::select_on_container_copy_construction(const Alloc &)' being compiled
1>          with
1>          [
1>              U=boost::unordered::detail::ptr_node<std::pair<const int,pcl::GridProjection<pcl::PointNormal>::Leaf>>
1>  ,            Alloc=Eigen::aligned_allocator<boost::unordered::detail::ptr_node<std::pair<const int,pcl::GridProjection<pcl::PointNormal>::Leaf>>>
1>          ]
1>          D:\lib\boost_1_62_0\boost/unordered/detail/unique.hpp(120) : see reference to class template instantiation 'boost::unordered::detail::allocator_traits<Eigen::aligned_allocator<U>>' being compiled
1>          with
1>          [
1>              U=boost::unordered::detail::ptr_node<std::pair<const int,pcl::GridProjection<pcl::PointNormal>::Leaf>>
1>          ]
1>          D:\lib\boost_1_62_0\boost/unordered/detail/map.hpp(25) : see reference to class template instantiation 'boost::unordered::detail::pick_node<Eigen::aligned_allocator<int>,std::pair<const K,T>>' being compiled
1>          with
1>          [
1>              K=int
1>  ,            T=pcl::GridProjection<pcl::PointNormal>::Leaf
1>          ]
1>          D:\lib\boost_1_62_0\boost/unordered/unordered_map.hpp(58) : see reference to class template instantiation 'boost::unordered::detail::map<A,K,T,H,P>' being compiled
1>          with
1>          [
1>              A=Eigen::aligned_allocator<int>
1>  ,            K=int
1>  ,            T=pcl::GridProjection<pcl::PointNormal>::Leaf
1>  ,            H=boost::hash<int>
1>  ,            P=std::equal_to<int>
1>          ]
1>          D:\lib\pcl-pcl-1.8.0_source\pcl-pcl-1.8.0\surface\include\pcl/surface/grid_projection.h(463) : see reference to class template instantiation 'boost::unordered::unordered_map<int,pcl::GridProjection<pcl::PointNormal>::Leaf,boost::hash<int>,std::equal_to<int>,Eigen::aligned_allocator<int>>' being compiled
1>          D:\lib\pcl-pcl-1.8.0_source\pcl-pcl-1.8.0\surface\src\grid_projection.cpp(44) : see reference to class template instantiation 'pcl::GridProjection<pcl::PointNormal>' being compiled
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Compiling PCL 1.8 with visual studio 2013

david2
In reply to this post by tePer
I also receive error #1 compiling with VS 2015 in 64 bit against Eigen 3.3.1, 3.3.90 or 3.3.0.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Compiling PCL 1.8 with visual studio 2013

Ryosuke
In reply to this post by tePer
Regarding error#1, I had the same error against eigen 3.3.1 and 3.3.0 recently. On the other side, against 3.2.8, the error disappeared. PCL 1.8.0 has not been suitable for eigen 3.3 yet, I think.

I built PCL 1.8.0 on win 7 with vs2015, but I hope this would help you.

Best regards,
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Compiling PCL 1.8 with visual studio 2013

itabhiyanta
This post has NOT been accepted by the mailing list yet.
The last solution to use 3.2.8 instead of 3.3.9 works. I used pcl1.8 in ubuntu.
Loading...