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

[libpq] Adding "-flto" to VCPKG_C_FLAGS causing libpq fail to compile #22163

Closed
Yuhta opened this issue Dec 22, 2021 · 15 comments
Closed

[libpq] Adding "-flto" to VCPKG_C_FLAGS causing libpq fail to compile #22163

Yuhta opened this issue Dec 22, 2021 · 15 comments
Assignees
Labels
category:question This issue is a question requires:more-information This Issue requires more information to solve

Comments

@Yuhta
Copy link

Yuhta commented Dec 22, 2021

Host Environment

To Reproduce
vcpkg.json:

{
    "name": "sp-filesvc",
    "version": "0.1.0",
    "builtin-baseline": "67e4272121ee24eb743d5b38b5e56004c6490aae",
    "dependencies": [
        "libpq"
    ]
}

vcpkg as a git submodule, included scripts/buildsystems/vcpkg.cmake in CMakeLists.txt.

Failure logs

cmake  -G Ninja -Wno-dev ..
-- Bootstrapping vcpkg before install
-- Bootstrapping vcpkg before install - done
-- Running vcpkg install
A suitable version of cmake was not found (required v3.21.1). Downloading portable cmake v3.21.1...
Downloading cmake...
  https://github.com/Kitware/CMake/releases/download/v3.21.1/cmake-3.21.1-Linux-x86_64.tar.gz -> /apps/home/gongchul/dse_poc/filesvc/vcpkg/downloads/cmake-3.21.1-linux-x86_64.tar.gz
Extracting cmake...
Detecting compiler hash for triplet x64-linux...
The following packages will be built and installed:
    libpq[core,openssl,zlib]:x64-linux -> 12.9#1 -- /apps/home/gongchul/dse_poc/filesvc/vcpkg/buildtrees/versioning_/versions/libpq/099cade84111279ffa4a909061cb8f4f36137842
  * openssl[core]:x64-linux -> 1.1.1l#4 -- /apps/home/gongchul/dse_poc/filesvc/vcpkg/buildtrees/versioning_/versions/openssl/d25384246619019a1e44f018546cdfcaf1800174
  * vcpkg-cmake[core]:x64-linux -> 2021-12-05 -- /apps/home/gongchul/dse_poc/filesvc/vcpkg/buildtrees/versioning_/versions/vcpkg-cmake/462dd9ada82163b8c104cef8c2ad5b5c0bfa5eb8
  * vcpkg-cmake-config[core]:x64-linux -> 2021-12-01 -- /apps/home/gongchul/dse_poc/filesvc/vcpkg/buildtrees/versioning_/versions/vcpkg-cmake-config/51df1bbddb22782b9e7f23f9b3588674184e991a
  * zlib[core]:x64-linux -> 1.2.11#13 -- /apps/home/gongchul/dse_poc/filesvc/vcpkg/buildtrees/versioning_/versions/zlib/92cfe30c807d343c6359d272242f0765ad906740
Additional packages (*) will be modified to complete this operation.
Restored 4 packages from /lxhome/gongchul/.cache/vcpkg/archives in 123.1 ms. Use --debug to see more details.
Starting package 1/5: zlib:x64-linux
Installing package zlib[core]:x64-linux...
Elapsed time for package zlib:x64-linux: 6.014 ms
Starting package 2/5: vcpkg-cmake-config:x64-linux
Installing package vcpkg-cmake-config[core]:x64-linux...
Elapsed time for package vcpkg-cmake-config:x64-linux: 1.328 ms
Starting package 3/5: vcpkg-cmake:x64-linux
Installing package vcpkg-cmake[core]:x64-linux...
Elapsed time for package vcpkg-cmake:x64-linux: 1.592 ms
Starting package 4/5: openssl:x64-linux
Installing package openssl[core]:x64-linux...
Elapsed time for package openssl:x64-linux: 37.37 ms
Starting package 5/5: libpq:x64-linux
Building package libpq[core,openssl,zlib]:x64-linux...
-- Installing port from location: /apps/home/gongchul/dse_poc/filesvc/vcpkg/buildtrees/versioning_/versions/libpq/099cade84111279ffa4a909061cb8f4f36137842
-- Downloading https://ftp.postgresql.org/pub/source/v12.9/postgresql-12.9.tar.bz2 -> postgresql-12.9.tar.bz2...
-- Extracting source /apps/home/gongchul/dse_poc/filesvc/vcpkg/downloads/postgresql-12.9.tar.bz2
-- Applying patch patches/windows/install.patch
-- Applying patch patches/windows/win_bison_flex.patch
-- Applying patch patches/windows/openssl_exe_path.patch
-- Applying patch patches/windows/Solution.patch
-- Applying patch patches/windows/MSBuildProject_fix_gendef_perl.patch
-- Applying patch patches/windows/msgfmt.patch
-- Applying patch patches/windows/python_lib.patch
-- Applying patch patches/windows/fix-compile-flag-Zi.patch
-- Applying patch patches/linux/configure.patch
-- Applying patch patches/windows/MSBuildProject-static-lib.patch
-- Applying patch patches/windows/Mkvcbuild-static-lib.patch
-- Applying patch patches/windows/minimize_install.patch
-- Using source at /apps/home/gongchul/dse_poc/filesvc/vcpkg/buildtrees/libpq/src/tgresql-12-5e12ab542a.clean
-- Found external ninja('1.10.2').
-- Getting CMake variables for x64-linux-dbg
-- Getting CMake variables for x64-linux-rel
-- Configuring x64-linux-dbg
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:127 (message):
    Command failed: /bin/bash -c "V=1 ././configure  \"--with-openssl\" \"--with-zlib\" \"--without-readline\" \"--disable-silent-rules\" \"--verbose\" \"--disable-shared\" \"--enable-static\" \"--enable-debug\" \"--prefix=/apps/home/gongchul/dse_poc/filesvc/build/vcpkg_installed/x64-linux/deb\
ug\" \"--bindir=\\${prefix}/../tools/libpq/debug/bin\" \"--sbindir=\\${prefix}/../tools/libpq/debug/sbin\" \"--libdir=\\${prefix}/lib\" \"--includedir=\\${prefix}/../include\" \"--datarootdir=\\${prefix}/share/libpq\""
    Working Directory: /apps/home/gongchul/dse_poc/filesvc/vcpkg/buildtrees/libpq/x64-linux-dbg
    Error code: 1
    See logs for more information:
      /apps/home/gongchul/dse_poc/filesvc/vcpkg/buildtrees/libpq/config-x64-linux-dbg-out.log
      /apps/home/gongchul/dse_poc/filesvc/vcpkg/buildtrees/libpq/config-x64-linux-dbg-err.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_make.cmake:796 (vcpkg_execute_required_process)
  buildtrees/versioning_/versions/libpq/099cade84111279ffa4a909061cb8f4f36137842/portfile.cmake:287 (vcpkg_configure_make)
  scripts/ports.cmake:142 (include)

Error: Building package libpq:x64-linux failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `git pull` and `./vcpkg update`.
Then check for known issues at:
  https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+libpq
You can submit a new issue at:
  https://github.com/microsoft/vcpkg/issues/new?template=report-package-build-failure.md&title=[libpq]+Build+error
including:
  package: libpq[core,openssl,zlib]:x64-linux -> 12.9#1
    vcpkg-tool version: 2021-12-09-724cea8b33cbf06c645f5095fa29773697da9761
    vcpkg-scripts version: 67e427212 2021-12-22 (13 hours ago)

Additionally, attach any relevant sections from the log files above.
-- Running vcpkg install - failed
CMake Error at vcpkg/scripts/buildsystems/vcpkg.cmake:831 (message):
  vcpkg install failed.  See logs for more information:
  /apps/home/gongchul/dse_poc/filesvc/build/vcpkg-manifest-install.log
Call Stack (most recent call first):
  /opt/third/gcc/10.3.0/share/cmake-3.20/Modules/CMakeDetermineSystem.cmake:123 (include)
  CMakeLists.txt:4 (project)


CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

config-x64-linux-dbg-err.log:

configure: WARNING: unrecognized options: --disable-silent-rules, --disable-shared, --enable-static
configure: error: zlib library not found
If you have zlib already installed, see config.log for details on the
failure.  It is possible the compiler isn't looking in the proper directory.
Use --without-zlib to disable zlib support.
@PhoebeHui PhoebeHui self-assigned this Dec 23, 2021
@PhoebeHui
Copy link
Contributor

@Yuhta, it seems the directory where ninja.exe is located to your path has not set correctly. could you reference https://stackoverflow.com/questions/38658014/ninja-not-found-by-cmake and see if it's helpful? BTW, I can't repro this issue locally.

Failures:

CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

@PhoebeHui PhoebeHui added the category:question This issue is a question label Dec 23, 2021
@PhoebeHui PhoebeHui changed the title [libpq] Build error [libpq] CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. Dec 23, 2021
@Yuhta
Copy link
Author

Yuhta commented Dec 23, 2021

The build seems having failed before that, it is complaining about "zlib library not found". The same setting was working when I use a toolchain with gcc 9 and cmake 3.16, but failed when I upgrade the toolchain to gcc 10 and cmake 3.20 (I always have ninja in $PATH).

@Yuhta
Copy link
Author

Yuhta commented Dec 23, 2021

I find out the reason, cmake is not picking up the correct gcc that I put on PATH (seems it ignores PATH entirely), I need to set CC in order to change the compiler.

@Yuhta Yuhta closed this as completed Dec 23, 2021
@Yuhta Yuhta reopened this Dec 23, 2021
@Yuhta
Copy link
Author

Yuhta commented Dec 23, 2021

Actually it's very confusing, after I set CC, it works. I have a custom triplet:

set(VCPKG_TARGET_ARCHITECTURE x64)                     
set(VCPKG_CRT_LINKAGE dynamic)                         
set(VCPKG_LIBRARY_LINKAGE static)                      
set(VCPKG_CMAKE_SYSTEM_NAME Linux)                     
set(VCPKG_C_FLAGS "-O3 -ggdb3 -march=cascadelake")
set(VCPKG_CXX_FLAGS ${VCPKG_C_FLAGS})                  

As soon as I add -flto, the same issue ("zlib library not found") showing up again:

set(VCPKG_TARGET_ARCHITECTURE x64)                      
set(VCPKG_CRT_LINKAGE dynamic)                          
set(VCPKG_LIBRARY_LINKAGE static)                       
set(VCPKG_CMAKE_SYSTEM_NAME Linux)                      
set(VCPKG_C_FLAGS "-O3 -ggdb3 -march=cascadelake -flto")
set(VCPKG_CXX_FLAGS ${VCPKG_C_FLAGS})                   
set(VCPKG_LINKER_FLAGS "-flto")                         

@Yuhta
Copy link
Author

Yuhta commented Dec 23, 2021

I narrowed it down to VCPKG_C_FLAGS, this works:

set(VCPKG_C_FLAGS "-O3 -ggdb3 -march=cascadelake")

and this does not:

set(VCPKG_C_FLAGS "-O3 -ggdb3 -march=cascadelake -flto")

I suspect the underlying issue is one invocation of compiler failed (with -flto), but vcpkg/libpq hide the root cause, and obscure it with a failed configure command and cmake errors.

@Yuhta Yuhta changed the title [libpq] CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. [libpq] Adding "-flto" to VCPKG_C_FLAGS causing libpq fail to compile Dec 23, 2021
@Yuhta
Copy link
Author

Yuhta commented Dec 23, 2021

This does not work either:

if(PORT STREQUAL libpq)                                   
  set(VCPKG_C_FLAGS "-O3 -ggdb3 -march=cascadelake")      
else()                                                    
  set(VCPKG_C_FLAGS "-O3 -ggdb3 -march=cascadelake -flto")
endif()                                                   

@PhoebeHui
Copy link
Contributor

@Yuhta, sorry for my late response, could you provide the failure log /apps/home/gongchul/dse_poc/filesvc/vcpkg/buildtrees/libpq/config-x64-linux-dbg-out.log? It seems a compiler issue, I can't repro this issue with gcc 9.4.0.

@PhoebeHui PhoebeHui added requires:more-information This Issue requires more information to solve requires:repro The issue is not currently repro-able and removed category:question This issue is a question labels Dec 29, 2021
@Yuhta
Copy link
Author

Yuhta commented Dec 29, 2021

@PhoebeHui Looks normal to me:

checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking which template to use... linux
checking whether NLS is wanted... no
checking for default port number... 5432
checking for block size... 8kB
checking for segment size... 1GB
checking for WAL block size... 8kB
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /opt/third/gcc/10.3.0/bin/gcc accepts -g... yes
checking for /opt/third/gcc/10.3.0/bin/gcc option to accept ISO C89... none needed
checking for /opt/third/gcc/10.3.0/bin/gcc option to accept ISO C99... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... yes
checking for gawk... gawk
checking whether /opt/third/gcc/10.3.0/bin/gcc supports -Wdeclaration-after-statement, for CFLAGS... yes
checking whether /opt/third/gcc/10.3.0/bin/gcc supports -Werror=vla, for CFLAGS... yes
checking whether /opt/third/gcc/10.3.0/bin/gcc supports -Wendif-labels, for CFLAGS... yes
checking whether g++ supports -Wendif-labels, for CXXFLAGS... yes
checking whether /opt/third/gcc/10.3.0/bin/gcc supports -Wmissing-format-attribute, for CFLAGS... yes
checking whether g++ supports -Wmissing-format-attribute, for CXXFLAGS... yes
checking whether /opt/third/gcc/10.3.0/bin/gcc supports -Wformat-security, for CFLAGS... yes
checking whether g++ supports -Wformat-security, for CXXFLAGS... yes
checking whether /opt/third/gcc/10.3.0/bin/gcc supports -fno-strict-aliasing, for CFLAGS... yes
checking whether g++ supports -fno-strict-aliasing, for CXXFLAGS... yes
checking whether /opt/third/gcc/10.3.0/bin/gcc supports -fwrapv, for CFLAGS... yes
checking whether g++ supports -fwrapv, for CXXFLAGS... yes
checking whether /opt/third/gcc/10.3.0/bin/gcc supports -fexcess-precision=standard, for CFLAGS... yes
checking whether g++ supports -fexcess-precision=standard, for CXXFLAGS... no
checking whether /opt/third/gcc/10.3.0/bin/gcc supports -funroll-loops, for CFLAGS_VECTOR... yes
checking whether /opt/third/gcc/10.3.0/bin/gcc supports -ftree-vectorize, for CFLAGS_VECTOR... yes
checking whether /opt/third/gcc/10.3.0/bin/gcc supports -Wunused-command-line-argument, for NOT_THE_CFLAGS... no
checking whether /opt/third/gcc/10.3.0/bin/gcc supports -Wformat-truncation, for NOT_THE_CFLAGS... yes
checking whether /opt/third/gcc/10.3.0/bin/gcc supports -Wstringop-truncation, for NOT_THE_CFLAGS... yes
checking whether the C compiler still works... yes
checking how to run the C preprocessor... /opt/third/gcc/10.3.0/bin/gcc -E
checking pkg-config is at least version 0.9.0... yes
checking allow thread-safe client libraries... yes
checking whether to build with ICU support... no
checking whether to build with Tcl... no
checking whether to build Perl modules... no
checking whether to build Python modules... no
checking whether to build with GSSAPI support... no
checking whether to build with PAM support... no
checking whether to build with BSD Authentication support... no
checking whether to build with LDAP support... no
checking whether to build with Bonjour support... no
checking whether to build with OpenSSL support... yes
checking whether to build with SELinux support... no
checking whether to build with systemd support... no
checking whether to build with XML support... no
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ld used by GCC... /opt/third/gcc/10.3.0/x86_64-pc-linux-gnu/bin/ld
checking if the linker (/opt/third/gcc/10.3.0/x86_64-pc-linux-gnu/bin/ld) is GNU ld... yes
checking for ranlib... ranlib
checking for strip... strip
checking whether it is possible to strip libraries... yes
checking for ar... ar
checking for a BSD-compatible install... /bin/install -c
checking for tar... /bin/tar
checking whether ln -s works... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for bison... /bin/bison
configure: using bison (GNU Bison) 3.0.4
checking for flex... /bin/flex
configure: using flex 2.5.37
checking for perl... /bin/perl
configure: using perl 5.16.3
checking for a sed that does not truncate output... /bin/sed
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether /opt/third/gcc/10.3.0/bin/gcc is Clang... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking whether more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for strerror_r... yes
checking for getpwuid_r... yes
checking for gethostbyname_r... yes
checking whether strerror_r returns int... no
checking for main in -lm... yes
checking for library containing setproctitle... no
checking for library containing dlopen... -ldl
checking for library containing socket... none required
checking for library containing shl_load... no
checking for library containing getopt_long... none required
checking for library containing crypt... -lcrypt
checking for library containing shm_open... -lrt
checking for library containing shm_unlink... none required
checking for library containing clock_gettime... none required
checking for library containing fdatasync... none required
checking for library containing sched_yield... none required
checking for library containing gethostbyname_r... none required
checking for library containing shmget... none required
checking for inflate in -lz... no

@PhoebeHui
Copy link
Contributor

@Yuhta, thanks for your response, I setup a machine with gcc 10.3.0 installed, I can't repro this issue with latest source.

phoebe@phoebe001:~/test/vcpkg$ cat ./triplets/x64-linux.cmake
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)

set(VCPKG_CMAKE_SYSTEM_NAME Linux)
set(VCPKG_C_FLAGS "-O3 -ggdb3 -march=cascadelake -flto")
set(VCPKG_CXX_FLAGS "-O3 -ggdb3 -march=cascadelake -flto")
phoebe@phoebe001:~/test/vcpkg$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 10.3.0-1ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-10 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-10-S4I5Pr/gcc-10-10.3.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-10-S4I5Pr/gcc-10-10.3.0/debian/tmp-gcn/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-mutex
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.3.0 (Ubuntu 10.3.0-1ubuntu1~20.04)
Starting package 5/5: libpq:x64-linux
Building package libpq[core,openssl,zlib]:x64-linux...
-- Downloading https://ftp.postgresql.org/pub/source/v12.9/postgresql-12.9.tar.bz2 -> postgresql-12.9.tar.bz2...
-- Extracting source /home/phoebe/test/vcpkg/downloads/postgresql-12.9.tar.bz2
-- Applying patch patches/windows/install.patch
-- Applying patch patches/windows/win_bison_flex.patch
-- Applying patch patches/windows/openssl_exe_path.patch
-- Applying patch patches/windows/Solution.patch
-- Applying patch patches/windows/MSBuildProject_fix_gendef_perl.patch
-- Applying patch patches/windows/msgfmt.patch
-- Applying patch patches/windows/python_lib.patch
-- Applying patch patches/windows/fix-compile-flag-Zi.patch
-- Applying patch patches/linux/configure.patch
-- Applying patch patches/windows/MSBuildProject-static-lib.patch
-- Applying patch patches/windows/Mkvcbuild-static-lib.patch
-- Applying patch patches/windows/minimize_install.patch
-- Using source at /home/phoebe/test/vcpkg/buildtrees/libpq/src/tgresql-12-5e12ab542a.clean
-- Getting CMake variables for x64-linux-dbg
-- Getting CMake variables for x64-linux-rel
-- 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/phoebe/test/vcpkg/packages/libpq_x64-linux/share/libpq/usage
-- Installing: /home/phoebe/test/vcpkg/packages/libpq_x64-linux/share/libpq/copyright
-- Fixing pkgconfig file: /home/phoebe/test/vcpkg/packages/libpq_x64-linux/lib/pkgconfig/libpq.pc
-- Fixing pkgconfig file: /home/phoebe/test/vcpkg/packages/libpq_x64-linux/debug/lib/pkgconfig/libpq.pc
-- Performing post-build validation
-- Performing post-build validation done
Stored binary cache: /root/.cache/vcpkg/archives/56/561dd68bc81092e64a13ea1e2208                                                                                                                                                             17fb066745dcceba589dcc615edc8f4ea153.zip
Installing package libpq[core,openssl,zlib]:x64-linux...
Elapsed time for package libpq:x64-linux: 5.469 min

Total elapsed time: 7.409 min

The package libpq provides CMake integration:

    find_package(PostgreSQL REQUIRED)
    target_link_libraries(main PRIVATE PostgreSQL::PostgreSQL)

@Yuhta
Copy link
Author

Yuhta commented Dec 30, 2021

My compiler is not built with system zlib (no --with-system-zlib), could that be the reason?

$ /opt/third/gcc/10.3.0/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/opt/third/gcc/10.3.0/bin/gcc
COLLECT_LTO_WRAPPER=/opt/third/gcc/10.3.0/libexec/gcc/x86_64-pc-linux-gnu/10.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /opt/tmp/gcc-10.3.0/configure --prefix=/opt/third/gcc/10.3.0 --with-gmp=/opt/third/gcc/10.3.0/gmp-6.2.1 --with-isl=/opt/third/gcc/10.3.0/isl-0.23 --with-mpfr=/opt/third/gcc/10.3.0/mpfr-4.1.0 --with-mpc=/opt/third/gcc/10.3.0/mpc-1.2.1 --with-zstd=/opt/third/gcc/10.3.0/zstd-1.4.9 --disable-multilib --disable-werror --enable-lto --enable-compressed-debug-sections=all --enable-languages=c,c++,d,fortran,go,lto --enable-deterministic-archives --enable-linker-build-id --enable-libstdcxx-time=yes --enable-cxx-flags='-fdata-sections -ffunction-sections -grecord-gcc-switches'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.3.0 (GCC)

@PhoebeHui PhoebeHui removed the requires:more-information This Issue requires more information to solve label Dec 31, 2021
@PhoebeHui
Copy link
Contributor

@Yuhta, I installed the pkgs which based on https://github.com/microsoft/vcpkg/blob/master/scripts/azure-pipelines/linux/provision-image.sh, could you help confirm?

@Yuhta
Copy link
Author

Yuhta commented Dec 31, 2021

@PhoebeHui The compiler is configured by another team in my firm, it will take some time for me to get a gcc --with-system-zlib to test on it. In the meantime if you have time, can you try test the build with a gcc without --with-system-zlib and see if you get the same error?

@JackBoosY JackBoosY added category:question This issue is a question requires:more-information This Issue requires more information to solve and removed requires:repro The issue is not currently repro-able labels Jan 13, 2022
@JackBoosY
Copy link
Contributor

JackBoosY commented Jan 13, 2022

Please provide file config.log in VCPKG_ROOT/buildtrees/libpq/x64-linxu-dbg?

Thanks.

BTW, please install libpq with ./vcpkg install libpq[zlib] instead.
Or, use the following manifest content:

    "dependencies":
     {
         "name": "libpq",
         "features": [
             "zlib"
          ] 
     }

@daschuer
Copy link
Contributor

Does #22516 make a difference?

@JackBoosY JackBoosY self-assigned this Jun 10, 2022
@JackBoosY
Copy link
Contributor

Please reopen this issue if it still exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:question This issue is a question requires:more-information This Issue requires more information to solve
Projects
None yet
Development

No branches or pull requests

4 participants