I am developing my first R package with the dependency rstan on macOS. So far, I receive one warning and two notes from devtools::check()
on RStudio.
> checking top-level files ... WARNING
A complete check needs the 'checkbashisms' script.
See section ‘Configure and cleanup’ in the ‘Writing R Extensions’
manual.
> checking installed package size ... NOTE
installed size is 6.2Mb
sub-directories of 1Mb or more:
libs 5.9Mb
> checking for GNU extensions in Makefiles ... NOTE
GNU make is a SystemRequirements.
0 errors ✓ | 1 warning x | 2 notes x
I am not a sophiscated developer. I checked all the online discussions I could find, but haven't solved the issues.
For 'checkbashisms'
, [1] I downloaded v2.0.0.2 from here and copied it to the package folder and the /usr/local/bin/
path; [2] added the below to configure
and configure.win
files in the package folder.
#! /bin/sh
if [ -f /usr/bin/checkbashisms ]; then
checkbashisms --force
fi
So far, [1] and [2] didn't work. I also turned to this post, but I was not sure how to follow added the checkbashisms perl script to $PATH, made it executable (important)
, especially on macOS.
For SystemRequirements
, I turned to this post. So far, not solved.
P.S.
configure
and configure.win
files
# Generated by rstantools. Do not edit by hand.
#! /bin/sh
"${R_HOME}/bin/Rscript" -e "rstantools::rstan_config()"
if [ -f /usr/bin/checkbashisms ]; then
checkbashisms --force
fi
Makevars
and Makevars.win
in the src
folder
# Generated by rstantools. Do not edit by hand.
STANHEADERS_SRC = $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "message()" -e "cat(system.file('include', 'src', package = 'StanHeaders', mustWork = TRUE))" -e "message()" | grep "StanHeaders")
PKG_CPPFLAGS = -I"../inst/include" -I"$(STANHEADERS_SRC)" -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -DBOOST_MATH_OVERFLOW_ERROR_POLICY=errno_on_error
PKG_CXXFLAGS = $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "RcppParallel::CxxFlags()") $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "StanHeaders:::CxxFlags()")
PKG_LIBS = $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "RcppParallel::RcppParallelLibs()") $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "StanHeaders:::LdFlags()")
CXX_STD = CXX14
DESCRIPTION
file
**here, some package info is omitted
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.1
Biarch: true
Depends:
R (>= 3.4.0)
Imports:
methods,
Rcpp (>= 0.12.0),
RcppParallel (>= 5.0.1),
rstan (>= 2.18.1),
rstantools (>= 2.1.1)
LinkingTo:
BH (>= 1.66.0),
Rcpp (>= 0.12.0),
RcppEigen (>= 0.3.3.3.0),
RcppParallel (>= 5.0.1),
rstan (>= 2.18.1),
StanHeaders (>= 2.18.0)
SystemRequirements: GNU make
Thank you for the kind comments.