[Bioc-devel] portable make syntax

Kevin Ushey kevinushey at gmail.com
Sat Jan 24 03:13:25 CET 2015


On Fri, Jan 23, 2015 at 5:18 PM, Dan Tenenbaum <dtenenba at fredhutch.org> wrote:
>
>
> ----- Original Message -----
>> From: "Kevin Ushey" <kevinushey at gmail.com>
>> To: "Laurent Gatto" <lg390 at cam.ac.uk>
>> Cc: "bioc-devel" <bioc-devel at stat.math.ethz.ch>
>> Sent: Friday, January 23, 2015 4:58:40 PM
>> Subject: Re: [Bioc-devel] portable make syntax
>>
>> If I understand correctly, all versions of `make` on the BioC build
>> systems will support GNU extensions to Makefiles, and so it's
>> probably
>> not worth your time to make this 'portable' -- just add the
>> SystemRequirements bit.
>>
>
> BTW, the warning was added in recent versions of R-devel and I don't know why it was added.
> It could be that GNU extensions may not be supported in future versions of Rtools (the windows
> toolchain maintained by Duncan Murdoch). I really have no idea. But since a warning was added, it's probably a good idea to find out why rather than to ignore it. So it might be worth a note to R-devel asking about the intention of that warning.
>
> Dan

Very unlikely -- I am really not sure of what the motivation is,
beyond R wanting to support platforms with versions of make that do
not support GNU extensions (whichever those might be... BSD make? AT&T
make on Solaris? See:
http://cran.r-project.org/doc/manuals/r-release/R-exts.html#FOOT51)

I am guessing that the Windows toolchain will continue to be based off
of MinGW + GCC for the foreseeable future, and hence will continue to
allow GNU extensions. In fact, R-exts specifically prescribes GNU
extensions for Windows makefiles -- from R-exts,

    Since the only viable make for Windows is GNU make, it is
permissible to use GNU extensions in files Makevars.win or
Makefile.win.

so I really doubt Windows would ever foresake GNU extensions.

Kevin

>> However, you could work around this by (following R-exts at
>> http://cran.r-project.org/doc/manuals/r-release/R-exts.html#Writing-portable-packages)
>> wrapping your shell command in backticks, e.g.
>>
>>     R_HOME=`if test -z ${R_HOME}; then ...; else ...; fi`
>>
>> or something to that effect.
>>
>> On Fri, Jan 23, 2015 at 4:05 PM, Laurent Gatto <lg390 at cam.ac.uk>
>> wrote:
>> >
>> > Dear all,
>> >
>> > I have been using the following in various vignettes/Makefile
>> >
>> > ifeq (${R_HOME},)
>> > R_HOME= $(shell R RHOME)
>> > endif
>> >
>> > This syntax is GNU specific and now results in warnings when
>> > checking
>> > the package:
>> >
>> > * checking for GNU extensions in Makefiles ... WARNING
>> > Found the following file(s) containing GNU extensions:
>> >   vignettes/Makefile
>> > Portable Makefiles do not use GNU extensions such as +=, :=,
>> > $(shell),
>> > $(wildcard), ifeq ... endif. See section ‘Writing portable
>> > packages’ in
>> > the ‘Writing R Extensions’ manual.
>> >
>> > I couldn't find anything in R-exts; does anyone know a more
>> > portable
>> > syntax?
>> >
>> > Alternatively, I could add
>> >
>> > SystemRequirements: GNU make
>> >
>> > to my DESCRIPTION file, which however does not seem ideal.
>> >
>> > Any suggestions?
>> >
>> > Thank you very much in advance.
>> >
>> > Laurent
>> >
>> > _______________________________________________
>> > Bioc-devel at r-project.org mailing list
>> > https://stat.ethz.ch/mailman/listinfo/bioc-devel
>>
>> _______________________________________________
>> Bioc-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>>



More information about the Bioc-devel mailing list