Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit35216c2

Browse files
authored
Merge pull request#219 from kthohr/macOS-openMP
OpenMP-detection on macOS systems
2 parents00f25fb +7fa4bce commit35216c2

File tree

2 files changed

+128
-74
lines changed

2 files changed

+128
-74
lines changed

‎configure‎

Lines changed: 75 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.69 for RcppArmadillo 0.8.499.0.2.
3+
# Generated by GNU Autoconf 2.69 for RcppArmadillo 0.8.499.1.0.
44
#
55
#
66
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -576,8 +576,8 @@ MAKEFLAGS=
576576
# Identity of this package.
577577
PACKAGE_NAME='RcppArmadillo'
578578
PACKAGE_TARNAME='rcpparmadillo'
579-
PACKAGE_VERSION='0.8.499.0.2'
580-
PACKAGE_STRING='RcppArmadillo 0.8.499.0.2'
579+
PACKAGE_VERSION='0.8.499.1.0'
580+
PACKAGE_STRING='RcppArmadillo 0.8.499.1.0'
581581
PACKAGE_BUGREPORT=''
582582
PACKAGE_URL=''
583583

@@ -613,7 +613,6 @@ infodir
613613
docdir
614614
oldincludedir
615615
includedir
616-
runstatedir
617616
localstatedir
618617
sharedstatedir
619618
sysconfdir
@@ -685,7 +684,6 @@ datadir='${datarootdir}'
685684
sysconfdir='${prefix}/etc'
686685
sharedstatedir='${prefix}/com'
687686
localstatedir='${prefix}/var'
688-
runstatedir='${localstatedir}/run'
689687
includedir='${prefix}/include'
690688
oldincludedir='/usr/include'
691689
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -938,15 +936,6 @@ do
938936
| -silent | --silent | --silen | --sile | --sil)
939937
silent=yes ;;
940938

941-
-runstatedir | --runstatedir | --runstatedi | --runstated \
942-
| --runstate | --runstat | --runsta | --runst | --runs \
943-
| --run | --ru | --r)
944-
ac_prev=runstatedir ;;
945-
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
946-
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
947-
| --run=* | --ru=* | --r=*)
948-
runstatedir=$ac_optarg ;;
949-
950939
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
951940
ac_prev=sbindir ;;
952941
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1084,7 +1073,7 @@ fi
10841073
forac_varinexec_prefix prefix bindir sbindir libexecdir datarootdir \
10851074
datadir sysconfdir sharedstatedir localstatedir includedir \
10861075
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1087-
libdir localedir mandir runstatedir
1076+
libdir localedir mandir
10881077
do
10891078
eval ac_val=\$$ac_var
10901079
# Remove trailing slashes.
@@ -1197,7 +1186,7 @@ if test "$ac_init_help" = "long"; then
11971186
# Omit some internal or obsolete options to make the list less imposing.
11981187
# This message is too long to be a string in the A/UX 3.1 sh.
11991188
cat<<_ACEOF
1200-
\`configure' configures RcppArmadillo 0.8.499.0.2 to adapt to many kinds of systems.
1189+
\`configure' configures RcppArmadillo 0.8.499.1.0 to adapt to many kinds of systems.
12011190
12021191
Usage:$0 [OPTION]... [VAR=VALUE]...
12031192
@@ -1237,7 +1226,6 @@ Fine tuning of the installation directories:
12371226
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
12381227
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
12391228
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
1240-
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
12411229
--libdir=DIR object code libraries [EPREFIX/lib]
12421230
--includedir=DIR C header files [PREFIX/include]
12431231
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -1259,7 +1247,7 @@ fi
12591247

12601248
iftest -n"$ac_init_help";then
12611249
case$ac_init_helpin
1262-
short | recursive )echo"Configuration of RcppArmadillo 0.8.499.0.2:";;
1250+
short | recursive )echo"Configuration of RcppArmadillo 0.8.499.1.0:";;
12631251
esac
12641252
cat<<\_ACEOF
12651253
@@ -1339,7 +1327,7 @@ fi
13391327
test -n "$ac_init_help" && exit $ac_status
13401328
if $ac_init_version; then
13411329
cat <<\_ACEOF
1342-
RcppArmadillo configure 0.8.499.0.2
1330+
RcppArmadillo configure 0.8.499.1.0
13431331
generated by GNU Autoconf 2.69
13441332
13451333
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1431,7 +1419,7 @@ cat >config.log <<_ACEOF
14311419
This file contains any messages produced by compilers while
14321420
running configure, to aid debugging if configure makes a mistake.
14331421
1434-
It was created by RcppArmadillo $as_me 0.8.499.0.2, which was
1422+
It was created by RcppArmadillo $as_me 0.8.499.1.0, which was
14351423
generated by GNU Autoconf 2.69. Invocation command line was
14361424
14371425
$ $0 $@
@@ -2738,7 +2726,59 @@ $as_echo "$as_me: WARNING: Compiler self-identifies as being compliant with GNUC
27382726
esac
27392727
fi
27402728
2729+
## Check for Apple LLVM
2730+
2731+
{$as_echo"$as_me:${as_lineno-$LINENO}: checking for macOS">&5
2732+
$as_echo_n"checking for macOS...">&6; }
2733+
RSysinfoName=$("${R_HOME}/bin/Rscript" --vanilla -e'cat(Sys.info()["sysname"])')
2734+
2735+
iftest x"${RSysinfoName}" == x"Darwin";then
2736+
{$as_echo"$as_me:${as_lineno-$LINENO}: result: found">&5
2737+
$as_echo"found">&6; }
2738+
{$as_echo"$as_me:${as_lineno-$LINENO}: checking for macOS Apple compiler">&5
2739+
$as_echo_n"checking for macOS Apple compiler...">&6; }
27412740
2741+
apple_compiler=$($CXX --version2>&1| grep -i -c -e'apple llvm')
2742+
2743+
iftest x"${apple_compiler}" == x"1";then
2744+
{$as_echo"$as_me:${as_lineno-$LINENO}: result: found">&5
2745+
$as_echo"found">&6; }
2746+
{$as_echo"$as_me:${as_lineno-$LINENO}: WARNING: OpenMP unavailable and turned off.">&5
2747+
$as_echo"$as_me: WARNING: OpenMP unavailable and turned off.">&2;}
2748+
can_use_openmp="no"
2749+
else
2750+
{$as_echo"$as_me:${as_lineno-$LINENO}: result: not found">&5
2751+
$as_echo"not found">&6; }
2752+
iftest x"${can_use_openmp}" == x"no";then
2753+
{$as_echo"$as_me:${as_lineno-$LINENO}: checking for clang compiler">&5
2754+
$as_echo_n"checking for clang compiler...">&6; }
2755+
clang_compiler=$($CXX --version2>&1| grep -i -c -e'clang')
2756+
2757+
iftest x"${clang_compiler}" == x"1";then
2758+
{$as_echo"$as_me:${as_lineno-$LINENO}: result: found">&5
2759+
$as_echo"found">&6; }
2760+
{$as_echo"$as_me:${as_lineno-$LINENO}: checking for OpenMP compatible version of clang">&5
2761+
$as_echo_n"checking for OpenMP compatible version of clang...">&6; }
2762+
clang_version=$(${CXX} -v2>&1| awk'/^.*clang version/ {print $3}')
2763+
2764+
case${clang_version}in
2765+
4.*|5.*|6.*|7.*|8.*)
2766+
{$as_echo"$as_me:${as_lineno-$LINENO}: result: found and suitable">&5
2767+
$as_echo"found and suitable">&6; }
2768+
can_use_openmp="yes"
2769+
;;
2770+
*)
2771+
{$as_echo"$as_me:${as_lineno-$LINENO}: result: not found">&5
2772+
$as_echo"not found">&6; }
2773+
{$as_echo"$as_me:${as_lineno-$LINENO}: WARNING: OpenMP unavailable and turned off.">&5
2774+
$as_echo"$as_me: WARNING: OpenMP unavailable and turned off.">&2;}
2775+
can_use_openmp="no"
2776+
;;
2777+
esac
2778+
fi
2779+
fi
2780+
fi
2781+
fi
27422782
27432783
## Check for suitable LAPACK_LIBS
27442784
{$as_echo"$as_me:${as_lineno-$LINENO}: checking LAPACK_LIBS">&5
@@ -2772,37 +2812,22 @@ openmp_flag=""
27722812
## Set the fallback, by default it is nope
27732813
arma_have_openmp="#define ARMA_DONT_USE_OPENMP 1"
27742814
2775-
## Check for broken systems produced by a corporation based in Cupertino
2776-
{$as_echo"$as_me:${as_lineno-$LINENO}: checking for macOS">&5
2777-
$as_echo_n"checking for macOS...">&6; }
2778-
RSysinfoName=$("${R_HOME}/bin/Rscript" --vanilla -e'cat(Sys.info()["sysname"])')
2779-
iftest x"${RSysinfoName}" == x"Darwin";then
2780-
{$as_echo"$as_me:${as_lineno-$LINENO}: result: found">&5
2781-
$as_echo"found">&6; }
2782-
{$as_echo"$as_me:${as_lineno-$LINENO}: WARNING: OpenMP unavailable and turned off.">&5
2783-
$as_echo"$as_me: WARNING: OpenMP unavailable and turned off.">&2;}
2784-
arma_have_openmp="#define ARMA_DONT_USE_OPENMP 1"
2785-
else
2786-
{$as_echo"$as_me:${as_lineno-$LINENO}: result: not found as on${RSysinfoName}">&5
2787-
$as_echo"not found as on${RSysinfoName}">&6; }
2788-
## Check for OpenMP if and only if we have a suitable compile
2789-
iftest x"${can_use_openmp}" == x"yes";then
2790-
{$as_echo"$as_me:${as_lineno-$LINENO}: checking for OpenMP">&5
2815+
iftest x"${can_use_openmp}" == x"yes";then
2816+
{$as_echo"$as_me:${as_lineno-$LINENO}: checking for OpenMP">&5
27912817
$as_echo_n"checking for OpenMP...">&6; }
2792-
## if R has -fopenmp we should be good
2793-
allldflags=$(${R_HOME}/bin/R CMD config --ldflags)
2794-
hasOpenMP=$(echo${allldflags}| grep -- -fopenmp)
2795-
iftest x"${hasOpenMP}" == x"";then
2796-
{$as_echo"$as_me:${as_lineno-$LINENO}: result: missing">&5
2818+
## if R has -fopenmp we should be good
2819+
allldflags=$(${R_HOME}/bin/R CMD config --ldflags)
2820+
hasOpenMP=$(echo${allldflags}| grep -- -fopenmp)
2821+
iftest x"${hasOpenMP}" == x"";then
2822+
{$as_echo"$as_me:${as_lineno-$LINENO}: result: missing">&5
27972823
$as_echo"missing">&6; }
2798-
arma_have_openmp="#define ARMA_DONT_USE_OPENMP 1"
2799-
else
2800-
{$as_echo"$as_me:${as_lineno-$LINENO}: result: found and suitable">&5
2824+
arma_have_openmp="#define ARMA_DONT_USE_OPENMP 1"
2825+
else
2826+
{$as_echo"$as_me:${as_lineno-$LINENO}: result: found and suitable">&5
28012827
$as_echo"found and suitable">&6; }
2802-
arma_have_openmp="#define ARMA_USE_OPENMP 1"
2803-
openmp_flag='$(SHLIB_OPENMP_CXXFLAGS)'
2804-
fi
2805-
fi
2828+
arma_have_openmp="#define ARMA_USE_OPENMP 1"
2829+
openmp_flag='$(SHLIB_OPENMP_CXXFLAGS)'
2830+
fi
28062831
fi
28072832
28082833
@@ -3357,7 +3382,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
33573382
# report actual input values of CONFIG_FILES etc. instead of their
33583383
# values after options handling.
33593384
ac_log="
3360-
This file was extended by RcppArmadillo $as_me 0.8.499.0.2, which was
3385+
This file was extended by RcppArmadillo $as_me 0.8.499.1.0, which was
33613386
generated by GNU Autoconf 2.69. Invocation command line was
33623387
33633388
CONFIG_FILES = $CONFIG_FILES
@@ -3410,7 +3435,7 @@ _ACEOF
34103435
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
34113436
ac_cs_config="`$as_echo"$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
34123437
ac_cs_version="\\
3413-
RcppArmadillo config.status 0.8.499.0.2
3438+
RcppArmadillo config.status 0.8.499.1.0
34143439
configured by$0, generated by GNU Autoconf 2.69,
34153440
with options\\"\$ac_cs_config\\"
34163441

‎configure.ac‎

Lines changed: 53 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,47 @@ if test "${GXX}" = yes; then
6262
esac
6363
fi
6464

65+
## Check for Apple LLVM
6566

67+
AC_MSG_CHECKING([for macOS])
68+
RSysinfoName=$("${R_HOME}/bin/Rscript" --vanilla -e 'cat(Sys.info()[["sysname"]])')
69+
70+
if test x"${RSysinfoName}" == x"Darwin"; then
71+
AC_MSG_RESULT([found])
72+
AC_MSG_CHECKING([for macOS Apple compiler])
73+
74+
apple_compiler=$($CXX --version 2>&1 | grep -i -c -e 'apple llvm')
75+
76+
if test x"${apple_compiler}" == x"1"; then
77+
AC_MSG_RESULT([found])
78+
AC_MSG_WARN([OpenMP unavailable and turned off.])
79+
can_use_openmp="no"
80+
else
81+
AC_MSG_RESULT([not found])
82+
if test x"${can_use_openmp}" == x"no"; then
83+
AC_MSG_CHECKING([for clang compiler])
84+
clang_compiler=$($CXX --version 2>&1 | grep -i -c -e 'clang ')
85+
86+
if test x"${clang_compiler}" == x"1"; then
87+
AC_MSG_RESULT([found])
88+
AC_MSG_CHECKING([for OpenMP compatible version of clang])
89+
clang_version=$(${CXX} -v 2>&1 | awk '/^.*clang version/ {print $3}')
90+
91+
case ${clang_version} in
92+
4.*|5.*|6.*|7.*|8.*)
93+
AC_MSG_RESULT([found and suitable])
94+
can_use_openmp="yes"
95+
;;
96+
*)
97+
AC_MSG_RESULT([not found])
98+
AC_MSG_WARN([OpenMP unavailable and turned off.])
99+
can_use_openmp="no"
100+
;;
101+
esac
102+
fi
103+
fi
104+
fi
105+
fi
66106

67107
## Check for suitable LAPACK_LIBS
68108
AC_MSG_CHECKING([LAPACK_LIBS])
@@ -92,30 +132,19 @@ openmp_flag=""
92132
## Set the fallback, by default it is nope
93133
arma_have_openmp="#define ARMA_DONT_USE_OPENMP 1"
94134

95-
## Check for broken systems produced by a corporation based in Cupertino
96-
AC_MSG_CHECKING([for macOS])
97-
RSysinfoName=$("${R_HOME}/bin/Rscript" --vanilla -e 'cat(Sys.info()[["sysname"]])')
98-
if test x"${RSysinfoName}" == x"Darwin"; then
99-
AC_MSG_RESULT([found])
100-
AC_MSG_WARN([OpenMP unavailable and turned off.])
101-
arma_have_openmp="#define ARMA_DONT_USE_OPENMP 1"
102-
else
103-
AC_MSG_RESULT([not found as on ${RSysinfoName}])
104-
## Check for OpenMP if and only if we have a suitable compile
105-
if test x"${can_use_openmp}" == x"yes"; then
106-
AC_MSG_CHECKING([for OpenMP])
107-
## if R has -fopenmp we should be good
108-
allldflags=$(${R_HOME}/bin/R CMD config --ldflags)
109-
hasOpenMP=$(echo ${allldflags} | grep -- -fopenmp)
110-
if test x"${hasOpenMP}" == x""; then
111-
AC_MSG_RESULT([missing])
112-
arma_have_openmp="#define ARMA_DONT_USE_OPENMP 1"
113-
else
114-
AC_MSG_RESULT([found and suitable])
115-
arma_have_openmp="#define ARMA_USE_OPENMP 1"
116-
openmp_flag='$(SHLIB_OPENMP_CXXFLAGS)'
117-
fi
118-
fi
135+
if test x"${can_use_openmp}" == x"yes"; then
136+
AC_MSG_CHECKING([for OpenMP])
137+
## if R has -fopenmp we should be good
138+
allldflags=$(${R_HOME}/bin/R CMD config --ldflags)
139+
hasOpenMP=$(echo ${allldflags} | grep -- -fopenmp)
140+
if test x"${hasOpenMP}" == x""; then
141+
AC_MSG_RESULT([missing])
142+
arma_have_openmp="#define ARMA_DONT_USE_OPENMP 1"
143+
else
144+
AC_MSG_RESULT([found and suitable])
145+
arma_have_openmp="#define ARMA_USE_OPENMP 1"
146+
openmp_flag='$(SHLIB_OPENMP_CXXFLAGS)'
147+
fi
119148
fi
120149

121150

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp