Autocuts
Autocuts copied to clipboard
Fails to build on macOS
On macOS LLVM (brew) 5.0.1 and 6.0.0, after updating CMakeFile.txt to point to the correct clang, build fails on an Eigen compilation issue:
[ 79%] Building CXX object CMakeFiles/Autocuts_bin.dir/src/ApplicationPipeline.cpp.o
/usr/local/Cellar/llvm/5.0.1/bin/clang++ -DENABLE_SERIALIZATION_CORE_ONLY -DIGL_NO_MOSEK -DIGL_VIEWER_WITH_NANOGUI -DIGL_VIEWER_WITH_NANOGUI_IO -DIGL_VIEWER_WITH_NANOGUI_MULTIMESH -DIGL_VIEWER_WITH_NANOGUI_SERIALIZATION -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS -I/Users/charles/Documents/GitHub/Autocuts/libigl/shared/cmake/../../external/nanogui/ext/eigen -I/Users/charles/Documents/GitHub/Autocuts/libigl/shared/cmake/../../include -I/Users/charles/Documents/GitHub/Autocuts/libigl/shared/cmake/../../external/nanogui/ext/glfw/include -I/Users/charles/Documents/GitHub/Autocuts/libigl/shared/cmake/../../external/nanogui/include -I/Users/charles/Documents/GitHub/Autocuts/libigl/shared/cmake/../../external/nanogui/ext/nanovg/src -I/Users/charles/Documents/GitHub/Autocuts/libigl/shared/cmake/../../external/stb_image -I/Users/charles/Documents/GitHub/Autocuts/libigl/include/../external/nanogui/include -I/Users/charles/Documents/GitHub/Autocuts/libigl/include/../external/nanogui/ext/nanovg/src -std=c++14 -Wno-deprecated-declarations -fopenmp -O3 -DNDEBUG -o CMakeFiles/Autocuts_bin.dir/src/ApplicationPipeline.cpp.o -c /Users/charles/Documents/GitHub/Autocuts/src/ApplicationPipeline.cpp
In file included from /Users/charles/Documents/GitHub/Autocuts/src/ApplicationPipeline.cpp:1:
/Users/charles/Documents/GitHub/Autocuts/src/ApplicationPipeline.h:27:8: warning: 'init' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
void init(igl::viewer::Viewer *viewer);
^
/Users/charles/Documents/GitHub/Autocuts/libigl/shared/cmake/../../include/igl/viewer/ViewerPlugin.h:47:27: note: overridden virtual function is here
IGL_INLINE virtual void init(Viewer *_viewer)
^
In file included from /Users/charles/Documents/GitHub/Autocuts/src/ApplicationPipeline.cpp:1:
In file included from /Users/charles/Documents/GitHub/Autocuts/src/ApplicationPipeline.h:6:
In file included from /Users/charles/Documents/GitHub/Autocuts/libigl/shared/cmake/../../include/igl/viewer/Viewer.h:19:
In file included from /Users/charles/Documents/GitHub/Autocuts/libigl/shared/cmake/../../external/nanogui/ext/eigen/Eigen/Core:441:
/Users/charles/Documents/GitHub/Autocuts/libigl/shared/cmake/../../external/nanogui/ext/eigen/Eigen/src/Core/Product.h:29:116: error: no type named 'ReturnType' in 'Eigen::ScalarBinaryOpTraits<int,
double, Eigen::internal::scalar_product_op<int, double> >'
typedef typename ScalarBinaryOpTraits<typename traits<LhsCleaned>::Scalar, typename traits<RhsCleaned>::Scalar>::ReturnType Scalar;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
/Users/charles/Documents/GitHub/Autocuts/libigl/shared/cmake/../../external/nanogui/ext/eigen/Eigen/src/Core/EigenBase.h:40:30: note: in instantiation of template class
'Eigen::internal::traits<Eigen::Product<Eigen::Transpose<Eigen::SparseMatrix<int, 0, int> >, Eigen::SparseMatrix<double, 0, int>, 2> >' requested here
typedef typename internal::traits<Derived>::StorageKind StorageKind;
^
/Users/charles/Documents/GitHub/Autocuts/libigl/shared/cmake/../../external/nanogui/ext/eigen/Eigen/src/SparseCore/SparseMatrixBase.h:27:12: note: in instantiation of template class
'Eigen::EigenBase<Eigen::Product<Eigen::Transpose<Eigen::SparseMatrix<int, 0, int> >, Eigen::SparseMatrix<double, 0, int>, 2> >' requested here
: public EigenBase<Derived>
^
/Users/charles/Documents/GitHub/Autocuts/libigl/shared/cmake/../../external/nanogui/ext/eigen/Eigen/src/Core/Product.h:140:28: note: in instantiation of template class
'Eigen::SparseMatrixBase<Eigen::Product<Eigen::Transpose<Eigen::SparseMatrix<int, 0, int> >, Eigen::SparseMatrix<double, 0, int>, 2> >' requested here
class ProductImpl : public internal::generic_xpr_base<Product<Lhs,Rhs,Option>, MatrixXpr, StorageKind>::type
^
/Users/charles/Documents/GitHub/Autocuts/libigl/shared/cmake/../../external/nanogui/ext/eigen/Eigen/src/Core/Product.h:71:24: note: in instantiation of template class
'Eigen::ProductImpl<Eigen::Transpose<Eigen::SparseMatrix<int, 0, int> >, Eigen::SparseMatrix<double, 0, int>, 2, Eigen::Sparse>' requested here
class Product : public ProductImpl<_Lhs,_Rhs,Option,
^
/Users/charles/Documents/GitHub/Autocuts/src/Utils.h:254:32: note: in instantiation of template class 'Eigen::Product<Eigen::Transpose<Eigen::SparseMatrix<int, 0, int> >, Eigen::SparseMatrix<double, 0,
int>, 2>' requested here
SpMati t = (Ic_G.transpose() * V2V * Ic_K);
^
1 warning and 1 error generated.
make[2]: *** [CMakeFiles/Autocuts_bin.dir/src/ApplicationPipeline.cpp.o] Error 1
make[1]: *** [CMakeFiles/Autocuts_bin.dir/all] Error 2
make: *** [all] Error 2
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.13.4
BuildVersion: 17E202
Same here. Os X 10.13.3. Actually it looks like this error is blocking the build for some time now. A shame, looks like it's a neat tool, but I haven't been able to try it yet...
@kabukunz The problem with this line in Utils.h is that it is combining integer-valued matrices and double-valued matrices without telling how to convert them to make them compatible. My GUESS is that the fixed version is:
SpMati t = (Ic_G.transpose().cast<double>() * V2V * Ic_K.cast<double>()).cast<int>();
That compiles, but I can't swear it does the right thing.