Thursday, June 17, 2004

Compiling Perl

I've been programming in perl for almost 10 years now, on most every platform imaginable. Amazingly I've never once compiled it from source. I'm sure that hurts my 'Perl Hacker' status, but I've never been enthused about compiling from source when there is a pre-compiled package available. ActiveState has distributions for Windows, various UNIX systems come with it pre-installed, or in their flavor of packages/rpms/whatever.

But now I need 64-bit perl for our Windows 64-bit servers that have been oh-so-fun to work with. And ActiveState doesn't provide 64-bit binaries. According to their documentation, perl 5.8 should be compile-able for IA64 chips. So guess who got tasked to see how true that claim is.

After procuring a shiny-new copy of Visual Studio .Net 2003, and the latest MS platform kit (for the 64-bit compiler). Off I was, deep into Makefiles, win32-specific readmes, linker command line options, target machine types and everything else I've always loved about C programming.

Now keep in mind, I have a normal everyday Pentium III laptop that I was using to compiling for a IA64 target architecture.

After a few false starts trying to convince it to generate IA64 code, I poked around the makefile enough to determine I needed to be setting PROCESSOR_ARCHITECTURE=IA64. OK, we were off and running. Warnings are flying by, files being created and deleted, Process was being made. Then, disaster.

See, those perl guys are so clever. They build something called miniperl first, and then use that all over the place to get the rest of the source compiled. That would be fantastic. Except that of course, IA64 binaries don't run on my x86 laptop. And there doesn't appear to be a way to say 'I'm not compiling this on the target platform, so anything you need to run during the compile needs to be for Processor X, the rest is for Processor Y'.

Lord knows what will happen when I manually compile miniperl for x86 and build everything else for IA64. The first battle was lost when 32-bit miniperl crashed trying to write to a NULL pointer during 64-bit extension building, but the war rages on....

No comments: