Search code examples
rdata.tabledevtoolscran

Install packages requiring C/C++/Fortran with CRAN/Check_rhub


I am repeatedly running into an error when checking my new R package with devtools::check_rhub(). I get the same error with CRANs automatic tests. I can install these packages no bother locally.

My package uses plotly, for which data.table is a dependancy

The error message I get when Installing package dependencies is:

Packages which are only available in source form, and may need compilation of C/C++/Fortran: 'utf8' 'data.table' These will not be installed

Then later on when:

** byte-compile and prepare package for lazy loading there is no package called 'data.table' Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : Calls: ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart

Execution halted

This uses Windows Server 2008 R2 SP1, R-devel, 32/64 bit

So the package will not load. How do I make it compile on the RHub and CRAN?


Solution

  • I had similar issues recently. This resolved it, using the rhub package :

      rhub::check(
      platform="windows-x86_64-devel",
      env_vars=c(R_COMPILE_AND_INSTALL_PACKAGES = "always")
    )
    

    I think you should be able to pass that env_vars argument to devtools::check_rhub() function as well.