Question: Installing Bam-Readcount
0
gravatar for waihungh
7.8 years ago by
waihungh20
waihungh20 wrote:

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

• 6.1k views
ADD COMMENTlink modified 7.6 years ago by ron_veg50 • written 7.8 years ago by waihungh20
2
gravatar for ron_veg
7.6 years ago by
ron_veg50
ron_veg50 wrote:

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 COMMENTlink modified 13 months ago by RamRS30k • written 7.6 years ago by ron_veg50
1

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 REPLYlink written 7.5 years ago by tgi.tabbott230

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

ADD REPLYlink written 7.6 years ago by ron_veg50

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

ADD REPLYlink written 7.6 years ago by nnutter210
1
gravatar for Cyriac Kandoth
7.8 years ago by
Cyriac Kandoth5.5k
Memorial Sloan Kettering, New York, USA
Cyriac Kandoth5.5k wrote:

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 COMMENTlink written 7.8 years ago by Cyriac Kandoth5.5k

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

ADD REPLYlink written 7.8 years ago by waihungh20

To help us troubleshoot, please provide more information:

  • your operating system version
  • the sequence of steps performed before running make
ADD REPLYlink modified 7.8 years ago • written 7.8 years ago by Cyriac Kandoth5.5k
0
gravatar for waihungh
7.8 years ago by
waihungh20
waihungh20 wrote:

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 COMMENTlink modified 13 months ago by RamRS30k • written 7.8 years ago by waihungh20

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

ADD REPLYlink written 7.8 years ago by nnutter210
1
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 REPLYlink modified 13 months ago by RamRS30k • written 7.8 years ago by waihungh20
1

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 REPLYlink modified 7.8 years ago • written 7.8 years ago by nnutter210
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1806 users visited in the last hour