[R-pkg-devel] Two compile questions

Dirk Eddelbuettel edd @end|ng |rom deb|@n@org
Mon Feb 22 17:52:59 CET 2021


On 21 February 2021 at 19:52, Karim Rahim wrote:
| I'm in the process of incorporating some improvements that I pulled from
| github.
| I am getting a warning and a note. These occur when I run
| 
| R CMD check --as-cran fftwtools_0.9-10.tar.gz
| 
| 1.
| * checking whether package ‘fftwtools’ can be installed ... WARNING
| Found the following significant warnings:
|   'config' variable 'CPP' is deprecated
| See ‘/home/karim/PWLisp/fftwtools.Rcheck/00install.out’ for details.
| 
| In the .out file I have the following:
| 
| * installing *source* package ‘fftwtools’ ...
| ** using staged installation
| 'config' variable 'CPP' is deprecated
| checking for gcc... gcc -std=gnu99

What R version and/or OS version?  I do not see this with R 4.0.4 on Ubuntu.
But that may be related to 2. below. Read on...

| 2.
| Package has both ‘src/Makevars.in’ and ‘src/Makevars’.
| Installation with --no-configure' is unlikely to work.  If you intended
| ‘src/Makevars’ to be used on Windows, rename it to ‘src/Makevars.win’
| otherwise remove it.  If ‘configure’ created ‘src/Makevars’, you need a
| ‘cleanup’ script.
| 
| I cannot find a Makevars file. I do have a Makevars.win file.

You could be using a standard tool called 'autoconf'. There are some nice
tutorials out there. In essence it is used by calling 'autoconf' to turn a
'configure.ac' into a 'configure'.  The script 'configure' is then included
in package, executed by 'R CMD INSTALL ...' and friends and used to turn
'src/Makevars.in' into 'src/Makevars'.

| I would appreciate any help.

However, when I run 'autoconf' I

a) get the CPP warning (and we can likely remove the line from configure.ac)

b) worse, the resulting configure no longer works as the PKG_CHECK_MODULE
   use appears broken.

yet you do not need or use these as you have a _fixed_ src/Makevars. So no
need for configure.

I use these tools in my packages too. I can look into this later (maybe this
evening) and send you a pull request. Long story short you probably do not
even need autoconf, we can probably just use a shell script or Makefile
snippet to use

   edd using rob:~/git/fftwtools(master)$ pkg-config --cflags fftw3

   edd using rob:~/git/fftwtools(master)$ pkg-config --libs fftw3
   -lfftw3
   edd using rob:~/git/fftwtools(master)$ 

where on my Ubuntu system no -I is needed and no -L is needed either as
headers and shared library are in a common spot.  The difficulty generally is
dealing with non-standard situations. Outsourcing that to 'pkg-config' is one
option. You can also look at other packages using fftw3, for example CRAN
package 'fftw' that you depend upon too.  It _has_ what appears to be a
working configure.ac so you could read and study that and carry it over.
Note that it is a little longer than what you in your repo.

Hope this helps, Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org



More information about the R-package-devel mailing list