Archive for April 2008

Compiling MySQL UDFs on Mac OS X

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 does. MySQL loads the UDF just fine. But sometimes, you get linker errors, which can be annoying.

So, the full-proof solution to compiling UDFs on OS X, Leopard 10.5? A two-step process:
gcc -c `/usr/local/mysql/bin/mysql_config --cflags` udf_lightspeed.c
libtool -dynamic -o udf_lightspeed.so udf_lightspeed.o -lc

Feel free to add -O2 as an option to GCC. One day I might talk about the amazing mysql_config (use it! Read the documentation, in the meantime.)

Remember, once you’ve your your .dylib, to move it to your plugin_dir (find it by doing SHOW VARIABLES LIKE 'plugin_dir';). Also note that on OS X, it doesn’t matter if the extension is .dylib or .so – either one will do.

Happy UDF usage!

Update: As a reader points out in the comments, probably the easiest way, in a one-step process, is to use the bundle_loader. gcc -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 works a charm.

Technorati Tags: , , , , , ,

MySQL Community Dinner a great success

The Sunday before the MySQL Conference and Expo usually means the party at Marten’s house. This year, some of us arrived there rather early, and also made a beeline for the exit, rather quickly. This despite all the good alcohol, amazing food being served, and the great company of colleagues we hardly ever see. Why?

Some of us wanted to crashattend the MySQL Conf 2008 Community Dinner. And we did! The entire MySQL Community Team was there, as was Brian Aker, Mark Atwood, Monty Widenius, Timour Katchaounov, Eric Herman. We also naturally brought Barton George along (he gave us a ride! Thanks Barton). Oh, and did I mention, Rich Green and Jonathan Schwartz were there too? Jonathan picked up the tab, naturally :)

MySQL Community Dinner
Monty and Brian chat, while Jonathan is in the background

A big thank you to Jonathan and Rich. All the conversation, all the people I met (old and new), it was just simply fabulous. Now of course, comes the great fun of following up, and getting things done!

MySQL Community Dinner
Jonathan Schwartz with the MySQL/Sun plush dolphins

Did I mention that Santa Giuseppe also brought along little plush dolphins? Great party favours!

MySQL Community Dinner
Giuseppe with some Sun/MySQL dolphins… Monty egging him on

All in all, a great start to the conference. Pictures (that I took anyway – all Creative Commons licensed by Attribution, non-commercial, share-alike) are at my MySQL Conference and Expo 2008 set. They’ve all been added to the 2008 MySQL Users Conference and Expo group on Flickr as well. I know Ronald Bradford was running around with a camera (a 40D, like I have at home :P), and Barton George took some snapshots, as did Lenz Grimmer. Watch their photo feeds soon…

Update: Giuseppe has blogged it too at Community dinner with Jonathan Schwartz and Rich Green as has Kaj, at Jonathan Schwartz and Rich Green at the MySQL Community Pre-Conference Dinner party.

Technorati Tags: , , , , , , , , ,

Aza Raskin on Mozilla and User Interfaces

Aza Raskin from Mozilla, spoke largely about usability and user interface design. Judging from his Wikipedia entry, he’s been doing this for a long time and is very passionate about interfaces. It was very hard to see his slides (noted problem, too much sunlight), so I just attempted to make random bits of notes from his talk. His slides, may or may not be available, but he did mention that searching for a talk titled “Don’t Make Me Click”, was the basis for his LugRadio Live USA talk. Turns out, it was a Google Tech Talk, available on Youtube – Don’t Make Me Click (~65 minutes). Now for the sparse notes…

You already use a command line interface. Typed pine before? Or slrn? Now you just type gmail.com or nytimes.com. This is an interesting analogy… the command line and the location bar.

Intuitiveness vs. ease of use? There’s a difference. The iPhone interface isn’t exactly intuitive, but with all the advertising available around, when you got one, you knew what to do, and you got ease of use.

“Don’t copy, do something else”

1. Interface design is about how your software is used.
2. Usability is architectural (pretty interfaces/devices, you will use better)
3. Well designed command lines are good for usability. “Your users don’t know what features they want” – architect well, for your user. Learn a lot from Microsoft Word print dialog (which allows you to choose which pages to print)
4. Don’t blindly copy, find another box to think in
5. Don’t design separately for users and experts. Make things intuitive for all

Technorati Tags: , , , , ,

Gong-A-Thong at LugRadio Live USA

The very brave soul, was Aaron Bockover, from the Banshee media player fame (via the LugRadio Live USA 2008 weblog). There were a few interesting highlights from these gong-a-thong sessions…

Zumastor
Dan Kegel spoke about the Zumastor Linux Storage Project. Want snapshots and remote replication in your Linux filesystem? This one does just that. From the contributor list, it looks like its all Google engineers hacking on this… Yes, this is better than LVM. No, I haven’t tried it yet.

mod_ndb
J.D. Duncan spoke about mod_ndb. Here are my transcribed notes of the talk.

MySQL Cluster is a database designed to be fault tolerant, on cheap commodity hardware. Write SQL queries, and they access the data from the NDB nodes. A few deficiencies in web applications – 2 tier architecture (from PHP to MySQL), now it becomes a 3-tier architecture (PHP->MySQL->NDB). MySQL 5.0 also limited – no true VARCHARs, and entirely in memory. There are variable linked rows, VARCHARs support, and on disk support in 5.1.

Apache web server, link in mod_ndb in httpd.conf file, write something that looks like a SQL query, then you send a GET/DELETE/POST request to Apache (its a REST API). If its a GET, the data can come out of the database as JSON, XML, etc. From a browser, its as simple as an XMLHTTP request call.

Solomon Chang’s Irish Ballad
Folk at the MySQL Conference 2007 would remember active community member Solomon Chang. In fact, if you’ve read The MySQL 5.1 Cluster DBA Certification Guide, you’d also recognise the name.

Solomon went up on stage to entertain us with an Irish ballad. He used to be involved with an Irish woman, and has got the skills to mimic the accent really well, and make funny tunes. Solomon won a Neuros OSD for his efforts.

Technorati Tags: , , , , , ,

Ian Murdock on OpenSolaris… And Beyond

I paid great attention to Ian Murdock’s talk at LugRadio Live USA 2008, as he’s an important person at Sun in terms of the open source community, and I’m community facing as well. It was also the first time I got to meet Ian (after his talk), and we hit off a conversation really quickly. I look forward to working alongside Ian more… Now to the talk notes.

A Bit About Ian
– Linux user, developer, and advocate since 1993
– Founder of Debian, co-founder of Progeny
– Joined Sun in March 2007, Chief OS strategist (launched Project Indiana), and now since February 2008 is VP Developer and Community Marketing

What’s a Linux guy doing at Sun?
– When people say they want Linux… they don’t actually mean that they want Linux. You don’t only want the kernel, but you want the userspace as well. You really want a distribution, not Linux itself. Ian is more of an open source guy. So create a business model behind OpenSolaris?
– Solaris ships all userland utilities you’d expect from Linux. GNU Utilities vs. UNIX Utilities. Where the real differentiation is, is Linux Kernel vs. Solaris Kernel.
– Its the kernel where you drive change for the OS. Look at ZFS, Dtrace, containers, etc.
– Linux has multiple configurable platforms with expanding ecosystems. OpenSolaris, is an integrated operating system, with binary compatibility.
– Where Sun wants to go with OpenSolaris? Have binary compatibility in the core platform, and have the expanding ecosystem in it.
– Project Indiana has Solaris innovation with the “distribution” model of the Linux world, i.e. have package repositories. Also, to close the “familiarity gap” so that there is a GNU userland, a package management system, etc. And of course, focus on the unique Solaris capabilities – upgrade rollback via ZFS snapshots, AMP stack with integrated DTrace probes (MySQL in OpenSolaris Developer Preview 2 already has this capability), binary compatibility, etc.
– Remember, people deploy what’s accessible to them. This is a whole new deployment model. This is how Linux got into the Enterprise. This is the reasoning behind OpenSolaris… Solaris itself is great in the Enterprise, but lacks a user community. Follow the Linux (and largely, Microsoft) model…
– One Solaris Platform, two delivery mechanisms – Solaris: enterprise class, support, long release cycle (3-5 years); OpenSolaris: latest Solaris innovations, short release cycle (6 months), much easier to use, network economy, support from Sun also
– Adoption-Led Market is what its at now. Users become customers. Give users something of value. That’s the basic business model at Sun, around open source.
– Volume drives value! New consumers/communities on the network will drive infrastructure demand. Reach the developer community through massive volume, get it in use as many places as possible, then sell software/storage/servers/services/etc.
– Just spent $1 billion on MySQL. Databases are often deployed on other middleware, say identity management. Sun sells identity management software.
– Developer platforms of choice are moving up the stack. Traditional Sun platforms are increasingly invisible infrastructure. New platforms remove barriers to entry and hide complexity so developers can focus on getting to market quickly.
– Remember, no one “owns” the web. The Web 2.0 world is like open source in the 90s.
– Hot new platforms are silos – you write your application to Google APIs or Amazon APIs and there’s only one place to deploy it. Sun is a leader in open standards for 25 years, how do you take this leadership into the new platform world? One needs the ability to deploy on a number of different platforms, and take your application from one to another. Sun strategy?
– Where do down the stack technologies, like operating systems, fit? Do they still matter? Yes.
– Solaris 10 is free today (you just have to register to get it)

On the packaging system
– OpenSolaris package system is new. Needed to build own for a few reasons, despite studying apt/yum/conary.
1) platform is very different from Linux; use ZFS and you get rollback, and this is Solaris specific
2) zones/containers, single shared kernel, multiple application environments, which is intelligent for resource sharing, and the package system is fundamentally aware of zones
3) an opportunity to innovate; Sun’s all about innovation. Package managers haven’t changed much in over 10 years (apt, yum)
4) the notion of customisation, i.e. have a version control like facility for patches, etc. so that changes can be reconciled when you rebase with upstream, is something the new package management system can use. This is kind of like Conary?
5) All customers tend to customise, even (especially) in Enterprises. IPS helps them (refer to 4)

Questions & Answers
– OpenSolaris and Solaris, how is it in sync? Codebase is in sync, generally. Solaris 10 is one codebase, and there’s a development version (i.e. the next release). There is a Solaris “train” and an OpenSolaris train now. How will these two trains come together? Solaris Next based on OpenSolaris? OpenSolaris with Enterprise support? Questions that are being asked now, and there’s no real decision yet. Wait till 2-3 OpenSolaris releases first, before finding out more.
– What is Sun doing to make OpenSolaris work better in a virtualized environment? I.e. working better in Xen, QEMU, VMWare, etc. Linux naturally has better device support than OpenSolaris, so virtualization is very important. Mentions the innoTek purchase, so that VirtualBox could be used for bundle delivery.
– Is Linux and OpenSolaris in par, security wise? Solaris has a slight edge at this point… They’re fairly comparable, but there’s more maturity in the Solaris product.
– OpenSolaris on PowerPC – unknown status, there’s been some work at Sun Labs to port it to PPC, you can boot it and do some basic things, but unsure if its ready for users or not.

Technorati Tags: , , , , , , , ,

Miguel de Icaza from Mono on Moonlight

Miguel de Icaza from the Mono project, tells us more about Moonlight, and where the Mono project is headed, at LugRadio Live USA 2008.

– shows us about Silverlight 1.1 (Moonlight is the Mono equivalent)
– works a charm in Firefox, but there’s issues with the implementation in IE (something JavaScript related)
– Demos the chess application
– Microsoft will provide a Media Pack (they will incur the licensing costs for the media codecs) for all Moonlight users on Linux. Microsoft will also provide regression test suites, and complete specifications for implementation. Novell will deliver a 100% compatible Moonlight and will support it on all major Linux distributions (contractually, only the top 3 Linux distributions – no mention of what the top 3 are). This is the Microsoft/Novell agreement, as of last September 2007.
– The codecs come with a restriction – you can’t use it outside Moonlight. Its only for the in-browser experience. If you use Totem, you’ll need to make use of gstreamer, etc…
– The MSPL is better than the X11 license. Miguel would like to change the Mono license to the MSPL, but everyone that hates him now, will hate him more because of the “Microsoft” substring! Why is the MSPL better? It has a patent clause, so that the code you use there, if covered by a patent, you will not be sued, ever. That in a way, is similar to the Apache license.
– Self-contained applications – traditional GNU software is spread out, quite unlike Mac OS X applications where you drag an application into the Applications folder, and everything is contained in one directory. Mono has an application guideline, where everything is also in one directory.
– Like all good demos, something broke. Miguel starts debugging on stage, and fixes the problem, and the demo works!
– “Programmers have no taste for design”
– “I have a roadmap, but I don’t think anyone gives a fuck, so lets just go to questions”
– How long will it take to get mixed-mode assembly working? If you are Chris Toshok, it will take 2 weeks. If you’re not, definitely longer. He spoke to Dan Kegel from the WINE project :) Patches are being accepted… The aim is to allow WINE to run Windows applications on a fully open source stack

Technorati Tags: , , , , , , , , , , ,


i