Wednesday, October 31, 2012

How to compile PeakSplitter on Mac OS10

If you try to run MACS by typing macs14 command into the terminal with the --call-subpeaks option you will get an output that you need to install the PeakSplitter first:

ERROR:root:PeakSplitter can not be accessed through the command line!
ERROR:root:OS gave me this error message: [Errno 2]: No such file or directory
ERROR:root:Please download PeakSplitter from <http://www.ebi.ac.uk/bertone/software/PeakSplitter_Cpp.tar.gz>.
ERROR:root:After you download and unzip it, read the instruction at <http://www.ebi.ac.uk/bertone/software/PeakSplitter_Cpp_usage.txt>
ERROR:root:Install PeakSplitter so that you can access it through typing 'PeakSplitter' under the command line.


So Download the PeakSplitter from http://www.ebi.ac.uk/bertone/software/PeakSplitter_Cpp.tar.gz

However on Mac OS 10.8 if you try to follow the instructions from the readme file:

1. Open up a command terminal, go to the directory "PeakSplitter_v1" where you have uncompressed PeakSplitter.

2. Within this directory, go to "SFL/Release" directory and run the makefile using
make (or make -f makefile)

3. Return to the directory "PeakSplitter_v1", then go to the "Zlib/Release" directory and run the makefile
make (or make -f makefile)

4. Now you are ready to install PeakSplitter. Return to the directory "PeakSplitter_v1", and run the makefile
make (or make -f makefile)
An executable file named "PeakSplitter" will be generated in this folder.


You will find that Zlib will be compiled, but SFL cannot be compiled. The outcoming message will be:

Building file: ../sflbits.c
Invoking: GCC C Compiler
gcc -D__UNIX__ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"sflbits.d" -MT"sflbits.d" -o"sflbits.o" "../sflbits.c"
In file included from ../sflbits.c:16:
../prelude.h:401:9: error: #error "Cannot compile: must change definition of 'qbyte'."
make: *** [sflbits.o] Error 1


I found on MACS announcments google group the following solution to the problem:
https://groups.google.com/forum/?fromgroups=#!topic/macs-announcement/V2d8HdCJmRA

So, download the three files, sfl.h, prelude.h and sflprint.h and replace them (they are located in SFL folder).
Then:
make clean
make

Now if you try to compile PeakSplitter in the PeakSplitter_v1 folder you will get the error message:

Building file: SplitPeaks/BedGraphParser.cpp
Invoking: GCC C++ Compiler
g++ -D__UNIX__ -I./SplitPeaks -I./SFL -I./Zlib -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"BedGraphParser.d" -MT"BedGraphParser.d" -o"BedGraphParser.o" "SplitPeaks/BedGraphParser.cpp"
In file included from SplitPeaks/BedGraphParser.h:2,
                 from SplitPeaks/BedGraphParser.cpp:1:
SplitPeaks/Shared.h:3:1: warning: "__UNIX__" redefined
<command-line>: warning: this is the location of the previous definition
In file included from /usr/include/c++/4.2.1/backward/iostream.h:31,
                 from ./SFL/sfl.h:236,
                 from SplitPeaks/Shared.h:17,
                 from SplitPeaks/BedGraphParser.h:2,
                 from SplitPeaks/BedGraphParser.cpp:1:
/usr/include/c++/4.2.1/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
In file included from SplitPeaks/BedGraphParser.cpp:1:
SplitPeaks/BedGraphParser.h:12: error: extra qualification ‘BedGraphParser::’ on member ‘nextPosition’
make: *** [BedGraphParser.o] Error 1


So, open the BedGraphParser.h file:
nano BedGraphParser.h

and delete the BedGraphParser::
from the line
wigPosition* BedGraphParser::nextPosition();

so that it looks like:
wigPosition* nextPosition();

Now if you try to compile it should work fine.

No comments:

Post a Comment