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

[R-package] Fallback to MinGW when VS build fails #664

Merged
merged 15 commits into from
Jul 13, 2017
Merged
1 change: 1 addition & 0 deletions R-package/src/install.libs.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ if (!use_precompile) {
cmake_cmd <- paste0(cmake_base, " -DCMAKE_GENERATOR_PLATFORM=x64 ")
tryVS <- system(paste0(cmake_cmd, " .."))
if (tryVS == 1) {
system("rm -rf .")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure the rm -rf can work in windows or not. you can use unlink("./*", recursive = TRUE)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works with your method.

rm rf works, but I was denied access to remove . or .. apparently.

cmake_cmd <- paste0(cmake_base, " -G \"MinGW Makefiles\" ") # Switch to MinGW on failure, try build once
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to remove all cmake caches if last camke is fail. you can delete all contents in build folder.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know where is the build folder in all the folders? I can't seem to get rid of it.

Objective would be:

  • try VS build
  • if VS build fails, try MinGW build but delete build folder first (I don't know where is the build folder in all the folders)

system(paste0(cmake_cmd, " ..")) # Must build twice for Windows due sh.exe in Rtools
}
Expand Down