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" )
37 dnl ------------------------------------------------------------------
38 # TODO: make this configurable through arguments
39 #Define whether you want to run with ALIROOT or only ROOT
40 AH_TEMPLATE([ALIHLT_USEPACKAGE],[running environment])
41 ALIHLT_USEPACKAGE=ALIROOT
42 #ALIHLT_USEPACKAGE=ROOT
43 #ALIHLT_USEPACKAGE=STANDALONE
44 AC_DEFINE(use_aliroot)
46 CPPFLAGS="$CPPFLAGS ${ROOTCFLAGS}"
48 dnl ------------------------------------------------------------------
49 dnl check for AliRoot features
52 AC_ARG_WITH(aliroot,[ --with-aliroot top of the AliRoot installation],
53 [test -d $with_aliroot && ALICE_ROOT=$with_aliroot],
56 if 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' ;;
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 ])
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 ])
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])
80 ALICE_TARGET=$alice_target
82 ALIROOTLIBDIR=${ALICE_ROOT}/lib/tgt_${ALICE_TARGET}
83 ALIROOTINCDIR=${ALICE_ROOT}/include
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])
88 AC_MSG_CHECKING([for AliRoot])
89 if test "x$ALICE_ROOT" != "x" \
90 && test -d ${ALIROOTLIBDIR} \
91 && test -d ${ALIROOTINCDIR}; then
92 have_aliroot=$ALICE_ROOT
97 AC_MSG_RESULT([$have_aliroot])
99 if 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
104 # - from Nov 1 2006 TTreeFormula is needed by AliTagAnalysis and requires
106 ALIROOT_CPPFLAGS="-I${ALIROOTINCDIR} -I${ALICE_ROOT}/RAW"
107 ALIROOT_LDFLAGS="-L${ALIROOTLIBDIR}"
108 ALIROOT_LIBS="-lESD -lGeom -lMinuit -lVMC -lEG -ldl -lTreePlayer"
109 save_CPPFLAGS=$CPPFLAGS
110 save_LDFLAGS=$LDFLAGS
112 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
113 LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
115 # check for certain AliRoot libraries/files/features
116 # CBD library is present since AliRoot version v4-05-00 (02.06.2006)
117 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
119 AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
121 # splitted RAW libraries since AliRoot version v4-04-Rev-07 (09.08.2006)
123 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
125 AC_CHECK_LIB([$CHECKLIB],[_init],
126 [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
127 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
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
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)
152 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
154 AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
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"
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"
168 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
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>],
178 AliTPCParamSR paramsr;
179 AliTPCDigitsArray digarray;
180 AliTPCClustersArray clustarray;
182 AliTPCClustersRow row])],
183 [AC_DEFINE(HAVE_ALITPC)
184 saveALIROOT_CPPFLAGS=$ALIROOT_CPPFLAGS
185 saveALIROOT_LIBS=$ALIROOT_LIBS],
187 ALIROOT_CPPFLAGS=$saveALIROOT_CPPFLAGS
188 ALIROOT_LIBS=$saveALIROOT_LIBS])
190 AC_MSG_RESULT($have_alitpc)
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])
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)],
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])
220 if test "x$have_aliroot" = "xno" ; then
225 CPPFLAGS=$save_CPPFLAGS
226 LDFLAGS=$save_LDFLAGS
228 if test ! "x$have_aliroot" = "xno" ; then
229 CPPFLAGS="$CPPFLAGS -DALIROOTVERSION=\\\"Unknown\\\""
233 AC_SUBST([ALIROOT_CPPFLAGS])
234 AC_SUBST([ALIROOT_LDFLAGS])
235 AC_SUBST([ALIROOT_LIBS])
236 CPPFLAGS="$CPPFLAGS -DROOTVERSION=\\\"`${ROOTCONF} --version`\\\""
238 dnl ------------------------------------------------------------------
239 dnl check for the HLT PubSub Framework
240 AC_MSG_CHECKING([for HLT PubSub Framework])
241 AC_ARG_WITH(pubsub, [installation path of the HLT PubSub framework],
243 [ test -n $ALIHLT_DC_DIR && with_pubsub=$ALIHLT_DC_DIR ])
244 if test -z $with_pubsub || ! test -d $with_pubsub ; then
247 AC_MSG_RESULT([$with_pubsub])
251 AH_TEMPLATE([HAVE_HOMERREADER],[the HLT PubSub Homer Reader interface])
252 if test "x$with_pubsub" != "xno" ; then
253 save_CPPFLAGS=$CPPFLAGS
254 save_LDFLAGS=$LDFLAGS
256 # currently the different versions of the HLT PubSub framework have a different
258 if test -d ${with_pubsub}/include/HOMER ; then
259 # the 'early' location of the include files with separated HOMER sub dirs
260 HOMER_CPPFLAGS="-I${with_pubsub}/include/HOMER -I${with_pubsub}/include/HOMER/reader"
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"
268 # fall back if include files were not installed (versions before Sep 06)
269 HOMER_CPPFLAGS="-I${with_pubsub}/src/Util/HOMER/reader/include -I${with_pubsub}/src/Util/HOMER/data/include"
271 HOMER_LDFLAGS="-L${with_pubsub}/lib/`uname -s`-`uname -m`"
272 CPPFLAGS="$save_CPPFLAGS $HOMER_CPPFLAGS"
273 LDFLAGS="$save_LDFLAGS $HOMER_LDFLAGS"
277 AC_CHECK_HEADER([HOMERReader.h],
278 [ AC_CHECK_LIB([HOMER],[_init],
280 HOMER_LIBS="-lHOMER"],
281 [ AC_CHECK_LIB([HOMERReader],[_init],
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],
296 AC_MSG_RESULT([$HOMER_VERSION])
297 ]) #AC_CHECK_HEADER([HOMERReader.h])
299 if test "x$with_homer" = "xno" ; then
304 HOMER_CPPFLAGS="$HOMER_CPPFLAGS -DHOMER_VERSION=$HOMER_VERSION"
305 AC_DEFINE(HAVE_HOMERREADER)
307 CPPFLAGS="$save_CPPFLAGS"
308 LDFLAGS="$save_LDFLAGS"
311 AC_SUBST([HOMER_CPPFLAGS])
312 AC_SUBST([HOMER_LDFLAGS])
313 AC_SUBST([HOMER_LIBS])
315 dnl ------------------------------------------------------------------
316 AC_MSG_CHECKING([whether to impose strict coding conventions])
317 AC_ARG_ENABLE(strict,
318 [AC_HELP_STRING([--enable-strict],
319 [enable coding convention checks ])],
320 [],[enable_strict=no])
321 if test "x$enable_strict" = "xyes" ; then
322 CPPFLAGS="$CPPFLAGS -Weffc++"
324 AC_MSG_RESULT([$enable_strict])
326 dnl ------------------------------------------------------------------
327 AC_MSG_CHECKING([whether to compile sample library])
328 AH_TEMPLATE([HLT_SAMPLE],[hlt sample library])
329 AC_ARG_ENABLE(sample,
330 [AC_HELP_STRING([--enable-sample],
331 [compile the sample library ])],
332 [],[enable_sample=yes])
333 if test "x$enable_sample" = "xyes" ; then
334 AC_DEFINE(HLT_SAMPLE)
336 AM_CONDITIONAL(EN_HLT_SAMPLE, test x$enable_sample = xyes)
337 AC_MSG_RESULT([$enable_sample])
339 dnl ------------------------------------------------------------------
340 AC_MSG_CHECKING([whether to compile tpc library])
341 AH_TEMPLATE([HLT_TPC],[hlt tpc library])
343 [AC_HELP_STRING([--enable-tpc],
344 [compile the tpc library ])],
346 if test "x$have_aliroot" = "xno" ; then
347 enable_tpc="no...requires.AliRoot"
348 elif test "x$have_alitpc" = "xno" ; then
349 enable_tpc="no...requires.AliRoot.TPC.libraries"
351 if test "x$enable_tpc" = "xyes" ; then
354 AM_CONDITIONAL(EN_HLT_TPC, test x$enable_tpc = xyes)
355 AC_MSG_RESULT([$enable_tpc])
357 dnl ------------------------------------------------------------------
358 AC_MSG_CHECKING([whether to compile phos library])
359 AH_TEMPLATE([HLT_PHOS],[hlt phos library])
361 [AC_HELP_STRING([--enable-phos],
362 [compile the phos library ])],
363 [],[enable_phos=yes])
364 if test "x$have_aliroot" = "xno" ; then
365 enable_phos="no...requires.AliRoot"
367 if test "x$enable_phos" = "xyes" ; then
370 AM_CONDITIONAL(EN_HLT_PHOS, test x$enable_phos = xyes)
371 AC_MSG_RESULT([$enable_phos])
373 dnl ------------------------------------------------------------------
374 AC_MSG_CHECKING([whether to enable HLT logging])
375 AH_TEMPLATE([NOLOGGING],[disable hlt logging])
376 AC_ARG_ENABLE(logging,
377 [AC_HELP_STRING([--enable-logging],
379 [],[enable_logging=yes])
380 if test "x$enable_logging" != "xyes" ; then
383 AC_MSG_RESULT([$enable_logging])
385 dnl ------------------------------------------------------------------
386 AC_MSG_CHECKING([whether to enable saving MC data through the chain])
387 AH_TEMPLATE([DOMC],[MC saving])
388 AC_ARG_ENABLE(mc-saving,
389 [AC_HELP_STRING([--enable-mc-saving],
390 [enable saving MC data through the chain])],
391 [],[enable_mc_saving=no])
392 if test "x$enable_mc_saving" = "xyes" ; then
395 AC_MSG_RESULT([$enable_mc_saving])
397 dnl ------------------------------------------------------------------
398 AC_MSG_CHECKING([whether to enable AliRoot NEWIO])
399 AH_TEMPLATE([use_newio],[AliRoot NEWIO])
401 [AC_HELP_STRING([--enable-newio],
402 [enable AliRoot NEWIO ])],
403 [],[enable_newio=yes])
404 if test "x$enable_newio" = "xyes" ; then
407 AC_MSG_RESULT([$enable_newio])
409 dnl ------------------------------------------------------------------
410 dnl certainly something old, but we keep the define
411 AC_MSG_CHECKING([whether to use ROWHOUGH])
412 AH_TEMPLATE([USEROWHOUGH],[HLT ROWHOUGH])
413 AC_ARG_ENABLE(rowhough,
414 [AC_HELP_STRING([--enable-rowhough],
416 [],[enable_rowhough=no])
417 if test "x$enable_rowhough" = "xyes" ; then
418 AC_DEFINE(USEROWHOUGH)
420 AC_MSG_RESULT([$enable_rowhough])
422 dnl ------------------------------------------------------------------
426 AC_ARG_VAR(DOXYGEN, The Documentation Generator)
427 AC_PATH_PROG(PERL, perl)
428 AC_PATH_PROG(DOXYGEN, doxygen)
429 AM_CONDITIONAL(HAVE_DOXYGEN, test ! "x$DOXYGEN" = "x")
432 AC_PATH_PROG(DOT, dot)
433 if ! test "x$DOT" = "x" ; then
435 DOT_PATH=`dirname $DOT`
440 dnl ------------------------------------------------------------------
441 dnl inatallation directory for libraries
443 if test "x$prefix" != "xNONE" && test $ALICE_ROOT = $prefix ; then
444 libdir=\${exec_prefix}/lib/tgt_$ALICE_TARGET
445 AC_MSG_NOTICE([libdir set to $libdir])
447 dnl ------------------------------------------------------------------
448 AC_CONFIG_FILES([Makefile
452 TPCLib/mapping2array.cxx
453 TPCLib/OnlineDisplay/Makefile