-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfigure.in
6280 lines (5925 loc) · 229 KB
/
configure.in
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
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
AC_PREREQ(2.63)
#
# (C) 2006 by Argonne National Laboratory.
# See COPYRIGHT in top-level directory.
#
dnl Process this file with autoconf to produce a configure script.
dnl
dnl aclocal_cache.m4, included by sowing/confdb/aclocal.m4, fixes
dnl bugs in autoconf caching.
dnl
dnl This is a large configure script and it is important to keep it
dnl clearly organized. In addition, this script must coordinate with
dnl the other modules that can be used to construct MPICH2, such as
dnl the communication device and the process manager. Each of these
dnl may have special features or limitations that other modules or
dnl this configure may need to take into account. To handle this, there
dnl are xx major steps in this configure script:
dnl
dnl 1. Identify major modules and source any prerequisite scripts
dnl 2. Determine compiler characteristics
dnl 3. Setup and configure the other modules
dnl 4. Determine MPI features and characteristics (such as datatype values)
dnl
dnl Each of these is described in more detail below.
dnl
dnl 1. Identify the modules (most are specified by
dnl --with-<modulename>=instance,
dnl for example, --with-pm=mpd or --with-device=ch3:nemesis).
dnl For each module, source the file mpich2prereq if present (in the
dnl module's top-level directory). This
dnl must be a bourne (sh) shell script; it can access any of the variables
dnl in the configure script. In addition, there are a few variables that
dnl are defined and provided to allow the modules to communicate their
dnl needs or limitations to the other modules. These are:
dnl MPID_MAX_THREAD_LEVEL - thread level supported by device.
dnl if unset, is MPI_THREAD_FUNNELED
dnl MPID_NO_LONG_LONG - if yes, the device does not support the
dnl long long integer type
dnl MPID_NO_LONG_DOUBLE - if yes, the device does not support the
dnl long double type
dnl MPID_PM_NAMESERVER - if set, provides the name of the nameserver
dnl that the process manager supports.
dnl This name server will be used if the
dnl default name server is selected.
dnl MPID_NO_PM - If yes, the device does not require any
dnl PM implementation.
dnl MPID_NO_PMI - If yes, the device does not require any
dnl PMI implementation.
dnl EXTRA_STATUS_DECL - Any extra declarations that the device
dnl needs added to the definition of MPI_Status.
dnl MPID_MAX_PROCESSOR_NAME - The maximum number of character in a processor
dnl name. If not set, 128 will be used.
dnl PMI_REQUIRES_READABLE_TOKENS - if yes, define the C-preprocessor
dnl value USE_HUMAN_READABLE_TOKENS, which is
dnl used in src/include/mpimem.h to define token
dnl separators used in src/util/mem/argstr.c
dnl PM_REQUIRES_PMI - if set, provides the name of the PMI
dnl interface implementation. If not set,
dnl the "simple" PMI implementation is used.
dnl A process manager that needs a particular
dnl process manager should check that this is
dnl not set to an incompatible value.
dnl MPID_NO_SPAWN - if yes, the device does not support the
dnl dynamic process routines (spawn, connect
dnl attach, join, plus port and publish
dnl routines). The major effect of this
dnl is to let the test codes know that
dnl spawn is not implemented.
dnl MPID_NO_RMA - if yes, the device does not support the
dnl MPI RMA routines (MPI_Win_create and
dnl MPI_Put etc.). The major effect of this
dnl is to let the test codes know that
dnl RMA is not implemented.
dnl
dnl Note that the meanings of these variables are defined so that an
dnl undefined value gives the default. This makes it easy to expand
dnl the set of such variables, since only modules that need the new
dnl variable will need to be changed.
dnl
dnl 2. Determine compiler characteristics
dnl Here is where features of the compilers are determined, including
dnl support for shared libraries and sizes of the basic datatype types.
dnl
dnl 3. Setup and configure the other modules
dnl Before each module configure is executed, the script setup_<module>
dnl is run if present. This is a bourne (sh) shell script and may
dnl access configure variables. It should not make any changes to the
dnl compiler name or flags (e.g., do not add -D_XOPEN_SOURCE to CFLAGS here,
dnl because that may invalidate the determination of the compiler
dnl characteristics in the prior step).
dnl
dnl 4. Determine MPI features
dnl
dnl
dnl Special environment variables
dnl To let other scripts and in particular the configure in test/mpi
dnl know that they are being invoked from within the MPICH2 configure,
dnl the following environment variables are set and exported:
dnl FROM_MPICH2
dnl MPICH2_ENABLE_F77
dnl MPICH2_ENABLE_FC
dnl MPICH2_ENABLE_CXX
dnl
dnl The file name here refers to a file in the source being configured
dnl In later versions of autoconf, the binding of AC_INIT changed (!!!)
dnl The original version was AC_INIT(a source file)
dnl The later version is AC_INIT(package,version,[bug-report],[tarname])
dnl Here we use the original version
dnl AC_INIT(src/include/mpiimpl.h)
dnl
dnl Note that no executable statements are allowed (and any are silently
dnl dropped) before AC_INIT.
dnl
dnl AC_INIT requires an explicit version number
dnl Args are package name, version, bug report, and tar file name
dnl All must be literals
dnl Note that AC_PACKAGE_STRING is not a command but must be defined(!)
dnl Unfortunately, setting the PACKAGE names is not compatible with
dnl AC_CONFIG_SUBDIRS, since the resulting values in the generated
dnl conf file will not be consistent.
dnl define([AC_PACKAGE_STRING],[MPICH2 1.0.6])
dnl AC_INIT(mpich2,1.0.6,[email protected],mpich2-1.0.6)
dnl Use the oldstyle AC_INIT instead
AC_INIT(src/include/mpichconf.h.in)
CONFIGURE_ARGS_CLEAN=`echo $* | tr '"' ' '`
AC_SUBST(CONFIGURE_ARGS_CLEAN)
# Try to find the version and release date
if test -s "$srcdir/maint/Version" ; then
. $srcdir/maint/Version
export MPICH2_VERSION
else
AC_MSG_ERROR([Version information not found. Configuration aborted.])
fi
AC_SUBST(MPICH2_RELEASE_DATE)
# Produce a numeric version assuming the following format:
# Version: [MAJ].[MIN].[REV][EXT][EXT_NUMBER]
# Example: 1.0.7rc1 has
# MAJ = 1
# MIN = 0
# REV = 7
# EXT = rc
# EXT_NUMBER = 1
#
# Converting to numeric version will convert EXT to a format number:
# ALPHA (a) = 0
# BETA (b) = 1
# RC (rc) = 2
# PATCH (p) = 3
# Regular releases are treated as patch 0
#
# Numeric version will have 1 digit for MAJ, 2 digits for MIN,
# 2 digits for REV, 1 digit for EXT and 2 digits for EXT_NUMBER.
changequote(<<,>>)
V1=`expr $MPICH2_VERSION : '\([0-9]*\)\.[0-9]*\.*[0-9]*[a-zA-Z]*[0-9]*'`
V2=`expr $MPICH2_VERSION : '[0-9]*\.\([0-9]*\)\.*[0-9]*[a-zA-Z]*[0-9]*'`
V3=`expr $MPICH2_VERSION : '[0-9]*\.[0-9]*\.*\([0-9]*\)[a-zA-Z]*[0-9]*'`
V4=`expr $MPICH2_VERSION : '[0-9]*\.[0-9]*\.*[0-9]*\([a-zA-Z]*\)[0-9]*'`
V5=`expr $MPICH2_VERSION : '[0-9]*\.[0-9]*\.*[0-9]*[a-zA-Z]*\([0-9]*\)'`
changequote([,])
if test "$V2" -le 9 ; then V2=0$V2 ; fi
if test "$V3" = "" ; then V3=0; fi
if test "$V3" -le 9 ; then V3=0$V3 ; fi
if test "$V4" = "a" ; then
V4=0
elif test "$V4" = "b" ; then
V4=1
elif test "$V4" = "rc" ; then
V4=2
elif test "$V4" = "" ; then
V4=3
V5=0
elif test "$V4" = "p" ; then
V4=3
fi
if test "$V5" -le 9 ; then V5=0$V5 ; fi
MPICH2_NUMVERSION=`expr $V1$V2$V3$V4$V5 + 0`
AC_SUBST(MPICH2_NUMVERSION)
AC_SUBST(MPICH2_VERSION)
# ABIVERSION is the name used by simplemake, so we reassign the
# libmpich_so_version number to it
ABIVERSION=${libmpich_so_version}
export ABIVERSION
export libmpich_so_version
AC_SUBST(ABIVERSION)
# Print out the configure options
CONFIGURE_ARGUMENTS="$ac_configure_args"
AC_SUBST(CONFIGURE_ARGUMENTS)
if test -n "$ac_configure_args" ; then
echo "Configuring MPICH2 version $MPICH2_VERSION with $ac_configure_args"
else
echo "Configuring MPICH2 version $MPICH2_VERSION"
fi
# Add the information on the system:
echo "Running on system: `uname -a`"
dnl Definitions will be placed in this file rather than in the DEFS variable
AC_CONFIG_HEADER(src/include/mpichconf.h)
AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* (C) 2001 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#ifndef MPICHCONF_H_INCLUDED
#define MPICHCONF_H_INCLUDED
])
AH_BOTTOM([#endif])
dnl Set the directory that contains support scripts such as install-sh and
dnl config.guess
AC_CONFIG_AUX_DIR(confdb)
# Set the FROM_MPICH2 variable to tell subconfigures that they are
# built from within MPICH2
FROM_MPICH2=yes
export FROM_MPICH2
AC_ARG_VAR(FROM_MPICH2,
[internal flag to tell subconfigures that
they are built from within MPICH2])
# Save a copy of precious flags as USER_* before any of these flags
# are being modified by configure tests.
PAC_PREFIX_ALL_FLAGS(USER)
# WRAPPER_xFLAGS are used by mpicc and friends.
#
# WRAPPER_CFLAGS and other compile flags are used for compile options
# that are added by MPICH2, but should be used by applications (such
# as include paths).
#
# All libraries that are detected by MPICH2 as needed for some of its
# functionality (such as -lpthread) should be added to LIBS so
# autoconf link tests can use them. Libraries that are built by MPICH2
# at make time (and hence are not available for autoconf link tests to
# use), such as OPA and MPL, should be added to WRAPPER_LIBS for
# static builds. All libraries in LIBS are added to WRAPPER_LIBS
# (similarly LDFLAGS are added to WRAPPER_LDFLAGS) as well, at the end
# of configure.
PAC_PREFIX_ALL_FLAGS(WRAPPER)
WRAPPER_CFLAGS="$CFLAGS $MPICH2_MPICC_FLAGS"
WRAPPER_CPPFLAGS="$CPPFLAGS $MPICH2_MPICPP_FLAGS"
WRAPPER_CXXFLAGS="$CXXFLAGS $MPICH2_MPICXX_FLAGS"
WRAPPER_FFLAGS="$FFLAGS $MPICH2_MPIF77_FLAGS"
WRAPPER_FCFLAGS="$FCFLAGS $MPICH2_MPIFC_FLAGS"
WRAPPER_LDFLAGS="$MPICH2_LDFLAGS"
WRAPPER_LIBS="$MPICH2_LIBS"
# Add MPICH2LIB_* to the appropriate flags
AC_ARG_VAR(MPICH2LIB_CFLAGS,
[extra CFLAGS used in building MPICH2 libraries])
AC_ARG_VAR(MPICH2LIB_CPPFLAGS,
[extra CPPFLAGS used in building MPICH2 libraries])
AC_ARG_VAR(MPICH2LIB_CXXFLAGS,
[extra CXXFLAGS used in building MPICH2 libraries])
AC_ARG_VAR(MPICH2LIB_FFLAGS,
[extra FFLAGS used in building MPICH2 libraries])
AC_ARG_VAR(MPICH2LIB_FCFLAGS,
[extra FCFLAGS used in building MPICH2 libraries])
AC_ARG_VAR(MPICH2LIB_LDFLAGS,
[extra LDFLAGS used in building MPICH2 libraries])
AC_ARG_VAR(MPICH2LIB_LIBS,
[extra LIBS used in building MPICH2 libraries])
CFLAGS="$CFLAGS $MPICH2LIB_CFLAGS"
CPPFLAGS="$CPPFLAGS $MPICH2LIB_CPPFLAGS"
CXXFLAGS="$CXXFLAGS $MPICH2LIB_CXXFLAGS"
FFLAGS="$FFLAGS $MPICH2LIB_FFLAGS"
FCFLAGS="$FCFLAGS $MPICH2LIB_FCFLAGS"
LDFLAGS="$LDFLAGS $MPICH2LIB_LDFLAGS"
LIBS="$LIBS $MPICH2LIB_LIBS"
AC_ARG_ENABLE(lib-depend,
AC_HELP_STRING([--enable-lib-depend], [Turn on library dependencies (experimental)]),,
[enable_lib_depend=no])
AC_ARG_ENABLE(echo,
AC_HELP_STRING([--enable-echo], [Turn on strong echoing. The default is enable=no.]),
set -x)
AC_ARG_ENABLE(coverage,
AC_HELP_STRING([--enable-coverage], [Turn on coverage analysis using gcc and gcov]),,
enable_coverage=no)
AC_ARG_ENABLE(dynamiclibs,
AC_HELP_STRING([--enable-dynamiclibs], [Enable the use of dynamic libraries
by the devices that support them]),,enable_dynamiclibs=no)
AC_ARG_ENABLE(error-checking,
[ --enable-error-checking=level
Control the amount of error checking.
no - no error checking
runtime - error checking controllable at runtime through environment
variables
all - error checking always enabled (default)
],,enable_error_checking=default)
AC_ARG_ENABLE(error-messages,
[ --enable-error-messages=level - Control the amount of detail in error messages.
all - Maximum amount of information
generic - Only generic messages (no information about the specific
instance)
class - One message per MPI error class
none - No messages
],,enable_error_messages=all)
AC_ARG_ENABLE(timing,
[ --enable-timing=level - Control the amount of timing information
collected by the MPICH implementation.
none - Collect no data (default)
all - Collect lots of data
runtime - Runtime control of data collected
],,enable_timing=default)
AC_ARG_ENABLE(g,
[ --enable-g=option - Control the level of debugging support in the
MPICH implementation. option is a list of comma
separated names including
none - No debugging
handle - Trace handle operations
handlealloc - Trace handle allocations
dbg - Add compiler flag, -g, to all internal
compiler flags, i.e. MPICH2LIB_CFLAGS, MPICH2LIB_CXXFLAGS,
MPICH2LIB_FFLAGS, and MPICH2LIB_FCFLAGS.
debug - Synonym for dbg
instr - Enable instrumentation
log - Enable debug event logging
mem - Memory usage tracing
meminit - Preinitialize memory associated structures and unions to
eliminate access warnings from programs like valgrind
memarena - Check for overwrite errors in memory allocation arena
mutex - Enable error checking on pthread mutexes
mutexnesting - Check for non-nesting of mutexes
all - All of the above choices
],,enable_g=none)
dnl We may want to force MPI_Aint to be the same size as MPI_Offset,
dnl particularly on 32 bit systems with large (64 bit) file systems.
AC_ARG_WITH(aint-size,
AC_HELP_STRING([--with-aint-size], [Override the size of MPI_AINT (in bytes)]),,
with_aint_size=0)
AC_ARG_ENABLE(fast,
[ --enable-fast=option - Control the level of fast execution in the
MPICH implementation. option is a list of
comma separated names including
defopt - Default compiler optimization -O2 for all language bindings,
i.e. --enable-fast=O2, when neither --enable-fast
nor --disable-fast is specified. (default)
O<n> - Appends default optimization flags, -O<n>, to all internal
compiler flags, i.e. MPICH2LIB_CFLAGS, MPICH2LIB_CXXFLAGS,
MPICH2LIB_FFLAGS, and MPICH2LIB_FCFLAGS.
nochkmsg - No error checking, i.e. --disable-error-checking
notiming - No timing collection, i.e. --disable-timing.
ndebug - Appends -DNDEBUG to MPICH2LIB_CFLAGS.
all|yes - "defopt", "nochkmsg", "notiming" and "ndebug" are enabled
when --enable-fast is specified without any option.
none - None of above options, i.e. --disable-fast. Note that
--enable-strict will add the -O2 option even if
--enable-fast=none is given.
],,enable_fast=defopt)
AC_ARG_ENABLE(check-compiler-flags,
AC_HELP_STRING([--enable-check-compiler-flags], [enable the checks for all compiler
options, xxxFLAGS, MPICH2_xxxFLAGS. Default is on.]),,
enable_check_compiler_flags=yes)
dnl We enable f77 and fc if we can find compilers for them.
dnl In addition, we check whether f77 and fc can work together.
AC_ARG_ENABLE(f77,
AC_HELP_STRING([--enable-f77], [Enable Fortran 77 bindings]),,enable_f77=yes)
AC_ARG_ENABLE(fc,
AC_HELP_STRING([--enable-fc], [Enable Fortran 90 bindings]),,enable_fc=yes)
AC_ARG_ENABLE(f90,
AC_HELP_STRING([--enable-f90],
[Obsolete option: Use --enable-fc or --disable-fc instead]),
[AC_MSG_ERROR([
--enable-f90 and --disable-f90 are NO longer valid configure options,
use --enable-fc or --disable-fc instead])]
)
AC_ARG_ENABLE(cxx,
AC_HELP_STRING([--enable-cxx], [Enable C++ bindings]),,enable_cxx=default)
AC_ARG_ENABLE(romio,
AC_HELP_STRING([--enable-romio], [Enable ROMIO MPI I/O implementation]),,
enable_romio=yes)
AC_ARG_ENABLE(debuginfo,
AC_HELP_STRING([--enable-debuginfo], [Enable support for debuggers]),,
enable_debuginfo=no)
AC_ARG_ENABLE(smpcoll,
AC_HELP_STRING([--enable-smpcoll],
[Enable support for SMP/multi-core aware collectives]),
smpcoll=$enableval,smpcoll=yes)
if test $smpcoll = "yes" ; then
AC_DEFINE(USE_SMP_COLLECTIVES,1,[define to enable SMP/multi-core aware collectives])
fi
dnl The environment variable MPICH_DEBUGLIBNAME may be used to
dnl override the default name of the library that the debugger will
dnl load to access the MPICH2 internal data structures.
AC_ARG_ENABLE(nmpi-as-mpi,
AC_HELP_STRING([--enable-nmpi-as-mpi], [Use MPI rather than PMPI routines for MPI
routines, such as the collectives, that may be
implemented in terms of other MPI routines]),,
enable_nmpi_as_mpi=no)
dnl "default" is a special device that allows MPICH to choose one
dnl based on the environment.
AC_ARG_WITH(device,
AC_HELP_STRING([--with-device=name], [Specify the communication device for MPICH]),,
with_device=default)
AC_ARG_WITH(pmi,
AC_HELP_STRING([--with-pmi=name], [Specify the pmi interface for MPICH]),,
with_pmi=default)
AC_ARG_WITH(pm,
AC_HELP_STRING([--with-pm=name],
[Specify the process manager for MPICH. "no" or "none" are
valid values. Multiple process managers may be specified as
long as they all use the same pmi interface by separating them
with colons. The mpiexec for the first named process manager
will be installed. Example: "--with-pm=hydra:mpd:gforker"
builds the three process managers hydra, mpd and gforker;
only the mpiexec from hydra is installed into the bin
directory.]),,with_pm=default)
AC_ARG_WITH(logging,
AC_HELP_STRING([--with-logging=name], [Specify the logging library for MPICH]),
[if test -z "$withval" ; then with_logging=rlog ; fi],with_logging=none)
dnl both --without-mpe and --disable-mpe are supported
dnl AC_ARG_ENABLE(mpe) is used only when --with(out)-mpe is not used.
AC_ARG_WITH(mpe,
AC_HELP_STRING([--with-mpe], [Build the MPE (MPI Parallel Environment) routines]),,
with_mpe=default)
if test "$with_mpe" = "default" ; then
AC_ARG_ENABLE(mpe,
AC_HELP_STRING([--enable-mpe], [Build the MPE (MPI Parallel Environment) routines]),
with_mpe=$enableval,with_mpe=default)
fi
dnl
dnl The default option needs to be defined in terms of a specific choice
dnl (runtime in this case). Note that the default choice is the same as
dnl runtime only for certain devices - not for every device.
AC_ARG_ENABLE(threads,
[ --enable-threads=level - Control the level of thread support in the
MPICH implementation. The following levels
are supported.
single - No threads (MPI_THREAD_SINGLE)
funneled - Only the main thread calls MPI (MPI_THREAD_FUNNELED)
serialized - User serializes calls to MPI (MPI_THREAD_SERIALIZED)
runtime - The level of thread support is determined by
the arguments to MPI_Init_thread, with
MPI_THREAD_MULTIPLE available. The default option
for many communication devices.
multiple - Fully multi-threaded (MPI_THREAD_MULTIPLE) always.
DO NOT select this option. The option runtime is more
efficient and also supports thread_multiple.
(multiple aliased to runtime now)
default - Make a good choice depending on the communication
device. For ch3:nemesis, this is runtime.
See also the --enable-thread-cs option for controlling the granularity of
the concurrency inside of the library
],,enable_threads=default)
AC_ARG_ENABLE(thread-cs,
AC_HELP_STRING([--enable-thread-cs=type],
[Choose the method used for critical sections
and other atomic updates when multiple
threads are present. Values may be global
(default), per-object, lock-free]),,enable_thread_cs=global)
AC_ARG_ENABLE(refcount,
AC_HELP_STRING([--enable-refcount=type],
[Choose the method for ensuring atomic updates
to the reference counts for MPI objects.
Values may be lock, lock-free, none. The
default depends on the thread-cs choice; for
global it is none (because none is required),
for per-object it is lock, and for lock-free
it is lock-free]),,enable_refcount=default)
AC_ARG_ENABLE(mutex-timing,
AC_HELP_STRING([--enable-mutex-timing], [calculate the time spent waiting on mutexes]),
AC_DEFINE(MPIU_MUTEX_WAIT_TIME,1,[Define to enable timing mutexes]))
AC_ARG_ENABLE(handle-allocation,
AC_HELP_STRING([--enable-handle-allocation=type],
[Choose the method used for allocating MPI
object handles. Values may be 'tls' for
thread-local storage or 'mutex' for simple
locking. 'mutex' is the default.]),,enable_handle_allocation=default)
AC_ARG_ENABLE([predefined-refcount],
AS_HELP_STRING([--enable-predefined-refcount],
[control whether predefined objects like
MPI_COMM_WORLD are reference counted (default
depends on --enable-thread-cs choice)]),[],
[enable_predefined_refcount=default])
AC_ARG_ENABLE(weak-symbols,
AC_HELP_STRING([--enable-weak-symbols],
[Use weak symbols to implement PMPI routines (default)]),,
enable_weak_symbols=yes)
AC_ARG_ENABLE(multi-aliases,
AC_HELP_STRING([--enable-multi-aliases],
[Multiple aliasing to support multiple fortran compilers (default)]),,
enable_multi_aliases=yes)
AC_ARG_WITH(cross,
AC_HELP_STRING([--with-cross=file],
[Specify the values of variables that configure cannot
determine in a cross-compilation environment]),,with_cross=no)
AC_ARG_WITH(namepublisher,
[ --with-namepublisher=name Choose the system that will support
MPI_PUBLISH_NAME and MPI_LOOKUP_NAME. Options
include
no (no service available)
mpd
file[:directory] (optional directory)
pmi],,with_namepublisher=default)
AC_ARG_WITH(name-publisher,
[],
with_namepublisher=$with_name_publisher,)
AC_SUBST(MPIFLIBNAME)
AC_SUBST(PMPIFLIBNAME)
dnl The default is a special wrapper library
AC_ARG_WITH(fwrapname,
AC_HELP_STRING([--with-fwrapname=name],
[Specify name of library containing Fortran interface routines]),
[FWRAPNAME=$withval;set_FWRAPNAME="yes"],FWRAPNAME=fmpich)
AC_SUBST(FWRAPNAME)
# Find a C compiler.
# We also need to do this before the F77 and FC test to ensure that we
# find the C preprocessor reliably.
PAC_PROG_CC
PAC_PUSH_FLAG([CFLAGS])
AC_PROG_CPP
# Bug in autoconf. Restore cross settings
if test "$pac_cross_compiling" = "yes" -a "$ac_cv_prog_cc_cross" = "no" ; then
AC_MSG_RESULT([Resetting cross compilation to yes])
cross_compiling=yes
ac_cv_prog_cc_cross=yes
ac_cv_prog_f77_cross=yes
ac_cv_prog_fc_cross=yes
ac_cv_prog_cxx_cross=yes
fi
PAC_POP_FLAG([CFLAGS])
# compute canonical system types
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
# TARGET not needed, MPICH2 isn't a compiler
# Enable better caching control
PAC_ARG_CACHING
# Set CFLAGS for enable strict if necessary. Do this *first* because
# it may influence the output of the other tests
PAC_ARG_STRICT
# Check for shared library support
PAC_ARG_SHAREDLIBS
# -----------------------------------------------------------------------------
# First check that we have a clean build if we are doing a VPATH build
PAC_VPATH_CHECK(src/include/mpi.h src/env/mpicc src/env/mpicc.conf,lib)
# ----------------------------------------------------------------------------
# This test is complicated by the fact that top_srcdir is not set until
# the very end of configure. Instead, we get it ourselves
if test -z "$top_srcdir" ; then
use_top_srcdir=$srcdir
else
use_top_srcdir=$top_srcdir
fi
if test -z "$master_top_srcdir" ; then
# This needs to be an absolute pathname
case "$use_top_srcdir" in
/*) ;;
*)
use_top_srcdir=`(cd $use_top_srcdir && pwd)`
;;
esac
master_top_srcdir=$use_top_srcdir
fi
# Get the directory that we're running in...
if test -z "$master_top_builddir" ; then
master_top_builddir="`pwd`"
fi
AC_SUBST(master_top_builddir)
AC_SUBST(master_top_srcdir)
export master_top_builddir
export master_top_srcdir
# ----------------------------------------------------------------------------
# We create this file to allow other configures to find the "master"
# top builddir
rm -f .mpich2
date > .mpich2
# ----------------------------------------------------------------------------
# with-device
if test "$with_device" = "default" ; then
# Pick the device. For now, always choose ch3
with_device=ch3
fi
# Extract the device name from any options
# Allow the device to specify a directory; if no directory, use the
# included directories
#
DEVICE=$with_device
AC_SUBST(DEVICE)
device_name=`echo $with_device | sed -e 's/:.*$//'`
changequote(<<,>>)
device_args=`echo $with_device | sed -e 's/^[^:]*//' -e 's/^://'`
changequote([,])
devicedir=$use_top_srcdir/src/mpid/$device_name
devicereldir=src/mpid/$device_name
case "$device_name" in
/*)
devicedir=$DEVICE
# Get the name from the leaf
device_name=`echo $device_name ~ sed -e 's%.*/%%'`
# FIXME: should the devicereldir be different (perhaps not -
# this allows use to build within our tree, even when other data
# is outside of the tree)
;;
*)
;;
esac
export device_name
export device_args
export devicedir
# Make the device base name and args available to generated files
DEVICE_NAME=$device_name
AC_SUBST(DEVICE_NAME)
DEVICE_ARGS=$device_args
AC_SUBST(DEVICE_ARGS)
#
# Give the device an opportunity to include a header file in mpi.h. The
# default value of INCLUDE_MPIDDEFS_H is set prior to the inclusion of the
# device's mpich2prereq script. The device's script may override the value
# if needed.
INCLUDE_MPIDDEFS_H='/* ... no device specific definitions ... */'
AC_SUBST(INCLUDE_MPIDDEFS_H)
#
# See if the device wants to say something about the compilers (for example,
# the globus device may need to do this)
if test -f $devicedir/mpich2prereq ; then
. $devicedir/mpich2prereq
fi
# ----------------------------------------------------------------------------
# Set default library names if names haven't already been provided
MPILIBNAME=${MPILIBNAME:-"mpich"}
PMPILIBNAME_set=no
if test -n "$PMPILIBNAME" ; then
PMPILIBNAME_set=yes
fi
PMPILIBNAME=${PMPILIBNAME:-"p$MPILIBNAME"}
# Note that the name for this library may be updated after we check for
# enable_shmem
# Fortran names are set later.
# We use a different library for the C++ wrappers to avoid problems when
# creating shared libraries
if test -z "$MPICXXLIBNAME" ; then MPICXXLIBNAME="${MPILIBNAME}cxx" ; fi
export MPIFLIBNAME
export PMPIFLIBNAME
export MPICXXLIBNAME
AC_SUBST(MPICXXLIBNAME)
# We'll set FORTRAN_BINDING to 1 if we support Fortran
FORTRAN_BINDING=0
# Set up default compiler optimization
MPI_DEFAULT_COPTS="-O2"
MPI_DEFAULT_CXXOPTS="-O2"
MPI_DEFAULT_FOPTS="-O2"
MPI_DEFAULT_FCOPTS="-O2"
# enable-fast
# strip off multiple options, separated by commas
save_IFS="$IFS"
IFS=","
for option in $enable_fast ; do
case "$option" in
defopt)
enable_default_optimize=yes
;;
nochkmsg)
enable_fast_nochkmsg=yes
;;
notiming)
enable_timing=no
;;
ndebug)
enable_append_ndebug=yes
;;
#
# [BRT] removed the reseting of enable_g so that --with-enable=dbg,meminit
# can be specified with -enable-fast. This change was largely made for the
# PETSc folks who want to use --enable-fast to eliminate parameter checking
# overhead, but also wish to use meminit to eliminate initialization
# warnings from valgrind.
#
all|yes)
enable_default_optimize=yes
enable_fast_nochkmsg=yes
# Disable timing/logging stuffs
enable_timing=no
enable_append_ndebug=yes
;;
O*)
# Allows O<n> where <n> can be [0-9] or ' '.
opt_flags=`echo $option | sed -e 's%\(O[0-9] \)%\1%g'`
if test -n "$opt_flags" ; then
enable_default_optimize=yes
MPI_DEFAULT_COPTS="-$option"
MPI_DEFAULT_CXXOPTS="-$option"
MPI_DEFAULT_FOPTS="-$option"
MPI_DEFAULT_FCOPTS="-$option"
else
IFS="$save_IFS"
AC_MSG_WARN([Unknown value $option for --enable-fast])
IFS=","
fi
;;
none|no)
enable_default_optimize=no
enable_fast_nochkmsg=no
# Reset timing/logging stuffs to when --enable-timing isn't specified.
enable_timing=default
enable_append_ndebug=no
;;
*)
IFS="$save_IFS"
AC_MSG_WARN([Unknown value $option for --enable-fast])
IFS=","
;;
esac
done
IFS="$save_IFS"
# ----------------------------------------------------------------------------
# Process any enable or with values
# We must do enable-fast first, because it changes the other enable values
if test "$enable_fast_nochkmsg" = "yes" ; then
#
if test "$enable_error_checking" != "default" -a "$enable_error_checking" != "no" ; then
AC_MSG_ERROR([enable-fast overrides enable-error-checking; error-checking option $enable_error_checking ignored])
fi
enable_error_checking=no
# Export a variable that will allow the test suite to detect that
# MPICH has no error testing
MPICH_FAST=yes
export MPICH_FAST
fi
# error-checking
# Change default into the specific value of the default
if test "$enable_error_checking" = "default" ; then
enable_error_checking=all
fi
case "$enable_error_checking" in
no)
# if error checking has been disabled, then automatically disable the error
# checking tests in the test suite
ac_configure_args="${ac_configure_args} --disable-checkerrors"
;;
all|yes|runtime)
error_checking_kind=`echo $enable_error_checking | \
tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
error_checking_kind=MPID_ERROR_LEVEL_$error_checking_kind
AC_DEFINE_UNQUOTED(HAVE_ERROR_CHECKING,$error_checking_kind,[Define to enable error checking])
;;
*)
AC_MSG_WARN([Unknown value $enable_error_checking for enable-error-checking])
;;
esac
# error-messages
case "$enable_error_messages" in
no|none)
error_message_kind="MPICH_ERROR_MSG_NONE"
;;
all|yes)
error_message_kind="MPICH_ERROR_MSG_ALL"
;;
generic)
error_message_kind="MPICH_ERROR_MSG_GENERIC"
;;
class)
error_message_kind="MPICH_ERROR_MSG_CLASS"
;;
*)
AC_MSG_WARN([Unknown value $enable_error_messages for enable-error-messages])
;;
esac
AC_DEFINE_UNQUOTED(MPICH_ERROR_MSG_LEVEL,$error_message_kind,[define to enable error messages])
# ----------------------------------------------------------------------------
#
# enable-timing and with-logging
#
# Still to do: add subsets: e.g., class=pt2pt,class=coll. See mpich2 doc
#
# Logging and timing are intertwined. If you select logging, you
# may also need to select a timing level. If no timing is selected
# but logging with rlog is selected, make "all" the default timing level.
#
# FIXME: make timing and logging options work more cleanly together,
# particularly when other logging options are selected (e.g., logging is not
# rlog).
# ----------------------------------------------------------------------------
collect_stats=false
logging_required=false
if test "$enable_timing" = "default" ; then
if test "$with_logging" = "rlog" ; then
enable_timing=all
fi
fi
timing_name=$enable_timing
case "$enable_timing" in
no)
timing_name=none
;;
time)
collect_stats=true
;;
log|log_detailed)
logging_required=true
;;
yes)
timing_name=all
collect_stats=true
logging_required=true
;;
all|runtime)
collect_stats=true
logging_required=true
;;
none|default)
timing_name=none
;;
*)
AC_MSG_WARN([Unknown value $enable_timing for enable-timing])
enable_timing=no
timing_name=none
;;
esac
#
# The default logging package is rlog; you can get it by
# specifying --with-logging or --with-logging=rlog
#
case $with_logging in
yes)
logging_name=rlog
;;
no|none)
logging_name=none
;;
default)
if test "$logging_required" = "true" ; then
logging_name=rlog
else
logging_name=none
fi
;;
*)
logging_name=$with_logging
;;
esac
#
# Include the selected logging subsystem
#
# Choices:
# 1) A subdir of src/util/logging
# This directory must contain a configure which will be executed
# to build the
# 2) An external directory
# This directory must contain
# a mpilogging.h file
# It may contain
# a setup_logging script
# a configure
#
#
logging_subsystems=
if test "$logging_name" != "none" ; then
# Check for an external name (directory containing a /)
hasSlash=`echo A$logging_name | sed -e 's%[[^/]]%%g'`
if test -n "$hasSlash" ; then
# Check that the external logging system is complete.
# Any failure will cause configure to abort
if test ! -d $logging_name ; then
AC_MSG_ERROR([External logging directory $logging_name not found. Configure aborted])
logging_name=none
elif test ! -s $logging_name/mpilogging.h ; then
AC_MSG_ERROR([External logging header $logging_name/mpilogging.h not found. Configure aborted])
logging_name=none
fi
logdir=$logging_name
# Force the logdir to be absolute
logdir=`cd $logdir && pwd`
# Switch name to "external" because that is how the MPICH2
# code will know it
logging_name=external
# Add the dir to the include paths
#CPPFLAGS="$CPPFLAGS -I$logdir"
CPPFLAGS="$CPPFLAGS -I$logdir"
EXTERNAL_SRC_DIRS="$EXTERNAL_SRC_DIRS $logdir"
# Add to the list of external modules to setup
if test -x $logdir/setup_logging ; then
EXTERNAL_SETUPS="$EXTERNAL_SETUPS $logdir/setup_logging"
fi
else
logdir=$srcdir/src/util/logging
logreldir=src/util/logging/$logging_name
logging_subsystems="$logging_subsystems $logreldir"
logging_subdirs=$logging_name
for dir in $logging_subdirs ; do
if test ! -d $logdir/$dir ; then
AC_MSG_ERROR([$logdir/$dir does not exist. Configure aborted])
logging_name=none
fi
done
for dir in $logging_subsystems ; do
if test ! -x $srcdir/$dir/configure ; then
AC_MSG_ERROR([$logdir/$dir has no configure (required). Configure aborted])
logging_name=none
fi
other_install_dirs="${other_install_dirs} $logreldir"
done
fi
fi
#
# FIXME: Logging doesn't necessarily require timing (e.g., simply logging the
# sequence of routines).
if test "$logging_name" != "none" ; then
if test "$enable_timing" != "no" ; then
if test "$enable_timing" = "default" -o "$enable_timing" = "none" ; then
enable_timing=log
timing_name=log
fi
logging_dir=logging
subsystems="$subsystems $logging_subsystems"
else
AC_MSG_WARN([Timing was disabled. Logging has been disabled as well.])
with_logging=no
logging_name=none
logging_dir=
logging_subdirs=
fi
else
if test "$logging_required" = "true" ; then
AC_MSG_WARN([Timing was enabled with log option but no logging library is available. Timing has been disabled.])
enable_timing=no
timing_name=none
fi
logging_dir=
logging_subdirs=
fi
if test "$timing_name" != "none" ; then
timing_kind=`echo $timing_name | \
tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
timing_kind=MPID_TIMING_KIND_$timing_kind
AC_DEFINE_UNQUOTED(HAVE_TIMING,$timing_kind,[define to enable timing collection])
if test "$collect_stats" = "true" ; then
AC_DEFINE(COLLECT_STATS,1,[define to enable collection of statistics])
fi
fi
#
AC_SUBST(logging_dir)
AC_SUBST(logging_name)
AC_SUBST(logging_subdirs)
use_logging_variable="MPID_LOGGING_`echo $logging_name | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
AC_DEFINE_UNQUOTED(USE_LOGGING,$use_logging_variable,[define to choose logging library])