-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
129 lines (111 loc) · 3.72 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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
AC_INIT([lwpr], [1.2.6], [sethu.vijayakumar@ed.ac.uk])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([include/lwpr_config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_PROG_AR
LT_INIT
AC_PROG_CC
CFLAGS=-O3 -g
AC_PROG_CXX
AC_PROG_LIBTOOL
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
AC_CHECK_LIB([expat], [XML_ParserCreate])
AC_CHECK_LIB([m], [sqrt])
AC_CHECK_LIB([pthread], [pthread_create])
AC_CHECK_FUNCS([memset])
AC_CHECK_FUNCS([strcasecmp])
AC_CHECK_FUNCS([strtol])
AC_C_CONST
AC_FUNC_ERROR_AT_LINE
AC_FUNC_MALLOC
AC_FUNC_STRTOD
AC_TYPE_SIZE_T
AC_HEADER_STDBOOL
AC_HEADER_STDC
AC_STRUCT_TM
AC_DEFUN([SET_NUM_THREADS],
[echo You selected --enable-threads=$enable_threads
numthr=0
if test "X$enable_threads" = "Xno"; then
numthr=1
elif test $enable_threads -ge 1; then
if test $enable_threads -le 32; then
numthr=$enable_threads
fi
fi
if test "$numthr" = "0"; then
echo Number of threads must be between 1 and 32
exit 1
fi
AC_DEFINE_UNQUOTED([NUM_THREADS],$numthr,[Number of threads to use])
])
MEXSUB=
OCTSUB=
AC_DEFUN([SET_MATLAB],
[echo ==================================================================================
echo You selected --with-matlab=$with_matlab
if test "X$with_matlab" = "Xno"; then
echo MEX files will not be built
else
if test -e $with_matlab/extern/include/mex.h -a -e $with_matlab/bin/mex; then
MATLAB_PATH=$with_matlab
MEXSUB=mexsrc
echo Include path for Matlab MEX files is $with_matlab/extern/include
AC_CONFIG_FILES([mexsrc/Makefile])
else
echo ERROR: At least one of the following files
echo * $with_matlab/extern/include/mex.h
echo * $with_matlab/bin/mex
echo was not found. Please make sure that echo you have selected the right
echo path with the --with-matlab option.
exit 1
fi
fi
echo ==================================================================================
])
AC_DEFUN([SET_OCTAVE],
[echo ==================================================================================
echo You selected --with-octave=$with_octave
if test "X$with_octave" = "Xno"; then
echo MEX files \(for Octave\) will not be built
else
if test -e $with_octave/bin/mkoctfile -a -e $with_octave/bin/octave-config; then
OCTAVE_PATH=$with_octave
OCTSUB=mexoct
OCTINCLUDEPATH=`$with_octave/bin/octave-config -p OCTINCLUDEDIR`
echo Include path for Octave MEX files is $OCTINCLUDEPATH
AC_CONFIG_FILES([mexoct/Makefile])
else
echo ERROR: At least one of the following files
echo * $with_octave/bin/mkoctfile
echo * $with_matlab/bin/octave-config
echo was not found. Please make sure that echo you have selected the right
echo path with the --with-octave option.
exit 1
fi
fi
echo ==================================================================================
])
AC_ARG_ENABLE([threads],
[AC_HELP_STRING([--enable-threads=K],
[use K threads (1..32) for predictions and updates (default is 1, no multi-threading)])],
[SET_NUM_THREADS],
[AC_DEFINE([NUM_THREADS],[1],[Number of threads to use])]
)
AC_ARG_WITH([matlab],
[AC_HELP_STRING([--with-matlab=<path to Matlab installation>],
[Enables building MEX files and a special shared library liblwprmex.so])],
[SET_MATLAB]
)
AC_ARG_WITH([octave],
[AC_HELP_STRING([--with-octave=<path to Octave installation (must be >= 2.9.12) >],
[Enables building Octave MEX files and a special shared library liblwproctave.so])],
[SET_OCTAVE]
)
AC_SUBST([MATLAB_PATH])
AC_SUBST([OCTAVE_PATH])
AC_SUBST([MEXSUB])
AC_SUBST([OCTSUB])
AC_SUBST([OCTINCLUDEPATH])
AC_CONFIG_FILES([Makefile src/Makefile include/Makefile example_c/Makefile example_cpp/Makefile tests/Makefile])
AC_OUTPUT