【问题标题】:How to compile and work samtools with cygwin如何使用 cygwin 编译和使用 samtools
【发布时间】:2015-01-29 23:23:16
【问题描述】:

我需要一些帮助来解决这个问题。在 Cygwin(windows 8 64 位)下编译 Samtools 时出现错误。

我收到以下消息:

管理员@用户 ~/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 

请告诉我出了什么问题以及我需要如何纠正它。我尝试对 Makefile 进行一些更改,例如 将 -D_CURSES_LIB=1 更改为 -D_CURSES_LIB=0 将 "LIBCURSES= -lcurses # -lXCurses" 更改为 "LIBCURSES= # -lcurses # -lXCurse

错误信息仍然存在,请帮助..

【问题讨论】:

  • 看来你必须为 zlib 安装开发包(仅仅拥有来自 Base 的运行时包是不够的)。

标签: cygwin samtools


【解决方案1】:

我遇到了同样的问题,通过以下步骤解决了:

启动Cygwin Installer,在“Select Package”页面,搜索并安装gcc-g++、gdb、make、libncurses、zlib、zlib-devel。

下载并提取 samtools。

-Dexpl=exp -Dlogl=log追加到Makefile默认的DFLAGS行,如:

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

运行 make clean 以清理以前的构建尝试。

然后运行make

将 samtools.exe 和 misc 文件夹复制到系统路径。或者对于 samtools 1.0 或更高版本,运行make install

请注意:samtools 现在位于version 1.1。你应该先试试。

更多信息请访问my blog

【讨论】:

  • 我试过这个,但它不起作用。我收到第一个错误说 bgzf.c:630:8:warning: variable 'count' set but not used [-Wunused-but-set-variable] 最后它说 make: *** [Makefile:25: all-recur] Error 1
猜你喜欢
  • 1970-01-01
  • 2015-06-13
  • 1970-01-01
  • 2013-09-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多