Installing TPP 4.6.2 on Mountain Lion Mac OSX

some edits suggested by Oded Kleifeld

This is for the open-source proteomics folks out there who run Macs. I finally figured out how to install the latest Transatlantic-Proteomics-Pipeline package (TPP 4.6.2) on my Mountain Lion Macbook Air. It was not fun, and involved debugging make and configure files.

Basically the workflow of the TPP build process is that src/Makefile contains the commands to build the TPP, but it will call several children Makefiles dotted all over the package. For instance, src/Makefile.incl contains the commands to build all the external dependencies (found in extern/) that are included in the TPP package.

To make TPP 4.6.2 work with Mac OSX Mountain Lion also known as BSD/Darwin, you will have to change

  • src/Makefile
  • src/Makefile.incl
  • CGI/Makefile
  • CGI/tpp_gui/

and install the libraries

  • libgd
  • libpng1.2
  1. Compiling tools

Obviously, install XCode from Apple. This will install all the compilers you need to build the TPP.

In your .bashrc or whatever, you need to make sure the JAVA environment variable is setup:

export JAVA_HOME=$(/usr/libexec/java_home)
  1. Install libgd and libpng.

In the instructions, they suggest fink and macports, but I've had problems with these two packages, and now I prefer brew (based on Ruby goodness). So go install brew now.

Installing libgd is easy with brew (haha try installing libgd with macports):

brew install gd

First the TPP does not work with the latest libpng (version 1.5), so you must use libpng 1.2. To install that, use brew:

brew tap homebrew/versions
brew install libpng12

On some systems, libpng 1.5 may already be installed. You have to make sure that the libpng 1.5 header files are not included.

Now the links to these two need to be hard-coded into src/Makefile.incl. The relevant section is identified by the comment:

# use the next two lines if you use fink rather than macports

and you should replace the line:

GD_LIB= /opt/local/lib/libgd.a /opt/local/lib/libpng.a


GD_LIB = /usr/local/lib/libgd.a /usr/local/Cellar/libpng12/1.2.50/lib/libpng12.a

As well, some of the auxilliary scripts require the downloading tool wget. If you don't have this,

brew install wget

3.The make cycle.

The biggest glitch I've found in the TPP make cycle is that the top src/Makefile passes the LDFLAGS into all the children makefiles. This causes all the extern packages to crash at the ./configure stage, where the ./configure test fails because it can't find the libraries stated in the LDFLAGS of the top-level src/Makefiles.

So, to do this, we need to be sneaky and run make twice, once with the LDFLAGS turned off so that the extern packages compile, and a second turn to put back the LDFLAGS so that the TPP programs can find the libraries they actually need. So find the line:


Comment the shit out of it (add a '#' at the front).

Then run make. It should compile all the extern dependencies and then crash somewhere in the compilation of the TPP.

Then uncomment that very line in src/Makefile, and run make again.

Everything should compile now. At this point, all the binaries should have been built, but not deployed.

  1. deprecated copy options.

In the deployment, one of the Makefiles uses an option for the copy command cp that has been deprecated in BSD/Darwin. It is in CGI/Makefile. It is in the line:

cp -rfu tpp_gui/users/* ${CGI_USERS_DIR}

Specifically, -u option is not available in Darwin, so we simply delete it (it's not very important anyway) and remove the -u option:

cp -rf tpp_gui/users/* ${CGI_USERS_DIR}
  1. md5 is md5sum is not md5.

The last bit is due to an annoying difference between the md5 hash programs between BSD/Darwin and GNU/Linux. The numbers are the same but the text output is slightly different, enough to confuse the TPP. If md5 is not installed correctly, you can't interpret passwords for user accounts.

So in the file CGI/tpp_gui/, find the line:

'md5' => '/usr/bin/md5sum',     # full path to md5sum 

and replace '/usr/bin/md5sum' with:

'md5' => '/sbin/md5',     # full path to md5sum 
  1. Deploy.

Now you are ready to deploy. So go ahead:

make install

I had suggested sudo before, but somehow this interferes with the process, so stick with normal make. Presumably the staging directories will not require admin access.

And of course, you must then configure your local apache server, which is as described in the previous Mac OSX installation guides.