Skip to content

Commit

Permalink
switch print() to message() in in install.libs.R
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed May 13, 2020
1 parent a15a0a1 commit a1d2596
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions R-package/src/install.libs.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ R_ver <- as.double(R.Version()$major) + as.double(R.Version()$minor) / 10.0

if (!(R_int_UUID == "0310d4b8-ccb1-4bb8-ba94-d36a55f60262"
|| R_int_UUID == "2fdf6c18-697a-4ba7-b8ef-11c0d92f1327")) {
print("Warning: unmatched R_INTERNALS_UUID, may not run normally.")
warning("Warning: unmatched R_INTERNALS_UUID, may not run normally.")
}

# system() will not raise an R exception if the process called
Expand Down Expand Up @@ -63,7 +63,7 @@ if (!(R_int_UUID == "0310d4b8-ccb1-4bb8-ba94-d36a55f60262"
)
working_vs_version <- NULL
for (vs_version in vs_versions) {
print(sprintf("Trying '%s'", vs_version))
message(sprintf("Trying '%s'", vs_version))
# if the build directory is not empty, clean it
if (file.exists("CMakeCache.txt")) {
file.remove("CMakeCache.txt")
Expand All @@ -77,7 +77,7 @@ if (!(R_int_UUID == "0310d4b8-ccb1-4bb8-ba94-d36a55f60262"
)
exit_code <- .run_shell_command("cmake", c(vs_cmake_args, ".."), strict = FALSE)
if (exit_code == 0L) {
print(sprintf("Successfully created build files for '%s'", vs_version))
message(sprintf("Successfully created build files for '%s'", vs_version))
return(invisible(TRUE))
}

Expand Down Expand Up @@ -140,7 +140,7 @@ if (!use_precompile) {
# Check if Windows installation (for gcc vs Visual Studio)
if (WINDOWS) {
if (use_mingw) {
print("Trying to build with MinGW")
message("Trying to build with MinGW")
# Must build twice for Windows due sh.exe in Rtools
cmake_args <- c(cmake_args, "-G", shQuote("MinGW Makefiles"))
.run_shell_command("cmake", c(cmake_args, ".."), strict = FALSE)
Expand All @@ -149,7 +149,7 @@ if (!use_precompile) {
} else {
visual_studio_succeeded <- .generate_vs_makefiles(cmake_args)
if (!isTRUE(visual_studio_succeeded)) {
print("Building with Visual Studio failed. Attempting with MinGW")
message("Building with Visual Studio failed. Attempting with MinGW")
# Must build twice for Windows due sh.exe in Rtools
cmake_args <- c(cmake_args, "-G", shQuote("MinGW Makefiles"))
.run_shell_command("cmake", c(cmake_args, ".."), strict = FALSE)
Expand Down Expand Up @@ -234,7 +234,7 @@ if (!use_precompile) {
dest <- file.path(R_PACKAGE_DIR, paste0("libs", R_ARCH), fsep = "/")
dir.create(dest, recursive = TRUE, showWarnings = FALSE)
if (file.exists(src)) {
print(paste0("Found library file: ", src, " to move to ", dest))
message(paste0("Found library file: ", src, " to move to ", dest))
file.copy(src, dest, overwrite = TRUE)

symbols_file <- file.path(source_dir, "symbols.rds")
Expand All @@ -248,7 +248,7 @@ if (file.exists(src)) {

# clean up the "build" directory
if (dir.exists(build_dir)) {
print("Removing 'build/' directory")
message("Removing 'build/' directory")
unlink(
x = build_dir
, recursive = TRUE
Expand Down

0 comments on commit a1d2596

Please sign in to comment.