Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

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

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


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


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


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


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


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


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


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

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

                  Comment


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

                    Comment


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


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


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


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


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

                              • seqadmin
                                Techniques and Challenges in Conservation Genomics
                                by seqadmin



                                The field of conservation genomics centers on applying genomics technologies in support of conservation efforts and the preservation of biodiversity. This article features interviews with two researchers who showcase their innovative work and highlight the current state and future of conservation genomics.

                                Avian Conservation
                                Matthew DeSaix, a recent doctoral graduate from Kristen Ruegg’s lab at The University of Colorado, shared that most of his research...
                                03-08-2024, 10:41 AM
                              • seqadmin
                                The Impact of AI in Genomic Medicine
                                by seqadmin



                                Artificial intelligence (AI) has evolved from a futuristic vision to a mainstream technology, highlighted by the introduction of tools like OpenAI's ChatGPT and Google's Gemini. In recent years, AI has become increasingly integrated into the field of genomics. This integration has enabled new scientific discoveries while simultaneously raising important ethical questions1. Interviews with two researchers at the center of this intersection provide insightful perspectives into...
                                02-26-2024, 02:07 PM

                              ad_right_rmr

                              Collapse

                              News

                              Collapse

                              Topics Statistics Last Post
                              Started by seqadmin, 03-14-2024, 06:13 AM
                              0 responses
                              33 views
                              0 likes
                              Last Post seqadmin  
                              Started by seqadmin, 03-08-2024, 08:03 AM
                              0 responses
                              72 views
                              0 likes
                              Last Post seqadmin  
                              Started by seqadmin, 03-07-2024, 08:13 AM
                              0 responses
                              81 views
                              0 likes
                              Last Post seqadmin  
                              Started by seqadmin, 03-06-2024, 09:51 AM
                              0 responses
                              68 views
                              0 likes
                              Last Post seqadmin  
                              Working...
                              X