Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • SeqVicious
    Member
    • Sep 2011
    • 20

    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.
  • Carlos Borroto
    Member
    • Mar 2011
    • 19

    #2
    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?

    Comment

    • SeqVicious
      Member
      • Sep 2011
      • 20

      #3
      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.

      Comment

      • SeqVicious
        Member
        • Sep 2011
        • 20

        #4
        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.

        Comment

        • Carlos Borroto
          Member
          • Mar 2011
          • 19

          #5
          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.

          Comment

          • SeqVicious
            Member
            • Sep 2011
            • 20

            #6
            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?

            Comment

            • Richard Finney
              Senior Member
              • Feb 2009
              • 701

              #7
              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.

              Comment

              • SeqVicious
                Member
                • Sep 2011
                • 20

                #8
                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?

                Comment

                • Richard Finney
                  Senior Member
                  • Feb 2009
                  • 701

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

                  If that does not work, try "./samtools.exe" .

                  Comment

                  • SeqVicious
                    Member
                    • Sep 2011
                    • 20

                    #10
                    Thank you for your help, it's all working now

                    Comment

                    • Brian E
                      Junior Member
                      • Oct 2010
                      • 5

                      #11
                      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.

                      Comment

                      • snakesgun
                        Junior Member
                        • Nov 2011
                        • 3

                        #12
                        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.

                        Comment

                        • pag
                          Member
                          • May 2012
                          • 72

                          #13
                          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

                          Comment

                          • pag
                            Member
                            • May 2012
                            • 72

                            #14
                            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?

                            Comment

                            • dalia12
                              Junior Member
                              • Aug 2012
                              • 1

                              #15
                              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

                              Comment

                              Latest Articles

                              Collapse

                              • SEQadmin2
                                From Collection to Sequencing: Why Sample Preparation and Preservation Define Sequencing Data
                                by SEQadmin2


                                Data variability is still an issue in sequencing technologies despite the advances in reproducibility and accuracy of these platforms. But the problem does not originate in the sequencing itself, but in the previous steps, before the sample reaches the sequencer.


                                The first step is collection, followed by preservation and sample preparation for analysis. Most scientists overlook those steps, but not being careful might just be skewing the experiment’s results.
                                ...
                                Yesterday, 10:05 AM
                              • SEQadmin2
                                Single-Cell Sequencing at an Inflection Point: Early Impacts of New Platforms and Emerging Trends
                                by SEQadmin2


                                With the launch of new single-cell sequencing platforms in 2026, the field stands at an exciting inflection point. This article surveys the most impactful advances in the field and discusses how they’re reshaping research in cancer, immunology, and beyond.


                                Introduction

                                Single-cell sequencing technologies have undergone remarkable advances over the past decade, transitioning from low-throughput experimental approaches to highly scalable platforms capable of...
                                05-22-2026, 06:42 AM
                              • SEQadmin2
                                Environmental Genomics in the Age of NGS: From Microbes to Conservation Strategies
                                by SEQadmin2

                                Studying ecosystems means dealing with complex, multi-species communities that are hard to observe at scale. This complexity, however, hides many important questions to be answered, from how biogeochemical cycles work and how climate change can affect species distribution to how conservation strategies can work best.


                                Genomics, particularly since the expansion of NGS, has transformed ecosystem ecology. By sequencing environmental DNA, we can now assess biodiversity without direct...
                                05-06-2026, 09:04 AM

                              ad_right_rmr

                              Collapse

                              News

                              Collapse

                              Topics Statistics Last Post
                              Started by SEQadmin2, Yesterday, 12:03 PM
                              0 responses
                              19 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, Yesterday, 11:40 AM
                              0 responses
                              14 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 05-28-2026, 11:40 AM
                              0 responses
                              29 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 05-26-2026, 10:12 AM
                              0 responses
                              31 views
                              0 reactions
                              Last Post SEQadmin2  
                              Working...