Thread: problems with sacio.a on the mac

Started: 2006-03-09 01:45:00
Last activity: 2006-03-10 17:38:05
Topics: SAC Help
Arthur Snoke
2006-03-09 01:45:00
I am trying to port (fortran) programs using sacio from sun solaris to
both the mac and linux. Things seem to work on linux, but not on the mac.
Hopefully someone has some insights to share.

OS 10.4.5 gcc 4 g77 (but not built for gcc 4).
sacio.a built on February 18 this year.
Simple program:

PROGRAM RSAC
PARAMETER (MAX=1000)
DIMENSION YARRAY(MAX)
CHARACTER*10 KNAME
KNAME='FILE1'
CALL RSAC1(KNAME,YARRAY,NLEN,BEG,DEL,MAX,NERR)
stop
END

f77 rsac.f -L/usr/local/lib -lsacio -o rsac
/usr/bin/ld: Undefined symbols:
_fprintf$LDBLStub
_sprintf$LDBLStub
_printf$LDBLStub
_sscanf$LDBLStub
collect2: ld returned 1 exit status

When I tried a more elaborate program, I got more messages:

/usr/bin/ld: warning multiple definitions of symbol _fmax
/usr/local/lib/libsacio.a(math.o) definition of _fmax in section
(__TEXT,__text)
/usr/lib/system/libmathCommon.A.dylib(single module) definition of _fmax
/usr/bin/ld: warning multiple definitions of symbol _fmin
/usr/local/lib/libsacio.a(math.o) definition of _fmin in section
(__TEXT,__text)
/usr/lib/system/libmathCommon.A.dylib(single module) definition of _fmin
/usr/bin/ld: Undefined symbols:
_fprintf$LDBLStub
_sprintf$LDBLStub
_printf$LDBLStub
_sscanf$LDBLStub
collect2: ld returned 1 exit status

Any suggestons would be appreciated.

  • Arthur Snoke
    2006-03-10 17:38:05
    As some of you have suggested, my problems with using g77 programs with
    the sacio library built using gcc4 is a library problem. I rebuilt sac
    using gcc 3.3, and even though I got some "warnings" when I compiled and
    linked my program, it worked.

    If you are not a mac user and do not care to use sacio.a, you can stop
    here (if you have not already).

    George H. says he built g77 and gcc4 both using fink. I have not used
    fink, rather I use the i-packages approach to all my supplementary
    programs/packages. I would appreciate suggestions about "third party"
    providers of g77 that could work with gcc4.

    Here are the warning messages that come during the link stage. I prefer
    not getting warning messages. Any comments?

    [macquake:/usr/local/src] snoke% cl_bin mfilt
    /usr/bin/ld: warning multiple definitions of symbol _fmax
    /usr/local/lib/libsacio.a(math.o) definition of _fmax in section
    (__TEXT,__text)
    /usr/lib/system/libmathCommon.A.dylib(single module) definition of _fmax
    /usr/bin/ld: warning multiple definitions of symbol _fmin
    /usr/local/lib/libsacio.a(math.o) definition of _fmin in section
    (__TEXT,__text)
    /usr/lib/system/libmathCommon.A.dylib(single module) definition of _fmin
    [macquake:/usr/local/src] snoke%

    Here is a synopsis of what I did.

    [macarthur:sac-stuff/060221/SAC] snoke% sudo gcc_select 3.3
    Password:
    Default compiler has been set to:
    gcc version 3.3 20030304 (Apple Computer, Inc. build 1809)
    [macarthur:sac-stuff/060221/SAC]

    [macquake:/usr/local] snoke% g77 -v
    Reading specs from /usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2/specs
    Configured with: ../gcc/configure --enable-threads=posix
    --enable-languages=f77 --disable-shared --enable-static
    Thread model: posix
    gcc version 3.4.2
    [macquake:/usr/local] snoke%

    So it talks about gcc 3.4.2, but I am using gcc 3.3. ...

05:01:53 v.01697673