-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure.ac
81 lines (66 loc) · 2.64 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
#################################################################################
## Created 20-May-2011 by David Kirkby <[email protected]>
## Run autoreconf after making any change here.
#################################################################################
# This could probably be relaxed to an older version.
AC_PREREQ([2.68])
# Our package info.
AC_INIT([likely], [dev], [[email protected]])
# Checks for programs
AC_PROG_CXX
# Use SIMD compiler extensions when available
AX_EXT
# Initialize libtool, which adds --enable/disable-shared configure options.
# The boost.m4 macros used below also need this.
LT_INIT
# Checks for libraries (there is no portable way to check for C++ classes in
# the library, so we just check that the linker can find the library using 'main')
AC_CHECK_LIB([m],[cos],,
AC_MSG_ERROR([Cannot find the math library.]))
AC_CHECK_LIB([blas],[main],,
AC_MSG_WARN([Cannot find the blas library. Will try to continue without it.]))
AC_CHECK_LIB([lapack],[main],,
AC_MSG_WARN([Cannot find the lapack library. Will try to continue without it.]))
# Following http://www.gentoo.org/proj/en/qa/automagic.xml below...
# Use 'configure --without-gsl' if GSL should not be used. The test below requires
# that the GSL cblas library is present, but we only use BLAS (and LAPACK) by
# directly calling the fortran library bindings.
AC_ARG_WITH([gsl],
AS_HELP_STRING([--without-gsl], [Build without the GSL library.]))
AS_IF([test "x$with_gsl" != "xno"], [
AC_CHECK_LIB([gslcblas],[cblas_dgemm],,
AC_MSG_ERROR([Cannot find the gsl cblas library.]))
])
AS_IF([test "x$with_gsl" != "xno"], [
AC_CHECK_LIB([gsl],[main],,
AC_MSG_ERROR([Cannot find the gsl library.]))
])
# Use 'configure --without-minuit2' if Minuit2 should not be used.
AC_ARG_WITH([minuit2],
AS_HELP_STRING([--without-minuit2], [Build without the Minuit2 library.]))
AS_IF([test "x$with_minuit2" != "xno"], [
AC_CHECK_LIB([Minuit2], [main],,
AC_MSG_ERROR([Cannot find the Minuit2 library.]))
])
# We need a recent version of boost
BOOST_REQUIRE([1.49])
# Required header-only boost packages
BOOST_BIND
BOOST_FOREACH
BOOST_FUNCTION
BOOST_UTILITY
BOOST_SMART_PTR
# Required boost libraries
BOOST_REGEX
BOOST_PROGRAM_OPTIONS
BOOST_TEST
# Configure automake
AC_CONFIG_FILES([Makefile likely.pc])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
# See http://www.gnu.org/s/hello/manual/automake/maintainer_002dmode.html
AM_MAINTAINER_MODE
AC_CONFIG_HEADERS([config.h])
# Define automake variables that flag whether optional libraries should be used.
AM_CONDITIONAL([USE_GSL], [test "x$ac_cv_lib_gsl_main" = "xyes"])
AM_CONDITIONAL([USE_MINUIT2],[test "x$ac_cv_lib_Minuit2_main" = "xyes"])
AC_OUTPUT