Issue Compiling OCIO Under OSX and vcpkg.


Simon Smith
 

Hi,

I’m attempting to use vcpkg as our dependency system for compiling various libraries for our application (OpenColorIO, OpenEXR, OpenImageIO) and everything works on all platforms except trying to compile OpenColorIO under OSX (always the platform that causes me the most bother!). It’s a pretty new system to me so I don’t claim to know it all inside out and may have just made a rookie error somewhere!

OK, so i’ve got Catalina (10.15.6) set up with XCode 11 (11.7) and have set up vcpkg as per the instructions.
As a prerequisite for compiling OpenColorIO I had to install brew to get xquartz installed (brew cask install quartz).

Once done, I run vcpkg install opencolorio which grabs v1.1.1 and various other dependencies it needs along the way (like yaml) but then fails to compile the OCIO library after successfully doing all the pre-requisites with the following error:


[49/63] /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++  -DOpenColorIO_STATIC -DUSE_SSE -I/Users/lightmap/Documents/vcpkg/buildtrees/opencolorio/src/7e704498fe-32e68b4241.clean/export -Iexport -I/Users/lightmap/Documents/vcpkg/buildtrees/opencolorio/src/7e704498fe-32e68b4241.clean/ext/oiio/src/include -I/Users/lightmap/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include -Iext/dist/include -isystem /Users/lightmap/Documents/vcpkg/installed/x64-osx/include -fPIC -msse2 -g -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/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/lightmap/Documents/vcpkg/buildtrees/opencolorio/src/7e704498fe-32e68b4241.clean/src/core/OCIOYaml.cpp
FAILED: src/core/CMakeFiles/OpenColorIO_STATIC.dir/OCIOYaml.cpp.o 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++  -DOpenColorIO_STATIC -DUSE_SSE -I/Users/lightmap/Documents/vcpkg/buildtrees/opencolorio/src/7e704498fe-32e68b4241.clean/export -Iexport -I/Users/lightmap/Documents/vcpkg/buildtrees/opencolorio/src/7e704498fe-32e68b4241.clean/ext/oiio/src/include -I/Users/lightmap/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include -Iext/dist/include -isystem /Users/lightmap/Documents/vcpkg/installed/x64-osx/include -fPIC -msse2 -g -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/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/lightmap/Documents/vcpkg/buildtrees/opencolorio/src/7e704498fe-32e68b4241.clean/src/core/OCIOYaml.cpp
In file included from /Users/lightmap/Documents/vcpkg/buildtrees/opencolorio/src/7e704498fe-32e68b4241.clean/src/core/OCIOYaml.cpp:75:
In file included from /Users/lightmap/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/yaml.h:11:
In file included from /Users/lightmap/Documents/vcpkg/installed/x64-osx/share/yaml-cpp/../../include/yaml-cpp/emitter.h:18:
/Users/lightmap/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/lightmap/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_) {} 


Any suggestions as to how to fix this and get vcpkg to build OCIO please?
As a slight aside, it would be really useful if vcpkg could handle xquartz automatically, but I don’t know if that is actually possible.


Best Regards,
   Simon

---
Simon C Smith
Co-Founder & CTO
www.lightmap.co.uk

Email confidentiality notice:
This message is private and confidential. If you have received this message in error, please notify us and remove it from your system.


Patrick Hodoul
 

Hi Simon & Community,

OCIO 1.1.1 is from the branch RB-1.1 and it does not compile in C++11. But the reported error is a new C++11 syntax to initialize vector in a Yaml include file. So, the build can only fail.
The expected yaml version for RB-1.1 is 0.3.0 but the yaml version used to compile is a most recent one.

So, there are definitively errors in vcpkg rules concerning OCIO v1.1.1:
https://github.com/microsoft/vcpkg/blob/master/ports/opencolorio/portfile.cmake

Few comments:
  • imposes Python 3 (RB-1.1 only supports Python 2)
  • disables Python bindings
  • requires external tinyxml & yaml. But the yaml version detection is difficult and flaky which could explain the problem if the build finds 0.6.3 for example.

Sometime this week, I will log a defect to vcpkg to fix:
  • require Python 2
  • enable Python bindings
  • do not use external tinyxml & yaml

Let me know if you notice something else.

Regards,

Patrick


Simon Smith
 

Just wondering if any progress was made on the vcpkg build issues I reported last month.
If I knew enough about the vcpkg and underlying systems I would have had a go myself at proposing a fix, but sadly I don’t.

If not, how would people recommend I work around this given that other systems such as OpenEXR, USD, & OpenImageIO are all compiled through the vcpkg system - making it super simple to get dependencies up to date across platforms with very minimal head scratching and setup!

Thanks in advance for any help/pointers that anyone can give.


Best Regards,
   Simon

---
Simon C Smith
Co-Founder & CTO
www.lightmap.co.uk

Email confidentiality notice:
This message is private and confidential. If you have received this message in error, please notify us and remove it from your system.

On 15 Sep 2020, at 15:01, Patrick Hodoul <patrickhodoul@...> wrote:

Hi Simon & Community,

OCIO 1.1.1 is from the branch RB-1.1 and it does not compile in C++11. But the reported error is a new C++11 syntax to initialize vector in a Yaml include file. So, the build can only fail.
The expected yaml version for RB-1.1 is 0.3.0 but the yaml version used to compile is a most recent one.

So, there are definitively errors in vcpkg rules concerning OCIO v1.1.1:
https://github.com/microsoft/vcpkg/blob/master/ports/opencolorio/portfile.cmake

Few comments:
  • imposes Python 3 (RB-1.1 only supports Python 2)
  • disables Python bindings
  • requires external tinyxml & yaml. But the yaml version detection is difficult and flaky which could explain the problem if the build finds 0.6.3 for example.

Sometime this week, I will log a defect to vcpkg to fix:
  • require Python 2
  • enable Python bindings
  • do not use external tinyxml & yaml

Let me know if you notice something else.

Regards,

Patrick


Patrick Hodoul <patrick.hodoul@...>
 

Hi Simon,
Issue 1179 is the issue in OpenColorIO GitHub concerning the problem on which some help will be greatly appreciated.

In the meantime I only see a manual compilation as a solution to the problem i.e. compiling and installing OpenColorIO so that OpenImageIO can find it.
Please refer to the following file to understand how OpenImageIO is working to find OpenColorIO:
https://github.com/OpenImageIO/oiio/blob/master/src/cmake/modules/FindOpenColorIO.cmake

Patrick