microsoft / vcpkg

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

BUILD_FAILED for glm package #3357

Closed boddicheg closed 4 years ago

boddicheg commented 6 years ago

Hey guys. Didn't found issues related to my problem so decided create a new one.

OS:

Distributor ID: Debian
Description:    Debian GNU/Linux testing (buster)
Release:    testing
Codename:   buster

Trying to get a OpenGL Mathematics (GLM):

$ ./vcpkg search glm
glm                  0.9.8.5-1        OpenGL Mathematics (GLM) https://glm.g-truc.net
$ ./vcpkg install glm
The following packages will be built and installed:
    glm[core]:x64-linux
Starting package 1/1: glm:x64-linux
Building package glm[core]:x64-linux... 
-- CURRENT_INSTALLED_DIR=/home/boddicheg/Dropbox/Projects/SimpleEngine3D/vendor/vcpkg/installed/x64-linux
-- DOWNLOADS=/home/boddicheg/Dropbox/Projects/SimpleEngine3D/vendor/vcpkg/downloads
-- CURRENT_PACKAGES_DIR=/home/boddicheg/Dropbox/Projects/SimpleEngine3D/vendor/vcpkg/packages/glm_x64-linux
-- CURRENT_BUILDTREES_DIR=/home/boddicheg/Dropbox/Projects/SimpleEngine3D/vendor/vcpkg/buildtrees/glm
-- CURRENT_PORT_DIR=/home/boddicheg/Dropbox/Projects/SimpleEngine3D/vendor/vcpkg/ports/glm/.
-- Using cached /home/boddicheg/Dropbox/Projects/SimpleEngine3D/vendor/vcpkg/downloads/g-truc-glm-0.9.8.5.tar.gz
-- Testing integrity of cached file...
-- Testing integrity of cached file... OK
-- Extracting done
-- Applying patch /home/boddicheg/Dropbox/Projects/SimpleEngine3D/vendor/vcpkg/ports/glm/ignore-warning-C4201.patch
-- Applying patch failed. This is expected if this patch was previously applied.
-- Applying patch /home/boddicheg/Dropbox/Projects/SimpleEngine3D/vendor/vcpkg/ports/glm/ignore-warning-C4201.patch done
-- Configuring x64-linux-dbg
-- Configuring x64-linux-dbg done
-- Configuring x64-linux-rel
-- Configuring x64-linux-rel done
-- Build x64-linux-dbg
CMake Error at scripts/cmake/vcpkg_build_cmake.cmake:170 (message):
    Command failed: /home/boddicheg/Dropbox/Projects/SimpleEngine3D/vendor/vcpkg/downloads/tools/cmake-3.10.2-linux/cmake-3.10.2-Linux-x86_64/bin/cmake;--build;.;--config;Debug;--target;install;--;-v;-j1
    Working Directory: /home/boddicheg/Dropbox/Projects/SimpleEngine3D/vendor/vcpkg/buildtrees/glm/x64-linux-dbg
    See logs for more information:
      /home/boddicheg/Dropbox/Projects/SimpleEngine3D/vendor/vcpkg/buildtrees/glm/install-x64-linux-dbg-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_install_cmake.cmake:24 (vcpkg_build_cmake)
  ports/glm/portfile.cmake:20 (vcpkg_install_cmake)
  scripts/ports.cmake:72 (include)

Error: Building package glm:x64-linux failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: glm:x64-linux
  Vcpkg version: 0.0.110-unknownhash

Additionally, attach any relevant sections from the log files above.

Here logs vcpkg/buildtrees/glm/install-x64-linux-dbg-out.log glm_failed.txt

Output of log file very similar to issue from official repository https://github.com/g-truc/glm/issues/726 and it fixed in 0.9.9(current package version is glm-0.9.8.5)

How can i fix this issue?

amaiorano commented 6 years ago

I also get a build error, but with a different call stack:

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_cmake.cmake:247 (vcpkg_execute_required_process)
  ports/glm/portfile.cmake:16 (vcpkg_configure_cmake)
  scripts/ports.cmake:72 (include)

By looking at error log, I saw that CXX needed to be defined for this to build, so after export CXX=g++-8 I was able to successfully build; however, I feel like vcpkg should have been able to build without my needing to set CXX explicitly.

amaiorano commented 6 years ago

Hi @boddicheg, I had 2 separate build issues with glm, but neither of them are related to vcpkg:

  1. As I wrote in my reply above, I needed to make sure CXX was pointing to a more recent g++ version. From your log, it seems you would need to do the same:

    /home/boddicheg/Dropbox/Projects/SimpleEngine3D/vendor/vcpkg/buildtrees/glm/src/glm-0.9.8.5/glm/detail/setup.hpp:456:100: note: #pragma message: GLM: GCC older than 4.6 has a bug presenting the use of rgba and stpq components
    # pragma message("GLM: GCC older than 4.6 has a bug presenting the use of rgba and stpq components")
  2. Using Travis, I got another build error in GLM:

    /usr/lib/gcc/x86_64-linux-gnu/8/include/immintrin.h:113:10: fatal error: movdirintrin.h: No such file or directory
    #include <movdirintrin.h>
          ^~~~~~~~~~~~~~~~

    Turns out this is a known issue with gcc 8.0.1 because this version is actually missing this file. I was able to fix this by installing gcc 7 and using it when building glm, something like:

    env CC=gcc-7 CXX=g++-7 vcpkg install glm

Perhaps you can verify if this works for you?

JackBoosY commented 4 years ago

This issue hasn’t been updated in a year; if it is still an issue, please reopen this issue.