forked from Vayu/PJFry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
316 lines (285 loc) · 11 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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.65])
# Package version number
# Major.Minor goes into symbols version
m4_define([pjfry_major_version], [1])
m4_define([pjfry_minor_version], [0])
m4_define([pjfry_micro_version], [0-beta.10])
# Libtool interface number ( current : revision : age )
# - If the library source code has changed at all since the last update,
# then increment revision
# - If any interfaces have been added, removed, or changed since the last update,
# increment current, and set revision to 0.
# - If any interfaces have been added since the last public release,
# then increment age.
# - If any interfaces have been removed or changed since the last public release,
# then set age to 0.
m4_define([pjfry_interface_current], [0])
m4_define([pjfry_interface_revision], [0])
m4_define([pjfry_interface_age], [0])
m4_define([pjfry_version], m4_defn([pjfry_major_version]).m4_defn([pjfry_minor_version]).m4_defn([pjfry_micro_version]))
AC_INIT([pjfry], m4_defn([pjfry_version]))
PJFRY_MAJOR=pjfry_major_version
PJFRY_MINOR=pjfry_minor_version
PJFRY_MICRO=pjfry_micro_version
PJFRY_CURRENT=pjfry_interface_current
PJFRY_REVISION=pjfry_interface_revision
PJFRY_AGE=pjfry_interface_age
PJFRY_VERSION=$PJFRY_MAJOR.$PJFRY_MINOR.$PJFRY_MICRO
PJFRY_VERSION_INFO=$PJFRY_CURRENT:$PJFRY_REVISION:$PJFRY_AGE
AC_CONFIG_SRCDIR([src/common.h])
AC_CONFIG_AUX_DIR([auxfiles])
AC_CONFIG_MACRO_DIR([m4])
# Note: "$(shell ...)" is a GNU make extension so it needs "-Wno-portability".
AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability silent-rules foreign])
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_F77
AC_PROG_FC
AC_F77_LIBRARY_LDFLAGS
AC_F77_WRAPPERS
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
# AC_PROG_RANLIB
AC_PROG_LIBTOOL
AC_PROG_LD
AC_PROG_CPP
AC_PROG_INSTALL
#AC_CHECK_TOOL(SED, sed, :)
AC_PROG_LN_S
# Set language
AC_LANG([C++])
# Checks for header files.
AC_CHECK_HEADERS([inttypes.h])
AC_HEADER_STDC
# Checks for typedefs, structures, and compiler characteristics.
#AC_C_INLINE
#AC_TYPE_UINT64_T
# Checks for library functions.
#AC_CHECK_FUNCS([sqrt])
AC_MSG_CHECKING([if libraries can be versioned])
# Special case for PE/COFF platforms: ld reports
# support for version-script, but doesn't actually
# do anything with it.
case $host in
*cygwin* | *mingw32* )
have_ld_version_script=no
AC_MSG_RESULT(no)
;;
* )
GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
if test "$GLD"; then
have_ld_version_script=yes
AC_MSG_RESULT(yes)
else
have_ld_version_script=no
AC_MSG_RESULT(no)
AC_MSG_WARN(*** You have not enabled versioned symbols.)
fi
;;
esac
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
# ------------------------- # ------------------------- # -------------------------
AC_ARG_WITH([integrals],
[AS_HELP_STRING([--with-integrals],
[library for scalar loop integrals @<:@default=auto@:>@.
@<:@qcdloop2@:>@ tries to use libqcdloop 2.x.
@<:@qcdloop1@:>@ tries to use libqcdloop1.
@<:@oneloop@:>@ tries to use libavh_olo.
@<:@qcdloop@:>@ tries to use libqcdloop 1.x (and libff), CXXFLAGS and LDFLAGS need to be set manually.
])],
[test "x$with_integrals" == "xyes" && with_integrals=auto],
[with_integrals=auto])
case $with_integrals in
auto)
library_auto_found="no"
if test "x$library_found" != "xyes" ; then
# QCDLoop 2.x
AC_CHECK_PROG([use_qcdloop2], [qcdloop-config], [yes], [no])
if test "x$use_qcdloop2" == "xyes" ; then
library_auto_found="yes"
AC_DEFINE(USE_QCDLOOP2,"1",[use libqcdloop 2.x for scalar integrals])
CPPFLAGS="`qcdloop-config --cppflags` $CPPFLAGS" # "qcdloop/qcdloop.h" needs "-std=c++11" or newer
# LDLIBS="$LDLIBS `qcdloop-config --ldflags`"
LIBS="$LIBS `qcdloop-config --ldflags`"
fi
fi
if test "x$library_auto_found" != "xyes" ; then
# QCDLoop1 / FF
AC_CHECK_LIB([qcdloop1], [qlinit_],[LIBS="$LIBS -lqcdloop1" use_qcdloop1=yes])
AC_CHECK_HEADERS([qcdloop1.h])
if test "x$use_qcdloop1" == "xyes" ; then
library_auto_found="yes"
AC_DEFINE(USE_QCDLOOP,"1",[use libqcdloop1 for scalar integrals])
fi
fi
if test "x$library_auto_found" != "xyes" ; then
# OneLOop
AC_F77_FUNC(avh_olo_mu_set)
AC_CHECK_LIB([avh_olo], [$avh_olo_mu_set],[LIBS="$LIBS -lavh_olo" use_oneloop=yes],[],[$FLIBS])
if test "x$use_oneloop" == "xyes" ; then
library_auto_found="yes"
AC_DEFINE(USE_ONELOOP,"1",[use libavh_olo for scalar integrals])
fi
fi
if test "x$library_auto_found" != "xyes" ; then
# QCDLoop 1.x / FF
AC_F77_FUNC(qlinit)
AC_CHECK_LIB([qcdloop], [$qlinit],[LIBS="$LIBS -lqcdloop -lff" use_qcdloop=yes],[],[-lff $FLIBS])
if test "x$use_qcdloop" == "xyes" ; then
library_auto_found="yes"
AC_DEFINE(USE_QCDLOOP,"1",[use libqcdloop 1.x for scalar integrals])
fi
fi
if test "x$library_auto_found" != "xyes" ; then
AC_MSG_ERROR([can't automatically find usable scalar integrals library])
fi
;;
qcdloop2) # QCDLoop 2.x
AC_CHECK_PROG([use_qcdloop2], [qcdloop-config], [yes], [no])
if test "x$use_qcdloop2" == "xyes" ; then
AC_DEFINE(USE_QCDLOOP2,"1",[use libqcdloop 2.x for scalar integrals])
CPPFLAGS="`qcdloop-config --cppflags` $CPPFLAGS" # "qcdloop/qcdloop.h" needs "-std=c++11" or newer
# LDLIBS="$LDLIBS `qcdloop-config --ldflags`"
LIBS="$LIBS `qcdloop-config --ldflags`"
else
AC_MSG_ERROR([qcdloop-config is missing])
fi
;;
qcdloop1) # QCDLoop1 / FF
AC_CHECK_LIB([qcdloop1], [qlinit_],
[LIBS="$LIBS -lqcdloop1" use_qcdloop1=yes AC_DEFINE(USE_QCDLOOP,"1",[use libqcdloop1 for scalar integrals])],
[AC_MSG_ERROR([libqcdloop1 library is missing])])
AC_CHECK_HEADERS([qcdloop1.h])
;;
oneloop) # OneLOop
AC_F77_FUNC(avh_olo_mu_set)
AC_CHECK_LIB([avh_olo], [$avh_olo_mu_set],
[LIBS="$LIBS -lavh_olo" use_oneloop=yes AC_DEFINE(USE_ONELOOP,"1",[use libavh_olo for scalar integrals])],
[AC_MSG_ERROR([libavh_olo library is missing])],[$FLIBS])
;;
qcdloop) # QCDLoop 1.x / FF
AC_F77_FUNC(qlinit)
AC_CHECK_LIB([qcdloop], [$qlinit],
[LIBS="$LIBS -lqcdloop -lff" use_qcdloop=yes AC_DEFINE(USE_QCDLOOP,"1",[use libqcdloop 1.x for scalar integrals])],
[AC_MSG_ERROR([libqcdloop 1.x library is missing])],[-lff $FLIBS])
;;
*)
AC_MSG_ERROR([Bad value for --with-integrals: $with_integrals])
;;
esac
# ------------------------- # ------------------------- # -------------------------
# ------------------------- # ------------------------- # -------------------------
AC_ARG_WITH([mcc-path],
[AS_HELP_STRING([--with-mcc-path],
[build Mathematica MathLink interface @<:@default=auto@:>@. Set this to full path to mcc tool])],
[test "x$with_mcc_path" == "xyes" && with_mcc_path=auto],
[with_mcc_path=auto])
# ------------------------- # -------------------------
if test "x$with_mcc_path" == "xauto" ; then
AC_MSG_CHECKING([for mcc in system path])
AC_PATH_PROGS_FEATURE_CHECK([MCC], [mcc mcc7.0 mcc6.0],
[[
cat - <<_ACEOF > conftest.cpp
#include <mathlink.h>
int main () { return 0; }
_ACEOF
rm -f conftest$ac_exeext
$ac_path_MCC conftest.cpp -o conftest$ac_exeext > conftest.err
if test -s conftest$ac_exeext; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
test ! -s conftest.err && test -s conftest$ac_exeext \
&& ac_cv_path_MCC=$ac_path_MCC ac_path_MCC_found=:
rm -f conftest.cpp conftest$ac_exeext conftest.err
]], [with_mcc_path=])
if test "x$ac_cv_path_MCC" != "x" ; then
AC_SUBST([MCC],[$ac_cv_path_MCC])
AC_MSG_RESULT($ac_cv_path_MCC)
else
AC_MSG_RESULT(no)
fi
if test `uname -s` == "Linux" ; then
case `uname -m` in
ia64) SystemIDList="Linux-IA64";;
i?86) SystemIDList="Linux";;
x86_64) SystemIDList="Linux-x86-64";;
*) SystemIDList="Unknown";;
esac
math_p1a=/opt/products/mathematica
math_p1b=/usr/local/Wolfram/Mathematica
math_p2=SystemFiles/Links/MathLink/DeveloperKit/$SystemIDList/CompilerAdditions
math_ps=$math_p1a/7.0/$math_p2$PATH_SEPARATOR$math_p1b/7.0/$math_p2$PATH_SEPARATOR$math_p1a/6.0/$math_p2$PATH_SEPARATOR$math_p1b/6.0/$math_p2
AC_PATH_PROGS(MPREP,[mprep],[],[$math_ps])
if test "x$ac_cv_path_MCC" == "x" ; then
AC_PATH_PROGS(MCC,[mcc mcc7.0 mcc6.0],[],[$math_ps])
fi
fi
# -------------------------
else
if test "x$with_mcc_path" != "xno" ; then
if test -d $with_mcc_path ; then
ac_cv_path_MCC=$with_mcc_path/mcc
ac_cv_path_MPREP=$with_mcc_path/mprep
else
ac_cv_path_MCC=$with_mcc_path
fi
if test "x$ac_cv_path_MCC" != "x" && test -x $ac_cv_path_MCC ; then
AC_SUBST([MCC],[$ac_cv_path_MCC])
fi
if test "x$ac_cv_path_MPREP" != "x" && test -x $ac_cv_path_MPREP ; then
AC_SUBST([MPREP],[$ac_cv_path_MPREP])
fi
fi
fi
# ------------------------- # ------------------------- # -------------------------
AM_CONDITIONAL(HAVE_MCC, test "x$with_mcc_path" != "xno" && test "x$ac_cv_path_MCC" != "x")
AM_CONDITIONAL(HAVE_MPREP, test "x$with_mcc_path" != "xno" && test "x$ac_cv_path_MPREP" != "x")
AM_CONDITIONAL(HAVE_FLIBS, test "x$use_qcdloop" == "xyes" || test "x$use_oneloop" == "xyes")
AC_ARG_ENABLE(golem-mode,[AS_HELP_STRING([--enable-golem-mode],
[build golem95-like interface @<:@default=no@:>@])],
[test "x$enable_golem_mode" == "xyes" && AC_DEFINE(USE_GOLEM_MODE,"1","build golem95-like interface")],
[enable_golem_mode=no])
AM_CONDITIONAL(EMU_GOLEM, test "x$enable_golem_mode" == "xyes")
if test "x$enable_golem_mode" == "xyes" ; then
enable_golem_mode_begin=""
enable_golem_mode_end=""
else
enable_golem_mode_begin="/*"
enable_golem_mode_end="*/"
fi
AC_SUBST(enable_golem_mode_begin)
AC_SUBST(enable_golem_mode_end)
AC_ARG_ENABLE(cache-high,[AS_HELP_STRING([--enable-cache-high],
[enable caching of 5- and 6-point coefficients @<:@default=yes@:>@])],
[],
[enable_cache_high=yes])
if test "x$enable_cache_high" == "xyes" ; then
AC_DEFINE(USE_CACHE_HIGH,"1","enable cache for 5 and 6-point coefficients")
fi
AC_ARG_ENABLE(cache-low,[AS_HELP_STRING([--enable-cache-low],
[enable caching of 2-,3-,4-point coefficients @<:@default=no@:>@])],
[test "x$enable_cache_low" == "xyes" && AC_DEFINE(USE_CACHE_LOW,"1","enable cache for 2-,3-,4-point coefficients")],
[enable_cache_low=no])
AC_ARG_ENABLE(f2c,[AS_HELP_STRING([--enable-f2c],
[Use g77 and ifort calling conventions @<:@default=no@:>@])],
[test "x$enable_f2c" == "xyes" && AC_DEFINE(USE_F2C,"1","Use g77 and ifort calling conventions for complex return values")],
[enable_f2c=no])
# Substitutions for .in files
AC_SUBST(PJFRY_MAJOR)
AC_SUBST(PJFRY_MINOR)
AC_SUBST(PJFRY_MICRO)
AC_SUBST(PJFRY_CURRENT)
AC_SUBST(PJFRY_REVISION)
AC_SUBST(PJFRY_AGE)
AC_SUBST(PJFRY_VERSION_INFO)
AC_CONFIG_FILES([Makefile
src/Makefile
src/libpjfry.vers
mlink/Makefile
examples/Makefile])
AC_OUTPUT