0

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.

1 Answers1

0

I have solved the warning regarding checkbashisms.

Last login: Thu Aug 19 00:28:45 on *******
(base) *-MacBook-Pro:~ *$ brew install checkbashisms
Updating Homebrew...
fatal: Could not resolve HEAD to a revision
Warning: No available formula or cask with the name "checkbashisms".
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
(base) *-MacBook-Pro:~ *$ sudo apt-get install devscripts
Password:
sudo: apt-get: command not found
(base) *-MacBook-Pro:~ *$ less install.sh
install.sh: No such file or directory
(base) *-MacBook-Pro:~ *$ brew --version
Homebrew 3.2.8
Homebrew/homebrew-core (no Git repository)
Homebrew/homebrew-cask (git revision 946741eb2e; last commit 2021-08-19)
(base) *-MacBook-Pro:~ *$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or run:
  softwareupdate --all --install --force

If that doesn't show you any updates, run:
  sudo rm -rf /Library/Developer/CommandLineTools
  sudo xcode-select --install

Alternatively, manually download them from:
  https://developer.apple.com/download/more/.
You should download the Command Line Tools for Xcode 11.3.1.


Warning: Homebrew/homebrew-core was not tapped properly! Run:
  rm -rf "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core"
  brew tap homebrew/core

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
  /Library/Frameworks/Python.framework/Versions/3.8/bin/python3-config
  /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8-config
  /Applications/anaconda3/bin/icu-config
  /Applications/anaconda3/bin/krb5-config
  /Applications/anaconda3/bin/freetype-config
  /Applications/anaconda3/bin/xslt-config
  /Applications/anaconda3/bin/libpng16-config
  /Applications/anaconda3/bin/python3.7-config
  /Applications/anaconda3/bin/libpng-config
  /Applications/anaconda3/bin/xml2-config
  /Applications/anaconda3/bin/python3.7m-config
  /Applications/anaconda3/bin/python3-config
  /Applications/anaconda3/bin/curl-config
  /Applications/anaconda3/bin/ncursesw6-config
  /Applications/anaconda3/bin/pcre-config
  /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6m-config
  /Library/Frameworks/Python.framework/Versions/3.6/bin/python3-config
  /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6-config

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
  /usr/local/lib/libnnz11.dylib
  /usr/local/lib/libociei.dylib
  /usr/local/lib/libocijdbc11.dylib
  /usr/local/lib/libtcl8.6.dylib
  /usr/local/lib/libtk8.6.dylib

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
  /usr/local/include/fakemysql.h
  /usr/local/include/fakepq.h
  /usr/local/include/fakesql.h
  /usr/local/include/itcl.h
  /usr/local/include/itcl2TclOO.h
  /usr/local/include/itclDecls.h
  /usr/local/include/itclInt.h
  /usr/local/include/itclIntDecls.h
  /usr/local/include/itclMigrate2TclCore.h
  /usr/local/include/itclTclIntStubsFcn.h
  /usr/local/include/mysqlStubs.h
  /usr/local/include/odbcStubs.h
  /usr/local/include/pqStubs.h
  /usr/local/include/tcl.h
  /usr/local/include/tclDecls.h
  /usr/local/include/tclOO.h
  /usr/local/include/tclOODecls.h
  /usr/local/include/tclPlatDecls.h
  /usr/local/include/tclThread.h
  /usr/local/include/tclTomMath.h
  /usr/local/include/tclTomMathDecls.h
  /usr/local/include/tdbc.h
  /usr/local/include/tdbcDecls.h
  /usr/local/include/tdbcInt.h
  /usr/local/include/tk.h
  /usr/local/include/tkDecls.h
  /usr/local/include/tkPlatDecls.h

Warning: Unbrewed '.pc' files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected '.pc' files:
  /usr/local/lib/pkgconfig/tcl.pc
  /usr/local/lib/pkgconfig/tk.pc

Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:
  /usr/local/lib/libtclstub8.6.a
  /usr/local/lib/libtkstub8.6.a

Warning: Some taps are not on the default git origin branch and may not receive
updates. If this is a surprise to you, check out the default branch with:
  git -C $(brew --repo homebrew/core) checkout master

Warning: Homebrew's "sbin" was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting your PATH for example like so:
  echo 'export PATH="/usr/local/sbin:$PATH"' >> /Users/*/.bash_profile

Warning: Your Xcode (10.3) is outdated.
Please update to Xcode 11.3.1 (or delete it).
Xcode can be updated from the App Store.


Warning: Your XQuartz (2.7.7) is outdated.
Please install XQuartz 2.7.11 (or delete the current version).
XQuartz can be updated using Homebrew Cask by running:
  brew reinstall xquartz
(base) *-MacBook-Pro:~ *$ git -C $(brew --repository homebrew/core) checkout master
Checking out files: 100% (6068/6068), done.
Branch 'master' set up to track remote branch 'master' from 'origin'.
Already on 'master'
(base) *-MacBook-Pro:~ *$ brew install checkbashisms
Updating Homebrew...
==> Downloading https://ghcr.io/v2/homebrew/core/checkbashisms/manifests/2.21.4
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/checkbashisms/blobs/sha256:53f9
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Pouring checkbashisms--2.21.4.all.bottle.tar.gz
  /usr/local/Cellar/checkbashisms/2.21.4: 6 files, 71.2KB
(base) *-MacBook-Pro:~ *$