1 dnl -*- mode: autoconf -*-
4 dnl template for the configuration script for the Alice HLT
5 dnl framework and components
7 dnl ------------------------------------------------------------------
8 AC_INIT([Alice High Level Trigger] , [0.5-dev], [Matthias.Richter@ift.uib.no], alice-hlt)
10 dnl ------------------------------------------------------------------
11 dnl the package from CVS contains the old Makefiles as well. In order to
12 dnl prevent them from becoming overwritten, we require a separate build
14 if test "`dirname $0`" = "." ; then
15 AC_ERROR([please run the script from a separate build directory])
18 dnl ------------------------------------------------------------------
20 AC_PREFIX_DEFAULT(${PWD})
21 AC_CONFIG_SRCDIR(BASE/AliHLTComponent.cxx)
30 dnl ------------------------------------------------------------------
34 ROOT_PATH(, [have_root=1], [AC_ERROR([Stop! The HLT package needs ROOT.])])
35 AM_CONDITIONAL(HAVE_ROOT, test "x$have_root" = "x1" )
38 dnl ------------------------------------------------------------------
39 # TODO: make this configurable through arguments
40 #Define whether you want to run with ALIROOT or only ROOT
41 AH_TEMPLATE([ALIHLT_USEPACKAGE],[running environment])
42 ALIHLT_USEPACKAGE=ALIROOT
43 #ALIHLT_USEPACKAGE=ROOT
44 #ALIHLT_USEPACKAGE=STANDALONE
45 AC_DEFINE(use_aliroot)
47 CPPFLAGS="$CPPFLAGS ${ROOTCFLAGS}"
49 dnl ------------------------------------------------------------------
50 dnl check for AliRoot features
53 AC_ARG_WITH(aliroot,[ --with-aliroot top of the AliRoot installation],
54 [test -d $with_aliroot && ALICE_ROOT=$with_aliroot],
57 if test "x$ALICE_ROOT" != "x" && test -d $ALICE_ROOT ; then
58 dnl ------------------------------------------------------------------
59 dnl Try to estimate the system architecture
60 case $host_os:$host_cpu in
61 linux*:x86_64*) alice_target='linuxx8664gcc' ;;
62 linux*) alice_target='linux' ;;
63 *) alice_target='unknown' ;;
65 if test "x$alice_target" = "xunknown" ; then
66 if test -z $ALICE_TARGET ; then
67 AC_MSG_ERROR([Can not estimate system architecture.
68 To avoid the problem, set the ALICE_TARGET variable appropriately.
69 Please send the following information to Matthias.Richter@ift.uib.no:
70 ${PACKAGE}: no AliRoot target definition for os=$host_os and cpu=$host_cpu ])
72 AC_MSG_NOTICE([Unknown system architecture.
73 Please send the following information to Matthias.Richter@ift.uib.no:
74 ${PACKAGE}: no AliRoot target definition for os=$host_os and cpu=$host_cpu ])
77 if test "x$ALICE_TARGET" != "x" && test "x$ALICE_TARGET" != "x$alice_target" ; then
78 AC_MSG_WARN([The ALICE_TARGET variable does not match your current system
79 overriding $ALICE_TARGET by $alice_target])
81 ALICE_TARGET=$alice_target
83 ALIROOTLIBDIR=${ALICE_ROOT}/lib/tgt_${ALICE_TARGET}
84 ALIROOTINCDIR=${ALICE_ROOT}/include
85 test -d ${ALIROOTLIBDIR} || AC_MSG_WARN([can not find AliRoot library directory $ALIROOTLIBDIR])
86 test -d ${ALIROOTINCDIR} || AC_MSG_WARN([can not find AliRoot include directory $ALIROOTINCDIR])
89 AC_MSG_CHECKING([for AliRoot])
90 if test "x$ALICE_ROOT" != "x" \
91 && test -d ${ALIROOTLIBDIR} \
92 && test -d ${ALIROOTINCDIR}; then
93 have_aliroot=$ALICE_ROOT
98 AC_MSG_RESULT([$have_aliroot])
100 if test ! "x$have_aliroot" = "xno" ; then
101 # we check for the libSTEER library which is linked to
102 # - the ROOT libs libGeom libMinuit libVMC libEG
103 # - the AliRoot libESD libRAWData (libRAWDatarec from v4-04-Rev-07)
104 # - ROOT libCint needs also libdl
105 # - from Nov 1 2006 TTreeFormula is needed by AliTagAnalysis and requires
107 ALIROOT_CPPFLAGS="-I${ALIROOTINCDIR} -I${ALICE_ROOT}/RAW"
108 ALIROOT_LDFLAGS="-L${ALIROOTLIBDIR}"
109 ALIROOT_LIBS="-lESD -lGeom -lMinuit -lVMC -lEG -ldl -lTreePlayer"
110 save_CPPFLAGS=$CPPFLAGS
111 save_LDFLAGS=$LDFLAGS
113 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
114 LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
116 # check for certain AliRoot libraries/files/features
117 # CBD library is present since AliRoot version v4-05-00 (02.06.2006)
118 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
120 AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
122 # splitted RAW libraries since AliRoot version v4-04-Rev-07 (09.08.2006)
124 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
126 AC_CHECK_LIB([$CHECKLIB],[_init],
127 [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
128 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
130 AC_CHECK_LIB([$CHECKLIB],[_init],
131 [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
132 AC_DEFINE(HAVE_ALIRAWDATA)
133 have_alirawdata=$CHECKLIB])],
134 [# second pass with -RAWData
136 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $CHECKLIB -lSTEER"
137 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRawReaderMemory.h>
138 #include <AliRawReaderFile.h>
139 #include <AliRawReaderDate.h>
140 #include <AliRawReaderRoot.h>],
141 [AliRawReaderMemory mreader;
142 AliRawReaderFile freader;
143 AliRawReaderDate dreader(NULL,0);
144 AliRawReaderRoot rreader(NULL,0);])],
145 [AC_DEFINE(HAVE_ALIRAWDATA)
146 ALIROOT_LIBS="$ALIROOT_LIBS $CHECKLIB"
147 have_alirawdata=$CHECKLIB],
148 [have_alirawdata=no])
149 ]) dnl AC_CHECK_LIB RAWDatabase
150 AC_MSG_CHECKING(for AliRawReader classes in RAWData libraries)
151 AC_MSG_RESULT($have_alirawdata)
153 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
155 AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
157 if test ! "x$have_aliroot" = "xno" ; then
158 # the HLTTPCLib needs to link agains TPCbase and TPCrec
159 # TPC library for AliTPCParam and AliSimDigits used in
160 # AliHLTTPCFileHandler.h and AliHLTTPCDisplay.cxx
161 saveALIROOT_CPPFLAGS="$ALIROOT_CPPFLAGS"
162 ALIROOT_CPPFLAGS="$saveALIROOT_CPPFLAGS -I${ALICE_ROOT}/TPC"
163 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
165 AC_MSG_CHECKING(for required classes in TPC libraries)
166 if test ! "x$have_alitpc" = "xno" ; then
167 save_ALIROOT_LIBS=$ALIROOT_LIBS
168 ALIROOT_LIBS="$save_ALIROOT_LIBS -lTPCbase -lTPCrec"
169 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
170 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliSimDigits.h>
171 #include <AliTPCParam.h>
172 #include <AliTPCParamSR.h>
173 #include <AliTPCDigitsArray.h>
174 #include <AliTPCClustersArray.h>
175 #include <AliTPCcluster.h>
176 #include <AliTPCClustersRow.h>],
179 AliTPCParamSR paramsr;
180 AliTPCDigitsArray digarray;
181 AliTPCClustersArray clustarray;
183 AliTPCClustersRow row])],
184 [AC_DEFINE(HAVE_ALITPC)
185 saveALIROOT_CPPFLAGS=$ALIROOT_CPPFLAGS
186 saveALIROOT_LIBS=$ALIROOT_LIBS],
188 ALIROOT_CPPFLAGS=$saveALIROOT_CPPFLAGS
189 ALIROOT_LIBS=$saveALIROOT_LIBS])
191 AC_MSG_RESULT($have_alitpc)
194 if test ! "x$have_alirawdata" = "xno" ; then
195 # check for header files needed by the TPCLib/AliHLTTPCDigitReaderPacket
196 # the header file has been moved to the TPC module
197 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
198 # AliRawReaderMemory.h AliRawReaderFile.h already checked
199 #AC_CHECK_HEADERS([AliRawReaderMemory.h AliRawReaderFile.h AliTPCRawStream.h])
200 AC_CHECK_HEADERS([AliTPCRawStream.h])
204 if test ! "x$have_aliroot" = "xno" ; then
205 # the TPCLib/AliHLTTPCRawReader needs the actual Pad layot of the TPC
206 # which is stored in the TPC/mapping/Patchx.data files from
207 # AliRoot version v4-04-Release (May 2006)
208 AH_TEMPLATE([HAVE_TPC_MAPPING],[TPC pad mapping available])
209 TPC_PAD_MAPPING_PATH=$have_aliroot/TPC/mapping
210 AC_CHECK_FILE( [$TPC_PAD_MAPPING_PATH/Patch0.data],
211 [have_tpc_mapping=yes
212 AC_SUBST(TPC_PAD_MAPPING_PATH)
213 AC_DEFINE(HAVE_TPC_MAPPING)],
217 AC_MSG_CHECKING([for TPC mapping layout])
218 AM_CONDITIONAL(USE_TPC_MAPPING, test x$have_tpc_mapping = xyes)
219 AC_MSG_RESULT([$have_tpc_mapping])
221 if test "x$have_aliroot" = "xno" ; then
226 CPPFLAGS=$save_CPPFLAGS
227 LDFLAGS=$save_LDFLAGS
231 AC_SUBST([ALIROOT_CPPFLAGS])
232 AC_SUBST([ALIROOT_LDFLAGS])
233 AC_SUBST([ALIROOTLIBDIR])
234 AC_SUBST([ALIROOT_LIBS])
236 HLTBASE_CPPFLAGS='-I${top_srcdir}/BASE'
238 AC_SUBST([HLTBASE_CPPFLAGS])
239 AC_SUBST([HLTBASE_LDFLAGS])
241 dnl ------------------------------------------------------------------
242 dnl check for the HLT PubSub Framework
243 AC_MSG_CHECKING([for HLT PubSub Framework])
244 AC_ARG_WITH(pubsub, [installation path of the HLT PubSub framework],
246 [ test -n $ALIHLT_DC_DIR && with_pubsub=$ALIHLT_DC_DIR ])
247 if test -z $with_pubsub || ! test -d $with_pubsub ; then
250 AC_MSG_RESULT([$with_pubsub])
254 AH_TEMPLATE([HAVE_HOMERREADER],[the HLT PubSub Homer Reader interface])
255 if test "x$with_pubsub" != "xno" ; then
256 save_CPPFLAGS=$CPPFLAGS
257 save_LDFLAGS=$LDFLAGS
259 # currently the different versions of the HLT PubSub framework have a different
261 if test -d ${with_pubsub}/include/HOMER ; then
262 # the 'early' location of the include files with separated HOMER sub dirs
263 HOMER_CPPFLAGS="-I${with_pubsub}/include/HOMER -I${with_pubsub}/include/HOMER/reader"
264 elif test -d ${with_pubsub}/include/Util/HOMER ; then
265 # location for HLT Framework versions after Sep 2006
266 HOMER_CPPFLAGS="-I${with_pubsub}/include/Util/HOMER"
267 elif test -d ${with_pubsub}/src/Util/HOMER/include ; then
268 # fall back if include files were not installed (versions after Sep 06)
269 HOMER_CPPFLAGS="-I${with_pubsub}/src/Util/HOMER/include"
271 # fall back if include files were not installed (versions before Sep 06)
272 HOMER_CPPFLAGS="-I${with_pubsub}/src/Util/HOMER/reader/include -I${with_pubsub}/src/Util/HOMER/data/include"
274 HOMER_BINDIR="${with_pubsub}/bin/`uname -s`-`uname -m`"
275 HOMER_LIBDIR="${with_pubsub}/lib/`uname -s`-`uname -m`"
276 HOMER_LDFLAGS="-L${HOMER_LIBDIR}"
277 CPPFLAGS="$save_CPPFLAGS $HOMER_CPPFLAGS"
278 LDFLAGS="$save_LDFLAGS $HOMER_LDFLAGS"
282 AC_CHECK_HEADER([HOMERReader.h],
283 [ AC_CHECK_LIB([HOMER],[_init],
285 HOMER_LIBS="-lHOMER"],
286 [ AC_CHECK_LIB([HOMERReader],[_init],
288 HOMER_LIBS="-lHOMERReader"])])
289 LIBS="$LIBS $HOMER_LIBS"
290 AC_MSG_CHECKING([for HOMER version])
291 dnl The Homer library has no versioning, so we do our own
292 dnl version description
293 dnl ----------------------------------------------------------------------
294 dnl 1 inintial version
295 dnl 2 GetBlockStatusFlags added to the interface
296 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <HOMERReader.h>],
297 [HOMERReader reader("dummy", 0);
298 reader.GetBlockStatusFlags(0);])],
299 [if test $HOMER_VERSION -lt 2 ; then HOMER_VERSION=2; fi],
301 AC_MSG_RESULT([$HOMER_VERSION])
302 ]) #AC_CHECK_HEADER([HOMERReader.h])
304 if test "x$with_homer" = "xno" ; then
309 HOMER_CPPFLAGS="$HOMER_CPPFLAGS -DHOMER_VERSION=$HOMER_VERSION"
310 AC_DEFINE(HAVE_HOMERREADER)
312 CPPFLAGS="$save_CPPFLAGS"
313 LDFLAGS="$save_LDFLAGS"
316 AC_SUBST([HOMER_CPPFLAGS])
317 AC_SUBST([HOMER_LDFLAGS])
318 AC_SUBST([HOMER_LIBDIR])
319 AC_SUBST([HOMER_BINDIR])
320 AC_SUBST([HOMER_LIBS])
322 dnl ------------------------------------------------------------------
323 AC_MSG_CHECKING([whether to impose strict coding conventions])
324 AC_ARG_ENABLE(strict,
325 [AC_HELP_STRING([--enable-strict],
326 [enable coding convention checks ])],
327 [],[enable_strict=no])
328 if test "x$enable_strict" = "xyes" ; then
329 CPPFLAGS="$CPPFLAGS -Weffc++"
331 AC_MSG_RESULT([$enable_strict])
333 dnl ------------------------------------------------------------------
334 AC_MSG_CHECKING([whether to compile sample library])
335 AH_TEMPLATE([HLT_SAMPLE],[hlt sample library])
336 AC_ARG_ENABLE(sample,
337 [AC_HELP_STRING([--enable-sample],
338 [compile the sample library ])],
339 [],[enable_sample=yes])
340 if test "x$enable_sample" = "xyes" ; then
341 AC_DEFINE(HLT_SAMPLE)
343 AM_CONDITIONAL(EN_HLT_SAMPLE, test x$enable_sample = xyes)
344 AC_MSG_RESULT([$enable_sample])
346 dnl ------------------------------------------------------------------
347 AC_MSG_CHECKING([whether to compile tpc library])
348 AH_TEMPLATE([HLT_TPC],[hlt tpc library])
350 [AC_HELP_STRING([--enable-tpc],
351 [compile the tpc library ])],
353 if test "x$have_aliroot" = "xno" ; then
354 enable_tpc="no...requires.AliRoot"
355 elif test "x$have_alitpc" = "xno" ; then
356 enable_tpc="no...requires.AliRoot.TPC.libraries"
358 if test "x$enable_tpc" = "xyes" ; then
361 AM_CONDITIONAL(EN_HLT_TPC, test x$enable_tpc = xyes)
362 AC_MSG_RESULT([$enable_tpc])
364 dnl ------------------------------------------------------------------
365 AC_MSG_CHECKING([whether to compile phos library])
366 AH_TEMPLATE([HLT_PHOS],[hlt phos library])
368 [AC_HELP_STRING([--enable-phos],
369 [compile the phos library ])],
370 [],[enable_phos=yes])
371 if test "x$have_aliroot" = "xno" ; then
372 enable_phos="no...requires.AliRoot"
374 if test "x$enable_phos" = "xyes" ; then
377 AM_CONDITIONAL(EN_HLT_PHOS, test x$enable_phos = xyes)
378 AC_MSG_RESULT([$enable_phos])
380 dnl ------------------------------------------------------------------
381 AC_MSG_CHECKING([whether to enable HLT logging])
382 AH_TEMPLATE([NOLOGGING],[disable hlt logging])
383 AC_ARG_ENABLE(logging,
384 [AC_HELP_STRING([--enable-logging],
386 [],[enable_logging=yes])
387 if test "x$enable_logging" != "xyes" ; then
390 AC_MSG_RESULT([$enable_logging])
392 dnl ------------------------------------------------------------------
393 AC_MSG_CHECKING([whether to enable saving MC data through the chain])
394 AH_TEMPLATE([DOMC],[MC saving])
395 AC_ARG_ENABLE(mc-saving,
396 [AC_HELP_STRING([--enable-mc-saving],
397 [enable saving MC data through the chain])],
398 [],[enable_mc_saving=no])
399 if test "x$enable_mc_saving" = "xyes" ; then
402 AC_MSG_RESULT([$enable_mc_saving])
404 dnl ------------------------------------------------------------------
405 dnl certainly something old, but we keep the define
406 AC_MSG_CHECKING([whether to use ROWHOUGH])
407 AH_TEMPLATE([USEROWHOUGH],[HLT ROWHOUGH])
408 AC_ARG_ENABLE(rowhough,
409 [AC_HELP_STRING([--enable-rowhough],
411 [],[enable_rowhough=no])
412 if test "x$enable_rowhough" = "xyes" ; then
413 AC_DEFINE(USEROWHOUGH)
415 AC_MSG_RESULT([$enable_rowhough])
417 dnl ------------------------------------------------------------------
418 dnl The ROOTVERSION and ALIROOTVERSION defines were used by the old
419 dnl stand-alone build system. This is most likely something old we can
420 dnl get rid off later, or do something more reasonable. Since the define
421 dnl needs the quotes they have to be escaped. This works well for the
422 dnl Makefile but not for the configure script. So we have to add the
423 dnl defines after all the other checks.
424 CPPFLAGS="$CPPFLAGS -DROOTVERSION=\\\"`${ROOTCONF} --version`\\\""
425 if test ! "x$have_aliroot" = "xno" ; then
426 CPPFLAGS="$CPPFLAGS -DALIROOTVERSION=\\\"Unknown\\\""
429 dnl ------------------------------------------------------------------
433 AC_ARG_VAR(DOXYGEN, The Documentation Generator)
434 AC_PATH_PROG(PERL, perl)
435 AC_PATH_PROG(DOXYGEN, doxygen)
436 AM_CONDITIONAL(HAVE_DOXYGEN, test ! "x$DOXYGEN" = "x")
439 AC_PATH_PROG(DOT, dot)
440 if ! test "x$DOT" = "x" ; then
442 DOT_PATH=`dirname $DOT`
447 dnl ------------------------------------------------------------------
448 dnl inatallation directory for libraries
450 if test "x$prefix" != "xNONE" && test $ALICE_ROOT = $prefix ; then
451 libdir=\${exec_prefix}/lib/tgt_$ALICE_TARGET
452 AC_MSG_NOTICE([libdir set to $libdir])
454 dnl ------------------------------------------------------------------
455 AC_CONFIG_FILES([Makefile
461 TPCLib/mapping2array.cxx
462 TPCLib/OnlineDisplay/Makefile