Discussion:
[Rcpp-devel] GNU extension in makefile
Murray Efford
2018-06-23 15:22:16 UTC
Permalink
The RcppParallel introduction at https://rcppcore.github.io/RcppParallel/
instructs package writers to include a Makevars file with

PKG_LIBS += $(shell ${R_HOME}/bin/Rscript -e "RcppParallel::RcppParallelLibs()")

However, R CMD check in R 3.5.0 generates a warning apparently because +=
and $(shell are non-portable GNU extensions. As a Windows user I'm not
familiar with makefiles and am not confident to work around this. Am I
missing something, or is there a simple solution? An update to the
introduction would be welcome.

Murray
Dirk Eddelbuettel
2018-06-23 15:31:20 UTC
Permalink
On 24 June 2018 at 03:22, Murray Efford wrote:
| The RcppParallel introduction at https://rcppcore.github.io/RcppParallel/
| instructs package writers to include a Makevars file with
|
| PKG_LIBS += $(shell ${R_HOME}/bin/Rscript -e "RcppParallel::RcppParallelLibs()")
|
| However, R CMD check in R 3.5.0 generates a warning apparently because +=
| and $(shell are non-portable GNU extensions. As a Windows user I'm not
| familiar with makefiles and am not confident to work around this. Am I
| missing something, or is there a simple solution? An update to the
| introduction would be welcome.

Two things:

i) _Every_ R package which needs a Makevars _on Windows_ uses
src/Makevars.win -- see "Writing R Extensions"

ii) If one needs GNU make, one can declare the dependency in DESCRIPTION via
SystemRequirements: -- again, see "Writing R Extensions"

And we have just that:

SystemRequirements: GNU make, Windows: cmd.exe and cscript.exe, Solaris: g++ is required

Does that answer your question? If not, did you look at user reverse-depends
of RcppParallel and examine what they do? One can often copy working
solution s from other packages...

Dirk
--
http://dirk.eddelbuettel.com | @eddelbuettel | ***@debian.org
Jeff Newmiller
2018-06-23 15:40:43 UTC
Permalink
Alternatively, you might not need that file at all since Rcpp handles simple cases without it. [1]
Post by Dirk Eddelbuettel
| The RcppParallel introduction at
https://rcppcore.github.io/RcppParallel/
| instructs package writers to include a Makevars file with
|
| PKG_LIBS += $(shell ${R_HOME}/bin/Rscript -e
"RcppParallel::RcppParallelLibs()")
|
| However, R CMD check in R 3.5.0 generates a warning apparently because +=
| and $(shell are non-portable GNU extensions. As a Windows user I'm not
| familiar with makefiles and am not confident to work around this. Am I
| missing something, or is there a simple solution? An update to the
| introduction would be welcome.
i) _Every_ R package which needs a Makevars _on Windows_ uses
src/Makevars.win -- see "Writing R Extensions"
ii) If one needs GNU make, one can declare the dependency in
DESCRIPTION via
SystemRequirements: -- again, see "Writing R Extensions"
SystemRequirements: GNU make, Windows: cmd.exe and cscript.exe,
Solaris: g++ is required
Does that answer your question? If not, did you look at user
reverse-depends
of RcppParallel and examine what they do? One can often copy working
solution s from other packages...
Dirk
--
Sent from my phone. Please excuse my brevity.
Murray Efford
2018-06-23 15:59:08 UTC
Permalink
Thanks for the advice. It seems that R CMD check (locally and on
winbuilder) throws the warning despite having SystemRequirements: GNU make.
May not be a problem on CRAN itself.

I assumed that for CRAN one needed both Makevars and Makevars.win, so have
always included both in submissions to CRAN.

I suspect Jeff's suggestion, to omit, does not apply to RcppParallel.
Post by Dirk Eddelbuettel
| The RcppParallel introduction at https://rcppcore.github.io/
RcppParallel/
| instructs package writers to include a Makevars file with
|
RcppParallelLibs()")
|
| However, R CMD check in R 3.5.0 generates a warning apparently because +=
| and $(shell are non-portable GNU extensions. As a Windows user I'm not
| familiar with makefiles and am not confident to work around this. Am I
| missing something, or is there a simple solution? An update to the
| introduction would be welcome.
i) _Every_ R package which needs a Makevars _on Windows_ uses
src/Makevars.win -- see "Writing R Extensions"
ii) If one needs GNU make, one can declare the dependency in DESCRIPTION via
SystemRequirements: -- again, see "Writing R Extensions"
SystemRequirements: GNU make, Windows: cmd.exe and cscript.exe,
Solaris: g++ is required
Does that answer your question? If not, did you look at user
reverse-depends
of RcppParallel and examine what they do? One can often copy working
solution s from other packages...
Dirk
--
Murray Efford
2018-06-23 16:14:04 UTC
Permalink
My mistake - the SystemRequirements line had been lost from my DESCRIPTION
file (editing error?). OK and wiser now.
Sorry for wasting your time.
Murray
Post by Murray Efford
Thanks for the advice. It seems that R CMD check (locally and on
winbuilder) throws the warning despite having SystemRequirements: GNU make.
May not be a problem on CRAN itself.
I assumed that for CRAN one needed both Makevars and Makevars.win, so have
always included both in submissions to CRAN.
I suspect Jeff's suggestion, to omit, does not apply to RcppParallel.
Post by Dirk Eddelbuettel
| The RcppParallel introduction at https://rcppcore.github.io/Rcp
pParallel/
| instructs package writers to include a Makevars file with
|
| PKG_LIBS += $(shell ${R_HOME}/bin/Rscript -e
"RcppParallel::RcppParallelLibs()")
|
| However, R CMD check in R 3.5.0 generates a warning apparently because +=
| and $(shell are non-portable GNU extensions. As a Windows user I'm not
| familiar with makefiles and am not confident to work around this. Am I
| missing something, or is there a simple solution? An update to the
| introduction would be welcome.
i) _Every_ R package which needs a Makevars _on Windows_ uses
src/Makevars.win -- see "Writing R Extensions"
ii) If one needs GNU make, one can declare the dependency in DESCRIPTION via
SystemRequirements: -- again, see "Writing R Extensions"
SystemRequirements: GNU make, Windows: cmd.exe and cscript.exe,
Solaris: g++ is required
Does that answer your question? If not, did you look at user
reverse-depends
of RcppParallel and examine what they do? One can often copy working
solution s from other packages...
Dirk
--
Dirk Eddelbuettel
2018-06-23 16:36:23 UTC
Permalink
On 24 June 2018 at 04:14, Murray Efford wrote:
| My mistake - the SystemRequirements line had been lost from my DESCRIPTION
| file (editing error?). OK and wiser now.
| Sorry for wasting your time.

Oh, not to worry -- we've all been there. Thanks for circling back though!

Dirk
--
http://dirk.eddelbuettel.com | @eddelbuettel | ***@debian.org
Loading...