<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>I don't think so - I had to build and install glfw from source to get the Haskell code to link after building glfw-b (which built fine without GLFW installed, incidentally).</div><div><br></div><div>I get the following for library dependencies - it looks like they're using the exact same libs (aside from iconv):</div><div><br></div><div><div>hhmacbook:~/Development/haskell/OpenGL:6&gt; otool -L ./a.out&nbsp;</div><div>./a.out:</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>@executable_path/libglfw.dylib (compatibility version 1.0.0, current version 1.0.0)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)</div><div>hhmacbook:~/Development/haskell/OpenGL:7&gt; otool -L ./Test2</div><div>./Test2:</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>@executable_path/libglfw.dylib (compatibility version 1.0.0, current version 1.0.0)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)</div><div>hhmacbook:~/Development/haskell/OpenGL:8&gt;&nbsp;</div></div><div><br></div><br><div><div>On Mar 10, 2013, at 9:31 AM, Andrey Yankin wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div><div>Hi.<br><br></div>AFAIK glfw-b uses its own version of glfw which is built during setup.<br></div><div>There is a makefile inside the package.<br></div><div><br></div>Can't reproduce this error on Arch.<br>
<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/3/10 Hollister Herhold <span dir="ltr">&lt;<a href="mailto:hollister@fafoh.com" target="_blank">hollister@fafoh.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
OK, I get the same results as you. I ran a dtruss on the two different apps to look at the system calls being made and I can see where the C code opens the OpenGL hardware driver and the haskell code does not, but I'm not sure why. There are a lot of preferences files flying around. Still digging.<br>

<br>
I do know that both apps are using the same glfw library.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Mar 10, 2013, at 8:23 AM, Hollister Herhold wrote:<br>
<br>
&gt;<br>
&gt; I'm building glfw now on 10.7.5 and I'll try your test code.<br>
&gt;<br>
&gt; I've been learning haskell (still very much a beginner) but I know OpenGL, so I'm very interested in how this turns out.<br>
&gt;<br>
&gt; -Hollister<br>
&gt;<br>
&gt;<br>
&gt; On Mar 10, 2013, at 4:38 AM, Jesper Särnesjö wrote:<br>
&gt;<br>
&gt;&gt; On Sun, Mar 10, 2013 at 4:46 PM, Jesper Särnesjö &lt;<a href="mailto:sarnesjo@gmail.com">sarnesjo@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt; I've figured out what the problem is: the Haskell program is using a<br>
&gt;&gt;&gt; software implementation of OpenGL, so rendering *does* in fact happen<br>
&gt;&gt;&gt; on the CPU.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; It would appear that there is in fact some relevant difference between<br>
&gt;&gt;&gt; the Haskell and C versions of my program, or possibly some way<br>
&gt;&gt;&gt; in which the bindings from the GLFW-b package are different from the C<br>
&gt;&gt;&gt; library.<br>
&gt;&gt;<br>
&gt;&gt; To remove any possibility of the problem being in GLFW-b or OpenGLRaw,<br>
&gt;&gt; I created two new programs, one in Haskell [1] and one in C [2], that<br>
&gt;&gt; don't import or include anything related to OpenGL, and that simply<br>
&gt;&gt; create a context, check if it is hardware accelerated, and then exit.<br>
&gt;&gt; That is all. And still, the Haskell program receives a software<br>
&gt;&gt; renderer, while the C program receives a hardware one:<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; $ ghc -O2 Test2.hs -lglfw -framework OpenGL -fforce-recomp &amp;&amp; ./Test2<br>
&gt;&gt; &nbsp; [1 of 1] Compiling Main &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ( Test2.hs, Test2.o )<br>
&gt;&gt; &nbsp; Linking Test2 ...<br>
&gt;&gt; &nbsp; software<br>
&gt;&gt; &nbsp; (2,7,7)<br>
&gt;&gt; &nbsp; (3,2,0)<br>
&gt;&gt; &nbsp; $ gcc -O2 test2.c -lglfw -framework OpenGL &amp;&amp; ./a.out<br>
&gt;&gt; &nbsp; hardware<br>
&gt;&gt; &nbsp; 2.7.7<br>
&gt;&gt; &nbsp; 3.2.0<br>
&gt;&gt;<br>
&gt;&gt; I haven't had the chance to run these programs on any OS other than<br>
&gt;&gt; Mac OS X 10.8.2, so I don't know if this problem is Mac-specific.<br>
&gt;&gt; Still, it's really weird that the system would differentiate between<br>
&gt;&gt; Haskell and C programs in this way.<br>
&gt;&gt;<br>
&gt;&gt; If anyone has any ideas about what's going on here, I'd very much like<br>
&gt;&gt; to hear them.<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Jesper Särnesjö<br>
&gt;&gt; <a href="http://jesper.sarnesjo.org/" target="_blank">http://jesper.sarnesjo.org/</a><br>
&gt;&gt;<br>
&gt;&gt; [1] <a href="https://gist.github.com/sarnesjo/5116084#file-test2-hs" target="_blank">https://gist.github.com/sarnesjo/5116084#file-test2-hs</a><br>
&gt;&gt; [2] <a href="https://gist.github.com/sarnesjo/5116084#file-test2-c" target="_blank">https://gist.github.com/sarnesjo/5116084#file-test2-c</a><br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Beginners mailing list<br>
&gt;&gt; <a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
&gt;&gt; <a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Beginners mailing list<br>
&gt; <a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
<br>
<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
</div></div></blockquote></div><br></div>
_______________________________________________<br>Beginners mailing list<br><a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>http://www.haskell.org/mailman/listinfo/beginners<br></blockquote></div><br></body></html>