Material updates.
[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
104 ALIROOT_CPPFLAGS="-I${ALIROOTINCDIR} -I${ALICE_ROOT}/RAW"
105 ALIROOT_LDFLAGS="-L${ALIROOTLIBDIR}"
2bbbadd1 106 ALIROOT_LIBS="-lESD -lGeom -lMinuit -lVMC -lEG -ldl"
74c73e5a 107 save_CPPFLAGS=$CPPFLAGS
108 save_LDFLAGS=$LDFLAGS
109 save_LIBS=$LIBS
110 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
db16520a 111 LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
2bbbadd1 112
74c73e5a 113 # check for certain AliRoot libraries/files/features
2bbbadd1 114 # CBD library is present since AliRoot version v4-05-00 (02.06.2006)
115 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
116 CHECKLIB=CDB
117 AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
74c73e5a 118
2bbbadd1 119 # splitted RAW libraries since AliRoot version v4-04-Rev-07 (09.08.2006)
120 have_alirawdata=no
121 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
122 CHECKLIB=RAWDatabase
123 AC_CHECK_LIB([$CHECKLIB],[_init],
124 [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
125 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
126 CHECKLIB=RAWDatarec
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
132 CHECKLIB="-lRAWData"
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)
149
150 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
151 CHECKLIB=STEER
152 AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
74c73e5a 153
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"
161 have_alitpc=yes
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"
db16520a 166 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
74c73e5a 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>],
174 [AliSimDigits dig;
175 AliTPCParam param;
176 AliTPCParamSR paramsr;
177 AliTPCDigitsArray digarray;
178 AliTPCClustersArray clustarray;
179 AliTPCcluster clust;
180 AliTPCClustersRow row])],
181 [AC_DEFINE(HAVE_ALITPC)
182 saveALIROOT_CPPFLAGS=$ALIROOT_CPPFLAGS
183 saveALIROOT_LIBS=$ALIROOT_LIBS],
184 [have_alitpc=no
185 ALIROOT_CPPFLAGS=$saveALIROOT_CPPFLAGS
186 ALIROOT_LIBS=$saveALIROOT_LIBS])
187 fi
188 AC_MSG_RESULT($have_alitpc)
189 fi
190
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])
198 fi
85869391 199
db16520a 200 have_tpc_mapping=no
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)],
211 [])
212
213 fi
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])
217
74c73e5a 218 if test "x$have_aliroot" = "xno" ; then
219 ALIROOT_CPPFLAGS=
220 ALIROOT_LDFLAGS=
221 ALIROOT_LIBS=
222 fi
223 CPPFLAGS=$save_CPPFLAGS
224 LDFLAGS=$save_LDFLAGS
225 LIBS=$save_LIBS
226 if test ! "x$have_aliroot" = "xno" ; then
227 CPPFLAGS="$CPPFLAGS -DALIROOTVERSION=\\\"Unknown\\\""
228 fi
229fi
230AC_LANG_POP(C++)
231AC_SUBST([ALIROOT_CPPFLAGS])
232AC_SUBST([ALIROOT_LDFLAGS])
233AC_SUBST([ALIROOT_LIBS])
234CPPFLAGS="$CPPFLAGS -DROOTVERSION=\\\"`${ROOTCONF} --version`\\\""
85869391 235
236dnl ------------------------------------------------------------------
78b557c2 237dnl check for the HLT PubSub Framework
238AC_MSG_CHECKING([for HLT PubSub Framework])
239AC_ARG_WITH(pubsub, [installation path of the HLT PubSub framework],
240 [],
241 [ test -n $ALIHLT_DC_DIR && with_pubsub=$ALIHLT_DC_DIR ])
242if test -z $with_pubsub || ! test -d $with_pubsub ; then
243 with_pubsub=no
244fi
245AC_MSG_RESULT([$with_pubsub])
246
247AH_TEMPLATE([HAVE_HOMERREADER],[the HLT PubSub Homer Reader interface])
248if test "x$with_pubsub" != "xno" ; then
249 save_CPPFLAGS=$CPPFLAGS
250 save_LDFLAGS=$LDFLAGS
251 save_LIBS=$LIBS
4a6b4894 252 # currently the different versions of the HLT PubSub framework have a different
253 # directory layout
20b6dd9a 254 if test -d ${with_pubsub}/include/HOMER ; then
5235c3e9 255 # the 'early' location of the include files with separated HOMER sub dirs
20b6dd9a 256 HOMER_CPPFLAGS="-I${with_pubsub}/include/HOMER -I${with_pubsub}/include/HOMER/reader"
5235c3e9 257 elif test -d ${with_pubsub}/include/Util/HOMER ; then
258 # location for HLT Framework versions after Sep 2006
259 HOMER_CPPFLAGS="-I${with_pubsub}/include/Util/HOMER"
260 elif test -d ${with_pubsub}/src/Util/HOMER/include ; then
261 # fall back if include files were not installed (versions after Sep 06)
262 HOMER_CPPFLAGS="-I${with_pubsub}/src/Util/HOMER/include"
4a6b4894 263 else
5235c3e9 264 # fall back if include files were not installed (versions before Sep 06)
4a6b4894 265 HOMER_CPPFLAGS="-I${with_pubsub}/src/Util/HOMER/reader/include -I${with_pubsub}/src/Util/HOMER/data/include"
266 fi
267 HOMER_LDFLAGS="-L${with_pubsub}/lib/`uname -s`-`uname -m`"
78b557c2 268 CPPFLAGS="$save_CPPFLAGS $HOMER_CPPFLAGS"
269 LDFLAGS="$save_LDFLAGS $HOMER_LDFLAGS"
270 LIBS="$save_LIBS "
271 with_homer=no
272 AC_LANG_PUSH(C++)
273 AC_CHECK_HEADER([HOMERReader.h],
274 [ AC_CHECK_LIB([HOMERReader],[_init],[with_homer=yes])])
275 AC_LANG_POP(C++)
276 if test "x$with_homer" = "xno" ; then
277 HOMER_CPPFLAGS=
278 HOMER_LDFLAGS=
279 else
280 AC_DEFINE(HAVE_HOMERREADER)
281 fi
282 CPPFLAGS="$save_CPPFLAGS"
283 LDFLAGS="$save_LDFLAGS"
284 LIBS="$save_LIBS"
285fi
286AC_SUBST([HOMER_CPPFLAGS])
287AC_SUBST([HOMER_LDFLAGS])
288
289dnl ------------------------------------------------------------------
85869391 290AC_MSG_CHECKING([whether to impose strict coding conventions])
291AC_ARG_ENABLE(strict,
292 [AC_HELP_STRING([--enable-strict],
293 [enable coding convention checks ])],
294 [],[enable_strict=no])
295if test "x$enable_strict" = "xyes" ; then
296 CPPFLAGS="$CPPFLAGS -Weffc++"
297fi
298AC_MSG_RESULT([$enable_strict])
b521659f 299
300dnl ------------------------------------------------------------------
301AC_MSG_CHECKING([whether to compile sample library])
302AH_TEMPLATE([HLT_SAMPLE],[hlt sample library])
303AC_ARG_ENABLE(sample,
304 [AC_HELP_STRING([--enable-sample],
305 [compile the sample library ])],
306 [],[enable_sample=yes])
307if test "x$enable_sample" = "xyes" ; then
308 AC_DEFINE(HLT_SAMPLE)
309fi
310AM_CONDITIONAL(EN_HLT_SAMPLE, test x$enable_sample = xyes)
311AC_MSG_RESULT([$enable_sample])
312
313dnl ------------------------------------------------------------------
314AC_MSG_CHECKING([whether to compile tpc library])
315AH_TEMPLATE([HLT_TPC],[hlt tpc library])
316AC_ARG_ENABLE(tpc,
317 [AC_HELP_STRING([--enable-tpc],
318 [compile the tpc library ])],
319 [],[enable_tpc=yes])
74c73e5a 320if test "x$have_aliroot" = "xno" ; then
321 enable_tpc="no...requires.AliRoot"
322elif test "x$have_alitpc" = "xno" ; then
323 enable_tpc="no...requires.AliRoot.TPC.libraries"
324fi
b521659f 325if test "x$enable_tpc" = "xyes" ; then
326 AC_DEFINE(HLT_TPC)
327fi
328AM_CONDITIONAL(EN_HLT_TPC, test x$enable_tpc = xyes)
329AC_MSG_RESULT([$enable_tpc])
330
331dnl ------------------------------------------------------------------
c160eda8 332AC_MSG_CHECKING([whether to compile phos library])
333AH_TEMPLATE([HLT_PHOS],[hlt phos library])
334AC_ARG_ENABLE(phos,
335 [AC_HELP_STRING([--enable-phos],
336 [compile the phos library ])],
337 [],[enable_phos=yes])
338if test "x$have_aliroot" = "xno" ; then
339 enable_phos="no...requires.AliRoot"
340fi
341if test "x$enable_phos" = "xyes" ; then
342 AC_DEFINE(HLT_PHOS)
343fi
344AM_CONDITIONAL(EN_HLT_PHOS, test x$enable_phos = xyes)
345AC_MSG_RESULT([$enable_phos])
346
347dnl ------------------------------------------------------------------
b521659f 348AC_MSG_CHECKING([whether to enable HLT logging])
349AH_TEMPLATE([NOLOGGING],[disable hlt logging])
350AC_ARG_ENABLE(logging,
351 [AC_HELP_STRING([--enable-logging],
352 [enable logging])],
353 [],[enable_logging=yes])
354if test "x$enable_logging" != "xyes" ; then
355 AC_DEFINE(NOLOGGING)
356fi
357AC_MSG_RESULT([$enable_logging])
358
359dnl ------------------------------------------------------------------
360AC_MSG_CHECKING([whether to enable saving MC data through the chain])
361AH_TEMPLATE([DOMC],[MC saving])
362AC_ARG_ENABLE(mc-saving,
363 [AC_HELP_STRING([--enable-mc-saving],
364 [enable saving MC data through the chain])],
365 [],[enable_mc_saving=no])
366if test "x$enable_mc_saving" = "xyes" ; then
367 AC_DEFINE(DOMC)
368fi
369AC_MSG_RESULT([$enable_mc_saving])
370
371dnl ------------------------------------------------------------------
b521659f 372AC_MSG_CHECKING([whether to enable AliRoot NEWIO])
373AH_TEMPLATE([use_newio],[AliRoot NEWIO])
374AC_ARG_ENABLE(newio,
375 [AC_HELP_STRING([--enable-newio],
376 [enable AliRoot NEWIO ])],
377 [],[enable_newio=yes])
378if test "x$enable_newio" = "xyes" ; then
379 AC_DEFINE(use_newio)
380fi
381AC_MSG_RESULT([$enable_newio])
382
383dnl ------------------------------------------------------------------
384dnl certainly something old, but we keep the define
385AC_MSG_CHECKING([whether to use ROWHOUGH])
386AH_TEMPLATE([USEROWHOUGH],[HLT ROWHOUGH])
387AC_ARG_ENABLE(rowhough,
388 [AC_HELP_STRING([--enable-rowhough],
389 [use ROWHOUGH ])],
390 [],[enable_rowhough=no])
391if test "x$enable_rowhough" = "xyes" ; then
392 AC_DEFINE(USEROWHOUGH)
393fi
394AC_MSG_RESULT([$enable_rowhough])
395
396dnl ------------------------------------------------------------------
397dnl
398dnl Documentation
399dnl
400AC_ARG_VAR(DOXYGEN, The Documentation Generator)
401AC_PATH_PROG(PERL, perl)
402AC_PATH_PROG(DOXYGEN, doxygen)
403AM_CONDITIONAL(HAVE_DOXYGEN, test ! "x$DOXYGEN" = "x")
404HAVE_DOT=NO
405DOT_PATH=
406AC_PATH_PROG(DOT, dot)
407if ! test "x$DOT" = "x" ; then
408 HAVE_DOT=YES
409 DOT_PATH=`dirname $DOT`
410fi
411AC_SUBST([HAVE_DOT])
412AC_SUBST([DOT_PATH])
413
414dnl ------------------------------------------------------------------
2bbbadd1 415dnl inatallation directory for libraries
416dnl
417if test "x$prefix" != "xNONE" && test $ALICE_ROOT = $prefix ; then
418libdir=\${exec_prefix}/lib/tgt_$ALICE_TARGET
419AC_MSG_NOTICE([libdir set to $libdir])
420fi
421dnl ------------------------------------------------------------------
b521659f 422AC_CONFIG_FILES([Makefile
423 BASE/Makefile
424 SampleLib/Makefile
425 TPCLib/Makefile
db16520a 426 TPCLib/mapping2array.cxx
78b557c2 427 TPCLib/OnlineDisplay/Makefile
c160eda8 428 PHOS/Makefile
b521659f 429 doc/Makefile
430 doc/doxygen.conf])
431
432
433AC_OUTPUT
434dnl
435dnl EOF
436dnl
437