I recommend that you read the Apple documentation on Frameworks .
The main story, however, is that OS X allows library and header search paths based on the frameworks you compile. For example, to compile a program using the OpenCL SDK on a Macintosh, you must compile it as follows:
clang -framework OpenCL main.c
This tells clang (or gcc or llvm-gcc, depending on your choice of compiler) to search for the System OpenCL SDK for both the headers (for compilation) and the libraries (for binding). Try:
// compile me with: clang -framework OpenCL -o test test.c #include <stdio.h> #include <stdlib.h> #include <OpenCL/opencl.h> int main(int argc, char* const argv[]) { cl_uint num_devices, i; clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, 0, NULL, &num_devices); cl_device_id* devices = calloc(sizeof(cl_device_id), num_devices); clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, num_devices, devices, NULL); char buf[128]; for (i = 0; i < num_devices; i++) { clGetDeviceInfo(devices[i], CL_DEVICE_NAME, 128, buf, NULL); fprintf(stdout, "Device %s supports ", buf); clGetDeviceInfo(devices[i], CL_DEVICE_VERSION, 128, buf, NULL); fprintf(stdout, "%s\n", buf); } free(devices); }
Please note that here I include OpenCL/opencl.h . This is the preferred title to enable to access CL on Mac. If you look at the title, you will see that it includes cl.h for you as well as cl_platform.h . You can simply enable OpenCL/cl.h if you want; it will still work fine.