[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 16:21:05 CEST 2023


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

> So when I run the commands, I get this output. I honestly have no
> clue whether this can be considered as something useful or not :-/
> 
> ```
> > tools:::.shlib_internal(c('-n', 'hello.c'))  
> make cmd is
>   make -f "C:/PROGRA~1/R/R-43~1.1/etc/x64/Makeconf" -f
> "C:/PROGRA~1/R/R-43~1.1/share/make/winshlib.mk" SHLIB="hello.dll"
> WIN=64 TCLBIN= OBJECTS="hello.o"

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?

> But I did not fully understand how to adjust PATH.

This WikiHow article points in the right direction:
https://www.wikihow.com/Change-the-PATH-Environment-Variable-on-Windows

It might help to prepend

C:\\rtools43/x86_64-w64-mingw32.static.posix/bin;C:\\rtools43/usr/bin;

...to the existing value of PATH. On the other hand, it might not. I
don't yet have a good explanation why your Rcmd.exe seemingly refuses
to work.

-- 
Best regards,
Ivan



More information about the R-help mailing list