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
Repository Restructure and CMake refactor #520
Repository Restructure and CMake refactor #520
Conversation
project(OpenColorIO VERSION 1.2.0) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on this page it seems that set(CMAKE_CXX_EXTENSIONS OFF)
must be added to avoid platform specific C++11 extensions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not being an expert of cmake I've only review the code changes. I think that it's very nice refactoring of the code and a great simplification of the cmake files. So, that's a win for me 👍
share/cmake/FindLCMS2.cmake
Outdated
|
||
# attempt to find static library first if this is set | ||
if(LCMS2_STATIC_LIBRARY) | ||
set(LCMS2_STATIC liblcms2.a) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a linux specific name.
For Windows, the names of the 'external' libraries are: lcms2.lib, libyamll-cppmd.lib and tinyxml.lib.
Looks like a great improvement! A few minor comments on first glance:
Might be out-of-scope for this ticket, but since it relates to tidying up the repo:
|
I think its just to highlight that they aren't a part of the core library, which is true. You have executables that link against it, and language bindings that are built on top of it. I'd say they use OpenColorIO but aren't in and of themselves "OpenColorIO" the library, but are a part of "OpenColorIO" the project.
I agree on the Changelog, just needs to be deleted. RV and Mari could also disappear since they're natively supported now. I'd say that ocioconvert should go, OIIO has supported OCIO for some time now, so it's redundant and frankly not useful. ociodisplay is a little different. I think it's useful to provide a good reference implementation of OCIO, but I don't think ociodisplay satisfies that completely. It could be moved to its own repository so as to remove the OIIO dependency from OCIO completely. |
ah, ociolutimage also depends on OIIO |
Why would you remove ocioconvert? For automated tests it shouldn’t have an
external dependency just to test itself. If you have a problem how do you
quickly know if the issue is oiio or ocio?
…On Thu, Mar 8, 2018 at 02:57 Sean Cooper ***@***.***> wrote:
I prefer the original src/core/ to src/OpenColorIO (otherwise it kind of
sounds like all the other code isn't part of OCIO)
I think its just to highlight that they aren't a part of the core library,
which is true. You have executables that link against it, and language
bindings that are built on top of it. I'd say they *use* OpenColorIO but
aren't in and of themselves "OpenColorIO" the library, but are a part of
"OpenColorIO" the project.
There's a separate changelog in docs which is empty and untouched for 6
years, could be removed
The rv integration code in thirdparty/rv/ is very outdated and should be
deleted. Probably same with Mari one
ocioconvert and maybe ociodisplay feel a bit like example code rather than
practical utilities (compared to ociocheck/ociobakelut/etc). Not sure if
these should be handled differently, somehow. Particularly given the
somewhat circular dependency where OIIO depends on OCIO (and these parts of
OCIO then depend on OIIO)
I agree on the Changelog, just needs to be deleted. RV and Mari could also
disappear since they're natively supported now. I'd say that *ocioconvert*
should go, OIIO has supported OCIO for some time now, so it's redundant and
frankly not useful.
*ociodisplay* is a little different. I think it's useful to provide a
good reference implementation of OCIO, but I don't think *ociodisplay*
satisfies that completely. It could be moved to its own repository so as to
remove the OIIO dependency from OCIO completely.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#520 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAHaAUpF5bq_GB_75GgTolPbpMDVRdD1ks5tcQ6XgaJpZM4Sbdef>
.
|
ocioconvert already has a dependency on OIIO, and there isn't anything that ocioconvert does that couldn't be done by |
Indeed, but seems like having
ociodisplay is a definitely valuable piece of example code to have around (same with ocioconvert). I was thinking they could be organised a bit more like, say, the Qt "demos" example code - an clearly separate (optional) component when you build Qt (still be built via CI of course), creates a separate executable, and structured distinctly from the main source - e.g https://github.com/qt/qtbase/tree/5.11/examples/ Wouldn't be a big change, just a slightly clearer distinction between the "core" applications like ociocheck (might just be a case of moving them into
Hmm oh yeh - that is a bit unfortunate. I wonder if instead of OIIO it could use a few smaller libraries which we could bundle into the thirdparty modules (maybe TinyTIFF and TinyEXR). Much less flexible than OIIO, but that isn't necessary a bad thing (e.g would mean people couldn't accidentally try and extract a LUT from a compressed JPEG) Probably worth splitting this into a separate ticket |
|
@Shootfast Following the agreement explained in #556, this work is now critical for the next steps of OCIO v2. So, I took few hours to investigate the branch. Only few minor changes are needed to make it compile on Windows (except the unit tests which are missing). Not beeing a cmake expert please only use these files as a way to highlight where are the remaining problems. |
@Shootfast, noticed there we updated commits but I'm not certain if you're done. For those following at home, here's the proposed structure from the latest commit on this fork:
I do think it is much more clear and straight forward, though I'm still not 100% on the overall structure. In particular So anyway, I took a stab at what it would like to me as a additional commit on top of your cmake work (which is much much better) and I didn't touch it much apart from dir changes. Found here: Directory layout here:
|
Regardless of the final decision it should try to happen swiftly, so as to unblock the ADSK contributions... Also your Python bindings weren't building correctly due to a missing definition: In addition to Python3 being pulled in on MacOS and breaking |
Yeah, I'm almost finished. Just chasing the last few build bugs.
I still have to shuffle some tests around (python and java binding tests in particular), and I have some linker errors on the windows side that I've not 100% found the cause of yet. |
I like your changes though! I might pull those across / make the same changes to my branch. I haven't yet included putting the ops, fileformats, and transforms into their own subdirectories yet. Do you think that would be a worthwhile change to make here at the same time? |
Python3 is not supported yet right? It's the build bot configuration that is wrong, not me right? 😇 |
Ok, yeah, I just think The vendor/DCC specific code is definitely odd since some of them really just work as examples, whereas the photoshop and aftereffects are the only real workhorses there that provide something the DCC doesn't, and the rest are outdated... but we can worry about that outside of this PR. I would go ahead and subdir the transforms/filetypes. Patrick et. al. PRs should still be ready to merge because the they were git-moved, correct? |
For Python stuff, I think we need to manually force it to Python2.7 if Python3 doesn't work out of the box... at least until its fixed and working. Seems like you'll specify by:
In both the python binding and docs CMakeLists.txt |
Submitted a PR to your branch if you wanted to pull my changes in. |
That did indeed fix the MacOS issue, but the Windows builds are horribly maimed... |
Hoping it could help, here are my findings for the Windows platform:
|
Nothing in OCIO currently depends on ilmbase, and there don't seem to be any includes for any of its components. This might be a red-herring
Thanks for this one, I'll add it to the CMake for it (though I've disabled the GPU tests on the CI hosts)
Yeah any help here would be great. I'm fairly sure it's me building sub-components with the wrong visibility settings when they pull in the public api. Might be the unit tests too as they pull the same files (but don't link against the OpenColorIO dll) |
BTW, I like @scoopxyz proposal for the new file structure. |
--> OIIO adds an explicit dependency on IlmBase includes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all your work on this @Shootfast !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Carrying over the error that necessitates jumping to CMake 3.10.x:
-- The C compiler identification is MSVC 19.0.24213.1
-- The CXX compiler identification is MSVC 19.0.24213.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OIIO: D:/OpenSource/3rdParty/compiled-dist_rls/OpenImageIO-1.9.0/lib/OpenImageIO.lib
-- Found ILMBASE: D:/OpenSource/3rdParty/compiled-dist_rls/IlmBase-2.2.0/include
CMake Error at src/apps/ociobakelut/CMakeLists.txt:7 (target_link_libraries):
Target "lcms2" of type UNKNOWN_LIBRARY may not be linked into another
target. One may link only to STATIC or SHARED libraries, or to executables
with the ENABLE_EXPORTS property set.
-- Found GLEW: D:/OpenSource/3rdParty/glew-1.9.0/include
-- Found GLUT: D:/OpenSource/3rdParty/freeglut-3.0.0-2/lib/freeglut.lib
-- Found OpenGL: opengl32
-- Found PythonLibs: C:/Python27/libs/python27.lib (found suitable version "2.7.13", minimum required is "2.7")
-- Found PythonInterp: D:/Tools/cygwin64/bin/python2.7.exe (found suitable version "2.7.14", minimum required is "2.7")
CMake Error at src/OpenColorIO/CMakeLists.txt:77 (target_link_libraries):
Target "tinyxml" of type UNKNOWN_LIBRARY may not be linked into another
target. One may link only to STATIC or SHARED libraries, or to executables
with the ENABLE_EXPORTS property set.
CMake Error at src/OpenColorIO/CMakeLists.txt:77 (target_link_libraries):
Target "yamlcpp" of type UNKNOWN_LIBRARY may not be linked into another
target. One may link only to STATIC or SHARED libraries, or to executables
with the ENABLE_EXPORTS property set.
CMake Error at tests/cpu/CMakeLists.txt:13 (target_link_libraries):
Target "tinyxml" of type UNKNOWN_LIBRARY may not be linked into another
target. One may link only to STATIC or SHARED libraries, or to executables
with the ENABLE_EXPORTS property set.
Call Stack (most recent call first):
tests/cpu/CMakeLists.txt:118 (add_ocio_test)
CMake Error at tests/cpu/CMakeLists.txt:13 (target_link_libraries):
Target "yamlcpp" of type UNKNOWN_LIBRARY may not be linked into another
target. One may link only to STATIC or SHARED libraries, or to executables
with the ENABLE_EXPORTS property set.
Call Stack (most recent call first):
tests/cpu/CMakeLists.txt:118 (add_ocio_test)
-- Configuring incomplete, errors occurred!
See also "D:/OpenSource/ocio_mark/build_rls/CMakeFiles/CMakeOutput.log".
Also, a summary of the changes included:
@Shootfast correct me if wrong/missing things |
The only side note is that the java bindings are not working at the moment, but that is already the case on the master branch, and I will try to fix them up soon. I do also want to make it so that the apps aren't built by default (as this leads to the circular dependency issue), but again I can make those changes after this patch is merged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows 7 with Vc14 in Release mode (and using jom), ctest -V fails:
3: Test command: C:\Python27\python.exe "D:/OpenSource/ocio_mark/tests/python/OpenColorIOTestSuite.py" "D:/OpenSource/ocio_mark/build_rls" "Release"
3: Test timeout computed to be: 10000000
3: Traceback (most recent call last):
3: File "D:/OpenSource/ocio_mark/tests/python/OpenColorIOTestSuite.py", line 18, in <module>
3: import PyOpenColorIO as OCIO
3: ImportError: No module named PyOpenColorIO
3/3 Test #3: test_python ......................***Failed 0.06 sec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows 7 using Vc14 in Debug mode, the Python library link fails:
version:0.0 /machine:x64 /debug /INCREMENTAL C:\Python27\libs\python27.lib ..\..\OpenColorIO\OpenColorIO.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:
CMakeFiles\PyOpenColorIO.dir/intermediate.manifest CMakeFiles\PyOpenColorIO.dir/manifest.res" failed (exit code 1104) with the following output:
LINK : fatal error LNK1104: cannot open file 'python27_d.lib'
[100%] Built target test_gpu_exec
jom: D:\OpenSource\ocio_mark\build_dbg\src\bindings\python\CMakeFiles\PyOpenColorIO.dir\build.make [src\bindings\python\PyOpenColorIO.pyd] Error 2
jom: D:\OpenSource\ocio_mark\build_dbg\CMakeFiles\Makefile2 [src\bindings\python\CMakeFiles\PyOpenColorIO.dir\all] Error 2```
because it looks for **python27_d.lib*** where default Python installation on Windows is release only.
The solution would be to have two Python installations which not a way to go on Windows platform.
[Minor] The command jom help does not display any target to only run Python tests. |
[Minor] It would be nice to have a target like jom test_verbose to run test in verbose mode (i.e. like ctest -V) |
Using the target Visual Studio 14 2015 Win64 with Vc14 in release mode, the command GPU & Python unit tests fail:
Update A solution is to update the execution environment. Closed |
[Minor] The compilation variable OCIO_WARNING_AS_ERROR is not used by the build
|
ext/CMakeLists.txt
Outdated
endif() | ||
|
||
if(NOT BUILD_SHARED_LIBS) | ||
#TODO: Find a way to merge in the static libs when built with internal yamlcpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo 'yaml' --> 'tinyXML'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, and added the same warning to lcms2!
src/OpenColorIO/CMakeLists.txt
Outdated
) | ||
|
||
add_library(OpenColorIO ${SOURCES}) | ||
set_property(TARGET OpenColorIO PROPERTY CXX_STANDARD 11) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The C++ version selection is already done in the CMakeLists.txt line 5. Why is that needed here too?
If oneday the C++ version is changed, only one location should be changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, This was leftover from an earlier test. I've removed the additional check.
add_subdirectory(ociobakelut) | ||
add_subdirectory(ociocheck) | ||
|
||
if(TARGET OpenImageIO) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometime some external libraries are checked (i.e. OpenImageIO) and the build is 'adjusted'. Sometimes some external libraries (GLUT, GLEW) are required, and the build fails if they are not present. On the Windows platform, the two cases are strictly equivalent as none of these libraries are installed by default.
I would recommend following the same rule (i.e. the OpenImageIO one) for all external libraries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a tricky one. The presence of OIIO is the common requirement for those additional apps, hence me using it to drive their inclusion. In the past we considered OIIO to be a "non blocking" requirement, as you can still build some tools without it. I would be tempted to remove the special check for OIIO and make the entire OCIO_BUILD_APPS require OIIO, as this might also help the people with the circular dependency problem.
This would treat OIIO, GLUT and GLEW as hard dependencies for all apps, and we could just rely on the traditional find_package(OIIO) calls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the windows platform, the makefile generation will fail right away as none of these libraries are present by default. I would prefer to let Windows devs be able to generate the makefiles and compile successfully even if some apps are missing (and GPU unit tests are missing too).
Another point is that the libraries are part of two different categories, one to read/write a file (OIIO) and some to have GPU. For example, GPU unit tests only need GPU related libraries while ociodisplay needs both categories.
Note: The find_package with some ' potential path' will never work on Windows.
My proposal is to only have soft dependencies with clear messages explaining the 'adjustment'.
With the long-term maintenance perpective in mind, we should help devs (*nix or Windows platforms) successfully compile the library itself whatever is the platform.
Compiling (i.e. Vc14 in Release mode) with -DBUILD_SHARED_LIBS=OFF fails because of symbol issues.
Note: That case should be added to the CI builds. Note: If it's problematic to fix, it could be done in a follow-up pull request i.e. not blocking |
I am not a fan of additional targets that are created solely for non-build related tasks. If you want verbose tests, run ctest -V! I've made the verbose output be the default for the CI jobs. |
The current Python test runner is a bit of a hack. I might try and get cmake to pass the built location of OpenColorIO and PyOpenColorIO explicitly, rather than relying on my guesswork. |
After a discussion with @Shootfast and the fact that the work is blocking for any development on the repo, we agreed to merge the work as-is. The modernization of the depot (refactor/simplify of cmake files, and file source code retructuration) is now successfully completed. Here is a summary of missing parts:
@Shootfast please correct me if needed. |
Hi,
This isn't quite 100% ready yet (I need to rebase with some latest patches and unit tests), but I'm putting it here for public review / criticism on what I've done so far.
What's not done yet:
I'm hoping to tick of the remaining issues over the next week or so!