From d2bea788fbff6c775de57a698429072dedb206f8 Mon Sep 17 00:00:00 2001 From: shellyco-code Date: Sun, 15 Nov 2026 13:40:49 +0530 Subject: [PATCH 1/3] Add static assertion when Eigen is not available and default traits is used Surface_mesh_deformation and Mean_curvature_flow_skeletonization rely on Eigen 3 as default traits. When compiled without Eigen3 and default traits are used, a static assertion with an explicit error message is now triggered instead of producing deep template error cascades. Assisted-by: Antigravity:gemini-2.5-pro --- .../include/CGAL/Surface_mesh_deformation.h | 8 ++++++++ .../include/CGAL/Mean_curvature_flow_skeletonization.h | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/Surface_mesh_deformation/include/CGAL/Surface_mesh_deformation.h b/Surface_mesh_deformation/include/CGAL/Surface_mesh_deformation.h index c35bf0a655a1..cc5d87d4e620 100644 --- a/Surface_mesh_deformation/include/CGAL/Surface_mesh_deformation.h +++ b/Surface_mesh_deformation/include/CGAL/Surface_mesh_deformation.h @@ -28,6 +28,7 @@ #include #include #include +#include /* #define CGAL_DEFORM_MESH_USE_EXPERIMENTAL_SCALE // define it to activate optimal scale calculation, @@ -231,6 +232,13 @@ class Surface_mesh_deformation // sparse linear solver #ifndef DOXYGEN_RUNNING + #if !defined(CGAL_EIGEN3_ENABLED) + static_assert(!(std::is_same::value), + "Error: You must either provide 'ST' or link CGAL with the Eigen library"); + static_assert(!(std::is_same::value), + "Error: You must either provide 'CR' or link CGAL with the Eigen library"); + #endif + typedef typename Default::Get< ST, #if defined(CGAL_EIGEN3_ENABLED) diff --git a/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h b/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h index 40c54d999b90..6864eb52dc01 100644 --- a/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h +++ b/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -186,6 +187,11 @@ class Mean_curvature_flow_skeletonization #endif #ifndef DOXYGEN_RUNNING + #if !defined(CGAL_EIGEN3_ENABLED) + static_assert(!(std::is_same::value), + "Error: You must either provide 'SolverTraits_' or link CGAL with the Eigen library"); + #endif + typedef typename Default::Get< SolverTraits_, #if defined(CGAL_EIGEN3_ENABLED) From 332581679a9e91747d9b5f72bd0977cc45f76969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 17 Nov 2026 11:40:23 +0100 Subject: [PATCH 2/3] static assertions for user friendly messages when Eigen3 is not present --- .../CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h | 3 +++ .../Iterative_authalic_parameterizer_3.h | 3 +++ .../CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h | 3 +++ 3 files changed, 9 insertions(+) diff --git a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h index 1bd8a1ee76a9..3b05ff608fcb 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h @@ -34,6 +34,7 @@ #include #include +#include #include #include @@ -767,6 +768,8 @@ class Surface_mesh_geodesic_distances_3 typedef LA LA_type; #endif + static_assert(!std::is_same_v, " Error: CGAL::Eigen3_support target is not linked and no type is provided for LA"); + typedef typename Default::Get< VertexPointMap, typename boost::property_map< TriangleMesh, vertex_point_t>::const_type>::type Vertex_point_map; diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h index c54d0d2678de..91dac42bd99b 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h @@ -48,6 +48,7 @@ #include #include #include +#include #include #define CGAL_SMP_IA_DEBUG_L0 0 @@ -117,6 +118,8 @@ class Iterative_authalic_parameterizer_3 typedef SolverTraits_ Solver_traits; #endif + static_assert(!std::is_same_v, " Error: CGAL::Eigen3_support target is not linked and no type is provided for SolverTraits_"); + /// Triangle mesh type typedef TriangleMesh_ Triangle_mesh; diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h index ae6dcdde6f30..40745b354296 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h @@ -39,6 +39,7 @@ #include #include #include +#include /// \file MVC_post_processor_3.h @@ -99,6 +100,8 @@ class MVC_post_processor_3 typedef SolverTraits_ Solver_traits; #endif + static_assert(!std::is_same_v, " Error: CGAL::Eigen3_support target is not linked and no type is provided for SolverTraits_"); + /// Triangle mesh type typedef TriangleMesh_ Triangle_mesh; From cd709249f83140aaac86eda9668e4ca32345556a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 17 Nov 2026 15:15:49 +0100 Subject: [PATCH 3/3] improve message --- .../CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h | 3 ++- .../include/CGAL/Surface_mesh_deformation.h | 4 ++-- .../Iterative_authalic_parameterizer_3.h | 3 ++- .../CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h | 3 ++- .../include/CGAL/Mean_curvature_flow_skeletonization.h | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h index 3b05ff608fcb..cc4dc1455d81 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h @@ -768,7 +768,8 @@ class Surface_mesh_geodesic_distances_3 typedef LA LA_type; #endif - static_assert(!std::is_same_v, " Error: CGAL::Eigen3_support target is not linked and no type is provided for LA"); + static_assert(!std::is_same_v, + "Error: You must either provide the template parameter 'LA' or link with the target CGAL::Eigen3_support"); typedef typename Default::Get< VertexPointMap, diff --git a/Surface_mesh_deformation/include/CGAL/Surface_mesh_deformation.h b/Surface_mesh_deformation/include/CGAL/Surface_mesh_deformation.h index cc5d87d4e620..fd0af38c8de8 100644 --- a/Surface_mesh_deformation/include/CGAL/Surface_mesh_deformation.h +++ b/Surface_mesh_deformation/include/CGAL/Surface_mesh_deformation.h @@ -234,9 +234,9 @@ class Surface_mesh_deformation #ifndef DOXYGEN_RUNNING #if !defined(CGAL_EIGEN3_ENABLED) static_assert(!(std::is_same::value), - "Error: You must either provide 'ST' or link CGAL with the Eigen library"); + "Error: You must either provide the template parameter 'ST' or link with the target CGAL::Eigen3_support"); static_assert(!(std::is_same::value), - "Error: You must either provide 'CR' or link CGAL with the Eigen library"); + "Error: You must either provide the template parameter 'CR' or link with the target CGAL::Eigen3_support"); #endif typedef typename Default::Get< diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h index 91dac42bd99b..ef64f5095422 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h @@ -118,7 +118,8 @@ class Iterative_authalic_parameterizer_3 typedef SolverTraits_ Solver_traits; #endif - static_assert(!std::is_same_v, " Error: CGAL::Eigen3_support target is not linked and no type is provided for SolverTraits_"); + static_assert(!std::is_same_v, + "Error: You must either provide the template parameter 'SolverTraits_' or link with the target CGAL::Eigen3_support"); /// Triangle mesh type typedef TriangleMesh_ Triangle_mesh; diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h index 40745b354296..c68b4b34b8c1 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h @@ -100,7 +100,8 @@ class MVC_post_processor_3 typedef SolverTraits_ Solver_traits; #endif - static_assert(!std::is_same_v, " Error: CGAL::Eigen3_support target is not linked and no type is provided for SolverTraits_"); + static_assert(!std::is_same_v, + "Error: You must either provide the template parameter 'SolverTraits_' or link with the target CGAL::Eigen3_support"); /// Triangle mesh type typedef TriangleMesh_ Triangle_mesh; diff --git a/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h b/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h index 6864eb52dc01..ea02536efe07 100644 --- a/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h +++ b/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h @@ -189,7 +189,7 @@ class Mean_curvature_flow_skeletonization #ifndef DOXYGEN_RUNNING #if !defined(CGAL_EIGEN3_ENABLED) static_assert(!(std::is_same::value), - "Error: You must either provide 'SolverTraits_' or link CGAL with the Eigen library"); + "Error: You must either provide the template parameter 'SolverTraits_' or link with the target CGAL::Eigen3_support"); #endif typedef typename Default::Get<