Skip to content

Commit 44c085d

Browse files
committed
More eager test for /usr/local/lib/libomp.dylib
Don't assume that only Clang 17 needs /usr/local/lib/libomp.dylib. If it exists and passes the test, use it. Otherwise our tests may immediately break next time Apple ships a new compiler.
1 parent 323c826 commit 44c085d

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

configure

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,15 @@ detect_openmp () {
135135
"-L${HOMEBREW_PREFIX}/opt/libomp/lib -lomp" \
136136
&& return
137137

138-
if "${CC}" --version | grep -q 'Apple clang 17'; then
139-
test -e /usr/local/lib/libomp.dylib \
140-
&& test_openmp_variant "-Xclang -fopenmp" "/usr/local/lib/libomp.dylib" \
141-
&& return
142-
echo "*** All OpenMP runtime tests failed and you're running Apple clang 17."
143-
echo "*** Do you need a new OpenMP runtime from <https://mac.r-project.org/openmp/>?"
138+
if test -e /usr/local/lib/libomp.dylib \
139+
&& test_openmp_variant "-Xclang -fopenmp" "/usr/local/lib/libomp.dylib"; then
140+
echo "*** Using the OpenMP runtime from /usr/local/lib/libomp.dylib."
141+
echo "*** Please be careful when mixing the result with CRAN binaries."
142+
return
144143
fi
144+
145+
echo "*** All OpenMP tests failed and you're running macOS."
146+
echo "*** Do you need an OpenMP runtime from <https://mac.r-project.org/openmp/>?"
145147
;;
146148
esac
147149

0 commit comments

Comments
 (0)