Vcpkg: [openimageio] build failure

Created on 30 Oct 2019  路  8Comments  路  Source: microsoft/vcpkg

Host Environment

  • OS: Windows 10
  • Compiler: VS2019Pro

To Reproduce
Steps to reproduce the behavior:
./vcpkg.exe install openimageio

Failure logs
The following packages will be built and installed:
openimageio[core]:x64-windows
Starting package 1/1: openimageio:x64-windows
Building package openimageio[core]:x64-windows...
-- Using cached C:/vcpkg/downloads/OpenImageIO-oiio-ad1ab61a56c63d770e4beb335efe8b1f1a9e36cd.tar.gz
-- Using source at C:/vcpkg/buildtrees/openimageio/src/1f1a9e36cd-9b16117fec
-- Configuring x64-windows
-- Building x64-windows-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:136 (message):
Command failed: C:/vcpkg/downloads/tools/cmake-3.14.0-windows/cmake-3.14.0-win32-x86/bin/cmake.exe --build . --config Debug --target install -- -v
Working Directory: C:/vcpkg/buildtrees/openimageio/x64-windows-dbg
See logs for more information:
C:\vcpkg\buildtrees\openimageio\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/openimageio/portfile.cmake:66 (vcpkg_install_cmake)
scripts/ports.cmake:94 (include)

Error: Building package openimageio: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: openimageio:x64-windows
Vcpkg version: 2019.09.12-nohash

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

Additional context
None

port-bug

All 8 comments

This is the same issue as https://github.com/microsoft/vcpkg/issues/8344. It should be a Visual studio 2019 issue. Turns out it is going to be fixed on OIIIO side. OIIO cannot be built with VS 16.3+. For now the solution is to uninstall VS, then either install vs 16.2.x or stick to the baseline . If it is not an urgent issue for you, please keep your VS up to date, and let me know when the issue is fixed in a newer version. Then I'll update my VS 馃槇
Another solution might be to add -T v141 in vcpkg/ports/openimageio/portfile.cmake:

vcpkg_configure_cmake(
    SOURCE_PATH ${SOURCE_PATH}
    PREFER_NINJA
    OPTIONS ${FEATURE_OPTIONS}
        -T v141
        -DOIIO_BUILD_TOOLS=OFF
    ...

That would require toolset v141 to be installed.
Theoretically should work, but I'm not one hundred percent sure vcpkg_configure_cmake would pass that option to cmake. It would be nice of you, if you could give it a shot and let me the result 馃槂

I can build it successfully on Visual Studio 2017. And I confirm that is a Visual Studio 2019 bug.

@ChaoJia I gave the "-T v141" toolset specification in the portfile.cmake file a try, but in the
log (attached) it shows Ninja does not support toolset specification, but toolset v141 was specified. :(
It was worth a shot, I really appreciate your suggestion... :)
config-x64-windows-out.log

Thanks and have a wonderful day!!!

@timautry then you can comment out PREFER_NINJA, I think this time it will work, but please let me know if it does not 馃槃
I just saw "-DVCPKG_PLATFORM_TOOLSET=v142" in the generated cmake command, not sure whether -T v141 can override it.

vcpkg_configure_cmake(
    SOURCE_PATH ${SOURCE_PATH}
    # PREFER_NINJA
    OPTIONS ${FEATURE_OPTIONS}
        -T v141
        -DOIIO_BUILD_TOOLS=OFF
    ...

If it does not work, then fallback to a second solution:
append the following lines to ${vcpkg_root}/triplets/x64-windows.cmake (because you are using triplet x64-windows):

if(${PORT} MATCHES "openimageio")
    set(VCPKG_PLATFORM_TOOLSET v141)
endif()

I consider it not so elegant as changing the port file. Feels dangerous because triplet files affect all packages.

Neither of the above options worked. I do have a workable version under VS2017 I can use if needed until the next version of OIIO is released with a fix for VS2019 and toolset 14.2.

@timautry that's quite bizarre. The second solution is guaranteed to work, provided that toolset v141 has been installed, and the modifications made in the portfile.cmake have been undone.

Just went through ${vcpkg_root}/scripts/cmake/vcpkg_configure_cmake.cmake. For the first option, the following should work, provided that toolset v141 has been installed.
Modify ${vcpkg_root}/ports/openimageio/portfile.cmake

...
set(VCPKG_PLATFORM_TOOLSET "v141")
vcpkg_configure_cmake(
    SOURCE_PATH ${SOURCE_PATH}
    GENERATOR "Visual Studio 16 2019"
    # PREFER_NINJA
    OPTIONS ${FEATURE_OPTIONS}
        -T v141
        -DOIIO_BUILD_TOOLS=OFF
...

default generator and toolset configuration can be bypassed by explicitly specifying 'GENERATOR' and VCPKG_PLATFORM_TOOLSET (the latter is actually overridden; the value seems to have been set before entering portfile.cmake)

@kangstarr Thanks for posting this issue. Does the issue still occur? I installed it successfully with Visual Studio 2019 and VCPKG latest source.

Thanks for posting this issue. Please reopen this issue if this is still a problem for you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oahzuw picture oahzuw  路  3Comments

invy picture invy  路  3Comments

cjvaijo picture cjvaijo  路  3Comments

F0I0l0I0P picture F0I0l0I0P  路  3Comments

tzbo picture tzbo  路  3Comments