-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
48 lines (38 loc) · 1.03 KB
/
configure.ac
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
AC_PREREQ([2.61])
AC_INIT([iBMQ], [1.0.1], [http://www.rglab.org])
AC_CONFIG_SRCDIR([DESCRIPTION])
# determine RHOME
: ${R_HOME=`R RHOME`}
if test -z "${R_HOME}"; then
echo "could not determine R_HOME"
exit 1
fi
## pick up compiler as will be used by R CMD INSTALL/SHLIB
CC=`"${R_HOME}/bin/R" CMD config CC`
CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS`
CPPFLAGS=`"${R_HOME}/bin/R" CMD config CPPFLAGS`
AC_PROG_CC
AC_PROG_CPP
## BLAS.
AC_ARG_WITH([blas],
[AC_HELP_STRING([--with-blas],
[use system gsl BLAS library (if available)])],
[BLAS_LIBS=$with_blas],
[BLAS_LIBS="-lgslcblas"])
PKG_CHECK_MODULES(GSL, [gsl >= 1.2], [HAVEGSL="yes"], [HAVEGSL="no"])
if test "$HAVEGSL" = "yes"; then
LIBS=$GSL_LIBS
else
AM_PATH_GSL(1.2,[LIBS="${LIBS} -lgsl ${BLAS_LIBS} -lm "],[AC_MSG_ERROR([Cannot find Gnu Scientific Library >=1.6])])
fi
AC_SUBST(OPENMP_CFLAGS)
AC_CHECK_HEADERS(omp.h,
[
LIBS+=-lgomp
OPENMP_CFLAGS=-fopenmp
],
[
AC_MSG_NOTICE([no parallelism])
])
AC_CONFIG_FILES([src/Makevars])
AC_OUTPUT()