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

Building pindel with g++-7.3.0 fails #99

Open
SHuang-Broad opened this issue Sep 17, 2018 · 9 comments
Open

Building pindel with g++-7.3.0 fails #99

SHuang-Broad opened this issue Sep 17, 2018 · 9 comments

Comments

@SHuang-Broad
Copy link

Hello,

I'm reporting a compilation error when building with g++ version 7.3.0

path is now: /home/shuang/htslib-1.9/
make -C src pindel
make[1]: Entering directory '/home/shuang/pindel/src'
g++  -I/home/shuang/htslib-1.9 -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/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from pindel.cpp:23:
/usr/include/stdlib.h:837:12: note: candidate: int abs(int)
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^~~
In file included from /usr/include/c++/7/cstdlib:77:0,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from pindel.cpp:23:
/usr/include/c++/7/bits/std_abs.h:56:3: note: candidate: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^~~
/usr/include/c++/7/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/include/c++/7/bits/std_abs.h:70:3: note: candidate: constexpr double std::abs(double)
   abs(double __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:74:3: note: candidate: constexpr float std::abs(float)
   abs(float __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:78:3: note: candidate: constexpr long double std::abs(long double)
   abs(long double __x)
   ^~~
/usr/include/c++/7/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/include/c++/7/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
 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/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from pindel.cpp:23:
/usr/include/stdlib.h:837:12: note: candidate: int abs(int)
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^~~
In file included from /usr/include/c++/7/cstdlib:77:0,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from pindel.cpp:23:
/usr/include/c++/7/bits/std_abs.h:56:3: note: candidate: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^~~
/usr/include/c++/7/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/include/c++/7/bits/std_abs.h:70:3: note: candidate: constexpr double std::abs(double)
   abs(double __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:74:3: note: candidate: constexpr float std::abs(float)
   abs(float __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:78:3: note: candidate: constexpr long double std::abs(long double)
   abs(long double __x)
   ^~~
/usr/include/c++/7/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/include/c++/7/bits/std_abs.h:102:3: note: candidate: constexpr __float128 std::abs(__float128)
   abs(__float128 __x)
   ^~~
Makefile:47: recipe for target 'pindel.o' failed
make[1]: *** [pindel.o] Error 1
make[1]: Leaving directory '/home/shuang/pindel/src'
Makefile:12: recipe for target 'pindel' failed
make: *** [pindel] Error 2

mv: cannot stat 'src/pindel': No such file or directory
mv: cannot stat 'src/pindel2vcf': No such file or directory
mv: cannot stat 'src/sam2pindel': No such file or directory
mv: cannot stat 'src/pindel2vcf4tcga': No such file or directory

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

You can test pindel with the example files in the demo directory; example commands are given in the RUNME in that directory.

For help and background information, see the pindel wiki and its FAQ on gmt.genome.wustl.edu/packages/pindel, as well as
the FAQ file in the Pindel root directory (the same directory as this INSTALL script is located)
or contact us on [email protected]

What's dangerous here is near the bottom:
despite make reporting errors, there's the line

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

The same ambiguity exists in pindel.cpp, bddata.cpp, genotyping.cpp.
Using fabs temporarily solves the problem (needs to update the includes accordingly), but I don't think that's optimal.

@JoseReverol
Copy link

Hello SHuang-Broad,
how do I use fabs to temporarily solve the issue?
I'm new to this whole thing, can you explain this step so I can start analyzing data using pindel.
Thanks in advance.

Jose

@SHuang-Broad
Copy link
Author

SHuang-Broad commented Mar 6, 2019

Hey @JoseReverol , if you don't want to do this fix yourself, and you are comfortable with dockers, I've built a docker image for Pindel here:

https://cloud.docker.com/u/shuangbroad/repository/docker/shuangbroad/pindel,

which is based on the docker here:

https://hub.docker.com/r/mgibio/pindel

If you cannot use docker, let me know and I can explain in detail how I fixed it.

@JoseReverol
Copy link

Hi @SHuang-Broad I'm currently having issues with the docker pulling, do you have an image anywhere else where I could pull it or download it directly.

@SHuang-Broad
Copy link
Author

Huh? That's strange. I just tried:
docker pull shuangbroad/pindel:v0.2.5b8
or
docker pull mgibio/pindel:v0.2.5b8
Both succeeded.
Can you try again?

@jmarshall
Copy link
Contributor

This problem with abs() can be fixed by applying PR #64 to your source code. For example, download that as a patch and apply it with patch -p 1 < pr64.patch.

@JoseReverol
Copy link

I succesfully pulled the doc,
which equally dropped the same error

Makefile:47: recipe for target 'pindel.o' failed
make[1]: *** [pindel.o] Error 1
make[1]: Leaving directory '/usr/local/pindel/src'
Makefile:12: recipe for target 'pindel' failed
make: *** [pindel] Error 2
  
mv: cannot stat 'src/pindel': No such file or directory
mv: cannot stat 'src/pindel2vcf': No such file or directory
mv: cannot stat 'src/sam2pindel': No such file or directory
mv: cannot stat 'src/pindel2vcf4tcga': No such file or directory
 

I don't understand how to apply PR #64 to my source code since I'm my of a beginner in this area @jmarshall if you could tell me how to I would be very glad.

Thanks all for your recommendations, I will try and delete any former installation and try it again just in case any prior installation is messing up with the new configuration.

@SHuang-Broad
Copy link
Author

@JoseReverol, you shouldn't need to re-make Pindel if using docker.

It seems that you are not aiming to deploy the docker in a cloud computing environment, therefore I would suggest you use the docker you pulled down using docker pull mgibio/pindel:v0.2.5b8.
To use that, you can use

docker run mgibio/pindel:v0.2.5b8 --help

to see the help message, or if you need more, you can go to http://gmt.genome.wustl.edu/packages/pindel/user-manual.html

Just note that before you run, you probably need to run

echo "${input_bam} ${mean_insert_size} ${sample_name}" >  ${sample_name}.bam.config

Then

docker run mgibio/pindel:v0.2.5b8 [YOUR_OPTIONS]

And wait....... (depending on your BAM size, variants you want, it might take a while).

@jmarshall
Copy link
Contributor

Download this tarball to get a copy of the source code with PR #64 already applied.

@JoseReverol
Copy link

Thanks to both of you guys, it worked like a charm after I copied the source code just as @jmarshall said. Smoothly running right now.

Best,

Jose

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

3 participants