-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.ac
More file actions
71 lines (56 loc) · 1.99 KB
/
configure.ac
File metadata and controls
71 lines (56 loc) · 1.99 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
63
64
65
66
67
68
69
70
71
AC_INIT([fCWTr],[0.3.1])
# Find the compiler and compiler flags used by R.
: ${R_HOME=`R RHOME`}
if test -z "${R_HOME}"; then
echo "could not determine R_HOME"
exit 1
fi
CXX=`"${R_HOME}/bin/R" CMD config CXX`
CXXFLAGS=`"${R_HOME}/bin/R" CMD config CXXFLAGS` `"${R_HOME}/bin/R" CMD config CXXPICFLAGS`
CPPFLAGS="`"${R_HOME}/bin/R" CMD config CPPFLAGS`"
LDFLAGS="`"${R_HOME}/bin/R" CMD config LDFLAGS`"
AC_LANG(C++)
AC_PROG_CPP
AC_PATH_PROG([PKG_CONFIG], [pkg-config])
AC_OPENMP
AC_MSG_CHECKING([for pkg-config])
AS_IF(["$PKG_CONFIG" --version], , [AC_MSG_RESULT([no])
AC_MSG_ERROR([Provided flags don't work and pkg-config is not present.])])
AC_MSG_CHECKING([whether pkg-config knows about fftw3f])
AS_IF([$PKG_CONFIG fftw3f], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT([no])
AC_MSG_ERROR([Install libfftw3-dev or equivalent first])])
CPPFLAGS="${CPPFLAGS} `$PKG_CONFIG --cflags fftw3f`"
LIBS="${LIBS} `$PKG_CONFIG --libs fftw3f`"
# needs to be after pkg-config checks
# to have correct paths already
# Check for fftw3.h header
AC_CHECK_HEADER([fftw3.h], [
AC_DEFINE([HAVE_FFTW3_H], [1], [Define if you have the fftw3.h header file])
], [
AC_MSG_ERROR([fftw3.h header file not found in: $CPPFLAGS])
])
# there are no pkg-config files for fftw3-omp,
# so check like this.
# have_fftw_omp=no
AC_SEARCH_LIBS(
fftwf_plan_with_nthreads,
fftw3f_omp,
[have_fftw_omp=yes],
[AC_MSG_RESULT([The fftw3-omp support not found.])]
)
# Write the flags into the src/Makevars file.
AC_SUBST([PKG_CPPFLAGS], ["${CPPFLAGS} ${OPENMP_CFLAGS}"])
AC_SUBST([PKG_CXXFLAGS], ["${CXXFLAGS} ${OPENMP_CXXFLAGS}"])
AC_SUBST([PKG_LDFLAGS], ["${LDFLAGS} ${OPENMP_CXXFLAGS}"])
AC_SUBST([PKG_LIBS], ["${LIBS}"])
AC_CONFIG_FILES([src/Makevars])
AC_OUTPUT
echo "
--------------------------------------------------
Configuration for ${PACKAGE_NAME} ${PACKAGE_VERSION}
cppflags: ${PKG_CPPFLAGS}
cxxflags: ${PKG_CXXFLAGS}
ldflags: ${PKG_LDFLAGS}
libs: ${PKG_LIBS}
--------------------------------------------------
"