I will be compiling this code as ‘root’ as a system tool in/usr/local/src, so do not scream at me for that.
First I created an/usr/local/src/blatdirectory and I copied the blatSrc35.zip file into that.
Next I used
unzipblatSrc35.zip
to unpack the archive. This gives a directory blatSrc now move into that directory.
#cd blatSrc
before you begin read the README file that comes with the source code.
One thing about building blat is that you need to set the MACHTYPE variable so that the BLAT sources know what type of machine you are compiling the software on.
on most *nix machines, typing
echo$MACHTYPE
will return the machine architecture type.
On my CentOS 6 based system this gave:
x86_64-redhat-linux-gnu
However, what BLAT requires is the ‘short value’ (ie the first part of the MACHTYPE). To correct this, in the bash shell type (change this to the correct MACHTYPE for your system)
MACHTYPE=x86_64
exportMACHTYPE
now running the command:
echo$MACHTYPE
should give the correct short form of the MACHTYPE:
x86_64
now create the directorylib/$MACHTYPEin the source tree. ie:
mkdirlib/$MACHTYPE
For my machine, lib/x86_64already existed, so I did not have to do this, but this is not the case for all architectures.
The BLAT code assumes that you are compiling BLAT as a non-privileged (ie non-root) user. As a result, you must create the directory for the executables to go into:
mkdir~/bin/$MACHTYPE
If you are installing as a normal user, edit your.bashrcto add the following (change the x86_64 to be your MACHTYPE):
exportPATH=~/bin/x86_64::$PATH
For me, though, this was not good enough. I wanted the executables in/usr/local/binwhere all my other code goes. As a result I did some hackery…
There is a master make template in the inc directory called common.mk and I edited this file with the command:
viinc/common.mk
I replaced the line
BINDIR=${HOME}/bin/${MACHTYPE}
with
BINDIR=/usr/local/bin
saved and quit (as this is in my path, I do not need to do anything else)
All the preparation is now done and you can create the blat executables by going into the toplevel of the blat source tree (for me it was /usr/local/src/blat/blatSrc, but change to wherever you unpacked blat into).
Now simply run the command:
make
to compile the code.
Blat installed cleanly and the executables were all neatly placed in/usr/local/bin/x86_64, just like I wanted.
now simply running the command:
blat
on the command line gives me information on blat and sample usage.
Blat is installed and it’s installed properly in my system code tree!!!