[R-pkg-devel] package installation and linking with JAGS

Frantisek Bartos |@b@rto@96 @end|ng |rom gm@||@com
Wed Jul 8 11:06:31 CEST 2020


Hello,

we have written an R package that uses JAGS and requires a JAGS module
that's distributed with the package. We had a lot of problems making
the installation work across platforms and we adapted the way it's done in
'runjags' (it also contains a JAGS module). However, we are having two
problems:

1) the CMD CHECK returns this warning
Check: for GNU extensions in Makefiles, Result: WARNING
  Found the following file(s) containing GNU extensions:
    src/Makevars
    src/Makevars.in
  Portable Makefiles do not use GNU extensions such as +=, :=, $(shell),
  $(wildcard), ifeq ... endif, .NOTPARALLEL See section 'Writing portable
  packages' in the 'Writing R Extensions' manual.

2) the package installation works only from the source. For example,
devtools::install_github() returns an error since .o files are generated
inside of the package folder. A similar problem occurs when generating the
source .tar.gz, however, manually deleting the .o files from it fixes
the problem and it can be used for installing the package.

I wanted to ask how should I proceed. Can I submit the package to cran with
this warning? We verified that the installation from source works on
Windows, macOS, and Linux.

Thank you very much,
František Bartoš


github link: https://github.com/FBartos/RoBMA

the makevars.win file:
#Set a default value for JAGS_ROOT in case the user hasn't set it, this
location was specified by the CRAN-team (according to runjags, where I
copied this from)
JAGS_ROOT ?= c:/progra~1/JAGS/JAGS-4.3.0

## Use the old ABI to match JAGS 4.x compilation on Windows:
PKG_CXXFLAGS = -D_GLIBCXX_USE_CXX11_ABI=0

PKG_CPPFLAGS=-I"$(JAGS_ROOT)/include"
PKG_LIBS=-L"$(JAGS_ROOT)/${R_ARCH}/bin" -ljags-4 -ljrmath-0

# Actual sources and objects for RoBMA
SOURCES= $(wildcard *.cc) $(wildcard */*.cc)
OBJECTS=$(SOURCES:.cc=.o)

the makevars.in file:
PKG_CPPFLAGS=@JAGS_CFLAGS@
PKG_LIBS=@JAGS_LIBS@ @JAGS_RPATH@

SOURCES= $(wildcard *.cc) $(wildcard */*.cc)
OBJECTS=$(SOURCES:.cc=.o)

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list