Question: Trouble Installing Bamtools On Ubuntu
1
gravatar for Loki
7.6 years ago by
Loki30
Israel
Loki30 wrote:

I'm not sure if BioStars is the place to post this type of question, please let me know if I should have put it elsewhere.

I'm running Ubuntu 11.10 and am trying to install BAMTools.

I'm following the instructions but I seem to be getting a CMake error when running the 'Make' command:

> [  4%] Building CXX object
> src/api/CMakeFiles/BamTools.dir/BamReader.cpp.o In file included from
> /home/karen1/Downloads/bamtools-1.0.2/src/api/internal/BamReader_p.h:29:0,
>                  from /home/karen1/Downloads/bamtools-1.0.2/src/api/BamReader.cpp:11:
> /home/karen1/Downloads/bamtools-1.0.2/src/api/internal/BgzfStream_p.h:27:18:
> fatal error: zlib.h: No such file or directory compilation terminated.
> make[2]: *** [src/api/CMakeFiles/BamTools.dir/BamReader.cpp.o] Error 1
> make[1]: *** [src/api/CMakeFiles/BamTools.dir/all] Error 2 make: ***
> [all] Error 2

I saw this issue was posted previously and tried following the instructions by editing 'bamtools/src/api/CMakeLists.txt' and adding the line 'includedirectories(usr/lib/syslinux/com32/include)', which contains a zlib.h file, under the existing 'includedirectories' line (is zlib.h a system file? I saw several copies when I ran a search).

I ran 'Make' again and got a similar error at 7%:

> [  7%] Building CXX object
> src/api/CMakeFiles/BamTools.dir/BamReader.cpp.o In file included from
> /home/karen1/Downloads/bamtools-1.0.2/src/api/internal/BamReader_p.h:29:0,
>                  from /home/karen1/Downloads/bamtools-1.0.2/src/api/BamReader.cpp:11:
> /home/karen1/Downloads/bamtools-1.0.2/src/api/internal/BgzfStream_p.h:27:18:
> fatal error: zlib.h: No such file or directory compilation terminated.
> make[2]: *** [src/api/CMakeFiles/BamTools.dir/BamReader.cpp.o] Error 1
> make[1]: *** [src/api/CMakeFiles/BamTools.dir/all] Error 2 make: ***
> [all] Error 2 [1]+  Done                    gedit
> ../src/api/CMakeLists.txt

I'm clueless at this point. Any help or redirection to help would be appreciated.

• 8.2k views
ADD COMMENTlink modified 7.6 years ago by Jonathan Manning640 • written 7.6 years ago by Loki30

Try 'sudo apt-get install build-essential' and check if you have kernel headers installed.

ADD REPLYlink written 7.6 years ago by Niallhaslam2.3k
7
gravatar for Jonathan Manning
7.6 years ago by
Near Boston, MA
Jonathan Manning640 wrote:

You need zlib development headers, which are not installed by default (just the runtime library is typically installed).

On ubuntu: sudo apt-get install libz-dev

Don't hack the Makefile to use the syslinux version, as it may vary from the /usr/lib/libz.so implementation being linked to - the header must match the library.

ADD COMMENTlink written 7.6 years ago by Jonathan Manning640

this solved it for me. Thanks!

ADD REPLYlink written 7.6 years ago by Loki30
2
gravatar for Pierre Lindenbaum
7.6 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum124k wrote:

check that the zlib library and its developpement files (e.g. /usr/include/zlib.h or /usr/local/include/zlib.h ) is installed on your computer. http://zlib.net/

ADD COMMENTlink written 7.6 years ago by Pierre Lindenbaum124k
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: 1671 users visited in the last hour