-
Notifications
You must be signed in to change notification settings - Fork 26
/
configure.ac
203 lines (183 loc) · 5.08 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# Automatically generated by -*- Autoconf -*-
# ...and manually buggered up by Phil Garner
AC_PREREQ(2.59)
AC_INIT([Juicer], [0.12.1])
AM_INIT_AUTOMAKE([-Wall -Werror])
AC_CONFIG_SRCDIR([src/juicer.cpp])
AC_CONFIG_MACRO_DIR([m4])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_YACC
AC_PROG_LEX
AC_PROG_LIBTOOL
# Check for Tracter
PKG_CHECK_MODULES(
TRACTER, tracter >= 0.5.0, ac_cv_tracter=1, ac_cv_tracter=0
)
AC_SUBST(TRACTER_CFLAGS)
AC_SUBST(TRACTER_LIBS)
AS_IF(
[test "$ac_cv_tracter" = 0],
[AC_ERROR([Required library TRACTER not found])]
)
# Check for Torch3 first using an explicit --with-torch3
AC_MSG_CHECKING([whether to use Torch3])
AC_ARG_WITH(torch3,
[AS_HELP_STRING(
[--with-torch3=DIR],
[Use Torch3 in DIR]
)],
[],
[with_torch3=yes]
)
AS_IF( [test "$with_torch3" = yes],
# yes is default, but not informative; Try via pkgconfig (at Idiap)
[PKG_CHECK_MODULES(TORCH, torch >= 3.1, pkg_torch3=1, pkg_torch3=0)
AS_IF( [test "$pkg_torch3" = 1],
[AC_DEFINE([HAVE_TORCH3], [1], [Define if you have TORCH3.])
AC_SUBST([TORCH3_INCLUDES], [$TORCH_CFLAGS])
AC_SUBST([TORCH3_LIBS], [$TORCH_LIBS])],
[with_torch3=no]
)],
# There is an explicit --with-torch3=dir
[AS_IF( [test "$with_torch3" != no],
[AS_IF( [test -d "$with_torch3"],
[AC_DEFINE([HAVE_TORCH3], [1], [Define if you have Torch3.])
AC_SUBST(
[TORCH3_INCLUDES],
["-I$with_torch3/core \
-I$with_torch3/speech \
-I$with_torch3/datasets \
-I$with_torch3/distributions \
-I$with_torch3/gradients"]
)
AC_SUBST(
[TORCH3_LIBS],
["-L$with_torch3/libs/Linux_opt_float -ltorch"]
)],
[AC_MSG_ERROR([Can't find directory $with_torch3])
with_torch3=no]
)]
)
AC_MSG_RESULT([$with_torch3])]
)
AM_CONDITIONAL([WITH_TORCH3], [test "$with_torch3" != no])
AS_IF(
[test "$with_torch3" = "no"],
[AC_ERROR([Required library TORCH3 not found])]
)
# HTK
AC_ARG_WITH(htk-includes,
[AS_HELP_STRING(
[--with-htk-includes=DIR],
[Directory containing HTK headers]
)]
)
AC_ARG_WITH(htk-libs,
[AS_HELP_STRING(
[--with-htk-libs=DIR],
[List of HTK libraries]
)]
)
AC_MSG_CHECKING([whether to use HTK])
AS_IF(
[test "$with_htk_includes" != ""],
[AC_DEFINE([HAVE_HTKLIB], [1], [Define if you have HTK.])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)]
)
AC_SUBST([HTK_INCLUDES], [$with_htk_includes])
AC_SUBST([HTK_LIBS], [$with_htk_libs])
AM_CONDITIONAL([WITH_HTK], [test "$with_htk_includes" != ""])
# use GMM computation routines from Intel Integrated Performance
# Primitives (IPP)
AC_ARG_WITH(ipproot,
[AS_HELP_STRING(
[--with-ipproot=DIR],
[Root directory of Intel Integrated Performance Primitives lib, usually defined as IPPROOT]
)]
)
AC_MSG_CHECKING([whether to use Intel IPP lib])
AS_IF(
[test "$with_ipproot" != ""],
[AC_DEFINE([HAVE_INTEL_IPP], [1], [Define if you have Intel IPP lib installed.])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)]
)
AS_IF(
[test "$with_ipproot" != ""],
[AC_SUBST([INTEL_IPP_INCLUDES], ["-I$with_ipproot/include"])],
[AC_SUBST([INTEL_IPP_INCLUDES], [""])]
)
AS_IF(
[test "$with_ipproot" != ""],
[AC_SUBST([INTEL_IPP_LIBS], ["-L$with_ipproot/lib \
-L$with_ipproot/sharedlib \
-lirc \
-lippcore$POSTFIX \
-lippsemerged$POSTFIX \
-lippsremerged$POSTFIX \
-lippsrmerged$POSTFIX \
-lippsmerged$POSTFIX"])],
[AC_SUBST([INTEL_IPP_LIBS], [""])]
)
AM_CONDITIONAL([WITH_INTEL_IPP], [test "$with_ipproot" != ""])
# required by feature OPT_FAST_EXP
AC_C_BIGENDIAN
# SWIG interface
AC_ARG_ENABLE(swig,
[AS_HELP_STRING(
[--enable-swig],
[Enable compilation of swig generated JNI interface]
)],
[enable_swig=$enableval],
[enable_swig=no]
)
AC_MSG_CHECKING([whether to use swig JNI interface])
AC_MSG_RESULT([$enable_swig])
AM_CONDITIONAL([WITH_SWIG], [test "$enable_swig" = "yes"])
#
# Many of these were added by autoscan, then removed by me (Phil).
# The point is that if these checks fail I don't do anything to fix the
# failure. Of course, this can be done, but I'll do it when it becomes
# a problem.
#
# Checks for libraries.
# Checks for header files.
#AC_HEADER_STDC
#AC_CHECK_HEADERS([fcntl.h stdlib.h string.h])
# Checks for typedefs, structures, and compiler characteristics.
#AC_HEADER_STDBOOL
#AC_C_CONST
#AC_C_INLINE
#AC_TYPE_SIZE_T
#AC_STRUCT_TM
# Checks for library functions.
#AC_FUNC_ERROR_AT_LINE
#AC_FUNC_MALLOC
#AC_FUNC_REALLOC
#AC_FUNC_SETVBUF_REVERSED
#AC_FUNC_VPRINTF
#AC_CHECK_FUNCS([gethostname memmove strchr strcspn strpbrk strrchr strstr])
AC_CONFIG_FILES([
Makefile
juicer.pc
Doxyfile
bin/Makefile
src/Makefile
doc/Makefile
])
AC_OUTPUT
AC_MSG_RESULT([
Juicer Configured
TORCH3_INCLUDES = $TORCH3_INCLUDES
TORCH3_LIBS = $TORCH3_LIBS
TRACTER_CFLAGS = $TRACTER_CFLAGS
TRACTER_LIBS = $TRACTER_LIBS
HTK_INCLUDES = $HTK_INCLUDES
HTK_LIBS = $HTK_LIBS
INTEL_IPP_INCLUDES = $INTEL_IPP_INCLUDES
INTEL_IPP_LIBS = $INTEL_IPP_LIBS
CXXFLAGS = $CXXFLAGS
])