1

I need some help to resolve this problem. I got an error when I compiled Samtools under Cygwin (windows 8 64 bit).

I got the following message:

ADMIN@USER ~/samtools-0.1.19

$ make    
make[1]: Entering directory '/cygdrive/c/Users/ADMIN/Cygwin/home/samtools-0.1.19'    
make[2]: Entering directory '/cygdrive/c/Users/ADMIN/Cygwin/home/samtools-0.1.19'    
gcc -c -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -DBGZF_CACHE -I. bgzf.c -o bgzf.o    
In file included from bgzf.c:32:0:    
bgzf.h:33:18: fatal error: zlib.h: No such file or directory    
#include <zlib.h>        
^         
compilation terminated.    
Makefile:56: recipe for target 'bgzf.o' failed    
make[2]: *** [bgzf.o] Error 1
make[2]: Leaving directory '/cygdrive/c/Users/ADMIN/Cygwin/home/samtools-0.1.19'
Makefile:27: recipe for target 'lib-recur' failed
make[1]: *** [lib-recur] Error 1
make[1]: Leaving directory '/cygdrive/c/Users/ADMIN/Cygwin/home/samtools-0.1.19'
Makefile:27: recipe for target 'all-recur' failed
make: *** [all-recur] Error 1 

please tell me what went wrong and how I need to correct it. I tried to make a few changes to the Makefile like changed the -D_CURSES_LIB=1 to -D_CURSES_LIB=0 changed "LIBCURSES= -lcurses # -lXCurses" to "LIBCURSES= # -lcurses # -lXCurse

the error message still continues, please help..

azalea
  • 11,402
  • 3
  • 35
  • 46
user3455175
  • 11
  • 1
  • 2
  • 2
    Looks like you have to install the development package for zlib (just having the runtime one from Base is not enough). – fvu Mar 24 '14 at 11:50

1 Answers1

2

I had the same issue, and solved it with the following steps:

Start the Cygwin Installer, in the "Select Package" page, search and install gcc-g++, gdb, make, libncurses, zlib, zlib-devel.

Download and extract samtools.

Append -Dexpl=exp -Dlogl=log to Makefile's default DFLAGS line, such as:

DFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_CURSES_LIB=1 -Dexpl=exp -Dlogl=log

Run make clean to clean up previous build attempts.

Then run make.

Copy samtools.exe and misc folder to the system path. Or for samtools version 1.0 or later, run make install.

Please note: samtools is now in version 1.1. You should try it first.

More information is on my blog.

azalea
  • 11,402
  • 3
  • 35
  • 46
  • I tried this, but it's not working. I'm getting a first error saying `bgzf.c:630:8:warning: variable 'count' set but not used [-Wunused-but-set-variable]` At the end it says `make: *** [Makefile:25: all-recur] Error 1` – oaklander114 Oct 31 '16 at 01:19