Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 May 2000 14:58:13 +0300
From:      Panagiotis Astithas <past@netmode.ntua.gr>
To:        questions@freebsd.org
Subject:   f77 linking error
Message-ID:  <20000509145813.A11108@netmode.ece.ntua.gr>

next in thread | raw e-mail | index | archive | help
Hello,

I have a small Fortran program that I'm trying to run and it produces an
error during the linking phase:

laptop$ f77 marina.f -lg2c -lm -lc
/usr/lib/libg2c.so: warning: tempnam() possibly used unsafely; consider using mkstemp()
/tmp/ccrOW248.o: In function `f.0':
/tmp/ccrOW248.o(.text+0x19): undefined reference to `expf_'
/tmp/ccrOW248.o(.text+0x41): undefined reference to `sinf_'
/tmp/ccrOW248.o: In function `MAIN__':
/tmp/ccrOW248.o(.text+0x2a7): undefined reference to `absf_'

I'm using the gcc provided wiht FreeBSD 4-STABLE, and I tried to provide
explicitly any necessary library on the command line. 
Has anyone come across this before? Is it excpected behavior? FWIW I tried
to locate the symbols (expf_ etc.) using 'strings' in libm.so.4, etc. to
no avail. Should I get & build gcc under /usr/local in case something in
the stock version is missing?

Thanks in advance for any help.

Cheers,
-past

P.S.: This is the program in case it matters:

         F(X) = EXPF(-X) - SINF(3.1415926*X/2.)
         READ 100, X1, X2, TOL
  100 FORMAT (2F10.0, E10.0)
         FX1 = F(X1)
         FX2 = F(X2)
         IF (FX1*FX2) 1, 2, 3
    3 PRINT 200
  200 FORMAT (80H FUNCTION VALUES WITH INITIAL X VALUES ARE NOT OF OPPOS
     1ITE SIGNS. CHANGE INPUTS. )
         CALL EXIT
    2 IF (FX1) 4, 5, 4
    5 PRINT 201, X1
  201 FORMAT (22H THE INPUT VALUE, X = ,F6.3, 27H IS A ROOT OF THE EQUAT
     1ION. )
    4 IF (FX2) 6, 7, 6
    7 PRINT 201, X2
         CALL EXIT
    6 PRINT 202 
  202 FORMAT (55H ERROR. FX1 AND FX2 NOT ZERO THOUGH PRODUCT TESTS ZERO.
     1 )
          CALL EXIT
    1 DO 30 I = 1, 25
           X = (X1 + X2)/2
           FX = F(X)
          PRINT 206, X, FX
  206 FORMAT (8H AT X = , F10.7, 8H F(X) = ,F10.6)
           IF (ABSF(X) - TOL) 8, 8, 9
    9 IF (FX*FX1) 10, 11, 12
   10 X2 = X
           GO TO 30
   12 X1 = X
           FX1 = FX
   30 CONTINUE
           PRINT 204
  204 FORMAT (33H NON-CONVERGENT IN 25 ITERATIONS. )
           CALL EXIT
   11 PRINT 205
  205 FORMAT (7H ERROR. )
           CALL EXIT
    8 PRINT 203, X, 1
  203 FORMAT (16H THE VALUE, X = ,F10.7, 12H IS A ROOT. , I3, 27H ITERA
     1TIONS WERE REQUIRED. )
           CALL EXIT 
           END



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000509145813.A11108>