This post has NOT been accepted by the mailing list yet.
I'm developing an Erlang binding to a C++ library of mine, which relies on OpenCL.
I set up a basic environment, with proper extern "C", as well as linker flags. In my case the magic words are:
-undefined dynamic_lookup -dynamiclib
Without these additional flags my NIF shared library won't compile. Everything work well until I try to link OpenCL within my NIF library. Bear in mind that I'm on Mac OS and OpenCL comes as a dynamic library (a Cocoa Framework to be more specific) and going to another platform like Linux or Windows is not feasible.
When I try to load my "new" NIF library (with OpenCL linked with it), this is the result:
Which is not very informative about what's going wrong. But I suspect it may be related to the dynamic nature of the OpenCL library. In fact, linking my framework, which is a static library, doesn't cause any issue.
I would like to know:
a) If anyone has had any contact with the NIF + MacOs + C++ world
b) If anyone know a workaround for this annoying situation.