google / s2geometry

Computational geometry and spatial indexing on the sphere
http://s2geometry.io/
Apache License 2.0
2.29k stars 302 forks source link

set_target_properties called with incorrect number of arguments #320

Closed ThomasThelen closed 1 year ago

ThomasThelen commented 1 year ago

When installing off the latest commit in master on Ubuntu, I'm running across the error message below when interacting with googletest.

Error Message

0.670 GOOGLETEST_ROOT: /s2/googletest
0.670 CMake Warning at /s2/googletest/googlemock/CMakeLists.txt:40 (project):
0.670   VERSION keyword not followed by a value or was followed by a value that
0.670   expanded to nothing.
0.670 
0.670 
0.671 CMake Warning at /s2/googletest/googletest/CMakeLists.txt:50 (project):
0.671   VERSION keyword not followed by a value or was followed by a value that
0.671   expanded to nothing.
0.671 
0.671 
0.705 -- Found Python3: /usr/bin/python3.8 (found version "3.8.10") found components: Interpreter 
0.707 CMake Error at /s2/googletest/googletest/CMakeLists.txt:124 (set_target_properties):
0.707   set_target_properties called with incorrect number of arguments.
0.707 
0.707 
0.707 CMake Error at /s2/googletest/googletest/CMakeLists.txt:142 (set_target_properties):
0.707   set_target_properties called with incorrect number of arguments.
0.707 
0.707 
0.708 CMake Error at /s2/googletest/googlemock/CMakeLists.txt:98 (set_target_properties):
0.708   set_target_properties called with incorrect number of arguments.
0.708 
0.708 
0.708 CMake Error at /s2/googletest/googlemock/CMakeLists.txt:101 (set_target_properties):
0.708   set_target_properties called with incorrect number of arguments.
0.708 
0.708 
0.714 -- Configuring incomplete, errors occurred!
0.714 See also "/s2/s2geometry/build/CMakeFiles/CMakeOutput.log".
0.714 See also "/s2/s2geometry/build/CMakeFiles/CMakeError.log".
------
Dockerfile:22
--------------------
  20 |     
  21 |     WORKDIR /s2/s2geometry/build
  22 | >>> RUN cmake -DGOOGLETEST_ROOT=/s2/googletest -DCMAKE_PREFIX_PATH=/s2/abseil-cpp/install -DCMAKE_CXX_STANDARD=14 -DBUILD_SHARED_LIBS=OFF -DWITH_PYTHON=ON ..
  23 |     RUN make -j $(nproc)
  24 |     RUN make test ARGS="-j$(nproc)"  # If GOOGLETEST_ROOT specified above.
--------------------
ERROR: failed to solve: process "/bin/sh -c cmake -DGOOGLETEST_ROOT=/s2/googletest -DCMAKE_PREFIX_PATH=/s2/abseil-cpp/install -DCMAKE_CXX_STANDARD=14 -DBUILD_SHARED_LIBS=OFF -DWITH_PYTHON=ON .." did not complete successfully: exit code: 1

Any ideas where I could be going wrong here? Here's the following Dockerfile to reproduce the error

FROM ubuntu:focal
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get -y install git cmake googletest libssl-dev build-essential python3-dev swig

WORKDIR /s2/

RUN git clone https://github.com/google/s2geometry.git
RUN git clone https://github.com/abseil/abseil-cpp.git
RUN git clone https://github.com/google/googletest.git

RUN cmake -S /s2/googletest -B /s2/googletest -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/s2/googletest/install -DBUILD_GMOCK=ON
RUN cmake --build /s2/googletest --target install

RUN cmake -S /s2/abseil-cpp -B /s2/abseil-cpp/build -DCMAKE_CXX_STANDARD=14 -DCMAKE_PREFIX_PATH=/s2/googletest/install -DCMAKE_INSTALL_PREFIX=/s2/abseil-cpp/install -DABSL_ENABLE_INSTALL=ON -DABSL_USE_EXTERNAL_GOOGLETEST=ON -DABSL_FIND_GOOGLETEST=ON
RUN cmake --build /s2/abseil-cpp/build/

RUN ctest --test-dir /s2/abseil-cpp/build/
RUN cmake --build /s2/abseil-cpp/build/ --target install

WORKDIR /s2/s2geometry/build
RUN cmake -DGOOGLETEST_ROOT=/s2/googletest -DCMAKE_PREFIX_PATH=/s2/abseil-cpp/install -DCMAKE_CXX_STANDARD=14 -DBUILD_SHARED_LIBS=OFF -DWITH_PYTHON=ON ..
RUN make -j $(nproc)
RUN make test ARGS="-j$(nproc)"  # If GOOGLETEST_ROOT specified above.
RUN make install
mitchellfaulk commented 1 year ago

@ThomasThelen thanks for all your help in debugging. This is what we settled upon that seems to work on my machine. Please note that I omit any references to GOOGLE_TEST

FROM ubuntu:focal
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get -y install libgflags-dev libgoogle-glog-dev libgtest-dev libssl-dev swig cmake git build-essential python3-dev python3-pip

WORKDIR /s2/
RUN git clone https://github.com/abseil/abseil-cpp.git
WORKDIR /s2/abseil-cpp/
RUN cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_CXX_STANDARD=14
RUN make install

WORKDIR /s2/
RUN git clone https://github.com/google/s2geometry.git
WORKDIR /s2/s2geometry/build/
RUN cmake -DCMAKE_CXX_STANDARD=14 -DCMAKE_PREFIX_PATH=/s2/abseil-cpp/install -DWITH_PYTHON=ON ..
RUN make install

RUN python3 -m pip install cmake_build_extension wheel
WORKDIR /s2/s2geometry/
RUN python3 setup.py bdist_wheel
WORKDIR /s2/s2geometry/dist
RUN python3 -m pip install s2geometry-0.11.0.dev1-cp38-cp38-linux_aarch64.whl

WORKDIR /s2/s2geometry/src/python
RUN python3 s2geometry_test.py