microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.9k stars 6.32k forks source link

[colmap] Build error on x64-linux #38393

Open BowMonk opened 5 months ago

BowMonk commented 5 months ago

Package: colmap[core,cuda,tests]:x64-linux@2023-10-01

Host Environment

To Reproduce

vcpkg install colmap[cuda,tests]:x64-linux Failure logs

-- Using cached colmap-colmap-9c704e89ff0a80e797725e112011f9f69e5aa28f.tar.gz.
-- Cleaning sources at /home/bowmonk/nerf/Hierarchical-Localization/vcpkg/buildtrees/colmap/src/f69e5aa28f-361efbb7b2.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source /home/bowmonk/nerf/Hierarchical-Localization/vcpkg/downloads/colmap-colmap-9c704e89ff0a80e797725e112011f9f69e5aa28f.tar.gz
-- Using source at /home/bowmonk/nerf/Hierarchical-Localization/vcpkg/buildtrees/colmap/src/f69e5aa28f-361efbb7b2.clean
-- Configuring x64-linux-dbg
-- Configuring x64-linux-rel
-- Building x64-linux-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message):
    Command failed: /home/bowmonk/nerf/Hierarchical-Localization/vcpkg/downloads/tools/cmake-3.29.0-linux/cmake-3.29.0-linux-x86_64/bin/cmake --build . --config Debug --target install -- -v -j17
    Working Directory: /home/bowmonk/nerf/Hierarchical-Localization/vcpkg/buildtrees/colmap/x64-linux-dbg
    See logs for more information:
      /home/bowmonk/nerf/Hierarchical-Localization/vcpkg/buildtrees/colmap/install-x64-linux-dbg-out.log

Call Stack (most recent call first):
  installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process)
  installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_install.cmake:16 (vcpkg_cmake_build)
  ports/colmap/portfile.cmake:58 (vcpkg_cmake_install)
  scripts/ports.cmake:175 (include)

install-x64-linux-dbg-out.log

FrankXie05 commented 5 months ago

@BowMonk Thanks for posting this issue, have you installed glog:x64-linux?

BowMonk commented 5 months ago

Yes I have. It was also installed during the original full setup for vcpkg, and I also tried installing it separately. Nothing changed. Would it be useful to provide the logs for the glog installation?

Just to inform about the specific glog version

libgoogle-glog-dev is already the newest version (0.5.0+really0.4.0-2).
The following packages were automatically installed and are no longer required:
  docker-ce-rootless-extras libaccinj64-11.5 libcub-dev libcudart11.0 libcufft10 libcufftw10 libcupti-dev libcupti-doc
  libcupti11.5 libcurand10 libcusparse11 libnppc11 libnppial11 libnppicc11 libnppidei11 libnppif11 libnppig11
  libnppim11 libnppist11 libnppisu11 libnppitc11 libnpps11 libnvidia-cfg1-530 libnvidia-extra-530 libnvjpeg11
  libnvrtc-builtins11.5 libnvrtc11.2 libnvtoolsext1 libnvvm4 libslirp0 libthrust-dev libvdpau-dev node-html5shiv
  nvidia-cuda-gdb nvidia-cuda-toolkit-doc nvidia-firmware-535-535.154.05 nvidia-firmware-535-535.161.07
  nvidia-opencl-dev ocl-icd-opencl-dev opencl-c-headers opencl-clhpp-headers slirp4netns
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 178 not upgraded.

And through vcpkg:

./vcpkg install glog:x64-linux
Computing installation plan...
The following packages are already installed:
    glog:x64-linux@0.7.0#1
glog:x64-linux is already installed

All i did was clone the vcpkg repo, bootstrap, then run the install command, where colmap is the only place it fails.

Also, should I tag everytime I update here or just comment? Not sure how it goes since it's the first time I've had to submit an issue.

FrankXie05 commented 5 months ago
/home/bowmonk/nerf/Hierarchical-Localization/vcpkg/installed/x64-linux/include/glog/logging.h:60:4: error: #error <glog/logging.h> was not included correctly. See the documention for how to consume the library.
   60 | #  error <glog/logging.h> was not included correctly. See the documention for how to consume the library.
      |    ^~~~~

Thanks for the information, we don't include this header file logging.h by default under linux. I see that your compilation options also pass -DGLOG_USE_GLOG_EXPORT. Can you provide your header file export.h?

#if defined(GLOG_USE_GLOG_EXPORT)
#  include "glog/export.h"
#endif

#if !defined(GLOG_EXPORT) || !defined(GLOG_NO_EXPORT)
#  error <glog/logging.h> was not included correctly. See the documention for how to consume the library.
#endif

https://github.com/microsoft/vcpkg/blob/90a5b03c9f1f7af404b16f780a2cc60b77c1f34f/ports/glog/portfile.cmake#L41

BowMonk commented 5 months ago

This is the export file under: home\bowmonk\nerf\Hierarchical-Localization\vcpkg\installed\x64-linux\include\glog\export.h


#ifndef GLOG_EXPORT_H
#define GLOG_EXPORT_H

#if 1
#  define GLOG_EXPORT
#  define GLOG_NO_EXPORT
#else
#  ifndef GLOG_EXPORT
#    ifdef GOOGLE_GLOG_IS_A_DLL
        /* We are building this library */
#      define GLOG_EXPORT 
#    else
        /* We are using this library */
#      define GLOG_EXPORT 
#    endif
#  endif

#  ifndef GLOG_NO_EXPORT
#    define GLOG_NO_EXPORT 
#  endif
#endif

#ifndef GLOG_DEPRECATED
#  define GLOG_DEPRECATED __attribute__ ((__deprecated__))
#endif

#ifndef GLOG_DEPRECATED_EXPORT
#  define GLOG_DEPRECATED_EXPORT GLOG_EXPORT GLOG_DEPRECATED
#endif

#ifndef GLOG_DEPRECATED_NO_EXPORT
#  define GLOG_DEPRECATED_NO_EXPORT GLOG_NO_EXPORT GLOG_DEPRECATED
#endif

#if 0 /* DEFINE_NO_DEPRECATED */
#  ifndef GLOG_NO_DEPRECATED
#    define GLOG_NO_DEPRECATED
#  endif
#endif

#endif /* GLOG_EXPORT_H */

Hope this is the right export file.

And regarding logging.h, am I supposed to deal with that separately? Again, I haven't made any changes on top of just running the vcpkg command, so not sure why there would be extra things being required (or maybe I'm just really confused)

BowMonk commented 5 months ago

Is there any other information you need from me for reproduction? Or is the above enough for now?

FrankXie05 commented 4 months ago

@BowMonk Judging from the documents you provided, everything is normal. This condition should not be triggered. Some other places may interfere with the judgment of this condition. 😢

#if !defined(GLOG_EXPORT) || !defined(GLOG_NO_EXPORT)
BowMonk commented 4 months ago

Alright thank you! Just want to clarify, you've been unable to reproduce this error and you think something else in my setup is causing the issue? It ran with no issues for you?

FrankXie05 commented 4 months ago

@BowMonk You can try clearing the cache of vcpkg and try again.

LilyWangLL commented 4 months ago

Pinging @BowMonk for response, could you please test PR #39006 resolve this issue or not?

BowMonk commented 3 months ago

Can't test at the moment, however I will try in a week or so.