Mac OS X

Installing BioPerl on Mac OS 10.6 Snow Leopard in 6 Easy Steps

The strategy I used to install BioPerl was as follows:

1. Use MacPorts to install Perl.
2. Use CPAN to install BioPerl.

Here are the nitty gritty details. You need a live internet connection, as both MacPorts and CPAN expect to be able to download packages.

Step One: XCode Tools

Before MacPorts can be installed, XCode Tools needs to be installed. This is free from Apple and can be installed from the original OS X 10.6 DVD or downloaded from Apple's developer site.

You can tell that XCode Tools is installed by looking for a Developer directory at the root of your hard drive.

Step Two: MacPorts

I simply downloaded the MacPorts Package Installer from the MacPorts site.

Step Three: Install Perl

sudo port install perl5.12

Step Four: Install GraphViz

This is a prerequisite of BioPerl and the BioPerl build will fail if it is not installed. It will download a ton of prequisites first. After typing the following, get a coffee and a sandwich.

sudo port install graphviz

Step Five: Configure CPAN

CPAN likes to have YAML installed. So:

sudo cpan YAML

At this point cpan will realize it's being run for the first time and ask you some questions like

Would you like me to configure as much as possible automatically? [yes]

Selecting the defaults worked fine.

It's nice to have LWP too.

To install LWP, first get to the cpan command prompt:

sudo cpan

Then install it:

install Bundle::LWP

Step Six: Build BioPerl

To install BioPerl, first get to the cpan command prompt:

sudo cpan

At the command prompt, tell CPAN that you want it to automatically get and install any prerequisites it comes across (this saves you hours of choosing "Yes"):

cpan[1]> o conf prerequisites_policy follow

And now, at the cpan prompt, install BioPerl:

install C/CJ/CJFIELDS/BioPerl-1.6.1.tar.gz

It will stop several times along the way. Except for the following question where my selection was to install all optional external modules, the defaults were fine.

Install [a]ll optional external modules, [n]one, or choose [i]nteractively? [n] a

During the tests that BioPerl runs, I saw the following:

Replacement list is longer than search list at Bio/Range.pm line 251.

According to this post, The above are warnings from perl 5.12 that can be ignored (they have been fixed in bioperl-live on github).

For a quick test of BioPerl, put the following into a file named test.pl:

use Bio::Perl;

# this script will only work if you have an internet connection on the
# computer you're using, the databases you can get sequences from
# are 'swiss', 'genbank', 'genpept', 'embl', and 'refseq'

$seq_object = get_sequence('embl',"AI129902");

write_sequence(">roa1.fasta",'fasta',$seq_object);

Then run it:

perl test.pl

and sure enough, a file named roa1.fasta gets written. Yay!

If you are installing BioPerl on a Mac that has multiple user accounts, you'll need to make sure that the following exists in each user's .profile file (at /Users/john/.profile, for example):

# MacPorts Installer addition on 2010-10-04_at_15:32:08: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.

This makes it so that when you type perl the Mac will find and use the Perl from MacPorts instead of the system Perl. Also, be aware of scripts that say #!/usr/bin/perl at the top.

Solution to 100% CPU Usage by Linux Guest on VMWare Fusion

As part of my testing setup, I have an Intel Mac Pro with Mac OS X 10.6 Server (which runs with the 64-bit kernel) on which I run VMWare Fusion 3.0.1 and several Red Hat virtual machines.

I noticed that even at idle, each VM was taking up a high amount (like 100%!) of a CPU core. Additionally, on one VM top was displaying in near-real-time, which was kind of neat but I doubt the intended behavior. Because of this, I suspected the time management in the kernel was off.

Sure enough, Timekeeping Best Practices for Linux Guests has some hints, and for more information than you'll ever want, try Timekeeping in VMWare Virtual Machines (I was particularly interested in the Clocksource Kernels section).

Making the following modification to /etc/grub.conf on RHEL5 brought my CPU usage down from 100% to barely noticeable:

Before:

kernel /vmlinuz-2.6.18-164.11.1.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet

After:

kernel /vmlinuz-2.6.18-164.11.1.el5 ro root=/dev/VolGroup00/LogVol00 rhgb divider=10

I took out quiet because I like to see what's happening when the system boots.

The Note on RHEL 5.4 or CentOS and divider=10 mentions that you do not need this for RHEL 5.4 for accurate timekeeping, but you do need it to prevent the excessive CPU use.

I also modified /etc/ntp.conf as described in the above article, adding

tinker panic 0

to the top of the file and commenting out the following lines:

# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available.
#server 127.127.1.0
#fudge 127.127.1.0 stratum 10

My VMs are down from 100 percent CPU use to practically zero. Think of the energy savings!

APC UPS and Snow Leopard Server Not Communicating

I have used APC (American Power Conversion) power equipment for a long time. I have had both good and bad experiences with their products (a cherished memory is calling their technical support and asking about the "smell of burning plastic" emanating from one of their units).

I've recently upgraded an Intel Mac Pro to Snow Leopard Server (OS X Server 10.6.2) and noticed that the controls in Energy Saver for the UPS are different. Not in a good way.

Here's the relevant screen from OS X Server 10.5.8:

And the same screen from OS X Server 10.6.2:

After reading a thread on Apple's support site about APC UPS Charge Percentage Not Updating I changed the setting on the server to that shown in the second screenshot above; namely, since the computer can't seem to read the charge percentage, it's better to let the computer monitor how long it's been on the battery.

Another annoyance is that I keep getting the dialog Your computer is now running on UPS backup battery power. The UPS is supposed to self-test every 14 days but I'm seeing the dialog more often then this.

It makes me uneasy, and I don't like being uneasy about servers.

See also: http://www.macworld.com/article/140207/2009/05/apc_leopard.html

Eudora, Snow Leopard and Kerberos

I upgraded to OS X 10.6 "Snow Leopard" yesterday. A smooth upgrade except for one thing.

Eudora 6.2.4 for Mac OS X works on 10.6 (provided the optional Rosetta PowerPC-emulation code is installed), but not with kerberos.

To use kerberized POP, Eudora depends on the Code Fragment Manager library "Kerberos" which is part of the MIT Kerberos Extras for OS X package.

The actual library is installed to /System/Library/CFMSupport/Kerberos and is a 983k file last updated in 2003. It's labeled version 4.2.

If the MIT Kerberos Extras for OS X have been installed, and thus this library is installed, Eudora will fail to launch with the following errors:

Launch failed with error code -2821 (cfragInitFunctionErr) for application /System/Library/Frameworks/Carbon.framework/Versions/A/Support/LaunchCFM App

Eudora can be launched by removing the library. But then kerberos-enabled POP cannot be accomplished.

Topic: 

Pages

Subscribe to RSS - Mac OS X