genome / pindel

Pindel can detect breakpoints of large deletions, medium sized insertions, inversions, tandem duplications and other structural variants at single-based resolution from next-gen sequence data. It uses a pattern growth approach to identify the breakpoints of these variants from paired-end short reads.
GNU General Public License v3.0
163 stars 90 forks source link

[SOLVED] issue with compiling pindel on OS X #44

Closed odoland closed 8 years ago

odoland commented 8 years ago

Hello! I am having some issues with compiling pindel. I have searched Google many times and read your FAQ hoping to resolve the issues, but to no luck.

I have re-installed the 6.1.0 versions of gcc and g++ via homebrew --without-multilib

I am on an OS X 10.11 El Capitan. Tried to make sure I was using the newer version of gcc by the command:

[$alias g++='g++-6' 
$gcc='gcc-6', 

$cd src,
make clean
make CXX=g++-6, 

$./INSTALL ~/coolstuff/samtools-1.3.1/

path is now: /Users/elisaur/coolstuff/samtools-1.3.1/
make -C src pindel
c++  -I/Users/elisaur/coolstuff/htslib -Wall -g -c -O3 -fopenmp bddata.cpp -o bddata.o
clang: error: unsupported option '-fopenmp'
make[1]: *** [bddata.o] Error 1
make: *** [pindel] Error 2

mv: rename src/pindel to ./pindel: No such file or directory
mv: rename src/pindel2vcf to ./pindel2vcf: No such file or directory
mv: rename src/sam2pindel to ./sam2pindel: No such file or directory
mv: rename src/pindel2vcf4tcga to ./pindel2vcf4tcga: No such file or directory

Pindel successfully compiled. The pindel executable can be found in this directory.

Thanks for your help!](url)

EWLameijer commented 8 years ago

Hello Odoland,

at first sight, you seem to have done things correctly, though I'm a bit confused why you called the ./INSTALL with the samtools directory, as current versions of Pindel require the htslib directory.

Looking at the error message, it refers to clang, which means that for some reason g++ was not properly 'overruled' to gcc.

As I'm not much of an OSX expert, I can only guess to the reason - is it possible that using cd src, make clean, make CXX=g++-6 did not work properly? I would in any case try to make it four 'normal' commands (cd src [ENTER] make clean [ENTER] etc.) [this may not work, but I can't check it myself as I still need to call a OSX-expert to undestroy my compiler installation]

Perhaps Kai has some tips, but in any case I would search in the direction of how to overload clang correctly.

Best regards,

Eric-Wubbo

odoland commented 8 years ago

Hi, I finally got pindel to compile successfully on OS X, and I would like to share how in here for others who may be Googling the problem.

First, follow the FAQ. Install g++ and gcc (any version after 4.9 has OpenMP). Then, type the command so the compiler OS X uses is gcc-6 and not clang.

$CC=gcc-6 CXX=g++-6 ./INSTALL /path/to/htslib

I ran into another error after this on the bddata.cpp. It was: error: call of overloaded abs is ambiguous

After an extensive google search, I found this, http://stackoverflow.com/questions/30084577/ambiguous-call-to-abs

So I went to the bddata.cpp file (located under /htslib/src), opened it up with vim editor.

I added these libraries to the header:

#include <cmath>
#include <cstdlib>
#include <cstdint>

and then I replaced every instance of abs( in the code to fabs( The command to find and replace with vim is :%s/abs(/fabs(/g Find each occurrence of 'abs(' (in all lines), and replace it with 'fabs('.

After this, it finally worked!

Best of luck!