As per OpenCL spec:
"All OpenCL API calls are thread-safe except clSetKernelArg. These thread-safe APIs allow an application to call these functions in multiple host threads without having to implement mutual exclusion across these host threads."
[For details, please refer the "Note" section of clSetKernelArg.html ]
So, I think, multiple clBuildProgram calls should work without any race condition. Are you running each instance as a separate process or thread? Can I assume that it works fine when there are upto 8 instances running on that machine?
It would be helpful if you could share the compilation error or bug you are getting. Just make sure you are using the latest driver version.
I'm sorry for very late answering, I just found out that opencl-c compiler is not ready always and needs to be queried which I didn't know.
I forgot to use CL_DEVICE_COMPILER_AVAILABLE on all threads. My bad.