Skip to content

Commit

Permalink
[R-package] Singlethread make to lower RAM usage significantly (#1141)
Browse files Browse the repository at this point in the history
* Singlethread make to lower RAM usage significantly

* Update install.libs.R
  • Loading branch information
Laurae2 authored and guolinke committed Dec 27, 2017
1 parent f1f18dd commit a5f43c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R-package/src/install.libs.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if (!use_precompile) {

# Prepare installation steps
cmake_cmd <- "cmake "
build_cmd <- "make _lightgbm -j"
build_cmd <- "make _lightgbm"
lib_folder <- file.path(R_PACKAGE_SOURCE, "src", fsep = "/")

if (use_gpu) {
Expand All @@ -52,7 +52,7 @@ if (!use_precompile) {
if (WINDOWS) {
if (use_mingw) {
cmake_cmd <- paste0(cmake_cmd, " -G \"MinGW Makefiles\" ")
build_cmd <- "mingw32-make.exe _lightgbm -j"
build_cmd <- "mingw32-make.exe _lightgbm"
system(paste0(cmake_cmd, " ..")) # Must build twice for Windows due sh.exe in Rtools
} else {
try_vs <- 0
Expand All @@ -72,7 +72,7 @@ if (!use_precompile) {
if (try_vs == 1) {
cmake_cmd <- paste0(cmake_cmd, " -G \"MinGW Makefiles\" ") # Switch to MinGW on failure, try build once
system(paste0(cmake_cmd, " ..")) # Must build twice for Windows due sh.exe in Rtools
build_cmd <- "mingw32-make.exe _lightgbm -j"
build_cmd <- "mingw32-make.exe _lightgbm"
} else {
cmake_cmd <- paste0(cmake_cmd, local_vs_def)
build_cmd <- "cmake --build . --target _lightgbm --config Release"
Expand Down

0 comments on commit a5f43c9

Please sign in to comment.