Open zfergus opened 1 year ago
Through some clever rewrites of the Jacobian calculation done in the IPC Toolkit (https://github.com/ipc-sim/ipc-toolkit/pull/56), I can now compile the IPC Toolkit with the newer Eigen. Unfortunately, it hits a snag when it needs to compile libigl:
[ 74%] Building CXX object CMakeFiles/polyfem.dir/src/polyfem/basis/PolygonalBasis3d.cpp.o
In file included from /Users/zachary/Development/research/polyfem/polyfem/src/polyfem/basis/PolygonalBasis3d.cpp:18:
In file included from /Users/zachary/.cache/CPM/libigl/121135a7e89a917cf11e894acdbecd58f5460544/include/igl/per_vertex_normals.h:77:
In file included from /Users/zachary/.cache/CPM/libigl/121135a7e89a917cf11e894acdbecd58f5460544/include/igl/per_vertex_normals.cpp:11:
In file included from /Users/zachary/.cache/CPM/libigl/121135a7e89a917cf11e894acdbecd58f5460544/include/igl/per_face_normals.h:76:
In file included from /Users/zachary/.cache/CPM/libigl/121135a7e89a917cf11e894acdbecd58f5460544/include/igl/per_face_normals.cpp:104:
In file included from /Users/zachary/.cache/CPM/libigl/121135a7e89a917cf11e894acdbecd58f5460544/include/igl/cotmatrix.h:79:
In file included from /Users/zachary/.cache/CPM/libigl/121135a7e89a917cf11e894acdbecd58f5460544/include/igl/cotmatrix.cpp:84:
In file included from /Users/zachary/.cache/CPM/libigl/121135a7e89a917cf11e894acdbecd58f5460544/include/igl/diag.h:59:
/Users/zachary/.cache/CPM/libigl/121135a7e89a917cf11e894acdbecd58f5460544/include/igl/diag.cpp:75:10: error: no member named 'DynamicSparseMatrix' in namespace 'Eigen'
Eigen::DynamicSparseMatrix<T, Eigen::RowMajor> dyn_X(V.size(),V.size());
~~~~~~~^
/Users/zachary/.cache/CPM/libigl/121135a7e89a917cf11e894acdbecd58f5460544/include/igl/diag.cpp:75:30: error: 'T' does not refer to a value
Eigen::DynamicSparseMatrix<T, Eigen::RowMajor> dyn_X(V.size(),V.size());
^
/Users/zachary/.cache/CPM/libigl/121135a7e89a917cf11e894acdbecd58f5460544/include/igl/diag.cpp:69:20: note: declared here
template <typename T>
^
/Users/zachary/.cache/CPM/libigl/121135a7e89a917cf11e894acdbecd58f5460544/include/igl/diag.cpp:76:3: error: use of undeclared identifier 'dyn_X'
dyn_X.reserve(V.size());
^
/Users/zachary/.cache/CPM/libigl/121135a7e89a917cf11e894acdbecd58f5460544/include/igl/diag.cpp:80:5: error: use of undeclared identifier 'dyn_X'
dyn_X.coeffRef(it.index(),it.index()) += it.value();
^
/Users/zachary/.cache/CPM/libigl/121135a7e89a917cf11e894acdbecd58f5460544/include/igl/diag.cpp:82:30: error: use of undeclared identifier 'dyn_X'
X = Eigen::SparseMatrix<T>(dyn_X);
^
/Users/zachary/.cache/CPM/libigl/121135a7e89a917cf11e894acdbecd58f5460544/include/igl/diag.cpp:92:10: error: no member named 'DynamicSparseMatrix' in namespace 'Eigen'
Eigen::DynamicSparseMatrix<T, Eigen::RowMajor> dyn_X(V.size(),V.size());
~~~~~~~^
/Users/zachary/.cache/CPM/libigl/121135a7e89a917cf11e894acdbecd58f5460544/include/igl/diag.cpp:92:30: error: 'T' does not refer to a value
Eigen::DynamicSparseMatrix<T, Eigen::RowMajor> dyn_X(V.size(),V.size());
^
/Users/zachary/.cache/CPM/libigl/121135a7e89a917cf11e894acdbecd58f5460544/include/igl/diag.cpp:85:20: note: declared here
template <typename T, typename DerivedV>
^
/Users/zachary/.cache/CPM/libigl/121135a7e89a917cf11e894acdbecd58f5460544/include/igl/diag.cpp:93:3: error: use of undeclared identifier 'dyn_X'
dyn_X.reserve(V.size());
^
/Users/zachary/.cache/CPM/libigl/121135a7e89a917cf11e894acdbecd58f5460544/include/igl/diag.cpp:97:5: error: use of undeclared identifier 'dyn_X'
dyn_X.coeffRef(i,i) += V[i];
^
/Users/zachary/.cache/CPM/libigl/121135a7e89a917cf11e894acdbecd58f5460544/include/igl/diag.cpp:99:30: error: use of undeclared identifier 'dyn_X'
X = Eigen::SparseMatrix<T>(dyn_X);
^
10 errors generated.
make[2]: *** [CMakeFiles/polyfem.dir/src/polyfem/basis/PolygonalBasis3d.cpp.o] Error 1
make[1]: *** [CMakeFiles/polyfem.dir/all] Error 2
make: *** [all] Error 2
It looks like we need to bug the libigl folks to remove the usage of the deprecated Eigen::DynamicSparseMatrix
.
DynamicSparseMatrix stuff was removed from libigl last year as part of https://github.com/libigl/libigl/pull/2016. You should be able to simply update the libigl version used in PolyFEM.
Oh, thanks for letting me know! Maybe they should release a new version (the last one was Feb. 2022).
Dang, so close!
[ 59%] Building CXX object _deps/wildmeshing-toolkit-build/CMakeFiles/wildmeshing_toolkit.dir/src/wmtk/utils/InsertTriangleUtils.cpp.o
In file included from /Users/zachary/.cache/CPM/wildmeshing-toolkit/a785d7e79c8a55035c3bcc3873c9730090efc95a/src/wmtk/utils/InsertTriangleUtils.cpp:3:
In file included from /Users/zachary/.cache/CPM/libigl/3d08427119f752ef9c9358f32224f9bb34efd025/include/igl/remove_duplicate_vertices.h:55:
/Users/zachary/.cache/CPM/libigl/3d08427119f752ef9c9358f32224f9bb34efd025/include/igl/predicates/../remove_duplicate_vertices.cpp:35:33: error: no member named 'all' in namespace 'Eigen'
SV = V(SVI.derived(),Eigen::all);
~~~~~~~^
I think Eigen::all
was renamed to Eigen::placeholders::all
That may be a change with the development version of Eigen, but I think the latest stable release still uses Eigen::all
.
As for tagging a new release of libigl you'll have to check with @alecjacobson. I'm not involved in libigl development anymore.
There is an issue with conflicting versions of Eigen when this option is enabled.
I get this compilation error:
_Originally posted by @zfergus in https://github.com/polyfem/polyfem/pull/239#discussion_r1298966745_