Skip to content

Commit 5b6284e

Browse files
committed
Expand macOS detection for OpenMP
1 parent d56d40f commit 5b6284e

File tree

2 files changed

+31
-6
lines changed

2 files changed

+31
-6
lines changed

configure

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3294,7 +3294,15 @@ printf "%s\n" "found" >&6; }
32943294
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: OpenMP unavailable and turned off." >&5
32953295
printf "%s\n" "$as_me: WARNING: OpenMP unavailable and turned off." >&2;}
32963296
can_use_openmp="no"
3297+
else
3298+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5
3299+
printf "%s\n" "not found" >&6; }
3300+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Case of not 'apple_compiler'" >&5
3301+
printf "%s\n" "$as_me: WARNING: Case of not 'apple_compiler'" >&2;}
32973302
fi
3303+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Compiler is'" >&5
3304+
printf "%s\n" "$as_me: WARNING: Compiler is'" >&2;}
3305+
$(${CXX} --version)
32983306
else
32993307
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5
33003308
printf "%s\n" "not found" >&6; }
@@ -3303,9 +3311,15 @@ fi
33033311
if test x"${can_use_openmp}" = x"yes"; then
33043312
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OpenMP" >&5
33053313
printf %s "checking for OpenMP... " >&6; }
3306-
## if R has -fopenmp we should be good
3307-
allldflags=$(${R_HOME}/bin/R CMD config --ldflags)
3308-
hasOpenMP=$(echo ${allldflags} | grep -- -fopenmp)
3314+
if test x"${RSysinfoName}" = x"Darwin"; then
3315+
## if R has ~/.R/Makevars set we might good on macOS
3316+
allldflags=$(${R_HOME}/bin/R CMD config --ldflags)
3317+
hasOpenMP=$(echo ${allldflags} | grep -- -fopenmp)
3318+
else
3319+
## if R has -fopenmp we should be good (non macOS)
3320+
allldflags=$(${R_HOME}/bin/R CMD config --ldflags)
3321+
hasOpenMP=$(echo ${allldflags} | grep -- -lomp)
3322+
fi
33093323
if test x"${hasOpenMP}" = x""; then
33103324
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: missing" >&5
33113325
printf "%s\n" "missing" >&6; }

configure.ac

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,27 @@ if test x"${RSysinfoName}" = x"Darwin"; then
8787
AC_MSG_RESULT([found])
8888
AC_MSG_WARN([OpenMP unavailable and turned off.])
8989
can_use_openmp="no"
90+
else
91+
AC_MSG_RESULT([not found])
92+
AC_MSG_WARN([Case of not 'apple_compiler'])
9093
fi
94+
AC_MSG_WARN([Compiler is'])
95+
$(${CXX} --version)
9196
else
9297
AC_MSG_RESULT([not found])
9398
fi
9499

95100
if test x"${can_use_openmp}" = x"yes"; then
96101
AC_MSG_CHECKING([for OpenMP])
97-
## if R has -fopenmp we should be good
98-
allldflags=$(${R_HOME}/bin/R CMD config --ldflags)
99-
hasOpenMP=$(echo ${allldflags} | grep -- -fopenmp)
102+
if test x"${RSysinfoName}" = x"Darwin"; then
103+
## if R has ~/.R/Makevars set we might good on macOS
104+
allldflags=$(${R_HOME}/bin/R CMD config --ldflags)
105+
hasOpenMP=$(echo ${allldflags} | grep -- -fopenmp)
106+
else
107+
## if R has -fopenmp we should be good (non macOS)
108+
allldflags=$(${R_HOME}/bin/R CMD config --ldflags)
109+
hasOpenMP=$(echo ${allldflags} | grep -- -lomp)
110+
fi
100111
if test x"${hasOpenMP}" = x""; then
101112
AC_MSG_RESULT([missing])
102113
arma_have_openmp="#define ARMA_DONT_USE_OPENMP 1"

0 commit comments

Comments
 (0)