nzfeng / signed-heat-3d

MIT License
71 stars 8 forks source link

Auto dependency fetching for compiling seems to be broken #2

Closed BartBruininks closed 2 months ago

BartBruininks commented 2 months ago

Following the install instructions does not result in a positive outcome:

git clone --recursive https://github.com/nzfeng/signed-heat-3d.git
cd SHM # <-- should be cd signed-heat-3d (minor) 
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release .. # use `Debug` mode to enable checks
make -j8 # or however many cores you want to use
bin/main /path/to/mesh

Using this gives an error because the cd SHM refers to the wrong folder name (trivial to solve). However, more serious is the fact that the deps folders are all empty. This gives the following error duing cmake:

path_to/signed-heat-3d/deps/polyscope/deps/tetgen
  does not contain a CMakeLists.txt file.

Obviously, the real problem is more severe than just a missing CMakeList.txt. All other deps suffer from the same fate.

By running the following command removing the git repo and redoing the install seems to alleviate this issue:

git config --global --add safe.directory path_to/crane/signed-heat-3d/deps/tetgen

However, the following deps cannot be fixed in this manner and keep giving this error, which seems to be a recursion of the stated above:

CMake Error at deps/polyscope/deps/CMakeLists.txt:14 (add_subdirectory):
  The source directory

    /home/bart/projects/others/kcrane/signed-heat-3d/deps/polyscope/deps/glfw

  does not contain a CMakeLists.txt file.

CMake Error at deps/polyscope/deps/CMakeLists.txt:20 (add_subdirectory):
  The source directory

    /home/bart/projects/others/kcrane/signed-heat-3d/deps/polyscope/deps/glm

  does not contain a CMakeLists.txt file.

CMake Error at deps/polyscope/deps/CMakeLists.txt:21 (target_compile_definitions):
  Cannot specify compile definitions for target "glm" which is not built by
  this project.

CMake Error at deps/polyscope/deps/CMakeLists.txt:22 (set_target_properties):
  set_target_properties Can not find target to add properties to: glm

Probably I am just missing something trivial here, but I cannot get the program to compile in a nice manner from the github repo.

Chees,

Bart

BartBruininks commented 2 months ago

Iterating the following command and the suggested fix in the error until the command runs without error solves the problem.

git submodule update --init --recursive
Submodule path 'deps/polyscope/deps/happly': checked out '88f79725d32d78e0e637ebf42d8432d519e1c7d0'
fatal: detected dubious ownership in repository at 'path_to/signed-heat-3d/deps/polyscope/deps/imgui/imgui'
To add an exception for this directory, call:

    git config --global --add safe.directory path_to/signed-heat-3d/deps/polyscope/deps/imgui/imgui
Unable to find current revision in submodule path 'deps/polyscope/deps/imgui/imgui'
Failed to recurse into submodule path 'deps/polyscope'
nzfeng commented 2 months ago

Thanks for catching the typo! Fixed in fb4bf21.

And yup, executing git submodule update --init --recursive should do the trick for all submodules and sub-submodules, if the repo doesn't get cloned recursively at first.

You should only need to execute this command once, though in your case it seems the "recursive" part keeps failing to recurse properly due to "dubious ownership" errors from git. You might have already checked these resources out, but these Stack Overflow posts suggest some possible causes of ownership issues. Glad you could get this repo working, and hopefully getting git sorted out prevents these issues from happening again in future cloned repos.