Tuesday, 16 September 2014

Installing standalone SpectraST in linux

Some tips to install SpectraST in linux in standalone:

1. -  Download TTP latest version.
2. -  go to SpectraST folder and run make:
     
    cd TPP-x.x.x/trans_proteomic_pipeline/src/Search/SpectraST
    make -f Makefile_STANDALONE_LINUX


If you have some problems with dependencies this tips should help:

I successfully installed the standalone version of SpectraST on an Ubuntu machine, but I had to make the two following changes. Perhaps these changes could be made to the prerequisites script and the source, respectively. Details below.

1. install libgsl0-dev from apt-get
2. modify SpectraST_util.cpp to include unistd.h

As for the first, I understand that the prerequisites scripts don't include Ubuntu 13.04. Perhaps the second issue is also specific to later ubuntu versions.

Ubuntu 13.04, 64-bit
TPP 4.6.3


1. gsl dependency

Reproduce:
$ cd TPP-4.6.3/trans_proteomic_pipeline/src/Search/SpectraST
$ make -f Makefile_STANDALONE_LINUX
...
g++  -I/usr/include -Werror -Wformat -Wstrict-aliasing -Wno-deprecated -Wno-char-subscripts -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE  -DSTANDALONE_LINUX   -I/usr/include -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Werror -Wformat -Wstrict-aliasing -Wno-deprecated -Wno-char-subscripts -O2 -c SpectraSTDenoiser.cpp -o linux_standalone/SpectraSTDenoiser.o
SpectraSTDenoiser.cpp:8:28: fatal error: gsl/gsl_vector.h: No such file or directory
compilation terminated.
make: *** [linux_standalone/SpectraSTDenoiser.o] Error 1

Fix:
$ sudo apt-get install libgsl0-dev


2. unistd.h (getcwd)

Reproduce:

$ make -f Makefile_STANDALONE_LINUX
...  
g++  -I/usr/include -Werror -Wformat -Wstrict-aliasing -Wno-deprecated -Wno-char-subscripts -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE  -DSTANDALONE_LINUX   -I/usr/include -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Werror -Wformat -Wstrict-aliasing -Wno-deprecated -Wno-char-subscripts -O2 -c SpectraST_util.cpp -o linux_standalone/SpectraST_util.o
SpectraST_util.cpp: In function ‘char* safepath_getcwd(char*, int)’:
SpectraST_util.cpp:587:30: error: ‘getcwd’ was not declared in this scope
make: *** [linux_standalone/SpectraST_util.o] Error 1

Fix:

Change the relevant lines in SpectraST_util.cpp:
 
#ifdef _MSC_VER // if under Visual Studio
#include <direct.h> // for getcwd 
#else
#include <unistd.h>
#endif