What? This has been no problem to you? If so, let me know, because it was giving me an error 11 thing (look further down), that was just impossible to understand. People around the web were saying that this error meant that the RAM was shitty, but this error happened in every mac I have. You just downloaded the precompiled version? Then you’re boring. Anyway, yes, I am obsessed with compiling my programs because then they are “optimized” to my liking. Well, I know, commonly there will be no difference, and commonly what you want is something that just works. Anyway. I wanted to compile it myself, but couldn’t. So I was stuck with NCBI‘s BLAST 2.2.26+ (the horror!).

As I was telling you, I had tried to compile this one, and, because I always forget how I compiled the previous version, well, I did not know what option could I be missing. Of course, I had the Xcode and such installed, otherwise how on Earth could I compile. Thus, I am assuming that you know how to install Xcode, and how to install the command-line compiling tools from within Xcode’s preferences panel. Normally, you are supposed to download the latest version of NCBI’s BLAST, which, for me works as follows:

I first investigate the files available with this command (the “%” represents the cursor, don’t type it!):

% rsync rsync://rsync.ncbi.nih.gov/blast/executables/LATEST/

The command gives me the list of blast thingies in there. Tons of precompiled ones (I know, I know, I don’t care), and, today, The Source: ncbi-blast-2.2.27+-src.tar.gz, which I can retrieve with the command:

% rsync -av \
 rsync://rsync.ncbi.nih.gov/blast/executables/LATEST/ncbi-blast-2.2.27+-src.tar.gz \

(The dot at the end is important) With that, we untar the source:

% tar zxvf ncbi-blast-2.2.27+-src.tar.gz

move yourself to the extracted directory:

% cd ncbi-blast-2.2.27+-src/c++

and here is where you are supposed to type this:

% ./configure --prefix=/usr/local/ncbi --without-debug \
  --with-mt --with-build-root=ReleaseMT

(I added the “prefix” thingie because I want it installed in it’s own directory path.)

Well, if I type make, the process fails after some minutes giving me this shit:

internal compiler error: Segmentation fault: 11

As I said, I looked it up, and found lots of useless advice. What did I do? Well, so it happens that I have fink installed. So it happens that because I install octave, a GNU, therefore free, matlab-like thingie, I get gcc-4 installed. Because I get that, I thought, what the hell, maybe those compilers will do the trick. So, I first declared these environmental variables:

% setenv CC /sw/bin/gcc-4
% setenv CXX /sw/bin/g++-4
% setenv CFLAGS "-O3"
% setenv CXXFLAGS "-O3"

(I still use the tcsh, in bash the equivalent would be “export CC=/sw/bin/gcc-4” and so on.)

Now, the “-O3” might not be necessary, but as I said, I compile to have some stuff my own way.

OK, then the configure above went instead as follows, just to make sure that it would choose only 64 bit compilation, because I do not give a damn about older MacOSXs, and to make sure I can install the program in other macs even if they lack some library, I add “static”:

% ./configure --prefix=/usr/local/ncbi --with-static \
  --with-64 --without-debug --with-mt --with-build-root=ReleaseMT

Then I typed make, and it worked! Took a good while to compile, but compile it did. Then I typed “make install”, and done! 64-bit compiled NCBI’s BLAST 2.2.27+. I checked!

% blastp -version
blastp: 2.2.27+
Package: blast 2.2.27, build Jan 17 2013 15:17:18
% file `which blastp`
/usr/local/ncbi/bin/blastp: Mach-O 64-bit executable x86_64


So there! A recipe to compile your own NCBI’s BLAST 2.2.27+ from source.



2 thoughts on “I got to compile NCBI’s BLAST 2.2.27+ under Mountain Lion

  1. Pingback: If ssearch36 gets stuck while comparing sequences in your mac « Entropic Evolution

  2. Pingback: Compiling NCBI’s blast 2.2.28+ in Mountain Lion | Entropic Evolution

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s