So you think the problem may be caused by 64 bit?<div>I suppose that, in order to work, it need a 32 bit version of Erlang, isn't it?</div><div>Bye</div><div>A.<br><br><div class="gmail_quote">Il giorno 17 marzo 2012 17:03, Tony Rogvall <span dir="ltr"><<a href="mailto:tony@rogvall.se">tony@rogvall.se</a>></span> ha scritto:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Update.<div><br></div><div>running cl works on 32 bit emulator.</div><div>So that is a great workaround, while poking around in the subject.</div>
<span class="HOEnZb"><font color="#888888"><div><br></div><div>/Tony</div></font></span><div><div class="h5"><div><br></div><div><div><div>On 16 mar 2012, at 15:41, Tony Rogvall wrote:</div><br><blockquote type="cite"><div style="word-wrap:break-word">
Hi Dan!<div><br></div><div>I think (and hope) that it is only dlopen that needs to be run from the main thread,</div><div>is the undocumented feature accessible from the NIF's ?</div><div><br></div><div>Otherwise what about having a special async thread you could run in the main thread?</div>
<div><br></div><div>Apple still have not fixed poll ! Lets start a Facebook group ;-)</div><div><br></div><div>/Tony</div><div><br></div><div><div><div>On 16 mar 2012, at 12:09, Dan Gudmundsson wrote:</div><br><blockquote type="cite">
<div>That is a pain ...<br><br>You can grab the main thread within erlang (undocumented ?)  because<br>the gui must also be run from the<br>main thread, which means that you can not combine OpenCL with wx (or esdl).<br><br>
Or is it only the dlopen call that must be run from that thread?<br><br>Apple sometimes not so great..<br><br>/Dan<br><br>On Fri, Mar 16, 2012 at 11:34 AM, Tony Rogvall <<a href="mailto:tony@rogvall.se" target="_blank">tony@rogvall.se</a>> wrote:<br>
<blockquote type="cite">The problem seem to be dlopen, that it must be called from the main thread,<br></blockquote><blockquote type="cite">this used to work. Googling around I can see other people have this problem,<br></blockquote>
<blockquote type="cite">the work around for some projects is to run erlang as:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">erl -smp disable<br></blockquote><blockquote type="cite"><br>
</blockquote><blockquote type="cite">However, this is not possible with the cl binding since it require SMP(<br></blockquote><blockquote type="cite">sending event messages from<br></blockquote><blockquote type="cite">various threads )<br>
</blockquote><blockquote type="cite">You can verify that the cl application loads ok with non smp, but then crash<br></blockquote><blockquote type="cite">with<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">
enif_send: env==NULL on non-SMP VMAbort trap: 6<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">as it should :-)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">
Any OTP takers ? Sverker / Björn ?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">/Tony<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">
<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On 16 mar 2012, at 11:21, Alfredo Di Napoli wrote:<br></blockquote><blockquote type="cite"><br></blockquote>
<blockquote type="cite"><br></blockquote><blockquote type="cite">On 16/mar/2012, at 11:10, Tony Rogvall wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I just tried it, and you are totally correct.<br>
</blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">The cl nif failed to load on R15B Darwin 11.3.0.<br></blockquote><blockquote type="cite">What Erlang release and OS/release are you using ?<br>
</blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">/Tony<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Hi Tony, I'm on a Mac Os X Lion (so SDK 10.7) with the latest Erlang<br>
</blockquote><blockquote type="cite">distribution R15B.<br></blockquote><blockquote type="cite">I suspect this isn't a problem with your bindings, though, because I'm the<br></blockquote><blockquote type="cite">same guy who asked you help about OpenCL binding with NIF via email :)<br>
</blockquote><blockquote type="cite">I've also tried a brain-dead simple NIF application (a stupid app that<br></blockquote><blockquote type="cite">performs a square of a number), compiling it from command line (so no Xcode<br>
</blockquote><blockquote type="cite">involved :) )<br></blockquote><blockquote type="cite">The NIF works fine, until I link ANY Mac OS Framework. In my example I've<br></blockquote><blockquote type="cite">ONLY linked the AppKit.framework: bare in mind that actually the NIF does<br>
</blockquote><blockquote type="cite">not uses it in any function call!<br></blockquote><blockquote type="cite">The result? Abort trap!<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">So I guess this could be a Erlang VM bug, related to Mac Os Frameworks<br>
</blockquote><blockquote type="cite">dynamic linking process.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Regards,<br></blockquote><blockquote type="cite">Alfredo<br></blockquote><blockquote type="cite">
<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">"Installing applications can lead to corruption over time. Applications<br>
</blockquote><blockquote type="cite">gradually write over each other's libraries, partial upgrades occur, user<br></blockquote><blockquote type="cite">and system errors happen, and minute changes may be unnoticeable and<br>
</blockquote><blockquote type="cite">difficult to fix"<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">
<br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">erlang-questions mailing list<br></blockquote><blockquote type="cite"><a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
</blockquote><blockquote type="cite"><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br></blockquote><blockquote type="cite"><br></blockquote>
</div></blockquote></div><br><div>
<span style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><div>
<span style="color:rgb(51,51,51);font-family:Geneva,Arial,Helvetica,sans-serif;font-size:12px">"Installing applications can lead to corruption over time. </span><span style="color:rgb(51,51,51);font-family:Geneva,Arial,Helvetica,sans-serif;font-size:12px">Applications gradually write over each other's libraries, partial upgrades occur, user and system errors happen, and minute changes may be unnoticeable and difficult to fix"</span></div>
<div><span style="color:rgb(51,51,51);font-family:Geneva,Arial,Helvetica,sans-serif;font-size:12px"><br></span></div></span><br>
</div>
<br></div></div>_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br><div>
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div>
<span style="color:rgb(51,51,51);font-family:Geneva,Arial,Helvetica,sans-serif;font-size:12px">"Installing applications can lead to corruption over time. </span><span style="color:rgb(51,51,51);font-family:Geneva,Arial,Helvetica,sans-serif;font-size:12px">Applications gradually write over each other's libraries, partial upgrades occur, user and system errors happen, and minute changes may be unnoticeable and difficult to fix"</span></div>
<div><span style="color:rgb(51,51,51);font-family:Geneva,Arial,Helvetica,sans-serif;font-size:12px"><br></span></div></span><br>
</div>
<br></div></div></div></div></blockquote></div><br></div>