Skip to content

Commit

Permalink
introduced fix for non-portable Makefiles generated by cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Nov 5, 2019
1 parent 250c928 commit 1ff05f1
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions R-package/src/install.libs.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,32 @@ if (!use_precompile) {

# Install
system(paste0(cmake_cmd, " .."))

# R CMD check complains about the .NOTPARALLEL directive created in the cmake
# Makefile. We don't need it here anyway since targets are built serially, so trying
# to remove it with this hack
generated_makefile <- file.path(
R_PACKAGE_SOURCE
, "src"
, "build"
, "Makefile"
)
if (file.exists(generated_makefile)) {
makefile_txt <- readLines(
con = generated_makefile
)
makefile_txt <- gsub(
pattern = ".*NOTPARALLEL.*"
, replacement = ""
, x = makefile_txt
)
writeLines(
text = makefile_txt
, con = generated_makefile
, sep = "\n"
)
}

system(build_cmd)
src <- file.path(lib_folder, paste0("lib_lightgbm", SHLIB_EXT), fsep = "/")

Expand Down

0 comments on commit 1ff05f1

Please sign in to comment.