statgen / bamUtil

http://genome.sph.umich.edu/wiki/BamUtil
87 stars 29 forks source link

Compile error #50

Closed LiyanJi-code closed 6 years ago

LiyanJi-code commented 6 years ago

When I run "make" to compile libStatGen and bamUtil, I get the following errors: make[1]: [obj/VcfRecord.o] Error 1 make[1]: Leaving directory `/home/Software/libStatGen/vcf' make: [vcf] Error 2

Thank for your help.

jonathonl commented 6 years ago

Is there any other output before those three lines? On what OS are you building?

LiyanJi-code commented 6 years ago

@jonathonl run 'make' on CentOS: make -C ../../libStatGen --no-print-directory opt ar -cru ../libStatGen.a obj/bgzf.o obj/knetfile.o ar -cru ../libStatGen.a obj/BaseAsciiMap.o obj/BaseQualityHelper.o obj/BaseUtilities.o obj/BasicHash.o obj/BgzfFileType.o obj/BgzfFileTypeRecovery.o obj/CharBuffer.o obj/Chromosome.o obj/Cigar.o obj/CigarRoller.o obj/Error.o obj/ErrorHandler.o obj/FileType.o obj/FortranFormat.o obj/GenomeSequence.o obj/GenotypeLists.o obj/glfHandler.o obj/GzipFileType.o obj/GzipHeader.o obj/Hash.o obj/IndexBase.o obj/Input.o obj/InputFile.o obj/IntArray.o obj/IntHash.o obj/LongLongCounter.o obj/MapFunction.o obj/MathMatrix.o obj/MathVector.o obj/MemoryAllocators.o obj/MemoryInfo.o obj/MemoryMapArray.o obj/MemoryMap.o obj/MiniDeflate.o obj/NonOverlapRegions.o obj/Parameters.o obj/PedigreeAlleleFreq.o obj/Pedigree.o obj/PedigreeDescription.o obj/PedigreeFamily.o obj/PedigreeGlobals.o obj/PedigreePerson.o obj/PhoneHome.o obj/QuickIndex.o obj/Random.o obj/ReferenceSequence.o obj/SmithWaterman.o obj/Sort.o obj/STLUtilities.o obj/StatGenStatus.o obj/StringAlias.o obj/StringArray.o obj/StringBasics.o obj/StringHash.o obj/StringMap.o obj/Tabix.o obj/UncompressedFileType.o obj/PedigreeLoader.o obj/PedigreeTrim.o obj/PedigreeTwin.o ar -cru ../libStatGen.a obj/SamFileHeader.o obj/SamFile.o obj/GenericSamInterface.o obj/SamInterface.o obj/BamInterface.o obj/SamRecord.o obj/BamIndex.o obj/SamHeaderHD.o obj/SamHeaderPG.o obj/SamHeaderRecord.o obj/SamHeaderSQ.o obj/SamHeaderRG.o obj/SamHeaderTag.o obj/SamValidation.o obj/SamStatistics.o obj/SamQuerySeqWithRefHelper.o obj/SamFilter.o obj/PileupElement.o obj/PileupElementBaseQual.o obj/SamReferenceInfo.o obj/SamTags.o obj/PosList.o obj/CigarHelper.o obj/SamRecordPool.o obj/SamCoordOutput.o obj/SamRecordHelper.o ar -cru ../libStatGen.a obj/FastQFile.o obj/BaseCount.o obj/BaseComposition.o obj/FastQStatus.o ar -cru ../libStatGen.a obj/GlfException.o obj/GlfFile.o obj/GlfHeader.o obj/GlfRecord.o obj/GlfRefSection.o obj/GlfStatus.o g++ -std=c++0x -O4 -pipe -Wall -I../include -I. -DZLIB_AVAILABLE__ -D_FILE_OFFSET_BITS=64 -DSTDC_LIMIT_MACROS -o obj/VcfRecord.o -c VcfRecord.cpp -DVERSION="\"1.0.0\"" 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 `/home/Software/bamUtil-1.0.14/src' make: [src] Error 2

I have tried to 1) run the "make CXX11_AVAIL=0" as suggested in https://genome.sph.umich.edu/wiki/BamUtil:_FAQ, 2) run "make CFLAGS=-std=c++11". 3) add zlib package path to ZLIB_LIB = -lz lines in ./libStatGen/Makefiles/Makefile.include according to https://github.com/statgen/bamUtil/issues/49 But all failed.

Am I doing something wrong? Do you have other suggestions? thanks.

jonathonl commented 6 years ago

I'm assuming you are using version 6 of CentOS and version 4.4 of g++. I believe this is a bug (partial implementation) in the c++11 implementation in that version of g++. The first suggestion in https://github.com/statgen/bamUtil/issues/49 will fix your problem.

Edit libStatGen/vcf/VcfRecord.cpp:

line 160
from
std::to_string(my1BasedPosNum) + " (chr:pos) - " + e.what();
to
std::to_string((long long)my1BasedPosNum) + " (chr:pos) - " + e.what();

line 199
from:
std::string strPos = std::to_string(my1BasedPosNum);
to:
std::string strPos = std::to_string((long long)my1BasedPosNum);
LiyanJi-code commented 6 years ago

The problem has been solved. Thanks a lot.

2018-04-13 22:41 GMT+08:00 Jonathon LeFaive notifications@github.com:

I'm assuming you are using version 6 of CentOS and version 4.4 of g++. I believe this is a bug (partial implementation) in the c++11 implementation in that version of g++. The first suggestion in #49 https://github.com/statgen/bamUtil/issues/49 will fix your problem.

line 160 from std::to_string(my1BasedPosNum) + " (chr:pos) - " + e.what(); to std::to_string((long long)my1BasedPosNum) + " (chr:pos) - " + e.what();

line 199 from: std::string strPos = std::to_string(my1BasedPosNum); to: std::string strPos = std::to_string((long long)my1BasedPosNum);

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/statgen/bamUtil/issues/50#issuecomment-381157243, or mute the thread https://github.com/notifications/unsubscribe-auth/AJtg-0jRDRk0Nr3DnRvVcs5YTIIE5J_8ks5toLkngaJpZM4TRD_r .