Mailing List ArchiveSupport open source code!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]tlug: Calling C procedures from FORTRAN
- To: "tlug@example.com" <tlug@example.com>
- Subject: tlug: Calling C procedures from FORTRAN
- From: "Stephen J. Turnbull" <turnbull@example.com>
- Date: Fri, 12 Feb 1999 13:30:32 +0900 (JST)
- Content-Transfer-Encoding: 7bit
- Content-Type: text/plain; charset=us-ascii
- In-Reply-To: <36C39982.93B1BBC9@example.com>
- References: <36C39982.93B1BBC9@example.com>
- Reply-To: tlug@example.com
- Sender: owner-tlug@example.com
>>>>> "VR" == Venkatesh Raghavan <raghavan@example.com> writes: VR> I am writing a FORTRAN program that calls C procedures. I am VR> using g77 and gcc compilers. By default the g77 compiler VR> appends an _(underscore) to function and subroutine names. For VR> example my program call a C procedure as follows; CALL CPROC() VR> and I have to name the C procedure as cproc_() Does this actually work? I thought FORTRAN and C had different calling conventions. That's what those underscores are for, preventing you from accidentally linking incompatible call sequences. VR> Is there any way/option for suppressing this addition of VR> underscore in FORTRAN so that C procedures can be called VR> directly (without adding an underscore). In C++, if FORTRAN linkage is supported, you can do the following #ifndef NAG_WRAPPER #define NAG_WRAPPER extern "fortran" { /* prototypes for NAG routines go here */ } This automatically generates the necessary thunks to make sure the arguments are in the right order and alignment and so on. I don't know how you would do this in FORTRAN to call C. -- University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN Institute of Policy and Planning Sciences Tel/fax: +81 (298) 53-5091 __________________________________________________________________________ __________________________________________________________________________ What are those two straight lines for? "Free software rules." ------------------------------------------------------------------- Next Technical Meeting: February 13 (Sat), 12:30 place: Temple Univ. ** presentation: XEmacs, by Steven Baur and Martin Buchholz Next Nomikai: March 19 (Fri), 19:30 Tengu TokyoEkiMae 03-3275-3691 ------------------------------------------------------------------- more info: http://tlug.linux.or.jp Sponsor: PHT
- Follow-Ups:
- Re: tlug: Calling C procedures from FORTRAN
- From: Venkatesh Raghavan <raghavan@example.com>
- References:
- tlug: Calling C procedures from FORTRAN
- From: Venkatesh Raghavan <raghavan@example.com>
Home | Main Index | Thread Index
- Prev by Date: Re: tlug: Re: your mail
- Next by Date: tlug: Intial Window size in Wmaker
- Prev by thread: tlug: Calling C procedures from FORTRAN
- Next by thread: Re: tlug: Calling C procedures from FORTRAN
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links