Closed etudemin closed 5 years ago
Hi!
Interesting -- this does not seem to happen with gcc-6, gcc-7 or clang-6. It does happen with gcc-5 though!
If upgrading to gcc-6 or newer is not an option, simply separating function definitions from declarations (with no default template arguments in the former) seems to fix it. In the commit you mentioned (https://github.com/kzampog/cilantro/commit/373cf7048f493e8dfeda6449b39350efc29d838d), the culprit is estimateRigidTransformCombinedMetric3
. Writing the declaration separately:
template <typename ScalarT, class PointCorrWeightEvaluatorT = UnityWeightEvaluator<ScalarT,ScalarT>, class PlaneCorrWeightEvaluatorT = UnityWeightEvaluator<ScalarT,ScalarT>>
bool estimateRigidTransformCombinedMetric3(const ConstVectorSetMatrixMap<ScalarT,3> &dst_p,
const ConstVectorSetMatrixMap<ScalarT,3> &dst_n,
const ConstVectorSetMatrixMap<ScalarT,3> &src_p,
const CorrespondenceSet<typename PointCorrWeightEvaluatorT::InputScalar> &point_to_point_correspondences,
ScalarT point_to_point_weight,
const CorrespondenceSet<typename PlaneCorrWeightEvaluatorT::InputScalar> &point_to_plane_correspondences,
ScalarT point_to_plane_weight,
RigidTransformation<ScalarT,3> &tform,
size_t max_iter = 1,
ScalarT convergence_tol = (ScalarT)1e-5,
const PointCorrWeightEvaluatorT &point_corr_evaluator = PointCorrWeightEvaluatorT(),
const PlaneCorrWeightEvaluatorT &plane_corr_evaluator = PlaneCorrWeightEvaluatorT());
followed by the definition:
template <typename ScalarT, class PointCorrWeightEvaluatorT, class PlaneCorrWeightEvaluatorT>
bool estimateRigidTransformCombinedMetric3(const ConstVectorSetMatrixMap<ScalarT,3> &dst_p,
const ConstVectorSetMatrixMap<ScalarT,3> &dst_n,
const ConstVectorSetMatrixMap<ScalarT,3> &src_p,
const CorrespondenceSet<typename PointCorrWeightEvaluatorT::InputScalar> &point_to_point_correspondences,
ScalarT point_to_point_weight,
const CorrespondenceSet<typename PlaneCorrWeightEvaluatorT::InputScalar> &point_to_plane_correspondences,
ScalarT point_to_plane_weight,
RigidTransformation<ScalarT,3> &tform,
size_t max_iter,
ScalarT convergence_tol,
const PointCorrWeightEvaluatorT &point_corr_evaluator,
const PlaneCorrWeightEvaluatorT &plane_corr_evaluator)
{
// ...
// rest of the body here
should fix the error with gcc-5. Simply commenting out all OpenMP #pragma
s should also solve the compilation issue, but you would lose some performance in that case.
Since there are more custom reductions in more recent commits, I will try to investigate more and push a proper solution for gcc-5 soon!
Hi kzampog,
I have followed your suggestions (separating function definitions from declarations / upgrading to gcc-6).
Both of the options can work, thank you very much!
I applied a fix in the latest commit (https://github.com/kzampog/cilantro/commit/36d99293a91502399c068b9cdf9b8fa12766edab) -- it seems to do the trick with gcc-5.
Again, thank you for reporting this!
Thank you very much. It can work on my computer (with gcc-5) now.
Hi kzampog,
I am trying to compile the latest version of the project.
It works well when I compile the branch released before 373cf70 (Various improvements and additions).
But unfortunately when I compile the branch 373cf70, there are some errors.
It seems like the codes added in include/cilantro/rigid_registration_utilities.hpp would trigger some error:
The errors are shown as follows:
Is there any hint of how to solve this issue?
Thanks for your help and kind reply!