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
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 REPLY
• link
updated 5.1 years ago by
Ram
44k
•
written 11.8 years ago by
waihungh
▴
20
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.
I updated the code to always link the platform threading library (pthreads on linux), so this shouldn't be an issue in the future.
Nevermind, fixed the problem. Apparently the installion doesnt work with samtools 0.1.19. Tried 0.1.17 and it worked.
Thanks for letting us know. I'll update the README to mention that 0.1.19 may not work.