OSX: Building OpenCV 3.0.0, undeclared identifier clEnqueueSVMMap - macos

I'm trying to get OpenCV built on OSX (Yosemite), following this guide: http://blogs.wcode.org/2014/10/howto-install-build-and-use-opencv-macosx-10-10/
Got the static libs built fine but when building the shared libs I get errors, including the following:
/Users/chrismash/Development/OSX/WireframeUpscaler/WireframeUpscaler/ThirdParty/opencv-3.0.0/modules/core/src/ocl.cpp:2700:49:
error:
use of undeclared identifier 'clEnqueueSVMUnmap'; did you mean
'svm::SVMFunctions::fn_clEnqueueSVMUnmap'? ...= clEnqueueSVMUnmap;
^~~~~~~~~~~~~~~~~
svm::SVMFunctions::fn_clEnqueueSVMUnmap
/Users/chrismash/Development/OSX/WireframeUpscaler/WireframeUpscaler/ThirdParty/opencv-3.0.0/modules/core/src/ocl.cpp:2700:49:
error:
invalid use of non-static data member 'fn_clEnqueueSVMUnmap'
svmFunctions.fn_clEnqueueSVMUnmap = clEnqueueSVMUnmap;
Any ideas where I might be going wrong...?

As #jprice pointed out it seems I somehow got the WITH_OPENCL_SVM option enabled in CMake. Because OS X doesn't support OpenCL 2.0 yet it should be unticked.

Related

"'_Nonnull' cannot be applied to non-pointer type" while building FLTK on macOS?

I tried to build FLTK 1.3.4-2 version on my mac. I followed the instruction, and successfully configure it.
But when I install it, it shows:
Compiling Fl_cocoa.mm...
In file included from Fl_cocoa.mm:55:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:128:
/System/Library/Frameworks/Foundation.framework/Headers/NSUUID.h:26:49: error: nullability specifier '_Nullable' cannot be applied to
non-pointer type 'uuid_t' (aka 'unsigned char [16]')
- (instancetype)initWithUUIDBytes:(const uuid_t _Nullable)bytes;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSUUID.h:29:30: error: nullability specifier '_Nonnull' cannot be applied to
non-pointer type 'uuid_t' (aka 'unsigned char [16]')
- (void)getUUIDBytes:(uuid_t _Nonnull)uuid;
^
2 errors generated.
make[1]: *** [Fl_cocoa.o] Error 1
make: *** [install] Error 1
Does anyone know how to solve this problem?
It seems you build system is a bit of mix'n'match and through that you have found a compiler bug.
The error message indicates that the compiler is not recognising that an array type (uuid_t) when used as a function/method parameter type becomes a pointer type (as C-style arrays are passed by reference not by value) before it checks the validity of _Nullable/_Nonnull – so it throws the error as _Nullable/_Nonnull are not applicable to array types.
However not only isn't this your code, it is system code which is causing the error, which is surprising. Which is where the mix'n'match comes in...
Prior to the macOS10.13 SDK the two methods causing the error, initWithUUIDBytes: and getUUIDBytes:, were not annotated with nullability attributes. By default Xcode 8.1 uses the macOS10.12 SDK and your code should compile with that arrangement – the included header, NSUUID.h, will not contain the nullability attributes.
If you wrote your own code with array typed parameters and specified nullability then Xcode 8.1's compiler would produce an error – the bug is in (at least) that compiler. But this isn't your code...
Xcode 9.4.1 (lastest 9) by default uses macOS10.13SDK and again your code would compiler – the included header will contain the nullability attributes and Xcode 9.4.1's compiler will not produce an error as the bug has been fixed.
So at best guess either you are using Xcode 8.1 but with the macOS10.13+ SDK intentionally installed, or you've managed to install the macOS10.13+ SDK headers and you are using a version of gcc which has the bug, or you've got multiple versions of Xcode installed and the command line tools are not for Xcode 8.1 (How to switch between multiple Command Line Tools installations in Mac OS X (without installing XCode) may help), or some other scenario where you've got mismatched compilers and installed SDKs – nobody else but you can know what is actually installed on your system; the header file path is a system location so the header causing the issue isn't a copy in the FLTK source folder.
HTH
[BTW your gcc comes from 2007, if you are building with it you should probably update to something newer.]

Vmware 8.0 and ubuntu bionic- gcc not found

I am trying to install vmware 8 on kubuntu bionic with gcc-7.3. The installation process went well until the message "gcc is not found". gcc is there but I guess vmware 8 is too old and does not recognize gcc version 7.3.
I have tried to manually compiled the modules (vmmon and stuff) but an error came out. An example is shown below.
/usr/lib/vmware/modules/source/vmmon-only/linux/driver.c: At top level:
/usr/lib/vmware/modules/source/vmmon-only/linux/driver.c:175:19: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
.fault = LinuxDriverFault
^~~~~~~~~~~~~~~~
/usr/lib/vmware/modules/source/vmmon-only/linux/driver.c:175:19: note: (near initialization for ‘vmuser_mops.fault’)
/usr/lib/vmware/modules/source/vmmon-only/linux/driver.c: In function ‘init_module’:
/usr/lib/vmware/modules/source/vmmon-only/linux/driver.c:346:4: error: implicit declaration of function ‘init_timer’; did you mean ‘init_timers’? [-Werror=implicit-function-declaration]
init_timer(&linuxState.pollTimer);
^~~~~~~~~~
init_timers
Is there a workaround?
Many thanks

OSX Sierra Xcode clang libc++ missing qualifier bug

Using:
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.1.0
there are huge numbers of errors introduced in the standard library by a really stupid coding error: an example is here:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono:281:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ratio:256:81: fatal error:
unknown class name 'false_type'; did you mean '::std::false_type'?
template struct __is_ratio : false_type {};
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:278:38: note:
'::std::false_type' declared here
typedef _LIBCPP_BOOL_CONSTANT(false) false_type;
^
The compiler diagnostic is correct, it should read ::std::false_type. I fixed that but then found the same error is repeated over and over again all over the library. The library worked until I decided to use chrono. The bug, however, is not just in chrono.
Does anyone know if this has been fixed?

Error in building OpenCV 3.1 in Mac OS X

I am trying to install OpenCV 3.1 in Mac OS 10.10 Yosemite, however after cmake there was always the following error:
/Users/cwang/Downloads/opencv/modules/core/include/opencv2/core/matx.hpp(503): error: identifier "_Static_assert" is undefined
detected during:
instantiation of "cv::Matx<_Tp, m, n>::Matx(_Tp, _Tp) [with _Tp=float, m=2, n=1]"
OpenCV 3.0 would not produce the error.
Any ideas?
I get around this error by setting CMAKE_CXX_FLAGS=-std=c++11 (check the advanced box if you are using the CMake GUI).
The CV_StaticAssert macro should expand to static_assert for a modern c++ compiler. See the macro for CV_StaticAssert in base.hpp starting at line 275.

VSTGUI 4.0.1 XCODE 4.5 and MacOSX 10.8 Troubles

That's the first time I use stack overflow 'cause I got a problem develop VST Plugins with GUI on MacOSX 10.8.
I'm new to mac development and I'm not shure why I get the following errors due compiling and linking my product using VSTGUI 4.0.1.
/Users/christianschragen/Downloads/samples/vst2.x/mac/aeffguieditor.cpp:115:34: 'createDrawContext' is deprecated
/Users/christianschragen/Downloads/samples/vst2.x/mac/aeffguieditor.cpp:182:10: 'TickCount' is deprecated: first deprecated in Mac OS X 10.8
/Users/christianschragen/Downloads/samples/vst2.x/mac/aeffguieditor.cpp:237:27: Conversion from string literal to 'char *' is deprecated
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/cview.cpp
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/cview.cpp:661:22: No matching function for call to 'make_pair'
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/macfileselector.mm
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/macfileselector.mm:239:5: 'beginSheetForDirectory:file:types:modalForWindow:modalDelegate:didEndSelector:contextInfo:' is deprecated
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/macfileselector.mm:244:21: 'runModalForDirectory:file:types:' is deprecated
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/macfileselector.mm:255:5: 'beginSheetForDirectory:file:modalForWindow:modalDelegate:didEndSelector:contextInfo:' is deprecated
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/macfileselector.mm:260:21: 'runModalForDirectory:file:' is deprecated
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewframe.cpp
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewframe.cpp:493:4: Use of undeclared identifier 'GetPortBounds'
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewframe.cpp:524:2: Use of undeclared identifier 'GetPortBounds'
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewframe.cpp:539:24: Use of undeclared identifier 'QDSwapPort'
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewframe.cpp:542:3: Use of undeclared identifier 'QDSwapPort'
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewframe.cpp:634:124: Non-constant-expression cannot be narrowed from type 'CCoord' (aka 'double') to 'CGFloat' (aka 'float') in initializer list
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewframe.cpp:747:13: Enumeration value 'kError' not handled in switch
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewframe.cpp:808:24: Use of undeclared identifier 'NewRgn'
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewframe.cpp:822:5: Use of undeclared identifier 'DisposeRgn'
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewframe.cpp:1016:17: Use of undeclared identifier 'kQDRegionToRectsMsgParse'
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewframe.cpp:1117:37: Use of undeclared identifier 'kQDParseRegionFromTopLeft'
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewoptionmenu.cpp
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewoptionmenu.cpp:107:17: 'UniqueID' is deprecated: first deprecated in Mac OS X 10.8
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewtextedit.cpp
/Users/christianschragen/Downloads/samples/vst2.x/mac/lib/platform/mac/carbon/hiviewtextedit.cpp:111:3: Use of undeclared identifier 'GetFNum'
Any ideas what's wrong?
Thanks
Chris
I have a strong feeling that VSTGUI does not support 10.8 yet. You should set the target SDK in your Xcode build settings to 10.7 (or maybe 10.6), which probably involves downloading a huge DMG from Apple via Xcode.
Also it probably wouldn't hurt to contact the VSTGUI developers to seek support from them.

Resources