When I tried to compile a program from source code, I always got an error:
snpexp.cxx:63:2: error: #error this program requires bam.h, bgzf.h and libbam
The corresponding part in the source code of snpexp.cxx reads as (without line numbers):
60 #ifdef HAVE_BAM_H
61 #include <bam.h>
62 #else
63 #error this program requires bam.h, bgzf.h and libbam
64 #endif
which is exactly what the author stated in the README:
# Install
#
# Before building this project, you have to install libbam provided by Li et al. (http://samtools.sourceforge.net/).
# If you build SAMtools bam.h, bgzf.h and libbam.o files will appear in the directory. These files should be
# copied topaths for header files and library files typically at /usr/local/include/ and /usr/local/lib/.
#
# If these files are correctly installed, you can setup and build the program.
#
# ./configure
# make
#
# Built binaries can be installed your executable paths.
It seems I have those requirement installed, as a copy of the two files (bam.h, bgzf.h) have been copied to /usr/local/include which can be confirmed when I issued:
./configure
......
checking for zlib.h... yes
checking bam.h usability... yes
checking bam.h presence... yes
checking for bam.h... yes
And in the Makefile derived from the configuration above, it can be seen:
......
LIBS = -lz -lbam -lpthread
includedir = ${prefix}/include
prefix = /usr/local
......
And I do have those files in my system (Ubuntu 18.04):
/usr/local/lib/libbam.a
/usr/local/include/bam.h
/usr/local/include/bgzf.h
...
and the tools I used are:
GNU Make 4.1 Built for x86_64-pc-linux-gnu
g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
but I simply always got the error message. I have wrote to the author, maybe the package is a little bit old there is no update/response.
This may not have a simple answer, but I appreciate if anyone can point me the possible direction(s) that I could have missed. Thank you!