Error compiling from SVN under Fedora20

terryb
2014-06-06
2014-06-11
  • terryb
    terryb
    2014-06-06

    Hi,

    I have obtained io_lib and staden from the current SVN and am trying to compile under Fedora20. io_lib compiles with no errors but I get an error when compiling staden. configure runs without error. Here is the call to gcc that results in the error:

    gcc -L/home/terry/temp/staden/staden/trunk/src/build.myhost/lib -Wl,-rpath,/home/terry/bin/staden/staden-head/lib/staden -o tg_index.bin tg_iface_g.o b+tree2.o hache_table.o tg_gio.o tg_cache.o tg_contig.o tg_sequence.o tg_track.o tg_bin.o tg_utils.o tg_register.o tg_tracks.o tg_anno.o tg_library.o tg_scaffold.o tg_check.o actf.o zfio.o gap_cli_arg.o tg_tcl.o tg_index.o  -lgap5   -lprimer3  -lz -llzma  -ltk_utils   -lseq_utils  -L/usr/lib64 -ltk8.5 -L/usr/lib64 -ltcl8.5 -lX11 -lXft -lfreetype   -ldl  -lieee -lm  -lmisc  -L/home/terry/bin/staden-io_lib/staden-io_lib-head/lib -lstaden-read  -lm -lpthread -llzma   -lcurl -lz  -lm   
    /home/terry/temp/staden/staden/trunk/src/build.myhost/lib/libgap5.so: undefined reference to `sam_hdr_add'
    /home/terry/temp/staden/staden/trunk/src/build.myhost/lib/libgap5.so: undefined reference to `bam_aux_iter'
    /home/terry/temp/staden/staden/trunk/src/build.myhost/lib/libgap5.so: undefined reference to `scram_put_seq'
    /home/terry/temp/staden/staden/trunk/src/build.myhost/lib/libgap5.so: undefined reference to `scram_next_seq'
    /home/terry/temp/staden/staden/trunk/src/build.myhost/lib/libgap5.so: undefined reference to `scram_line'
    /home/terry/temp/staden/staden/trunk/src/build.myhost/lib/libgap5.so: undefined reference to `bam_add_raw'
    /home/terry/temp/staden/staden/trunk/src/build.myhost/lib/libgap5.so: undefined reference to `scram_write_header'
    /home/terry/temp/staden/staden/trunk/src/build.myhost/lib/libgap5.so: undefined reference to `scram_open'
    /home/terry/temp/staden/staden/trunk/src/build.myhost/lib/libgap5.so: undefined reference to `scram_set_option'
    /home/terry/temp/staden/staden/trunk/src/build.myhost/lib/libgap5.so: undefined reference to `scram_close'
    /home/terry/temp/staden/staden/trunk/src/build.myhost/lib/libgap5.so: undefined reference to `sam_hdr_find_key'
    /home/terry/temp/staden/staden/trunk/src/build.myhost/lib/libgap5.so: undefined reference to `bam_aux_find'
    /home/terry/temp/staden/staden/trunk/src/build.myhost/lib/libgap5.so: undefined reference to `scram_get_header'
    /home/terry/temp/staden/staden/trunk/src/build.myhost/lib/libgap5.so: undefined reference to `scram_set_header'
    /home/terry/temp/staden/staden/trunk/src/build.myhost/lib/libgap5.so: undefined reference to `bam_aux_add_data'
    /home/terry/temp/staden/staden/trunk/src/build.myhost/lib/libgap5.so: undefined reference to `sam_hdr_find_rg'
    /home/terry/temp/staden/staden/trunk/src/build.myhost/lib/libgap5.so: undefined reference to `sam_hdr_name2ref'
    /home/terry/temp/staden/staden/trunk/src/build.myhost/lib/libgap5.so: undefined reference to `sam_hdr_parse'
    /home/terry/temp/staden/staden/trunk/src/build.myhost/lib/libgap5.so: undefined reference to `bam_construct_seq'
    collect2: error: ld returned 1 exit status
    make[1]: *** [tg_index.bin] Error 1
    make[1]: Leaving directory `/home/terry/temp/staden/staden/trunk/src/build.myhost/gap5'
    make: *** [gap5] Error 2
    

    Any help would be appreciated.

    Thanks, Terry

     
    • James Bonfield
      James Bonfield
      2014-06-06

      Hello Terry,
      On Fri, Jun 06, 2014 at 12:55:17AM +0000, terryb wrote:

      I have obtained io_lib and staden from the current SVN and am trying
      to compile under Fedora20. io_lib compiles with no errors but I get an
      error when compiling staden. configure runs without error. Here is the
      call to gcc that results in the error:
      ...
      /home/terry/temp/staden/staden/trunk/src/build.myhost/lib/libgap5.so: undefined reference to sam_hdr_add' /home/terry/temp/staden/staden/trunk/src/build.myhost/lib/libgap5.so: undefined reference tobam_aux_iter'

      All these functions are in io_lib (aka libstaden-read.so), but only in
      the newer versions.

      Did you do a make install in io_lib before moving on to do the Staden
      package build?

      gcc -L/home/terry/temp/staden/staden/trunk/src/build.myhost/lib -Wl,-rpath,/home/terry/bin/staden/staden-head/lib/staden -o tg_index.bin tg_iface_g.o b+tree2.o hache_table.o tg_gio.o tg_cache.o tg_contig.o tg_sequence.o tg_track.o tg_bin.o tg_utils.o tg_register.o tg_tracks.o tg_anno.o tg_library.o tg_scaffold.o tg_check.o actf.o zfio.o gap_cli_arg.o tg_tcl.o tg_index.o -lgap5 -lprimer3 -lz -llzma -ltk_utils -lseq_utils -L/usr/lib64 -ltk8.5 -L/usr/lib64 -ltcl8.5 -lX11 -lXft -lfreetype -ldl -lieee -lm -lmisc -L/home/terry/bin/staden-io_lib/staden-io_lib-head/lib -lstaden-read -lm -lpthread -llzma -lcurl -lz -lm

      Ie here you have /home/terry/bin/staden-io_lib/staden-io_lib-head/lib
      -lstaden-read as the link line. Does that have the new io_lib build
      in there yet?

      If so I'm scratching my head as to why it doesn't contain these
      symbols.

      Regards,

      James

      --
      James Bonfield (jkb@sanger.ac.uk) | Hora aderat briligi. Nunc et Slythia Tova
      | Plurima gyrabant gymbolitare vabo;
      A Staden Package developer: | Et Borogovorum mimzebant undique formae,
      https://sf.net/projects/staden/ | Momiferique omnes exgrabure Rathi.

      --
      The Wellcome Trust Sanger Institute is operated by Genome Research
      Limited, a charity registered in England with number 1021457 and a
      company registered in England with number 2742969, whose registered
      office is 215 Euston Road, London, NW1 2BE.

       
      • terryb
        terryb
        2014-06-10

        Hi James,

        Did you do a make install in io_lib before moving on to do the Staden
        package build?

        Yes I did.

        Ie here you have /home/terry/bin/staden-io_lib/staden-io_lib-head/lib
        -lstaden-read as the link line. Does that have the new io_lib build
        in there yet?

        The directory /home/terry/bin/staden-io_lib/staden-io_lib-head/lib contains the following:
        libstaden-read.a
        libstaden-read.la
        libstaden-read.so (link to libstaden-read.so.1.5.1)
        libstaden-read.so.1 (link to libstaden-read.so.1.5.1)
        libstaden-read.so.1.5.1

        I tried from scratch this morning (in case it was a Friday-thing) but got the same error.

        Cheers
        Terry

         
        • James Bonfield
          James Bonfield
          2014-06-10

          Hello Terry,

          On Tue, Jun 10, 2014 at 01:33:57AM +0000, terryb wrote:

          The directory /home/terry/bin/staden-io_lib/staden-io_lib-head/lib contains the following:
          libstaden-read.a
          libstaden-read.la
          libstaden-read.so (link to libstaden-read.so.1.5.1)
          libstaden-read.so.1 (link to libstaden-read.so.1.5.1)
          libstaden-read.so.1.5.1

          I tried from scratch this morning (in case it was a Friday-thing) but got the same error.

          Ok so it's not the obvious, sorry.

          Could you try doing "nm
          /home/terry/bin/staden-io_lib/staden-io_lib-head/lib/libstaden-read.so"
          and looking for the missing symbols, eg sam_hdr_add, scram_open, etc?
          I assume that given the compiler errors they do not exist.

          If so this implies that io_lib itself has failed to build correctly,
          possibly due to some missing dependency (in which case the configure
          script needs some amendments to make it more explicit). The output
          from ./configure in io_lib could be useful, along with the config.log
          file. If you're not willing to post these publically here then please
          email to jkb@sanger.ac.uk.

          James

          --
          James Bonfield (jkb@sanger.ac.uk) | Hora aderat briligi. Nunc et Slythia Tova
          | Plurima gyrabant gymbolitare vabo;
          A Staden Package developer: | Et Borogovorum mimzebant undique formae,
          https://sf.net/projects/staden/ | Momiferique omnes exgrabure Rathi.

          --
          The Wellcome Trust Sanger Institute is operated by Genome Research
          Limited, a charity registered in England with number 1021457 and a
          company registered in England with number 2742969, whose registered
          office is 215 Euston Road, London, NW1 2BE.

           
          • terryb
            terryb
            2014-06-11

            Hi James,

            Could you try doing "nm
            /home/terry/bin/staden-io_lib/staden-io_lib-head/lib/libstaden-read.so"
            and looking for the missing symbols, eg sam_hdr_add, scram_open, etc?
            I assume that given the compiler errors they do not exist.

            The symbols do exist.

            I have emailed you the files as requested.

            Many thanks for your help
            Terry

             
  • James Bonfield
    James Bonfield
    2014-06-11

    We have the likely culprit now.

    The link line which is failing (tg_index) contains:

     -lgap5 -lprimer3 -lz -llzma -ltk_utils -lseq_utils -L/usr/lib64 -ltk8.5 -L/usr/lib64 -ltcl8.5 -lX11 -lXft -lfreetype -ldl -lieee -lm -lmisc -L/home/terry/bin/staden-io_lib/staden-io_lib-head/lib -lstaden-read -lm -lpthread -llzma -lcurl -lz -lm
    

    Note the -L/usr/lib64 -ltcl8.5 before the -Lhome/terry/bin/staden-io_lib/staden-io_lib-head/lib -lstaden-read

    This works provided you don't happen to have a copy of libstaden-read.so in /usr/lib64/, which I assume you do. (yum get install staden-io_lib will put one there.)

    There are two work arounds for now.

    1) Removed the system installed staden-io_lib package.
    2) Edit your system.mk in the local staden source directory and remove the -L/usr/lib64 part in TCL_LIB and TK_LIB definitions.

    The explicit directories being listed shouldn't be necessary on modern RedHat equivalents, although I'm not 100% certain given their strong urge to put 32-bit libraries in /usr/lib instead of /usr/lib64. Either way the configure script ought to check whether the explicit -L path is a requirement, to avoid this sort of problem from happening.

    James

     
    • terryb
      terryb
      2014-06-11

      Hi James,

      Yes there is a copy libstaden-read.so in /usr/lib64/ but I wonder if it was part of the distro as I don't recall having installed it.

      cheers
      Terry

       
  • James Bonfield
    James Bonfield
    2014-06-11

    The latest SVN commit for src/gap5/Makefile should have resolved this issue too now by juggling the link line order.

    Thanks for reporting the issue.

     
    • terryb
      terryb
      2014-06-11

      I can confirm that the update resolves the issue.

      Thanks for taking the time to help with my problem

      Cheers
      Terry