]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/configure.ac
method added to convert raw digits to sdigits
[u/mrichter/AliRoot.git] / HLT / configure.ac
CommitLineData
b521659f 1dnl -*- mode: autoconf -*-
2dnl
3dnl $Id$
4dnl template for the configuration script for the Alice HLT
5dnl framework and components
6dnl
7dnl ------------------------------------------------------------------
2bbbadd1 8AC_INIT([Alice High Level Trigger] , [0.5-dev], [Matthias.Richter@ift.uib.no], alice-hlt)
b521659f 9
10dnl ------------------------------------------------------------------
11dnl the package from CVS contains the old Makefiles as well. In order to
12dnl prevent them from becoming overwritten, we require a separate build
13dnl directory
14if test "`dirname $0`" = "." ; then
15 AC_ERROR([please run the script from a separate build directory])
16fi
17
18dnl ------------------------------------------------------------------
19AC_CANONICAL_SYSTEM
20AC_PREFIX_DEFAULT(${PWD})
21AC_CONFIG_SRCDIR(BASE/AliHLTComponent.cxx)
22AM_INIT_AUTOMAKE
23AC_PROG_CC
24AC_PROG_CXX
25AC_PROG_LIBTOOL
26
27AC_DEBUG
28AC_OPTIMIZATION
29
30dnl ------------------------------------------------------------------
31dnl
32dnl Check for ROOT
33dnl
34ROOT_PATH(, [have_root=1], [AC_ERROR([Stop! The HLT package needs ROOT.])])
35AM_CONDITIONAL(HAVE_ROOT, test "x$have_root" = "x1" )
36
37dnl ------------------------------------------------------------------
38# TODO: make this configurable through arguments
39#Define whether you want to run with ALIROOT or only ROOT
40AH_TEMPLATE([ALIHLT_USEPACKAGE],[running environment])
41ALIHLT_USEPACKAGE=ALIROOT
42#ALIHLT_USEPACKAGE=ROOT
43#ALIHLT_USEPACKAGE=STANDALONE
44AC_DEFINE(use_aliroot)
45AC_DEFINE(use_root)
85869391 46CPPFLAGS="$CPPFLAGS ${ROOTCFLAGS}"
85869391 47
48dnl ------------------------------------------------------------------
74c73e5a 49dnl check for AliRoot features
50AC_LANG_PUSH(C++)
74c73e5a 51have_aliroot=no
2bbbadd1 52AC_ARG_WITH(aliroot,[ --with-aliroot top of the AliRoot installation],
53 [test -d $with_aliroot && ALICE_ROOT=$with_aliroot],
54 [])
55
56if test "x$ALICE_ROOT" != "x" && test -d $ALICE_ROOT ; then
57 dnl ------------------------------------------------------------------
58 dnl Try to estimate the system architecture
59 case $host_os:$host_cpu in
60 linux*:x86_64*) alice_target='linuxx8664gcc' ;;
61 linux*) alice_target='linux' ;;
62 *) alice_target='unknown' ;;
63 esac
64 if test "x$alice_target" = "xunknown" ; then
65 if test -z $ALICE_TARGET ; then
66 AC_MSG_ERROR([Can not estimate system architecture.
67 To avoid the problem, set the ALICE_TARGET variable appropriately.
68 Please send the following information to Matthias.Richter@ift.uib.no:
69 ${PACKAGE}: no AliRoot target definition for os=$host_os and cpu=$host_cpu ])
70 else
71 AC_MSG_NOTICE([Unknown system architecture.
72 Please send the following information to Matthias.Richter@ift.uib.no:
73 ${PACKAGE}: no AliRoot target definition for os=$host_os and cpu=$host_cpu ])
74 fi
75 else
76 if test "x$ALICE_TARGET" != "x" && test "x$ALICE_TARGET" != "x$alice_target" ; then
77 AC_MSG_WARN([The ALICE_TARGET variable does not match your current system
78 overriding $ALICE_TARGET by $alice_target])
79 fi
80 ALICE_TARGET=$alice_target
81 fi
74c73e5a 82 ALIROOTLIBDIR=${ALICE_ROOT}/lib/tgt_${ALICE_TARGET}
83 ALIROOTINCDIR=${ALICE_ROOT}/include
2bbbadd1 84 test -d ${ALIROOTLIBDIR} || AC_MSG_WARN([can not find AliRoot library directory $ALIROOTLIBDIR])
85 test -d ${ALIROOTINCDIR} || AC_MSG_WARN([can not find AliRoot include directory $ALIROOTINCDIR])
74c73e5a 86fi
2bbbadd1 87
88AC_MSG_CHECKING([for AliRoot])
74c73e5a 89if test "x$ALICE_ROOT" != "x" \
90 && test -d ${ALIROOTLIBDIR} \
91 && test -d ${ALIROOTINCDIR}; then
92 have_aliroot=$ALICE_ROOT
93else
94 ALIROOTLIBDIR=
95 ALIROOTINCDIR=
96fi
97AC_MSG_RESULT([$have_aliroot])
98
99if test ! "x$have_aliroot" = "xno" ; then
100 # we check for the libSTEER library which is linked to
101 # - the ROOT libs libGeom libMinuit libVMC libEG
102 # - the AliRoot libESD libRAWData (libRAWDatarec from v4-04-Rev-07)
103 # - ROOT libCint needs also libdl
fd07422b 104 # - from Nov 1 2006 TTreeFormula is needed by AliTagAnalysis and requires
105 # libTreePlayer.so
74c73e5a 106 ALIROOT_CPPFLAGS="-I${ALIROOTINCDIR} -I${ALICE_ROOT}/RAW"
107 ALIROOT_LDFLAGS="-L${ALIROOTLIBDIR}"
fd07422b 108 ALIROOT_LIBS="-lESD -lGeom -lMinuit -lVMC -lEG -ldl -lTreePlayer"
74c73e5a 109 save_CPPFLAGS=$CPPFLAGS
110 save_LDFLAGS=$LDFLAGS
111 save_LIBS=$LIBS
112 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
db16520a 113 LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
2bbbadd1 114
74c73e5a 115 # check for certain AliRoot libraries/files/features
2bbbadd1 116 # CBD library is present since AliRoot version v4-05-00 (02.06.2006)
117 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
118 CHECKLIB=CDB
119 AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
74c73e5a 120
2bbbadd1 121 # splitted RAW libraries since AliRoot version v4-04-Rev-07 (09.08.2006)
122 have_alirawdata=no
123 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
124 CHECKLIB=RAWDatabase
125 AC_CHECK_LIB([$CHECKLIB],[_init],
126 [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
127 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
128 CHECKLIB=RAWDatarec
129 AC_CHECK_LIB([$CHECKLIB],[_init],
130 [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
131 AC_DEFINE(HAVE_ALIRAWDATA)
132 have_alirawdata=$CHECKLIB])],
133 [# second pass with -RAWData
134 CHECKLIB="-lRAWData"
135 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $CHECKLIB -lSTEER"
136 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRawReaderMemory.h>
137 #include <AliRawReaderFile.h>
138 #include <AliRawReaderDate.h>
139 #include <AliRawReaderRoot.h>],
140 [AliRawReaderMemory mreader;
141 AliRawReaderFile freader;
142 AliRawReaderDate dreader(NULL,0);
143 AliRawReaderRoot rreader(NULL,0);])],
144 [AC_DEFINE(HAVE_ALIRAWDATA)
145 ALIROOT_LIBS="$ALIROOT_LIBS $CHECKLIB"
146 have_alirawdata=$CHECKLIB],
147 [have_alirawdata=no])
148 ]) dnl AC_CHECK_LIB RAWDatabase
149 AC_MSG_CHECKING(for AliRawReader classes in RAWData libraries)
150 AC_MSG_RESULT($have_alirawdata)
151
152 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
153 CHECKLIB=STEER
154 AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
74c73e5a 155
156 if test ! "x$have_aliroot" = "xno" ; then
157 # the HLTTPCLib needs to link agains TPCbase and TPCrec
158 # TPC library for AliTPCParam and AliSimDigits used in
159 # AliHLTTPCFileHandler.h and AliHLTTPCDisplay.cxx
160 saveALIROOT_CPPFLAGS="$ALIROOT_CPPFLAGS"
161 ALIROOT_CPPFLAGS="$saveALIROOT_CPPFLAGS -I${ALICE_ROOT}/TPC"
162 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
163 have_alitpc=yes
164 AC_MSG_CHECKING(for required classes in TPC libraries)
165 if test ! "x$have_alitpc" = "xno" ; then
166 save_ALIROOT_LIBS=$ALIROOT_LIBS
167 ALIROOT_LIBS="$save_ALIROOT_LIBS -lTPCbase -lTPCrec"
db16520a 168 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
74c73e5a 169 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliSimDigits.h>
170 #include <AliTPCParam.h>
171 #include <AliTPCParamSR.h>
172 #include <AliTPCDigitsArray.h>
173 #include <AliTPCClustersArray.h>
174 #include <AliTPCcluster.h>
175 #include <AliTPCClustersRow.h>],
176 [AliSimDigits dig;
177 AliTPCParam param;
178 AliTPCParamSR paramsr;
179 AliTPCDigitsArray digarray;
180 AliTPCClustersArray clustarray;
181 AliTPCcluster clust;
182 AliTPCClustersRow row])],
183 [AC_DEFINE(HAVE_ALITPC)
184 saveALIROOT_CPPFLAGS=$ALIROOT_CPPFLAGS
185 saveALIROOT_LIBS=$ALIROOT_LIBS],
186 [have_alitpc=no
187 ALIROOT_CPPFLAGS=$saveALIROOT_CPPFLAGS
188 ALIROOT_LIBS=$saveALIROOT_LIBS])
189 fi
190 AC_MSG_RESULT($have_alitpc)
191 fi
192
193 if test ! "x$have_alirawdata" = "xno" ; then
194 # check for header files needed by the TPCLib/AliHLTTPCDigitReaderPacket
195 # the header file has been moved to the TPC module
196 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
197 # AliRawReaderMemory.h AliRawReaderFile.h already checked
198 #AC_CHECK_HEADERS([AliRawReaderMemory.h AliRawReaderFile.h AliTPCRawStream.h])
199 AC_CHECK_HEADERS([AliTPCRawStream.h])
200 fi
85869391 201
db16520a 202 have_tpc_mapping=no
203 if test ! "x$have_aliroot" = "xno" ; then
204 # the TPCLib/AliHLTTPCRawReader needs the actual Pad layot of the TPC
205 # which is stored in the TPC/mapping/Patchx.data files from
206 # AliRoot version v4-04-Release (May 2006)
207 AH_TEMPLATE([HAVE_TPC_MAPPING],[TPC pad mapping available])
208 TPC_PAD_MAPPING_PATH=$have_aliroot/TPC/mapping
209 AC_CHECK_FILE( [$TPC_PAD_MAPPING_PATH/Patch0.data],
210 [have_tpc_mapping=yes
211 AC_SUBST(TPC_PAD_MAPPING_PATH)
212 AC_DEFINE(HAVE_TPC_MAPPING)],
213 [])
214
215 fi
216 AC_MSG_CHECKING([for TPC mapping layout])
217 AM_CONDITIONAL(USE_TPC_MAPPING, test x$have_tpc_mapping = xyes)
218 AC_MSG_RESULT([$have_tpc_mapping])
219
74c73e5a 220 if test "x$have_aliroot" = "xno" ; then
221 ALIROOT_CPPFLAGS=
222 ALIROOT_LDFLAGS=
223 ALIROOT_LIBS=
224 fi
225 CPPFLAGS=$save_CPPFLAGS
226 LDFLAGS=$save_LDFLAGS
227 LIBS=$save_LIBS
228 if test ! "x$have_aliroot" = "xno" ; then
229 CPPFLAGS="$CPPFLAGS -DALIROOTVERSION=\\\"Unknown\\\""
230 fi
231fi
232AC_LANG_POP(C++)
233AC_SUBST([ALIROOT_CPPFLAGS])
234AC_SUBST([ALIROOT_LDFLAGS])
235AC_SUBST([ALIROOT_LIBS])
236CPPFLAGS="$CPPFLAGS -DROOTVERSION=\\\"`${ROOTCONF} --version`\\\""
85869391 237
78b557c2 238dnl ------------------------------------------------------------------
239dnl check for the HLT PubSub Framework
240AC_MSG_CHECKING([for HLT PubSub Framework])
241AC_ARG_WITH(pubsub, [installation path of the HLT PubSub framework],
242 [],
243 [ test -n $ALIHLT_DC_DIR && with_pubsub=$ALIHLT_DC_DIR ])
244if test -z $with_pubsub || ! test -d $with_pubsub ; then
245 with_pubsub=no
246fi
247AC_MSG_RESULT([$with_pubsub])
5f1685a0 248HOMER_VERSION=1
249HOMER_LIBS=
78b557c2 250
251AH_TEMPLATE([HAVE_HOMERREADER],[the HLT PubSub Homer Reader interface])
252if test "x$with_pubsub" != "xno" ; then
253 save_CPPFLAGS=$CPPFLAGS
254 save_LDFLAGS=$LDFLAGS
255 save_LIBS=$LIBS
4a6b4894 256 # currently the different versions of the HLT PubSub framework have a different
257 # directory layout
20b6dd9a 258 if test -d ${with_pubsub}/include/HOMER ; then
5235c3e9 259 # the 'early' location of the include files with separated HOMER sub dirs
20b6dd9a 260 HOMER_CPPFLAGS="-I${with_pubsub}/include/HOMER -I${with_pubsub}/include/HOMER/reader"
5235c3e9 261 elif test -d ${with_pubsub}/include/Util/HOMER ; then
262 # location for HLT Framework versions after Sep 2006
263 HOMER_CPPFLAGS="-I${with_pubsub}/include/Util/HOMER"
264 elif test -d ${with_pubsub}/src/Util/HOMER/include ; then
265 # fall back if include files were not installed (versions after Sep 06)
266 HOMER_CPPFLAGS="-I${with_pubsub}/src/Util/HOMER/include"
4a6b4894 267 else
5235c3e9 268 # fall back if include files were not installed (versions before Sep 06)
4a6b4894 269 HOMER_CPPFLAGS="-I${with_pubsub}/src/Util/HOMER/reader/include -I${with_pubsub}/src/Util/HOMER/data/include"
270 fi
271 HOMER_LDFLAGS="-L${with_pubsub}/lib/`uname -s`-`uname -m`"
78b557c2 272 CPPFLAGS="$save_CPPFLAGS $HOMER_CPPFLAGS"
273 LDFLAGS="$save_LDFLAGS $HOMER_LDFLAGS"
274 LIBS="$save_LIBS "
275 with_homer=no
276 AC_LANG_PUSH(C++)
277 AC_CHECK_HEADER([HOMERReader.h],
5f1685a0 278 [ AC_CHECK_LIB([HOMER],[_init],
279 [with_homer=yes
280 HOMER_LIBS="-lHOMER"],
281 [ AC_CHECK_LIB([HOMERReader],[_init],
282 [with_homer=yes
283 HOMER_LIBS="-lHOMERReader"])])
284 LIBS="$LIBS $HOMER_LIBS"
285 AC_MSG_CHECKING([for HOMER version])
286 dnl The Homer library has no versioning, so we do our own
287 dnl version description
288 dnl ----------------------------------------------------------------------
289 dnl 1 inintial version
290 dnl 2 GetBlockStatusFlags added to the interface
291 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <HOMERReader.h>],
292 [HOMERReader reader("dummy", 0);
293 reader.GetBlockStatusFlags(0);])],
294 [if test $HOMER_VERSION -lt 2 ; then HOMER_VERSION=2; fi],
295 [])
296 AC_MSG_RESULT([$HOMER_VERSION])
297 ]) #AC_CHECK_HEADER([HOMERReader.h])
78b557c2 298 AC_LANG_POP(C++)
299 if test "x$with_homer" = "xno" ; then
300 HOMER_CPPFLAGS=
301 HOMER_LDFLAGS=
5f1685a0 302 HOMER_LIBS=
78b557c2 303 else
5f1685a0 304 HOMER_CPPFLAGS="$HOMER_CPPFLAGS -DHOMER_VERSION=$HOMER_VERSION"
78b557c2 305 AC_DEFINE(HAVE_HOMERREADER)
306 fi
307 CPPFLAGS="$save_CPPFLAGS"
308 LDFLAGS="$save_LDFLAGS"
309 LIBS="$save_LIBS"
310fi
311AC_SUBST([HOMER_CPPFLAGS])
312AC_SUBST([HOMER_LDFLAGS])
5f1685a0 313AC_SUBST([HOMER_LIBS])
78b557c2 314
85869391 315dnl ------------------------------------------------------------------
316AC_MSG_CHECKING([whether to impose strict coding conventions])
317AC_ARG_ENABLE(strict,
318 [AC_HELP_STRING([--enable-strict],
319 [enable coding convention checks ])],
320 [],[enable_strict=no])
321if test "x$enable_strict" = "xyes" ; then
322 CPPFLAGS="$CPPFLAGS -Weffc++"
323fi
324AC_MSG_RESULT([$enable_strict])
b521659f 325
326dnl ------------------------------------------------------------------
327AC_MSG_CHECKING([whether to compile sample library])
328AH_TEMPLATE([HLT_SAMPLE],[hlt sample library])
329AC_ARG_ENABLE(sample,
330 [AC_HELP_STRING([--enable-sample],
331 [compile the sample library ])],
332 [],[enable_sample=yes])
333if test "x$enable_sample" = "xyes" ; then
334 AC_DEFINE(HLT_SAMPLE)
335fi
336AM_CONDITIONAL(EN_HLT_SAMPLE, test x$enable_sample = xyes)
337AC_MSG_RESULT([$enable_sample])
338
339dnl ------------------------------------------------------------------
340AC_MSG_CHECKING([whether to compile tpc library])
341AH_TEMPLATE([HLT_TPC],[hlt tpc library])
342AC_ARG_ENABLE(tpc,
343 [AC_HELP_STRING([--enable-tpc],
344 [compile the tpc library ])],
345 [],[enable_tpc=yes])
74c73e5a 346if test "x$have_aliroot" = "xno" ; then
347 enable_tpc="no...requires.AliRoot"
348elif test "x$have_alitpc" = "xno" ; then
349 enable_tpc="no...requires.AliRoot.TPC.libraries"
350fi
b521659f 351if test "x$enable_tpc" = "xyes" ; then
352 AC_DEFINE(HLT_TPC)
353fi
354AM_CONDITIONAL(EN_HLT_TPC, test x$enable_tpc = xyes)
355AC_MSG_RESULT([$enable_tpc])
356
c160eda8 357dnl ------------------------------------------------------------------
358AC_MSG_CHECKING([whether to compile phos library])
359AH_TEMPLATE([HLT_PHOS],[hlt phos library])
360AC_ARG_ENABLE(phos,
361 [AC_HELP_STRING([--enable-phos],
362 [compile the phos library ])],
363 [],[enable_phos=yes])
364if test "x$have_aliroot" = "xno" ; then
365 enable_phos="no...requires.AliRoot"
366fi
367if test "x$enable_phos" = "xyes" ; then
368 AC_DEFINE(HLT_PHOS)
369fi
370AM_CONDITIONAL(EN_HLT_PHOS, test x$enable_phos = xyes)
371AC_MSG_RESULT([$enable_phos])
372
b521659f 373dnl ------------------------------------------------------------------
374AC_MSG_CHECKING([whether to enable HLT logging])
375AH_TEMPLATE([NOLOGGING],[disable hlt logging])
376AC_ARG_ENABLE(logging,
377 [AC_HELP_STRING([--enable-logging],
378 [enable logging])],
379 [],[enable_logging=yes])
380if test "x$enable_logging" != "xyes" ; then
381 AC_DEFINE(NOLOGGING)
382fi
383AC_MSG_RESULT([$enable_logging])
384
385dnl ------------------------------------------------------------------
386AC_MSG_CHECKING([whether to enable saving MC data through the chain])
387AH_TEMPLATE([DOMC],[MC saving])
388AC_ARG_ENABLE(mc-saving,
389 [AC_HELP_STRING([--enable-mc-saving],
390 [enable saving MC data through the chain])],
391 [],[enable_mc_saving=no])
392if test "x$enable_mc_saving" = "xyes" ; then
393 AC_DEFINE(DOMC)
394fi
395AC_MSG_RESULT([$enable_mc_saving])
396
b521659f 397dnl ------------------------------------------------------------------
398AC_MSG_CHECKING([whether to enable AliRoot NEWIO])
399AH_TEMPLATE([use_newio],[AliRoot NEWIO])
400AC_ARG_ENABLE(newio,
401 [AC_HELP_STRING([--enable-newio],
402 [enable AliRoot NEWIO ])],
403 [],[enable_newio=yes])
404if test "x$enable_newio" = "xyes" ; then
405 AC_DEFINE(use_newio)
406fi
407AC_MSG_RESULT([$enable_newio])
408
409dnl ------------------------------------------------------------------
410dnl certainly something old, but we keep the define
411AC_MSG_CHECKING([whether to use ROWHOUGH])
412AH_TEMPLATE([USEROWHOUGH],[HLT ROWHOUGH])
413AC_ARG_ENABLE(rowhough,
414 [AC_HELP_STRING([--enable-rowhough],
415 [use ROWHOUGH ])],
416 [],[enable_rowhough=no])
417if test "x$enable_rowhough" = "xyes" ; then
418 AC_DEFINE(USEROWHOUGH)
419fi
420AC_MSG_RESULT([$enable_rowhough])
421
422dnl ------------------------------------------------------------------
423dnl
424dnl Documentation
425dnl
426AC_ARG_VAR(DOXYGEN, The Documentation Generator)
427AC_PATH_PROG(PERL, perl)
428AC_PATH_PROG(DOXYGEN, doxygen)
429AM_CONDITIONAL(HAVE_DOXYGEN, test ! "x$DOXYGEN" = "x")
430HAVE_DOT=NO
431DOT_PATH=
432AC_PATH_PROG(DOT, dot)
433if ! test "x$DOT" = "x" ; then
434 HAVE_DOT=YES
435 DOT_PATH=`dirname $DOT`
436fi
437AC_SUBST([HAVE_DOT])
438AC_SUBST([DOT_PATH])
439
2bbbadd1 440dnl ------------------------------------------------------------------
441dnl inatallation directory for libraries
442dnl
443if test "x$prefix" != "xNONE" && test $ALICE_ROOT = $prefix ; then
444libdir=\${exec_prefix}/lib/tgt_$ALICE_TARGET
445AC_MSG_NOTICE([libdir set to $libdir])
446fi
b521659f 447dnl ------------------------------------------------------------------
448AC_CONFIG_FILES([Makefile
449 BASE/Makefile
450 SampleLib/Makefile
451 TPCLib/Makefile
db16520a 452 TPCLib/mapping2array.cxx
78b557c2 453 TPCLib/OnlineDisplay/Makefile
c160eda8 454 PHOS/Makefile
b521659f 455 doc/Makefile
456 doc/doxygen.conf])
457
458
459AC_OUTPUT
460dnl
461dnl EOF
462dnl
463