The obvious place to look for pointers of how to detect and link
correctly to fftw would be in the current CRAN package `fftwtools` that
does it without any Rcpp:
https://github.com/krahim/fftwtools
Cheers,
Ege
On 11/28/2017 02:47 AM, Dirk Eddelbuettel wrote:
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
______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel