Host Environment
To Reproduce
Steps to reproduce the behavior:
./vcpkg install vtk:x64-windows
Failure logs
-Cut and past the appropriate build messages from the console output.
-- Using cached F:/Source/vcpkg-master/downloads/Kitware-VTK-v8.2.0.tar.gz
-- Using source at F:/Source/vcpkg-master/buildtrees/vtk/src/v8.2.0-b37306c27c
-- Configuring x64-windows
-- Building x64-windows-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:136 (message):
Command failed: "D:/Program Files/cmake/bin/cmake.exe" --build . --config Debug --target install -- -v
Working Directory: F:/Source/vcpkg-master/buildtrees/vtk/x64-windows-dbg
See logs for more information:
F:\Source\vcpkg-master\buildtrees\vtk\install-x64-windows-dbg-out.log
Call Stack (most recent call first):
scripts/cmake/vcpkg_build_cmake.cmake:96 (vcpkg_execute_build_process)
scripts/cmake/vcpkg_install_cmake.cmake:24 (vcpkg_build_cmake)
ports/vtk/portfile.cmake:134 (vcpkg_install_cmake)
scripts/ports.cmake:74 (include)
Error: Building package vtk:x64-windows 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: vtk:x64-windows
Vcpkg version: 2019.07.18-nohash
Additionally, attach any relevant sections from the log files above.
-Please attach any additional failure logs mentioned in the console output.
this is the error message in buildtrees/vtk/install-x64-windows-dbg-out.log
F:\Source\vcpkg-master\buildtrees\vtk\x64-windows-dbg\ThirdParty\glew\vtk_glew.h(40): fatal error C1083: Cannot open include file: 'GL/glew.h': No such file or directory
[1279/2701] "D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\cl.exe" /TP -DVTK_IN_VTK -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -DvtkRenderingOpenGL2_EXPORTS -IRendering\OpenGL2 -IF:\Source\vcpkg-master\buildtrees\vtk\src\v8.2.0-b37306c27c\Rendering\OpenGL2 -ICommon\Core -IF:\Source\vcpkg-master\buildtrees\vtk\src\v8.2.0-b37306c27c\Common\Core -IUtilities\KWIML -IF:\Source\vcpkg-master\buildtrees\vtk\src\v8.2.0-b37306c27c\Utilities\KWIML -IUtilities\KWSys -IF:\Source\vcpkg-master\buildtrees\vtk\src\v8.2.0-b37306c27c\Utilities\KWSys -IThirdParty\utf8 -IF:\Source\vcpkg-master\buildtrees\vtk\src\v8.2.0-b37306c27c\ThirdParty\utf8 -ICommon\DataModel -IF:\Source\vcpkg-master\buildtrees\vtk\src\v8.2.0-b37306c27c\Common\DataModel -ICommon\Math -IF:\Source\vcpkg-master\buildtrees\vtk\src\v8.2.0-b37306c27c\Common\Math -ICommon\Misc -IF:\Source\vcpkg-master\buildtrees\vtk\src\v8.2.0-b37306c27c\Common\Misc -ICommon\System -IF:\Source\vcpkg-master\buildtrees\vtk\src\v8.2.0-b37306c27c\Common\System -ICommon\Transforms -IF:\Source\vcpkg-master\buildtrees\vtk\src\v8.2.0-b37306c27c\Common\Transforms -ICommon\ExecutionModel -IF:\Source\vcpkg-master\buildtrees\vtk\src\v8.2.0-b37306c27c\Common\ExecutionModel -IRendering\Core -IF:\Source\vcpkg-master\buildtrees\vtk\src\v8.2.0-b37306c27c\Rendering\Core -ICommon\Color -IF:\Source\vcpkg-master\buildtrees\vtk\src\v8.2.0-b37306c27c\Common\Color -ICommon\ComputationalGeometry -IF:\Source\vcpkg-master\buildtrees\vtk\src\v8.2.0-b37306c27c\Common\ComputationalGeometry -IFilters\Core -IF:\Source\vcpkg-master\buildtrees\vtk\src\v8.2.0-b37306c27c\Filters\Core -IFilters\General -IF:\Source\vcpkg-master\buildtrees\vtk\src\v8.2.0-b37306c27c\Filters\General -IFilters\Geometry -IF:\Source\vcpkg-master\buildtrees\vtk\src\v8.2.0-b37306c27c\Filters\Geometry -IFilters\Sources -IF:\Source\vcpkg-master\buildtrees\vtk\src\v8.2.0-b37306c27c\Filters\Sources -IThirdParty\glew -IF:\Source\vcpkg-master\buildtrees\vtk\src\v8.2.0-b37306c27c\ThirdParty\glew /DWIN32 /D_WINDOWS /W4 /utf-8 /GR /EHsc /MP /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1 /showIncludes /FoRendering\OpenGL2\CMakeFiles\vtkRenderingOpenGL2.dir\vtkRenderingOpenGL2ObjectFactory.cxx.obj /FdRendering\OpenGL2\CMakeFiles\vtkRenderingOpenGL2.dir\ /FS -c Rendering\OpenGL2\vtkRenderingOpenGL2ObjectFactory.cxx
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27032.1 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
ninja: build stopped: subcommand failed.
Additional context
I'm sure glew has been installed, because glew.h exists in installed/include/GL
This literally just happened to me after I upgrade my CMake to 3.15.2. Can someone please fix this?
@claudiofantacci it seems like you made the upstream changes on FindGLEW.cmake for CMake. How would you suggest we work around this problem if we don't want to downgrade our CMake? I assume you made it work because I know you are using pcl in vcpkg.
Hi @jasjuang, I鈥檓 out of office for several weeks with no pc and limited connection 馃槥 sorry for any inconvenience caused by the FindGLEW.
One thing that I would check first is if the CMake鈥檚 FindGLEW is calling the glew-config.cmake provided by vcpkg鈥檚 GLEW as this is what should happen (basically, if there are config scripts from the pckage call them and skip the rest). If this is not the case, then we need to trace the bug in the target creation of the FindGLEW file.
@claudiofantacci thanks for the pointer, I tried to debug for a bit but it's a little bit too complicated for me. I downgraded my CMake to 3.14.2 for now. Looking forward to your return!
I stumbled upon this issue after having the same issue elsewhere. For me updating to CMake 3.15.2 fixes the issue (and the release notes mention GLEW fixes).
Here I am!
I tested ./vcpkg install vtk:x64-windows on my machine and verified that vtk indeed runs CMake's FindGLEW.cmake, but that it finds vcpkg's glew-config.cmake and runs it.
I get the same error as reported by @silentmissile, even after upgrading to CMake 3.15.2 as suggested by @chrisburr. The problem seems to be upstream on how vtk consumes glew. After some investigations it seems that it does not use the GLEW::glew target, but the old CMake variables, thus probably missing an include.
I'm now trying some tests on clean vcpkg installation.
vtk source code provides glew in the ThirdParty folder and the error refers to it:
F:\Source\vcpkg-master\buildtrees\vtk\x64-windows-dbg\ThirdParty\glew\vtk_glew.h.
However, while configuring vtk the CMake variable VTK_USE_SYSTEM_GLEW is set to ON, meaning that (I speculate) there is probably some errors in the project configuration because it should use the system installed glew and not the one in ThirdParty folder.
Setting VTK_USE_SYSTEM_GLEW to OFF works arond the problem and the compilation is succesfull.
@claudiofantacci Thanks for figuring out the fix. Can you submit a PR for everyone to get the fix?
Waiting for the fix.
Testing the port and pushing the fix.
PR created.
After some investigations it seems that it does not use the GLEW::glew target, but the old CMake variables, thus probably missing an include.
The Problem with VTK is that it cannot use Targets and has to use the old CMake variables because its internal dependency tree is messed up an incorrect. If you use the target by setting the <dependency>_LIBRARIES variable to it you will get cmake errors that GLEW::glew is used before the target is defined. So the old CMake variables are essential for VTK/ITK.
So either:
Setting VTK_USE_SYSTEM_GLEW to OFF is not an option for vcpkg.
Pinging @dzenanz to make him aware of the problem with newer cmake versions.
Thanks @Neumann-A for the explanation. Not sure the issue is really related to how GLEW is found though. Unfortunately, I have little time at this moment to properly figure this out (relocating).
Hi All, the fix merged, please get latest vcpkg and try to build VTK again.
Thank you Neumann-A for the fix!
Most helpful comment
The Problem with VTK is that it cannot use Targets and has to use the old CMake variables because its internal dependency tree is messed up an incorrect. If you use the target by setting the
<dependency>_LIBRARIESvariable to it you will get cmake errors that GLEW::glew is used before the target is defined. So the old CMake variables are essential for VTK/ITK.So either:
Setting VTK_USE_SYSTEM_GLEW to OFF is not an option for vcpkg.
Pinging @dzenanz to make him aware of the problem with newer cmake versions.