[R-pkg-devel] Errors in the pre-test after submitting the R package

Dirk Eddelbuettel edd at debian.org
Tue Nov 28 02:47:20 CET 2017


On 27 November 2017 at 21:24, Tan, Senren wrote:
| I have been developing an R package using Rcpp to call C++ functions that use the C subroutine library 'fftw3' that implements fast Fourier transform algorithm. Since I have the C library 'fftw3' installed on my laptop (running MacOS), when I checked my developed package using R CMD CHECK --as-cran, I could pass all the checks with no errors or warnings.
| 
| However, when I submitted the package to CRAN, during the pre-test, I encountered an error. I was wondering whether this error came from the absence of the 'fftw3' C library on the checking machine? Or maybe I have made some mistakes in the Makevars.win file?
| 
| I have done some search on how to use the external C library in R packages with Rcpp.
| 
| Here is what I have provided in the Makevars.win file:
| 
| PKG_CPPFLAGS = -I$(LIB_FFTW)/include
| CXX = g++
| PKG_CXXFLAGS = -std=c++11
| PKG_LIBS = -L$(LIB_FFTW)/lib -lfftw3
| 
| Could you please advise me on what to do?

Look at what other packages do. _Many_ packages deploy Rcpp to connect to
other external packages. That is how Rcpp started: to connect to QuantLib. I
also have packages connecting to the GSL, helped with one connecting to
nlopt, was involved with one connecting to PostgreSQL and probably several
more I now forget.  Jeroen has probably a dozen more too (xml2, curl,
poppler, v8, rmariadb, ... come to mind).  Look around some more. I also
think CRAN already _has_ packages interfacing the FFTW.  Plus, you can of
course connec to external libraries without using Rcpp. Lots of other
packages do that too.

Also read Writing R Extensions more carefully as the case is covered.  The
"bad" news is that you may need to learn to work with autoconf to create
configure, or re-invent it in shell how Jeroen does it, or rely on pkg-config
as I often, or ... do whatever it takes to _detect_ when fttw3 is not present.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



More information about the R-package-devel mailing list