Autocuts icon indicating copy to clipboard operation
Autocuts copied to clipboard

Cannot clone & build -- submodule error

Open nmwsharp opened this issue 6 years ago • 8 comments

Hi, I'm not able to clone and build this repo on a clean setup.

When I run

git clone https://github.com/Roipo/Autocuts.git
cd Autocuts/
git submodule update --init --recursive

the last command fails with

error: no such remote ref c4cc458aa2ab8ac2a9a5d3298cc43f304ab7080b
Fetched in submodule path 'libigl', but it did not contain c4cc458aa2ab8ac2a9a5d3298cc43f304ab7080b. Direct fetching of that commit failed.

Sounds like something might be up with the submodule configuration? Can you confirm that the repo builds from a clean clone? Am I missing a step?

Thanks!

nmwsharp avatar Apr 16 '18 01:04 nmwsharp

I'm having the same problem too

MotivaCG avatar Apr 24 '18 17:04 MotivaCG

It should work now. Can you please confirm?

Roipo avatar Apr 24 '18 22:04 Roipo

I've managed to download it now unfortunatly lots of errors were triggered under Win7 x64, most of them are present in several files like:

Error C2039 'Scalar': is not a member of 'Eigen::internal::traits<Derived>' Autocuts_bin ...SparseCore\SparseUtil.h 98

Severity Code Description Project File Line Suppression State Error C2065 'M_PI': undeclared identifier (compiling source file ...\src\Newton.cpp) Autocuts_bin ...\src\Utils.h 170 (there is no #define for M_PI)

or

omp_get_max_threads() (there is no include for <omp.h>)

Regards.

MotivaCG avatar Apr 25 '18 07:04 MotivaCG

Thanks for the update! The library now clones successfully, but now there are other issues (I think these are both the same as what the other commenter mentioned, though I'm on a different platform).

(1) I get an Eigen template type error

      '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;

which stems from this line. Glancing that super quickly, it looks like the code multiplies an SparseMatrix<int> times a SparseMatrix<double>, and expects a SparseMatrix<int> as a result, which can cause problems, but of course with Eigen we get a super cryptic error message. However, that should be compile error on all platforms, so I'm not sure why that would lead to a compile error for me but not you. Perhaps a submodule pulled in a newer version of Eigen that checks type errors more aggressively or something? I don't know.

(2) It look like some OpenMP commands are not guarded by the Use_OpenMP flag, such as here. However, this is less of a showstopper for me personally, as I can go find a compiler which supports OpenMP if need be.

nmwsharp avatar Apr 25 '18 12:04 nmwsharp

@nmwsharp Adding the explicit type cast: SpMati V2Vint = V2V.cast<int>(); to the line you mentioned, generates new errors:

'Eigen::internal::unary_evaluator<T,Eigen::internal::IteratorBased,double>::InnerIterator::Scalar': cannot access private typedef declared in class 'Eigen::internal::unary_evaluator<T,Eigen::internal::IteratorBased,double>::InnerIterator' Autocuts_bin d:\workspace\repositories\autocuts\libigl\external\nanogui\ext\eigen\eigen\src\SparseCore\SparseDiagonalProduct.h 75

I'm trying to reproduce this project using visual studios 2017 x64 build. Any info on how to go about this?

chrisleong-nvg avatar Apr 08 '19 07:04 chrisleong-nvg

@chrisleong-nvg Unfortunately this was a while ago, and I no longer have the code around, nor do I remember exactly what changes I made.

I did get the application building eventually by chasing down Eigen errors like the ones above and a few other small things. This amounted to various small 1-line changes like adding casts and types, and shuffling some includes and namespaces.

However, once the application built, I had some trouble generating cuts, so it would seem I may have introduced bugs while making those modifications!

nmwsharp avatar Apr 08 '19 19:04 nmwsharp

I've solved all the eigen related compilation issues including the need for the explicit cast by downgrading the eigen version to v3.2.10. All the errors went away after that. I'm assuming that the original author links a submodule to nanogui which uses a different version of eigen from what he originally used. Hence the provisioned version when pulled recursively now uses eigen 3.3.9

chrisleong-nvg avatar Apr 09 '19 05:04 chrisleong-nvg

Hey guys, thanks for all the work. I am not maintaining this repo anymore, but there is a new version coming. I'll link to it once it's up.

Roipo avatar Apr 09 '19 08:04 Roipo