Skip to content
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

error: unknown type name 'AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER' #4

Open
ryandesign opened this issue Jul 29, 2023 · 3 comments
Open

Comments

@ryandesign
Copy link

clew fails to build on Mac OS X 10.6. The error is:

include/clew.h:2352:22: error: unknown type name 'AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER'
typedef CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem (CL_API_CALL *
                     ^
include/clew.h:85:76: note: expanded from macro 'CL_EXT_PREFIX__VERSION_1_1_DEPRECATED'
    #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED   CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
                                                                           ^

The macro AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER first appeared in the Mac OS X 10.7 SDK and is not available in earlier SDKs.

@sergeyvfx
Copy link
Contributor

Can you please adding the following right after the #include <AvailabilityMacros.h> at line 59 of the clew.h:

#      if !defined(AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER)
#          define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER __attribute__((unavailable))
#      endif

@ryandesign
Copy link
Author

Thanks, that does eliminate that error. Would it make sense to give the same treatment to AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER?

The next error is:

include/clew.h:2629:21: error: 'PFNCLCREATEIMAGE2D' is unavailable
CLEW_FUN_EXPORT     PFNCLCREATEIMAGE2D                  __clewCreateImage2D                 ;
                    ^
include/clew.h:2359:1: note: 'PFNCLCREATEIMAGE2D' has been explicitly marked unavailable here
PFNCLCREATEIMAGE2D)(cl_context              /* context */,
^

@sergeyvfx
Copy link
Contributor

I think the AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER would need to be handled differently on your platform. You mentioned you're using 10.6, so it does not sound correct to declare symbols as unavailable.

Maybe you can get defines from a newer version of AvailabilityMacros.h and define them manually if they are not defined yet?
Looking online, maybe something like this could work:

#if !defined(AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER)
    #if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
        #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER     UNAVAILABLE_ATTRIBUTE
    #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
        #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER     WEAK_IMPORT_ATTRIBUTE
    #else
        #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
    #endif
#endif

Not sure if the UNAVAILABLE_ATTRIBUTE and WEAK_IMPORT_ATTRIBUTE would need to be manually expanded.

Another idea is to get an older version of the OpenCL wrangler. I think we used 10.6 deployment target in Blender 2.70, so maybe grabbing files from there will work for you : https://projects.blender.org/blender/blender/src/tag/v2.70/intern/opencl/intern

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants