Open benstadin opened 5 months ago
Let's wait until the "which code is it?" question from the other issues is resolved before worrying too much about this one.
This is on the master branch. Steps to reproduce (I'm using an Ubuntu 22.04 Docker Image):
git clone https://github.com/google/s2geometry.git cd s2geometry git clone https://github.com/google/googletest.git -b release-1.10.0 mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX:PATH=/usr/local -DBUILD_SHARED_LIBS=OFF -Dabsl_DIR=/usr/local/lib -DGOOGLETEST_ROOT="/root/tmp/s2geometry/googletest" .. make -j8
I'm actually using the Debian googletest-1.14.0-1, and it works. Do you get the same error message from 1.14.0?
I've answered that in the other issue (and sorry, I should have consolidated the issues into a single one). Though the build instructions from the readme won't work on Ubuntu 22.04 either way, because for whatever reason gmock is missing in the Ubuntu package (if I remember correctly the version there is otherwise 1.11.0). Even though gtest is found cmake complains right away that gmock isn't available when the system package is used.
Then the instructions about the required version number are probably wrong, as well as the package instructions for Ubunto. google-mock needs to be installed separately. Can you install google-mock and see if it works with 1.11 or 1.14?
The build fails at the same place with googletest and gmock installed via apt (the Ubuntu package version for both is 1.11.0-3). Since I get the same "wrong number of arguments" error on alpine 3.19 when using a recent googletest version as with ubuntu 22.04 I assume installing a different version on Ubuntu via apt from alternative sources would not make a difference.
sudo apt-get install cmake googletest libssl-dev libgmock-dev
git clone https://github.com/google/s2geometry.git
cd s2geometry
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX:PATH=/usr/local -DBUILD_SHARED_LIBS=OFF -Dabsl_DIR=/usr/local/lib -DGOOGLETEST_ROOT=/usr/src/googletest ..
make -j8
[...]
In file included from /usr/src/googletest/googlemock/include/gmock/gmock-spec-builders.h:75,
from /usr/src/googletest/googlemock/include/gmock/gmock-function-mocker.h:42,
from /usr/src/googletest/googlemock/include/gmock/gmock.h:61,
from /root/tmp3/s2geometry/src/s2/s2builderutil_lax_polygon_layer_test.cc:26:
/usr/src/googletest/googlemock/include/gmock/gmock-matchers.h: In instantiation of 'bool testing::internal::ElementsAreMatcherImpl<Container>::MatchAndExplain(Container, testing::MatchResultListener*) const [with Container = const IdSetLexicon::IdSet&]':
/usr/src/googletest/googlemock/include/gmock/gmock-matchers.h:3228:8: required from here
/usr/src/googletest/googlemock/include/gmock/gmock-matchers.h:3238:43: error: no type named 'const_iterator' in 'testing::internal::ElementsAreMatcherImpl<const IdSetLexicon::IdSet&>::StlContainer' {aka 'class IdSetLexicon::IdSet'}
3238 | typename StlContainer::const_iterator it = stl_container.begin();
| ^~
/usr/src/googletest/googlemock/include/gmock/gmock-matchers.h:3238:43: error: no type named 'const_iterator' in 'testing::internal::ElementsAreMatcherImpl<const IdSetLexicon::IdSet&>::StlContainer' {aka 'class IdSetLexicon::IdSet'}
Edit: By the way, for testing the above I used a shell into blank docker container. This may be a quick way to reproduce the issue: docker run -it ubuntu:22.04 /bin/bash
(build tools and git need to be installed still)
One of the tests won't compile with the latest version on Ubuntu 22.04. Neither with the mentioned googletest version 1.10.0 nor the current 1.14.0 release. The error is in s2builderutil_lax_polygon_layer_test:
In file included from /root/googletest/googlemock/include/gmock/gmock-spec-builders.h:75, from /root/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h:47, from /root/googletest/googlemock/include/gmock/gmock-function-mocker.h:39, from /root/googletest/googlemock/include/gmock/gmock.h:61, from /root/s2geometry/src/s2/s2builderutil_lax_polygon_layer_test.cc:26: /root/googletest/googlemock/include/gmock/gmock-matchers.h: In instantiation of 'bool testing::internal::ElementsAreMatcherImpl::MatchAndExplain(Container, testing::MatchResultListener) const [with Container = const IdSetLexicon::IdSet&]':
/root/googletest/googlemock/include/gmock/gmock-matchers.h:2747:8: required from here
/root/googletest/googlemock/include/gmock/gmock-matchers.h:2757:43: error: no type named 'const_iterator' in 'testing::internal::ElementsAreMatcherImpl<const IdSetLexicon::IdSet&>::StlContainer' {aka 'class IdSetLexicon::IdSet'}
2757 | typename StlContainer::const_iterator it = stl_container.begin();
| ^~
/root/googletest/googlemock/include/gmock/gmock-matchers.h:2757:43: error: no type named 'const_iterator' in 'testing::internal::ElementsAreMatcherImpl<const IdSetLexicon::IdSet&>::StlContainer' {aka 'class IdSetLexicon::IdSet'}
/root/s2geometry/src/s2/s2builderutil_snap_functions_test.cc: In function 'double GetS2CellIdMinVertexSeparation(int, absl::lts_20240116::flat_hash_set )':