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

[opencolorio:x64-osx] build failure #14113

Closed
shauser67 opened this issue Oct 19, 2020 · 7 comments
Closed

[opencolorio:x64-osx] build failure #14113

shauser67 opened this issue Oct 19, 2020 · 7 comments
Assignees
Labels
requires:repro The issue is not currently repro-able

Comments

@shauser67
Copy link

Host Environment

  • OS: macOS 10.15
  • Compiler: Apple clang 12.0.0
  • YAML: 0.6.3

To Reproduce

./vcpkg --triplet x64-osx install opencolorio

All dependencies of opencolorio were installed successfully, but compilation of opencolorio failed.

Failure logs

Console output:

Starting package 1/1: opencolorio:x64-osx
Building package opencolorio[core]:x64-osx...
Could not locate cached archive: /Users/sh/.cache/vcpkg/archives/31/31d1ae694ff00ae8044ef9963dab52079187f9e6.zip
-- Using cached /Users/sh/Documents/vcpkg/downloads/AcademySoftwareFoundation-OpenColorIO-ebdec4111f449bea995d01ecd9693b7e704498fe.tar.gz
-- Extracting source /Users/sh/Documents/vcpkg/downloads/AcademySoftwareFoundation-OpenColorIO-ebdec4111f449bea995d01ecd9693b7e704498fe.tar.gz
-- Applying patch 0001-lcms-dependency-search.patch
-- Applying patch 0002-msvc-cpluscplus.patch
-- Applying patch 0003-osx-self-assign-field.patch
-- Applying patch 0004-yaml-dependency-search.patch
-- Applying patch 0005-tinyxml-dependency-search.patch
-- Using source at /Users/sh/Documents/vcpkg/buildtrees/opencolorio/src/7e704498fe-32e68b4241.clean
-- Configuring x64-osx-dbg
-- Configuring x64-osx-rel
-- Building x64-osx-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:141 (message):
    Command failed: /Users/sh/Documents/vcpkg/downloads/tools/cmake-3.17.2-osx/cmake-3.17.2-Darwin-x86_64/CMake.app/Contents/bin/cmake --build . --config Debug --target install -- -v -j5
    Working Directory: /Users/sh/Documents/vcpkg/buildtrees/opencolorio/x64-osx-dbg
    See logs for more information:
      /Users/sh/Documents/vcpkg/buildtrees/opencolorio/install-x64-osx-dbg-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_build_cmake.cmake:92 (vcpkg_execute_build_process)
  scripts/cmake/vcpkg_install_cmake.cmake:24 (vcpkg_build_cmake)
  ports/opencolorio/portfile.cmake:48 (vcpkg_install_cmake)
  scripts/ports.cmake:79 (include)


Error: Building package opencolorio:x64-osx failed with: BUILD_FAILED

install-x64-osx-dbg-out.log:

[48/63] /Library/Developer/CommandLineTools/usr/bin/c++  -DOpenColorIO_STATIC -DUSE_SSE -I/Users/sh/Documents/vcpkg/buildtrees/opencolorio/src/7e704498fe-32e68b4241.clean/export -Iexport -I/Users/sh/Documents/vcpkg/buildtrees/opencolorio/src/7e704498fe-32e68b4241.clean/ext/oiio/src/include -I/Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include -Iext/dist/include -isystem /Users/sh/Documents/vcpkg/installed/x64-osx/include -fPIC -msse2 -g -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk   -DTIXML_USE_STL   -fPIC -fvisibility=hidden -Werror -MD -MT src/core/CMakeFiles/OpenColorIO_STATIC.dir/OCIOYaml.cpp.o -MF src/core/CMakeFiles/OpenColorIO_STATIC.dir/OCIOYaml.cpp.o.d -o src/core/CMakeFiles/OpenColorIO_STATIC.dir/OCIOYaml.cpp.o -c /Users/sh/Documents/vcpkg/buildtrees/opencolorio/src/7e704498fe-32e68b4241.clean/src/core/OCIOYaml.cpp
FAILED: src/core/CMakeFiles/OpenColorIO_STATIC.dir/OCIOYaml.cpp.o 
/Library/Developer/CommandLineTools/usr/bin/c++  -DOpenColorIO_STATIC -DUSE_SSE -I/Users/sh/Documents/vcpkg/buildtrees/opencolorio/src/7e704498fe-32e68b4241.clean/export -Iexport -I/Users/sh/Documents/vcpkg/buildtrees/opencolorio/src/7e704498fe-32e68b4241.clean/ext/oiio/src/include -I/Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include -Iext/dist/include -isystem /Users/sh/Documents/vcpkg/installed/x64-osx/include -fPIC -msse2 -g -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk   -DTIXML_USE_STL   -fPIC -fvisibility=hidden -Werror -MD -MT src/core/CMakeFiles/OpenColorIO_STATIC.dir/OCIOYaml.cpp.o -MF src/core/CMakeFiles/OpenColorIO_STATIC.dir/OCIOYaml.cpp.o.d -o src/core/CMakeFiles/OpenColorIO_STATIC.dir/OCIOYaml.cpp.o -c /Users/sh/Documents/vcpkg/buildtrees/opencolorio/src/7e704498fe-32e68b4241.clean/src/core/OCIOYaml.cpp
In file included from /Users/sh/Documents/vcpkg/buildtrees/opencolorio/src/7e704498fe-32e68b4241.clean/src/core/OCIOYaml.cpp:75:
In file included from /Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/yaml.h:11:
In file included from /Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/emitter.h:18:
/Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/binary.h:23:17: error: expected member name or ';' after declaration specifiers
      : m_data{}, m_unownedData(data_), m_unownedSize(size_) {}
                ^
/Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/binary.h:23:15: error: expected '('
      : m_data{}, m_unownedData(data_), m_unownedSize(size_) {}
              ^
In file included from /Users/sh/Documents/vcpkg/buildtrees/opencolorio/src/7e704498fe-32e68b4241.clean/src/core/OCIOYaml.cpp:75:
In file included from /Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/yaml.h:14:
In file included from /Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/exceptions.h:11:
/Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/traits.h:111:10: error: 'auto' not allowed in function return type
  static auto test(int)
         ^~~~
/Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/traits.h:111:24: error: expected ';' at end of declaration list
  static auto test(int)
                       ^
/Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/traits.h:115:10: error: 'auto' not allowed in function return type
  static auto test(...) -> std::false_type;
         ^~~~
/Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/traits.h:115:24: error: expected ';' at end of declaration list
  static auto test(...) -> std::false_type;
                       ^
In file included from /Users/sh/Documents/vcpkg/buildtrees/opencolorio/src/7e704498fe-32e68b4241.clean/src/core/OCIOYaml.cpp:75:
In file included from /Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/yaml.h:14:
/Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/exceptions.h:100:47: error: a space is required between consecutive right angle brackets (use '> >')
    const T&, typename disable_if<is_numeric<T>>::type* = 0) {
                                              ^
/Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/exceptions.h:112:50: error: a space is required between consecutive right angle brackets (use '> >')
    const T& key, typename enable_if<is_numeric<T>>::type* = 0) {
                                                 ^
/Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/exceptions.h:120:47: error: a space is required between consecutive right angle brackets (use '> >')
    const T&, typename disable_if<is_numeric<T>>::type* = nullptr) {
                                              ^
/Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/exceptions.h:132:50: error: a space is required between consecutive right angle brackets (use '> >')
    const T& key, typename enable_if<is_numeric<T>>::type* = nullptr) {
                                                 ^
/Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/exceptions.h:152:11: error: exception specification of overriding function is more lax than base version
  virtual ~Exception() YAML_CPP_NOEXCEPT;
          ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/stdexcept:114:13: note: overridden virtual function is here
    virtual ~runtime_error() _NOEXCEPT;
            ^
In file included from /Users/sh/Documents/vcpkg/buildtrees/opencolorio/src/7e704498fe-32e68b4241.clean/src/core/OCIOYaml.cpp:75:
In file included from /Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/yaml.h:14:
/Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/exceptions.h:152:23: error: expected ';' at end of declaration list
  virtual ~Exception() YAML_CPP_NOEXCEPT;
                      ^
/Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/exceptions.h:178:29: error: expected ';' at end of declaration list
  virtual ~ParserException() YAML_CPP_NOEXCEPT;
                            ^
/Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/exceptions.h:186:37: error: expected ';' at end of declaration list
  virtual ~RepresentationException() YAML_CPP_NOEXCEPT;
                                    ^
/Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/exceptions.h:195:27: error: expected ';' at end of declaration list
  virtual ~InvalidScalar() YAML_CPP_NOEXCEPT;
                          ^
/Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/exceptions.h:205:25: error: expected ';' at end of declaration list
  virtual ~KeyNotFound() YAML_CPP_NOEXCEPT;
                        ^
/Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/exceptions.h:213:30: error: expected ';' at end of declaration list
  virtual ~TypedKeyNotFound() YAML_CPP_NOEXCEPT {}
                             ^
/Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/exceptions.h:212:35: error: member initializer 'key' does not name a non-static data member or base class
      : KeyNotFound(mark_, key_), key(key_) {}
                                  ^~~~~~~~~
/Users/sh/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/exceptions.h:230:25: error: expected ';' at end of declaration list
  virtual ~InvalidNode() YAML_CPP_NOEXCEPT;
                        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
@francis-wangfr
Copy link

francis-wangfr commented Oct 21, 2020

I got same build errors above on vcpkg 2020.07 as I tried to install OpenImageIO[opencolorio]:x64-osx. Is there a workarond? Thanks to your help.

@shauser67
Copy link
Author

Unfortunately I am not aware of a workaround. I am afraid installing OpenImageIO without OpenColorIO wouldn't be an option for you as well.

@hodoulp
Copy link

hodoulp commented Oct 22, 2020

The Yaml library version used to compile OpenColorIO, expects a C++11 (or higher) compilation flag which is not the default compilation for OpenColorIO version 1.x.

Note: The version detection for Yaml is kind of flaky because there are no good way to 'understand' the version of an installed yaml library so, it explains the problem here.

The usual way to select the right C++ version using CMake, is to add the flag -DCMAKE_CXX_STANDARD=11 but OpenColorIO 1.x does not officially support C++11 or higher. So, the right update is to change the vcpkg instructions to compile against Yaml version 0.5.1 (i.e. the expected version for OpenColorIO 1.x). The change consists to add -DUSE_EXTERNAL_YAML=OFF to the cmake instructions (take that opportunity to also add -DUSE_EXTERNAL_TINYXML=OFF -DUSE_EXTERNAL_LCMS=OFF control the tinyXML and lcms2 versions).

@shauser67
Copy link
Author

Thanks for the detailed explanations! I am not an vcpkg expert, but I am afraid vcpkg always uses the most recent version of a library, so it might not be possible to downgrade to yaml 0.5.1.

Under Linux opencolorio compiles without problems in combination with yaml 0.6.3. So I tried to compile it with support for C++11 under macOS - and there are no errors as well. The quick solution is to add -DCMAKE_CXX_STANDARD=11 to vcpkg/ports/opencolorio/portfile.cmake. This might also be a workaround when using vcpkg 2020.07.

vcpkg_configure_cmake(
    SOURCE_PATH ${SOURCE_PATH}
    PREFER_NINJA
    OPTIONS
        -DCMAKE_CXX_STANDARD=11
        -DOCIO_BUILD_APPS=OFF
        -DOCIO_BUILD_SHARED:BOOL=${_BUILD_SHARED}
        -DOCIO_BUILD_STATIC:BOOL=${_BUILD_STATIC}
        -DOCIO_BUILD_TRUELIGHT:BOOL=OFF
        -DOCIO_BUILD_NUKE:BOOL=OFF
        -DOCIO_BUILD_DOCS:BOOL=OFF
        -DOCIO_BUILD_TESTS:BOOL=OFF
        -DOCIO_BUILD_PYGLUE:BOOL=OFF
        -DOCIO_BUILD_JNIGLUE:BOOL=OFF
        -DOCIO_STATIC_JNIGLUE:BOOL=OFF
        -DUSE_EXTERNAL_TINYXML:BOOL=ON
        -DUSE_EXTERNAL_YAML:BOOL=ON
)

@hodoulp
Copy link

hodoulp commented Oct 22, 2020

To better explain my proposal which is to let OpenColorIO uses the right third-party library version (i.e. not the installed ones), here are the new settings for vcpkg:

vcpkg_configure_cmake(
   SOURCE_PATH ${SOURCE_PATH}
   PREFER_NINJA
   OPTIONS
       -DOCIO_BUILD_APPS=OFF
       -DOCIO_BUILD_SHARED:BOOL=${_BUILD_SHARED}
       -DOCIO_BUILD_STATIC:BOOL=${_BUILD_STATIC}
       -DOCIO_BUILD_TRUELIGHT:BOOL=OFF
       -DOCIO_BUILD_NUKE:BOOL=OFF
       -DOCIO_BUILD_DOCS:BOOL=OFF
       -DOCIO_BUILD_TESTS:BOOL=OFF
       -DOCIO_BUILD_PYGLUE:BOOL=OFF
       -DOCIO_BUILD_JNIGLUE:BOOL=OFF
       -DOCIO_STATIC_JNIGLUE:BOOL=OFF
       -DUSE_EXTERNAL_TINYXML:BOOL=OFF
       -DUSE_EXTERNAL_YAML:BOOL=OFF
       -DUSE_EXTERNAL_LCMS=OFF
)

Note: The Linux compilation is the example where OpenColorIO uses the right third-party libraries i.e. USE_EXTERNAL_XXX are all OFF by default.

@francis-wangfr
Copy link

Thank you, @hodoulp Patrick, it works with above solution.
After that, I got another error about incorrect definition "-D-DOpenColorIO_STATIC". I had to fix it with removing the "-D" ahead of "OpenColorIO_STATIC" in the file
"/buildtrees/openimageio/src/9c73ea82cc-f088f982ce/src/cmake/modules/FindOpenColorIO.cmake". And build again with --editable option to vcpkg command.

@NancyLi1013 NancyLi1013 added category:port-bug The issue is with a library, which is something the port should already support depends:upstream-changes Waiting on a change to the upstream project labels Oct 23, 2020
@PhoebeHui PhoebeHui assigned Cheney-W and unassigned NancyLi1013 Nov 22, 2021
@JonLiu1993 JonLiu1993 added requires:repro The issue is not currently repro-able and removed category:port-bug The issue is with a library, which is something the port should already support depends:upstream-changes Waiting on a change to the upstream project labels Apr 23, 2023
@JonLiu1993
Copy link
Member

Verified this issue with latest vcpkg, it looks fixed:

Building opencolorio[core]:x64-osx...
-- Downloading https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v2.1.2.tar.gz -> AcademySoftwareFoundation-OpenColorIO-v2.1.2.tar.gz...
-- Extracting source /Users/vcpkg/Jon/vcpkg/downloads/AcademySoftwareFoundation-OpenColorIO-v2.1.2.tar.gz
-- Applying patch fix-dependency.patch
-- Applying patch fix-pkgconfig.patch
-- Using source at /Users/vcpkg/Jon/vcpkg/buildtrees/opencolorio/src/v2.1.2-da9444f66f.clean
-- Found external ninja('1.11.1').
-- Configuring x64-osx
-- Building x64-osx-dbg
-- Building x64-osx-rel
-- Fixing pkgconfig file: /Users/vcpkg/Jon/vcpkg/packages/opencolorio_x64-osx/lib/pkgconfig/OpenColorIO.pc
-- Fixing pkgconfig file: /Users/vcpkg/Jon/vcpkg/packages/opencolorio_x64-osx/debug/lib/pkgconfig/OpenColorIO.pc
-- Installing: /Users/vcpkg/Jon/vcpkg/packages/opencolorio_x64-osx/share/opencolorio/copyright
-- Performing post-build validation
Stored binaries in 1 destinations.
Elapsed time to handle opencolorio:x64-osx: 1.7 min
Total install time: 2.1 min
opencolorio provides CMake targets:

    # this is heuristically generated, and may not be correct
    find_package(OpenColorIO CONFIG REQUIRED)
    target_link_libraries(main PRIVATE OpenColorIO::OpenColorIO)

vcpkg@VCPKGMM-12 vcpkg % ./vcpkg --version
vcpkg package management program version 2023-04-07-bedcba5172f5e4b91caac660ab7afe92c27a9895

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
requires:repro The issue is not currently repro-able
Projects
None yet
Development

No branches or pull requests

6 participants