Xref: utzoo comp.lang.c:14984 comp.lang.fortran:1646 Path: utzoo!attcan!uunet!husc6!rutgers!ucsd!sdcc6!ir10 From: ir10@sdcc6.ucsd.EDU (Donald R. Fredkin) Newsgroups: comp.lang.c,comp.lang.fortran Subject: Re: Interfacing FORTRAN with C Keywords: FORTRAN, C, Interprocedure calls Message-ID: <4176@sdcc6.ucsd.EDU> Date: 21 Dec 88 18:21:22 GMT References: <5962@thorin.cs.unc.edu> Reply-To: drfredkin@ucsd.edu (Donald R. Fredkin) Organization: University of California, San Diego Lines: 45 In article <5962@thorin.cs.unc.edu> singh@unc.cs.unc.edu (Raj Kumar Singh) writes: > >I think this question has been brought up before and so >I would like to exchange info with some one who can provide >helpful pointers on the issue of interprocedure calls between >C program and FORTRAN routines. > >The specifics are as follows: > >System: VaxStation-3200 running Ultrix-2.1. > > >C-program {tt.c} The following version works fine on a VaxStation-II running some flavor or other of Ultrix.: ******************************* #include extern void f_init(), f_exit(); /* fiddle with the Fortran I/O system */ MAIN_() /* f77 really wants this */ { } main() { extern void hello_(); f_init(); hello_(); f_exit(); exit(0); } ******************************* > >FORTRAN routine {hello.f} unchanged. I compile and link with the f77 command, which automatially includes the right things from /usr/lib. -- UUCP {ihnp4,decvax!ucbvax,dcdwest,ucbvax}!ucsd.edu!drfredkin Internet drfredkin@ucsd.edu or drf%sdph2@ucsd.edu Bitnet drfredkin@ucsd