tl;dr - In spite of some explicit include path manipulation done in
USD's build_usd.py, the OIIO build is incorrectly referring to OpenEXR
headers in /usr/include anyway. I've worked around this locally by undoing
a change that was added to OIIO in 2012, but checking here to make sure the
change makes sense.
Details below.
...
In build_usd.py there lies a comment: "OIIO's FindOpenEXR module
circumvents CMake's normal library search order, which causes versions of
OpenEXR installed in /usr/local or other hard-coded locations in the module
to take precedence over the version we've built" [1]. What build_usd.py
does is set OPENEXR_ROOT explicitly, and somewhere within OIIO's
FindOpenEXR.cmake this is supposed to override the search path and make
sure OPENEXR_ROOT sorts ahead of -I/usr/include in the search order.
However, that's not working, at least not for me.
After some manual debugging I tracked down a commit [2] from pull request
#329 made in OIIO in 2012:
- include_directories ("${Boost_INCLUDE_DIRS}")
+ include_directories (SYSTEM "${Boost_INCLUDE_DIRS}")
When Boost is installed in the same path as OPENEXR_ROOT, then declaring
that path "-isystem" forces the path to be scanned after all "-I" paths,
and defeats the effects of that OPENEXR_ROOT path override in build_usd.py.
My workaround was to add a patch that reverts that single line from 2012,
and now OIIO is building again.
[1]
https://github.com/PixarAnimationStudios/USD/blob/release/build_scripts/build_usd.py#L1113-L1121
[2]
https://github.com/OpenImageIO/oiio/pull/329/files#diff-95646360eb377c7ddd3025bdbbea190342b0c354d2a3d859d33d359ddb0484b1R159
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org