Closed HenrikBengtsson closed 9 years ago
The offending lines are in src/Makevars
:
L7: PKG_CPPFLAGS+=\
and in src/Makevars.win
:
L1: PKG_LIBS+=-lws2_32
...
L9: PKG_CPPFLAGS+=\
Trying to replace the above with:
PKG_CPPFLAGS=$(PKG_CPPFLAGS)\
gives
*** Recursive variable `PKG_CPPFLAGS' references itself (eventually). Stop.
on both Linux and Windows.
The solution is to use:
[...] use simply-expanded variables (‘:=’ or ‘::=’) or use the append operator (‘+=’)
Furthermore, the GNU make documentation suggests to use ::=
(and not :=
), because:
Simply expanded variables are defined by lines using ‘:=’ or ‘::=’ (see Setting Variables). Both forms are equivalent in GNU make; however only the ‘::=’ form is described by the POSIX standard (support for ‘::=’ was added to the POSIX standard in 2012, so older versions of make won’t accept this form either).
However, trying with:
PKG_CPPFLAGS ::= $(PKG_CPPFLAGS) \
gives R CMD INSTALL
error:
make: *** No rule to make target `=', needed by `PKG_CPPFLAGS'. Stop.
on both Linux and Windows whereas
PKG_CPPFLAGS := $(PKG_CPPFLAGS) \
works!
You can have great fun submitting a bug report complaining why R does not support a POSIX standard in its make system :)
Or you can be happy its working :)
On Wed, Apr 15, 2015 at 2:43 PM, Henrik Bengtsson notifications@github.com wrote:
The solution https://www.gnu.org/software/make/manual/html_node/Error-Messages.html is to use:
[...] use simply-expanded variables (‘:=’ or ‘::=’) or use the append operator (‘+=’)
Furthermore, the GNU make documentation suggests to use ::= (and not :=), because https://www.gnu.org/software/make/manual/html_node/Flavors.html#Flavors:
Simply expanded variables are defined by lines using ‘:=’ or ‘::=’ (see Setting Variables). Both forms are equivalent in GNU make; however only the ‘::=’ form is described by the POSIX standard (support for ‘::=’ was added to the POSIX standard in 2012, so older versions of make won’t accept this form either).
However, trying with:
PKG_CPPFLAGS ::= $(PKG_CPPFLAGS) \
gives R CMD INSTALL error:
make: *\ No rule to make target
=', needed by
PKG_CPPFLAGS'. Stop.on both Linux and Windows whereas
PKG_CPPFLAGS := $(PKG_CPPFLAGS) \
works!
— Reply to this email directly or view it on GitHub https://github.com/HenrikBengtsson/affxparser/issues/10#issuecomment-93528540 .
Yeah, I know. I think I stay quiet :)
BTW, Makevars
is an R invention, correct? I cannot find any documentation on it outside R.
I think so.
On Wed, Apr 15, 2015 at 3:01 PM, Henrik Bengtsson notifications@github.com wrote:
Yeah, I know. I think I stay quiet :)
BTW, Makevars is an R invention, correct? I cannot find any documentation on it outside R.
— Reply to this email directly or view it on GitHub https://github.com/HenrikBengtsson/affxparser/issues/10#issuecomment-93533070 .
Argh, too soon, it worked, but only because I forgot to remove 'SystemRequirements: GNU make`. So now we're back to:
* checking for GNU extensions in Makefiles ... WARNING
Found the following file(s) containing GNU extensions:
src/Makevars
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 think I finally solved this; we never needed:
PKG_LIBS := $(PKG_LIBS) -lws2_32
It was enough with
PKG_LIBS = -lws2_32
See commit 6478d11. All Bioc checks and Travis CI checks gives OK for this approach.
More details https://travis-ci.org/HenrikBengtsson/affxparser/jobs/47449797
This is currently "solved" by adding the following to the DESCRIPTION file:
such that
R CMD check
instead gives:which may be an unnecessary restriction. Is there a simple fix?