[erlang-questions] OpenCL.framework cause my NIF library to crash
Tue Mar 13 17:54:19 CET 2012
Do you also have the -framework OpenCL flag? Static libraries don't
automatically link in their dynamic dependencies.
On Tuesday, March 13, 2012, CharlesStain <> wrote:
> Hi everyone,
> I'm developing an Erlang binding to a C++ library of mine, which relies on
> 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.
> 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:
> laetus alfredodinapoli$ rebar eunit
> ==> elaetus (eunit)
> Compiled src/elaetus_app.erl
> Compiled src/elaetus_sup.erl
> Compiled src/elaetus.erl
> Trace/BPT trap: 5
> Which is not very informative about what's going wrong. But I suspect it
> be related to the dynamic nature of the OpenCL library. In fact, linking
> 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.
> Thanks in advance,
> Alfredo Di Napoli
> View this message in context:
> Sent from the Erlang Questions mailing list archive at Nabble.com.
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions