forked from PMunkes/Tauolapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
218 lines (186 loc) · 6.09 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT( [Tauola C++ Interface], [1.0.6], [tomasz.przedzinski@cern.ch] )
AC_CONFIG_AUX_DIR([config])
AM_INIT_AUTOMAKE
AC_LANG_CPLUSPLUS
AC_PREFIX_DEFAULT([`pwd`])
AC_CONFIG_HEADERS([config/config.h])
AC_CONFIG_SRCDIR([src/tauolaCInterfaces/Tauola.cxx])
##############################################################################
# Check for HepMC
AC_MSG_CHECKING([if HepMC location defined])
AC_ARG_WITH(
[hepmc],
[AS_HELP_STRING([--with-hepmc], [Path to HepMC 2.xx (use --without-hepmc to compile without HepMC)] )],
[
AC_MSG_RESULT([$with_hepmc]) ;
AC_SUBST(HEPMC_DIR,[$with_hepmc])
],
[AC_MSG_RESULT([no])]
)
# Check for debug flags
AC_MSG_CHECKING([if debug flags are enabled])
AC_ARG_ENABLE(
[debug],
[AS_HELP_STRING([--enable-debug],[Enable debug flags])],
[
AC_MSG_RESULT([$enable_debug]) ;
FFLAGS="-g3 -O0" ;
CXXFLAGS="-g3 -O0"
],
[
AC_MSG_RESULT([no]) ;
FFLAGS="-O2" ;
CXXFLAGS="-O2"
]
)
# autoconf 2.59 requires at least one check to be preformed unconditionally
# before other conditional checks can be done
AC_CHECK_HEADERS([stdio.h],,)
if ! test "$with_hepmc" == "no"; then
CPPFLAGS="-I$with_hepmc/include $CPPFLAGS"
AC_CHECK_HEADERS([HepMC/Version.h], ,
[ echo "" &&
echo "ERROR: HepMC not found. To provide location use:" &&
echo " './configure --with-hepmc=<path_to_HepMC>' "
echo " or use:"
echo " './configure --without-hepmc"
echo " (Consider using 'source platform/afs.paths.sh' (or .csh) )"
echo ""
exit -1
])
AC_CHECK_HEADERS([HepMC/Units.h], ,
[ echo "" &&
echo "WARNING: HepMC Version lower than 2.04! " &&
echo " The interface will be converted" &&
echo " To HepMC 2.03 " &&
echo "" &&
./platform/to-HepMC-2.03.sh
])
else
with_hepmc=""
fi
##############################################################################
# Check for programs
AC_PROG_MAKE_SET
AC_PROG_LN_S
AC_PROG_CC
AC_PROG_CXX
if ${CXX} --version | grep -E "GCC.* 3" >&/dev/null ; then
AC_PROG_F77([g77 gfortran f77 fortran fort])
else
AC_PROG_F77([gfortran g77 f77 fortran fort])
fi
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_CHECK_TYPES([ptrdiff_t])
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_STRFTIME
AC_CHECK_FUNCS([atexit getcwd pow sqrt], ,
[ echo "" &&
echo "ERROR: Basic functions not found. Something's wrong with paths." &&
exit -1
])
AC_PROG_LIBTOOL
AC_PROG_INSTALL
AC_PROG_LN_S
##############################################################################
# Check if we are compiling TauSpinner
# Check LHAPDF header files
AC_MSG_CHECKING([if LHAPDF location defined])
AC_ARG_WITH(
[lhapdf],
[AS_HELP_STRING([--with-lhapdf], [Path to LHAPDF (required for TauSpinner)] )],
[AC_MSG_RESULT([$with_lhapdf])],
[AC_MSG_RESULT([no])]
)
CPPFLAGS="-I$with_lhapdf/include $CPPFLAGS"
AC_CHECK_HEADERS([LHAPDF/LHAPDF.h], ,
[ if test "x$with_lhapdf" == "x"; then
echo ""
echo "INFO: LHAPDF not found. TauSpinner will not be compiled."
echo " To provide location to LHAPDF use:"
echo " --with-lhapdf=/path/to/LHAPDF" ;
echo ""
fi
])
AC_SUBST(with_lhapdf)
##############################################################################
# Check for other paths
AC_MSG_CHECKING([if Pythia8 location defined])
AC_ARG_WITH(
[pythia8],
[AS_HELP_STRING([--with-pythia8], [Path to Pythia 8.1 or later] )],
[
AC_MSG_RESULT([$with_pythia8]) ;
AC_SUBST(PYTHIA8_DIR,[$with_pythia8])
],
[
AC_MSG_RESULT([no]) ;
echo ""
echo "INFO: Pythia8 location not specified. Not all examples will be available." ;
echo " To define location use parameter: --with-pythia8" ;
echo ""
]
)
if test "x$with_pythia8" != "x"; then
if test "x$PYTHIA8DATA" == "x" ; then
echo ""
echo "WARNING: Pythia8 location specified but PYTHIA8DATA variable not set."
echo " This variable is required to run the examples. Try:"
echo " export PYTHIA8DATA=<path_to_pythia8>/xmldoc"
echo ""
fi
fi
# Check for newer pythia8 versions
CPPFLAGS="-I$with_pythia8/include $CPPFLAGS"
AC_CHECK_HEADER( [Pythia8/Pythia.h], PYTHIA8180_OR_LATER=yes, unset PYTHIA8180_OR_LATER )
AC_MSG_CHECKING([if MC-TESTER location defined])
AC_ARG_WITH(
[mc-tester],
[AS_HELP_STRING([--with-mc-tester], [Path to MC-TESTER 1.23 or later] )],
[
AC_MSG_RESULT([$with_mc_tester]) ;
AC_SUBST(MCTESTER_DIR,[$with_mc_tester])
],
[
AC_MSG_RESULT([no]) ;
echo "" ;
echo "INFO: MC-TESTER location not specified. Not all examples will be available." ;
echo " To define location use parameter: --with-mc-tester" ;
echo ""
]
)
if test "x$with_mc_tester" != "x"; then
AC_CHECK_PROG(HAS_ROOT_CONFIG,root-config,[yes],[no])
if test "$HAS_ROOT_CONFIG" == "no"; then
echo ""
echo "WARNING: root-config not found. ROOT is not installed or path"
echo " to ROOT bin folder not provied via \$PATH variable. Use:"
echo " export PATH=\$PATH:<path_to_root>/bin"
echo " export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\`root-config --libdir\`"
echo ""
else
ROOT_LIBS=`root-config --glibs`
ROOT_INC=`root-config --incdir`
AC_SUBST(ROOTLIBS,[$ROOT_LIBS])
AC_SUBST(ROOTINC,[$ROOT_INC])
fi
fi
AM_CONDITIONAL([HAS_HEPMC], [test "x$with_hepmc" != "x"])
AM_CONDITIONAL([HAS_PYTHIA8], [test "x$with_pythia8" != "x"])
AM_CONDITIONAL([HAS_PYTHIA8180_OR_LATER], [test "x$PYTHIA8180_OR_LATER" != "x"])
AM_CONDITIONAL([HAS_MCTESTER], [test "x$with_mc_tester" != "x"])
AM_CONDITIONAL([HAS_LHAPDF], [test "x$with_lhapdf" != "x"])
AC_CONFIG_FILES([Makefile
src/Makefile
tauola-fortran/Makefile examples/Makefile
TauSpinner/Makefile
TauSpinner/examples/Makefile
TauSpinner/examples/tauspinner-validation/Makefile
TauSpinner/examples/CP-tests/Makefile])
AC_OUTPUT