r-windows / docs

Documentation for rtools40 and R for Windows
31 stars 10 forks source link

How do I report a bug in the Rtools 4.0 Windows setup? #23

Closed marcoxa closed 3 years ago

marcoxa commented 3 years ago

Hi

this came up while installing an update for "ps" in the lastest R/Rtools/Rstudio combination. I am posting here because I was not able to find a place where to send the bug report (hint: add a pointer in the documentation).

I was then able to reproduce it on a simpler case. Bottom line: while the C compiler package quoting issue was fixed, the loader (ld.exe) was not.

g:\My Drive\Work\Projects\Hacking\elisp\iron-main\tests>"c:\Program Files\R\Rtools40\mingw64\bin\gfortran" hello.f 
"c:\Program Files\R\Rtools40\mingw64\bin\gfortran" hello.f 
c:/Program Files/R/Rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find c:/Program: No such file or directory
c:/Program Files/R/Rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find Files/R/Rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/lib/../lib/default-manifest.o: No such file or directory
collect2.exe: error: ld returned 1 exit status

Any idea about how to fix this?

All the best

Marco Antoniotti

jeroen commented 3 years ago

The best solution is to install rtools in a path without spaces. Preferably the default c:\\rtools40. I'll see if we can improve the quoting situation, but there are many problems with paths that contain spaces, it's just something you should generally avoid with command line tools.

In R we try to always quote the paths to CC/CXX etc where possible. That works for most packages.

jeroen commented 3 years ago

OK there is nothing I can do about this because in your example, the path to LD is implicitly determined by gcc itself, so it is out of our control. If you really want to fix this you need to open an bug report in https://github.com/msys2/MINGW-packages

But really, better just install command line tools in a path without spaces. The R admin manual has several warnings about this.

marcoxa commented 3 years ago

Thank you for your reply. Obviously it is a bug in msys2/MINGW-packages. Even in gcc.

As for the suggestion of installing Rtools in a non standard path, ok, I got that far. It is still a bug, given the current environment.

All the best

Marco Antoniotti