Building OpenCV-4.5.2 on MacOSX 10.10.5 Yosemite hits both clang & gcc issues

I’m trying to build OpenCV 4.5.2 on MacOSX 10.10.5 (unfortunately an absolute requirement for hardware compatibility / closed source driver reasons,. Thanks Apple!).
Using the clang compilers that come with XCode 7.2.1 (the last version that works on Yosemite. Again, thanks Apple!), (Apple LLVM version 7.0.2 (clang-700.1.81)), the build gets about 95% done, then errors out…
#############################################################
In file included from /Users/xxxx/contrib/opencv-4.5.2/modules/python/src2/cv2.cpp:41:
In file included from /Users/xxxx/contrib/opencv-4.5.2/build/modules/python_bindings_generator/pyopencv_generated_include.h:47:
In file included from /Users/xxxx/contrib/opencv-4.5.2/modules/gapi/include/opencv2/gapi/core.hpp:19:
In file included from /Users/xxxx/contrib/opencv-4.5.2/modules/gapi/include/opencv2/gapi/gkernel.hpp:20:
In file included from /Users/xxxx/contrib/opencv-4.5.2/modules/gapi/include/opencv2/gapi/gcall.hpp:11:
/Users/xxxx/contrib/opencv-4.5.2/modules/gapi/include/opencv2/gapi/garg.hpp:147:38: error: no type named
‘type’ in ‘std::__1::enable_if<false, int>’; ‘enable_if’ cannot be used to disable this declaration
typename std::enable_if< detail::in_variant<T, GRunArgBase>::value, int>::type = 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/xxxx/contrib/opencv-4.5.2/modules/gapi/include/opencv2/gapi/garg.hpp:197:20: note: in instantiation
of member function ‘cv::GRunArg::GRunArg’ requested here
using GRunArg::GRunArg;
^
/Users/xxxx/contrib/opencv-4.5.2/modules/gapi/include/opencv2/gapi/streaming/cap.hpp:85:20: note: while
substituting deduced template arguments into function template ‘Data’ [with T = cv::Mat &]
data = first; // no need to clone here since it was cloned already
^
#############################################################
Thinking it might be something that needs a more modern compiler, I tried GCC 10.3.
CXX="/usr/local/gcc-10.3.0/bin/g+±10.3 -std=c++17 -march=native -O3"
This gets about 37% in when it ends up hitting a rather different issue…
#############################################################
In file included from /usr/include/dispatch/dispatch.h:51,
from /Users/xxxx/contrib/opencv-4.5.2/modules/core/src/parallel.cpp:125:
/usr/local/gcc-10.3.0/lib/gcc/x86_64-apple-darwin14.5.0/10.3.0/include-fixed/dispatch/object.h:373:3: error: ‘dispatch_block_t’ has not been declared
373 | dispatch_block_t notification_block);
| ^~~~~~~~~~~~~~~~
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/parallel.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs…
#############################################################
XCode Clang builds opencv-4.5.2 without issues on MacOSX 10.13.6, I’ll try swapping back and check if gcc 10.3 works there, but even if it does, it doesn’t solve my “getting some old hardware working again” problem.
Thanks in advance for helping to look into this!
Vogarth

opencv-4.5.2 on MacOSX 10.13.6 with XCode clang works, but gcc-10.3 gets about 34% in, and starts spitting out pages and pages of errors.
The first one hit is…
############################################################
In file included from /System/Library/Frameworks/Accelerate.framework/Headers/…/Frameworks/vecLib.framework/Headers/vecLib.h:25,
from /System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h:20,
from /Users/xxxx/contrib/opencv-4.5.2/modules/imgcodecs/src/apple_conversions.h:6,
from /Users/xxxx/contrib/opencv-4.5.2/modules/imgcodecs/src/apple_conversions.mm:5:
/System/Library/Frameworks/vecLib.framework/Headers/vBasicOps.h: In function ‘vUInt16 vU16HalfMultiply(vUInt16, vUInt16)’:
/System/Library/Frameworks/vecLib.framework/Headers/vBasicOps.h:377:84: note: use ‘-flax-vector-conversions’ to permit conversions between vectors with differing element types or numbers of subparts
377 | vUInt16 __vbasicops_vB) { return _mm_mullo_epi16(__vbasicops_vA, __vbasicops_vB); }
| ^
/System/Library/Frameworks/vecLib.framework/Headers/vBasicOps.h:377:54: error: cannot convert ‘vUInt16’ to ‘__m128i’
377 | vUInt16 __vbasicops_vB) { return _mm_mullo_epi16(__vbasicops_vA, __vbasicops_vB); }
| ^~~~~~~~~~~~~~
| |
| vUInt16
############################################################
There seems to be an issue with “nullable”, with a lot of errors like this one…
############################################################
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSRange.h:5,
from /System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:7,
from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10,
from /System/Library/Frameworks/AVFoundation.framework/Headers/AVAnimation.h:11,
from /System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.h:22,
from /xxxx/Devo/contrib/opencv-4.5.2/modules/imgcodecs/src/apple_conversions.h:7,
from /xxxx/Devo/contrib/opencv-4.5.2/modules/imgcodecs/src/apple_conversions.mm:5:
/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:18:4: error: ‘nullable’ does not name a type; did you mean ‘cg_nullable’?
18 | - (nullable instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER;
| ^~~~~~~~
| cg_nullable
############################################################
and a bunch more. Like I mentioned in the first report, getting something compiled on MacOSX 10.10.5 is my only priority around this project. I’ve got the code working just fine using XCode/clang on MacOSX 10.13.6, but the hardware it’s supposed to interact with is completely non-functional on there with zero chance of getting that fixed.
Thanks again for looking at this!