Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building bamUtil returns error: call of overloaded 'to_string(int&)' is ambiguous #49

Closed
sam0per opened this issue Feb 26, 2018 · 4 comments

Comments

@sam0per
Copy link

sam0per commented Feb 26, 2018

Hi there,
I am encountering an error while building this repository using the following codes:

git clone git://github.com/statgen/bamUtil.git
cd bamUtil
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
module load gcc/v6.3.0
make cloneLib
make ## here comes the error
...
VcfRecord.cpp: In member function 'bool VcfRecord::read(InputFile*, bool, VcfRecordDiscardRules&, VcfSubsetSamples*)':
VcfRecord.cpp:160: error: call of overloaded 'to_string(int&)' is ambiguous
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/basic_string.h:2604: note: candidates are: std::string std::to_string(long long int)
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/basic_string.h:2610: note: std::string std::to_string(long long unsigned int)
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/basic_string.h:2616: note: std::string std::to_string(long double)
VcfRecord.cpp: In member function 'bool VcfRecord::write(InputFile*, bool)':
VcfRecord.cpp:199: error: call of overloaded 'to_string(int&)' is ambiguous
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/basic_string.h:2604: note: candidates are: std::string std::to_string(long long int)
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/basic_string.h:2610: note: std::string std::to_string(long long unsigned int)
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/basic_string.h:2616: note: std::string std::to_string(long double)
make[3]: *** [obj/VcfRecord.o] Error 1
make[2]: *** [vcf] Error 2
make[1]: *** [../../libStatGen/libStatGen.a] Error 2
make[1]: Leaving directory `/proj/data9/samuel/modules/bamUtil/src'
make: *** [src] Error 2

I am working on a HPC cluster that uses linux
Any suggestion to avoid the ambiguities?

@mktrost
Copy link
Contributor

mktrost commented Feb 28, 2018 via email

@sam0per
Copy link
Author

sam0per commented Feb 28, 2018

Thanks for your quick suggestion and it seems to work if you enclose my1BasePosNum in brackets too.

std::to_string(static_cast(my1BasedPosNum)) + " (chr:pos) - " + e.what();
std::string strPos = std::to_string(static_cast(my1BasedPosNum));

Unfortunately, there is another error that pops up and perhaps it is related to the zlib package which I am not able to load on the current HPC cluster. I am in contact with the admin and I will update you if you do not have any further comments at the moment. Here is the error:

../../libStatGen/libStatGen.a(GzipFileType.o): In function GzipFileType::GzipFileType(char const*, char const*)': GzipFileType.cpp:(.text+0xdf): undefined reference to gzopen64'
../../libStatGen/libStatGen.a(GzipFileType.o): In function GzipFileType::seek(long, int)': GzipFileType.cpp:(.text._ZN12GzipFileType4seekEli[_ZN12GzipFileType4seekEli]+0x9): undefined reference to gzseek64'
../../libStatGen/libStatGen.a(GzipFileType.o): In function GzipFileType::tell()': GzipFileType.cpp:(.text._ZN12GzipFileType4tellEv[_ZN12GzipFileType4tellEv]+0x5): undefined reference to gztell64'
collect2: error: ld returned 1 exit status
make[1]: *** [../bin/bam] Error 1

@sam0per
Copy link
Author

sam0per commented Mar 1, 2018

Hi @mktrost
I have been suggested to manually include the path of the zlib package into bamUtil/Makefile.inc. My first idea was to define the path to zlib and add this line into the Makefile LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/packages/zlib-1.2.8
However, I might need the help of an expert to guide me through this. How can I specify the reference to the zlib package in order to solve the errors posted in the previous message?

@sam0per
Copy link
Author

sam0per commented Mar 1, 2018

OK, problem solved following this suggestion

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

No branches or pull requests

2 participants