[Rcpp-devel] Rcpp with C++ and Fortran

Rodney Sparapani rsparapa at mcw.edu
Wed Jan 23 21:16:05 CET 2013


Hi!

Quick question:  has anyone used Rcpp with C++ and Fortran?

Longer version:  We have developed some C++ code to do MCMC sampling
with RcppEigen.  It works pretty well:  about a 70X speed
improvement over R code.  We have been able to link this with some
ARMS C code rather easily.  However, now we want to link it with
Fortran code from the DPpackage R package.

I have looked through as many Rcpp docs as I could get my hands, but I
didn't see anything about Fortran (plus googling).  Anyways, what is
the best way to call Fortran functions from our C++ code that will be
used via Rcpp/inline?  I've played around with f2c to convert the
Fortran code to C (but it makes me nervous ;o)  Should I be working
from a package skeleton?  Basically, any advice is welcome.  Thanks!

-- 
Rodney Sparapani, PhD  Center for Patient Care and Outcomes Research
Sr. Biostatistician               http://www.mcw.edu/pcor
4 wheels good, 2 wheels better!   Medical College of Wisconsin (MCW)
WWLD?:  What Would Lombardi Do?   Milwaukee, WI, USA


More information about the Rcpp-devel mailing list