Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Check for MM_PREFETCH and MM_MALLOC not only in CRAN builds #4540

Merged
merged 1 commit into from
Aug 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions .ci/test_r_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -219,30 +219,40 @@ if [[ $omp_working -ne 1 ]]; then
exit -1
fi

# this check makes sure that CI builds of the CRAN package
# this check makes sure that CI builds of the package
# actually use MM_PREFETCH preprocessor definition
if [[ $R_BUILD_TYPE == "cran" ]]; then
mm_prefetch_working=$(
cat $BUILD_LOG_FILE \
| grep --count -E "checking whether MM_PREFETCH work.*yes"
)
if [[ $mm_prefetch_working -ne 1 ]]; then
echo "MM_PREFETCH test was not passed, and should be when testing the CRAN package"
exit -1
fi
else
mm_prefetch_working=$(
cat $BUILD_LOG_FILE \
| grep --count -E ".*Performing Test MM_PREFETCH - Success"
)
fi
if [[ $mm_prefetch_working -ne 1 ]]; then
echo "MM_PREFETCH test was not passed"
exit -1
fi

# this check makes sure that CI builds of the CRAN package
# this check makes sure that CI builds of the package
# actually use MM_MALLOC preprocessor definition
if [[ $R_BUILD_TYPE == "cran" ]]; then
mm_malloc_working=$(
cat $BUILD_LOG_FILE \
| grep --count -E "checking whether MM_MALLOC work.*yes"
)
if [[ $mm_malloc_working -ne 1 ]]; then
echo "MM_MALLOC test was not passed, and should be when testing the CRAN package"
exit -1
fi
else
mm_malloc_working=$(
cat $BUILD_LOG_FILE \
| grep --count -E ".*Performing Test MM_MALLOC - Success"
)
fi
if [[ $mm_malloc_working -ne 1 ]]; then
echo "MM_MALLOC test was not passed"
exit -1
fi

# this check makes sure that no "warning: unknown pragma ignored" logs
Expand Down
32 changes: 22 additions & 10 deletions .ci/test_r_package_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -232,22 +232,34 @@ if (($env:COMPILER -eq "MINGW") -and ($env:R_BUILD_TYPE -eq "cmake")) {
}
}

# Checking that MM_PREFETCH preprocessor definition is actually used in CRAN builds.
# Checking that MM_PREFETCH preprocessor definition is actually used in CI builds.
if ($env:R_BUILD_TYPE -eq "cran") {
$checks = Select-String -Path "${INSTALL_LOG_FILE_NAME}" -Pattern "checking whether MM_PREFETCH work.*yes"
if ($checks.Matches.length -eq 0) {
Write-Output "MM_PREFETCH preprocessor definition wasn't used. Check the build logs."
Check-Output $False
}
$checks_cnt = $checks.Matches.length
} elseif ($env:TOOLCHAIN -ne "MSVC") {
$checks = Select-String -Path "${INSTALL_LOG_FILE_NAME}" -Pattern ".*Performing Test MM_PREFETCH - Success"
$checks_cnt = $checks.Matches.length
} else {
$checks_cnt = 1
}
if ($checks_cnt -eq 0) {
Write-Output "MM_PREFETCH preprocessor definition wasn't used. Check the build logs."
Check-Output $False
}

# Checking that MM_MALLOC preprocessor definition is actually used in CRAN builds.
# Checking that MM_MALLOC preprocessor definition is actually used in CI builds.
if ($env:R_BUILD_TYPE -eq "cran") {
$checks = Select-String -Path "${INSTALL_LOG_FILE_NAME}" -Pattern "checking whether MM_MALLOC work.*yes"
if ($checks.Matches.length -eq 0) {
Write-Output "MM_MALLOC preprocessor definition wasn't used. Check the build logs."
Check-Output $False
}
$checks_cnt = $checks.Matches.length
} elseif ($env:TOOLCHAIN -ne "MSVC") {
$checks = Select-String -Path "${INSTALL_LOG_FILE_NAME}" -Pattern ".*Performing Test MM_MALLOC - Success"
$checks_cnt = $checks.Matches.length
} else {
$checks_cnt = 1
}
if ($checks_cnt -eq 0) {
Write-Output "MM_MALLOC preprocessor definition wasn't used. Check the build logs."
Check-Output $False
}

# Checking that OpenMP is actually used in CMake builds.
Expand Down