From andy_liaw at merck.com  Thu Oct 20 17:53:41 2005
From: andy_liaw at merck.com (Liaw, Andy)
Date: Thu, 20 Oct 2005 11:53:41 -0400
Subject: [Rd] calling fortran from C
Message-ID: <39B6DDB9048D0F4DAD42CB26AAFF0AFAFED516@usctmx1106.merck.com>

This is in R-exts.  If the Fortran subroutine is called `dqrfit', you would
use something like:

F77_CALL(dqrfit)(...);

All arguments need to be pointers, as Fortran passes by reference.

Andy

> From: James Bullard
> 
> Hello, I had a question about calling some of R's fortran 
> routines from C.  
> Specifically, I would like to call: dqrfit from some C code 
> which will be  
> bundled as an R package. I was hoping someone knew of an 
> example in some  
> of R's code which does something like this (any fortran call 
> from R's C  
> would probably be a sufficient guide). So far I can only find 
> locations  
> where R calls the Fortran directly, but this is not an option for me.
> 
> Also, I am trying to gauge the overhead of making this call, 
> does anyone  
> have any knowledge of whether there might be some non-trivial 
> constant  
> time penalty on making such a call.
> 
> Thanks in advance, Jim
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
>



[Rd] calling fortran from C
Liaw, Andy