<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Programmers Blog</title>
	<atom:link href="http://www.jazzbee.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.jazzbee.com/blog</link>
	<description>A byte in a tcp stream, is better than a...</description>
	<lastBuildDate>Mon, 12 Mar 2012 20:48:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Building Android 4.0.3 (ICS) on OSX Lion</title>
		<link>http://www.jazzbee.com/blog/?p=86</link>
		<comments>http://www.jazzbee.com/blog/?p=86#comments</comments>
		<pubDate>Mon, 12 Mar 2012 20:46:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.jazzbee.com/blog/?p=86</guid>
		<description><![CDATA[Will post my findings shortly&#8230;]]></description>
			<content:encoded><![CDATA[<p>Will post my findings shortly&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jazzbee.com/blog/?feed=rss2&#038;p=86</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenCL development on OSX with Eclipse, part II</title>
		<link>http://www.jazzbee.com/blog/?p=76</link>
		<comments>http://www.jazzbee.com/blog/?p=76#comments</comments>
		<pubDate>Sun, 25 Sep 2011 22:14:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.jazzbee.com/blog/?p=76</guid>
		<description><![CDATA[I have now spent about 3-4 months developing OpenCL kernels on my Macbook Pro 2011. During this time I have stumbled upon several pro&#8217;s and con&#8217;s compared to developing on a Windows PC with Visual Studio. I will not go into detail about the differences between the 2 development setups, but instead concentrate on presenting [...]]]></description>
			<content:encoded><![CDATA[<p>I have now spent about 3-4 months developing OpenCL kernels on my Macbook Pro 2011. During this time I have stumbled upon several pro&#8217;s and con&#8217;s compared to developing on a Windows PC with Visual Studio. I will not go into detail about the differences between the 2 development setups, but instead concentrate on presenting my findings regarding the use of the Eclipse CDT IDE for c++ and OpenCL development on the OSX platform.</p>
<p>I decided to go with the Eclipse editor since I already knew it from Java, and since it is cross platform. As build environment i chose CMake since I already knew that from previous projects, and I knew it would be able to generate Eclipse and Visual Studio project files for me. As my versioning control system I use Mercurial since the guys at<a href=" http://bitbucket.org"> http://bitbucket.org</a> delivers a brilliant free hosting service. To sum up, my development tool chain is the following:</p>
<p>* Macbook Pro, 2011, ATI Radeon 6750M 1GB VRAM<br />
* OSX Lion<br />
* OpenCL 1.1 (since Lion, with Leopard it is 1.0)<br />
* Mercurial version control, using MacHg<br />
* Eclipse CDT, version 3.6.2, 32 bit version<br />
* GDB debugger 6.3.5  (Apple Version)<br />
* llvm-gcc compiler<br />
* CMake 2.8.4 (<a href="http://www.cmake.org/">http://www.cmake.org/</a>)<br />
* CLBuilder for testing kernels</p>
<p>Eclipse CDT has gotten far during the last previous years, and I have been using this editor a lot on the Windows platform. However, on OSX I fairly quickly ran into trouble. Mainly due to crashes, and Eclipse suddenly hanging. After searching the web for a solution I finally managed to find a solution. Disabling the JIT compiler when launching Eclipse. This slows down Eclipse considerable during compilation, but is a necessary evil unless you want to restart eclipse every 1 hour or so!</p>
<p><strong>Disabling JIT<br />
</strong>* Go to where you installed your Eclipse.app<br />
* Context click it, and click on &#8220;Show Package Contents&#8221;<br />
* Find the eclipse.ini<br />
* Edit it, and insert the line &#8220;-Xint&#8221;<br />
* Save and restart Eclipse.</p>
<p>Also look here: <a href="http://publib.boulder.ibm.com/infocenter/javasdk/v5r0/index.jsp?topic=%2Fcom.ibm.java.doc.diagnostics.50%2Fdiag%2Ftools%2Fjitpd_disable.html">http://publib.boulder.ibm.com/infocenter/javasdk/v5r0/index.jsp?topic=%2Fcom.ibm.java.doc.diagnostics.50%2Fdiag%2Ftools%2Fjitpd_disable.html</a> for more info on disabling the JIT compiler.</p>
<p>For now my setup was working fine. CMake was able to generate my eclipse project files by using the -G command when generating my build tree. Now to setup a debugging environment inside Eclipse I had to add a few changes to the CMake Eclipse generator, for choosing the correct binary parser, and error parser for your eclipse project.<br />
By default CMake 2.8.4 generates Eclipse project using wrong the old GNU Make Error Parser 6.0 (deprecated), and the binary parser Mach-O Parser (deprecated) for the eclipse project settings. This will not work when starting the GDB debugging session in eclipse. Changing the error parser to GNU Make Error Parser 7.0 and the binary parser to Mach-O 64 Parser in the project settings manually fixes the problem. However, every time you edit your CMakeLists.txt files, the project settings are reverted!<br />
To avoid this, I patched the CMake Eclipse generator.</p>
<p><strong>Patching CMake 2.8.5<br />
</strong>* Open cmExtraEclipseCDT4Generator.cxx<br />
* find &#8220;org.eclipse.cdt.core.MachO&#8221; and change it to &#8220;org.eclipse.cdt.core.MachO64&#8243;<br />
* find &#8220;org.eclipse.cdt.core.MakeErrorParser&#8221; and change it to &#8220;org.eclipse.cdt.core.GmakeErrorParser&#8221;</p>
<p>Compile and install the patched CMake.</p>
<p>Now you will be able to compile 64bit binaries, and debug them using the GDB build by Apple on the system.</p>
<p>I was and I still is, facing some issues. Such as:</p>
<ul>
<li>Unable to set breakpoints in constructors. Probably due to multiple breakpoints set by GDB which cannot be handled by the Eclipse fronted.</li>
<li>Problems debugging OpenCL kernels properly. You need to use the CLI of GDB to get this working properly.</li>
<li>Using OSX frameworks and their header files seems to break code completion from these frameworks. Seems to be due to the include path of &lt;OpenGL/gl.h&gt; which the indexer in Eclipse does not seem to understand.</li>
</ul>
<div>Even with the above flaws I still believe Eclipse is a pretty good alternative to Xcode on the OSX platform. It has a very nice Mercurial plugin available, which Xcode lacks. It is cross platform. A CMake editor plugin exists for Eclipse as well, which makes it easier to edit CMakeLists.txt files in the same editor as your source files. The biggest downside, is the above problem of not being able to properly set breakpoints in constructors. It becomes a pain in the long run, and I am seriously thinking of giving in and change my IDE to Xcode, or perhaps even Emacs.</div>
<p>That&#8217;s it for now. Next update will probably be some screenshots or videos from the fluid simulator I am developing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jazzbee.com/blog/?feed=rss2&#038;p=76</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updated my CV</title>
		<link>http://www.jazzbee.com/blog/?p=69</link>
		<comments>http://www.jazzbee.com/blog/?p=69#comments</comments>
		<pubDate>Thu, 22 Sep 2011 18:52:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.jazzbee.com/blog/?p=69</guid>
		<description><![CDATA[My new CV can be downloaded here cv.]]></description>
			<content:encoded><![CDATA[<p>My new CV can be downloaded here <a href="http://www.jazzbee.com/blog/wp-content/uploads/2011/09/cv.pdf">cv</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jazzbee.com/blog/?feed=rss2&#038;p=69</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenCL development on OSX with Eclipse, part I</title>
		<link>http://www.jazzbee.com/blog/?p=64</link>
		<comments>http://www.jazzbee.com/blog/?p=64#comments</comments>
		<pubDate>Fri, 10 Jun 2011 18:40:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.jazzbee.com/blog/?p=64</guid>
		<description><![CDATA[Recently I started on developing OpenCL kernels on my Macbook Pro, meaning Leopard OSX 1.6. Coming from a Windows platform, there was a few changes I needed to get used too. First of all, no need to install special graphic card drivers, or SDK runtimes to get the OpenCL libraries and includes. On OSX they [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I started on developing OpenCL kernels on my Macbook Pro, meaning Leopard OSX 1.6.</p>
<p>Coming from a Windows platform, there was a few changes I needed to get used too. First of all, no need to install special graphic card drivers, or SDK runtimes to get the OpenCL libraries and includes. On OSX they are all included directly on the platform.</p>
<p>On my machine, running Mac OS X 10.6.7, the OpenCL include files and libraries are located in: /System/Library/Frameworks/OpenCL.framework</p>
<p>To include OpenCL headers in your source code, you need some different includes than that on a Windows system. To be honest I never really understood how the includes on OS X are resolved, but anyway, they need to take the following form:</p>
<pre class="qoate-code">#if defined(__APPLE__) || defined(MACOSX)

#define __NO_STD_VECTOR

#include &lt;OpenCL/cl.h&gt;

#else

#include &lt;Windows.h&gt;

#define __NO_STD_VECTOR

#include &lt;CL/cl.h&gt;

#endif</pre>
<p>The Windows version is included in the above code snippet for completion purposes and ensure cross platform code.</p>
<p>Using GCC on OS X you specify which framework to link too by adding the gcc linker option &#8220;-framework&#8221;. So to use the OpenCL framework, you need to add the option &#8220;-framework OpenCL&#8221; when compiling with GCC. This will automatically link the OpenCL libraries, and add the include libraries to the search path when compiling and linking. On OS X other c++ compilers exists, such as llvm-gcc and clang. I will write about my experiences with these compilers in later posts, however the I believe the options for these compilers are the same as when using GCC.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jazzbee.com/blog/?feed=rss2&#038;p=64</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse on OSX 10.6</title>
		<link>http://www.jazzbee.com/blog/?p=62</link>
		<comments>http://www.jazzbee.com/blog/?p=62#comments</comments>
		<pubDate>Wed, 08 Jun 2011 19:05:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.jazzbee.com/blog/?p=62</guid>
		<description><![CDATA[I recently myself a Mac Book Pro, using Windows as my preferred OS in the last 10-15 years, I thought it was time for a change. So far my prefered IDE for programming on OSX have been Eclipse. With that I can target both Android application, and native c++ and opencl development projects. Allthought it [...]]]></description>
			<content:encoded><![CDATA[<p>I recently myself a Mac Book Pro, using Windows as my preferred OS in the last 10-15 years, I thought it was time for a change.</p>
<p>So far my prefered IDE for programming on OSX have been Eclipse. With that I can target both Android application, and native c++ and opencl development projects. Allthought it seems Xcode is a close contender with regard to c++, I prefer to stick with one IDE.</p>
<p>Using Eclipse on OSX proved to be a bit of a hazzle. It kept crashing. After hours of searching forums, I finally figured out that it was due to a reported bug in Eclipse. Disabling the JIT compiler will help, or installing the 32 bit version of Eclipse.</p>
<p>Here is how to disable JIT compiler in Eclipse:</p>
<ul>
<li>Open Finder, and go to your eclipse installation folder</li>
<li>Find Eclipse.app and context click it, and choose &#8220;Show Package Contents&#8221;</li>
<li>Go to Contents-&gt;MacOS and open eclipse.ini</li>
<li>Add the following line &#8220;-Xint&#8221;</li>
<li>Volia! no more crashes or deadlock of Eclipse.</li>
</ul>
<p>Using this fix however seems to degrade performance of Eclipse, but for me it is better than a crash.</p>
<p>Downgrading to the 32 bit version is a better choice if you want the performance.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jazzbee.com/blog/?feed=rss2&#038;p=62</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

