-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
775 lines (687 loc) · 23 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
dnl Process this file with autoconf to produce a configure script.
dnl $Id$
dnl These two lines disable the cache.
define([AC_CACHE_LOAD], )
define([AC_CACHE_SAVE], )
AC_INIT([mpiP],[3.3],[mpip-help@googlegroups.com],[mpip])
AC_PREREQ(2.61)
AC_CONFIG_HEADER(mpiPconfig.h)
AC_CONFIG_AUX_DIR(bin)
AC_CANONICAL_TARGET()
AC_PREFIX_DEFAULT(".")
cross_compiling=yes
ac_tool_warned=yes
echo
echo " Note: mpiP sets cross_compiling to yes to keep configure from failing in"
echo " the case where test executables would need to be run as a parallel job."
echo
#
# With specifications
#
AC_ARG_WITH(cc,
AS_HELP_STRING(--with-cc,Gives the name of the C compiler to use.),
CC=$withval
)
AC_ARG_WITH(cxx,
AS_HELP_STRING(--with-cxx,Gives the name of the C++ compiler to use.),
CXX=$withval
)
AC_ARG_WITH(f77,
AS_HELP_STRING(--with-f77,Gives the name of the FORTRAN 77 compiler to use.),
F77=$withval
)
AC_ARG_WITH(include,
AS_HELP_STRING(--with-include,Specifies include directories (-Idir1 -Idir2).),
CPPFLAGS=$withval
echo Using extra include directories: $withval
)
AC_ARG_WITH(ldflags,
AS_HELP_STRING(--with-ldflags,Specifies ld flags (-L/usr/local/lib).),
LDFLAGS=$withval
echo Using ld flags: $withval
)
AC_SUBST(LDFLAGS)
AC_SUBST(CFLAGS)
if test -z "${FFLAGS}" ; then
FFLAGS=${CFLAGS}
fi
AC_SUBST(FFLAGS)
AC_ARG_WITH(libs,
AS_HELP_STRING(--with-libs,Specifies libraries (-llib1 -llib2).),
LIBS=$withval
echo Using extra libraries: $withval
)
AC_ARG_WITH(binutils-dir,
AS_HELP_STRING(--with-binutils-dir,Base directory of binutils installation.),
BINUTILS_DIR=$withval
CPPFLAGS="${CPPFLAGS} -I${BINUTILS_DIR}/include"
LIBS="-L${BINUTILS_DIR}/lib ${LIBS}"
echo Using binutils-dir: $withval
,
BINUTILS_DIR=/usr
)
AC_SUBST(BINUTILS_DIR)
AC_ARG_WITH(libunwind,
AS_HELP_STRING(--with-libunwind,Specify location of libunwind to merge.),
LIBUNWIND_LOC=$withval
echo Using libunwind: $withval
,
LIBUNWIND_LOC=/usr/lib/libunwind.a
)
AC_SUBST(LIBUNWIND_LOC)
AC_ARG_WITH(bin-type-flag,
AS_HELP_STRING(--with-bin-type-flag,Binary format for AIX ar operations.),
BIN_TYPE_FLAG=$withval
echo Using bin-type-flag: $withval
,
BIN_TYPE_FLAG=
)
AC_SUBST(BIN_TYPE_FLAG)
#
# Timer options
#
TIMER_OPTION=no
AC_ARG_WITH(gettimeofday,
AS_HELP_STRING(--with-gettimeofday,Use gettimeofday for timing.),
AC_DEFINE(USE_GETTIMEOFDAY)
USE_GETTIMEOFDAY=true
TIMER_OPTION=yes
,
)
AC_ARG_WITH(wtime,
AS_HELP_STRING(--with-wtime,Use MPI_Wtime for timing.),
AC_DEFINE(USE_WTIME)
TIMER_OPTION=yes
,
)
AC_ARG_WITH(clock_gettime,
AS_HELP_STRING(--with-clock_gettime,Use clock_gettime for timing.),
AC_DEFINE(USE_CLOCK_GETTIME)
USE_CLOCK_GETTIME=yes
TIMER_OPTION=yes
,
)
AC_ARG_WITH(rts_get_timebase,
AS_HELP_STRING(--with-rts_get_timebase,Use rts_get_timebase for timing on BG/L systems (default for BG/L).),
AC_DEFINE(USE_RTS_GET_TIMEBASE)
USE_RTS_GET_TIMEBASE=yes
TIMER_OPTION=yes
,
USE_RTS_TIMEBASE=no
)
AC_ARG_WITH(read_real_time,
AS_HELP_STRING(--with-read_real_time,Use read_real_time for timing on AIX systems (default for AIX).),
AC_DEFINE(USE_READ_REAL_TIME)
USE_READ_REAL_TIME=yes
TIMER_OPTION=yes
,
USE_READ_REAL_TIME=no
)
AC_ARG_WITH(rtc,
AS_HELP_STRING(--with-rtc,Use _rtc for timing on CRAY X1 systems (default for X1).),
AC_DEFINE(USE_RTC)
USE_RTC=yes
TIMER_OPTION=yes
,
USE_RTC=no
)
AC_ARG_WITH(dclock,
AS_HELP_STRING(--with-dclock,Use Catamount dclock for timing.),
AC_DEFINE(USE_DCLOCK)
USE_DCLOCK=yes
TIMER_OPTION=yes
,
USE_DCLOCK=no
)
#
# Enable / Disable specifications
#
DEFAULT_TARGS='${C_TARGET} ${FORTRAN_TARGET} ${DEMANGLE_TARGET}'
ENABLE_API_ONLY=no
AC_ARG_ENABLE(api-only,
AS_HELP_STRING(--enable-api-only,Only build the API library.),
if test x"$enableval" = xyes ; then
ENABLE_API_ONLY=yes
echo Configuring for API library only.
AC_DEFINE(ENABLE_API_ONLY)
DEFAULT_TARGS="API test"
fi
,
)
if test "$ENABLE_API_ONLY" = no ; then
ENABLE_MPI_IO=yes
AC_ARG_ENABLE(mpi-io,
AS_HELP_STRING(--disable-mpi-io,Disable MPI-I/O reporting.),
if test x"$enableval" = xno ; then
ENABLE_MPI_IO=no
echo Profiling of MPI I/O has been disabled.
fi
,
)
AC_SUBST(ENABLE_MPI_IO)
fi
if test x"$ENABLE_API_ONLY" = xno ; then
ENABLE_MPI_RMA=yes
AC_ARG_ENABLE(mpi-rma,
AS_HELP_STRING(--disable-mpi-rma,[Disable MPI RMA reporting.]),
if test x"$enableval" = xno ; then
ENABLE_MPI_RMA=no
echo Profiling of MPI RMA has been disabled.
fi
,
)
AC_SUBST(ENABLE_MPI_RMA)
ENABLE_MPI_NONBLOCKINGCOLLECTIVES=yes
AC_ARG_ENABLE(mpi-nbc,
AS_HELP_STRING(--disable-mpi-nbc,[Disable MPI NONBLOCKINGCOLLECTIVES reporting.]),
if test x"$enableval" = xno ; then
ENABLE_MPI_NONBLOCKINGCOLLECTIVES=no
echo Profiling of MPI NONBLOCKINGCOLLECTIVES has been disabled.
fi
,
)
AC_SUBST(ENABLE_MPI_NONBLOCKINGCOLLECTIVES)
fi
ENABLE_BFD=yes
AC_ARG_ENABLE(bfd,
AS_HELP_STRING(--disable-bfd,Do not use GNU binutils libbfd for source lookup.),
if test x"$enableval" = xno ; then
echo Use of libbfd has been disabled.
ENABLE_BFD=no SO_LOOKUP=no
fi
,
)
DISABLE_LIBUNWIND=no
AC_ARG_ENABLE(libunwind,
AS_HELP_STRING(--disable-libunwind,Do not use libunwind to generate stack traces.),
if test x"$enableval" = xno ; then
DISABLE_LIBUNWIND=yes
echo Use of libunwind has been disabled.
fi
,
)
DISABLE_SO_LOOKUP=no
AC_ARG_ENABLE(so-lookup,
AS_HELP_STRING(--disable-so-lookup,Disable functionality to attempt to find source info in shared objects.),
if test x"$enableval" = xno ; then
DISABLE_SO_LOOKUP=yes
echo Use of shared object source lookup has been disabled.
fi
,
)
USE_SETJMP=no
AC_ARG_ENABLE(setjmp,
AS_HELP_STRING(--enable-setjmp,Use setjmp instead of glic backtrace() to generate stack traces.),
if test x"$enableval" = xyes ; then
USE_SETJMP=yes
AC_DEFINE(USE_SETJMP)
echo Setjmp will be used to generate stack traces.
fi
,
)
AC_ARG_ENABLE(fortranxlate,
AS_HELP_STRING(--disable-fortranxlate,Disable translation of Fortran opaque objects.),
if test "$enable_fortranxlate" = "no" ; then
ENABLE_FORTRAN_XLATE=no
echo Translation of FORTRAN opaque objects has been disabled.
else
ENABLE_FORTRAN_XLATE=yes
echo Translation of FORTRAN opaque objects has been enabled.
fi
,
ENABLE_FORTRAN_XLATE=yes
)
AC_SUBST(ENABLE_FORTRAN_XLATE)
ENABLE_FORTRAN_WEAK_SYMS=no
AC_ARG_ENABLE(fortranweak,
AS_HELP_STRING(--enable-fortranweak,Generate weak symbols for additional Fortran symbol name styles.),
if test "$enable_fortranweak" = "no" ; then
ENABLE_FORTRAN_WEAK_SYMS=no
echo Generation of additional weak FORTRAN symbol names has been disabled.
else
ENABLE_FORTRAN_WEAK_SYMS=yes
AC_DEFINE(ENABLE_FORTRAN_WEAK_SYMS)
echo Generation of additional weak FORTRAN symbol names has been enabled.
fi
,
ENABLE_FORTRAN_WEAK_SYMS=no
)
AC_SUBST(ENABLE_FORTRAN_WEAK_SYMS)
AC_ARG_ENABLE(stackdepth,
AS_HELP_STRING(--enable-stackdepth,Specify maximum stacktrace depth (default is 8).),
STACKDEPTH=$enableval
echo Maximum stacktrace depth is $STACKDEPTH
,
STACKDEPTH=8
)
AC_SUBST(STACKDEPTH)
PC_LOOKUP_FILE=pc_lookup.c
AC_ARG_ENABLE(dwarf,
AS_HELP_STRING(--enable-dwarf,Use DWARF library for source lookup.),
if test x"$enableval" = xyes ; then
echo "Using DWARF library for symbol lookup; forcing --disable-bfd"
ENABLE_BFD=no
PC_LOOKUP_FILE=pc_lookup_dwarf.c
fi ;
USE_LIBDWARF=yes
,
USE_LIBDWARF=no
)
AC_SUBST(USE_LIBDWARF)
AC_SUBST(PC_LOOKUP_FILE)
USE_GETARG=false
AC_ARG_ENABLE(getarg,
AS_HELP_STRING(--enable-getarg,Use getarg to get fortran command line args.),
if test x"$enableval" = xyes ; then
AC_DEFINE(USE_GETARG)
echo Use of getarg has been enabled
USE_GETARG=true
fi
,
)
AC_SUBST(USE_GETARG)
AC_ARG_ENABLE(demangling,
AS_HELP_STRING(--enable-demangling,[Specify GNU, IBM, or Compaq demangling support.]),
DO_DEMANGLE=$enableval
echo $DO_DEMANGLE demangling enabled
,
DO_DEMANGLE=false
)
AC_SUBST(DO_DEMANGLE)
AC_ARG_ENABLE(check-time,
AS_HELP_STRING(--enable-check-time,Enable AIX check for negative time values.),
if test x"$enableval" = xyes ; then
AC_DEFINE(MPIP_CHECK_TIME)
echo AIX negative time value checking has been enabled
fi
,
)
AC_ARG_ENABLE(collective-report-default,
AS_HELP_STRING(--enable-collective-report-default,Have mpiP default to low-memory-use collective report generation as opposed to collecting all data at a single task (see runtime flags -l and -s).),
if test "x$enableval" = xyes ; then
AC_DEFINE(COLLECTIVE_REPORT_DEFAULT)
echo "Using collective report as default."
fi
,
)
AC_DEFINE([DEFAULT_REPORT_FORMAT], [mpiPi_style_verbose])
AC_ARG_ENABLE(concise-report-default,
AS_HELP_STRING(--enable-concise-report-default,Have mpiP default to a concise summary report format. (see runtime flags -c and -v).),
if test "x$enableval" = xyes ; then
AC_DEFINE([DEFAULT_REPORT_FORMAT], [mpiPi_style_concise])
echo "Using concise report as default."
fi
,
)
AC_PROG_INSTALL
AC_PROG_RANLIB
if test "x$AR" = "x"; then
AR=ar
fi
TEST_LIST=
if test "$ENABLE_API_ONLY" = no ; then
AC_CHECK_PROGS(CC, mpxlc mpixlc mpcc_r mpicc cmpicc gcc cc icc, mpicc)
AC_CHECK_PROGS(CXX, mpCC_r mpixlcxx xlC_r mpiCC mpicxx cmpic++ c++ g++ CC cxx icc, mpiCC)
AC_CHECK_PROGS(F77, mpxlf_r mpixlf77 mpxlf mpif77 cmpifc xlf f77 g77 pgf77 fort ifc, mpif77)
AC_CHECK_PROGS(LAUNCH, poe srun prun mpirun, mpirun)
else
AC_CHECK_PROGS(CC, xlc gcc cc icc, mpicc)
AC_CHECK_PROGS(CXX, xlC c++ g++ CC cxx icc, mpiCC)
AC_CHECK_PROGS(F77, xlf f77 g77 pgf77 fort ifc, mpif77)
LAUNCH="\\\"\\\""
TEST_LIST="api-test.exp"
fi
AC_CHECK_LIB(m,sqrt)
# Check for MPI, but also define AC_CHECK_DECL macro, since the next use
# would be within the bfd tests, making AC_CHECK_DECL undefined if not
# checking for bfd.
AC_CHECK_DECL(MPI_Init,,AC_MSG_ERROR(["Failed to find declaration for MPI_Init!"]),[#include "mpi.h"])
SOURCE_LOOKUP=none
if test "x$ENABLE_BFD" = "xyes" ; then
BFD_AUX_LIBS=
AC_SEARCH_LIBS([dlopen], [dl dld]) # newer versions of binutils have a libdl dependency
AC_CHECK_LIB(z,inflate, BFD_AUX_LIBS="$BFD_AUX_LIBS -lz") # newer versions of binutils have a zlib dependency
AC_CHECK_LIB(intl,dcgettext__, BFD_AUX_LIBS="$BFD_AUX_LIBS -lintl") #libintl required only on some platforms, eg AIX
AC_CHECK_LIB(iberty,objalloc_create, BFD_AUX_LIBS="$BFD_AUX_LIBS -liberty")
AC_CHECK_HEADER(bfd.h,
AC_CHECK_LIB(bfd,bfd_openr, LIBS="$LIBS -lbfd", ENABLE_BFD=no, $BFD_AUX_LIBS)
AC_CHECK_DECL(bfd_get_section_size, AC_DEFINE(HAVE_BFD_GET_SECTION_SIZE), ,[#include "bfd.h"])
, ENABLE_BFD=no SO_LOOKUP=no
)
AC_CHECK_TYPE(bfd_boolean, ,AC_DEFINE(HAVE_BFD_BOOLEAN), [#include "bfd.h"])
if test "x$ENABLE_BFD" = "xyes" ; then
AC_CHECK_HEADER(demangle.h, [AC_DEFINE(HAVE_DEMANGLE_H) if test "x$DO_DEMANGLE" = xfalse ; then DO_DEMANGLE=GNU ; fi])
LIBS="$LIBS $BFD_AUX_LIBS"
AC_DEFINE(ENABLE_BFD)
SOURCE_LOOKUP=bfd
fi
else
if test x$USE_LIBDWARF = xyes ; then
AC_CHECK_LIB(elf, elf_begin,
LIBELF_FOUND=yes,
ELFDWARF_ERR="failed to find libelf." ; LIBELF_FOUND=no
)
AC_CHECK_LIB(dwarf, dwarf_init,
LIBDWARF_FOUND=yes,
ELFDWARF_ERR="failed to find libdwarf." ; LIBDWARF_FOUND=no, [-lelf]
)
echo $ECHO_N "checking for libelf/libdwarf..." $ECHO_C
if test x$LIBELF_FOUND = xyes -a x$LIBDWARF_FOUND = xyes ; then
LIBS="${LIBS} -ldwarf -lelf"
AC_DEFINE(USE_LIBDWARF)
echo " found libelf/libdwarf"
SOURCE_LOOKUP=libelf/libdwarf
SO_LOOKUP=no
else
echo " $ELFDWARF_ERR Not using libelf/libdwarf"
fi
fi
fi
if test "$ENABLE_API_ONLY" = no ; then
AC_CHECK_LIB(mpi,MPIR_ToPointer,AC_DEFINE(HAVE_MPIR_TOPOINTER),)
AC_CHECK_LIB(mpich,MPIR_ToPointer,AC_DEFINE(HAVE_MPIR_TOPOINTER),)
fi
# Check for MPI3
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([@%:@include <mpi.h>],
[ #if MPI_VERSION < 3
# error not using MPI3
#endif
])
],
AC_DEFINE(USE_MPI3_CONSTS))
#
# Find an appropriate timer function
#
TIMER_FOUND=no
TIMER_NAME=none
# use rts_get_timebase (BG/L) by default if it exists
if test x$TIMER_FOUND = xno && \
(test x$TIMER_OPTION = xno || test x$USE_RTS_GET_TIMEBASE = xyes); then
AC_CHECK_FUNC(rts_get_timebase, AC_DEFINE(USE_RTS_GET_TIMEBASE)
USE_RTS_GET_TIMEBASE=yes ; TIMER_FOUND=yes ; TIMER_NAME="rts_get_timebase (assuming 700MHz)" ; AC_SUBST(USE_RTS_GET_TIMEBASE)
)
fi
# use _rtc (Cray X1) by default if it exists
if test x$TIMER_FOUND = xno && \
(test x$TIMER_OPTION = xno || test x$USE_RTC = xyes); then
AC_CHECK_DECL(_rtc, AC_DEFINE(USE_RTC)
USE_RTC=yes ; TIMER_FOUND=yes ; TIMER_NAME=_rtc ; AC_SUBST(USE_RTC)
, , [#include <intrinsics.h>])
fi
READ_REAL_TIME=read_real_time
## On AIX, prefer monotonic mread_real_time, if available
if test x$TIMER_FOUND = xno && test x$TIMER_OPTION = xno ; then
AC_CHECK_FUNC(mread_real_time, READ_REAL_TIME=mread_real_time TIMER_FOUND=yes)
if test x$TIMER_FOUND = xyes; then
# In AIX 5.3, finding mread_real_time in libc, but not in header files.
AC_CHECK_DECL(mread_real_time, ,AC_DEFINE(NEED_MREAD_REAL_TIME_DECL),[#include <sys/systemcfg.h>] [#include <sys/time.h>])
else
AC_CHECK_FUNC(read_real_time, READ_REAL_TIME=read_real_time TIMER_FOUND=yes)
fi
if test x$TIMER_FOUND = xyes ; then
TIMER_NAME=$READ_REAL_TIME
fi
fi
# If specified, try to use clock_gettime
if test x$TIMER_FOUND = xno && test "x$USE_CLOCK_GETTIME" = "xyes" ; then
AC_CHECK_LIB(rt,clock_gettime, AC_DEFINE(USE_CLOCK_GETTIME) USE_CLOCK_GETTIME=true TIMER_FOUND=yes TIMER_NAME=clock_gettime LIBS="$LIBS -lrt"
)
fi
# If specified, use dclock
if test x$TIMER_FOUND = xno && test "x$USE_DCLOCK" = "xyes" ; then
AC_DEFINE(USE_DCLOCK) TIMER_FOUND=yes TIMER_NAME=dclock
fi
# If no appropriate timers were found, default to MPI_Wtime
if test x$TIMER_FOUND = xno ; then
AC_CHECK_FUNC(MPI_Wtime, AC_DEFINE(USE_WTIME) TIMER_NAME=MPI_Wtime
, echo Failed to find MPI_Wtime. Trying to use gettimeofday.; AC_DEFINE(USE_GETTIMEOFDAY) USE_GETTIMEOFDAY=true)
fi
UNWIND_WITH=internal
# Not using AC_CHECK_LIB for libunwind as libunwnd API uses macros in libunwind.h to
# access platform-specific functions.
HAVE_LIBUNWIND=no
if test "x$DISABLE_LIBUNWIND" = "xno" ; then
AC_CHECK_HEADER(libunwind.h, AC_DEFINE(HAVE_LIBUNWIND) LIBS="$LIBS -lunwind" HAVE_LIBUNWIND=yes UNWIND_WITH=libunwind,
[ if test x$build_cpu = xx86_64 ; then
echo
echo " mpiP on x86_64 platforms requires libunwind."
echo " Please install libunwind and, if necessary, configure mpiP with "
echo " appropriate CFLAGS and LDFLAGS settings."
echo
exit 1
fi ]
)
fi
if test x"$HAVE_LIBUNWIND" = xno && test x"$USE_SETJMP" = xno ; then
AC_CHECK_FUNC(backtrace, AC_DEFINE(USE_BACKTRACE) UNWIND_WITH=glibc-backtrace, USE_SETJMP=yes)
fi
if test "$ENABLE_API_ONLY" = no && test "$ENABLE_MPI_IO" = yes ; then
AC_CHECK_FUNC(MPI_File_open,
AC_DEFINE(HAVE_MPI_IO) HAVE_MPI_IO=mpi.io.protos.txt,
AC_CHECK_LIB(mpio,MPI_File_open,
AC_DEFINE(HAVE_MPI_IO) HAVE_MPI_IO=mpi.io.protos.txt LIBS="${LIBS} -lmpio",
AC_MSG_RESULT(MPI I/O symbols not found. MPI I/O reporting deactivated.)
HAVE_MPI_IO=/dev/null
ENABLE_MPI_IO=no )
)
else
HAVE_MPI_IO=/dev/null
fi
if test "x$ENABLE_API_ONLY" = xno && test "x$ENABLE_MPI_RMA" = xyes ; then
AC_CHECK_FUNC(MPI_Win_allocate,
AC_DEFINE(HAVE_MPI_RMA) HAVE_MPI_RMA=mpi.rma.protos.txt,
AC_MSG_RESULT([MPI RMA symbols not found. MPI RMA reporting deactivated.])
HAVE_MPI_RMA=/dev/null
ENABLE_MPI_RMA=no
)
else
HAVE_MPI_RMA=/dev/null
fi
if test "x$ENABLE_API_ONLY" = xno && test "x$ENABLE_MPI_NONBLOCKINGCOLLECTIVES" = xyes ; then
AC_CHECK_FUNC(MPI_Ibarrier,
AC_DEFINE(HAVE_MPI_NONBLOCKINGCOLLECTIVES) HAVE_MPI_NONBLOCKINGCOLLECTIVES=mpi.nbc.protos.txt,
AC_MSG_RESULT([MPI NONBLOCKINGCOLLECTIVES symbols not found. MPI NONBLOCKINGCOLLECTIVES reporting deactivated.])
HAVE_MPI_NONBLOCKINGCOLLECTIVES=/dev/null
ENABLE_MPI_NONBLOCKINGCOLLECTIVES=no
)
else
HAVE_MPI_NONBLOCKINGCOLLECTIVES=/dev/null
fi
if test "x$DISABLE_SO_LOOKUP" = "xno" && test "x$ENABLE_BFD" = xyes; then
SO_LOOKUP=no
# Check for /proc/self/maps, can't use AC_CHECK_FILES since cross compiling
AC_MSG_CHECKING(/proc/self/maps)
if test -r /proc/self/maps ; then
AC_MSG_RESULT([yes])
SO_LOOKUP=yes
else
AC_MSG_RESULT([no])
fi
# SO lookup code uses getline, assumes ought to be available if we are using libbfd
if test "x$SO_LOOKUP" = xyes ; then
AC_CHECK_FUNC(getline, AC_DEFINE(SO_LOOKUP), AC_MSG_RESULT([getline not found so SO lookup is disabled.]))
fi
fi
if test "$ENABLE_API_ONLY" = no ; then
if test "$ENABLE_FORTRAN_XLATE" = yes ; then
AC_MSG_CHECKING(fortran to C conversion)
AC_LINK_IFELSE(
[ AC_LANG_PROGRAM([[#include "mpi.h"]],
[[ MPI_Fint mi; MPI_Request ri; ri = MPI_Request_f2c(mi);]] ) ],
[AC_MSG_RESULT([yes])],
(AC_MSG_RESULT( functions not found translation deactivated)
ENABLE_FORTRAN_XLATE=no) )
fi
fi
# If using Fortran routines to access command line,
# test whether get_command_argument is available, otherwise
# use getarg.
FORTRAN_GETARG=""
FORTRAN_GETARG_SRC_FILE=mpiP_getarg.f.part
if test "$USE_GETARG" = true ; then
AC_LANG_PUSH(Fortran 77)
# Force Fortran compiler tests
AC_LINK_IFELSE(AC_LANG_PROGRAM(,,), , )
AC_MSG_CHECKING(fortran command-line argument functions)
AC_LINK_IFELSE(
[ AC_LANG_PROGRAM(,
[[
integer len
character*10 val
call get_command_argument(0, val, len)]] ) ],
AC_MSG_RESULT([using get_command_argument])
echo " call get_command_argument(idx, buf, len)" > $FORTRAN_GETARG_SRC_FILE
FORTRAN_GETARG=$FORTRAN_GETARG_SRC_FILE,
AC_MSG_RESULT(using getarg)
echo " call getarg(idx, buf)" > $FORTRAN_GETARG_SRC_FILE
echo " len = mpipi_get_strlen(buf)" >> $FORTRAN_GETARG_SRC_FILE
FORTRAN_GETARG=$FORTRAN_GETARG_SRC_FILE
AC_SUBST_FILE(FORTRAN_GETARG)
)
AC_LANG_POP(Fortran 77)
fi
if test "$ENABLE_API_ONLY" = no ; then
dnl ========== Find out how FORTRAN symbol names appear in C ==========
AC_MSG_CHECKING(fortran symbols)
if test -n "$F77" -a "$F77" != no ; then
/bin/rm -f ffunc.f flink.c
echo " subroutine f_fun()" > ffunc.f
echo " return" >> ffunc.f
echo " end" >> ffunc.f
if ! $F77 $FFLAGS -c ffunc.f 1>/dev/null 2>/dev/null ; then
AC_MSG_RESULT(Failed to compile fortran test object. Example error follows:)
F77_OBJ_OUT=`$F77 $FFLAGS -c ffunc.f 2>&1`
AC_MSG_NOTICE($F77_OBJ_OUT)
AC_MSG_ERROR([giving up])
fi
echo "main(){ FF(); return 0; }" > flink.c
if $CC -o flink -DFF=f_fun flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
AC_MSG_RESULT(same as C)
F77_SYMBOLS=symbol
elif $CC -o flink -DFF=f_fun_ flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
AC_MSG_RESULT(lowercase with underscore)
F77_SYMBOLS=symbol_
elif $CC -o flink -DFF=f_fun__ flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
AC_MSG_RESULT(lowercase with 2 underscores)
F77_SYMBOLS=symbol__
elif $CC -o flink -DFF=F_FUN flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
AC_MSG_RESULT(uppercase)
F77_SYMBOLS=SYMBOL
elif $CC -o flink -DFF=F_FUN_ flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
AC_MSG_RESULT(uppercase with underscore)
F77_SYMBOLS=SYMBOL_
elif $CC -o flink -DFF=F_FUN_ flink.c ffunc.o $LDFLAGS $LIBS 1>/dev/null 2>/dev/null; then
AC_MSG_RESULT(uppercase with 2 underscores)
F77_SYMBOLS=SYMBOL__
else
AC_MSG_RESULT(could not determine F77 symbol names. Example error follows:)
CC_F77_SYM_OUT=`$CC -o flink -DFF=f_fun flink.c ffunc.o $LDFLAGS $LIBS 2>&1`
AC_MSG_NOTICE($CC_F77_SYM_OUT)
AC_MSG_ERROR([giving up])
fi
/bin/rm -f ffunc.f ffunc.o flink flink.c flink.o ffunc
else
F77_SYMBOLS=symbol_
AC_MSG_RESULT(guessing lowercase with underscore)
fi
AC_SUBST(F77_SYMBOLS)
AC_DEFINE_UNQUOTED(F77_SYMBOLS,$F77_SYMBOLS)
dnl ========== Identify F77 ==========
FORTRAN_GETARG_OBJ_FILE=get_fortran_arg.o
AC_MSG_CHECKING(fortran compiler)
if $F77 -V 2>&1 | grep -e 'Portland Group' 1> /dev/null 2> /dev/null ; then
F77_VENDOR=PGI
MPIPFLIB=mpiPpgf
FORTRAN_FLAG=-DPGI
FORTRAN_TARGET=libmpiPpgf.a
elif echo $F77 2>&1 | grep 'xlf' 1> /dev/null 2> /dev/null ; then
F77_VENDOR=IBM
if test "x$USE_GETARG" = xtrue ; then
MPIPFLIB=mpiPxlf
FORTRAN_TARGET=libmpiPxlf.a
else
MPIPFLIB=mpiP
fi
elif test "x$G77" = xyes ; then
F77_VENDOR=GNU
FORTRAN_FLAG=-DGNU_Fortran
FORTRAN_TARGET=libmpiPg77.a
MPIPFLIB=mpiPg77
elif $F77 -v 2>&1 | grep -e gcc 1> /dev/null 2> /dev/null ; then
F77_VENDOR=GNU
FORTRAN_FLAG=-DGNU_Fortran
FORTRAN_TARGET=libmpiPg77.a
MPIPFLIB=mpiPg77
elif $F77 -V 2>&1 | grep -e Intel 1> /dev/null 2> /dev/null ; then
F77_VENDOR=Intel
FORTRAN_FLAG=
FORTRAN_TARGET=
MPIPFLIB=
elif $F77 -V 2>&1 | grep -e Cray 1>/dev/null 2>/dev/null ; then
F77_VENDOR=Cray
FORTRAN_FLAG=-DCray_Fortran
FORTRAN_TARGET=libmpiPftn.a
MPIPFLIB=mpiPftn
if test "x$USE_GETARG" = xtrue ; then
FORTRAN_GETARG_OBJ_FILE=get_fortran_arg_pxf.o
fi
elif $F77 -version 2>&1 | grep -e Compaq 1> /dev/null 2> /dev/null ; then
F77_VENDOR=Compaq
MPIPFLIB=mpiP
FORTRAN_FLAG=
FORTRAN_TARGET=
else
F77_VENDOR=Unknown
MPIPFLIB=mpiP
FORTRAN_FLAG=
FORTRAN_TARGET=
fi
if test x"$F77_VENDOR" = x"IBM" ; then
FORTRAN_STR_DECL="character (buf_len) buf"
else
FORTRAN_STR_DECL="character buf*(*)"
fi
fi #if test "$ENABLE_API_ONLY" = no ; then
AC_MSG_RESULT($F77_VENDOR)
AC_SUBST(F77_VENDOR,$F77_VENDOR)
AC_SUBST(MPIPFLIB,$MPIPFLIB)
AC_SUBST(FORTRAN_FLAG,$FORTRAN_FLAG)
AC_SUBST(FORTRAN_TARGET,$FORTRAN_TARGET)
AC_SUBST(FORTRAN_STR_DECL, $FORTRAN_STR_DECL)
AC_SUBST(ENABLE_BFD, $ENABLE_BFD)
AC_SUBST(ENABLE_API_ONLY)
AC_SUBST(READ_REAL_TIME)
AC_SUBST(DEFAULT_TARGS)
AC_SUBST(FORTRAN_GETARG_OBJ_FILE)
AC_SUBST(TEST_LIST)
AC_SUBST(USE_BACKTRACE)
AC_SUBST(USE_SETJMP)
AC_SUBST_FILE(HAVE_MPI_IO)
AC_SUBST_FILE(HAVE_MPI_RMA)
AC_SUBST_FILE(HAVE_MPI_NONBLOCKINGCOLLECTIVES)
AC_SUBST_FILE(FORTRAN_GETARG)
if test "x${slibdir}" = x ; then
slibdir=$libdir
fi
AC_SUBST(slibdir)
AC_CONFIG_FILES([Defs.mak Makefile testing/Makefile Check.mak mpiPi.h mpi.protos.txt get_fortran_arg.f mpip_timers/aix_local.h])
AC_OUTPUT
#
# Print out Summary of configuration
#
echo
echo "********************************************************************************"
echo " mpiP Configuration Summary"
echo
echo " C compiler : ${CC}"
echo " Fortran compiler : ${F77}"
echo
echo " Timer : ${TIMER_NAME}"
echo " Stack Unwinding : ${UNWIND_WITH}"
echo " Address to Source Lookup : ${SOURCE_LOOKUP}"
echo
echo " MPI-I/O support : ${ENABLE_MPI_IO}"
echo " MPI-RMA support : ${ENABLE_MPI_RMA}"
echo " MPI-NBC support : ${ENABLE_MPI_NONBLOCKINGCOLLECTIVES}"
echo "********************************************************************************"