c++ - Wrapping a fortran function in Rcpp -


It initially showed me to do a simple job but I can not find the following to work. I am trying to wrap the Fortune sub-work in an RRPP call so that there is a function available in R to use R. The goal function is to be included in a package so it is not possible to use dyn.load () on a specific * .o file (unless someone can show me?). On specifying the flags in the MacWares file, I suspect that such problems can be solved but the information provided is very brief and some clarification would be appreciated.

I have made the following document close as I could:

  1. Rcpp.package.skeleton
  2. < Create a package structure with li> Keep my FORTRON file (hello.f) in the src directory
  3. created an original CPP file for RCP wrapper (Hello CPP)
  4. Create a 'clean' Create an R file to create a function call (i.e. . Avoid .

    However, when I try and build my package (With RStudio), I get the following error output:

      ==> CMD installs - No-MultiTech - with-source Fortran G ++ -share -Oforan.RQPXport. O hello o o hello. Rcpp hllo_world.o-ligretron -lm-lacwdmath -l / usr / lib / r / lib -lR * library '/home/.../R/x86_64 -pc-linux-gnu-library / 3.0 '* Install * source * Install in package' Fortune '... ** Libs hello.o: Function in' hello_wrapper ': /home/.../r_code/fortran /src/hello.cpp: 16: of 'hello_wrapper' Hi Definition Hello. O: / home /.../ r_code / fortran / src / hello.cpp: 16: Firstly defined here 2: Error: LD has created 1 exit status: *** [absconding] Error 1 Error: compile package 'fail for' FORTRAN * * DELETION '/home/.../R/x86_64- PC-Linux-GNU-Library / 3.0 / FORTRAN' out of position '  

    My files are as follows:

    Hello.F

      Hello Hello () print *, Hello World, Hello World  

    Hello

      External "C" {Zero (Hello); }  

    Hello.cpp

    #include

    wrapper.R

      hello_r & lt; - Function () {. ("Hello_wrapper") call; }  

I believe this problem is as simple as when you Many files try to rename the name of the name with the different names Name Hello. F hello_fortran.f and going from there.


Comments