-
Notifications
You must be signed in to change notification settings - Fork 13
/
configure.ac
192 lines (165 loc) · 6.84 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(latte-int, 1.7.6)
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([code/config.h:code/config.hin])
AM_INIT_AUTOMAKE([gnu 1.11]) # Need 1.11 for parallel test harness in code/maple
AM_MAINTAINER_MODE
AC_CONFIG_FILES([Makefile EXAMPLES/Makefile doc/Makefile code/Makefile code/latte/Makefile code/latte/normalize/Makefile code/test-suite/Makefile code/maple/Makefile code/lidia-include.h:code/lidia-include.hin])
AC_CONFIG_FILES([code/test-suite/test.pl], [chmod +x code/test-suite/test.pl])
AC_CONFIG_FILES([code/latte/integration/testMultiply.sh], [chmod +x code/latte/integration/testMultiply.sh])
AC_CONFIG_FILES([code/latte/integration/testIntegration.sh], [chmod +x code/latte/integration/testIntegration.sh])
AC_CONFIG_FILES([code/maple/test-maple.sh], [chmod +x code/maple/test-maple.sh])
AC_CONFIG_FILES([code/gnulib/Makefile])
AC_USE_SYSTEM_EXTENSIONS
LT_INIT
AC_PROG_CC
AC_PROG_CXX
# AC_PROG_LIBTOOL
# For Gnulib relocatable-prog
gl_EARLY
gl_INIT
RELOCATABLE_LIBRARY_PATH='$(libdir)'
RELOCATABLE_CONFIG_H_DIR='$(top_builddir)/code'
AC_LANG(C++)
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([malloc.h stdlib.h string.h sys/param.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([pow sqrt])
AC_CHECK_HEADERS([sstream])
maple_script_dir=${datadir}/${PACKAGE_NAME}
AC_DEFINE_DIR([MAPLE_SCRIPT_DIR], [maple_script_dir], [The directory where LattE's Maple scripts are installed.])
LB_MISC
LB_CHECK_GMP(,,[AC_MSG_ERROR([GMP not found!
GMP version 3.1.1 or greater is required for LattE to compile. Please
make sure GMP is installed and specify its location with the option
--with-gmp=<prefix> when running configure.])
])
if test -z "GMP_HAVE_CXX" ; then
AC_MSG_ERROR([Unable to use the GMP C++ library.
Please make sure that GMP was configured with "--enable-cxx".])
fi
AC_CACHE_SAVE
LB_CHECK_NTL(,,[AC_MSG_ERROR([NTL not found!
NTL version 5.4 or greater is required for LattE to compile. Please
make sure NTL is installed and specify its location with the option
--with-ntl=<prefix> when running configure.
Hint: If NTL was configured in C++11 mode, then LattE needs to
be configured with a compiler in C++11 mode as well by passing
CXX="g++ -std=c++11" or similar.
])
])
AC_CACHE_SAVE
LB_CHECK_LIDIA(,,
AC_MSG_WARN([LiDIA not found. LiDIA has a Smith normal form procedure that is faster than the built-in one.]))
AC_CACHE_SAVE
# From CDD+
AC_PATH_PROGS(CDD, [scdd_gmp scdd])
AC_DEFINE_UNQUOTED(CDD_PATH, "${CDD}", [The path to the CDD binary.])
if test -z "$CDD"; then
AC_MSG_ERROR([The `scdd_gmp' or `scdd' binary from cddlib is required for LattE.])
fi
AC_CACHE_SAVE
# From cddlib
AC_PATH_PROGS(REDCHECK, [redcheck_gmp])
AC_DEFINE_UNQUOTED(REDCHECK_PATH, "${REDCHECK}", [The path to the cddlib redcheck binary.])
if test -z "$REDCHECK"; then
AC_MSG_ERROR([The `redcheck' binary from cddlib is required for LattE.])
fi
# Cddlib library
LB_CHECK_CDDLIB
if test "x$cddlib_found" = "xno" ; then
# Older versions of cddlib are compiled with the C compiler;
# also some people compile newer versions with the C compiler instead of the C++ compiler.
AC_LANG(C)
LB_CHECK_CDDLIB
if test "x$cddlib_found" = "xyes" ; then
AC_DEFINE(HAVE_CDDLIB_C_LINKAGE, 1, [Define if the cddlib library has C linkage])
fi
AC_LANG(C++)
fi
if test "x$cddlib_found" = "xno" ; then
AC_MSG_ERROR([The cddlib headers and library are required for LattE.])
fi
AC_CACHE_SAVE
# From LRS
AC_PATH_PROGS(LRS, [lrs1])
AC_DEFINE_UNQUOTED(LRS_PATH, "${LRS}", [The path to the lrs binary.])
if test -z "$LRS"; then
AC_MSG_WARN([The `lrs1' binary from LRS is missing; LattE can optionally use LRS instead of CDD.])
fi
AC_CACHE_SAVE
# We need Maple to simplify some rational functions.
AC_PATH_PROGS(MAPLEBIN, [cmaple.exe maple], maple)
AM_CONDITIONAL(HAVE_MAPLE, test x$MAPLEBIN != xmaple )
AC_DEFINE_UNQUOTED(MAPLE_PATH, "${MAPLEBIN}", [The path to the Maple program.])
# TOPCOM for triangulations (optional)
LB_CHECK_TOPCOM
# 4ti2 for triangulations (optional)
LB_CHECK_FORTYTWO
# CPLEX for experimental code (optional)
AC_ARG_WITH(cplex-sharedlib,
AS_HELP_STRING([--with-cplex-sharedlib=/PATH/TO/FILE.so],
[Specify name of CPLEX shared library]),
[ CPLEX_SHAREDLIB=$withval ])
AC_ARG_WITH(cplex-include,
AS_HELP_STRING([--with-cplex-include=DIR], [Specify location of CPLEX include files]),
[ CPLEX_CFLAGS="-I$withval" ])
AC_SUBST(CPLEX_CFLAGS)
AM_CONDITIONAL(HAVE_CPLEX, test x$CPLEX_SHAREDLIB != x -a x$CPLEX_CFLAGS != x)
if test x$CPLEX_SHAREDLIB != x -a x$CPLEX_CFLAGS != x ; then
AC_DEFINE(HAVE_CPLEX, 1, [Define if the CPLEX callable library is available])
CPLEX_LDFLAGS="-L`dirname ${CPLEX_SHAREDLIB}` -R`dirname ${CPLEX_SHAREDLIB}` -l`basename ${CPLEX_SHAREDLIB} .so | sed 's/^lib//' ` -lm -lnsl -lsocket -lpthread "
fi
AC_SUBST(CPLEX_LDFLAGS)
#check for shared pointers.
AC_MSG_CHECKING([for std::shared_ptr])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <memory>]]
[[std::shared_ptr<int> have_shared_ptr;]])
], [
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED([HAVE_STD_SHARED_PTR], 1, [Define to 1 if you have the `std::shared_ptr' class.])
], [
AC_MSG_RESULT([no])
#AC_DEFINE_UNQUOTED([HAVE_STD_SHARED_PTR], 0, [Define to 1 if you have the `std::shared_ptr' class.])
])
AC_MSG_CHECKING([for std::tr1::shared_ptr])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <tr1/memory>]]
[[std::tr1::shared_ptr<int> have_shared_ptr;]])
], [
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED([HAVE_STD_TR1_SHARED_PTR], 1, [Define to 1 if you have the `std::tr1::shared_ptr' class.])
], [
AC_MSG_RESULT([no])
#AC_DEFINE_UNQUOTED([HAVE_STD_TR1_SHARED_PTR], 0, [Define to 1 if you have the `std::tr1::shared_ptr' class.])
])
# Experimental, not release-ready code.
AC_ARG_ENABLE(experiments, AS_HELP_STRING([--enable-experiments],
[use experimental code]))
AM_CONDITIONAL(HAVE_EXPERIMENTS, test x$enable_experiments = xyes)
if test x$enable_experiments = xyes ; then
AC_DEFINE(HAVE_EXPERIMENTS, 1, [Define if experimental code is enabled])
fi
AC_ARG_ENABLE(database, AS_HELP_STRING([--enable-database],
[use database code]))
AM_CONDITIONAL(HAVE_DATABASE, test x$enable_database = xyes)
if test x$enable_database = xyes ; then
AC_DEFINE(HAVE_DATABASE, 1, [Define if database code is enabled])
fi
#builds mini integration drivers
# or programs only latte programmers care about
AC_ARG_ENABLE(programmer-helper, AS_HELP_STRING([--enable-programmer-helper],
[build extra programs]))
AM_CONDITIONAL(HAVE_PROGRAMMER_HELPER, test x$enable_programmer_helper = xyes)
if test x$enable_programmer_helper = xyes ; then
AC_DEFINE(HAVE_PROGRAMMER_HELPER, 1, [Define if database code is enabled])
fi
AC_OUTPUT