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
7f71c96c
Unverified
Commit
7f71c96c
authored
Mar 22, 2020
by
James Lamb
Committed by
GitHub
Mar 22, 2020
Browse files
[R-package] fixed some minor issues with testing on Windows (#2908)
parent
c6245ed4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
7 deletions
+20
-7
.gitignore
.gitignore
+2
-0
R-package/src/install.libs.R
R-package/src/install.libs.R
+17
-6
R-package/tests/testthat/test_lgb.Booster.R
R-package/tests/testthat/test_lgb.Booster.R
+1
-1
No files found.
.gitignore
View file @
7f71c96c
...
@@ -400,6 +400,8 @@ python-package/lightgbm/VERSION.txt
...
@@ -400,6 +400,8 @@ python-package/lightgbm/VERSION.txt
R-package/src/CMakeLists.txt
R-package/src/CMakeLists.txt
R-package/src/lib_lightgbm.so.dSYM/
R-package/src/lib_lightgbm.so.dSYM/
R-package/src/src/
R-package/src/src/
R-package/src-x64
R-package/src-i386
lightgbm_r/*
lightgbm_r/*
lightgbm*.tar.gz
lightgbm*.tar.gz
lightgbm.Rcheck/
lightgbm.Rcheck/
...
...
R-package/src/install.libs.R
View file @
7f71c96c
...
@@ -4,7 +4,7 @@ use_gpu <- FALSE
...
@@ -4,7 +4,7 @@ use_gpu <- FALSE
use_mingw
<-
FALSE
use_mingw
<-
FALSE
if
(
.Machine
$
sizeof.pointer
!=
8L
)
{
if
(
.Machine
$
sizeof.pointer
!=
8L
)
{
stop
(
"
O
nly support 64-bit R, please check
your
the version of
your
R and Rtools."
)
stop
(
"
LightGBM o
nly support
s
64-bit R, please check the version of R and Rtools."
)
}
}
R_int_UUID
<-
.Internal
(
internalsID
())
R_int_UUID
<-
.Internal
(
internalsID
())
...
@@ -16,8 +16,13 @@ if (!(R_int_UUID == "0310d4b8-ccb1-4bb8-ba94-d36a55f60262"
...
@@ -16,8 +16,13 @@ if (!(R_int_UUID == "0310d4b8-ccb1-4bb8-ba94-d36a55f60262"
}
}
# Move in CMakeLists.txt
# Move in CMakeLists.txt
if
(
!
file.copy
(
"../inst/bin/CMakeLists.txt"
,
"CMakeLists.txt"
,
overwrite
=
TRUE
))
{
write_succeeded
<-
file.copy
(
stop
(
"Copying CMakeLists failed"
)
"../inst/bin/CMakeLists.txt"
,
"CMakeLists.txt"
,
overwrite
=
TRUE
)
if
(
!
write_succeeded
)
{
stop
(
"Copying CMakeLists.txt failed"
)
}
}
# Get some paths
# Get some paths
...
@@ -55,22 +60,28 @@ if (!use_precompile) {
...
@@ -55,22 +60,28 @@ if (!use_precompile) {
build_cmd
<-
"mingw32-make.exe _lightgbm"
build_cmd
<-
"mingw32-make.exe _lightgbm"
system
(
paste0
(
cmake_cmd
,
" .."
))
# Must build twice for Windows due sh.exe in Rtools
system
(
paste0
(
cmake_cmd
,
" .."
))
# Must build twice for Windows due sh.exe in Rtools
}
else
{
}
else
{
try_vs
<-
0L
local_vs_def
<-
""
local_vs_def
<-
""
vs_versions
<-
c
(
"Visual Studio 16 2019"
,
"Visual Studio 15 2017"
,
"Visual Studio 14 2015"
)
vs_versions
<-
c
(
"Visual Studio 16 2019"
,
"Visual Studio 15 2017"
,
"Visual Studio 14 2015"
)
for
(
vs
in
vs_versions
)
{
for
(
vs
in
vs_versions
)
{
print
(
paste0
(
"Trying to build with: '"
,
vs
,
"'"
))
vs_def
<-
paste0
(
" -G \""
,
vs
,
"\" -A x64"
)
vs_def
<-
paste0
(
" -G \""
,
vs
,
"\" -A x64"
)
tmp_cmake_cmd
<-
paste0
(
cmake_cmd
,
vs_def
)
tmp_cmake_cmd
<-
paste0
(
cmake_cmd
,
vs_def
)
try_vs
<-
system
(
paste0
(
tmp_cmake_cmd
,
" .."
))
try_vs
<-
system
(
paste0
(
tmp_cmake_cmd
,
" .."
))
if
(
try_vs
==
0L
)
{
if
(
try_vs
==
0L
)
{
local_vs_def
<-
vs_def
local_vs_def
<-
vs_def
print
(
paste0
(
"Building with '"
,
vs
,
"' succeeded"
))
break
break
}
else
{
}
else
{
unlink
(
"./*"
,
recursive
=
TRUE
)
# Clean up build directory
unlink
(
"./*"
,
recursive
=
TRUE
)
# Clean up build directory
}
}
}
}
if
(
try_vs
==
1L
)
{
if
(
try_vs
==
1L
)
{
cmake_cmd
<-
paste0
(
cmake_cmd
,
" -G \"MinGW Makefiles\" "
)
# Switch to MinGW on failure, try build once
print
(
"Building with Visual Studio failed. Attempted with MinGW"
)
cmake_cmd
<-
paste0
(
cmake_cmd
,
" -G \"MinGW Makefiles\" "
)
system
(
paste0
(
cmake_cmd
,
" .."
))
# Must build twice for Windows due sh.exe in Rtools
system
(
paste0
(
cmake_cmd
,
" .."
))
# Must build twice for Windows due sh.exe in Rtools
build_cmd
<-
"mingw32-make.exe _lightgbm"
build_cmd
<-
"mingw32-make.exe _lightgbm"
}
else
{
}
else
{
...
...
R-package/tests/testthat/test_lgb.Booster.R
View file @
7f71c96c
...
@@ -86,5 +86,5 @@ test_that("lgb.get.eval.result() should throw an informative error for incorrect
...
@@ -86,5 +86,5 @@ test_that("lgb.get.eval.result() should throw an informative error for incorrect
,
data_name
=
"test"
,
data_name
=
"test"
,
eval_name
=
"l1"
,
eval_name
=
"l1"
)
)
},
regexp
=
"Only the following eval_names exist for dataset
'test':
[l2]"
,
fixed
=
TRU
E
)
},
regexp
=
"Only the following eval_names exist for dataset
.*\\: \\
[l2
\\
]"
,
fixed
=
FALS
E
)
})
})
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