Skip to content

Eigen build fix, Eigen::all has been renamed.#2399

Merged
alecjacobson merged 1 commit intolibigl:mainfrom
mheistermann:fix-build/eigen-all
Oct 28, 2024
Merged

Eigen build fix, Eigen::all has been renamed.#2399
alecjacobson merged 1 commit intolibigl:mainfrom
mheistermann:fix-build/eigen-all

Conversation

@mheistermann
Copy link
Copy Markdown
Contributor

This fixes the build for recent Eigen versions. Eigen::all was first deprecated and is now only available as Eigen::placeholders:all.

This commit is simply the result of a search-and-replace, gsed -i 's/Eigen::all/Eigen::placeholders::all/' **/*(.)

Checklist

  • All changes meet libigl style-guidelines.
  • Adds new .cpp file.
  • Adds corresponding unit test.
  • This is a minor change.

Replace deprecated/removed Eigen::all with Eigen::placeholders:all.
@alecjacobson
Copy link
Copy Markdown
Contributor

Wait, what?? There isn't a short name like Eigen::all? Why would they do that...

@jdumas
Copy link
Copy Markdown
Collaborator

jdumas commented Jun 28, 2024

Apparently these names are too common: https://gitlab.com/libeigen/eigen/-/merge_requests/649

@leakec
Copy link
Copy Markdown

leakec commented Aug 13, 2024

@mheistermann When using libigl I also had to make the changes shown in the diff below when using the current Eigen master. Not sure if that should be included in this PR or not, but wanted to make someone aware. Without these changes, I get compiler errors regarding using vector operators on matrices.

diff --git a/include/igl/copyleft/cgal/mesh_boolean.cpp b/include/igl/copyleft/cgal/mesh_boolean.cpp
index 02d7a1c1..1de7aed3 100644
--- a/include/igl/copyleft/cgal/mesh_boolean.cpp
+++ b/include/igl/copyleft/cgal/mesh_boolean.cpp
@@ -337,7 +337,7 @@ IGL_INLINE bool igl::copyleft::cgal::mesh_boolean(
 
   const size_t num_selected = selected.size();
   DerivedFC kept_faces(num_selected, 3);
-  DerivedJ  kept_face_indices(num_selected, 1);
+  VectorXJ  kept_face_indices(num_selected);
   for (size_t i=0; i<num_selected; i++) 
   {
     size_t idx = abs(selected[i]) - 1;
@@ -348,7 +348,7 @@ IGL_INLINE bool igl::copyleft::cgal::mesh_boolean(
     {
       kept_faces.row(i) = F.row(idx).reverse();
     }
-    kept_face_indices(i, 0) = CJ[idx];
+    kept_face_indices(i) = CJ[idx];
   }
 #ifdef MESH_BOOLEAN_TIMING
   log_time("extract_output");
@@ -357,7 +357,7 @@ IGL_INLINE bool igl::copyleft::cgal::mesh_boolean(
   // Finally, remove duplicated faces and unreferenced vertices.
   {
     DerivedFC G;
-    DerivedJ JJ;
+    VectorXJ JJ;
     igl::resolve_duplicated_faces(kept_faces, G, JJ);
     J = kept_face_indices(JJ);

@alecjacobson alecjacobson merged commit 8aca5bd into libigl:main Oct 28, 2024
@alecjacobson
Copy link
Copy Markdown
Contributor

lol. I guess this needed to also bump Eigen because with the old Eigen I get tons of warnings now.

PLEASE use Eigen::all instead of Eigen::placeholders::all

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.

4 participants