home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!news.ans.net!cmcl2!adm!news
- From: nobody@kodak.com
- Newsgroups: comp.sys.sgi
- Subject: RE: Calling Fortran Subroutines from C
- Message-ID: <31544@adm.brl.mil>
- Date: 27 Jul 92 14:06:44 GMT
- Sender: news@adm.brl.mil
- Lines: 33
-
- >From: NAME: Arup K. Ghose
- FUNC: Biophys. & Compu. Chem.
- TEL: (518) 445-7059 <GHOSEAK@A1@DSRGVJ>
- To: "info-iris@BRL.MIL"@kodakr@mrgate@wpc
-
-
- >Does any of you out there know how to call ForTran subroutine
- >from a C program running on IRIX 3.3.2?
- >For example, if I write a ForTran 77 program as follows:
-
- SUBROUTINE TEST (TEMP1, TEMP2, N)
- DOUBLE COMPLEX TEMP1, TEMP2
- DIMENSION TEMP1 (N,N), TEMP2 (N)
- :
- :
- RETURN
- END
-
- >How would I incorporate the above subroutine into my C program?
- >Do I need to create a header
- >file for the above subroutine? What switches do I use to
- >compile the above subroutine (as a
- >Fortran 77 program) and my C program?
-
- Assuming that the variable types matched in the two routines,
- from the C routine call it with an _ (underscore) extension:
-
- test_(... , ... , ...);
-
- Similarly add an underscore (_) extension in the C modules that
- you want to call from a fortran routine and call it without the
- underscore extension. It works for me on the
-
-