build static OpenCL library


I have downloaded AMDAPP SDK for OpenCL on Debian Squeeze. I would like to know if it is possible to build statically the OpenCL librairies. Currently, I have got in the “/opt/AMDAPP/lib/x86_64/” directory :

one may have : libglut.a libamdocl64.a libOpenCL.a libGLEW.a ??

I try to look options in the Makefile but without success.

anyone could tell me if we can do this and how ?

In order for the OpenCL ICD (Installable Client Driver) mechanism to work (and support whichever hardware and drivers you have installed), you need to use OpenCL.DLL (e.g., under Windows) which is a dispatch layer to the driver. You can’t statically link against it. However, you can statically link against the LIB file provided with your SDK which dynamically loads the DLL.

It would be good to have a statically linked OpenCL CPU backend, that is always available.

Perhaps an open source OpenCL implementation can do it. It can coexist with the ICD.