Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
a78e3ed0
Unverified
Commit
a78e3ed0
authored
Mar 15, 2020
by
James Lamb
Committed by
GitHub
Mar 15, 2020
Browse files
[R-package] added command to remove build/ dir in install.libs.R (#2909)
parent
4aa888c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
R-package/src/install.libs.R
R-package/src/install.libs.R
+20
-7
No files found.
R-package/src/install.libs.R
View file @
a78e3ed0
...
...
@@ -20,16 +20,19 @@ if (!file.copy("../inst/bin/CMakeLists.txt", "CMakeLists.txt", overwrite = TRUE)
stop
(
"Copying CMakeLists failed"
)
}
# Get some paths
source_dir
<-
file.path
(
R_PACKAGE_SOURCE
,
"src"
,
fsep
=
"/"
)
build_dir
<-
file.path
(
source_dir
,
"build"
,
fsep
=
"/"
)
# Check for precompilation
if
(
!
use_precompile
)
{
# Check repository content
source_dir
<-
file.path
(
R_PACKAGE_SOURCE
,
"src"
,
fsep
=
"/"
)
setwd
(
source_dir
)
# Prepare building package
build_dir
<-
file.path
(
source_dir
,
"build"
,
fsep
=
"/"
)
dir.create
(
build_dir
,
recursive
=
TRUE
,
showWarnings
=
FALSE
)
dir.create
(
build_dir
,
recursive
=
TRUE
,
showWarnings
=
FALSE
)
setwd
(
build_dir
)
# Prepare installation steps
...
...
@@ -142,8 +145,18 @@ 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
))
{
cat
(
"Found library file: "
,
src
,
" to move to "
,
dest
,
sep
=
""
)
print
(
paste0
(
"Found library file: "
,
src
,
" to move to "
,
dest
)
)
file.copy
(
src
,
dest
,
overwrite
=
TRUE
)
}
else
{
stop
(
paste0
(
"Cannot find lib_lightgbm"
,
SHLIB_EXT
))
}
# clean up the "build" directory
if
(
dir.exists
(
build_dir
))
{
print
(
"Removing 'build/' directory"
)
unlink
(
x
=
file.path
(
R_PACKAGE_SOURCE
,
"src"
,
"build"
)
,
recursive
=
TRUE
,
force
=
TRUE
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment