File: configure.in

package info (click to toggle)
r-bioc-preprocesscore 1.48.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 1,108 kB
  • sloc: ansic: 9,489; sh: 13; makefile: 2
file content (95 lines) | stat: -rw-r--r-- 2,267 bytes parent folder | download
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
dnl
dnl Configuration things for preprocessCore
dnl


AC_INIT("DESCRIPTION")

dnl
dnl Are things (still) the same ?
dnl (taken from the 'writing R extensions manual')

dnl Now find the compiler and compiler flags to use
: ${R_HOME=`R RHOME`}
if test -z "${R_HOME}"; then
       echo "could not determine R_HOME"
       exit 1
fi
CC=`"${R_HOME}/bin/R" CMD config CC`
CPP=`"${R_HOME}/bin/R" CMD config CPP`
CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS`
CPPFLAGS=`"${R_HOME}/bin/R" CMD config CPPFLAGS`
AC_PROG_CC
AC_PROG_CPP


AC_LANG(C)

# Checks for libraries.
use_pthreads=no
AC_SEARCH_LIBS([pthread_create], [pthread],
  [use_pthreads=yes])

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h])

if test "x${have_pthreads}" = xyes; then
  AC_CHECK_HEADERS([pthread.h], [],
    [use_pthreads=no])
fi


AC_MSG_CHECKING([if PTHREAD_STACK_MIN is defined])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
	#include <pthread.h>
	#include <limits.h>

      int main () {size_t stacksize = PTHREAD_STACK_MIN + 0x4000;
}     	  
    ])],[use_pthread_stack_min=yes], [use_pthread_stack_min=no])
AC_MSG_RESULT($use_pthread_stack_min)

if test "x$use_pthread_stack_min" = xno; then
	use_pthreads=no
fi


AC_MSG_CHECKING([if R is using openblas])
BLAS_LIBS=`"${R_HOME}/bin/R" CMD config BLAS_LIBS`
if echo "${BLAS_LIBS}" | grep openblas > /dev/null; then
    AC_MSG_RESULT([openblas found. preprocessCore threading will be disabled])
    use_pthreads=no
else
    AC_MSG_RESULT([openblas not found. preprocessCore threading will not be disabled])
fi


AC_ARG_ENABLE([threading],
	AS_HELP_STRING([--disable-threading],[Disable threading]))



AS_IF([test "x$enable_threading" != "xno" ],[
	    if test "x${use_pthreads}" = "xno"; then
	       AC_MSG_NOTICE(------------------------------------------)
	       AC_MSG_NOTICE( Unable to find pthreads on this system.  )
	       AC_MSG_NOTICE( Building a single-threaded version.      )
	       AC_MSG_NOTICE(------------------------------------------)
	    fi


	    if test "x${use_pthreads}" = "xyes"; then
  	       AC_MSG_NOTICE(Enabling threading for preprocessCore)
  	       AC_DEFINE(USE_PTHREADS, 1)
	    fi
	    ],
	    [
	    AC_MSG_NOTICE(Disabling threading for preprocessCore)
	    ])





AC_OUTPUT(src/Makevars)