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
162 stars 90 forks source link

Error in compiling from master -- pindel.cpp:1557:127: error: call of overloaded ‘abs(unsigned int)’ is ambiguous #87

Open eroberson opened 6 years ago

eroberson commented 6 years ago

htslib: 1.7 g++: 7.2.0

hts compile:

./configure --prefix=/home/eli \
CFLAGS="-m64 -O3 -mtune=core2" \
CXXFLAGS="-m64 -O3 -mtune=core2" \
FCFLAGS="-m64 -O3 -mtune=core2"

make

make install

pindel clone & install

git clone git://github.com/genome/pindel
cd pindel
./INSTALL /home/eli/src/htslib-1.7/

path is now: /home/eli/src/htslib-1.7/
make: *** No rule to make target `Makefile.local', needed by `pindel'.  Stop.
If this is the first time you're running this install script please wait a moment as we create the Makefile.local
make -C src pindel
make[1]: Entering directory `/home/eli/src/pindel/src'
make[1]: Leaving directory `/home/eli/src/pindel/src'
make[1]: Entering directory `/home/eli/src/pindel/src'
g++  -I/home/eli/src/htslib-1.7 -Wall -g -c -O3 -fopenmp pindel.cpp -o pindel.o
pindel.cpp: In function ‘void MergeInterChr(ControlState&, UserDefinedSettings*)’:
pindel.cpp:1557:66: error: call of overloaded ‘abs(unsigned int)’ is ambiguous
             if (abs(All[index_a].FirstPos - All[index_b].FirstPos) < 10 && abs(All[index_a].SecondPos - All[index_b].SecondPos) < 10 && All[index_a].NumSupport + All[index_b].NumSupport >= cutoff) {
                                                                  ^
In file included from /usr/local/include/c++/7.2.0/cstdlib:75:0,
                 from /usr/local/include/c++/7.2.0/bits/stl_algo.h:59,
                 from /usr/local/include/c++/7.2.0/algorithm:62,
                 from pindel.cpp:23:
/usr/include/stdlib.h:771:12: note: candidate: int abs(int)
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^~~
In file included from /usr/local/include/c++/7.2.0/cstdlib:77:0,
                 from /usr/local/include/c++/7.2.0/bits/stl_algo.h:59,
                 from /usr/local/include/c++/7.2.0/algorithm:62,
                 from pindel.cpp:23:
/usr/local/include/c++/7.2.0/bits/std_abs.h:56:3: note: candidate: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^~~
/usr/local/include/c++/7.2.0/bits/std_abs.h:61:3: note: candidate: long long int std::abs(long long int)
   abs(long long __x) { return __builtin_llabs (__x); }
   ^~~
/usr/local/include/c++/7.2.0/bits/std_abs.h:70:3: note: candidate: constexpr double std::abs(double)
   abs(double __x)
   ^~~
/usr/local/include/c++/7.2.0/bits/std_abs.h:74:3: note: candidate: constexpr float std::abs(float)
   abs(float __x)
   ^~~
/usr/local/include/c++/7.2.0/bits/std_abs.h:78:3: note: candidate: constexpr long double std::abs(long double)
   abs(long double __x)
   ^~~
/usr/local/include/c++/7.2.0/bits/std_abs.h:84:3: note: candidate: constexpr __int128 std::abs(__int128)
   abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
   ^~~
/usr/local/include/c++/7.2.0/bits/std_abs.h:102:3: note: candidate: constexpr __float128 std::abs(__float128)
   abs(__float128 __x)
   ^~~
pindel.cpp:1557:127: error: call of overloaded ‘abs(unsigned int)’ is ambiguous
             if (abs(All[index_a].FirstPos - All[index_b].FirstPos) < 10 && abs(All[index_a].SecondPos - All[index_b].SecondPos) < 10 && All[index_a].NumSupport + All[index_b].NumSupport >= cutoff) {
                                                                                                                               ^
In file included from /usr/local/include/c++/7.2.0/cstdlib:75:0,
                 from /usr/local/include/c++/7.2.0/bits/stl_algo.h:59,
                 from /usr/local/include/c++/7.2.0/algorithm:62,
                 from pindel.cpp:23:
/usr/include/stdlib.h:771:12: note: candidate: int abs(int)
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^~~
In file included from /usr/local/include/c++/7.2.0/cstdlib:77:0,
                 from /usr/local/include/c++/7.2.0/bits/stl_algo.h:59,
                 from /usr/local/include/c++/7.2.0/algorithm:62,
                 from pindel.cpp:23:
/usr/local/include/c++/7.2.0/bits/std_abs.h:56:3: note: candidate: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^~~
/usr/local/include/c++/7.2.0/bits/std_abs.h:61:3: note: candidate: long long int std::abs(long long int)
   abs(long long __x) { return __builtin_llabs (__x); }
   ^~~
/usr/local/include/c++/7.2.0/bits/std_abs.h:70:3: note: candidate: constexpr double std::abs(double)
   abs(double __x)
   ^~~
/usr/local/include/c++/7.2.0/bits/std_abs.h:74:3: note: candidate: constexpr float std::abs(float)
   abs(float __x)
   ^~~
/usr/local/include/c++/7.2.0/bits/std_abs.h:78:3: note: candidate: constexpr long double std::abs(long double)
   abs(long double __x)
   ^~~
/usr/local/include/c++/7.2.0/bits/std_abs.h:84:3: note: candidate: constexpr __int128 std::abs(__int128)
   abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
   ^~~
/usr/local/include/c++/7.2.0/bits/std_abs.h:102:3: note: candidate: constexpr __float128 std::abs(__float128)
   abs(__float128 __x)
   ^~~
make[1]: *** [pindel.o] Error 1
make[1]: Leaving directory `/home/eli/src/pindel/src'
make: *** [pindel] Error 2

INSTALL failed
Possible reasons:
1. 'cannot cd to [path]
->the htslib path provided was incorrect

2. 'cannot find -lbam'
->htslib was not properly compiled/made, in that case, go to the htslib directory and follow the htslib installation instructions
and run 'make'.

For further help, see the FAQ file included in this directory
Or contact us on kaiye@xjtu.edu.cn
eroberson commented 6 years ago

Appears to confirm #83

jmarshall commented 6 years ago

Previously reported as #62 as well, and best fixed by pull request #64.

eroberson commented 6 years ago

I thought it was probably something like that. Confirmed that switched from ambiguous use of abs to the case diff function corrects the issue as suggested in #64