<?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"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: Link mach-o library into jitter external</title>
		<atom:link href="http://cycling74.com/forums/topic/link-mach-o-library-into-jitter-external/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/link-mach-o-library-into-jitter-external/feed</link>
		<description></description>
		<pubDate>Wed, 19 Jun 2013 03:54:13 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/link-mach-o-library-into-jitter-external/#post-25135</guid>
					<title><![CDATA[Link mach-o library into jitter external]]></title>
					<link>http://cycling74.com/forums/topic/link-mach-o-library-into-jitter-external/#post-25135</link>
					<pubDate>Wed, 29 Mar 2006 21:53:52 +0000</pubDate>
					<dc:creator>Michael</dc:creator>

					<description>
						<![CDATA[
						<p>While trying to create a Jitter< -->ODE (Open dynamics engine) bridge;<br />
I&#8217;ve run into several problems:</p>
<p>1st: Code-warrior (IDE v4.5) can compile externals, but it won&#8217;t let<br />
me link in the mach-o library unless if the external is compiled as<br />
mach-o; which yields a frenzy of compiler errors.  Specifically, it<br />
ends asking for &#8220;/usr/include&#8221; to go into the path, then pointing to a<br />
file that only exists in the newer version of code-warrior (only<br />
installed from curiosity, and it&#8217;s the free student version &#8212; so it<br />
can&#8217;t produce libraries).</p>
<p>2nd: Many failed attempts at linking the jitter libraries into XCode<br />
(it just can&#8217;t seem to understand the file format the library is in).</p>
<p>How can I convert the library (either ODE or Jitter) into a version<br />
where each would be able to link into the same project?</p>
<p>Thanks,<br />
&#8211;<br />
~Michael();</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/link-mach-o-library-into-jitter-external/#post-73664</guid>
					<title><![CDATA[Re: Link mach-o library into jitter external]]></title>
					<link>http://cycling74.com/forums/topic/link-mach-o-library-into-jitter-external/#post-73664</link>
					<pubDate>Wed, 29 Mar 2006 22:12:45 +0000</pubDate>
					<dc:creator>Joshua Kit Clayton</dc:creator>

					<description>
						<![CDATA[
						<p>You need to follow the strategy as demonstrated by the Apple Example  <br />
project: CFM_MachO_CFM. It might seem cumbersome at first, but it&#8217;s  <br />
actually not that tough. A good deal of this can be marshaled by only  <br />
having a few entry points into your Mach-O bundle.</p>
<p>  <a href="http://developer.apple.com/samplecode/CFM_MachO_CFM/CFM_Mach" rel="nofollow">http://developer.apple.com/samplecode/CFM_MachO_CFM/CFM_Mach</a> O_CFM.html</p>
<p>My simplethread extern also demonstrate one way to accomplish it from  <br />
a Max CFM extern. Keep in mind, you may need to do some header  <br />
munging or synthesis (as is the case for the necessary Mach-O pthread  <br />
calls in this example) to get this working.</p>
<p>  <a href="http://www.cycling74.com/twiki/bin/view/Share/JoshuaKitClayt" rel="nofollow">http://www.cycling74.com/twiki/bin/view/Share/JoshuaKitClayt</a> on</p>
<p>Note that a Mach-O Universal Binary version of Jitter along with Mach- <br />
O Jitter SDK is coming in the not too distant future (though I might  <br />
add, gcc produces markedly slower code than MWCC CFM in our tests so  <br />
far&#8230;sigh, I suppose this is the price of &#8220;progress&#8221;. Hopefully we  <br />
can figure out some tricks to get near MWCC CFM performance on PPC).</p>
<p>Great project, btw. We&#8217;ve for a long time been talking about  <br />
investigating ODE for use within Jitter. I&#8217;m looking forward to  <br />
seeing your results.</p>
<p>-Joshua</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/link-mach-o-library-into-jitter-external/#post-73665</guid>
					<title><![CDATA[Re: Link mach-o library into jitter external]]></title>
					<link>http://cycling74.com/forums/topic/link-mach-o-library-into-jitter-external/#post-73665</link>
					<pubDate>Wed, 29 Mar 2006 22:25:14 +0000</pubDate>
					<dc:creator>Joshua Kit Clayton</dc:creator>

					<description>
						<![CDATA[
						<p>
Another thing which might help you out is an example of how we find  <br />
and dynamically load from an auxiliary bundle in the Max search path  <br />
(rather than the already loaded system frameworks shown in my  <br />
simplethread example). I&#8217;ve included the following from our loading  <br />
of the Mach-O Cg.framework from within CFM Jitlib.</p>
<p>void jit_gl_shader_framework_init_cg(void)<br />
{</p>
<p>	OSStatus err;<br />
	short path;<br />
	char name[256];</p>
<p>	g_jit_gl_shader_cg_framework_ok = FALSE;<br />
	if (!nameinpath(&#8220;Cg.framework&#8221;, &#038;path))<br />
	{<br />
		char outname[1024];<br />
		char natname[1024];</p>
<p>		if (!path_topathname(path, &#8220;&#8221;, outname))<br />
		{<br />
			FSSpec fs;<br />
			CFStringRef str;<br />
			CFURLRef url;</p>
<p>			path_nameconform(outname, natname, PATH_STYLE_NATIVE,  <br />
PATH_TYPE_ABSOLUTE);<br />
			path_tospec(0, natname, &#038;fs);<br />
			str = CFStringCreateWithCString(kCFAllocatorDefault, natname,  <br />
kCFStringEncodingASCII);<br />
			if (url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, str,  <br />
kCFURLHFSPathStyle, true))<br />
			{<br />
				if (g_cg_bundle_ref = CFBundleCreate(kCFAllocatorDefault, url))<br />
				{<br />
					// post(&#8220;jit.gl.shader: loaded CG framework.&#8221;);				</p>
<p>					// include the bundle to cfm binding operations<br />
					#include &#8220;jit.gl.shader.cg.cfm.c&#8221;</p>
<p>					// toggle global flag<br />
					g_jit_gl_shader_cg_framework_ok = TRUE;<br />
				}<br />
broken:<br />
				CFRelease(url);<br />
			}<br />
			else<br />
			{<br />
				error(&#8220;jit.gl.shader: error loading CG framework : no URL from  <br />
FSRef.&#8221;);<br />
			}<br />
			CFRelease(str);<br />
		}<br />
	}<br />
	else<br />
	{<br />
		error(&#8220;jit.gl.shader: unable to find CG framework.&#8221;);<br />
	}<br />
}</p>
<p>// jit.gl.shader.cg.cfm.h is of the following form for each function  <br />
pointer</p>
<p>// cgCreateProgram<br />
typedef CGprogram (*tf_cgCreateProgram)(CGcontext ctx, CGenum  <br />
program_type, const char* program, CGprofile profile, const char*  <br />
entry, const char* *args);<br />
tf_cgCreateProgram pf_cgCreateProgram=NULL;</p>
<p>// jit.gl.shader.cg.cfm.c is of the following form for each function  <br />
pointer</p>
<p>pf_cgCreateProgram = CFBundleGetFunctionPointerForName <br />
(g_cg_bundle_ref, CFSTR(&#8220;cgCreateProgram&#8221;));<br />
if(!pf_cgCreateProgram) {<br />
	error(&#8220;jit.gl.shader: unable to load CG framework function  <br />
&#8216;cgCreateProgram&#8217;&#8221;);<br />
}</p>
<p>
This sort of thing can often be handled by some creative perl  <br />
scripting to make the appropriate files. I have a crummy one I hacked  <br />
together for some munging of the Max header files for other purposes.  <br />
If you want this as an example, let me know and I can send you that  <br />
monster off list.</p>
<p>
Hope this helps.</p>
<p>-Joshua</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/link-mach-o-library-into-jitter-external/#post-73666</guid>
					<title><![CDATA[Re: Link mach-o library into jitter external]]></title>
					<link>http://cycling74.com/forums/topic/link-mach-o-library-into-jitter-external/#post-73666</link>
					<pubDate>Wed, 29 Mar 2006 23:03:59 +0000</pubDate>
					<dc:creator>Mark Pauley</dc:creator>

					<description>
						<![CDATA[
						<p>Hi Joshua,</p>
<p>Do you have any information on these codegen regressions vs MWCC on  <br />
power pc?  Is there increased function call overhead?  Poor register  <br />
usage?</p>
<p>If you do find any glaring issues with gcc codegen vs MWCC please send  <br />
them my way in addition to whatever you would have normally done with  <br />
them.  I would be happy to file copious bugs against the dev tools  <br />
team over here.</p>
<p>Obviously most helpful would be minimal snipets of code along with the  <br />
compiler options you&#8217;re using and generated assembly from MWCC and gcc  <br />
and timing info.  I am guessing you guys are doing this sort of  <br />
analysis anyhow, pushing it upstream to Apple might allow you to not  <br />
kludge quite so much.</p>
<p>
_Mark</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/link-mach-o-library-into-jitter-external/#post-73667</guid>
					<title><![CDATA[Re: Link mach-o library into jitter external]]></title>
					<link>http://cycling74.com/forums/topic/link-mach-o-library-into-jitter-external/#post-73667</link>
					<pubDate>Thu, 30 Mar 2006 00:08:18 +0000</pubDate>
					<dc:creator>Wesley Smith</dc:creator>

					<description>
						<![CDATA[
						<p>Hi there,<br />
Check out PMDP by Cyrille Henry.  Ali Momeni did a max port of the<br />
objects.  They use ODE to do physical modelling.  There are<br />
codewarrior projects that you can download.</p>
<p><a href="http://drpichon.free.fr/pmpd/" rel="nofollow">http://drpichon.free.fr/pmpd/</a><br />
 <a href="http://www.cnmat.berkeley.edu/%7Eali/share/max/pmpd/pmpd-for" rel="nofollow">http://www.cnmat.berkeley.edu/%7Eali/share/max/pmpd/pmpd-for</a> -max.sit</p>
<p>best,<br />
wes</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

