Unverified Commit 981853b1 authored by Nikita Titov's avatar Nikita Titov Committed by GitHub
Browse files

[ci] Add checks that OpenMP is used in R-package builds (#4538)

parent a036c130
...@@ -200,17 +200,23 @@ if grep -q -E "NOTE|WARNING|ERROR" "$LOG_FILE_NAME"; then ...@@ -200,17 +200,23 @@ if grep -q -E "NOTE|WARNING|ERROR" "$LOG_FILE_NAME"; then
exit -1 exit -1
fi fi
# this check makes sure that CI builds of the CRAN package on Mac # this check makes sure that CI builds of the package actually use OpenMP
# actually use OpenMP
if [[ $OS_NAME == "macos" ]] && [[ $R_BUILD_TYPE == "cran" ]]; then if [[ $OS_NAME == "macos" ]] && [[ $R_BUILD_TYPE == "cran" ]]; then
omp_working=$( omp_working=$(
cat $BUILD_LOG_FILE \ cat $BUILD_LOG_FILE \
| grep --count -E "checking whether OpenMP will work .*yes" | grep --count -E "checking whether OpenMP will work .*yes"
) )
if [[ $omp_working -ne 1 ]]; then elif [[ $R_BUILD_TYPE == "cmake" ]]; then
echo "OpenMP was not found, and should be when testing the CRAN package on macOS" omp_working=$(
exit -1 cat $BUILD_LOG_FILE \
fi | 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 fi
# this check makes sure that CI builds of the CRAN package # this check makes sure that CI builds of the CRAN package
......
...@@ -250,6 +250,15 @@ if ($env:R_BUILD_TYPE -eq "cran") { ...@@ -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") { if ($env:COMPILER -eq "MSVC") {
Write-Output "Running tests with testthat.R" Write-Output "Running tests with testthat.R"
cd R-package/tests cd R-package/tests
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment