SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samtools installation problem under Cygwin fbhe Bioinformatics 34 08-05-2014 07:26 PM
SAMtools installation kaushal25 Bioinformatics 23 03-18-2014 11:56 PM
samtools installation error; gzopen64 poisson200 Bioinformatics 1 06-30-2011 02:56 AM
samtools installation rdu Bioinformatics 4 08-27-2010 11:18 AM
Orthomcl Installation Canadian_philosophy Bioinformatics 0 07-29-2010 07:36 AM

Reply
 
Thread Tools
Old 01-27-2012, 08:14 AM   #1
SeqVicious
Member
 
Location: New Hampshire

Join Date: Sep 2011
Posts: 15
Default Samtools installation

Hi all,

I'm very new to bioinformatics and all I'm trying to do is index a bam file so I can view the pileup in IGV. I've downloaded the latest version of samtools unpacked it successfully. I'm now trying to install it but I'm running into an error after the 'make samtools' command. Make clean works just fine but the following error occurs after 'make samtools'.

$ make samtools
make[1]: Entering directory <path>
gcc -c -g -Wall -O2 -D_FILE_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. bgzf.o
In file included from bgzf.c:36:0:
gbzf.h:29:28: fatal error: zlib.h: No such file or directory
compilation terminated
Makefile:21: recipe for target 'bgzf.o' failed
make[1]: *** [bgzf.o] Error 1
make[1]: Leaving directory <path>
$CC= gcc
gcc: no input filesr] Error 1

It looks like it's having trouble with one of the files. Since I only need to be using a few of the samtools options can I just delete the files that give problems? I've also tried redownloading samtools a couple of times and the same error shows up.
SeqVicious is offline   Reply With Quote
Old 01-27-2012, 08:21 AM   #2
Carlos Borroto
Member
 
Location: Baltimore, MD

Join Date: Mar 2011
Posts: 19
Default

Quote:
Originally Posted by SeqVicious View Post
gbzf.h:29:28: fatal error: zlib.h: No such file or directory
Hi, you don't have zlib in your system. Could you tell me in what operating system are you installing Samtools?
Carlos Borroto is offline   Reply With Quote
Old 01-27-2012, 08:28 AM   #3
SeqVicious
Member
 
Location: New Hampshire

Join Date: Sep 2011
Posts: 15
Default

I'm on windows 7 and I'm using cygwin. I just installed zlib by updating cygwin and the command got much further. This time curses.h failed and the command was terminated. I'll try installing curses.h to see if that works.
SeqVicious is offline   Reply With Quote
Old 01-27-2012, 08:36 AM   #4
SeqVicious
Member
 
Location: New Hampshire

Join Date: Sep 2011
Posts: 15
Default

I installed anything with the name 'curses' in it during the cygwin installation and I'm still getting the following right before termination.

gcc -c -g -Wall -O2 -D_FILE_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. bam_tview.c -o bam_tview.o
bam_tview.c:5:20: fatal error: curses.h: No such file or directory
compilation terminated
makefile:21: recipe for target 'bam_tview.o' failed
make:** [bam_tview.o] Error 1

I can't find curses.h to install in cygwin. I don't know what else to do from here.
SeqVicious is offline   Reply With Quote
Old 01-27-2012, 08:41 AM   #5
Carlos Borroto
Member
 
Location: Baltimore, MD

Join Date: Mar 2011
Posts: 19
Default

Sorry I don't use cygwin so I won't be of much help. Did you try installing libncurses-devel? I see there are several packages in cygwin for it.
Carlos Borroto is offline   Reply With Quote
Old 01-27-2012, 08:59 AM   #6
SeqVicious
Member
 
Location: New Hampshire

Join Date: Sep 2011
Posts: 15
Default

Thanks for trying, Carlos.

I found a fix suggested on another post but I have no idea how to implement it. The fix is adding

CC= gcc
CFLAGS= -g -Wall -O2 #-m64 #-arch ppc
CFLAGS= -I/usr/include/ncurses
DFLAGS= -D_FILE_OFFSET_BITS=64 -D_USE_KNETFILE -D_CURSES_LIB=1 -Dexpl=exp -Dlogl=log
KNETFILE_O= knetfile.o

to Makefile. I found three makefiles and none of them had any CFLAGS in the file. Is it even possible to install samtools on windows?
SeqVicious is offline   Reply With Quote
Old 01-27-2012, 09:42 AM   #7
Richard Finney
Senior Member
 
Location: bethesda

Join Date: Feb 2009
Posts: 526
Default

CFLAGS should be on the second line of the make file (Makefile)...

Makefile should be modified like this ...
CFLAGS= -g -Wall -O2 -I/usr/include/ncurses
DFLAGS= -D_FILE_OFFSET_BITS=64 -D_USE_KNETFILE -D_CURSES_LIB=1 -Dexpl=exp -Dlogl=log

You'll also need to append the text -Dexpl=exp -Dlogl=log to the DFLAGS line the Makefile in bcftools


ALSO !!!! run "make clean" or remove all the .o (object) files before re-making.
Richard Finney is offline   Reply With Quote
Old 01-27-2012, 12:15 PM   #8
SeqVicious
Member
 
Location: New Hampshire

Join Date: Sep 2011
Posts: 15
Default

Thank you Richard Finney. I just made these corrections and the make samtools command finished. Unfortunately, when I try to use samtools the samtools command cannot be found. Did something go wrong when I made the executable?
SeqVicious is offline   Reply With Quote
Old 01-27-2012, 12:20 PM   #9
Richard Finney
Senior Member
 
Location: bethesda

Join Date: Feb 2009
Posts: 526
Default

type "./samtools" (from cygwin) in the directory you made samools in.

If that does not work, try "./samtools.exe" .
Richard Finney is offline   Reply With Quote
Old 01-27-2012, 12:32 PM   #10
SeqVicious
Member
 
Location: New Hampshire

Join Date: Sep 2011
Posts: 15
Default

Thank you for your help, it's all working now
SeqVicious is offline   Reply With Quote
Old 03-09-2012, 01:22 PM   #11
Brian E
Junior Member
 
Location: DC metro area

Join Date: Oct 2010
Posts: 5
Default

I had a similar problem with getting samtools to work on Cygwin, only my error was:

bam_tview.c:5:20: fatal error: curses.h: No such file or directory

The fix was modifying the makefiles as Richard Finney suggested.
Thanks Richard.
Brian E is offline   Reply With Quote
Old 03-09-2012, 04:10 PM   #12
snakesgun
Junior Member
 
Location: Beijing

Join Date: Nov 2011
Posts: 3
Default

I find another solution of this problem. Before compiling samtools, we can fix the 16th line of Makefile like this"LIBCURSES= -lncurses # -lXCurses". P.S. My operating system is openSUSE.
snakesgun is offline   Reply With Quote
Old 07-16-2012, 01:18 PM   #13
pag
Member
 
Location: CA, USA

Join Date: May 2012
Posts: 72
Default

I followed this advice, but I get
In file included from /usr/include/math.h:146:0,
from bam_md.c:5:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:101:1: error: conflicting types for ‘exp’
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:110:1: error: conflicting types for ‘log’

Linux *** 3.2.0-26-generic-tuxonice #41~ppa3-Ubuntu SMP Wed Jul 11 19:04:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
pag is offline   Reply With Quote
Old 07-16-2012, 01:59 PM   #14
pag
Member
 
Location: CA, USA

Join Date: May 2012
Posts: 72
Default

may have solved this one
sudo ln -s /lib/x86_64-linux-gnu/libncurses.so.5 /lib/x86_64-linux-gnu/libncurses.so

CFLAGS= -g -Wall -O2 -I/usr/include/ncurses #-m64 #-arch ppc
DFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=0
LIBCURSES= -lncurses # -lXCurses


I also installed libcurses-perl and zlib-bin via ubuntu software center prior to getting this to work

note that
$ make test
make: *** No rule to make target `test'. Stop.
$ make check
make: *** No rule to make target `check'. Stop.
$ make install
make: *** No rule to make target `install'. Stop.

so, just the "make" itself is enough to install it?
pag is offline   Reply With Quote
Old 08-24-2012, 07:03 AM   #15
dalia12
Junior Member
 
Location: Belguim

Join Date: Aug 2012
Posts: 1
Default daliya

I'm also using cygwin and followed the advices above (changed the Makefile, installed ncurses, zlib), but still got the error:

bgzf.h:29:18: zlib.h: No such file or directory
bgzf.c: In function `open_write':
bgzf.c:186: error: `Z_DEFAULT_COMPRESSION' undeclared (first use in this functio n)
bgzf.c:186: error: (Each undeclared identifier is reported only once
bgzf.c:186: error: for each function it appears in.)
bgzf.c: In function `deflate_block':
bgzf.c:297: error: `z_stream' undeclared (first use in this function)
bgzf.c:297: error: parse error before "zs"
bgzf.c:298: error: `zs' undeclared (first use in this function)
bgzf.c:305: error: `Z_DEFLATED' undeclared (first use in this function)
bgzf.c:306: error: `Z_DEFAULT_STRATEGY' undeclared (first use in this function)
bgzf.c:307: error: `Z_OK' undeclared (first use in this function)
bgzf.c:311: error: `Z_FINISH' undeclared (first use in this function)
bgzf.c:312: error: `Z_STREAM_END' undeclared (first use in this function)
bgzf.c: In function `inflate_block':
bgzf.c:371: error: `z_stream' undeclared (first use in this function)
bgzf.c:371: error: parse error before "zs"
bgzf.c:373: error: `zs' undeclared (first use in this function)
bgzf.c:381: error: `Z_OK' undeclared (first use in this function)
bgzf.c:385: error: `Z_FINISH' undeclared (first use in this function)
bgzf.c:386: error: `Z_STREAM_END' undeclared (first use in this function)
bgzf.c: In function `check_header':
bgzf.c:405: error: `Z_DEFLATED' undeclared (first use in this function)
Makefile:22: recipe for target `bgzf.o' failed
make[2]: *** [bgzf.o] Error 1
make[2]: Leaving directory `/samtools-0.1.18'
Makefile:25: recipe for target `lib-recur' failed
make[1]: *** [lib-recur] Error 1
make[1]: Leaving directory `/samtools-0.1.18'
Makefile:25: recipe for target `all-recur' failed
make: *** [all-recur] Error 1

I installed everything with the name zlib, but cannot get further
dalia12 is offline   Reply With Quote
Old 03-12-2013, 11:36 AM   #16
Philcolson
Member
 
Location: New York

Join Date: Jul 2012
Posts: 12
Default

If anyone has solved the error: conflicting types for 'exp' or the equivalent for 'log', I'd be incredibly grateful.
Philcolson is offline   Reply With Quote
Old 03-12-2013, 06:07 PM   #17
Richard Finney
Senior Member
 
Location: bethesda

Join Date: Feb 2009
Posts: 526
Default

Is the conflicting types a warning or an error ?
Can you display the full message?

If it's just a warning, don't worry about it.
Richard Finney is offline   Reply With Quote
Old 03-13-2013, 08:15 AM   #18
Philcolson
Member
 
Location: New York

Join Date: Jul 2012
Posts: 12
Default

phil@phil:~/Desktop/samtools-0.1.18$ make
make[1]: Entering directory `/home/phil/Desktop/samtools-0.1.18'
make[2]: Entering directory `/home/phil/Desktop/samtools-0.1.18'
gcc -c -g -Wall -O2 -I/usr/include/ncurses -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -Dexpl=exp -Dlogl=log -I. bgzf.c -o bgzf.o
bgzf.c: In function ‘bgzf_close’:
bgzf.c:630:8: warning: variable ‘count’ set but not used [-Wunused-but-set-variable]
gcc -c -g -Wall -O2 -I/usr/include/ncurses -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -Dexpl=exp -Dlogl=log -I. kstring.c -o kstring.o
gcc -c -g -Wall -O2 -I/usr/include/ncurses -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -Dexpl=exp -Dlogl=log -I. bam_aux.c -o bam_aux.o
gcc -c -g -Wall -O2 -I/usr/include/ncurses -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -Dexpl=exp -Dlogl=log -I. bam.c -o bam.o
gcc -c -g -Wall -O2 -I/usr/include/ncurses -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -Dexpl=exp -Dlogl=log -I. bam_import.c -o bam_import.o
gcc -c -g -Wall -O2 -I/usr/include/ncurses -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -Dexpl=exp -Dlogl=log -I. sam.c -o sam.o
gcc -c -g -Wall -O2 -I/usr/include/ncurses -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -Dexpl=exp -Dlogl=log -I. bam_index.c -o bam_index.o
bam_index.c: In function ‘bam_index_load_core’:
bam_index.c:330:7: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
bam_index.c:337:7: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
bam_index.c:350:8: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
bam_index.c:353:9: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
bam_index.c:357:9: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
bam_index.c:361:9: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
bam_index.c:371:8: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
bam_index.c:375:8: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
gcc -c -g -Wall -O2 -I/usr/include/ncurses -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -Dexpl=exp -Dlogl=log -I. bam_pileup.c -o bam_pileup.o
bam_pileup.c: In function ‘resolve_cigar2’:
bam_pileup.c:75:9: warning: variable ‘is_head’ set but not used [-Wunused-but-set-variable]
gcc -c -g -Wall -O2 -I/usr/include/ncurses -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -Dexpl=exp -Dlogl=log -I. bam_lpileup.c -o bam_lpileup.o
gcc -c -g -Wall -O2 -I/usr/include/ncurses -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -Dexpl=exp -Dlogl=log -I. bam_md.c -o bam_md.o
In file included from /usr/include/math.h:146:0,
from bam_md.c:5:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:101:1: error: conflicting types for ‘exp’
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:110:1: error: conflicting types for ‘log’
make[2]: *** [bam_md.o] Error 1
make[2]: Leaving directory `/home/phil/Desktop/samtools-0.1.18'
make[1]: *** [lib-recur] Error 1
make[1]: Leaving directory `/home/phil/Desktop/samtools-0.1.18'
make: *** [all-recur] Error 1
Philcolson is offline   Reply With Quote
Old 03-13-2013, 08:17 AM   #19
Philcolson
Member
 
Location: New York

Join Date: Jul 2012
Posts: 12
Default

I don't quite know what's important, so there's all of it.
Philcolson is offline   Reply With Quote
Old 03-13-2013, 08:29 AM   #20
Philcolson
Member
 
Location: New York

Join Date: Jul 2012
Posts: 12
Default

Figured it out! I put in, from somewhere I found online, the -Dexpl=exp -Dlogl=log line in DFLAGS. Got rid of that and it worked! Thanks!
Philcolson is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 03:59 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.