-
Notifications
You must be signed in to change notification settings - Fork 14
/
configure.ac
209 lines (182 loc) · 6.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
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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(qmp, 2.5.4, [detar at physics.utah.edu])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR([lib/QMP_grid.c])
AC_CONFIG_SRCDIR([examples/QMP_test.c])
AC_CONFIG_HEADER([include/qmp_config.h])
AM_INIT_AUTOMAKE([subdir-objects])
dnl automake manual, ch 6 says to use this when SUBDIRS is used
AC_PROG_MAKE_SET
dnl Define these as defaults
dnl Needed below to check if compiler works
AC_PROG_CC(c99 cc gcc)
AC_ISC_POSIX
AC_PROG_RANLIB
AC_CHECK_TOOL(AR, ar, [ar])
AM_PROG_CC_C_O
dnl George Fleming, 12/12/2002
dnl
dnl This is simply a complete rewrite of the --enable and --with options
dnl to support different implementations of MPI or GM upon which QMP
dnl is built. In some ways it duplicates what is already available
dnl in scripts like 'mpicc' or 'mpcc' but since those don't always exist
dnl or can't be trusted to point to the implementation the user intended,
dnl this puts the onus on the user to set all the flags correctly.
AC_ARG_WITH(qmp-comms-type,
AC_HELP_STRING([--with-qmp-comms-type=TYPE],
[Build QMP for a single node (SINGLE) or on top of MPI (MPI).
Default is SINGLE.]),
[case "${with_qmp_comms_type}" in
single|SINGLE) QMP_COMMS_TYPE=SINGLE ;;
mpi|MPI) QMP_COMMS_TYPE=MPI
AC_DEFINE([HAVE_MPI],[],[compiling for MPI]) ;;
*) AC_MSG_ERROR([bad value "${with_qmp_comms_type}"
for --with-qmp-comms-type]) ;;
esac],
[QMP_COMMS_TYPE=SINGLE])
AC_ARG_WITH( qmp-comms-cflags,
AC_HELP_STRING([--with-qmp-comms-cflags=QMP_COMMS_CFLAGS],
[To pass optional include path to comms header files via compiler flag
-I]),
[QMP_COMMS_CFLAGS="$with_qmp_comms_cflags"] )
AC_ARG_WITH( qmp-comms-ldflags,
AC_HELP_STRING([--with-qmp-comms-ldflags=QMP_COMMS_LDFLAGS],
[To pass optional library search path to comms libraries via compiler
flag -L]),
[QMP_COMMS_LDFLAGS="$with_qmp_comms_ldflags"])
AC_ARG_WITH( qmp-comms-libs,
AC_HELP_STRING([--with-qmp-comms-libs=QMP_COMMS_LIBS],
[To pass optional list of comms libraries to linker via compiler flag -l]),
[QMP_COMMS_LIBS="$with_qmp_comms_libs"])
# If $QMP_COMMS_TYPE=MPI then perform the following link test
case "${QMP_COMMS_TYPE}" in
SINGLE)
echo Building QMP for SINGLE node use
;;
MPI)
echo Building QMP for use with MPI
PAC_MPI_LINK_CC_FUNC( ${QMP_COMMS_CFLAGS}, ${QMP_COMMS_LDFLAGS},
${QMP_COMMS_LIBS}, , , [mpi_link_ok=yes], [mpi_link_ok=no])
AC_MSG_CHECKING([if we can compile/link of a simple MPI program])
if test "X${mpi_link_ok}X" = "XyesX" ; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_ERROR([Cannot compile/link a basic MPI C program!
Check QMP_COMMS_CFLAGS, QMP_COMMS_LDFLAGS, QMP_COMMS_LIBS.])
fi
;;
*)
AC_MSG_ERROR([Shouldnt reach this point]);
;;
esac
AC_ARG_ENABLE( extra-debugging,
AC_HELP_STRING([--enable-extra-debugging],
[Extra debugging messages useful for QMP developers. Default is no.]),
[case "${enable_extra_debugging}" in
yes)
AC_DEFINE([_QMP_DEBUG],[],[enable extra debugging])
AC_DEFINE([_QMP_TRACE],[],[enable extra tracing])
;;
no) ;;
*) AC_MSG_ERROR([bad value ${enable_extra_debugging}
for --enable-extra-debugging]) ;;
esac],
[enable_extra_debugging=no])
dnl --enable-profiling
AC_ARG_ENABLE(
profiling,
AC_HELP_STRING([--enable-profiling],
[build QMP with weak linkage allowing profiling library to be inserted]),
[if test "X$enableval" != "Xno"; then
AC_DEFINE([QMP_BUILD_PROFILING],[],[build QMP to allow profiling])
fi]
)
dnl --enable-timing
AC_ARG_ENABLE(
timing,
AC_HELP_STRING([--enable-timing],
[turn on timing of all QMP functions]),
[if test "X$enableval" != "Xno"; then
AC_DEFINE([QMP_BUILD_TIMING],[],[build QMP with function timing])
fi]
)
dnl --enable-bgl
AC_ARG_ENABLE(
bgl,
AC_HELP_STRING([--enable-bgl],
[Use BG/L personality to set native machine geometry.]),
[if test "X$enableval" != "Xno"; then
AC_DEFINE([HAVE_BGL],[],[compiling for BG/L])
AC_MSG_NOTICE([Using BG/L personality.])
fi]
)
dnl --enable-bgp
AC_ARG_ENABLE(
bgp,
AC_HELP_STRING([--enable-bgp],
[Use BG/P personality to set native machine geometry.]),
[if test "X$enableval" != "Xno"; then
AC_DEFINE([HAVE_BGP],[],[compiling for BG/P])
AC_MSG_NOTICE([Using BG/P personality.])
QMP_COMMS_CFLAGS="-I/bgsys/drivers/ppcfloor/arch/include $QMP_COMMS_CFLAGS"
fi]
)
dnl --enable-bgq
AC_ARG_ENABLE(
bgq,
AC_HELP_STRING([--enable-bgq],
[Use BG/Q personality to set native machine geometry.]),
[if test "X$enableval" != "Xno"; then
AC_DEFINE([HAVE_BGQ],[],[compiling for BG/Q])
AC_MSG_NOTICE([Using BG/Q personality.])
QMP_COMMS_CFLAGS="-I/bgsys/drivers/ppcfloor/spi/include $QMP_COMMS_CFLAGS"
fi]
)
dnl --enable-bgspi
AC_ARG_ENABLE(
bgspi,
AC_HELP_STRING([--enable-bgspi],
[Use Blue Gene SPI low-level communications.]),
[if test "X$enableval" != "Xno"; then
AC_DEFINE([HAVE_BGSPI],[],[compiling for SPI])
AC_MSG_NOTICE([Using Blue Gene SPI.])
HAVE_BGSPI=1
#QMP_COMMS_CFLAGS="-I/bgsys/drivers/ppcfloor/spi/include $QMP_COMMS_CFLAGS"
fi]
)
AC_SUBST(QMP_COMMS_TYPE)
AC_SUBST(QMP_COMMS_CFLAGS)
AC_SUBST(QMP_COMMS_LDFLAGS)
AC_SUBST(QMP_COMMS_LIBS)
AM_CONDITIONAL(QMP_SINGLE, [test "X${QMP_COMMS_TYPE}X" = "XSINGLEX"])
AM_CONDITIONAL(QMP_MPI, [test "X${QMP_COMMS_TYPE}X" = "XMPIX"])
AM_CONDITIONAL(QMP_BGSPI, [test "X${HAVE_BGSPI}X" = "X1X"])
############################################################
# Support for memory debugging with DMALLOC
############################################################
AM_WITH_DMALLOC
############################################################
# Check for build programs
############################################################
AC_CHECK_PROG(DOXYGEN, doxygen, doxygen)
############################################################
# Check for library functions
############################################################
############################################################
# Pass configuration to distcheck target
############################################################
DISTCHECK_CONFIGURE_FLAGS="--enable-parallel-arch=$QMP_COMMS_TYPE CC=\"$CC\" CFLAGS=\"$CFLAGS\" QMP_COMMS_CFLAGS=\"$QMP_COMMS_CFLAGS\" QMP_COMMS_LDFLAGS=\"$QMP_COMMS_LDFLAGS\" QMP_COMMS_LIBS=\"$QMP_COMMS_LIBS\""
AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
############################################################
# Define files to configure and do it
############################################################
AC_CONFIG_FILES(Makefile)
AC_CONFIG_FILES(include/Makefile)
AC_CONFIG_FILES(lib/Makefile)
AC_CONFIG_FILES(bin/Makefile)
AC_CONFIG_FILES(bin/qmp-config)
AC_CONFIG_FILES(examples/Makefile)
AC_CONFIG_FILES(doc/Makefile)
AC_CONFIG_FILES(doc/QMPdoxyfile)
AC_OUTPUT