Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gdal build failure #16271

Closed
ywang2017 opened this issue Feb 18, 2021 · 14 comments
Closed

gdal build failure #16271

ywang2017 opened this issue Feb 18, 2021 · 14 comments
Assignees
Labels
requires:repro The issue is not currently repro-able

Comments

@ywang2017
Copy link

Host Environment

  • OS: docker, Linux, Debian
  • Compiler: revision

To Reproduce
Steps to reproduce the behavior:
#Install vcpkg and required packages and set the path
RUN git clone https://github.com/Microsoft/vcpkg &&
cd vcpkg &&
./bootstrap-vcpkg.sh -disableMetrics &&
./vcpkg install aws-sdk-cpp[s3] &&
./vcpkg install tbb hdf5[cpp] &&
./vcpkg install sqlite3 tinyxml2 &&
./vcpkg install gtest gdal log4cxx --recurse

Failure logs
#13 891.6 Starting package 21/23: gdal:x64-linux
#13 891.6 Building package gdal[core]:x64-linux...
#13 1086.3 -- Downloading http://download.osgeo.org/gdal/3.1.3/gdal313.zip -> gdal313.zip...
#13 1086.3 -- Extracting source /home/ec2-user/vcpkg/downloads/gdal313.zip
#13 1086.3 -- Applying patch 0001-Fix-debug-crt-flags.patch
#13 1086.3 -- Applying patch 0002-Fix-build.patch
#13 1086.3 -- Applying patch 0003-Fix-static-build.patch
#13 1086.3 -- Applying patch 0004-Fix-std-fabs.patch
#13 1086.3 -- Applying patch 0005-Fix-cfitsio.patch
#13 1086.3 -- Using source at /home/ec2-user/vcpkg/buildtrees/gdal/src/gdal313-b1dafdc415.clean
#13 1086.3 -- Configuring x64-linux-dbg
#13 1086.3 -- Configuring x64-linux-rel
#13 1086.3 -- Generating configure for x64-linux
#13 1086.3 -- Finished generating configure for x64-linux
#13 1086.3 -- Configuring x64-linux-dbg
#13 1086.3 -- Configuring x64-linux-rel
#13 1086.3 -- Building x64-linux-dbg
#13 1086.3 CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:144 (message):
#13 1086.3 Command failed: /usr/bin/make V=1 -j 17 -f GNUmakefile all
#13 1086.3 Working Directory: /home/ec2-user/vcpkg/buildtrees/gdal/x64-linux-dbg
#13 1086.3 See logs for more information:
#13 1086.3 /home/ec2-user/vcpkg/buildtrees/gdal/build-x64-linux-dbg-out.log
#13 1086.3 /home/ec2-user/vcpkg/buildtrees/gdal/build-x64-linux-dbg-err.log
#13 1086.3
#13 1086.3 Call Stack (most recent call first):
#13 1086.3 scripts/cmake/vcpkg_build_make.cmake:195 (vcpkg_execute_build_process)
#13 1086.3 scripts/cmake/vcpkg_install_make.cmake:26 (vcpkg_build_make)
#13 1086.3 ports/gdal/portfile.cmake:201 (vcpkg_install_make)
#13 1086.3 scripts/ports.cmake:131 (include)
#13 1086.3
#13 1086.3
#13 1086.3 Error: Building package gdal:x64-linux failed with: BUILD_FAILED
#13 1086.3 Please ensure you're using the latest portfiles with ./vcpkg update, then
#13 1086.3 submit an issue at https://github.com/Microsoft/vcpkg/issues including:
#13 1086.3 Package: gdal:x64-linux
#13 1086.3 Vcpkg version: 2021-01-13-unknownhash

@ras0219-msft ras0219-msft changed the title [<port name>] build failure gdal build failure Feb 18, 2021
@NancyLi1013
Copy link
Contributor

Hi @ywang2017

Thanks for posting this issue.

Could you please help provide the log from /home/ec2-user/vcpkg/buildtrees/gdal/build-x64-linux-dbg-out.log or /home/ec2-user/vcpkg/buildtrees/gdal/build-x64-linux-dbg-err.log?

@NancyLi1013 NancyLi1013 added the requires:repro The issue is not currently repro-able label Feb 19, 2021
@ywang2017
Copy link
Author

@ywang2017
Copy link
Author

I got same error after run

apt-get install libopenexr-dev
and
./vcpkg install gdal --recurse

@NancyLi1013
Copy link
Contributor

In file included from exrdataset.cpp:34:0:
openexr_headers.h:38:10: fatal error: ImathMatrix.h: No such file or directory
 #include "ImathMatrix.h"
          ^~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [../o/exrdataset.lo] Error 1
make[1]: *** [exr-install-obj] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [frmts-target] Error 2

It seems weird. I also don't install openexr and ImathMatrix.h cannot be found on my machine either. But I can install gdal successfully.

@ywang2017
Copy link
Author

I used docker file build, not machine

@ywang2017
Copy link
Author

our local base image

FROM gcc:7.3.0

LABEL description="Container for use with Visual Studio"

add ec2-user

RUN useradd -m -d /home/ec2-user -s /bin/bash -G sudo ec2-user

WORKDIR /home/ec2-user

#Install the required essentials
RUN apt-get update -y &&
apt-get install build-essential rsync zip openssh-server -y &&
apt-get install git zip unzip bzip2 wget nano make dos2unix -y

gdb debug

RUN apt-get install -y libc6-dbg gdb

ENV PATH=/usr/bin/ninja-build:$PATH

configure SSH for communication with Visual Studio

RUN mkdir -p /var/run/sshd

RUN echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config && \
ssh-keygen -A

#Install CMake and set the path
RUN wget https://github.com/Kitware/CMake/releases/download/v3.19.4/cmake-3.19.4-Linux-x86_64.sh -q -O /tmp/cmake-install.sh
&& chmod u+x /tmp/cmake-install.sh
&& /tmp/cmake-install.sh --skip-license --prefix=/usr
&& rm /tmp/cmake-install.sh

ENV PATH=/usr/bin/cmake/bin:$PATH

RUN apt-get install libopenexr-dev -y

#Install vcpkg and required packages and set the path
RUN git clone https://github.com/Microsoft/vcpkg &&
cd vcpkg &&
./bootstrap-vcpkg.sh -disableMetrics &&
./vcpkg install aws-sdk-cpp[s3] &&
./vcpkg install tbb hdf5[cpp] &&
./vcpkg install sqlite3 tinyxml2 &&
./vcpkg install gtest log4cxx --recurse

# ./vcpkg install gdal libgdal-dev

ENV PATH=/home/ec2-user/vcpkg:$PATH

expose port 22

EXPOSE 22

@ywang2017
Copy link
Author

please run the build with "--recurse". without this option, the gdal was older version. but with this option, compile failed.

@NancyLi1013
Copy link
Contributor

Sorry I don't have docker environment. I can install gdal successfully with option --recurse, which is not the key point.

Why do you install libgdal-dev? It should be provided by the system instead of vcpkg.

@ywang2017
Copy link
Author

I created EC2 with ubuntu, still got same error even without libgdal-dev . what OS is your system?

@NancyLi1013
Copy link
Contributor

I created EC2 with ubuntu, still got same error even without libgdal-dev . what OS is your system?

Ubuntu 18.04 , gcc 10.1.0

Starting package 23/23: gdal:x64-linux
Building package gdal[core]:x64-linux...
-- Downloading http://download.osgeo.org/gdal/3.1.3/gdal313.zip -> gdal313.zip...
-- Extracting source /home/vruil/code/vcpkg/downloads/gdal313.zip
-- Applying patch 0001-Fix-debug-crt-flags.patch
-- Applying patch 0002-Fix-build.patch
-- Applying patch 0003-Fix-static-build.patch
-- Applying patch 0004-Fix-std-fabs.patch
-- Applying patch 0005-Fix-cfitsio.patch
-- Using source at /home/vruil/code/vcpkg/buildtrees/gdal/src/gdal313-b1dafdc415
-- Configuring x64-linux-dbg
-- Configuring x64-linux-rel
-- Generating configure for x64-linux
-- Finished generating configure for x64-linux
-- Configuring x64-linux-dbg
-- Configuring x64-linux-rel
-- Building x64-linux-dbg
-- Installing x64-linux-dbg
-- Building x64-linux-rel
-- Installing x64-linux-rel
-- Installing: /home/vruil/code/vcpkg/packages/gdal_x64-linux/share/gdal/usage
-- Installing: /home/vruil/code/vcpkg/packages/gdal_x64-linux/share/gdal/copyright
-- Performing post-build validation
-- Performing post-build validation done
Building package gdal[core]:x64-linux... done
Installing package gdal[core]:x64-linux...
Installing package gdal[core]:x64-linux... done
Elapsed time for package gdal:x64-linux: 16.41 min

Total elapsed time: 31.79 min

The package GDAL provides CMake targets:

    find_package(GDAL REQUIRED)
    target_include_directories(main PRIVATE ${GDAL_INCLUDE_DIRS})
    target_link_libraries(main PRIVATE ${GDAL_LIBRARIES})

vruil@linux003:~/code/vcpkg$ gcc --version
gcc (Ubuntu 10.1.0-2ubuntu1~18.04) 10.1.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@NancyLi1013
Copy link
Contributor

Hi @ywang2017

Is this still a problem for you now? Have you tried with the latest vcpkg to rebuild gdal?

@dg0yt
Copy link
Contributor

dg0yt commented May 5, 2021

This particular build failure is to be fixed by #17205. (However, there are more issues, cf. #9068.)

@dg0yt
Copy link
Contributor

dg0yt commented Jan 9, 2022

I assume this is fixed.

@JonLiu1993
Copy link
Member

@ywang2017 , This issue has been fixed by #17205, please git pull your vcpkg and try again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
requires:repro The issue is not currently repro-able
Projects
None yet
Development

No branches or pull requests

4 participants