gmock_gtest_all not found
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.
I encountered the same problem, did you solve it?
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.
The most frequent errors encountered are:
- pyyaml installation error (cython error with pyyaml version 5.4.1)
- pybundle error
- 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:
- One will serve as the main repository.
- The other will be used to retrieve the missing parts.
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
This set only compiles successfully on Python versions <= 3.10. If Python 3.11 is used, the compilation will fail due to incompatibility issues with the thirdparty/pybind11 module.
@brz-hub I got problems with the Python version 3.10.11 on opencv-python installation, Until I changed to Python 3.9.13 the installation of the dependencies on requirements.txt was a headache.