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] parallelize compilation in CMake-based builds #4525

Merged
merged 12 commits into from
Nov 10, 2021
6 changes: 3 additions & 3 deletions R-package/src/install.libs.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ if (WINDOWS && use_visual_studio) {
# Prepare installation steps
cmake_args <- NULL
build_cmd <- "make"
build_args <- "_lightgbm"
build_args <- "_lightgbm -j4"
jameslamb marked this conversation as resolved.
Show resolved Hide resolved
lib_folder <- file.path(source_dir, fsep = "/")

# add in command-line arguments
Expand Down Expand Up @@ -194,7 +194,7 @@ if (WINDOWS) {
cmake_args <- c(cmake_args, "-G", shQuote(windows_makefile_generator))
.run_shell_command("cmake", c(cmake_args, ".."), strict = FALSE)
build_cmd <- windows_build_tool
build_args <- "_lightgbm"
build_args <- "_lightgbm -j4"
jameslamb marked this conversation as resolved.
Show resolved Hide resolved
} else {
visual_studio_succeeded <- .generate_vs_makefiles(cmake_args)
if (!isTRUE(visual_studio_succeeded)) {
Expand All @@ -203,7 +203,7 @@ if (WINDOWS) {
cmake_args <- c(cmake_args, "-G", shQuote(windows_makefile_generator))
.run_shell_command("cmake", c(cmake_args, ".."), strict = FALSE)
build_cmd <- windows_build_tool
build_args <- "_lightgbm"
build_args <- "_lightgbm -j4"
jameslamb marked this conversation as resolved.
Show resolved Hide resolved
} else {
build_cmd <- "cmake"
build_args <- c("--build", ".", "--target", "_lightgbm", "--config", "Release")
Expand Down