fort77 and intrinsic functions

fort77 and intrinsic functions

Post by Anand Kolatk » Sat, 01 Aug 1998 04:00:00

        Hi all.  I am trying to get some Fortran code to compile on
        our Pentium Linux box (Slackware/kernel: 2.0.34).
        I am using fort77 version 1.13 and gcc version

        There are a few intrinsic functions in the code that are causing
        problems at link time. Specifically, iand, zext and ran are causing
        undefined reference messages.  Not being a programmer, I just figured
        that these functions would be converted to the appropriate C functions
        by fort77.  Maybe not?  Maybe these functions should be named
        something else?  

graphics.o: In function `grrast_':
graphics.o(.text+0x654d): undefined reference to `iand_'
graphics.o(.text+0x7406): undefined reference to `iand_'
surfmap.o: In function `srfsan_':
surfmap.o(.text+0x2368): undefined reference to `iand_'
surfmap.o(.text+0x2452): undefined reference to `iand_'
surfmap.o(.text+0x2474): undefined reference to `iand_'
surfmap.o(.text+0x2496): more undefined references to `iand_' follow
mapread.o: In function `mapdn6_':
mapread.o(.text+0x2950): undefined reference to `zext_'
mapread.o: In function `mapbrx_':
mapread.o(.text+0x3370): undefined reference to `zext_'
../forlib/forlib.a(system.o): In function `syrand_':
system.o(.text+0xa72): undefined reference to `ran_'
system.o(.text+0xa92): undefined reference to `ran_'
system.o(.text+0xaa7): undefined reference to `ran_'
system.o(.text+0xafe): undefined reference to `ran_'  

        Can someone please point out some possible mistakes I am making?
        Maybe someone could even suggest an alternative to the fort77/gcc
        combo I used?  I just want to compile the thing and be done with
        it.  :-)
        Any advice is appreciated.

        Thanks very much.

        Anand Kolatkar                            Stanford University

Lab Phone: (650) 725-4625 or -7866              Fairchild Building D-143
      FAX: (650) 723-8464                       Stanford, CA. 94305-5126

        Home Page -


1. How do I use intrinsic function ...

they are defined in some kernel header.

you're not going to get floating point in the kernel.  the kernel
doesn't save/restore the floating point registers.  re-do your
algorithm to use fixed-point via integers.

the kernel doesn't link to libc.

since you do not have libc, you must provide your own functions.  many
are already written.  check the linux headers.  look at the source of
other (similar) drivers and do what they do.

J o h a n  K u l l s t a m

Don't Fear the Penguin!

2. FVWM list?

3. Linux intrinsic string and math functions...

4. question

5. Intrinsic Functions

6. $299.95 /mo Max/Max 10 GB $119 /GB Charged

7. Matrox Mystique ands X.

8. IRIX 6.2 and Netscape FastTrack 2.0a

9. function, function...who's got the function?

10. g77 and fort77: etime?

11. HELP: fort77 on Alpha machine

12. FORTRAN random number generator in fort77 (RedHat4.1)

13. Redhat 5.2 and fort77