build(4.x) OpenEXR 2.2 or earlier cannot be used with C++17 or later#26678
build(4.x) OpenEXR 2.2 or earlier cannot be used with C++17 or later#26678asmorkalov merged 8 commits intoopencv:4.xfrom
Conversation
cmake/OpenCVFindOpenEXR.cmake
Outdated
| if(NOT OPENEXR_VERSION) | ||
| SET(OPENEXR_VERSION "Unknown") | ||
| else() | ||
| if(HAVE_CXX17 AND OPENEXR_VERSION STRLESS "2_3") |
There was a problem hiding this comment.
STRLESS
"2_3"
Why is not VERSION_LESS?
OPENEXR_VERSION=2.3.0
There was a problem hiding this comment.
Thank you for your comment!
I think usually ‘VERSION_LESS` is better to compare version strings, but OpenCV use not standard version string for system OpenEXR, which is splited with "_" instead of ".".
Like built-in OpenEXR. I'll try to fix this at this pull request.
opencv/cmake/OpenCVFindOpenEXR.cmake
Lines 100 to 102 in 1b48eaf
https://cmake.org/cmake/help/latest/command/if.html#version-comparisons
if(<variable|string> VERSION_LESS <variable|string>)
Component-wise integer version number comparison (version format is major[.minor[.patch[.tweak]]], omitted components are treated as zero).
Build-in OpenEXR (Ver 2.3.0)
-- PNG: /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.6.43)
-- TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 / 4.5.1)
-- JPEG 2000: OpenJPEG (ver 2.5.0)
-- OpenEXR: build (ver 2.3.0)
System OpenEXR (Ver 2_2)
-- PNG: /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.6.43)
-- TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 / 4.5.1)
-- JPEG 2000: OpenJPEG (ver 2.5.0)
-- OpenEXR: /usr/local/lib/libImath-2_2.so /usr/local/lib/libIlmImf-2_2.so /usr/local/lib/libIex-2_2.so /usr/local/lib/libHalf.so /usr/local/lib/libIlmThread-2_2.so (ver 2_2)
There was a problem hiding this comment.
I fixed it. Currently OPENEXR_VERSION had been also used to search libraries.
So I split it into OPENEXR_VERSION_MM to search and OPENEXR_VERSION to show and comparing.
-- PNG: /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.6.43)
-- TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 / 4.5.1)
-- JPEG 2000: OpenJPEG (ver 2.5.0)
-- OpenEXR: /usr/local/lib/libImath-2_2.so /usr/local/lib/libIlmImf-2_2.so /usr/local/lib/libIex-2_2.so /usr/local/lib/libHalf.so /usr/local/lib/libIlmThread-2_2.so (ver 2.2.0)
And I also fixed potential problem.
IF (OPENEXR_VERSION_MAJOR AND OPENEXR_VERSION_MINOR)
set(OPENEXR_VERSION "${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR}")
ENDIF ()
If OpenEXR Ver x.0.y is used, this set(OPENEXR_VERSION) statement will not be executed.
IF (OPENEXR_VERSION_MAJOR AND OPENEXR_VERSION_MINOR)
IF (4 AND 0)
IF (TRUE AND FALSE) # non-zero means TRUE, zero means FALSE
IF (FALSE)
|
Test in opencv/modules/dnn/test/test_common.impl.hpp Lines 79 to 88 in 9c33bae |
|
Vulkan issue addressed in #26691. |
|
@Kumataro please rebase the PR and fix the conflicts. Is the PR ready for integration? |
|
Umm ... I feel there are something wrongs. Should I recreate new pull request and/or branch again ? |
|
Thank you very much for your advice !! I fixed it now. |
OpenEXR 2.2 or earlier cannot be used with C++17 or later opencv#26678 Close opencv#26673 Close opencv#25313 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake

Close #26673
Close #25313
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.