我正在macOS上开发我的第一个R包,依赖于rstan。到目前为止,我从RStudio上的devtools::check()
收到了一个警告和两个注释。
> 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
我不是一个老练的开发人员。我查了我能找到的所有在线讨论,但还没有解决问题。
对于'checkbashisms'
,[1]我从这里下载了v2.0.0.2,并将其复制到包文件夹和/usr/local/bin/
路径;[2]将以下内容添加到包文件夹中的configure
和configure.win
文件中。
#! /bin/sh
if [ -f /usr/bin/checkbashisms ]; then
checkbashisms --force
fi
目前,[1]和[2]没有工作。我也转向这篇文章,但我不确定如何跟随added the checkbashisms perl script to $PATH, made it executable (important)
,特别是在macOS上。
对于SystemRequirements
,我转向这篇文章。到目前为止,还没有解决
注:configure
和configure.win
文件
# 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
src
文件夹中的Makevars
和Makevars.win
# 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
谢谢你的评论。
我已经解决了关于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:~ *$