Installing Bam-Readcount
3
0
Entering edit mode
11.8 years ago
waihungh ▴ 20

I'm installing bam-readcount for my analysis. However, when I came to the last step in executing the command "make", error appeared as:

bamreadcount.cpp:4:17: fatal error: sam.h: No such file or directory compilation terminated.

make[2]: * [build/src/exe/bam-readcount/CMakeFiles/bam-readcount.dir/bamreadcount.cpp.o] Error 1

make[1]: * [build/src/exe/bam-readcount/CMakeFiles/bam-readcount.dir/all] Error 2

make: * [all] Error 2

Could anyone advice on how to proceed?

Thanks

• 8.5k views
ADD COMMENT
2
Entering edit mode
11.6 years ago
ron_veg ▴ 50

Hi,

I'm trying to install bam-readcount too. I followed the instructions but i keep getting an error at the last step: 'make' after the cmake command. Until that everything works fine.

The error appears as:

/home/schwessi/samtools-0.1.19/libbam.a(bgzf.o): In function `bgzf_mt':
/home/schwessi/samtools-0.1.19/bgzf.c:445: undefined reference to `pthread_create'
/home/schwessi/samtools-0.1.19/libbam.a(bgzf.o): In function `mt_destroy':
/home/schwessi/samtools-0.1.19/bgzf.c:458: undefined reference to `pthread_join'
collect2: ld returned 1 exit status
make[2]: *** [bin/bam-readcount] Error 1
make[1]: *** [build/src/exe/bam-readcount/CMakeFiles/bam-readcount.dir/all] Error 2
make: *** [all] Error 2

Any advice would be nice.

Thanks
Ron

ADD COMMENT
1
Entering edit mode

I updated the code to always link the platform threading library (pthreads on linux), so this shouldn't be an issue in the future.

ADD REPLY
0
Entering edit mode

Nevermind, fixed the problem. Apparently the installion doesnt work with samtools 0.1.19. Tried 0.1.17 and it worked.

ADD REPLY
0
Entering edit mode

Thanks for letting us know. I'll update the README to mention that 0.1.19 may not work.

ADD REPLY
1
Entering edit mode
11.8 years ago

The error message is complaining that you have not included the samtools library header (sam.h). Follow these instructions, and see if they help.

ADD COMMENT
0
Entering edit mode

I have followed the instructions but seems have problem linking with samtools

ADD REPLY
0
Entering edit mode

To help us troubleshoot, please provide more information:

  • your operating system version
  • the sequence of steps performed before running make
ADD REPLY
0
Entering edit mode
11.8 years ago
waihungh ▴ 20

It is ubuntu linux (Linux version 3.2.0-26-generic (buildd@batsu) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #41-Ubuntu SMP Thu Jun 14 17:49:24 UTC 2012).

I just follow the instruction of bam-readcount. After exporting SAMTOOLS_ROOT, I recursively clone the bam-readcount repository without error.

When I execute the cmake command, there was a warning:

WARNING: Target "bam-readcount" requests linking to directory "/software/sequencing/samtools_latest".  Targets may link only to libraries.  CMake is dropping the item.

When I further execute the make command, error appeared as:

[100%] Building CXX object build/src/exe/bam-readcount/CMakeFiles/bam-readcount.dir/bamreadcount.cpp.o
/home/danielho/bam-readcount/src/exe/bam-readcount/bamreadcount.cpp:1:0: warning: "_GNU_SOURCE" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
/home/danielho/bam-readcount/src/exe/bam-readcount/bamreadcount.cpp:4:17: fatal error: sam.h: No such file or directory
compilation terminated.
make[2]: *** [build/src/exe/bam-readcount/CMakeFiles/bam-readcount.dir/bamreadcount.cpp.o] Error 1
make[1]: *** [build/src/exe/bam-readcount/CMakeFiles/bam-readcount.dir/all] Error 2
make: *** [all] Error 2
ADD COMMENT
0
Entering edit mode

Can you append to your reply what you are setting SAMTOOLS_ROOT to and what the contents are, e.g. ls $SAMTOOLS_ROOT.

ADD REPLY
1
Entering edit mode
export SAMTOOLS_root=/software/sequencing/samtools_latest

The contents are:

AUTHORS   ChangeLog  examples  Makefile        misc  samtools    win32
bcftools  COPYING    INSTALL   Makefile.mingw  NEWS  samtools.1
ADD REPLY
1
Entering edit mode

I believe you should see sam.h in SAMTOOLS_ROOT so I suspect you may need to set it as, export SAMTOOLS_ROOT=/software/sequencing/samtools_latest/samtools.

ADD REPLY

Login before adding your answer.

Traffic: 1674 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6