Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

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

Open
eroberson opened this issue Mar 21, 2018 · 3 comments

Comments

@eroberson
Copy link

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 [email protected]
@eroberson
Copy link
Author

Appears to confirm #83

@jmarshall
Copy link
Contributor

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

@eroberson
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants