[Rd] R CMD INSTALL cannot recognize full path on Windows

Wang Jiefei @zwj|08 @end|ng |rom gm@||@com
Tue Mar 10 08:22:13 CET 2020


Hi all,

Here is a bug(or feature?) that exists at least from R 2020-02-24
r77852 to 2020-03-09 r77919 on Window. Consider this example makefile in a
package
```






*test1=$(shell echo 'runif(3)'|R --vanilla --slave)test2=$(shell echo
'runif(3)'|"C:/Program Files/R/R-devel/bin/R" --vanilla
--slave)test3=$(shell echo 'runif(3)'|"C:/PROGRA~1/R/R-devel/bin/R"
--vanilla --slave)$(info test1 is $(test1))$(info test2 is $(test2))$(info
test3 is $(test3))*
```

I have no problem running the file using GUN make or installing the package
on R 3.6, both give the same result.
```
*C:\Rtools\mingw_64\bin\mingw32-make.exe  *



*test1 is [1] 0.3427626 0.8027041 0.5611914test2 is [1] 0.9904205 0.3922129
0.5970083test3 is [1] 0.3469528 0.1993838 0.8434841mingw32-make: *** No
targets.  Stop.*
*```*

However, on the devel version of R, it cannot recognize both the full and
short path of R and gives an error
```




*test1 is  [1] 0.42686376 0.84126831 0.09538047The filename, directory
name, or volume label syntax is incorrect.test2 isThe filename, directory
name, or volume label syntax is incorrect.test3 is*
```

I found this issue because my package needs to call R functions in the
makefile. The code is similar to:
```
*  myvar = $(shell echo 'runif(3)'|"${R_HOME}/bin/R" --vanilla --slave)*
```
Since *R_HOME *is set to *C:/PROGRA~1/R/R-devel/*, this will result in the
same error as I mentioned above. I do not know whether this is intentional.
If so, what is the correct way to call R function in a makefile?

Best,
Jiefei

	[[alternative HTML version deleted]]



More information about the R-devel mailing list