-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathconfigure.ac
More file actions
63 lines (56 loc) · 2.15 KB
/
configure.ac
File metadata and controls
63 lines (56 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
### configure.ac -*- Autoconf -*-
dnl Based on OpenMP detection in R's configure script,
dnl which in turn is based on autoconf's openmp.m4,
dnl with is licensed under GPL-3 with the
dnl Autoconf Configure Script Exception, version 3.0.
AC_PREREQ(2.62)
AC_INIT([BART],[2.94],[],[],[])
dnl snippet from 1.24 Using C++11 Code
dnl https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Using-C_002b_002b11-code
dnl C++11 is now the CRAN standard: changing to CXX
CXX=`"${R_HOME}/bin/R" CMD config CXX`
if test -z "$CXX"; then
AC_MSG_ERROR([No C++ compiler is available])
fi
dnl CXX11STD=`"${R_HOME}/bin/R" CMD config CXX11STD`
dnl CXX="${CXX11} ${CXX11STD}"
CXXFLAGS=`"${R_HOME}/bin/R" CMD config CXXFLAGS`
AC_LANG(C++)
dnl additional changes as needed
LDFLAGS=`${R_HOME}/bin/R CMD config LDFLAGS`
dnl CPPFLAGS="${CPPFLAGS} -D_OPENMP"
dnl the meat of R's m4/openmp.m4
AC_LANG(C++)
OPENMP_[]_AC_LANG_PREFIX[]FLAGS=
AC_ARG_ENABLE([openmp],
[AS_HELP_STRING([--disable-openmp], [do not use OpenMP])])
if test "$enable_openmp" != no; then
AC_CACHE_CHECK([for $[]_AC_CC[] option to support OpenMP],
[ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp],
[AC_LINK_IFELSE([_AC_LANG_OPENMP],
[ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp='none needed'],
[ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp='unsupported'
for ac_option in -xopenmp -fopenmp -qopenmp \
-openmp -mp -omp -qsmp=omp -homp \
-fopenmp=libomp \
-Popenmp --openmp \
"-Xclang -fopenmp"; do
ac_save_[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $ac_option"
AC_LINK_IFELSE([_AC_LANG_OPENMP],
[ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp=$ac_option])
_AC_LANG_PREFIX[]FLAGS=$ac_save_[]_AC_LANG_PREFIX[]FLAGS
if test "$ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp" != unsupported; then
break
fi
done])])
case $ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp in #(
"none needed" | unsupported)
;; #(
*)
OPENMP_[]_AC_LANG_PREFIX[]FLAGS=$ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp ;;
esac
fi
AC_SUBST(OPENMP_CXXFLAGS)
AC_CONFIG_FILES([src/Makevars])
AC_OUTPUT