Trouble Installing Bamtools On Ubuntu
2
1
Entering edit mode
12.4 years ago
Loki ▴ 30

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.

• 10k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
7
Entering edit mode
12.4 years ago

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 COMMENT
0
Entering edit mode

this solved it for me. Thanks!

ADD REPLY
2
Entering edit mode
12.4 years ago

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 COMMENT

Login before adding your answer.

Traffic: 1272 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