Compiling and installing a User Defined Function for MySQL on Mac OS X seems tricky. There are installation notes, but they seem to be sparse on OS X (the comments are clues, though).
I was looking through the tutorial materials for Roland’s talk, and came up with what I think is the most full-proof way to ensure your UDFs get compiled…
gcc -Wall -dynamiclib -o udf_lightspeed.dylib -lstdc++ udf_lightspeed.c
The above will compile just fine, but MySQL will give you an interesting error saying “no suitable image found”. Its the infamous Error 1126.
Upon further poking, it seemed like the following should
work:
gcc -Wall -dynamiclib -o udf_lightspeed.dylib -lstdc++ -lc
-I`/usr/local/mysql/bin/mysql_config –cflags` udf_lightspeed.c
And it …
[Read more]