[R-pkg-devel] Fwd: src/ subdirectories contains sources....

Sokol Serguei @ergue|@@oko| @end|ng |rom gm@||@com
Tue Aug 30 14:39:43 CEST 2022


Le 30/08/2022 à 14:14, RICHET Yann a écrit :
> Dear all,
>
> I already asked some advice to well integrate a full C++ library as a submodule in my package... (which is just a wrapper for that cpp lib). As suggested, I moved the submodule inside src/, fixed some makefiles, ...
>
> But I still have a WARNING on Windows (only):
> * checking package subdirectories ... WARNING
> Subdirectory 'src' contains no source files.
>
> https://win-builder.r-project.org/incoming_pretest/rlibkriging_0.6-0_20220830_115756/Windows/00check.log
>
> While my src/ is well populated with subdirectories containing source files...

These files are coming from the library that you want to wrap. You still 
have to add an actual wrapper, i.e. your own code that will take SEXP 
arguments convert them in C type variables needed by the wrapped lib and 
once got the result from a lib call to convert it back to SEXP and 
return to R world. For example, the nloptr package (you are inspired 
off) has src/nloptr.c where it defines a function

    SEXP NLoptR_Optimize( SEXP args ) {...}

and in R/nloptr.R it is called with

    solution <- .Call( "NLoptR_Optimize", ret, PACKAGE = "nloptr" )

In now days, using Rcpp for lib wrapping is much more tractable solution 
(IMHO). So you can look over there.

Best,
Serguei.

> Regards,
>
> Yann
>
> ______________________________________________
> R-package-devel using r-project.org  mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel


	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list