-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.ac
More file actions
408 lines (362 loc) · 15.3 KB
/
configure.ac
File metadata and controls
408 lines (362 loc) · 15.3 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
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
# Process this file with autoconf to produce a configure script.
#########################
# Initializations #
#########################
m4_define([folding_major], [1])
m4_define([folding_minor], [4])
m4_define([folding_micro], [2])
m4_define([folding_version], [folding_major.folding_minor.folding_micro])
# Initialize autoconf & define package name, version and bug-report address
AC_INIT(folding, [folding_version], tools@bsc.es)
AC_CONFIG_HEADERS([folding-config.h:folding-config.h.in])
# Safety check to ensure that the directory told with `--srcdir` contains the source code
#AC_CONFIG_SRCDIR(src/mpitrace.c)
# GNU Autotools intermediate files are stored in the following directory
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([config])
SVN=`which svn 2> /dev/null`
# If SVN command exists and .svn directory also exists, check for the versioning
if test $? -eq 0 -a -d .svn ; then
${SVN} info . >& /dev/null
if test $? -eq 0 ; then
SVN_branch=`${SVN} info . | grep URL | cut -d/ -f 6-`
SVN_branch_res=$?
SVN_revision=`${SVN} info . | grep "Last Changed Rev:" | cut -d: -f 2`
SVN_revision_res=$?
if test ${SVN_branch_res} -eq 0 -a ${SVN_revision_res} -eq 0 ; then
echo ${SVN_branch} > SVN-branch
echo ${SVN_revision} > SVN-revision
fi
fi
fi
TOPDIR=`dirname ${0}`
if test -f ${TOPDIR}/SVN-branch -a -f ${TOPDIR}/SVN-revision ; then
SVN_branch=`cat ${TOPDIR}/SVN-branch`
SVN_revision=`cat ${TOPDIR}/SVN-revision`
else
SVN_branch=unknown
SVN_revision=0
fi
echo Configuring package ${PACKAGE_STRING} based on ${SVN_branch} revision ${SVN_revision}
AC_DEFINE_UNQUOTED([FOLDING_SVN_REVISION], [${SVN_revision}], [Define SVN version for this Folding])
AC_DEFINE_UNQUOTED([FOLDING_SVN_BRANCH], ["${SVN_branch}"], [Define SVN branch for this Folding])
# Loads some shell variables like host_cpu and host_os, to get the host information
AC_CANONICAL_SYSTEM
# Initialize automake
AM_INIT_AUTOMAKE([tar-ustar subdir-objects])
AM_SILENT_RULES([yes])
AC_PROG_MKDIR_P
# Write defines in the output header file for the architecture and operating system
case "${target_cpu}" in
armv7l) Architecture="arm"
AC_DEFINE([ARCH_ARM], [1], [Define if architecture is ARM]) ;;
i*86|x86_64|amd64)
Architecture="ia32"
AC_DEFINE([ARCH_IA32], [1], [Define if architecture is IA32])
if test "${target_cpu}" = "amd64" -o "${target_cpu}" = "x86_64" ; then
AC_DEFINE([ARCH_IA32_x64], [1], [Define if architecture is IA32 (with 64bit extensions)])
fi
;;
powerpc* ) Architecture="powerpc"
AC_DEFINE([ARCH_PPC], [1], [Define if architecture is PPC]) ;;
ia64 ) Architecture="ia64"
AC_DEFINE([ARCH_IA64], [1], [Define if architecture is IA64]) ;;
alpha* ) Architecture="alpha"
AC_DEFINE([ARCH_ALPHA], [1], [Define if architecture is ALPHA]) ;;
mips ) Architecture="mips"
AC_DEFINE([ARCH_MIPS], [1], [Define if architecture is MIPS]) ;;
esac
case "${target_os}" in
linux* ) OperatingSystem="linux"
AC_DEFINE([OS_LINUX], [1], [Define if operating system is Linux]) ;;
aix* ) OperatingSystem="aix"
AC_DEFINE([OS_AIX], [1], [Define if operating system is AIX]) ;;
osf* ) OperatingSystem="dec"
AC_DEFINE([OS_DEC], [1], [Define if operating system is DEC]) ;;
irix* ) OperatingSystem="irix"
AC_DEFINE([OS_IRIX], [1], [Define if operating system is IRIX]) ;;
freebsd* ) OperatingSystem="freebsd"
AC_DEFINE([OS_FREEBSD], [1], [Define if operating system is FreeBSD]) ;;
solaris* ) OperatingSystem="solaris"
AC_DEFINE([OS_SOLARIS], [1], [Define if operating system is Solaris]) ;;
darwin* ) OperatingSystem="darwin"
AC_DEFINE([OS_DARWIN], [1], [Define if operating system is Darwin]) ;;
esac
# Publish these defines for conditional compilation
AM_CONDITIONAL(ARCH_IA32, test "${Architecture}" = "ia32" )
AM_CONDITIONAL(ARCH_POWERPC, test "${Architecture}" = "powerpc" )
AM_CONDITIONAL(ARCH_IA64, test "${Architecture}" = "ia64" )
AM_CONDITIONAL(ARCH_ALPHA, test "${Architecture}" = "alpha" )
AM_CONDITIONAL(ARCH_MIPS, test "${Architecture}" = "mips" )
AM_CONDITIONAL(OS_LINUX, test "${OperatingSystem}" = "linux" )
AM_CONDITIONAL(OS_AIX, test "${OperatingSystem}" = "aix" )
AM_CONDITIONAL(OS_DEC, test "${OperatingSystem}" = "dec" )
AM_CONDITIONAL(OS_IRIX, test "${OperatingSystem}" = "irix" )
AM_CONDITIONAL(OS_FREEBSD, test "${OperatingSystem}" = "freebsd" )
AM_CONDITIONAL(OS_DARWIN, test "${OperatingSystem}" = "darwin" )
AM_CONDITIONAL(OS_SOLARIS, test "${OperatingSystem}" = "solaris" )
# Specify the output configuration header file
# AM_CONFIG_HEADER(folding-config.h)
# Search for libtool support
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
AC_ENABLE_SHARED
# Search for C++, C and Fortran compilers
AC_PROG_CC
if test "${CC}" = "" ; then
AC_MSG_ERROR([Cannot find C compiler])
fi
AC_PROG_CXX
if test "${CXX}" = "" ; then
AC_MSG_ERROR([Cannot find C++ compiler])
fi
AX_CXX_COMPILE_STDCXX_11([],[optional])
AC_PROG_FC
if test "${FC}" = "" ; then
AC_MSG_ERROR([Cannot find Fortran compiler])
fi
AX_CFLAGS_WARN_ALL
AX_CXXFLAGS_WARN_ALL
AM_PATH_XML2(
[2.5.0],
[AC_DEFINE([HAVE_XML2], [1], [Defined if libxml2 exists])],
[AC_MSG_ERROR(Cannot find xml2-config of libXML 2.5.0 (or above))]
)
AX_LIBBSCTOOLS
AT_WITH_QT
AM_CONDITIONAL(WANT_QT_GUI, test "${QT_PATH}" != "no" )
AX_HAVE_CUBE
AC_MSG_CHECKING([for R statistical package])
AC_ARG_WITH(R,
AC_HELP_STRING(
[--with-R@<:@=ARG@:>@],
[Specify where the R statistical package binary can be found]
),
[RBIN="$withval"],
[RBIN=`which R`]
)
if test -x "${RBIN}" ; then
AC_MSG_RESULT(${RBIN})
AC_MSG_CHECKING(that R can process a simple script)
echo "q()" > ${TMPDIR:-/tmp}/Rconftest
${RBIN} -f ${TMPDIR:-/tmp}/Rconftest > ${TMPDIR:-/tmp}/Rconftest.out
nlines=`grep "The R Foundation for Statistical Computing" ${TMPDIR:-/tmp}/Rconftest.out | wc -l`
if test "${nlines}" -eq 1 ; then
AC_MSG_RESULT([yes])
R_AVAILABLE=yes
AC_MSG_CHECKING(that R has the strucchange package)
echo "library(strucchange)" > ${TMPDIR:-/tmp}/Rconftest
echo "Nile" >> ${TMPDIR:-/tmp}/Rconftest
echo "q()" >> ${TMPDIR:-/tmp}/Rconftest
${RBIN} -f ${TMPDIR:-/tmp}/Rconftest > ${TMPDIR:-/tmp}/Rconftest.out 2> /dev/null
nlines=`grep "Time Series" ${TMPDIR:-/tmp}/Rconftest.out | wc -l`
if test "${nlines}" -eq 1 ; then
R_STRUCCHANGE_AVAILABLE=yes
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING(that R has the doParallel package)
echo "library(doParallel)" > ${TMPDIR:-/tmp}/Rconftest
echo "registerDoParallel(cores=1)" >> ${TMPDIR:-/tmp}/Rconftest
echo "getDoParName()" >> ${TMPDIR:-/tmp}/Rconftest
echo "getDoParVersion()" >> ${TMPDIR:-/tmp}/Rconftest
${RBIN} -f ${TMPDIR:-/tmp}/Rconftest > ${TMPDIR:-/tmp}/Rconftest.out 2> /dev/null
grep 1 ${TMPDIR:-/tmp}/Rconftest.out > ${TMPDIR:-/tmp}/Rconftest.out.grep
doparallel=`tail -2 ${TMPDIR:-/tmp}/Rconftest.out.grep | head -1 | cut -d\" -f2`
if test "${doparallel}" = "doParallel" -o "${doparallel}" = "doParallelMC" ; then
R_DOPARALLEL_AVAILABLE=yes
AC_MSG_RESULT([yes])
AC_MSG_CHECKING(for the doParallel package version)
version=`tail -1 ${TMPDIR:-/tmp}/Rconftest.out.grep | cut -d\" -f 2`
AC_MSG_RESULT($version)
else
AC_MSG_RESULT([no])
fi
else
AC_MSG_RESULT([no])
fi
else
AC_MSG_RESULT([Not found])
fi
if test "${R_STRUCCHANGE_AVAILABLE}" = "yes" ; then
if test "${R_DOPARALLEL_AVAILABLE}" = "yes" ; then
AC_MSG_NOTICE([Segmented linear regression through R+strucchange is available through parallel version])
AC_DEFINE([HAVE_R_DOPARALLEL], [1], [Define if R has doParallel package])
else
AC_MSG_NOTICE([Segmented linear regression through R+strucchange is available through serial version])
fi
AC_DEFINE([HAVE_R],[1],[Define if have R available])
AC_DEFINE_UNQUOTED([R_BINARY],["${RBIN}"],[Define binary for R])
elif test "${R_AVAILABLE}" = yes ; then
AC_MSG_NOTICE([Segmented linear regression through R is not available because strucchange library is missing. Execute install.packages("strucchange") in a R session])
else
AC_MSG_NOTICE([Segmented linear regression is not available as R cannot be find])
fi
AC_MSG_CHECKING([for clang compiler])
AC_ARG_WITH(clang,
AC_HELP_STRING(
[--with-clang@<:@=ARG@:>@],
[Specify where the clang compiler]
),
[CLANGBIN="$withval"],
[CLANGBIN=`which clang`]
)
if test -x "${CLANGBIN}" ; then
AC_MSG_RESULT(${CLANGBIN})
CLANG_AVAILABLE="yes"
fi
if test "${CLANG_AVAILABLE}" = "yes" ; then
AC_MSG_NOTICE([clang is available and ready for providing AST information])
AC_DEFINE([HAVE_CLANG],[1],[Define if have clang available])
AC_DEFINE_UNQUOTED([CLANG_BINARY],["${CLANGBIN}"],[Define binary for clang])
else
AC_MSG_NOTICE([clang is not available. AST parsing for C/C++ files will not be available])
AC_DEFINE_UNQUOTED([CLANG_BINARY],[""],[Define for clang])
fi
AC_MSG_CHECKING([for Clustering suite])
AC_ARG_WITH(clustering-suite,
AC_HELP_STRING(
[--with-clustering-suite@<:@=ARG@:>@],
[Specify where to locate the clustering suite]
),
[CLUSTERING_HOME="${withval}"],
[CLUSTERING_HOME="none"]
)
if test "${CLUSTERING_HOME}" != "none" ; then
AC_MSG_RESULT(${CLUSTERING_HOME})
AC_MSG_CHECKING([for headers and libraries of the Clustering suite])
if test -r ${CLUSTERING_HOME}/include/libClustering.hpp -a \
-r ${CLUSTERING_HOME}/include/Partition.hpp -a \
-r ${CLUSTERING_HOME}/include/Point.hpp ; then
if test -r ${CLUSTERING_HOME}/lib/libClustering.so -a \
-r ${CLUSTERING_HOME}/lib/libBasicClasses.so ; then
AC_MSG_RESULT([found])
AC_DEFINE([HAVE_CLUSTERING_SUITE], [1], [Define if have clustering suite available])
AC_SUBST([CLUSTERING_HOME])
CLUSTERING_SUITE_FOUND="yes"
fi
fi
if test ${CLUSTERING_SUITE_FOUND} != "yes" ; then
AC_MSG_ERROR([Cannot find the headers or the libraries for the Clustering suite])
fi
else
AC_MSG_RESULT(not given)
fi
AM_CONDITIONAL(HAVE_CLUSTERING_SUITE, test "${CLUSTERING_SUITE_FOUND}" = "yes" )
dnl Example of default-disabled feature
AC_ARG_ENABLE([gui],
AS_HELP_STRING([--enable-gui], [Enables GUI frontend based on wxPython]))
AM_CONDITIONAL(WANT_GUI_FRONTEND, test "${enable_gui}" = "yes" )
AC_ARG_ENABLE([callstack-analysis],
AS_HELP_STRING([--disable-callstack-analysis], [Disables call-stack analysis (enabled by default)]),
[enable_callstack_analysis="${enableval}"],
[enable_callstack_analysis="yes"])
if test "${enable_callstack_analysis}" = "yes" ; then
AC_DEFINE([CALLSTACK_ANALYSIS], [1], [Define if call-stack analysis is enabled])
fi
AC_ARG_ENABLE([memory-analysis],
AS_HELP_STRING([--enable-memory-analysis], [Enables memory analysis]))
if test "${enable_memory_analysis}" = "yes" ; then
AC_DEFINE([MEMORY_ANALYSIS], [1], [Define if memory analysis is enabled])
fi
AC_ARG_ENABLE([rri],
AS_HELP_STRING([--disable-rri], [Disable RRI files generation (enabled by default)]),
[enable_rri="${enableval}"],
[enable_rri="yes"])
if test "${enable_rri}" = "yes" ; then
AC_DEFINE([RRI], [1], [Define if enable RRI in folding])
fi
AX_PROG_BOOST
AC_CHECK_FUNC(stat, [AC_DEFINE([HAVE_STAT],[1],[Define if have stat])])
AC_CHECK_FUNC(stat64, [AC_DEFINE([HAVE_STAT64],[1],[Define if have stat64])])
AC_CHECK_FUNC(access, [AC_DEFINE([HAVE_ACCESS],[1],[Define if have access])])
# Regular C headers
AC_MSG_NOTICE([Checking for availability of C headers])
AC_CHECK_HEADERS(
[assert.h dirent.h math.h stdio.h stdlib.h string.h time.h unistd.h],
[],
[AC_MSG_ERROR([Cannot find required header])])
# Regular C headers in sys/
AC_CHECK_HEADERS(
[sys/stat.h sys/types.h],
[],
[AC_MSG_ERROR([Cannot find required header])])
# Specific C++ headers
AC_MSG_NOTICE([Checking for availability of C++ headers])
AC_LANG_PUSH([C++])
AC_CHECK_HEADERS(
[algorithm exception fstream iomanip iostream iterator list map set \
sstream string vector deque ctime chrono],
[],
[AC_MSG_ERROR([Cannot find required header])])
AC_LANG_POP([C++])
# So as to generate documentation
AC_CHECK_PROGS(pdflatex,[pdflatex],no)
AC_CHECK_PROGS(latex2html,[latex2html],no)
AM_CONDITIONAL(BUILD_DOCS_PDF, test "${pdflatex}" != "no")
AM_CONDITIONAL(BUILD_HTML_DOCS, test "${pdflatex}" != "no" -a "${latex2html}" != "no")
# Avoid problems reinstalling libtools .so libraries into target
# directory if they are the same
if test "${prefix}" = "NONE"; then
myprefix=${ac_default_prefix}
else
myprefix=${prefix}
fi
AM_CONDITIONAL(LIBBSCTOOLS_DIR_SAME_AS_LIBDIR, test "${LIBBSCTOOLS_LIB_DIR}" == "${myprefix}/lib")
AC_CONFIG_FILES([
Makefile
src/Makefile
src/common/Makefile
src/io/Makefile
src/codeblocks/Makefile
src/fuse/Makefile
src/extract/Makefile
src/interpolate/Makefile
src/interpolate/service-kriger/Makefile
src/interpolate/service-R/Makefile
src/interpolate/model/Makefile
src/interpolate/callstack-processor/Makefile
src/interpolate/gnuplot/Makefile
src/gui/Makefile
src/gui/qcustomplot/Makefile
src/gui/cube-plugins/Makefile
src/gui/cube-plugins/time-line/Makefile
src/gui/cube-plugins/source-code/Makefile
src/others/Makefile
doc/Makefile
])
AC_CONFIG_LINKS([
src/common/common.H:src/common/common.H
src/common/object-selection.H:src/common/object-selection.H
src/common/sample.H:src/common/sample.H
src/common/callstack-codereftriplet.H:src/common/callstack-codereftriplet.H
src/common/codereftriplet.H:src/common/codereftriplet.H
src/common/data-object.H:src/common/data-object.H
src/common/pcf-common.H:src/common/pcf-common.H
src/common/prv-types.H:src/common/prv-types.H
src/common/common-math.H:src/common/common-math.H
src/common/prv-colors.H:src/common/prv-colors.H
src/interpolate/instance.H:src/interpolate/instance.H
src/interpolate/interpolation-results.H:src/interpolate/interpolation-results.H
src/interpolate/instance-group.H:src/interpolate/instance-group.H
src/interpolate/codereftriplet-accounting.H:src/interpolate/codereftriplet-accounting.H
src/interpolate/model/model.H:src/interpolate/model/model.H
src/interpolate/model/componentmodel.H:src/interpolate/model/componentmodel.H
src/interpolate/model/componentnode.H:src/interpolate/model/componentnode.H
src/interpolate/model/componentnode_alias.H:src/interpolate/model/componentnode_alias.H
src/interpolate/model/componentnode_constant.H:src/interpolate/model/componentnode_constant.H
src/interpolate/model/componentnode_data.H:src/interpolate/model/componentnode_data.H
src/interpolate/model/componentnode_derived.H:src/interpolate/model/componentnode_derived.H
src/interpolate/interpolate.H:src/interpolate/interpolate.H
src/interpolate/instance-container.H:src/interpolate/instance-container.H
src/interpolate/callstack-processor/callstack-processor.H:src/interpolate/callstack-processor/callstack-processor.H
src/interpolate/instance-separator.H:src/interpolate/instance-separator.H
src/interpolate/gnuplot/generate-gnuplot.H:src/interpolate/gnuplot/generate-gnuplot.H
src/interpolate/service-R/execute-R.H:src/interpolate/service-R/execute-R.H
src/interpolate/service-kriger/kriger_wrapper.h:src/interpolate/service-kriger/kriger_wrapper.h
src/interpolate/callstack-processor/callstack-processor-consecutive-recursive.H:src/interpolate/callstack-processor/callstack-processor-consecutive-recursive.H
src/io/folding-writer.H:src/io/folding-writer.H
src/io/folding-reader.H:src/io/folding-reader.H
])
AC_OUTPUT