OSGeo / PROJ

PROJ - Cartographic Projections and Coordinate Transformations Library
https://proj.org
Other
1.75k stars 789 forks source link

unit tests Failed when adding GDAL deps #3178

Closed julienlau closed 2 years ago

julienlau commented 2 years ago

Hi, I have problem with unit tests on ubuntu when trying to compile proj with dependencies from gdal.

Dockerfile

##
# OSGeo/PROJ

FROM ubuntu:20.04 as builder

MAINTAINER Howard Butler <howard@hobu.co>

ARG DESTDIR="/build"

# Setup build env
RUN apt-get update -y \
    && DEBIAN_FRONTEND=noninteractive apt-get install -y --fix-missing --no-install-recommends \
            software-properties-common build-essential ca-certificates \
            cmake wget unzip \
            zlib1g-dev libsqlite3-dev sqlite3 libcurl4-gnutls-dev \
            libtiff5-dev

WORKDIR /opt
ARG PROJ_VERSION=9.0.0
RUN mkdir proj \
    && wget -q https://github.com/OSGeo/PROJ/archive/${PROJ_VERSION}.tar.gz -O - \
        | tar xz -C proj --strip-components=1
RUN mkdir -p proj/build \
    && cd proj/build \
    && cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \
    && make -j$(nproc) \
    && ctest -V \
    && make install

But I have a Warning during configure that says network dependent tests are skipped :

-- ENABLE_IPO                     = OFF
-- PROJ_CORE_TARGET_OUTPUT_NAME   = proj
-- BUILD_SHARED_LIBS              = ON
-- PROJ_LIBRARIES                 = proj
-- Checking if network is available...
CMake Warning at test/CMakeLists.txt:33 (message):
  ...  no.  Skipping network dependent tests.

-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY) (Required is at least version "1.8.1")
-- Using internal GTest

I see that a total of 57 tests are launched (57/57 OK)

FROM $BASE_IMAGE as builder

ARG GCC_ARCH=x86_64

Setup build env for PROJ

USER root RUN apt-get update -y \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --fix-missing --no-install-recommends \ build-essential ca-certificates \ git make cmake ninja-build wget unzip libtool automake \ zlib1g-dev libsqlite3-dev pkg-config sqlite3 libcurl4-gnutls-dev \ libtiff5-dev

Setup build env for GDAL

RUN apt-get update -y \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --fix-missing --no-install-recommends \ python3-dev python3-numpy python3-setuptools \ libjpeg-dev libgeos-dev \ libexpat-dev libxerces-c-dev \ libwebp-dev libpng-dev \ libzstd-dev bash zip curl \ libpq-dev libssl-dev libopenjp2-7-dev \ autoconf automake sqlite3 bash-completion

WORKDIR /opt ARG PROJ_VERSION=9.0.0 RUN mkdir proj \ && wget -q https://github.com/OSGeo/PROJ/archive/${PROJ_VERSION}.tar.gz -O - \ | tar xz -C proj --strip-components=1 RUN cd proj \ && mkdir build \ && cd build \ && cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON \ && make -j$(nproc) \ && ctest -V \ && make install


No more warning:

-- Configuring proj library: -- ENABLE_IPO = OFF -- PROJ_CORE_TARGET_OUTPUT_NAME = proj -- BUILD_SHARED_LIBS = ON -- PROJ_LIBRARIES = proj -- Checking if network is available... -- ... yes -- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY) (Required is at least version "1.8.1")


But the new test fails (nkg):

18/58 Test #18: tinshift ......................... Passed 0.02 sec test 19 Start 19: nkg

19: Test command: /opt/proj/build/bin/gie "/opt/proj/test/gie/nkg.gie" 19: Environment variables: 19: PROJ_USER_WRITABLE_DIRECTORY=/opt/proj/build/tmp_user_writable_dir 19: PROJ_NETWORK=ON 19: PROJ_LIB=/opt/proj/build/data/for_tests 19: Test timeout computed to be: 1500 19: ------------------------------------------------------------------------------- 19: Reading file '/opt/proj/test/gie/nkg.gie' 19: ----- 19: FAILURE in nkg.gie(211): 19: expected: 3275753.9111 321110.8658 5445041.8822 2020.0 19: got: 3275753.909377121367 321110.862629641255 5445041.881752743 2020.000000000 19: deviation: 3.635866 mm, expected: 0.100000 mm 19: ----- 19: FAILURE in nkg.gie(215): 19: expected: 2391774.5535 615614.9100 5860965.8138 2020.0 19: got: 2391774.548114618286 615614.906333823106 5860965.818464150 2020.000000000 19: deviation: 8.012333 mm, expected: 0.100000 mm 19: ----- 19: FAILURE in nkg.gie(219): 19: expected: 2107889.5097 895603.2085 5933242.3152 2020.0 19: got: 2107889.501365525648 895603.205471481429 5933242.320781169 2020.000000000 19: deviation: 10.477825 mm, expected: 0.100000 mm 19: ------------------------------------------------------------------------------- 19: total: 28 tests succeeded, 0 tests skipped, 3 tests FAILED! 19: ------------------------------------------------------------------------------- 19/58 Test #19: nkg ..............................***Failed 40.80 sec test 20



I cannot understand why and how to solve this.
Can I disable the plugin related to `nkg` ? How ?
On which criteria `network dependent tests` are enabled / disabled ?

I tried with PROJ 8.2.1, but the problem persists
Regards
JL
rouault commented 2 years ago

duplicate of https://github.com/OSGeo/PROJ/issues/3164