EDIT: see edit in end.
I have a R package in github and I'm using devtools::install_github
to install it, which also install dependency packages.
Recently this process will install httpuv
as source package, but compiling it in Mac meet errors with automake
(something like this). I installed automake
, then there was error with clang: error: unsupported option '-fopenmp'
.
The issue and the possible solutions 1 2 seemed to be quite complicated. I think the CRAN version of httpuv
probably will work for me, and I don't want my users to go through so many errors and fixing compiler errors.
I'd like to just install all dependency packages from CRAN in binary. For some packages that do need the more up to date version, I have specified it in my package description with remote
section.
I checked install_github
, then install
, then install.packages
. It seemed that the default behavior for binary vs source package is
An alternative (and the current default) is "both" which means ‘use binary if available and current, otherwise try source’. The action if there are source packages which are preferred but may contain code which needs to be compiled is controlled by getOption("install.packages.compile.from.source").
My getOption("install.packages.compile.from.source")
is interactive
. This is actually a preferred behavior for me. However I never see the interactive prompt.
I tried to give a type = "binary"
parameter in install_github
, but it doesn't seem to work, maybe it's not passed to every dependency package install?
EDIT:
I found the situation is a little bit more complex:
shiny
github version via remote
in description. shiny
specified to install httpuv
github version in remote
section too. So this is actually the intended behavior.shiny
in my package.EDIT 2: It's more complex than my previous findings.
remote
section in my package description, supposedly only CRAN version is needed. However install_github
still install most dependencies from github.install_github
found this information and "upgrade" them again, even when some of them have no change.The really problem here is that if a dependency package is already new, it should not be installed. It could be a bug of devtools.
install_github
passes arguments to devtools::install
, and there upgrade_dependencies= FALSE
and maybe even dependencies = FALSE
might be what you're after:
install_github("you/urPackage", upgrade_dependencies = FALSE)