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

Christophe Bousquet chr_bou@quet @end|ng |rom protonm@||@com
Thu Aug 31 16:59:07 CEST 2023


> This can be considered good news. You have just successfully performed
> the job that is normally done by R CMD SHLIB when installing source
> packages or running inline C++ code. The environment variables, at
> least inside your running R session, are completely fine.
>
> Now we need to find out why R CMD SHLIB itself fails without producing
> any output. Do you get any output from tools::Rcmd('SHLIB --version')?
> Does tools::Rcmd('') print the list of available options?

Thanks again.
Here is the output before I changed anything in PATH:

```
> tools::Rcmd('SHLIB --version')
> tools::Rcmd('')
Usage: Rcmd command args

where 'command' is one of:
  INSTALL  Install add-on packages
  REMOVE   Remove add-on packages
  SHLIB    Make a DLL for use with dynload
  BATCH    Run R in batch mode
  build    Build add-on packages
  check    Check add-on packages
  Rprof    Post process R profiling files
  Rdconv   Convert Rd format to various other formats
  Rdiff    difference R output files
  Rd2pdf   Convert Rd format to PDF
  Rd2txt   Convert Rd format to pretty text
  Stangle   Extract S/R code from vignette
  Sweave    Process vignette documentation
  config   Obtain configuration information about R
  open     Open a file via Windows file associations
  texify   Process a latex file

Use
  Rcmd command --help
for usage information for each command.
```

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'):

```
> tools::Rcmd('BATCH --help')
Usage: Rcmd BATCH [options] infile [outfile]

Run R non-interactively with input from infile and place output (stdout
and stderr) to another file.  If not given, the name of the output file
is the one of the input file, with a possible '.R' extension stripped,
and '.Rout' appended.

Options:
  -h, --help            print short help message and exit
  -v, --version         print version info and exit
  --no-timing           do not report the timings
  --                    end processing of options

Further arguments starting with a '-' are considered as options as long
as '--' was not encountered, and are passed on to the R process, which
by default is started with '--restore --save'.

Report bugs at <https://bugs.R-project.org>.
```

I get exactly the same output after adding the paths to PATH in the System variables part of the Environment variables box and before restarting my computer. I had to change the / to \\ because my computer does not allow the sign / for paths. So
C:\\rtools43/x86_64-w64-mingw32.static.posix/bin
became
C:\\rtools43\\x86_64-w64-mingw32.static.posix\\bin

After restart, I get the same output. I can also add that:

```
> tools::Rcmd('BATCH --version')
R batch front end: 4.3.1 (r84548)

Copyright (C) 1997-2023 The R Core Team.
This is free software; see the GNU General Public Licence version 2
or later for copying conditions.  There is NO warranty.
```

Best regards,
Christophe



More information about the R-help mailing list