mrc-ide / didehpc

:cloud::computer::cloud: Support for the DIDE cluster
http://mrc-ide.github.io/didehpc
Other
10 stars 4 forks source link

Avoid stan path warning #8

Closed richfitz closed 3 years ago

richfitz commented 8 years ago

rstan's rtools detection does not seem to pick up Rtools in the location that we put it.

It finds gcc in T:\Rtools\Rtools33\gcc-4.6.3\bin but finds ls in C:'\windows so rstan gives a warning that it can't be found. However PATH seems correct as

"T:\\Rtools\\Rtools33\\bin;T:\\Rtools\\Rtools33\\gcc-4.6.3\\bin;C:\\Program Files (x86)\\Common Files\\libhmsbeagle\\;C:\\Program Files\\Microsoft MPI\\Bin\\;C:\\Program Files\\Microsoft HPC Pack 2012\\Bin\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Dell\\SysMgt\\oma\\bin;C:\\Program Files\\Dell\\SysMgt\\shared\\bin;C:\\Program Files\\Dell\\SysMgt\\idrac;C:\\Program Files\\Mellanox\\\\WinMFT\\;;C:\\Program Files\\R\\R-3.2.4revised\\bin\\x64"
richfitz commented 8 years ago

Weirdly, even this doesn't work:

tt <- obj$enqueue({
  Sys.setenv(PATH=paste0("\\\\fi--didef2\\tmp\\Rtools\\Rtools33\\bin;",
                         Sys.getenv("PATH")))
  Sys.which("ls")})
tt$wait(100)

Still finding the windows one. But the Rtools ls does work if called directly....

richfitz commented 8 years ago

I bet this is a system specific thing actually.

richfitz commented 8 years ago

Scanning through the R source, looks like Sys.which on windows goes through do_syswhich (src/gnuwin32/run.c) which calls expandcmd (same file) which passes off to the windows API function SearchPath

https://msdn.microsoft.com/en-us/library/windows/desktop/aa365527(v=vs.85).aspx

That function says that the system path is searched first, which is also the case in this old KB article

How the path is built

The Path is constructed from the system path, which can be viewed in the System Environment Variables field in the System dialog box. The User path is appended to the system path. Then the path from the AUTOEXEC.BAT file is appended.

richfitz commented 3 years ago

noone has reported this recently and stan has changed how it does compiler detections a bajillionty times