<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Compiling MySQL UDFs on Mac OS X</title>
	<atom:link href="http://www.bytebot.net/blog/archives/2008/04/14/compiling-mysql-udfs-on-mac-os-x/feed" rel="self" type="application/rss+xml" />
	<link>http://www.bytebot.net/blog/archives/2008/04/14/compiling-mysql-udfs-on-mac-os-x</link>
	<description>A permanent record for what's interesting today - this is my live journal</description>
	<lastBuildDate>Wed, 10 Mar 2010 10:35:48 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: byte</title>
		<link>http://www.bytebot.net/blog/archives/2008/04/14/compiling-mysql-udfs-on-mac-os-x/comment-page-1#comment-138925</link>
		<dc:creator>byte</dc:creator>
		<pubDate>Tue, 06 Oct 2009 05:19:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.bytebot.net/blog/archives/2008/04/14/compiling-mysql-udfs-on-mac-os-x#comment-138925</guid>
		<description>Hi Bejamin!&lt;br&gt;&lt;br&gt;Thanks. It looks like bundle_loader makes things much better :)&lt;br&gt;&lt;br&gt;Quick testing on a few UDFs I had handy:&lt;br&gt;g++ -Wall -bundle -bundle_loader /usr/local/mysql/bin/mysqld -o udf_return_values.so `/usr/local/mysql/bin/mysql_config --cflags` udf_return_values.c</description>
		<content:encoded><![CDATA[<p>Hi Bejamin!</p>
<p>Thanks. It looks like bundle_loader makes things much better :)</p>
<p>Quick testing on a few UDFs I had handy:<br />g++ -Wall -bundle -bundle_loader /usr/local/mysql/bin/mysqld -o udf_return_values.so `/usr/local/mysql/bin/mysql_config &#8211;cflags` udf_return_values.c</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.bytebot.net/blog/archives/2008/04/14/compiling-mysql-udfs-on-mac-os-x/comment-page-1#comment-138410</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Sat, 16 May 2009 16:03:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.bytebot.net/blog/archives/2008/04/14/compiling-mysql-udfs-on-mac-os-x#comment-138410</guid>
		<description>I realize this is year old, but wanted to express my gratitude for the helpful article; I was wondering what the hell I was doing wrong on my Mac OS X where documentation isn&#039;t as plentiful as it is on *nix.

Just one minor correction- your instruction had one dash for cflags; in my case, it doesn&#039;t work; I had to use two dashes. 

echo `/usr/local/mysql/bin/mysql_config -cflags` 
returns the sample usage page for this script while this
echo `/usr/local/mysql/bin/mysql_config --cflags`
will return the correct include directory path and flags needed to compile

I&#039;d also encourage you to post something over at MySQL&#039;s documentation, even just a link back to this page for the UDF installation on Mac OS X.


Again, thanks!</description>
		<content:encoded><![CDATA[<p>I realize this is year old, but wanted to express my gratitude for the helpful article; I was wondering what the hell I was doing wrong on my Mac OS X where documentation isn&#8217;t as plentiful as it is on *nix.</p>
<p>Just one minor correction- your instruction had one dash for cflags; in my case, it doesn&#8217;t work; I had to use two dashes. </p>
<p>echo `/usr/local/mysql/bin/mysql_config -cflags`<br />
returns the sample usage page for this script while this<br />
echo `/usr/local/mysql/bin/mysql_config &#8211;cflags`<br />
will return the correct include directory path and flags needed to compile</p>
<p>I&#8217;d also encourage you to post something over at MySQL&#8217;s documentation, even just a link back to this page for the UDF installation on Mac OS X.</p>
<p>Again, thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: byte</title>
		<link>http://www.bytebot.net/blog/archives/2008/04/14/compiling-mysql-udfs-on-mac-os-x/comment-page-1#comment-132710</link>
		<dc:creator>byte</dc:creator>
		<pubDate>Mon, 14 Apr 2008 16:30:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.bytebot.net/blog/archives/2008/04/14/compiling-mysql-udfs-on-mac-os-x#comment-132710</guid>
		<description>When time permits, must figure out why using g++ generates a &quot;bigger&quot; .so over using gcc (it really shouldn&#039;t make a difference)

-rwxr-xr-x  1 root      wheel  8616 Apr 14 09:16 /usr/local/mysql/lib/udf_return_values.so*
-rwxr-xr-x  1 ccharles  staff  8568 Apr 14 09:25 udf_return_values.so*

8616 (g++) vs 8568 (gcc)</description>
		<content:encoded><![CDATA[<p>When time permits, must figure out why using g++ generates a &#8220;bigger&#8221; .so over using gcc (it really shouldn&#8217;t make a difference)</p>
<p>-rwxr-xr-x  1 root      wheel  8616 Apr 14 09:16 /usr/local/mysql/lib/udf_return_values.so*<br />
-rwxr-xr-x  1 ccharles  staff  8568 Apr 14 09:25 udf_return_values.so*</p>
<p>8616 (g++) vs 8568 (gcc)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: byte</title>
		<link>http://www.bytebot.net/blog/archives/2008/04/14/compiling-mysql-udfs-on-mac-os-x/comment-page-1#comment-132709</link>
		<dc:creator>byte</dc:creator>
		<pubDate>Mon, 14 Apr 2008 16:19:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.bytebot.net/blog/archives/2008/04/14/compiling-mysql-udfs-on-mac-os-x#comment-132709</guid>
		<description>Hi Bejamin!

Thanks. It looks like bundle_loader makes things much better :)

Quick testing on a few UDFs I had handy:
g++ -Wall -bundle -bundle_loader /usr/local/mysql/bin/mysqld -o udf_return_values.so `/usr/local/mysql/bin/mysql_config --cflags` udf_return_values.c</description>
		<content:encoded><![CDATA[<p>Hi Bejamin!</p>
<p>Thanks. It looks like bundle_loader makes things much better :)</p>
<p>Quick testing on a few UDFs I had handy:<br />
g++ -Wall -bundle -bundle_loader /usr/local/mysql/bin/mysqld -o udf_return_values.so `/usr/local/mysql/bin/mysql_config &#8211;cflags` udf_return_values.c</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Benjamin Reed</title>
		<link>http://www.bytebot.net/blog/archives/2008/04/14/compiling-mysql-udfs-on-mac-os-x/comment-page-1#comment-132704</link>
		<dc:creator>Benjamin Reed</dc:creator>
		<pubDate>Mon, 14 Apr 2008 15:31:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.bytebot.net/blog/archives/2008/04/14/compiling-mysql-udfs-on-mac-os-x#comment-132704</guid>
		<description>If you get linker errors, it might be that it expects certain runtime symbols to exist which come from the mysql binary itself.  If you want it to properly resolve all symbols at link-time, you should be able to use the -bundle_loader flag.  Also, if it&#039;s a loadable module that&#039;s going to be dlopened by MySQL, it&#039;s technically more &quot;correct&quot; to make it a -bundle, not a -dynamiclib.

Try something like this (I can&#039;t test it since I don&#039;t have any udf sources handy):

g++ -Wall -bundle -bundle_loader /usr/local/mysql/bin/mysqld -o udf_lightspeed.so `/usr/local/mysql/bin/mysql_config --cflags` udf_lightspeed.c

You might need to add `/usr/local/mysql/bin/mysql_config --libmysqld-libs` to that as well to resolve libmysqld symbols.</description>
		<content:encoded><![CDATA[<p>If you get linker errors, it might be that it expects certain runtime symbols to exist which come from the mysql binary itself.  If you want it to properly resolve all symbols at link-time, you should be able to use the -bundle_loader flag.  Also, if it&#8217;s a loadable module that&#8217;s going to be dlopened by MySQL, it&#8217;s technically more &#8220;correct&#8221; to make it a -bundle, not a -dynamiclib.</p>
<p>Try something like this (I can&#8217;t test it since I don&#8217;t have any udf sources handy):</p>
<p>g++ -Wall -bundle -bundle_loader /usr/local/mysql/bin/mysqld -o udf_lightspeed.so `/usr/local/mysql/bin/mysql_config &#8211;cflags` udf_lightspeed.c</p>
<p>You might need to add `/usr/local/mysql/bin/mysql_config &#8211;libmysqld-libs` to that as well to resolve libmysqld symbols.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
