mapillary / OpenSfM

Open source Structure-from-Motion pipeline
https://www.opensfm.org/
BSD 2-Clause "Simplified" License
3.41k stars 861 forks source link

gmock_gtest_all not found #1078

Open Diego1890 opened 1 week ago

Diego1890 commented 1 week ago

Hello, I was trying to build OpenSFM and I folled the documentation for building:

git clone --recursive https://github.com/mapillary/OpenSfM
pip install -r requirements
#Install some dependencies
python3 setup.py build

But I got the error that these files were not located: gmock_gtest_all.cc gmock_main.cc testing_main.cc

If you have any advice I would appreciate it.

dizzyrue commented 6 days ago

I encountered the same problem, did you solve it?

DiegoHerrera1890 commented 4 days ago

I have the same issue and still haven't found a solution. However, when using git checkout v0.5.1, the files become available, but other issues arise.

alessandro-pistola-me commented 3 days ago

The most frequent errors encountered are:

  1. pyyaml installation error (cython error with pyyaml version 5.4.1)
  2. pybundle error
  3. third_party/gtest error

By reviewing the commit history from August 9 (commit ef872b2399cf1cc036d91e950f210a7be33c2745) onward, you’ll notice that all workflows for subsequent commits, like "Docker CI / Build docker and run tests (push)" and "Docker CI / Build docker installing CeresSolver 2 and run tests (push)," fail.

Below is a step-by-step guide explaining how I resolved these issues.

The missing files should be taken from the release, but only those for the third_party folder (missing gtest files), as the release uses outdated dependencies and likely Ceres 2.0.

To begin, create two clones of the latest repository:

In the root of the main repo, run: `git submodule update --init --recursive This will load the removed submodules.

In the main repo, remove pyyaml==5.4.1 from requirements.txt and install it manually with the following command: pip install "cython<3.0.0" && pip install --no-build-isolation pyyaml==5.1

In the second repo, go to the August 9 commit: git checkout ef872b2399cf1cc036d91e950f210a7be33c2745

From this commit, copy the missing files (gmock_gtest_all.cc, gmock_main.cc, testing_main.cc, and any other required files) into the main repository. Now you should be able to build the image from the modified dockerfile in which you should install ceres 2.2 insted ceres 2.0 RUN \ curl -L http://ceres-solver.org/ceres-solver-2.2.0.tar.gz | tar xz && \ mkdir ceres-bin && cd ceres-bin && \ cmake ../ceres-solver-2.2.0 && \ make -j3 && \ make install