<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/12705" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2019-06-17T12:36:00+00:00</updated>

	<author><name><![CDATA[Real-Time Physics Simulation Forum]]></name></author>
	<id>https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/12705</id>

		<entry>
		<author><name><![CDATA[przecze]]></name></author>
		<updated>2019-06-17T12:36:00+00:00</updated>

		<published>2019-06-17T12:36:00+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42208#p42208</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42208#p42208"/>
		<title type="html"><![CDATA[How to build OpenCL examples? (no CMakeLists.txt)]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42208#p42208"><![CDATA[
Hi,<br>so, according to README and docs you just need to pass `--enable_experimental_opencl` to `App_ExampleBrowser` to see the examples. But I tried that, and examples were still missing from the browser. I checked the source code and found this:<br><div class="codebox"><p>Code: </p><pre><code>void ExampleEntriesAll::initOpenCLExampleEntries(){#ifdef B3_USE_CLEW#ifndef NO_OPENGL3int numDefaultEntries = sizeof(gOpenCLExamples) / sizeof(ExampleEntry);for (int i = 0; i &lt; numDefaultEntries; i++){m_data-&gt;m_allExamples.push_back(gOpenCLExamples[i]);}#endif#endif  //B3_USE_CLEW}</code></pre></div>And I discovered taht `B3_USE_CLEW` was not defined in my case. I tried to check when CMake adds this definition, and there's a `ADD_DEFINITIONS(-DB3_USE_CLEW)` in <em class="text-italics">src/Bullet3OpenCL/CMakeLists.txt</em>. But according to CMake docs, this cannot affect the <strong class="text-strong">examples</strong> directory. <br>So I tried adding `ADD_DEFINITIONS(-DB3_USE_CLEW)` to <em class="text-italics">examples/CMakeLists.txt</em> but this results in undefined references, because the code in <em class="text-italics">examples/OpenCL</em> directory is not being build at all. I tried adding `OpenCL/broadphase` etc. to `SUBDIRS` in <em class="text-italics">examples/CMakeLists.txt</em> but this didn't change anything because, as I realized, there's no CMakeLists.txt in <em class="text-italics">examples/OpenCL</em><br><br>So my question is: documentation gives the impression that all OpenCL examples are build by default, you just need to enable them in the Browser by passing a flag. Yet from what I see, building them requires messing with CMake files and even writing some of them single-handedly. Am I missing something?<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13325">przecze</a> — Mon Jun 17, 2019 12:36 pm</p><hr />
]]></content>
	</entry>
	</feed>
