-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
executable file
·463 lines (380 loc) · 17.9 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
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
# @HEADER
#
########################################################################
#
# Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring
# Copyright 2012 Sandia Corporation
#
# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
# the U.S. Government retains certain rights in this software.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the Corporation nor the names of the
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Questions? Contact Karen Devine [email protected]
# Erik Boman [email protected]
#
########################################################################
#
# @HEADER
# ------------------------------------------------------------------------
# Process this file with autoconf to produce a configure script.
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
# Initialization
# ------------------------------------------------------------------------
# This must be the first line in configure.ac.
# Optional 3rd argument is email address for bugs.
AC_INIT(Zoltan, 3.6, [email protected])
echo "----------------------------------------"
echo "Running Zoltan Configure Script"
echo "----------------------------------------"
# This is to protect against accidentally specifying the wrong
# directory with --srcdir. Any file in that directory will do,
# preferably one that is unlikely to be removed or renamed.
AC_CONFIG_SRCDIR([src/include/zoltan.h])
# Specify directory for auxillary build tools (e.g., install-sh,
# config.sub, config.guess) and M4 files.
AC_CONFIG_AUX_DIR(config)
#
# We don't want people to configure in the source directory. Some
# things may break.
#
if test -e configure.ac ; then
echo "You are trying to run configure in the source directory. This is not allowed. Please run configure from a separate build directory."
exit
fi
# Configure should create src/Zoltan_config.h from src/Zoltan_config.h.in
AM_CONFIG_HEADER(src/include/Zoltan_config.h:src/include/Zoltan_config.h.in)
# Allow users to specify their own "install" command. If none is specified,
# the default is install-sh found in the config subdirectory.
AC_ARG_WITH(install,
[AC_HELP_STRING([--with-install=INSTALL_PROGRAM],
[Use the installation program INSTALL_PROGRAM rather the default that is provided. For example --with-install="/path/install -p"])],
[
INSTALL=$withval
INSTALL_PROGRAM=$withval
INSTALL_SCRIPT=$withval
INSTALL_DATA="$withval -m 644"
],)
# AM_MAINTAINER_MODE turns off maintainer-only makefile targets by
# default, and changes configure to understand a
# --enable-maintainer-mode option. --enable-maintainer-mode turns the
# maintainer-only targets back on. The maintainer-only makefile
# targets permit end users to clean automatically-generated files such
# as configure, which means they have to have autoconf and automake
# installed to repair the damage. AM_MAINTAINER_MODE makes it a bit
# harder for users to shoot themselves in the foot.
AM_MAINTAINER_MODE
# Define $build, $host, $target, etc
AC_CANONICAL_TARGET
# Note in header file and Makefile conditional what the host OS is
AM_CONDITIONAL(HOST_CYGWIN, false)
AM_CONDITIONAL(HOST_LINUX, false)
AM_CONDITIONAL(HOST_SOLARIS, false)
case $host_os in
cygwin)
AM_CONDITIONAL(HOST_CYGWIN, true)
AC_DEFINE(HOST_CYGWIN,1,[software host will be cygwin])
;;
linux*)
AM_CONDITIONAL(HOST_LINUX, true)
AC_DEFINE(HOST_LINUX,1,[software host will be linux])
;;
solaris*)
AM_CONDITIONAL(HOST_SOLARIS, true)
AC_DEFINE(HOST_SOLARIS,1,[software host will be solaris])
;;
esac
# Use automake
# - Required version of automake.
AM_INIT_AUTOMAKE(1.9.6 no-define tar-ustar)
# Specify required version of autoconf.
AC_PREREQ(2.59)
#TAC_ARG_ENABLE_OPTION(fortran, [enable Fortran support], FORTRAN_SUPPORT, no)
#This option is not currently available
TAC_ARG_ENABLE_OPTION(f90interface, [enable Fortran 90 interface (automatically enables Fortran support)], F90INTERFACE, no)
AM_CONDITIONAL(BUILD_ZOLTAN_F90_INTERFACE, [test "X$ac_cv_use_f90interface" != "Xno"])
#AM_CONDITIONAL(USE_FORTRAN, [test "X$ac_cv_use_fortran" != "Xno"])
if test "X$ac_cv_use_f90interface" = "Xyes"; then
ac_cv_use_fortran=yes
else
ac_cv_use_fortran=no
fi
if test "X$ac_cv_use_fortran" = "Xyes"; then
ac_cv_use_fortran90=yes
# AX_F90_MODULE_FLAG
# if test "X$ax_cv_f90_modflag" = "Xunknown" ; then
# AC_MSG_ERROR([unable to find f90 modules extension])
# else
# FCFLAGS="$ax_cv_f90_modflag../ $ax_cv_f90_modflag. ${FCFLAGS}"
# fi
else
ac_cv_use_fortran90=no
fi
TAC_ARG_ENABLE_FEATURE_SUB(zoltan, cppdriver, [Enable Zoltan's C++ driver], ZOLTAN_CPPDRIVER, yes)
AM_CONDITIONAL(HAVE_ZOLTAN_CPPDRIVER, [test "X$ac_cv_use_zoltan_cppdriver" != "Xno"])
#This can be removed after we retire the old build system
#AC_DEFINE([TRILINOS_CONFIG_H],,[Define when using the autotools to build Zoltan])
# ------------------------------------------------------------------------
# Check to see if MPI enabled and if any special configuration done
# ------------------------------------------------------------------------
# We may want to handle this differently because Zoltan requires MPI
#TAC_ARG_CONFIG_MPI
ZAC_ARG_CONFIG_MPI
# #np# - can eliminate compiler checks below if your package does not use the
# language corresponding to the check. Please note that if you use
# F77_FUNC to determine Fortran name mangling, you should not remove
# the Fortran compiler check or the check for Fortran flags. Doing
# so will prevent the detection of the proper name mangling in some
# cases.
AC_ARG_ENABLE(mpi-recv-limit,
AS_HELP_STRING([--enable-mpi-recv-limit],[Set to the limit on the number of simultaneous MPI posted receives, if any; default is --enable-mpi-recv-limit=10]),
[ AC_MSG_NOTICE(Building Zoltan to observe a limit of $enable_mpi_recv_limit simultaneously posted MPI receives)
AC_SUBST(MPI_RECV_LIMIT_FLAG, "-DMPI_RECV_LIMIT=$enable_mpi_recv_limit")
]
)
# ------------------------------------------------------------------------
# Checks for programs
# ------------------------------------------------------------------------
AM_PROG_CC_C_O(cc gcc)
#Conditional only?
#if test "X$ac_cv_use_zoltan_cppdriver" = "Xyes"; then
AC_PROG_CXX(CC g++ c++ cxx)
#fi
if test "X$ac_cv_use_fortran90" = "Xyes"; then
AC_PROG_FC(FC gfortran f90 xlf90 f95)
fi
if test "X$ac_cv_use_fortran" = "Xyes"; then
AC_PROG_FC(FC gfortran f90 xlf90 f95)
fi
AC_PROG_RANLIB
# Check if --with-flags present, prepend any specs to FLAGS
TAC_ARG_WITH_FLAGS(ccflags, CCFLAGS)
#if test "X$ac_cv_use_zoltan_cppdriver" = "Xyes"; then
TAC_ARG_WITH_FLAGS(cxxflags, CXXFLAGS)
CXXFLAGS="-DMPICH_IGNORE_CXX_SEEK ${CXXFLAGS}"
#fi
TAC_ARG_WITH_FLAGS(cflags, CFLAGS)
TAC_ARG_WITH_FLAGS(fcflags, FCFLAGS)
#TAC_ARG_WITH_FLAGS(fflags, FFLAGS)
TAC_ARG_WITH_LIBS
TAC_ARG_WITH_FLAGS(ldflags, LDFLAGS)
# ------------------------------------------------------------------------
# Alternate archiver
# ------------------------------------------------------------------------
TAC_ARG_WITH_AR
# ------------------------------------------------------------------------
# MPI link check
# ------------------------------------------------------------------------
TAC_ARG_CHECK_MPI
# ------------------------------------------------------------------------
# Checks for Makefile.export related systems
# ------------------------------------------------------------------------
# Add this later
TAC_ARG_ENABLE_EXPORT_MAKEFILES(yes)
# ------------------------------------------------------------------------
# Checks for special package flags
# ------------------------------------------------------------------------
ZAC_ARG_WITH_ID()
TAC_ARG_ENABLE_OPTION(gzip, [enable zlib support for driver], GZIP, no)
if test "X$ac_cv_use_gzip" != "Xno"; then
LIBS="-lz ${LIBS}"
fi
AM_CONDITIONAL(BUILD_GZIP, [test "X$ac_cv_use_gzip" != "Xno"])
TAC_ARG_WITH_PACKAGE(parmetis, [Enable Parmetis support.], PARMETIS, no)
AM_CONDITIONAL(BUILD_PARMETIS, [test "X$ac_cv_use_parmetis" != "Xno"])
TAC_ARG_WITH_3PL_SUB(parmetis, libdir, [Specify where the Parmetis library is located. Ex. /path/to/library])
if test "X$tac_with_parmetis_libdir" != "Xno"; then
LIBS="-L${tac_with_parmetis_libdir} -lparmetis -lmetis ${LIBS}"
fi
TAC_ARG_WITH_3PL_SUB(parmetis, incdir, [Specify where the Parmetis header files are located. Ex. /path/to/headers])
# It was necessary to move the parmetis include directories before the scotch
# include directories.
#if test "X$tac_with_parmetis_incdir" != "Xno"; then
# CPPFLAGS="-I${tac_with_parmetis_incdir} ${CPPFLAGS}"
#fi
TAC_ARG_WITH_PACKAGE(scotch, [Enable Scotch support.], SCOTCH, no)
AM_CONDITIONAL(BUILD_SCOTCH, [test "X$ac_cv_use_scotch" != "Xno"])
TAC_ARG_WITH_3PL_SUB(scotch, libdir, [Specify where the Scotch library is located. Ex. /path/to/library])
if test "X$tac_with_scotch_libdir" != "Xno"; then
LIBS="-L${tac_with_scotch_libdir} -lptscotch -lptscotcherr -lptscotcherrexit -lscotch -lscotcherr -lscotcherrexit ${LIBS}"
fi
TAC_ARG_WITH_3PL_SUB(scotch, incdir, [Specify where the Scotch header files are located. Ex. /path/to/headers])
if test "X$tac_with_scotch_incdir" != "Xno"; then
CPPFLAGS="-I${tac_with_scotch_incdir} ${CPPFLAGS}"
fi
# The parmetis include directories need to be before the Scotch include
# directories.
if test "X$tac_with_parmetis_incdir" != "Xno"; then
CPPFLAGS="-I${tac_with_parmetis_incdir} ${CPPFLAGS}"
fi
TAC_ARG_WITH_PACKAGE(patoh, [Enable Patoh support.], PATOH, no)
TAC_ARG_WITH_3PL_SUB(patoh, libdir, [Specify where the Patoh library is located. Ex. /path/to/library])
if test "X$tac_with_patoh_libdir" != "Xno"; then
LIBS="-L${tac_with_patoh_libdir} -lpatoh ${LIBS}"
fi
TAC_ARG_WITH_3PL_SUB(patoh, incdir, [Specify where the Patoh header files are located. Ex. /path/to/headers])
if test "X$tac_with_patoh_incdir" != "Xno"; then
CPPFLAGS="-I${tac_with_patoh_incdir} ${CPPFLAGS}"
fi
#TAC_ARG_WITH_PACKAGE(drum, [Enable Drum support. Library name as well as library and include paths must be specified using LDFLAGS and CPPFLAGS.], DRUM, no)
#TAC_ARG_WITH_3PL_SUB(drum, libdir, [Specify where the Drum library is located. Ex. /path/to/library])
#if test "X$tac_with_drum_libdir" != "Xno"; then
# LIBS="-L${tac_with_drum_libdir} ${LIBS}"
#fi
#TAC_ARG_WITH_3PL_SUB(drum, incdir, [Specify where the Drum header files are located. Ex. /path/to/headers])
#if test "X$tac_with_drum_incdir" != "Xno"; then
# CPPFLAGS="-I${tac_with_drum_incdir} ${CPPFLAGS}"
#fi
TAC_ARG_WITH_PACKAGE(nemesis_exodus, [Enable Nemesis/Exodus support for the Zdrive test executable. Library and include paths must be specified using LDFLAGS and CFLAGS.], NEMESIS_EXODUS, no)
#I am not sure if we can do this. We may not be able to get things in the right
#order. JW.
if test "X$ac_cv_use_nemesis_exodus" != "Xno"; then
LIBS="-lnemIc -lexoIIv2c -lnetcdf ${LIBS}"
fi
LIBS="${LIBS} -lm"
#TAC_ARG_WITH_PACKAGE(parkway, [Enable Parkway support.], PARKWAY, no)
#TAC_ARG_WITH_3PL_SUB(parkway, libdir, [Specify where the Parkway library is located. Ex. /path/to/library])
#if test "X$tac_with_parkway_libdir" != "Xno"; then
# LIBS="-L${tac_with_parkway_libdir} -lparkway -lpmpich++ -lstdc++ ${LIBS}"
#fi
#TAC_ARG_WITH_3PL_SUB(parkway, incdir, [Specify where the Parkway header files are located. Ex. /path/to/headers])
#if test "X$tac_with_parkway_incdir" != "Xno"; then
# CPPFLAGS="-I${tac_with_parkway_incdir} ${CPPFLAGS}"
#fi
# ------------------------------------------------------------------------
# Checks if tests and examples should be built
# ------------------------------------------------------------------------
TAC_ARG_ENABLE_FEATURE(tests, [Make tests for all Trilinos packages buildable with 'make tests'], TESTS, yes)
TAC_ARG_ENABLE_FEATURE_SUB_CHECK( zoltan, tests, [Make Zoltan tests buildable with 'make tests'], ZOLTAN_TESTS)
AM_CONDITIONAL(BUILD_TESTS, test "X$ac_cv_use_zoltan_tests" != "Xno")
TAC_ARG_ENABLE_FEATURE(examples, [Make examples for all Trilinos packages buildable with 'make examples'], EXAMPLES, yes)
TAC_ARG_ENABLE_FEATURE_SUB_CHECK( zoltan, examples, [Make Zoltan examples buildable with 'make examples'], ZOLTAN_EXAMPLES)
AM_CONDITIONAL(BUILD_EXAMPLES, test "X$ac_cv_use_zoltan_examples" != "Xno")
#We now build tests and examples through separate make targets, rather than
#during "make". We still need to conditionally include the test and example
#in SUBDIRS, even though SUB_TEST and SUB_EXAMPLE will never be
#defined, so that the tests and examples are included in the distribution
#tarball.
AM_CONDITIONAL(SUB_TEST, test "X$ac_cv_use_sub_test" = "Xyes")
AM_CONDITIONAL(SUB_EXAMPLE, test "X$ac_cv_use_sub_example" = "Xyes")
#TAC_ARG_ENABLE_FEATURE(libcheck, [Check for some third-party libraries. (Cannot be disabled unless tests and examples are also disabled.)], LIBCHECK, yes)
# ------------------------------------------------------------------------
# Specify other directories
# ------------------------------------------------------------------------
# enable use of --with-libdirs="-Llibdir1 -Llibdir2 ..." to prepend to LDFLAGS
TAC_ARG_WITH_LIBDIRS
# enable use of --with-incdirs="-Iincdir1 -Iincdir2 ..." to prepend to CPPFLAGS
TAC_ARG_WITH_INCDIRS
# ------------------------------------------------------------------------
# Checks for libraries
# ------------------------------------------------------------------------
ax_cv_f90_modulecase="lower"
FC_VENDOR="none"
# Define F77_FUNC that will be used to link with Fortran subroutines.
if test "X$ac_cv_use_fortran" != "Xno"; then
AC_FC_WRAPPERS
AC_FC_SRCEXT(f)
AC_FC_SRCEXT(f90)
# Determine compile-line flag for F90 modules (e.g., -M).
AX_F90_MODULE_FLAG
if test "X$ax_cv_f90_modflag" = "Xunknown" ; then
AC_MSG_ERROR([unable to find f90 modules extension])
else
FCFLAGS="$ax_cv_f90_modflag../ $ax_cv_f90_modflag. ${FCFLAGS}"
fi
# Determine case (upper or lower) of F90 module files.
AX_F90_MODULE_CASE
echo "KDDKDD " $ax_cv_f90_modulecase
WK_FC_GET_VENDOR()
echo "KDDKDD " $FC_VENDOR
if test "$FC_VENDOR" = "PGI"; then
FCFLAGS="-DPGI ${FCFLAGS}"
CFLAGS="-DPGI ${CFLAGS}"
fi
if test "$FC_VENDOR" = "Lahey"; then
FCFLAGS="-DFUJITSU ${FCFLAGS}"
CFLAGS="-DFUJITSU ${CFLAGS}"
fi
fi
AM_CONDITIONAL(F90_MODULE_LOWERCASE, [test "X$ax_cv_f90_modulecase" != "Xupper"])
AM_CONDITIONAL(NAG_F90_COMPILER, [test "X$FC_VENDOR" == "XNAG"])
# If tests, examples and libcheck are disabled, we don't have to check
# for these libraries.
#if test "X$ac_cv_use_new_package_examples" != "Xno" || test "X$ac_cv_use_libcheck" != "Xno"; then
#if test "X$ac_cv_use_zoltan_tests" != "Xno" || test "X$ac_cv_use_zoltan_examples" != "Xno" || test "X$ac_cv_use_libcheck" != "Xno"; then
# checks for libraries now
dnl Replace `main' with a function in -lm:
#AC_SEARCH_LIBS(pow,[m],,AC_MSG_ERROR(Cannot find math library))
#AC_SEARCH_LIBS(sqrt,[m],,AC_MSG_ERROR(Cannot find math library))
#fi
# end of the list of libraries that don't need to be checked for if
# tests and examples are disabled.
# ------------------------------------------------------------------------
# Checks for linker characteristics
# ------------------------------------------------------------------------
# Determine libraries needed for linking with Fortran
#AC_FC_LIBRARY_LDFLAGS
if test "X$ac_cv_use_fortran" = "Xyes"; then
AC_FC_LIBRARY_LDFLAGS
fi
# ------------------------------------------------------------------------
# Zoltan may be built via autotools, cmake, or our native makefile
# ------------------------------------------------------------------------
CPPFLAGS="-DAUTOTOOLS_BUILD ${CPPFLAGS}"
# ------------------------------------------------------------------------
# Perform substitutions in output files
# ------------------------------------------------------------------------
AC_SUBST(ac_aux_dir)
# ------------------------------------------------------------------------
# Output files
# ------------------------------------------------------------------------
#
AC_CONFIG_FILES([
Makefile
src/Makefile
src/driver/Makefile
src/fdriver/Makefile
Makefile.export.zoltan
example/Makefile
example/C/Makefile
example/CPP/Makefile
siMPI/Makefile
siMPI/pyMPI/Makefile
siMPI/pyMPI/siMPI/Makefile
])
# test/Large_Data/Makefile
# example/lib/Makefile
# example/C/Makefile
# example/C/sparse_matrix/Makefile
# example/CPP/Makefile
# Utilities/Makefile
AC_OUTPUT()
echo "---------------------------------------------"
echo "Finished Running Zoltan Configure Script"
echo "---------------------------------------------"