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
981853b1
Unverified
Commit
981853b1
authored
Aug 20, 2021
by
Nikita Titov
Committed by
GitHub
Aug 19, 2021
Browse files
[ci] Add checks that OpenMP is used in R-package builds (#4538)
parent
a036c130
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
.ci/test_r_package.sh
.ci/test_r_package.sh
+12
-6
.ci/test_r_package_windows.ps1
.ci/test_r_package_windows.ps1
+9
-0
No files found.
.ci/test_r_package.sh
View file @
981853b1
...
...
@@ -200,17 +200,23 @@ if grep -q -E "NOTE|WARNING|ERROR" "$LOG_FILE_NAME"; then
exit
-1
fi
# this check makes sure that CI builds of the CRAN package on Mac
# actually use OpenMP
# this check makes sure that CI builds of the package actually use OpenMP
if
[[
$OS_NAME
==
"macos"
]]
&&
[[
$R_BUILD_TYPE
==
"cran"
]]
;
then
omp_working
=
$(
cat
$BUILD_LOG_FILE
\
|
grep
--count
-E
"checking whether OpenMP will work .*yes"
)
if
[[
$omp_working
-ne
1
]]
;
then
echo
"OpenMP was not found, and should be when testing the CRAN package on macOS"
exit
-1
fi
elif
[[
$R_BUILD_TYPE
==
"cmake"
]]
;
then
omp_working
=
$(
cat
$BUILD_LOG_FILE
\
|
grep
--count
-E
".*Found OpenMP: TRUE.*"
)
else
omp_working
=
1
fi
if
[[
$omp_working
-ne
1
]]
;
then
echo
"OpenMP was not found"
exit
-1
fi
# this check makes sure that CI builds of the CRAN package
...
...
.ci/test_r_package_windows.ps1
View file @
981853b1
...
...
@@ -250,6 +250,15 @@ if ($env:R_BUILD_TYPE -eq "cran") {
}
}
# Checking that OpenMP is actually used in CMake builds.
if
(
$
env
:
R_BUILD_TYPE
-eq
"cmake"
)
{
$checks
=
Select-String
-Path
"
${INSTALL_LOG_FILE_NAME}
"
-Pattern
".*Found OpenMP: TRUE.*"
if
(
$checks
.
Matches
.
length
-eq
0
)
{
Write-Output
"OpenMP wasn't found. Check the build logs."
Check-Output
$False
}
}
if
(
$
env
:
COMPILER
-eq
"MSVC"
)
{
Write-Output
"Running tests with testthat.R"
cd
R-package/tests
...
...
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