Ivan Krylov
2023-Aug-31 14:21 UTC
[R] Problems with installing R packages from source and running C++ in R, even on fresh R installation
? Thu, 31 Aug 2023 14:01:54 +0000 Christophe Bousquet <chr_bousquet at 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
Christophe Bousquet
2023-Aug-31 14:59 UTC
[R] Problems with installing R packages from source and running C++ in R, even on fresh R installation
> 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
Possibly Parallel Threads
- Problems with installing R packages from source and running C++ in R, even on fresh R installation
- Problems with installing R packages from source and running C++ in R, even on fresh R installation
- Problems with installing R packages from source and running C++ in R, even on fresh R installation
- Problems with installing R packages from source and running C++ in R, even on fresh R installation
- Problems with installing R packages from source and running C++ in R, even on fresh R installation