[Rcpp-devel] Errors while compiling a script (seems to be related to Fortran)

Xiao He praguewatermelon at gmail.com
Thu Sep 4 09:30:27 CEST 2014


Hi Dirk,

Thanks for the comments. Suppose if I were to go with your third
suggestion, do you happen to have any examples of RcppArmadillo calling
SEXP functions that I can refer to?

In the past, I tried (1) putting the set of MASS functions in a separate
MASS.cpp file, (2) creating a header file MASS.h, and (3) making the main
script file call the MASS functions by doing include "MASS.h". But the same
errors were still present.

Thank you again for your help!

-Xiao



On Wed, Sep 3, 2014 at 9:52 PM, Dirk Eddelbuettel <edd at debian.org> wrote:

>
> Xiao,
>
> On 3 September 2014 at 21:39, Xiao He wrote:
> | Hi Kevin,
> |
> | Yes, those extra includes are there because some functions taken from
> the MASS
> | package need these them.
> |
> | I rearranged the includes by placing #include <RcppArmadillo.h> before
> the ones
> | below, and was able to reduce the number of errors from 7 to 4.
> |
> | #include <R_ext/Linpack.h>
> | #include <R_ext/Applic.h>
> | #include <R_ext/Utils.h>
> |
> | Is it possible for you to take a look at the script below, which
> includes those
> | functions from MASS that require these includes? I am not sure what else
> needs
> | to be done. The errors seem to have to do with the fortran library.
> |
> | https://www.dropbox.com/s/ukjml693ta8r8gi/test2.cpp?dl=0
>
> I just glanced at this for a few secs. Quick comments
>
> -- Remove R.h (pulled in via Rcpp which is pulled in from RcppArmadillo)
>
> -- think about using sort and QR from (Rcpp)Armadillo: because that is why
> we
>    use Armadillo for
>
> -- if you can't make the error go away in one file, create two files:
>    * one higher-level with RcppArmadillo calling
>    * another lower-level SEXP-only set of functions with the code you
>      borrowed from MASS
>
> Dirk
>
> --
> http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20140904/1a46d33c/attachment.html>


More information about the Rcpp-devel mailing list