Thread: compiling standalone progs with sac libraries on 64-bit

Started: 2010-08-17 23:20:45
Last activity: 2010-08-17 23:20:45
Topics: SAC Help
Steve Sherburn
2010-08-17 23:20:45
(no body)
  • Dear Steve,

    You need to add the math library (libm) that contains pow.

    Add -lm to the end of the compile line or to LIB

    Brian

    On Aug 17, 2010, at 12:20 AM , Steve Sherburn wrote:

    Hi,

    I am trying to compile a standalone progam using the sac libraries
    on a machine running 64-bit Fedora 13. I have the most recent 64-bit
    executables, sac-101.4-linux-x86_64.

    my makefile contains
    LIB = -L/usr/local/sac/lib -lsacio
    sac2rsam: sac2rsam.o
    gcc -c sac2rsam.c -o sac2rsam.o $(LIB)
    gcc -o sac2rsam sac2rsam.o $(LIB)

    This gives an error:
    make sac2rsam
    gcc -c sac2rsam.c -o sac2rsam.o -L/usr/local/sac/lib -lsacio
    gcc -o sac2rsam sac2rsam.o -L/usr/local/sac/lib -lsacio
    /usr/local/sac/lib/libsacio.a(math.o): In function `powi':
    math.c:(.text+0xf1): undefined reference to `pow'
    collect2: ld returned 1 exit status
    make: *** [sac2rsam] Error 1

    If I assume sacio is 32-bit and add -m32 after gcc in my makefile I
    get a different error:
    make sac2rsam
    gcc -m32 -c sac2rsam.c -o sac2rsam.o -L/usr/local/sac/lib -lsacio
    In file included from /usr/include/features.h:385,
    from /usr/include/stdio.h:28,
    from sac2rsam.c:5:
    /usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file
    or directory
    make: *** [sac2rsam] Error 1

    Does anyone know how I should proceed?

    Many thanks


    Steven Sherburn
    GNS Science
    Wairakei
    New Zealand

    Notice: This email and any attachments are confidential. If received
    in error please destroy and immediately notify us. Do not copy or
    disclose the contents.




    _______________________________________________
    sac-help mailing list
    sac-help<at>iris.washington.edu
    http://www.iris.washington.edu/mailman/listinfo/sac-help


  • Hi

    Does you have the necessary files to compile 32bits code installed in your
    fedora ? Normally you would need some 32 bits header files. Something like
    libc32-dev, or libgcc32-dev or something like this ....

    regards,

    Marcelo
    --
    Mobile ~ +55 11 8384 9207
    http://sites.google.com/site/foo4funreborn/


    2010/8/17 Steve Sherburn <S.Sherburn<at>gns.cri.nz>

    Hi,

    I am trying to compile a standalone progam using the sac libraries on a
    machine running 64-bit Fedora 13. I have the most recent 64-bit executables,
    sac-101.4-linux-x86_64.

    my makefile contains
    LIB = -L/usr/local/sac/lib -lsacio
    sac2rsam: sac2rsam.o
    gcc -c sac2rsam.c -o sac2rsam.o $(LIB)
    gcc -o sac2rsam sac2rsam.o $(LIB)

    This gives an error:
    make sac2rsam
    gcc -c sac2rsam.c -o sac2rsam.o -L/usr/local/sac/lib -lsacio
    gcc -o sac2rsam sac2rsam.o -L/usr/local/sac/lib -lsacio
    /usr/local/sac/lib/libsacio.a(math.o): In function `powi':
    math.c:(.text+0xf1): undefined reference to `pow'
    collect2: ld returned 1 exit status
    make: *** [sac2rsam] Error 1

    If I assume sacio is 32-bit and add -m32 after gcc in my makefile I get a
    different error:
    make sac2rsam
    gcc -m32 -c sac2rsam.c -o sac2rsam.o -L/usr/local/sac/lib -lsacio
    In file included from /usr/include/features.h:385,
    from /usr/include/stdio.h:28,
    from sac2rsam.c:5:
    /usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or
    directory
    make: *** [sac2rsam] Error 1

    Does anyone know how I should proceed?

    Many thanks


    Steven Sherburn
    GNS Science
    Wairakei
    New Zealand

    Notice: This email and any attachments are confidential. If received in
    error please destroy and immediately notify us. Do not copy or disclose the
    contents.

    _______________________________________________
    sac-help mailing list
    sac-help<at>iris.washington.edu
    http://www.iris.washington.edu/mailman/listinfo/sac-help



18:25:40 v.9bc884e1