-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathconfigure.ac
130 lines (78 loc) · 2.71 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
#we're building bertini_real, version 1.8, and the corresponding email is silviana's
AC_INIT([bertini_real],[1.8],[[email protected]],[bertini_real],[https://bertinireal.com/])
# Force autoconf to be at least this version number:
AC_PREREQ([2.71])
#
AC_CONFIG_AUX_DIR([config])
# turn on the keeping of produced objects in their folders. this is for non-recursive make
# and autotools
# see Recursive Make Considered Harmful, and any number of demos.
AM_INIT_AUTOMAKE([1.13 subdir-objects])
#the language for BertiniReal is C++
AC_LANG([C++])
#another directive to use the m4 folder
AC_CONFIG_MACRO_DIR([m4])
#the only produced file will be a single Makefile.
AC_CONFIG_FILES([Makefile])
#find the CC compiler
AC_PROG_CXX
#this calls a file in the m4/ directory, which sets up the MPI wrapper stuffs
# If --with-mpi=auto is used, try to find MPI, but use standard C compiler if it is not found.
# If --with-mpi=yes is used, try to find MPI and fail if it isn't found.
# If --with-mpi=no is used, use a standard C compiler instead.
AC_ARG_WITH(mpi, [AS_HELP_STRING([--with-mpi],
[compile with MPI (parallelization) support. If none is found,
MPI is not used. Default: auto])
],,[with_mpi=auto])
AX_PROG_CXX_MPI([test x"$with_mpi" != xno],[use_mpi=yes],[
use_mpi=no
if test x"$with_mpi" = xyes; then
AC_MSG_FAILURE([MPI compiler requested, but couldn't use MPI.])
else
AC_MSG_FAILURE([No MPI compiler found, won't use MPI.])
fi
])
#enable the creation of shared libraries
AC_ENABLE_SHARED
#enable the creation of static libraries
AC_ENABLE_STATIC
#set up for building libraries
LT_INIT
#find flex / lex
AC_PROG_LEX
#find bison / yacc
AC_PROG_YACC
#find the linker
AC_PROG_LN_S
#find the command for making directories with their parents
AC_PROG_MKDIR_P
#fire up libtool
LT_INIT
AX_CXX_COMPILE_STDCXX_14
# the form of the following commands --
# AC_SEARCH_LIBS(function, libraries-list, action-if-found, action-if-not-found, extra-libraries)
#find gmp
AC_SEARCH_LIBS([__gmpz_init],[gmp], [],[
AC_MSG_ERROR([unable to find gmp])
])
# find mpfr
AC_SEARCH_LIBS([mpfr_get_version],[mpfr], [],[
AC_MSG_ERROR([unable to find mpfr])
])
#find bertini
AC_SEARCH_LIBS([head_zero_dim_track_d],[bertini-parallel], [],
[AC_MSG_ERROR([unable to find libbertini-parallel. please build and install bertini1 from source. bertini.nd.edu])],
$MPI_CXXLDFLAGS)
#find the math library
AC_SEARCH_LIBS([cos], [m], [], [
AC_MSG_ERROR([unable to find the cos() function])
])
AX_BOOST_BASE([1.50],, [AC_MSG_ERROR([bertini_real needs Boost, but it was not found in your system])])
AX_BOOST_FILESYSTEM
AX_BOOST_REGEX
AX_BOOST_CHRONO
AX_BOOST_TIMER
AX_BOOST_SYSTEM
AM_CONFIG_HEADER(config.h)
#wrap it up.
AC_OUTPUT