[R] Problems with installing R packages from source and running C++ in R, even on fresh R installation

Ivan Krylov kry|ov@r00t @end|ng |rom gm@||@com
Thu Aug 31 21:43:52 CEST 2023

В Thu, 31 Aug 2023 14:59:07 +0000
Christophe Bousquet <chr_bousquet using protonmail.com> пишет:

> So I get no output for tools::Rcmd('SHLIB --version').
> I tried to run tools::Rcmd('SHLIB --help') or tools::Rcmd('check
> --help'), but no output neither.
> I had more success with tools::Rcmd('BATCH --help'):

The job of Rcmd.exe is to figure out where it's located and pass the
correct arguments to Rterm.exe (or some of the few other executables).

In a few cases (like `R CMD BATCH --help` or just `R CMD` without
arguments) it understands enough to produce the output by itself, which
you see. In most other cases (`SHLIB` or `check` with any arguments), it
constructs the command line to launch "${R_HOME}/bin/x64/Rterm.exe" -e
<something> and forwards the command line arguments there. For some
reason, the command line fails to produce any output.

Is there a "C:\Program Files\R\R-4.3.1\bin\x64\Rterm.exe"? If you
launch it, does it present an R command line?

I'm suspecting that Rcmd.exe somehow messes up when it tries to locate
Rterm.exe to launch it. Here's one way to see what happens:

1. Download Sysinternals Process Monitor, a free monitoring utility,
   from the Microsoft website and launch it (no installation needed):

2. Set up the filter so that so that entries are included
 - Process name is "Rcmd.exe"
 - Operation is "Process Create"

3. Run tools::Rcmd('SHLIB --help') (or any other Rcmd invocation that
   fails to produce any output for you)

4. You should get one event of Rcmd.exe trying to launch cmd.exe with a
   long command line. What is the command line?

Best regards,

More information about the R-help mailing list