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 ALIROOT_CPPFLAGS="-I${ALIROOTINCDIR} -I${ALICE_ROOT}/RAW"
105 ALIROOT_LDFLAGS="-L${ALIROOTLIBDIR}"
106 ALIROOT_LIBS="-lESD -lGeom -lMinuit -lVMC -lEG -ldl"
107 save_CPPFLAGS=$CPPFLAGS
108 save_LDFLAGS=$LDFLAGS
110 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
111 LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
113 # check for certain AliRoot libraries/files/features
114 # CBD library is present since AliRoot version v4-05-00 (02.06.2006)
115 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
117 AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
119 # splitted RAW libraries since AliRoot version v4-04-Rev-07 (09.08.2006)
121 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
123 AC_CHECK_LIB([$CHECKLIB],[_init],
124 [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
125 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
127 AC_CHECK_LIB([$CHECKLIB],[_init],
128 [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
129 AC_DEFINE(HAVE_ALIRAWDATA)
130 have_alirawdata=$CHECKLIB])],
131 [# second pass with -RAWData
133 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $CHECKLIB -lSTEER"
134 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRawReaderMemory.h>
135 #include <AliRawReaderFile.h>
136 #include <AliRawReaderDate.h>
137 #include <AliRawReaderRoot.h>],
138 [AliRawReaderMemory mreader;
139 AliRawReaderFile freader;
140 AliRawReaderDate dreader(NULL,0);
141 AliRawReaderRoot rreader(NULL,0);])],
142 [AC_DEFINE(HAVE_ALIRAWDATA)
143 ALIROOT_LIBS="$ALIROOT_LIBS $CHECKLIB"
144 have_alirawdata=$CHECKLIB],
145 [have_alirawdata=no])
146 ]) dnl AC_CHECK_LIB RAWDatabase
147 AC_MSG_CHECKING(for AliRawReader classes in RAWData libraries)
148 AC_MSG_RESULT($have_alirawdata)
150 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
152 AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
154 if test ! "x$have_aliroot" = "xno" ; then
155 # the HLTTPCLib needs to link agains TPCbase and TPCrec
156 # TPC library for AliTPCParam and AliSimDigits used in
157 # AliHLTTPCFileHandler.h and AliHLTTPCDisplay.cxx
158 saveALIROOT_CPPFLAGS="$ALIROOT_CPPFLAGS"
159 ALIROOT_CPPFLAGS="$saveALIROOT_CPPFLAGS -I${ALICE_ROOT}/TPC"
160 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
162 AC_MSG_CHECKING(for required classes in TPC libraries)
163 if test ! "x$have_alitpc" = "xno" ; then
164 save_ALIROOT_LIBS=$ALIROOT_LIBS
165 ALIROOT_LIBS="$save_ALIROOT_LIBS -lTPCbase -lTPCrec"
166 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
167 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliSimDigits.h>
168 #include <AliTPCParam.h>
169 #include <AliTPCParamSR.h>
170 #include <AliTPCDigitsArray.h>
171 #include <AliTPCClustersArray.h>
172 #include <AliTPCcluster.h>
173 #include <AliTPCClustersRow.h>],
176 AliTPCParamSR paramsr;
177 AliTPCDigitsArray digarray;
178 AliTPCClustersArray clustarray;
180 AliTPCClustersRow row])],
181 [AC_DEFINE(HAVE_ALITPC)
182 saveALIROOT_CPPFLAGS=$ALIROOT_CPPFLAGS
183 saveALIROOT_LIBS=$ALIROOT_LIBS],
185 ALIROOT_CPPFLAGS=$saveALIROOT_CPPFLAGS
186 ALIROOT_LIBS=$saveALIROOT_LIBS])
188 AC_MSG_RESULT($have_alitpc)
191 if test ! "x$have_alirawdata" = "xno" ; then
192 # check for header files needed by the TPCLib/AliHLTTPCDigitReaderPacket
193 # the header file has been moved to the TPC module
194 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
195 # AliRawReaderMemory.h AliRawReaderFile.h already checked
196 #AC_CHECK_HEADERS([AliRawReaderMemory.h AliRawReaderFile.h AliTPCRawStream.h])
197 AC_CHECK_HEADERS([AliTPCRawStream.h])
201 if test ! "x$have_aliroot" = "xno" ; then
202 # the TPCLib/AliHLTTPCRawReader needs the actual Pad layot of the TPC
203 # which is stored in the TPC/mapping/Patchx.data files from
204 # AliRoot version v4-04-Release (May 2006)
205 AH_TEMPLATE([HAVE_TPC_MAPPING],[TPC pad mapping available])
206 TPC_PAD_MAPPING_PATH=$have_aliroot/TPC/mapping
207 AC_CHECK_FILE( [$TPC_PAD_MAPPING_PATH/Patch0.data],
208 [have_tpc_mapping=yes
209 AC_SUBST(TPC_PAD_MAPPING_PATH)
210 AC_DEFINE(HAVE_TPC_MAPPING)],
214 AC_MSG_CHECKING([for TPC mapping layout])
215 AM_CONDITIONAL(USE_TPC_MAPPING, test x$have_tpc_mapping = xyes)
216 AC_MSG_RESULT([$have_tpc_mapping])
218 if test "x$have_aliroot" = "xno" ; then
223 CPPFLAGS=$save_CPPFLAGS
224 LDFLAGS=$save_LDFLAGS
226 if test ! "x$have_aliroot" = "xno" ; then
227 CPPFLAGS="$CPPFLAGS -DALIROOTVERSION=\\\"Unknown\\\""
231 AC_SUBST([ALIROOT_CPPFLAGS])
232 AC_SUBST([ALIROOT_LDFLAGS])
233 AC_SUBST([ALIROOT_LIBS])
234 CPPFLAGS="$CPPFLAGS -DROOTVERSION=\\\"`${ROOTCONF} --version`\\\""
236 dnl ------------------------------------------------------------------
237 dnl check for the HLT PubSub Framework
238 AC_MSG_CHECKING([for HLT PubSub Framework])
239 AC_ARG_WITH(pubsub, [installation path of the HLT PubSub framework],
241 [ test -n $ALIHLT_DC_DIR && with_pubsub=$ALIHLT_DC_DIR ])
242 if test -z $with_pubsub || ! test -d $with_pubsub ; then
245 AC_MSG_RESULT([$with_pubsub])
249 AH_TEMPLATE([HAVE_HOMERREADER],[the HLT PubSub Homer Reader interface])
250 if test "x$with_pubsub" != "xno" ; then
251 save_CPPFLAGS=$CPPFLAGS
252 save_LDFLAGS=$LDFLAGS
254 # currently the different versions of the HLT PubSub framework have a different
256 if test -d ${with_pubsub}/include/HOMER ; then
257 # the 'early' location of the include files with separated HOMER sub dirs
258 HOMER_CPPFLAGS="-I${with_pubsub}/include/HOMER -I${with_pubsub}/include/HOMER/reader"
259 elif test -d ${with_pubsub}/include/Util/HOMER ; then
260 # location for HLT Framework versions after Sep 2006
261 HOMER_CPPFLAGS="-I${with_pubsub}/include/Util/HOMER"
262 elif test -d ${with_pubsub}/src/Util/HOMER/include ; then
263 # fall back if include files were not installed (versions after Sep 06)
264 HOMER_CPPFLAGS="-I${with_pubsub}/src/Util/HOMER/include"
266 # fall back if include files were not installed (versions before Sep 06)
267 HOMER_CPPFLAGS="-I${with_pubsub}/src/Util/HOMER/reader/include -I${with_pubsub}/src/Util/HOMER/data/include"
269 HOMER_LDFLAGS="-L${with_pubsub}/lib/`uname -s`-`uname -m`"
270 CPPFLAGS="$save_CPPFLAGS $HOMER_CPPFLAGS"
271 LDFLAGS="$save_LDFLAGS $HOMER_LDFLAGS"
275 AC_CHECK_HEADER([HOMERReader.h],
276 [ AC_CHECK_LIB([HOMER],[_init],
278 HOMER_LIBS="-lHOMER"],
279 [ AC_CHECK_LIB([HOMERReader],[_init],
281 HOMER_LIBS="-lHOMERReader"])])
282 LIBS="$LIBS $HOMER_LIBS"
283 AC_MSG_CHECKING([for HOMER version])
284 dnl The Homer library has no versioning, so we do our own
285 dnl version description
286 dnl ----------------------------------------------------------------------
287 dnl 1 inintial version
288 dnl 2 GetBlockStatusFlags added to the interface
289 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <HOMERReader.h>],
290 [HOMERReader reader("dummy", 0);
291 reader.GetBlockStatusFlags(0);])],
292 [if test $HOMER_VERSION -lt 2 ; then HOMER_VERSION=2; fi],
294 AC_MSG_RESULT([$HOMER_VERSION])
295 ]) #AC_CHECK_HEADER([HOMERReader.h])
297 if test "x$with_homer" = "xno" ; then
302 HOMER_CPPFLAGS="$HOMER_CPPFLAGS -DHOMER_VERSION=$HOMER_VERSION"
303 AC_DEFINE(HAVE_HOMERREADER)
305 CPPFLAGS="$save_CPPFLAGS"
306 LDFLAGS="$save_LDFLAGS"
309 AC_SUBST([HOMER_CPPFLAGS])
310 AC_SUBST([HOMER_LDFLAGS])
311 AC_SUBST([HOMER_LIBS])
313 dnl ------------------------------------------------------------------
314 AC_MSG_CHECKING([whether to impose strict coding conventions])
315 AC_ARG_ENABLE(strict,
316 [AC_HELP_STRING([--enable-strict],
317 [enable coding convention checks ])],
318 [],[enable_strict=no])
319 if test "x$enable_strict" = "xyes" ; then
320 CPPFLAGS="$CPPFLAGS -Weffc++"
322 AC_MSG_RESULT([$enable_strict])
324 dnl ------------------------------------------------------------------
325 AC_MSG_CHECKING([whether to compile sample library])
326 AH_TEMPLATE([HLT_SAMPLE],[hlt sample library])
327 AC_ARG_ENABLE(sample,
328 [AC_HELP_STRING([--enable-sample],
329 [compile the sample library ])],
330 [],[enable_sample=yes])
331 if test "x$enable_sample" = "xyes" ; then
332 AC_DEFINE(HLT_SAMPLE)
334 AM_CONDITIONAL(EN_HLT_SAMPLE, test x$enable_sample = xyes)
335 AC_MSG_RESULT([$enable_sample])
337 dnl ------------------------------------------------------------------
338 AC_MSG_CHECKING([whether to compile tpc library])
339 AH_TEMPLATE([HLT_TPC],[hlt tpc library])
341 [AC_HELP_STRING([--enable-tpc],
342 [compile the tpc library ])],
344 if test "x$have_aliroot" = "xno" ; then
345 enable_tpc="no...requires.AliRoot"
346 elif test "x$have_alitpc" = "xno" ; then
347 enable_tpc="no...requires.AliRoot.TPC.libraries"
349 if test "x$enable_tpc" = "xyes" ; then
352 AM_CONDITIONAL(EN_HLT_TPC, test x$enable_tpc = xyes)
353 AC_MSG_RESULT([$enable_tpc])
355 dnl ------------------------------------------------------------------
356 AC_MSG_CHECKING([whether to compile phos library])
357 AH_TEMPLATE([HLT_PHOS],[hlt phos library])
359 [AC_HELP_STRING([--enable-phos],
360 [compile the phos library ])],
361 [],[enable_phos=yes])
362 if test "x$have_aliroot" = "xno" ; then
363 enable_phos="no...requires.AliRoot"
365 if test "x$enable_phos" = "xyes" ; then
368 AM_CONDITIONAL(EN_HLT_PHOS, test x$enable_phos = xyes)
369 AC_MSG_RESULT([$enable_phos])
371 dnl ------------------------------------------------------------------
372 AC_MSG_CHECKING([whether to enable HLT logging])
373 AH_TEMPLATE([NOLOGGING],[disable hlt logging])
374 AC_ARG_ENABLE(logging,
375 [AC_HELP_STRING([--enable-logging],
377 [],[enable_logging=yes])
378 if test "x$enable_logging" != "xyes" ; then
381 AC_MSG_RESULT([$enable_logging])
383 dnl ------------------------------------------------------------------
384 AC_MSG_CHECKING([whether to enable saving MC data through the chain])
385 AH_TEMPLATE([DOMC],[MC saving])
386 AC_ARG_ENABLE(mc-saving,
387 [AC_HELP_STRING([--enable-mc-saving],
388 [enable saving MC data through the chain])],
389 [],[enable_mc_saving=no])
390 if test "x$enable_mc_saving" = "xyes" ; then
393 AC_MSG_RESULT([$enable_mc_saving])
395 dnl ------------------------------------------------------------------
396 AC_MSG_CHECKING([whether to enable AliRoot NEWIO])
397 AH_TEMPLATE([use_newio],[AliRoot NEWIO])
399 [AC_HELP_STRING([--enable-newio],
400 [enable AliRoot NEWIO ])],
401 [],[enable_newio=yes])
402 if test "x$enable_newio" = "xyes" ; then
405 AC_MSG_RESULT([$enable_newio])
407 dnl ------------------------------------------------------------------
408 dnl certainly something old, but we keep the define
409 AC_MSG_CHECKING([whether to use ROWHOUGH])
410 AH_TEMPLATE([USEROWHOUGH],[HLT ROWHOUGH])
411 AC_ARG_ENABLE(rowhough,
412 [AC_HELP_STRING([--enable-rowhough],
414 [],[enable_rowhough=no])
415 if test "x$enable_rowhough" = "xyes" ; then
416 AC_DEFINE(USEROWHOUGH)
418 AC_MSG_RESULT([$enable_rowhough])
420 dnl ------------------------------------------------------------------
424 AC_ARG_VAR(DOXYGEN, The Documentation Generator)
425 AC_PATH_PROG(PERL, perl)
426 AC_PATH_PROG(DOXYGEN, doxygen)
427 AM_CONDITIONAL(HAVE_DOXYGEN, test ! "x$DOXYGEN" = "x")
430 AC_PATH_PROG(DOT, dot)
431 if ! test "x$DOT" = "x" ; then
433 DOT_PATH=`dirname $DOT`
438 dnl ------------------------------------------------------------------
439 dnl inatallation directory for libraries
441 if test "x$prefix" != "xNONE" && test $ALICE_ROOT = $prefix ; then
442 libdir=\${exec_prefix}/lib/tgt_$ALICE_TARGET
443 AC_MSG_NOTICE([libdir set to $libdir])
445 dnl ------------------------------------------------------------------
446 AC_CONFIG_FILES([Makefile
450 TPCLib/mapping2array.cxx
451 TPCLib/OnlineDisplay/Makefile