[R] Writing R package that call Fortran codes

Kodalore Vijayan, Vineetha W vwkv13 at mun.ca
Thu Jun 16 21:33:30 CEST 2016


Thank you Don. I did send an email to R-sig-mac.

-Vineetha

On Thu, Jun 16, 2016 at 10:36 AM, MacQueen, Don <macqueen1 at llnl.gov> wrote:

> You might want to take this question to R-sig-mac.
>
> --
> Don MacQueen
>
> Lawrence Livermore National Laboratory
> 7000 East Ave., L-627
> Livermore, CA 94550
> 925-423-1062
>
>
>
>
>
> On 6/15/16, 1:20 PM, "R-help on behalf of Kodalore Vijayan, Vineetha W"
> <r-help-bounces at r-project.org on behalf of vwkv13 at mun.ca> wrote:
>
> >Hi,
> >
> >I'm trying to write an R package that calls a Fortran subroutine on my
> >Mac
> >os x El Capitan with Xcode 7 and gfortran 6.1, R 3.3.0.   I can build and
> >load the library but when I try to use it in R I get this error:
> >>library(NEpidemic)
> >>random_epi(variable_names)
> >
> >Error in .Fortran("random_epi", : "random_pi" not resolved from current
> >namespace (NEpidemic).
> >
> >Then I  tried adding useDynLib(random_epi.f95) in the NAMESPACE file,
> >additional to useDynLib(NEpidemic). After doing that I couldn't build the
> >package and it gave me another error:
> >
> >Error in library.dynam(lib, package, package.lib) :
> >  shared object Œrandom_epi.so¹ not found
> >Error: loading failed
> >Execution halted
> >ERROR: loading failed
> >
> >When I checked my src folder, there is only random_epi.o file.  How can I
> >fix this issue? Any help would be much appreciated. I'm vey new to both R
> >and Fortran coding, especially in package building.
> >
> >Thanks in advance!
> >Vineetha
> >
> >       [[alternative HTML version deleted]]
> >
> >______________________________________________
> >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> >https://stat.ethz.ch/mailman/listinfo/r-help
> >PLEASE do read the posting guide
> >http://www.R-project.org/posting-guide.html
> >and provide commented, minimal, self-contained, reproducible code.
>
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list