Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
* Calling Fortran 90 subroutine from C program
@ 1999-01-08  5:00 Yon Han CHONG
  1999-01-08  5:00 ` Manfred Weiser
  0 siblings, 1 reply; 3+ messages in thread
From: Yon Han CHONG @ 1999-01-08  5:00 UTC (permalink / raw)


I am tring to call a Fortran 90 subroutine from a C program but I get
following error messages:


===================================
> make prefv
cc prefvf.c -c
cc prefvf.o prefv3d.o check_alloc.o -o prefv
ld:
Unresolved:
for_open
for_read_seq_lis
for_read_seq_lis_xmit
for_alloc_allocatable
for_close
for_read_seq
for_write_seq
for_write_seq_xmit
for_write_seq_lis
for_write_seq_lis_xmit
for_deallocate
for_stop
make: *** [prefv] Error 1
> 
===================================

Can anybody tell me where I can find these libraries?

-- 
----------------------------------------------------------------------
Yon Han CHONG                     |
Flow Control and Prediction Group | Tel: + 44 1234 750 111 ext. 5420
Cranfield College of Aeronautics  | E-mail: Y.H.Chong@cranfield.ac.uk
Cranfield University              | Fax: + 44 1234 752 149
United Kingdom                    | Mobile: + 44 958 381 395
----------------------------------------------------------------------



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Calling Fortran 90 subroutine from C program
  1999-01-08  5:00 Calling Fortran 90 subroutine from C program Yon Han CHONG
@ 1999-01-08  5:00 ` Manfred Weiser
  1999-01-08  5:00   ` paolowalter
  0 siblings, 1 reply; 3+ messages in thread
From: Manfred Weiser @ 1999-01-08  5:00 UTC (permalink / raw)


Hi,


you should give the option  -lfor  (or -lf2c for Linux)  in order to
link Fortran routines correctly.

Bye,
Manfred

-- 
------------------------------------------------------------------------------
 Manfred Weiser               Physik-Department der TU Muenchen, Institut T30
                                Telephon: ++49 (89) 289-14608 (Fax: -12296)
                                E-Mail:   mweiser@physik.tu-muenchen.de




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Calling Fortran 90 subroutine from C program
  1999-01-08  5:00 ` Manfred Weiser
@ 1999-01-08  5:00   ` paolowalter
  0 siblings, 0 replies; 3+ messages in thread
From: paolowalter @ 1999-01-08  5:00 UTC (permalink / raw)


In article <775b1h$jsc$1@sparcserver.lrz-muenchen.de>,
  Manfred Weiser <mweiser@physik.tu-muenchen.de> wrote:
> Hi,
>
> you should give the option  -lfor  (or -lf2c for Linux)  in order to
> link Fortran routines correctly.

Good suggestion, but not always literaly true. The point is that if you do
not link with the fortran linker (probably f77 or f90 for you) you do not get
automatic acceess to the Fortran system library and you need to link them by
hand. On my system they are libf.a, hence you need -lf Otherwise you can link
with the Fortran linker and link by hand the c routines -lc.

Ciao Paolo

>
> Bye,
> Manfred
> ------------------------------------------------------------------------------
>  Manfred Weiser               Physik-Department der TU Muenchen, Institut T30
>                                 Telephon: ++49 (89) 289-14608 (Fax: -12296)
>                                 E-Mail:   mweiser@physik.tu-muenchen.de
>
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-01-08  5:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-01-08  5:00 Calling Fortran 90 subroutine from C program Yon Han CHONG
1999-01-08  5:00 ` Manfred Weiser
1999-01-08  5:00   ` paolowalter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox