BamUtil: FAQ

From Genome Analysis Wiki
Revision as of 09:49, 25 March 2014 by Mktrost (talk | contribs)
Jump to navigationJump to search

For problems with libStatGen, see LibStatGen Troubleshooting

Compile Problems

HashErrorModel.cpp:96: error: ‘class std::unordered_map, std::equal_to, std::allocator > >’ has no member named ‘at’

Error:
HashErrorModel.cpp: In member function ‘uint8_t HashErrorModel::getQemp(BaseData&)’:
HashErrorModel.cpp:96: error: ‘class std::unordered_map, std::equal_to, std::allocator > >’ has no member named ‘at’
make[2]: *** [../obj/HashErrorModel.o] Error 1
HashErrorModel by default uses an unordered_map which is only found in C++11/C++0x.
The code attempts to automatically detect whether or not you have C++11/C++0x by checking if the gcc version > X4.3.0.
If you see this failure, that means this check did not properly work and you will need to manually disable the C++11/C++0x code. There are a couple of ways to do this:
  1. Update bamUtil/Makefile.inc, line 7, change CXX11_AVAIL ?= 1 to CXX11_AVAIL = 0
  2. Set CXX11_AVAIL to 0 on the command line:
    make CXX11_AVAIL=0
  3. Set CXX11_AVAIL = 0 in your environment

By making one of these changes, the code should compile and use map instead of unordered_map.

ld: lto: could not merge in ../obj/BamExecutable.o because Unknown instruction for architecture x86_64

ERROR:
ld: lto: could not merge in ../obj/BamExecutable.o because Unknown instruction for architecture x86_64
collect2: ld returned 1 exit status
make[2]: *** [../bin/bam] Error 1
make[1]: *** [src] Error 2
make: *** [bamUtil/] Error 2
This error was seen when running on Mac OS X 10.7.5 on a 64-bit kernel with gcc/g++: i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
The error appears to be due to the default build optimization: -O4
If you see this error, try compiling for debug (optimization -O0): make debug
The debug executable is: bamUtil/bin/debug/bam
If the debug compile worked and you would prefer an optimized executable (runs a little faster), then update the optimization flag to -O3:
  1. Open libStatGen/Makefiles/Makefile.include
  2. Change OPTFLAG_OPT?=-O4 to OPTFLAG_OPT?=-O3
  3. Run make clean; make in both libStatGen and bamUtil
  4. The optimized executable is bamUtil/bin/bam