-
Notifications
You must be signed in to change notification settings - Fork 280
/
configure.ac
1875 lines (1737 loc) · 60.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
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
##
## Copyright (C) by Argonne National Laboratory
## See COPYRIGHT in top-level directory
##
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.67)
dnl
dnl aclocal_cache.m4, included by sowing/confdb/aclocal.m4, fixes
dnl bugs in autoconf caching.
dnl
dnl
dnl Environment variables that affect behavior of the test configure
dnl MPICH_FAST
dnl
dnl The file name here refers to a file in the source being configured
dnl FIXME this is the old style, needs updating to new style
dnl AC_INIT(include/mpitest.h)
m4_include([version.m4])
AC_INIT([mpich-testsuite],
MPICH_VERSION_m4,
[discuss@mpich.org],
[mpich-testsuite],
[http://www.mpich.org/])
AC_CONFIG_HEADERS([include/mpitestconf.h])
AH_TOP([/*
* Copyright (C) by Argonne National Laboratory
* See COPYRIGHT in top-level directory
*/
#ifndef MPITESTCONF_H_INCLUDED
#define MPITESTCONF_H_INCLUDED
])
AH_BOTTOM([#endif])
VERSION=MPICH_VERSION_m4
AC_SUBST(VERSION)
AC_CONFIG_AUX_DIR([confdb])
AC_CONFIG_MACRO_DIR([confdb])
dnl
echo "RUNNING CONFIGURE FOR MPI TESTS"
AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability-recursive foreign 1.12.3 silent-rules subdir-objects])
AM_MAINTAINER_MODE([enable])
# Non-verbose make by default
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
if test -z "$mpich_top_srcdir" ; then
if test -z "$top_srcdir" ; then
use_top_srcdir=$srcdir
else
use_top_srcdir=$top_srcdir
fi
case "$use_top_srcdir" in
/*) ;;
*)
use_top_srcdir=`(cd $use_top_srcdir && pwd)`
;;
esac
if test -f $use_top_srcdir/../../maint/version.m4 ; then
mpich_top_srcdir=`cd $use_top_srcdir && cd ../.. && pwd`
fi
fi
AC_SUBST(mpich_top_srcdir)
# these (in particular main_top_srcdir) are needed to regenerate
# the f90 files from the f77 files
AC_ARG_VAR([main_top_builddir],[path to the MPICH top-level build directory (if present)])
AC_ARG_VAR([main_top_srcdir],[path to the MPICH top-level source directory (if present)])
# Ensure that main_top_srcdir is set if maintainer mode for is set,
# since some of the Makefile targets require it.
if test "X$main_top_srcdir" = "X" -a "$USE_MAINTAINER_MODE" = "yes" ; then
if test -z "$top_srcdir" ; then
use_top_srcdir=$srcdir
else
use_top_srcdir=$top_srcdir
fi
# Make use_top_srcdir absolute
case "$use_top_srcdir" in
/*) ;;
*)
use_top_srcdir=`(cd $use_top_srcdir && pwd)`
;;
esac
# Now, see if we can find the f77tof90 routine
if test -x $use_top_srcdir/maint/f77tof90 ; then
main_top_srcdir=$use_top_srcdir
else
AC_MSG_ERROR([Unable to find main source file - reconfigure using --disable-maintainer_mode])
fi
fi
AC_ARG_ENABLE(echo,
[AS_HELP_STRING([--enable-echo],[Turn on strong echoing. The default is enable=no.])],
[set -x])
AC_ARG_ENABLE(fortran,
[ --enable-fortran=option - Control the level of Fortran support in the MPICH implementation.
yes|all - Enable all available Fortran implementations (F77, F90, F08)
no|none - No Fortran support
],,[enable_fortran=all])
save_IFS="$IFS"
IFS=","
enable_f77=no
enable_fc=no
enable_f08=no
for option in $enable_fortran ; do
case "$option" in
yes|all)
enable_f77=yes
enable_fc=yes
enable_f08=yes
;;
no|none)
enable_f77=no
enable_fc=no
enable_f08=no
;;
*)
IFS="$save_IFS"
AC_MSG_WARN([Unknown value $option for --enable-fortran])
IFS=","
;;
esac
done
IFS="$save_IFS"
# DTPools switch
AC_ARG_ENABLE([dtpools],
[AS_HELP_STRING([--disable-dtpools],[Disable dtpools tests])],,
[enable_dtpools=yes])
if test "x${enable_dtpools}" = "xyes"; then
DTP_SWITCH="ON"
else
DTP_SWITCH="OFF"
fi
AC_SUBST(DTP_SWITCH)
AC_ARG_ENABLE(cxx,
[AS_HELP_STRING([--enable-cxx],[Turn on C++ tests (default)])],,[enable_cxx=yes])
AC_ARG_ENABLE(romio,
[AS_HELP_STRING([--enable-romio],[Enable ROMIO MPI I/O implementation])],,
[enable_romio=yes])
AC_ARG_ENABLE(spawn,
[AS_HELP_STRING([--enable-spawn],
[Enable tests of the dynamic process parts of MPI-2 (default)])],,
[enable_spawn=yes])
AC_ARG_ENABLE(rma,
[AS_HELP_STRING([--enable-rma],[Enable tests of the one sided parts of MPI-2 (default)])],,
[enable_rma=yes])
AC_ARG_ENABLE(part,
[AS_HELP_STRING([--enable-part],[Enable tests of partitioned communication of MPI-4 (default)])],,
[enable_part=yes])
AC_ARG_ENABLE(long-double-complex,
[AS_HELP_STRING([--enable-long-double-complex],
[Enable tests involving MPI_LONG_DOUBLE_COMPLEX (default)])],,
[enable_long_double_complex=yes])
AC_ARG_ENABLE(long-double,
[AS_HELP_STRING([--enable-long-double-complex],
[Enable tests involving MPI_LONG_DOUBLE and related types (default)])],,
[enable_long_double=yes])
AC_ARG_ENABLE(checkerrors,
[AS_HELP_STRING([--enable-checkerrors],
[Add some tests for checking for errors in user programs])],,
[enable_checkerrors=yes])
AC_ARG_ENABLE(perftest,
[AS_HELP_STRING([--enable-perftest],
[Include tests for basic performance consistency (default)])],,
[enable_perftest=yes])
AC_ARG_ENABLE(large-tests,
[AS_HELP_STRING([--enable-large-tests],
[Enable tests which require large (>2GB per proc) amount of memory])],,
[enable_large_tests=no])
AC_ARG_ENABLE(ft-tests,
[AS_HELP_STRING([--enable-ft-tests],
[Include tests for fault tolerance (default no)])],,
[enable_ft_tests=no])
AC_ARG_ENABLE(comm-overlap-tests,
[AS_HELP_STRING([--enable-comm-overlap-tests],
[Include tests for communicator overlap (default)])],,
[enable_comm_overlap_tests=yes])
AC_ARG_ENABLE(checkfaults,
[AS_HELP_STRING([--enable-checkfaults],
[Add some tests for checking on handling of faults in user programs])],,
[enable_checkfaults=no])
AC_ARG_ENABLE(checkpointing,
[AS_HELP_STRING([--enable-checkpointing],
[Add some tests for checkpointing])],,
[enable_checkpointing=no])
AC_ARG_ENABLE(fast,
[AS_HELP_STRING([--enable-fast],
[Indicates that the MPI implementation may have been
built for fastest operation, such as building without
error checking. Has the effect of
--enable-checkerrors=no])],,)
AC_ARG_ENABLE(strictmpi,
[AS_HELP_STRING([--enable-strictmpi],
[Only test for operations specifically defined by the
MPI standard. This turns off tests for some common
extensions, including for combinations of predefined
datatypes and predefined MPI_Op s.])],,
[enable_strictmpi=no])
AC_ARG_ENABLE(threads,
[--enable-threads=level - Specify the level of thread support expected from the
MPI 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)
multiple - Fully multi-threaded (MPI_THREAD_MULTIPLE)
The default is funneled. If enabled and no level is
specified, the level is set to multiple. If disabled, the
level is set to single. If the environment variable
MPICH_THREAD_LEVEL is set, that thread level is used (this is
to let MPICH build for the correct thread support without
requiring a specific --enable-threads argument.],,
[enable_threads=default])
AC_ARG_ENABLE(xfail,
[AS_HELP_STRING([--enable-xfail],
[Run tests marked for expected failure])],,
[enable_xfail=no])
AC_ARG_ENABLE(gpu-tests-only,
[AS_HELP_STRING([--enable-gpu-tests-only],
[Run only GPU tests])],,
[enable_gpu_tests_only=no])
# DTPools test generation
AC_ARG_WITH(dtpools-datatypes,
[AS_HELP_STRING([--with-dtpools-datatypes=typelist],
[Comma separated list of MPI datatypes to use for DTPools tests
generation. Typelist can be of the form: 'MPI_INT,MPI_DOUBLE,...',
for single element types, 'MPI_INT:4+MPI_DOUBLE:8,...', for multiple
element types, or a combination of both.])],,[with_dtpools_datatypes=MPI_INT,MPI_INT:4+MPI_DOUBLE:8])
# parse args for typegen.sh script
dtp_args="--with-dtpools-datatypes=${with_dtpools_datatypes}"
PAC_CHECK_PYTHON
AC_CONFIG_COMMANDS([gentests],[$srcdir/maint/gentests_dtp.sh $dtp_args],[dtp_args="$dtp_args"])
#Test collectives algorithms with CVARs
cmd="$PYTHON $srcdir/maint/gen_coll_cvar.py"
AC_CONFIG_COMMANDS([collcvartests],[$cmd_gen_coll],[cmd_gen_coll="$cmd"])
AC_ARG_WITH(mpi,
[AS_HELP_STRING([--with-mpi=dir],
[Use the selected MPI; compilation scripts for mpicc,
mpifort and mpicxx should be in dir/bin])],,)
AC_ARG_WITH(pm,
AS_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:gforker"
builds the two process managers hydra and gforker;
only the mpiexec from hydra is installed into the bin
directory.]),,with_pm=default)
if test "$with_pm" = "none" ; then
# add "none" as synonym for "no" to agree with older erroneous docs
with_pm="no"
fi
if test "$MPID_NO_PM" = yes ; then
if test "$with_pm" != "default" -a "$with_pm" != no ; then
AC_MSG_ERROR([The PM chosen ($with_pm) is is not valid for the selected device ($with_device)])
fi
# This is used to change with_pm=default to with_pm=no in the case
# where the device does not want a PM
with_pm=no
fi
if test -z "$with_pm" ; then
with_pm="no"
fi
if test "$with_pmi" = "uni" -a "$with_pm" = "default" ; then
with_pm="no"
fi
if test "$with_pm" = "default" -o "$with_pm" = "yes" ; then
if test ! -z "$MPID_DEFAULT_PM" ; then
with_pm=${MPID_DEFAULT_PM}
else
with_pm=hydra
fi
fi
# Get the first pm specified
if test "$with_pm" != "no" ; then
first_pm="`echo $with_pm | sed -e 's/:.*//' -e 's/,.*//'`"
else
first_pm=""
fi
AC_ARG_WITH(config-args,
[AS_HELP_STRING([--with-config-args=filename],
[Specify configure argument file that contains the
values of variables that configure reads,
e.g. CC,CFLAGS,F77,FFLAGS,FC,FCFLAGS.... If the
filename does not begin with / (absolute path), . or
.. (relative path), the filename will be assumed to be
$top_srcdir/configargs/<filename>.cfg.])],,
[with_config_args=no])
if test "$with_config_args" != "no" ; then
case "$with_config_args" in
/*|../*|./*)
config_args_file="$with_config_args"
;;
*)
config_args_file="$srcdir/configargs/$with_config_args.cfg"
;;
esac
if test -s "$config_args_file" ; then
AC_MSG_RESULT([Reading the configure arguments in ${config_args_file}.])
. $config_args_file
# Export all the variables in $config_args_file
# i.e. CC,CFLAGS, F77/FFLAGS, FC/FCFLAGS, CXX/CXXFLAGS and friends...
config_args_vars=`grep -v '^#' $config_args_file | sed -e 's/=.*//g'`
for var in $config_args_vars ; do
eval value=\$"$var"
echo "Exporting $var=$value ..."
export $var
done
else
AC_MSG_WARN([Non-existent ${config_args_file}.])
fi
fi
# First, determine whether we are/can support the language bindings
#
# Since F90/F90FLAGS are replaced by FC/FCFLAGS, rather than silently
# substituting them, i.e. FC=$F90 and FCFLAGS=$F90FLAGS, we choose to emit
# an error message and abort to avoid any ambiguous/hidden bug in choosing
# Fortran90 compilers.
if test -n "$F90" -o -n "$F90FLAGS" ; then
AC_MSG_ERROR([F90 and F90FLAGS are replaced by FC and FCFLAGS respectively in this configure, please unset F90/F90FLAGS and set FC/FCFLAGS instead and rerun configure again.])
fi
# ------------------------------------------------------------------------
dnl use AC_ARG_VAR to mark FROM_MPICH as "precious" to autoconf so that
dnl automatic re-runs of config.status preserve its value correctly
AC_ARG_VAR([FROM_MPICH],[should be set to "yes" if this configure script is being invoked by the main MPICH configure])
AC_ARG_VAR([MPICH_THREAD_LEVEL],
[the MPI thread level supported by the enclosing MPICH build (when built within MPICH)])
# ------------------------------------------------------------------------
if test "$enable_threads" = "yes" ; then
enable_threads=multiple
elif test "$enable_threads" = "no" ; then
enable_threads=single
elif test "$enable_threads" = default ; then
if test -n "$MPICH_THREAD_LEVEL" ; then
case $MPICH_THREAD_LEVEL in
MPI_THREAD_MULTIPLE)
enable_threads=multiple
;;
MPI_THREAD_SERIALIZED)
enable_threads=serialized
;;
MPI_THREAD_FUNNELED)
enable_threads=funneled
;;
MPI_THREAD_SINGLE)
enable_threads=single
;;
esac
else
enable_threads=funneled
fi
fi
# errordir is substituted into the testlist file as errors when the
# tests should check error handling and as a comment (#) otherwise.
errordir="#"
if test "$enable_checkerrors" = "yes" ; then
errordir=errors
fi
AC_SUBST(errordir)
# The performance tests are not part of the MPI standard
perfdir="perf"
if test "$enable_strictmpi" = "yes" -o "$enable_perftest" = "no" ; then
perfdir="#"
fi
AC_SUBST(perfdir)
# The ft tests are not part of the MPI standard and some of the netmods can't handle them
ftdir="#ft"
if test "$first_pm" = "hydra" -a "$enable_strictmpi" = "no" -a "$enable_ft_tests" = "yes" ; then
ftdir="ft"
fi
AC_SUBST(ftdir)
# Setup "comm_overlap" variable based on whether comm_overlap tests
# are enabled or not
if test "${enable_comm_overlap_tests}" = "yes" ; then
comm_overlap=""
else
comm_overlap="#"
fi
AC_SUBST(comm_overlap)
#
# Only run the threads tests if multiple is specified
if test "$enable_threads" = "multiple" -o "$enable_threads" = "runtime" ; then
threadsdir="threads"
fi
#
# Only run the checkpointing tests if enabled
ckpointdir="#ckpoint"
if test "$enable_checkpointing" = "yes" ; then
ckpointdir="ckpoint"
fi
AC_SUBST(ckpointdir)
#
# Only run xfail tests if enabled
RUN_XFAIL=false
if test "$enable_xfail" = "yes" ; then
RUN_XFAIL=true
fi
AC_SUBST(RUN_XFAIL)
PAC_LOAD_BASE_CACHE
PAC_VPATH_CHECK()
PAC_PROG_MAKE
MPILIBLOC=""
AC_SUBST(MPILIBLOC)
# more variables that must be marked precious for proper re-configure operation
AC_ARG_VAR([MPICH_ENABLE_FC],["yes" if the enclosing MPICH build supports modern Fortran])
AC_ARG_VAR([MPICH_ENABLE_CXX],["yes" if the enclosing MPICH build supports C++])
# If we're building from MPICH, check the MPICH_ENABLE_xxx environment
# variables for enable defaults
if test "$FROM_MPICH" = yes ; then
if test -n "$MPICH_ENABLE_FC" ; then
enable_f77=$MPICH_ENABLE_FC
enable_fc=$MPICH_ENABLE_FC
fi
if test -n "$MPICH_ENABLE_CXX" ; then
enable_cxx=$MPICH_ENABLE_CXX
fi
namepub_tests="#"
if test -n "$nameserv_name" ; then
namepub_tests=""
fi
AC_SUBST(namepub_tests)
fi
# Some MPI-2 implementations (including some of the MPICH shared-memory
# channels and BG/L) leave out the dynamic process routines. This
# allows tests to avoid reporting failure for these routines.
# This can be controlled by either a --disable-spawn argument or by
# setting the environment variable MPI_NO_SPAWN to yes.
AC_ARG_VAR([MPI_NO_SPAWN],[set to "yes" to disable dynamic process tests])
if test "$enable_spawn" = "yes" -a "$MPI_NO_SPAWN" != "yes" ; then
spawndir=spawn
AC_DEFINE(HAVE_MPI_SPAWN,1,[Define if Dynamic Process functionality is available])
fi
AC_SUBST(spawndir)
# Also allow rma to be disabled
AC_ARG_VAR([MPI_NO_RMA],[set to "yes" to disable one-sided tests])
rmadir=rma
if test "$enable_rma" != yes ; then
rmadir="#"
elif test "$MPI_NO_RMA" = yes ; then
rmadir="#"
else
AC_DEFINE(HAVE_MPI_WIN_CREATE,1,[Define if MPI_Win_create is available])
fi
AC_SUBST(rmadir)
# Also allow partitioned communication to be disabled
AC_ARG_VAR([MPI_NO_PART],[set to "yes" to disable partitioned communication tests])
partdir=part
if test "$enable_part" != "yes" -o "$MPI_NO_PART" = "yes" ; then
partdir="#"
fi
AC_SUBST(partdir)
faultsdir=#
if test "$enable_checkfaults" = "yes" ; then
faultsdir=faults
fi
AC_SUBST(faultsdir)
#
MPI_IS_STRICT=false
AC_SUBST(MPI_IS_STRICT)
if test "$enable_strictmpi" = "yes" ; then
MPI_IS_STRICT=true
AC_DEFINE(USE_STRICT_MPI,1,[Define if only operations defined in MPI should be tested])
fi
#
# At this writing, MPICH has many MPIX routines, and the test suite includes
# them. As these are not MPI routines (yet), they are invalid and incorrect
# when this test suite is used for other MPI implementations, including those
# based on earlier versions of MPICH.
MPI_HAS_MPIX=no
#
# Hack to detect build from within MPICH. Ensure strictmpi not selected.
if test "$FROM_MPICH" = "yes" -a "$enable_strictmpi" = "no" ; then
MPI_HAS_MPIX=yes
fi
AC_SUBST(MPI_HAS_MPIX)
# Prepend @mpix@ to lines of tests in testlist.in which are MPIX tests so that
# we can skip running these tests when we do strict MPI test.
mpix="#"
if test "$enable_strictmpi" = "no"; then
mpix=""
fi
AC_SUBST(mpix)
# Use the conditional variable BUILD_MPIX_TESTS to conditionally add MPIX tests
# to noninst_PROGRAMS to skip building the tests when we do strict MPI test
AM_CONDITIONAL([BUILD_MPIX_TESTS], [test "$enable_strictmpi" = "no"])
# preserve these values across a reconfigure
AC_ARG_VAR([WRAPPER_CFLAGS],[])
AC_ARG_VAR([WRAPPER_CPPFLAGS],[])
AC_ARG_VAR([WRAPPER_LDFLAGS],[])
AC_ARG_VAR([WRAPPER_LIBS],[])
AC_ARG_VAR([WRAPPER_FFLAGS],[])
AC_ARG_VAR([WRAPPER_FCFLAGS],[])
AC_ARG_VAR([WRAPPER_CXXFLAGS],[])
# Attach program prefix and suffix to executable names
PAC_GET_EXENAME("mpicc", MPICC_NAME)
PAC_GET_EXENAME("mpif77", MPIF77_NAME)
PAC_GET_EXENAME("mpifort", MPIFORT_NAME)
PAC_GET_EXENAME("mpicxx", MPICXX_NAME)
PAC_GET_EXENAME("mpiexec", MPIEXEC_NAME)
if test "$FROM_MPICH" = "yes" ; then
# perform configure tests with the normal compilers ($CC/$F77/etc), but use
# the WRAPPER_xFLAGS computed by MPICH as our flags instead. Then at the
# end of configure we will empty out these flags and set our compilers to
# the installed compiler wrappers
CFLAGS="$WRAPPER_CFLAGS"
CPPFLAGS="$WRAPPER_CPPFLAGS"
LDFLAGS="$WRAPPER_LDFLAGS"
FFLAGS="$WRAPPER_FFLAGS"
FCFLAGS="$WRAPPER_FCFLAGS"
CXXFLAGS="$WRAPPER_CXXFLAGS"
# WRAPPER_LIBS contains currently non-existent libs like "-lopa" and "-lmpl"
# right now, so set LIBS to the user-specified libs for now.
# FIXME Does this need to be an AC_ARG_VAR?
LIBS="$MPICH_LIBS"
elif test -n "$with_mpi" ; then
if test -z "$MPICC" ; then
CC=$with_mpi/bin/$MPICC_NAME
else
CC=$MPICC
fi
if test -z "$MPIF77" ; then
F77=$with_mpi/bin/$MPIF77_NAME
else
F77=$MPIF77
fi
if test -z "$MPIFC" ; then
FC=$with_mpi/bin/$MPIFORT_NAME
else
FC=$MPIFC
fi
if test -z "$MPICXX" ; then
CXX=$with_mpi/bin/$MPICXX_NAME
else
CXX=$MPICXX
fi
if test -z "$MPIEXEC" ; then
MPIEXEC=$with_mpi/bin/$MPIEXEC_NAME
fi
else
# Try to use mpicc etc names
if test -z "$MPICC" ; then
AC_PATH_PROG(MPICC,$MPICC_NAME mpcc)
fi
if test "x$MPICC" != "x" ; then
CC=$MPICC
fi
if test -z "$MPIF77" ; then
AC_PATH_PROG(MPIF77,$MPIF77_NAME mpf77)
fi
if test "x$MPIF77" != "x" ; then
F77=$MPIF77
fi
if test -z "$MPIFC" ; then
AC_PATH_PROG(MPIFC,$MPIFORT_NAME mpftn)
fi
if test "x$MPIFC" != "x" ; then
FC=$MPIFC
fi
if test -z "$MPICXX" ; then
# We left mpiCC off of this list because mpicc and mpiCC are the
# same on Mac OSX systems.
AC_PATH_PROG(MPICXX,$MPICXX_NAME mpCC)
fi
if test "x$MPICXX" != "x" ; then
CXX=$MPICXX
fi
if test -z "$MPIEXEC" ; then
AC_PATH_PROG(MPIEXEC,$MPIEXEC_NAME)
fi
fi
# Make sure we export CC before configuring DTPools, since MPI is
# needed to build the library.
export CC
AC_CONFIG_SUBDIRS([dtpools])
# Running C compiler tests
AC_PROG_CC
AC_PROG_CC_C99
AM_PROG_CC_C_O
# Note that some versions of autoconf will insist that the compiler
# produce executables at this point, which is why we must do something
# special for building within MPICH
# Ensure that we can compile an MPI program before we go any further
# We don't use a cached value here because this is a sanity check
# The exception is if we are executing this configure from within the
# MPICH configure - in that case, the
if test "$FROM_MPICH" != "yes" ; then
AC_MSG_CHECKING([whether we can compile and link MPI programs in C])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([#include "mpi.h"],[MPI_Init(0,0);MPI_Finalize();])
],[mpi_compile_works=yes],[mpi_compile_works=no])
AC_MSG_RESULT($mpi_compile_works)
if test "$mpi_compile_works" != "yes" ; then
AC_MSG_ERROR([Unable to compile and/or link an MPI program! Check config.log])
fi
fi
dnl We cannot use AC_C_LONG_DOUBLE
dnl because it does not support cross-compilation. Instead, we use the
dnl same test in the MPICH configure.
# Check on support for long double and long long types. Do this before the
# structure alignment test because it will test for including those
# types as well
#
# If --disable-long-double is selected, then bypass this test.
# Some MPI implementations may choose to not support long double because
# their C compilers are inconsistent on the length of long double (this
# is the case on the Cray, with Cray, PGI, and GNU not agreeing on the
# size of long double)
if test "$enable_long_double" = "yes" ; then
AC_CACHE_CHECK([whether long double is supported],pac_cv_have_long_double,[
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([],[long double a;])
],[pac_cv_have_long_double=yes],[pac_cv_have_long_double=no])
])
if test "$pac_cv_have_long_double" = "yes" ; then
AC_DEFINE(HAVE_LONG_DOUBLE,1,[Define if long double is supported])
fi
fi
AC_CACHE_CHECK([whether long long is supported],pac_cv_have_long_long,[
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([],[long long a;])
],[pac_cv_have_long_long=yes],[pac_cv_have_long_long=no])
])
if test "$pac_cv_have_long_long" = yes ; then
AC_DEFINE(HAVE_LONG_LONG,1,[Define if compiler supports long long])
fi
#
# Check for const and restrict (used in some of the performance tests)
AC_C_CONST
AC_C_RESTRICT
# not using libtool for the test suite, so no LT_INIT. Instead, test here
# for Library programs
AC_PROG_RANLIB
AM_PROG_AR
# Check for --enable-strict
# NOTE: do this before checking any AC_CHECK_HEADERS, because strict may
# turn on extension macros
PAC_ARG_STRICT
# General headers
dnl AC_CHECK_HEADERS(stdarg.h unistd.h string.h stdlib.h memory.h stdint.h)
dnl unistd.h string.h stdlib.h memory.h stdint.h are checked by AC_PROG_CC.
AC_CHECK_HEADERS(stdarg.h sys/time.h sys/resource.h)
# check if we need declarations
AC_CHECK_FUNCS(strdup)
if test "$ac_cv_func_strdup" = "yes" ; then
PAC_FUNC_NEEDS_DECL([#include <string.h>],strdup)
fi
AC_CHECK_FUNCS(usleep)
if test "$ac_cv_func_usleep" = "yes" ; then
PAC_FUNC_NEEDS_DECL([#include <unistd.h>],usleep)
fi
# Check for fixed width types
AC_TYPE_INT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
# Check for availability of C99 types
AC_CHECK_TYPES([_Bool, float _Complex, double _Complex, long double _Complex])
AC_CHECK_SIZEOF(void *,8)
# Start of GPU libs check
have_gpu="no"
PAC_PUSH_FLAG([CPPFLAGS])
PAC_PUSH_FLAG([LDFLAGS])
PAC_PUSH_FLAG([LIBS])
# Check CUDA availability
PAC_CHECK_HEADER_LIB_OPTIONAL([cuda],[cuda_runtime_api.h],[cudart],[cudaStreamSynchronize])
cuda_CPPFLAGS=""
cuda_LDFLAGS=""
cuda_LIBS=""
if test "X${pac_have_cuda}" = "Xyes" ; then
AC_DEFINE([HAVE_CUDA],[1],[Define if CUDA is available])
have_gpu="yes"
if test -n "${with_cuda}" -a "$with_cuda" != "no" ; then
cuda_CPPFLAGS="-I${with_cuda}/include"
if test -d ${with_cuda}/lib64 ; then
cuda_LDFLAGS="-L${with_cuda}/lib64 -L${with_cuda}/lib"
else
cuda_LDFLAGS="-L${with_cuda}/lib"
fi
fi
cuda_LIBS="-lcudart"
fi
AM_CONDITIONAL([HAVE_CUDA],[test "X${pac_have_cuda}" = "Xyes"])
AC_SUBST([cuda_CPPFLAGS])
AC_SUBST([cuda_LDFLAGS])
AC_SUBST([cuda_LIBS])
if test "$have_gpu" = "no" ; then
# Check Level Zero availability when no other GPU library is available
PAC_CHECK_HEADER_LIB_OPTIONAL([ze],[level_zero/ze_api.h],[ze_loader],[zeInit])
ze_CPPFLAGS=""
ze_LDFLAGS=""
ze_LIBS=""
if test "X${pac_have_ze}" = "Xyes" ; then
AC_DEFINE([HAVE_ZE],[1],[Define if ZE is available])
have_gpu="yes"
if test -n "${with_ze}" -a "$with_ze" != "no" ; then
ze_CPPFLAGS="-I${with_ze}/include"
if test -d ${with_ze}/lib64 ; then
ze_LDFLAGS="-L${with_ze}/lib64 -L${with_ze}/lib"
else
ze_LDFLAGS="-L${with_ze}/lib"
fi
fi
ze_LIBS="-lze_loader"
fi
AC_SUBST([ze_CPPFLAGS])
AC_SUBST([ze_LDFLAGS])
AC_SUBST([ze_LIBS])
fi
AM_CONDITIONAL([HAVE_ZE],[test "X${pac_have_ze}" = "Xyes"])
# Check HIP availability
if test "$have_gpu" = "no" ; then
AC_DEFINE([__HIP_PLATFORM_AMD__],[1],[AMD GPU HIP available])
PAC_CHECK_HEADER_LIB_OPTIONAL([hip],[hip/hip_runtime_api.h],[amdhip64],[hipStreamSynchronize])
hip_CPPFLAGS=""
hip_LDFLAGS=""
hip_LIBS=""
if test "X$pac_have_hip" = "Xyes" ; then
AC_DEFINE([HAVE_HIP],[1],[Define if HIP is available])
have_gpu="yes"
if test -n "${with_hip}" -a "$with_hip" != "no" ; then
hip_CPPFLAGS="-I${with_hip}/include"
if test -d ${with_hip}/lib64 ; then
hip_LDFLAGS="-L${with_hip}/lib64 -L${with_hip}/lib"
else
hip_LDFLAGS="-L${with_hip}/lib"
fi
fi
hip_LIBS="-lamdhip64"
fi
AC_SUBST([hip_CPPFLAGS])
AC_SUBST([hip_LDFLAGS])
AC_SUBST([hip_LIBS])
fi
AM_CONDITIONAL([HAVE_HIP],[test "X${pac_have_hip}" = "Xyes"])
PAC_POP_FLAG([CPPFLAGS])
PAC_POP_FLAG([LDFLAGS])
PAC_POP_FLAG([LIBS])
AM_CONDITIONAL([HAVE_GPU], [test $have_gpu = "yes"])
# GPU only tests
if test $have_gpu = "no" -a $enable_gpu_tests_only = "yes" ; then
AC_MSG_ERROR([GPU only test configuration requires GPU library (CUDA or LevelZero)])
fi
AM_CONDITIONAL([GPU_ONLY], [test $enable_gpu_tests_only = "yes"])
# End of GPU libs Check
# for tests that require large mem
largetest="#"
if test "$enable_large_tests" = "yes" -a $ac_cv_sizeof_void_p -ge 8; then
largetest=""
fi
AC_SUBST(largetest)
# Enable device specific tests in impls/mpich
ch3_tests="#"
ch4_tests="#"
case $with_device in
ch3*)
ch3_tests=""
;;
ch4*)
ch4_tests=""
;;
esac
ch4_ucx_tests="#"
ch4_ofi_tests="#"
case $with_device in
ch4:ucx*)
ch4_ucx_tests=""
;;
ch4:ofi*)
ch4_ofi_tests=""
;;
esac
AC_SUBST(ch3_tests)
AC_SUBST(ch4_tests)
AC_SUBST(ch4_ucx_tests)
AC_SUBST(ch4_ofi_tests)
# Only run the long double complex tests if that type is available
if test "x$enable_long_double" = "xyes" && \
test "x$enable_long_double_complex" = "xyes" && \
test "x$ac_cv_type_long_double__Complex" = "xyes" ; then
AC_DEFINE(USE_LONG_DOUBLE_COMPLEX,1,[Define if tests with long double complex should be included])
fi
# extra libraries may be necessary on some platforms (solaris) for spawn/join
if test "$spawndir" = "spawn" ; then
PAC_PUSH_FLAG(LIBS)
AC_SEARCH_LIBS(socket,socket,socklib=$LIBS)
PAC_POP_FLAG(LIBS)
PAC_PUSH_FLAG(LIBS)
AC_SEARCH_LIBS(gethostbyname,nsl,nslib=$LIBS)
PAC_POP_FLAG(LIBS)
AC_SUBST(socklib)
AC_SUBST(nslib)
fi
PAC_ARG_THREAD_PACKAGE
THREAD_PACKAGE_NAME=THREAD_PACKAGE_INVALID
threadlib=""
case $with_thread_package in
yes|posix|pthreads|solaris|uti)
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_LIB([pthread],[pthread_key_create],[threadlib="-lpthread"])
THREAD_PACKAGE_NAME=THREAD_PACKAGE_POSIX
;;
win|windows)
with_thread_package=win
THREAD_PACKAGE_NAME=THREAD_PACKAGE_WIN
AC_MSG_ERROR([The 'win' thread package is not supported via autoconf builds at this time.])
;;
abt|argobots)
with_thread_package=argobots
PAC_CHECK_HEADER_LIB_FATAL([argobots], [abt.h], [abt], [ABT_key_create])
threadlib="-labt"
THREAD_PACKAGE_NAME=THREAD_PACKAGE_ARGOBOTS
;;
no|none)
with_thread_package=none
THREAD_PACKAGE_NAME=THREAD_PACKAGE_NONE
;;
*)
AC_MSG_ERROR([The specified thread package, $with_thread_package, is not supported.])
;;
esac
# Define and export the selected thread library so that other packages
# know what's used
AC_DEFINE_UNQUOTED([THREAD_PACKAGE_NAME],[$THREAD_PACKAGE_NAME],[set to the name of the thread package])
AC_SUBST(threadlib)
# Check for h_addr or h_addr_list. This is needed for the singjoin test
# in manual/singjoin.c
AC_CACHE_CHECK([whether struct hostent contains h_addr_list],
dnl Use Double quote LANG_PROGRAM
dnl so [] in h_addr_list[0] won't be ignored by IFELSE.
pac_cv_have_haddr_list,[
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([#include <netdb.h>],[[
struct hostent hp;
hp.h_addr_list[0]=0;
]])
],[pac_cv_have_haddr_list=yes],[pac_cv_have_haddr_list=no])
])
if test "$pac_cv_have_haddr_list" = "yes" ; then
AC_DEFINE(HAVE_H_ADDR_LIST,1,[Define if struct hostent contains h_addr_list])
fi
AC_CHECK_FUNCS(getrusage)
# Check for the MPI Version. This test assumes at least MPI 2.0. For
# some tests, we need to know if we are MPI 2.1 or MPI 2.2,
# particularly for new routines in Fortran
if test "$FROM_MPICH" != "yes" ; then
AC_CACHE_CHECK([that MPI program can be compiled],pac_cv_mpi_compile_ok,[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include "mpi.h"],[MPI_Init(0,0);MPI_Finalize();])],pac_cv_mpi_compile_ok=yes,pac_cv_mpi_compile_ok=no)])
if test "$pac_cv_mpi_compile_ok" != yes ; then
AC_MSG_ERROR([Unable to compile an MPI program containing mpi.h!])
fi
AC_CACHE_CHECK([for major version of MPI],pac_cv_mpi_major_version,[
for pac_cv_mpi_major_version in 3 2 1 unknown ; do
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include "mpi.h"],[
#if MPI_VERSION == $pac_cv_mpi_major_version
''' force failure '''
#endif])],,break)
done
])
AC_CACHE_CHECK([for minor version of MPI],pac_cv_mpi_minor_version,[
for pac_cv_mpi_minor_version in 4 3 2 1 0 unknown ; do
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include "mpi.h"],[
#if MPI_SUBVERSION == $pac_cv_mpi_minor_version
''' force failure '''
#endif])],,break)
done
])
MPI_VERSION=$pac_cv_mpi_major_version
MPI_SUBVERSION=$pac_cv_mpi_minor_version
else
# We are within the MPICH build. Extract the MPI versions from
# mpi.h.in
if test ! -f $mpich_top_srcdir/src/include/mpi.h.in ; then
AC_MSG_ERROR([Could not find the required mpi.h.in file!])
fi
MPI_VERSION=`grep MPI_VERSION $mpich_top_srcdir/src/include/mpi.h.in | \
sed -e 's/#define *MPI_VERSION *\([0-4]\).*/\1/g'`
MPI_SUBVERSION=`grep MPI_SUBVERSION $mpich_top_srcdir/src/include/mpi.h.in | \
sed -e 's/#define *MPI_SUBVERSION *\([0-9]\).*/\1/g'`
fi
AC_SUBST(MPI_VERSION)
AC_SUBST(MPI_SUBVERSION)
# Running Fortran 77 compiler tests
AC_PROG_F77
if test "$enable_f77" = yes ; then
# If there is no working F77, then set enable_f77 to no
if test -z "$F77" ; then
enable_f77=no
fi
fi
# Simple tests for which other languages we can handle.
# Use these only when configuring separate from an MPICH build
f77dir="#"
AC_SUBST(f77dir)
buildingF77=no
if test "$FROM_MPICH" = yes ; then
if test "$enable_f77" = yes ; then
# Assume success
otherlangs="$otherlangs f77"
f77dir=f77
buildingF77=yes
fi
elif test "$enable_f77" = yes ; then
AC_MSG_CHECKING([that we can build MPI programs with Fortran 77])
AC_LANG_PUSH([Fortran 77])
AC_LINK_IFELSE([