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])
247 AH_TEMPLATE([HAVE_HOMERREADER],[the HLT PubSub Homer Reader interface])
248 if test "x$with_pubsub" != "xno" ; then
249 save_CPPFLAGS=$CPPFLAGS
250 save_LDFLAGS=$LDFLAGS
252 # currently the different versions of the HLT PubSub framework have a different
254 if test -d ${with_pubsub}/include/HOMER ; then
255 HOMER_CPPFLAGS="-I${with_pubsub}/include/HOMER -I${with_pubsub}/include/HOMER/reader"
257 HOMER_CPPFLAGS="-I${with_pubsub}/src/Util/HOMER/reader/include -I${with_pubsub}/src/Util/HOMER/data/include"
259 HOMER_LDFLAGS="-L${with_pubsub}/lib/`uname -s`-`uname -m`"
260 CPPFLAGS="$save_CPPFLAGS $HOMER_CPPFLAGS"
261 LDFLAGS="$save_LDFLAGS $HOMER_LDFLAGS"
265 AC_CHECK_HEADER([HOMERReader.h],
266 [ AC_CHECK_LIB([HOMERReader],[_init],[with_homer=yes])])
268 if test "x$with_homer" = "xno" ; then
272 AC_DEFINE(HAVE_HOMERREADER)
274 CPPFLAGS="$save_CPPFLAGS"
275 LDFLAGS="$save_LDFLAGS"
278 AC_SUBST([HOMER_CPPFLAGS])
279 AC_SUBST([HOMER_LDFLAGS])
281 dnl ------------------------------------------------------------------
282 AC_MSG_CHECKING([whether to impose strict coding conventions])
283 AC_ARG_ENABLE(strict,
284 [AC_HELP_STRING([--enable-strict],
285 [enable coding convention checks ])],
286 [],[enable_strict=no])
287 if test "x$enable_strict" = "xyes" ; then
288 CPPFLAGS="$CPPFLAGS -Weffc++"
290 AC_MSG_RESULT([$enable_strict])
292 dnl ------------------------------------------------------------------
293 AC_MSG_CHECKING([whether to compile sample library])
294 AH_TEMPLATE([HLT_SAMPLE],[hlt sample library])
295 AC_ARG_ENABLE(sample,
296 [AC_HELP_STRING([--enable-sample],
297 [compile the sample library ])],
298 [],[enable_sample=yes])
299 if test "x$enable_sample" = "xyes" ; then
300 AC_DEFINE(HLT_SAMPLE)
302 AM_CONDITIONAL(EN_HLT_SAMPLE, test x$enable_sample = xyes)
303 AC_MSG_RESULT([$enable_sample])
305 dnl ------------------------------------------------------------------
306 AC_MSG_CHECKING([whether to compile tpc library])
307 AH_TEMPLATE([HLT_TPC],[hlt tpc library])
309 [AC_HELP_STRING([--enable-tpc],
310 [compile the tpc library ])],
312 if test "x$have_aliroot" = "xno" ; then
313 enable_tpc="no...requires.AliRoot"
314 elif test "x$have_alitpc" = "xno" ; then
315 enable_tpc="no...requires.AliRoot.TPC.libraries"
317 if test "x$enable_tpc" = "xyes" ; then
320 AM_CONDITIONAL(EN_HLT_TPC, test x$enable_tpc = xyes)
321 AC_MSG_RESULT([$enable_tpc])
323 dnl ------------------------------------------------------------------
324 AC_MSG_CHECKING([whether to enable HLT logging])
325 AH_TEMPLATE([NOLOGGING],[disable hlt logging])
326 AC_ARG_ENABLE(logging,
327 [AC_HELP_STRING([--enable-logging],
329 [],[enable_logging=yes])
330 if test "x$enable_logging" != "xyes" ; then
333 AC_MSG_RESULT([$enable_logging])
335 dnl ------------------------------------------------------------------
336 AC_MSG_CHECKING([whether to enable saving MC data through the chain])
337 AH_TEMPLATE([DOMC],[MC saving])
338 AC_ARG_ENABLE(mc-saving,
339 [AC_HELP_STRING([--enable-mc-saving],
340 [enable saving MC data through the chain])],
341 [],[enable_mc_saving=no])
342 if test "x$enable_mc_saving" = "xyes" ; then
345 AC_MSG_RESULT([$enable_mc_saving])
347 dnl ------------------------------------------------------------------
348 AC_MSG_CHECKING([whether to enable AliRoot NEWIO])
349 AH_TEMPLATE([use_newio],[AliRoot NEWIO])
351 [AC_HELP_STRING([--enable-newio],
352 [enable AliRoot NEWIO ])],
353 [],[enable_newio=yes])
354 if test "x$enable_newio" = "xyes" ; then
357 AC_MSG_RESULT([$enable_newio])
359 dnl ------------------------------------------------------------------
360 dnl certainly something old, but we keep the define
361 AC_MSG_CHECKING([whether to use ROWHOUGH])
362 AH_TEMPLATE([USEROWHOUGH],[HLT ROWHOUGH])
363 AC_ARG_ENABLE(rowhough,
364 [AC_HELP_STRING([--enable-rowhough],
366 [],[enable_rowhough=no])
367 if test "x$enable_rowhough" = "xyes" ; then
368 AC_DEFINE(USEROWHOUGH)
370 AC_MSG_RESULT([$enable_rowhough])
372 dnl ------------------------------------------------------------------
376 AC_ARG_VAR(DOXYGEN, The Documentation Generator)
377 AC_PATH_PROG(PERL, perl)
378 AC_PATH_PROG(DOXYGEN, doxygen)
379 AM_CONDITIONAL(HAVE_DOXYGEN, test ! "x$DOXYGEN" = "x")
382 AC_PATH_PROG(DOT, dot)
383 if ! test "x$DOT" = "x" ; then
385 DOT_PATH=`dirname $DOT`
390 dnl ------------------------------------------------------------------
391 dnl inatallation directory for libraries
393 if test "x$prefix" != "xNONE" && test $ALICE_ROOT = $prefix ; then
394 libdir=\${exec_prefix}/lib/tgt_$ALICE_TARGET
395 AC_MSG_NOTICE([libdir set to $libdir])
397 dnl ------------------------------------------------------------------
398 AC_CONFIG_FILES([Makefile
402 TPCLib/mapping2array.cxx
403 TPCLib/OnlineDisplay/Makefile