Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepend PATH with path to RTools on Windows #259

Closed
rok-cesnovar opened this issue Jul 29, 2020 · 5 comments · Fixed by #289
Closed

Prepend PATH with path to RTools on Windows #259

rok-cesnovar opened this issue Jul 29, 2020 · 5 comments · Fixed by #289
Assignees
Labels
feature New feature or request windows

Comments

@rok-cesnovar
Copy link
Member

We have seen a few issues from users that turned out to be muliple g++ installed on the system. Typically some MinGw install or something along those lines.

What we could do is try to prepend the path to rtools on the front of PATH (like we do for TBB) which would then force the use of the right compiler.

We would check the usual paths to rtools and if found use it. If the user installed it in some non-typical location, then we would not prepend it.

@rok-cesnovar rok-cesnovar added feature New feature or request windows labels Jul 29, 2020
@rok-cesnovar rok-cesnovar added this to the v1.0.0 - release milestone Jul 29, 2020
@rok-cesnovar rok-cesnovar self-assigned this Jul 29, 2020
@jgabry
Copy link
Member

jgabry commented Jul 29, 2020

I don't know much about this topic, but that sounds ok to me if you think it's a good idea

@andrjohns
Copy link
Collaborator

Not sure whether is what you're talking about, but for Windows there's an RTOOLS40_HOME environment variable that gives the install directory for Rtools (I believe the equivalent for version 3.5 and lower is RTOOLS_HOME), which could simplify finding the right compiler

@rok-cesnovar
Copy link
Member Author

Good call. RTOOLS40_HOME is definitely something we could rely on. We do have to double-check if this gets set for all RTools 4.0 installs. Hopefully, there is no way of not setting it. If that is the case, then it should be easy for R 4.0.

@rok-cesnovar
Copy link
Member Author

rok-cesnovar commented Aug 10, 2020

Ok, silly me. As @andrjohns pointed out, prepending PATH is actually what RTools 4.0 suggests upon installing (see https://cran.r-project.org/bin/windows/Rtools/#putting-rtools-on-the-path)

writeLines('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"', con = "~/.Renviron")

So maybe we should just check if the user did that? And if they did not, do it for them or suggest they do it themselves?

@jgabry
Copy link
Member

jgabry commented Aug 10, 2020

Sounds good to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants