Message-ID: <c38ca63a-40b4-3e0c-fc04-2be19759df8f@gmail.com>
Date: 2022-08-30T12:39:43Z
From: Serguei Sokol
Subject: [R-pkg-devel] Fwd: src/ subdirectories contains sources....
In-Reply-To: <788b3859-60db-3f61-5a9b-15d71a48e291@insa-toulouse.fr>
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 at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
[[alternative HTML version deleted]]