ompi-svn-mirror / 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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
#                         University Research and Technology
#                         Corporation.  All rights reserved.
# Copyright (c) 2004-2005 The University of Tennessee and The University
#                         of Tennessee Research Foundation.  All rights
#                         reserved.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 
#                         University of Stuttgart.  All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
#                         All rights reserved.
# $COPYRIGHT$
# 
# Additional copyrights may follow
# 
# $HEADER$
#


############################################################################
# Initialization, version number, and other random setup/init stuff
############################################################################

# Init autoconf

# We don't have the version number to put in here yet, and we can't
# call OMPI_GET_VERSION (etc.) before AC_INIT.  So use the shell
# version.

AC_INIT([Open MPI], 
        [m4_normalize(esyscmd([config/ompi_get_version.sh VERSION --base]))],
        [http://www.open-mpi.org/community/help/], [openmpi])
AC_PREREQ(2.58)
AC_CONFIG_AUX_DIR(./config)
AC_CONFIG_MACRO_DIR(./config)

# Get our platform support file.  This has to be done very, very early
# because it twiddles random bits of autoconf
OMPI_LOAD_PLATFORM

#
# Init automake
#

AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects no-define])

# Make configure depend on the VERSION file, since it's used in AC_INIT
AC_SUBST([CONFIGURE_DEPENDENCIES], ['$(top_srcdir)/VERSION'])

# Get the version of OMPI that we are installing

OMPI_GET_VERSION($srcdir/VERSION, OMPI)

# override/fixup the version numbers set by AC_INIT, since on
# developer builds, there's no good way to know what the version is
# before running configure :(.  We only use the base version number
# (ie, no svn r numbers) for the version set in AC_INIT.  This will
# always match reality because we add the VERSION file (the only way
# to change the major.minor.release{greek}) into the configure
# dependencies.
PACKAGE_VERSION="$OMPI_VERSION"
PACKAGE_STRING="${PACKAGE_NAME} ${PACKAGE_VERSION}"
VERSION="${PACKAGE_VERSION}"

AC_SUBST(OMPI_MAJOR_VERSION)
AC_SUBST(OMPI_MINOR_VERSION)
AC_SUBST(OMPI_RELEASE_VERSION)
AC_SUBST(OMPI_GREEK_VERSION)
AC_SUBST(OMPI_WANT_SVN)
AC_SUBST(OMPI_SVN_R)
AC_SUBST(OMPI_VERSION)

AC_DEFINE_UNQUOTED(OMPI_MAJOR_VERSION, $OMPI_MAJOR_VERSION,
    [Major release number of Open MPI])
AC_DEFINE_UNQUOTED(OMPI_MINOR_VERSION, $OMPI_MINOR_VERSION,
    [Minor release number of Open MPI])
AC_DEFINE_UNQUOTED(OMPI_RELEASE_VERSION, $OMPI_RELEASE_VERSION,
    [Release release number of Open MPI])
AC_DEFINE_UNQUOTED(OMPI_GREEK_VERSION, "$OMPI_GREEK_VERSION",
    [Greek - alpha, beta, etc -  release number of Open MPI])
AC_DEFINE_UNQUOTED(OMPI_VERSION, "$OMPI_RELEASE_VERSION",
    [Complete release number of Open MPI])

# JMS: For the moment, cheat and have ORTE and OPAL version numbers be
# the same.  Someday, they will be 3rd part import packages and have
# their own version numbers

ORTE_MAJOR_VERSION="$OMPI_MAJOR_VERSION"
ORTE_MINOR_VERSION="$OMPI_MINOR_VERSION"
ORTE_RELEASE_VERSION="$OMPI_RELEASE_VERSION"
ORTE_GREEK_VERSION="$OMPI_GREEK_VERSION"
ORTE_WANT_SVN="$OMPI_WANT_SVN"
ORTE_SVN_R="$OMPI_SVN_R"
ORTE_VERSION="$OMPI_VERSION"

AC_SUBST(ORTE_MAJOR_VERSION)
AC_SUBST(ORTE_MINOR_VERSION)
AC_SUBST(ORTE_RELEASE_VERSION)
AC_SUBST(ORTE_GREEK_VERSION)
AC_SUBST(ORTE_WANT_SVN)
AC_SUBST(ORTE_SVN_R)
AC_SUBST(ORTE_VERSION)

AC_DEFINE_UNQUOTED(ORTE_MAJOR_VERSION, $ORTE_MAJOR_VERSION,
    [Major release number of Open RTE])
AC_DEFINE_UNQUOTED(ORTE_MINOR_VERSION, $ORTE_MINOR_VERSION,
    [Minro release number of Open RTE])
AC_DEFINE_UNQUOTED(ORTE_RELEASE_VERSION, $ORTE_RELEASE_VERSION,
    [Release release number of Open RTE])
AC_DEFINE_UNQUOTED(ORTE_GREEK_VERSION, "$ORTE_GREEK_VERSION",
    [Greek - alpha, beta, etc -  release number of Open RTE])
AC_DEFINE_UNQUOTED(ORTE_VERSION, "$ORTE_RELEASE_VERSION",
    [Complete release number of Open RTE])

OPAL_MAJOR_VERSION="$OMPI_MAJOR_VERSION"
OPAL_MINOR_VERSION="$OMPI_MINOR_VERSION"
OPAL_RELEASE_VERSION="$OMPI_RELEASE_VERSION"
OPAL_GREEK_VERSION="$OMPI_GREEK_VERSION"
OPAL_WANT_SVN="$OMPI_WANT_SVN"
OPAL_SVN_R="$OMPI_SVN_R"
OPAL_VERSION="$OMPI_VERSION"

AC_SUBST(OPAL_MAJOR_VERSION)
AC_SUBST(OPAL_MINOR_VERSION)
AC_SUBST(OPAL_RELEASE_VERSION)
AC_SUBST(OPAL_GREEK_VERSION)
AC_SUBST(OPAL_WANT_SVN)
AC_SUBST(OPAL_SVN_R)
AC_SUBST(OPAL_VERSION)

AC_DEFINE_UNQUOTED(OPAL_MAJOR_VERSION, $OPAL_MAJOR_VERSION,
    [Major release number of OPAL])
AC_DEFINE_UNQUOTED(OPAL_MINOR_VERSION, $OPAL_MINOR_VERSION,
    [Minor release number of OPAL])
AC_DEFINE_UNQUOTED(OPAL_RELEASE_VERSION, $OPAL_RELEASE_VERSION,
    [Release release number of OPAL])
AC_DEFINE_UNQUOTED(OPAL_GREEK_VERSION, "$OPAL_GREEK_VERSION",
    [Greek - alpha, beta, etc - release number of OPAL])
AC_DEFINE_UNQUOTED(OPAL_VERSION, "$OPAL_RELEASE_VERSION",
    [Complete release number of OPAL])

#
# Start it up
#

OMPI_CONFIGURE_SETUP
ompi_show_title "Configuring Open MPI"

ompi_show_subtitle "Checking versions"
AC_MSG_CHECKING([Open MPI version])
AC_MSG_RESULT([$OMPI_VERSION])
AC_MSG_CHECKING([Open MPI Subversion repository version])
AC_MSG_RESULT([$OMPI_SVN_R])

AC_MSG_CHECKING([Open Run-Time Environment (ORTE) version])
AC_MSG_RESULT([$ORTE_VERSION])
AC_MSG_CHECKING([ORTE Subversion repository version])
AC_MSG_RESULT([$ORTE_SVN_R])

AC_MSG_CHECKING([Open Portable Access Layer (OPAL) version])
AC_MSG_RESULT([$OPAL_VERSION])
AC_MSG_CHECKING([OPAL Subversion repository version])
AC_MSG_RESULT([$OPAL_SVN_R])

ompi_show_subtitle "Initialization, setup"

#
# GNU C and autotools are inconsistent about whether this is defined
# so let's make it true everywhere for now...
#
AC_GNU_SOURCE

OMPI_TOP_BUILDDIR="`pwd`"
AC_SUBST(OMPI_TOP_BUILDDIR)
cd "$srcdir"
OMPI_TOP_SRCDIR="`pwd`"
AC_SUBST(OMPI_TOP_SRCDIR)
cd "$OMPI_TOP_BUILDDIR"

AC_MSG_NOTICE([builddir: $OMPI_TOP_BUILDDIR])
AC_MSG_NOTICE([srcdir: $OMPI_TOP_SRCDIR])
if test "$OMPI_TOP_BUILDDIR" != "$OMPI_TOP_SRCDIR"; then
    AC_MSG_NOTICE([Detected VPATH build])
fi

# Setup the top of the include/ompi_config.h file

AH_TOP([/* -*- c -*-
 *
 * Copyright (c) 2004-2005 The Trustees of Indiana University.
 *                         All rights reserved.
 * Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
 *                         All rights reserved.
 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 
 *                         University of Stuttgart.  All rights reserved.
 * Copyright (c) 2004-2005 The Regents of the University of California.
 *                         All rights reserved.
 * $COPYRIGHT$
 * 
 * Additional copyrights may follow
 * 
 * $HEADER$
 *
 * Function: - OS, CPU and compiler dependent configuration 
 */

#ifndef OMPI_CONFIG_H
#define OMPI_CONFIG_H
])
AH_BOTTOM([
#include "ompi_config_bottom.h"
#endif /* OMPI_CONFIG_H */
])

# Other basic setup stuff (shared with components)

OMPI_BASIC_SETUP

top_ompi_srcdir="$OMPI_TOP_SRCDIR"
AC_SUBST(top_ompi_srcdir)
top_ompi_builddir="$OMPI_TOP_BUILDDIR"
AC_SUBST(top_ompi_builddir)

############################################################################
# Configuration options
############################################################################

OMPI_CONFIGURE_OPTIONS

############################################################################
# Libtool: part one
# (before C compiler setup)
############################################################################

#
# Part one of libtool magic.  Enable static so that we have the --with
# tests done up here and can check for OS.  Save the values of
# $enable_static and $enable_shared before setting the defaults,
# because if the user specified --[en|dis]able-[static|shared] on the
# command line, they'll already be set.  In this way, we can tell if
# the user requested something or if the default was set here.
#

ompi_enable_shared="$enable_shared"
ompi_enable_static="$enable_static"
AM_ENABLE_SHARED
AM_DISABLE_STATIC

OMPI_SETUP_WRAPPER_INIT


############################################################################
# Check for compilers and preprocessors
############################################################################
ompi_show_title "Compiler and preprocessor tests"

##################################
# C compiler characteristics
##################################

OMPI_SETUP_CC

#
# Check for some types
#

AC_CHECK_TYPES(long long)
AC_CHECK_TYPES(long double)
AC_CHECK_TYPES(int8_t)
AC_CHECK_TYPES(uint8_t)
AC_CHECK_TYPES(int16_t)
AC_CHECK_TYPES(uint16_t)
AC_CHECK_TYPES(int32_t)
AC_CHECK_TYPES(uint32_t)
AC_CHECK_TYPES(int64_t)
AC_CHECK_TYPES(uint64_t)
AC_CHECK_TYPES(intptr_t)
AC_CHECK_TYPES(uintptr_t)
AC_CHECK_TYPES(mode_t)


#
# Check for type sizes
#

AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
if test $ac_cv_type_long_long = yes; then
    AC_CHECK_SIZEOF(long long)
fi
if test $ac_cv_type_long_double = yes; then
    AC_CHECK_SIZEOF(long double)
fi
AC_CHECK_SIZEOF(float)
AC_CHECK_SIZEOF(double)
AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(size_t)

#
# Check for type alignments
#

OMPI_C_GET_ALIGNMENT(char, OMPI_ALIGNMENT_CHAR)
OMPI_C_GET_ALIGNMENT(short, OMPI_ALIGNMENT_SHORT)
OMPI_C_GET_ALIGNMENT(wchar_t, OMPI_ALIGNMENT_WCHAR)
OMPI_C_GET_ALIGNMENT(int, OMPI_ALIGNMENT_INT)
OMPI_C_GET_ALIGNMENT(long, OMPI_ALIGNMENT_LONG)
if test $ac_cv_type_long_long = yes; then
    OMPI_C_GET_ALIGNMENT(long long, OMPI_ALIGNMENT_LONG_LONG)
fi
OMPI_C_GET_ALIGNMENT(float, OMPI_ALIGNMENT_FLOAT)
OMPI_C_GET_ALIGNMENT(double, OMPI_ALIGNMENT_DOUBLE)
if test $ac_cv_type_long_double = yes; then
    OMPI_C_GET_ALIGNMENT(long double, OMPI_ALIGNMENT_LONG_DOUBLE)
fi
OMPI_C_GET_ALIGNMENT(void *, OMPI_ALIGNMENT_VOID_P)

#
# Does the C compiler native support "bool"? (i.e., without
# <stdbool.h> or any other help)
#

AC_MSG_CHECKING(for C bool type)
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
AC_INCLUDES_DEFAULT]],
[[bool bar, foo = true; bar = foo;]]),
[OMPI_NEED_C_BOOL=0 MSG=yes],[OMPI_NEED_C_BOOL=1 MSG=no])
AC_DEFINE_UNQUOTED(OMPI_NEED_C_BOOL, $OMPI_NEED_C_BOOL,
    [Whether the C compiler supports "bool" without any other help (such as <stdbool.h>)])
AC_MSG_RESULT([$MSG])

#
# Check for other compiler characteristics
#

if test "$GCC" = "yes"; then

    # gcc 2.96 will emit oodles of warnings if you use "inline" with
    # -pedantic (which we do in developer builds).  However,
    # "__inline__" is ok.  So we have to force gcc to select the
    # right one.  If you use -pedantic, the AC_C_INLINE test will fail
    # (because it names a function foo() -- without the (void)).  So
    # we turn off all the picky flags, turn on -ansi mode (which is
    # implied by -pedantic), and set warnings to be errors.  Hence,
    # this does the following (for 2.96):
    #
    # - causes the check for "inline" to emit a warning, which then
    # fails
    # - checks for __inline__, which then emits no error, and works
    #
    # This also works nicely for gcc 3.x because "inline" will work on
    # the first check, and all is fine.  :-)

    CFLAGS_save="$CFLAGS"
    CFLAGS="$OMPI_CFLAGS_BEFORE_PICKY -Werror -ansi"
fi
AC_C_INLINE
AC_C_RESTRICT
OMPI_C_WEAK_SYMBOLS
if test "$GCC" = "yes"; then
    CFLAGS="$CFLAGS_save"
fi

if test "x$CC" = "xicc"; then
  OMPI_CHECK_ICC_VARARGS
fi

# If we want the profiling layer:
# - If the C compiler has weak symbols, use those.
# - If not, then set to compile the code again with #define's in a
#   separate directory.

if test "$WANT_WEAK_SYMBOLS" = "0"; then
    OMPI_C_HAVE_WEAK_SYMBOLS=0
fi
if test "$WANT_MPI_PROFILING" = "1"; then
    if test "$OMPI_C_HAVE_WEAK_SYMBOLS" = "1"; then
	OMPI_PROFILING_COMPILE_SEPARATELY=0
    else
	OMPI_PROFILING_COMPILE_SEPARATELY=1
    fi
else
    OMPI_PROFILING_COMPILE_SEPARATELY=0
fi

#
# There are 2 layers to the MPI Language binidings One layer generates
# MPI_* bindings. The other layer generates PMPI_* bindings. The
# following conditions determine whether each (or both) these layers
# are built.
# 1. MPI_* bindings are needed if:
#	- Profiling is not required
#   - Profiling is required but weak symbols are not
#	  supported
# 2. PMPI_* bindings are needed if profiling is required.  Hence we
# define 2 conditionals which tell us whether each of these layers
# need to be built or NOT
#

AM_CONDITIONAL(WANT_MPI_BINDINGS_LAYER,
	test "$WANT_MPI_PROFILING" = 0 -o "$OMPI_PROFILING_COMPILE_SEPARATELY" = 1)

AM_CONDITIONAL(WANT_PMPI_BINDINGS_LAYER,
	test "$WANT_MPI_PROFILING" = 1)
AM_CONDITIONAL(COMPILE_PROFILING_SEPARATELY, 
    test "$OMPI_PROFILING_COMPILE_SEPARATELY" = 1)
AC_DEFINE_UNQUOTED(OMPI_ENABLE_MPI_PROFILING, $WANT_MPI_PROFILING,
    [Whether we want MPI profiling or not])
AC_DEFINE_UNQUOTED(OMPI_HAVE_WEAK_SYMBOLS, $OMPI_C_HAVE_WEAK_SYMBOLS,
    [Wehther we have weak symbols or not])


##################################
# C++ compiler characteristics
##################################

OMPI_SETUP_CXX

# check for type sizes

AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_CHECK_SIZEOF(bool)

# check for type alignments

OMPI_C_GET_ALIGNMENT(bool, OMPI_ALIGNMENT_CXX_BOOL)
AC_LANG_RESTORE

# check if we want C++ support                                                  

AM_CONDITIONAL(WANT_MPI_CXX_BINDINGS,
    test "$WANT_MPI_CXX_SUPPORT" = 1)
AC_DEFINE_UNQUOTED(OMPI_WANT_CXX_BINDINGS, $WANT_MPI_CXX_SUPPORT,
    [Whether we want MPI cxx support or not])
    

##################################
# Assembler Configuration
##################################

ompi_show_subtitle "Assembler" 

AM_PROG_AS
OMPI_CONFIG_ASM


##################################
# Fortran
##################################

OMPI_SETUP_F77
OMPI_F77_FIND_EXT_SYMBOL_CONVENTION($OMPI_F77)

# This allows us to mark bogus types, but still have them be a valid
# [sentinel] value

AC_DEFINE([ompi_fortran_bogus_type_t], [int],
          [A bogus type that allows us to have sentinel type values that are still valid])

# We want to set the #define's for all of these, so invoke the macros
# regardless of whether we have F77 support or not.

OMPI_F77_CHECK(LOGICAL, LOGICAL, logical, yes, 
               [char int int32_t], -1)

OMPI_F77_CHECK(INTEGER, INTEGER, integer, yes,
               [int32_t int int64_r long:long long], -1)
OMPI_F77_CHECK(INTEGER*1, INTEGER1, integer1, no, 
               [char int8_t short int int64_t long:long long], 1)
OMPI_F77_CHECK(INTEGER*2, INTEGER2, integer2, no,
               [short int16_t int32_t int int64_t long:long long], 2)
OMPI_F77_CHECK(INTEGER*4, INTEGER4, integer4, no,
               [int32_t int int64_t long:long long], 4)
OMPI_F77_CHECK(INTEGER*8, INTEGER8, integer8, no,
               [int int64_t long:long long], 8)
OMPI_F77_CHECK(INTEGER*16, INTEGER16, integer16, no,
               [int int64_t long:long long], 16)

OMPI_F77_CHECK(REAL, REAL, real, yes, 
               [float double long:double], -1)
OMPI_F77_CHECK(REAL*4, REAL4, real4, no,
               [float double long:double], 4)
OMPI_F77_CHECK(REAL*8, REAL8, real8, no,
               [float double long:double], 8)
OMPI_F77_CHECK(REAL*16, REAL16, real16, no,
               [float double long:double], 16)

OMPI_F77_CHECK(DOUBLE PRECISION, DOUBLE_PRECISION, double_precision, yes,
               [float double long:double], -1)

OMPI_F77_CHECK(COMPLEX, COMPLEX, [], yes, [], -1)

# The complex*N tests are a bit different (note: the complex tests are
# the same as all the rest, because complex is a composite of two
# reals, which we *have* to have.  It's only the complex*N tests that
# are different).  The fortran complex types are composites of the
# real*(N/2) types.  So for us to support complex*N, two conditions
# must be true:
#
# a) we must support real*(N/2) (i.e., compiler supports it and we
#    have a back-end C type for it)
# b) compiler supports complex*N

OMPI_F77_CHECK(COMPLEX*8, COMPLEX8, [], no, [], 8)
OMPI_F77_CHECK(COMPLEX*16, COMPLEX16, [], no, [], 16)
OMPI_F77_CHECK(COMPLEX*32, COMPLEX32, [], no, [], 32)

# Regardless of whether we have fortran bindings, or even a fortran
# compiler, get the max value for a fortran MPI handle (this macro
# handles the case where we don't have a fortran compiler).

OMPI_F77_GET_FORTRAN_HANDLE_MAX

#
# There are 2 layers to the MPI f77 layer. The only extra thing that
# determine f77 bindings is that fortran can be disabled by user. In
# such cases, we need to not build the target at all.  One layer
# generates MPI_f77* bindings. The other layer generates PMPI_f77*
# bindings. The following conditions determine whether each (or both)
# these layers are built.
#
# Superceeding clause:
#   - fortran77 bindings should be enabled, else everything is
#     disabled
# 1. MPI_f77* bindings are needed if:
#   - Profiling is not required
#   - Profiling is required but weak symbols are not
#     supported
# 2. PMPI_* bindings are needed if profiling is required.  Hence we
# define 2 conditionals which tell us whether each of these layers
# need to be built or NOT
#
AM_CONDITIONAL(WANT_MPI_F77_BINDINGS_LAYER,
               test \( "$WANT_MPI_PROFILING" = 0 -o "$OMPI_PROFILING_COMPILE_SEPARATELY" = 1 \) -a "$OMPI_WANT_F77_BINDINGS" = 1)
                    
AM_CONDITIONAL(WANT_PMPI_F77_BINDINGS_LAYER,
               test "$OMPI_WANT_F77_BINDINGS" = 1 -a "$WANT_MPI_PROFILING" = 1)

#
# Fortran 90 setup
#

OMPI_HAVE_F90_INTEGER1=0
OMPI_HAVE_F90_INTEGER2=0
OMPI_HAVE_F90_INTEGER4=0
OMPI_HAVE_F90_INTEGER8=0
OMPI_HAVE_F90_INTEGER16=0
OMPI_HAVE_F90_REAL4=0
OMPI_HAVE_F90_REAL8=0
OMPI_HAVE_F90_REAL16=0
OMPI_HAVE_F90_COMPLEX8=0
OMPI_HAVE_F90_COMPLEX16=0
OMPI_HAVE_F90_COMPLEX32=0

OMPI_SIZEOF_F90_LOGICAL=0
OMPI_SIZEOF_F90_INT=0
OMPI_SIZEOF_F90_REAL=0
OMPI_SIZEOF_F90_DBLPREC=0
OMPI_SIZEOF_F90_COMPLEX=0
OMPI_SIZEOF_F90_DBLCOMPLEX=0

OMPI_SIZEOF_F90_INT1=0
OMPI_SIZEOF_F90_INT2=0
OMPI_SIZEOF_F90_INT4=0
OMPI_SIZEOF_F90_INT8=0
OMPI_SIZEOF_F90_INT16=0

OMPI_SIZEOF_F90_REAL4=0
OMPI_SIZEOF_F90_REAL8=0
OMPI_SIZEOF_F90_REAL16=0

OMPI_SIZEOF_F90_COMPLEX8=0
OMPI_SIZEOF_F90_COMPLEX16=0
OMPI_SIZEOF_F90_COMPLEX32=0

OMPI_ALIGNMENT_F90_LOGICAL=0
OMPI_ALIGNMENT_F90_INT=0
OMPI_ALIGNMENT_F90_REAL=0
OMPI_ALIGNMENT_F90_DBLPREC=0
OMPI_ALIGNMENT_F90_COMPLEX=0
OMPI_ALIGNMENT_F90_DBLCOMPLEX=0

OMPI_ALIGNMENT_F90_INT1=0
OMPI_ALIGNMENT_F90_INT2=0
OMPI_ALIGNMENT_F90_INT4=0
OMPI_ALIGNMENT_F90_INT8=0
OMPI_ALIGNMENT_F90_INT16=0

OMPI_ALIGNMENT_F90_REAL4=0
OMPI_ALIGNMENT_F90_REAL8=0
OMPI_ALIGNMENT_F90_REAL16=0

OMPI_ALIGNMENT_F90_COMPLEX8=0
OMPI_ALIGNMENT_F90_COMPLEX16=0
OMPI_ALIGNMENT_F90_COMPLEX32=0

OMPI_PRECISION_F90_REAL4=0
OMPI_PRECISION_F90_REAL8=0
OMPI_PRECISION_F90_REAL16=0

OMPI_PRECISION_F90_COMPLEX8=0
OMPI_PRECISION_F90_COMPLEX16=0
OMPI_PRECISION_F90_COMPLEX32=0

OMPI_RANGE_F90_REAL4=0
OMPI_RANGE_F90_REAL8=0
OMPI_RANGE_F90_REAL16=0

OMPI_RANGE_F90_COMPLEX8=0
OMPI_RANGE_F90_COMPLEX16=0
OMPI_RANGE_F90_COMPLEX32=0

OMPI_MPI_OFFSET_KIND=0
OMPI_MPI_ADDRESS_KIND=0

#
# lists of supported Fortran types
#
OMPI_FORTRAN_LKINDS=""
OMPI_FORTRAN_IKINDS=""
OMPI_FORTRAN_RKINDS=""
OMPI_FORTRAN_CKINDS=""


OMPI_SETUP_F90

if test "$OMPI_WANT_F90_BINDINGS" = "0" ; then
    OMPI_SIZEOF_F90_LOGICAL=$ac_cv_sizeof_int
    OMPI_SIZEOF_F90_INT=$ac_cv_sizeof_int
    OMPI_SIZEOF_F90_REAL=$ac_cv_sizeof_float
    OMPI_SIZEOF_F90_DBLPREC=$ac_cv_sizeof_double
else
    # Look for the fortran module compiler flag

    OMPI_F90_FIND_MODULE_INCLUDE_FLAG

    # If we want modern Fortran support, then get supported types and sizes

    # NOTE: Some Fortran compilers actually will return that a type
    # exists even if it doesn't support it -- the compiler will
    # automatically convert the unsupported type to a type that it
    # *does* support.  For example, if you try to use INTEGER*16 and
    # the compiler doesn't support it, it may well automatically
    # convert it to INTEGER*8 for you (!).  So we have to check the
    # actual size of the type once we determine that the compiler
    # doesn't error if we try to use it (i.e,. the compiler *might*
    # support that type).  If the size doesn't match the expected
    # size, then the compiler doesn't really support it.

    OMPI_F90_CHECK_TYPE(integer(selected_int_kind(2)), OMPI_HAVE_F90_INTEGER1)
    if test "$OMPI_HAVE_F90_INTEGER1" = "1"; then
        OMPI_F90_GET_SIZEOF(integer(selected_int_kind(2)), 
                            OMPI_SIZEOF_F90_INT1)
        if test "$OMPI_SIZEOF_F90_INT1" != 1; then
            AC_MSG_WARN([*** Fortran 90 selected_int_kind(2) does not have expected size!])
            AC_MSG_WARN([*** Expected 1, got $OMPI_SIZEOF_F90_INT1])
            AC_MSG_WARN([*** Disabling MPI support for Fortran selected_int_kind(2)])
        else                            
            OMPI_FORTRAN_LKINDS="${OMPI_FORTRAN_LKINDS}1 "
            OMPI_FORTRAN_IKINDS="${OMPI_FORTRAN_IKINDS}1 "

            OMPI_F90_GET_ALIGNMENT(integer(selected_int_kind(2)),
                                   OMPI_ALIGNMENT_F90_INT1)
            OMPI_F90_GET_SIZEOF(logical(selected_int_kind(2)), 
                                OMPI_SIZEOF_F90_LOGICAL)
            OMPI_F90_GET_ALIGNMENT(logical(selected_int_kind(2)),
                                   OMPI_ALIGNMENT_F90_LOGICAL1)
        fi
    fi

    OMPI_F90_CHECK_TYPE(integer(selected_int_kind(4)), OMPI_HAVE_F90_INTEGER2)
    if test "$OMPI_HAVE_F90_INTEGER2" = "1"; then
        OMPI_F90_GET_SIZEOF(integer(selected_int_kind(4)), 
                            OMPI_SIZEOF_F90_INT2)
        if test "$OMPI_SIZEOF_F90_INT2" != 2; then
            AC_MSG_WARN([*** Fortran 90 selected_int_kind(4) does not have expected size!])
            AC_MSG_WARN([*** Expected 2, got $OMPI_SIZEOF_F90_INT2])
            AC_MSG_WARN([*** Disabling MPI support for Fortran selected_int_kind(4)])
        else                            
            OMPI_FORTRAN_LKINDS="${OMPI_FORTRAN_LKINDS}2 "
            OMPI_FORTRAN_IKINDS="${OMPI_FORTRAN_IKINDS}2 "
            OMPI_F90_GET_ALIGNMENT(integer(selected_int_kind(4)),
                                   OMPI_ALIGNMENT_F90_INT2)
            OMPI_F90_GET_SIZEOF(logical(selected_int_kind(4)), 
                                OMPI_SIZEOF_F90_LOGICAL2)
            OMPI_F90_GET_ALIGNMENT(logical(selected_int_kind(4)),
                                   OMPI_ALIGNMENT_F90_LOGICAL2)
        fi
    fi

    OMPI_F90_CHECK_TYPE(integer(selected_int_kind(9)), OMPI_HAVE_F90_INTEGER4)
    if test "$OMPI_HAVE_F90_INTEGER4" = "1"; then
        OMPI_F90_GET_SIZEOF(integer(selected_int_kind(9)),
                            OMPI_SIZEOF_F90_INT4)
        if test "$OMPI_SIZEOF_F90_INT4" != 4; then
            AC_MSG_WARN([*** Fortran 90 selected_int_kind(9) does not have expected size!])
            AC_MSG_WARN([*** Expected 4, got $OMPI_SIZEOF_F90_INT4])
            AC_MSG_WARN([*** Disabling MPI support for Fortran selected_int_kind(9)])
        else                            
            OMPI_FORTRAN_LKINDS="${OMPI_FORTRAN_LKINDS}4 "
            OMPI_FORTRAN_IKINDS="${OMPI_FORTRAN_IKINDS}4 "
            OMPI_F90_GET_ALIGNMENT(integer(selected_int_kind(9)),
                                   OMPI_ALIGNMENT_F90_INT4)
            OMPI_F90_GET_SIZEOF(logical(selected_int_kind(9)),
                                OMPI_SIZEOF_F90_LOGICAL4)
            OMPI_F90_GET_ALIGNMENT(logical(selected_int_kind(9)),
                                   OMPI_ALIGNMENT_F90_LOGICAL4)
        fi
    fi

    OMPI_F90_CHECK_TYPE(integer(selected_int_kind(18)), OMPI_HAVE_F90_INTEGER8)
    if test "$OMPI_HAVE_F90_INTEGER8" = "1"; then
        OMPI_F90_GET_SIZEOF(integer(selected_int_kind(18)), 
                            OMPI_SIZEOF_F90_INT8)
        if test "$OMPI_SIZEOF_F90_INT8" != 8; then
            AC_MSG_WARN([*** Fortran 90 selected_int_kind(18) does not have expected size!])
            AC_MSG_WARN([*** Expected 8, got $OMPI_SIZEOF_F90_INT8])
            AC_MSG_WARN([*** Disabling MPI support for Fortran selected_int_kind(18)])
        else                            
            OMPI_FORTRAN_LKINDS="${OMPI_FORTRAN_LKINDS}8 "
            OMPI_FORTRAN_IKINDS="${OMPI_FORTRAN_IKINDS}8 "
            OMPI_F90_GET_ALIGNMENT(integer(selected_int_kind(18)),
                                   OMPI_ALIGNMENT_F90_INT8)
            OMPI_F90_GET_SIZEOF(logical(selected_int_kind(18)), 
                                OMPI_SIZEOF_F90_LOGICAL8)
            OMPI_F90_GET_ALIGNMENT(logical(selected_int_kind(18)),
                                   OMPI_ALIGNMENT_F90_LOGICAL8)
        fi
    fi

    OMPI_F90_CHECK_TYPE(integer(selected_int_kind(19)),
                        OMPI_HAVE_F90_INTEGER16)
    if test "$OMPI_HAVE_F90_INTEGER16" = "1"; then
        OMPI_F90_GET_SIZEOF(integer(selected_int_kind(19)), 
                            OMPI_SIZEOF_F90_INT16)
        if test "$OMPI_SIZEOF_F90_INT16" != 16; then
            AC_MSG_WARN([*** Fortran 90 selected_int_kind(19) does not have expected size!])
            AC_MSG_WARN([*** Expected 16, got $OMPI_SIZEOF_F90_INT16])
            AC_MSG_WARN([*** Disabling MPI support for Fortran selected_int_kind(19)])
        else                            
            OMPI_FORTRAN_LKINDS="${OMPI_FORTRAN_LKINDS}16 "
            OMPI_FORTRAN_IKINDS="${OMPI_FORTRAN_IKINDS}16 "
            OMPI_F90_GET_ALIGNMENT(integer(selected_int_kind(19)),
                                   OMPI_ALIGNMENT_F90_INT16)
            OMPI_F90_GET_SIZEOF(logical(selected_int_kind(19)), 
                                OMPI_SIZEOF_F90_LOGICAL16)
            OMPI_F90_GET_ALIGNMENT(logical(selected_int_kind(19)),
                                   OMPI_ALIGNMENT_F90_LOGICAL16)
        fi
    fi

    OMPI_F90_CHECK_TYPE(real(selected_real_kind(6)), OMPI_HAVE_F90_REAL4)
    if test "$OMPI_HAVE_F90_REAL4" = "1"; then
        OMPI_F90_GET_SIZEOF(real(selected_real_kind(6)), OMPI_SIZEOF_F90_REAL4)
        if test "$OMPI_SIZEOF_F90_REAL4" != 4; then
            AC_MSG_WARN([*** Fortran 90 selected_real_kind(6) does not have expected size!])
            AC_MSG_WARN([*** Expected 4, got $OMPI_SIZEOF_F90_REAL4])
            AC_MSG_WARN([*** Disabling MPI support for Fortran selected_real_kind(6)])
        else                            
            OMPI_HAVE_F90_COMPLEX8=1
            OMPI_FORTRAN_RKINDS="${OMPI_FORTRAN_RKINDS}4 "
            OMPI_FORTRAN_CKINDS="${OMPI_FORTRAN_CKINDS}4 "
            OMPI_F90_GET_SIZEOF(complex(selected_real_kind(6)),
                                OMPI_SIZEOF_F90_COMPLEX8)
            OMPI_F90_GET_ALIGNMENT(real(selected_real_kind(6)),
                                   OMPI_ALIGNMENT_F90_REAL4)
            OMPI_F90_GET_ALIGNMENT(complex(selected_real_kind(6)),
                                   OMPI_ALIGNMENT_F90_COMPLEX8)
            OMPI_F90_GET_PRECISION(real(selected_real_kind(6)),
                                   OMPI_PRECISION_F90_REAL4)
            OMPI_F90_GET_PRECISION(complex(selected_real_kind(6)),
                                   OMPI_PRECISION_F90_COMPLEX8)
            OMPI_F90_GET_RANGE(real(selected_real_kind(6)),
                               OMPI_RANGE_F90_REAL4)
            OMPI_F90_GET_RANGE(complex(selected_real_kind(6)),
                               OMPI_RANGE_F90_COMPLEX8)
        fi
    fi

    OMPI_F90_CHECK_TYPE(real(selected_real_kind(15)), OMPI_HAVE_F90_REAL8)
    if test "$OMPI_HAVE_F90_REAL8" = "1"; then
        OMPI_F90_GET_SIZEOF(real(selected_real_kind(15)), 
                            OMPI_SIZEOF_F90_REAL8)
        if test "$OMPI_SIZEOF_F90_REAL8" != 8; then
            AC_MSG_WARN([*** Fortran 90 selected_real_kind(15) does not have expected size!])
            AC_MSG_WARN([*** Expected 8, got $OMPI_SIZEOF_F90_REAL8])
            AC_MSG_WARN([*** Disabling MPI support for Fortran selected_real_kind(15)])
        else                            
            OMPI_HAVE_F90_COMPLEX16=1
            OMPI_FORTRAN_RKINDS="${OMPI_FORTRAN_RKINDS}8 "
            OMPI_FORTRAN_CKINDS="${OMPI_FORTRAN_CKINDS}8 "
            OMPI_F90_GET_SIZEOF(complex(selected_real_kind(15)),
                                OMPI_SIZEOF_F90_COMPLEX16)
            OMPI_F90_GET_ALIGNMENT(real(selected_real_kind(15)),
                                OMPI_ALIGNMENT_F90_REAL8)
            OMPI_F90_GET_ALIGNMENT(complex(selected_real_kind(15)),
                                OMPI_ALIGNMENT_F90_COMPLEX16)
            OMPI_F90_GET_PRECISION(real(selected_real_kind(15)),
                                OMPI_PRECISION_F90_REAL8)
            OMPI_F90_GET_PRECISION(complex(selected_real_kind(15)),
                                OMPI_PRECISION_F90_COMPLEX16)
            OMPI_F90_GET_RANGE(real(selected_real_kind(15)),
                            OMPI_RANGE_F90_REAL8)
            OMPI_F90_GET_RANGE(complex(selected_real_kind(15)),
                            OMPI_RANGE_F90_COMPLEX16)
        fi
    fi

    OMPI_F90_CHECK_TYPE(real(selected_real_kind(31)), OMPI_HAVE_F90_REAL16)
    if test "$OMPI_HAVE_F90_REAL16" = "1"; then
        OMPI_F90_GET_SIZEOF(real(selected_real_kind(31)), 
                            OMPI_SIZEOF_F90_REAL16)
        if test "$OMPI_SIZEOF_F90_REAL16" != 16; then
            AC_MSG_WARN([*** Fortran 90 selected_real_kind(31) does not have expected size!])
            AC_MSG_WARN([*** Expected 16, got $OMPI_SIZEOF_F90_REAL16])
            AC_MSG_WARN([*** Disabling MPI support for Fortran selected_real_kind(31)])
        else                            
            OMPI_HAVE_F90_COMPLEX32=1
            OMPI_FORTRAN_RKINDS="${OMPI_FORTRAN_RKINDS}16 "
            OMPI_FORTRAN_CKINDS="${OMPI_FORTRAN_CKINDS}16 "
            OMPI_F90_GET_SIZEOF(complex(selected_real_kind(31)),
                                OMPI_SIZEOF_F90_COMPLEX32)
            OMPI_F90_GET_ALIGNMENT(real(selected_real_kind(31)),
                                OMPI_ALIGNMENT_F90_REAL16)
            OMPI_F90_GET_ALIGNMENT(complex(selected_real_kind(31)),
                                OMPI_ALIGNMENT_F90_COMPLEX32)
            OMPI_F90_GET_PRECISION(real(selected_real_kind(31)),
                                OMPI_PRECISION_F90_REAL16)
            OMPI_F90_GET_PRECISION(complex(selected_real_kind(31)),
                                OMPI_PRECISION_F90_COMPLEX32)
            OMPI_F90_GET_RANGE(real(selected_real_kind(31)),
                                    OMPI_RANGE_F90_REAL16)
            OMPI_F90_GET_RANGE(complex(selected_real_kind(31)),
                            OMPI_RANGE_F90_COMPLEX32)
        fi
    fi

    OMPI_F90_GET_SIZEOF(logical, OMPI_SIZEOF_F90_LOGICAL)
    OMPI_F90_GET_ALIGNMENT(logical, OMPI_ALIGNMENT_F90_LOGICAL)

    OMPI_F90_GET_SIZEOF(integer, OMPI_SIZEOF_F90_INT)
    OMPI_F90_GET_ALIGNMENT(integer, OMPI_ALIGNMENT_F90_INT)

    OMPI_F90_GET_SIZEOF(real, OMPI_SIZEOF_F90_REAL)
    OMPI_F90_GET_ALIGNMENT(real, OMPI_ALIGNMENT_F90_REAL)

    OMPI_F90_GET_SIZEOF(real(kind(1.D0)), OMPI_SIZEOF_F90_DBLPREC)
    OMPI_F90_GET_ALIGNMENT(real(kind(1.D0)), OMPI_ALIGNMENT_F90_DBLPREC)

    OMPI_F90_GET_SIZEOF(complex, OMPI_SIZEOF_F90_COMPLEX)
    OMPI_F90_GET_ALIGNMENT(complex, OMPI_ALIGNMENT_F90_COMPLEX)

    OMPI_F90_GET_SIZEOF(complex(kind(1.D0)), OMPI_SIZEOF_F90_DBLCOMPLEX)
    OMPI_F90_GET_ALIGNMENT(complex(kind(1.D0)), OMPI_ALIGNMENT_F90_DBLCOMPLEX)

    #
    # get values for Fortran MPI_OFFSET_KIND and MPI_ADDRESS_KIND
    #

    OMPI_F90_GET_INT_KIND(18, OMPI_MPI_OFFSET_KIND)

    if test "$ac_cv_sizeof_void_p" = "2"; then
        OMPI_F90_GET_INT_KIND(4, OMPI_MPI_ADDRESS_KIND)
    elif test "$ac_cv_sizeof_void_p" = "4"; then
        OMPI_F90_GET_INT_KIND(9, OMPI_MPI_ADDRESS_KIND)
    elif test "$ac_cv_sizeof_void_p" = "8"; then
        OMPI_F90_GET_INT_KIND(18, OMPI_MPI_ADDRESS_KIND)
    elif test "$ac_cv_sizeof_void_p" = "16"; then
        OMPI_F90_GET_INT_KIND(19, OMPI_MPI_ADDRESS_KIND)
    else
        AC_MSG_ERROR([Cannot support Fortran MPI_ADDRESS_KIND!])
    fi
fi

#
# Substitute everything in
#

AC_SUBST(OMPI_FORTRAN_LKINDS)
AC_SUBST(OMPI_FORTRAN_IKINDS)
AC_SUBST(OMPI_FORTRAN_RKINDS)
AC_SUBST(OMPI_FORTRAN_CKINDS)

AC_SUBST(OMPI_SIZEOF_F90_INT1)
AC_SUBST(OMPI_SIZEOF_F90_INT2)
AC_SUBST(OMPI_SIZEOF_F90_INT4)
AC_SUBST(OMPI_SIZEOF_F90_INT8)
AC_SUBST(OMPI_SIZEOF_F90_INT16)

AC_SUBST(OMPI_SIZEOF_F90_REAL4)
AC_SUBST(OMPI_SIZEOF_F90_REAL8)
AC_SUBST(OMPI_SIZEOF_F90_REAL16)

AC_SUBST(OMPI_SIZEOF_F90_COMPLEX8)
AC_SUBST(OMPI_SIZEOF_F90_COMPLEX16)
AC_SUBST(OMPI_SIZEOF_F90_COMPLEX32)

AC_SUBST(OMPI_MPI_OFFSET_KIND)
AC_SUBST(OMPI_MPI_ADDRESS_KIND)

AC_DEFINE_UNQUOTED(OMPI_HAVE_F90_INTEGER1, $OMPI_HAVE_F90_INTEGER1,
    [support for fortran integer*1])
AC_DEFINE_UNQUOTED(OMPI_HAVE_F90_INTEGER2, $OMPI_HAVE_F90_INTEGER2,
    [support for fortran integer*2])
AC_DEFINE_UNQUOTED(OMPI_HAVE_F90_INTEGER4, $OMPI_HAVE_F90_INTEGER4,
    [support for fortran integer*4])
AC_DEFINE_UNQUOTED(OMPI_HAVE_F90_INTEGER8, $OMPI_HAVE_F90_INTEGER8,
    [support for fortran integer*8])
AC_DEFINE_UNQUOTED(OMPI_HAVE_F90_INTEGER16, $OMPI_HAVE_F90_INTEGER16,
    [support for fortran integer*16])

AC_DEFINE_UNQUOTED(OMPI_HAVE_F90_REAL4, $OMPI_HAVE_F90_REAL4,
    [support for fortran real*4])
AC_DEFINE_UNQUOTED(OMPI_HAVE_F90_REAL8, $OMPI_HAVE_F90_REAL8,
    [support for fortran real*8])
AC_DEFINE_UNQUOTED(OMPI_HAVE_F90_REAL16, $OMPI_HAVE_F90_REAL16,
    [support for fortran real*16])

AC_DEFINE_UNQUOTED(OMPI_HAVE_F90_COMPLEX8, $OMPI_HAVE_F90_COMPLEX8,
    [support for fortran complex*8])
AC_DEFINE_UNQUOTED(OMPI_HAVE_F90_COMPLEX16, $OMPI_HAVE_F90_COMPLEX16,
    [support for fortran complex*16])
AC_DEFINE_UNQUOTED(OMPI_HAVE_F90_COMPLEX32, $OMPI_HAVE_F90_COMPLEX32,
    [support for fortran complex*32])

AC_DEFINE_UNQUOTED(OMPI_SIZEOF_F90_INT1, $OMPI_SIZEOF_F90_INT1,
    [size of fortran integer*1])
AC_DEFINE_UNQUOTED(OMPI_SIZEOF_F90_INT2, $OMPI_SIZEOF_F90_INT2,
    [size of fortran integer*2])
AC_DEFINE_UNQUOTED(OMPI_SIZEOF_F90_INT4, $OMPI_SIZEOF_F90_INT4,
    [size of fortran integer*4])
AC_DEFINE_UNQUOTED(OMPI_SIZEOF_F90_INT8, $OMPI_SIZEOF_F90_INT8,
    [size of fortran integer*8])
AC_DEFINE_UNQUOTED(OMPI_SIZEOF_F90_INT16, $OMPI_SIZEOF_F90_INT16,
    [size of fortran integer*16])

AC_DEFINE_UNQUOTED(OMPI_SIZEOF_F90_REAL4, $OMPI_SIZEOF_F90_REAL4,
    [size of fortran real*4])
AC_DEFINE_UNQUOTED(OMPI_SIZEOF_F90_REAL8, $OMPI_SIZEOF_F90_REAL8,
    [size of fortran real*8])
AC_DEFINE_UNQUOTED(OMPI_SIZEOF_F90_REAL16, $OMPI_SIZEOF_F90_REAL16,
    [size of fortran real*16])

AC_DEFINE_UNQUOTED(OMPI_SIZEOF_F90_COMPLEX8, $OMPI_SIZEOF_F90_COMPLEX8,
    [size of fortran complex*8])
AC_DEFINE_UNQUOTED(OMPI_SIZEOF_F90_COMPLEX16, $OMPI_SIZEOF_F90_COMPLEX16,
    [size of fortran complex*16])
AC_DEFINE_UNQUOTED(OMPI_SIZEOF_F90_COMPLEX32, $OMPI_SIZEOF_F90_COMPLEX32,
    [size of fortran complex*32])

AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_F90_LOGICAL, $OMPI_ALIGNMENT_F90_LOGICAL,
    [Alignment of fortran logical])
AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_F90_INT, $OMPI_ALIGNMENT_F90_INT,
    [Alignment of fortran integer])
AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_F90_REAL, $OMPI_ALIGNMENT_F90_REAL,
    [alignment of fortran real])
AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_F90_DBLPREC, $OMPI_ALIGNMENT_F90_DBLPREC,
    [Alignment of fortran double precision])
AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_F90_COMPLEX, $OMPI_ALIGNMENT_F90_COMPLEX,
    [Alignment of fortran complex])
AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_F90_DBLCOMPLEX,
    $OMPI_ALIGNMENT_F90_DBLCOMPLEX,
    [Alignment of fortran double complex])

AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_F90_INT1, $OMPI_ALIGNMENT_F90_INT1,
    [alignment of fortran integer*1])
AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_F90_INT2, $OMPI_ALIGNMENT_F90_INT2,
    [alignment of fortran integer*2])
AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_F90_INT4, $OMPI_ALIGNMENT_F90_INT4,
    [alignment of fortran integer*4])
AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_F90_INT8, $OMPI_ALIGNMENT_F90_INT8,
    [alignment of fortran integer*8])
AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_F90_INT16, $OMPI_ALIGNMENT_F90_INT16,
    [alignment of fortran integer*16])

AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_F90_REAL4, $OMPI_ALIGNMENT_F90_REAL4,
    [alignment of fortran real*4])
AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_F90_REAL8, $OMPI_ALIGNMENT_F90_REAL8,
    [alignment of fortran real*8])
AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_F90_REAL16, $OMPI_ALIGNMENT_F90_REAL16,
    [alignment of fortran real*16])

AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_F90_COMPLEX8, $OMPI_ALIGNMENT_F90_COMPLEX8,
    [alignment of fortran complex*8])
AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_F90_COMPLEX16, $OMPI_ALIGNMENT_F90_COMPLEX16,
    [alignment of fortran complex*16])
AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_F90_COMPLEX32, $OMPI_ALIGNMENT_F90_COMPLEX32,
    [alignment of fortran complex*32])

AC_DEFINE_UNQUOTED(OMPI_PRECISION_F90_REAL4, $OMPI_PRECISION_F90_REAL4,
    [precision of fortran real*4])
AC_DEFINE_UNQUOTED(OMPI_PRECISION_F90_REAL8, $OMPI_PRECISION_F90_REAL8,
    [precision of fortran real*8])
AC_DEFINE_UNQUOTED(OMPI_PRECISION_F90_REAL16, $OMPI_PRECISION_F90_REAL16,
    [precision of fortran real*16])

AC_DEFINE_UNQUOTED(OMPI_PRECISION_F90_COMPLEX8, $OMPI_PRECISION_F90_COMPLEX8,
    [precision of fortran complex*8])
AC_DEFINE_UNQUOTED(OMPI_PRECISION_F90_COMPLEX16, $OMPI_PRECISION_F90_COMPLEX16,
    [precision of fortran complex*16])
AC_DEFINE_UNQUOTED(OMPI_PRECISION_F90_COMPLEX32, $OMPI_PRECISION_F90_COMPLEX32,
    [precision of fortran complex*32])

AC_DEFINE_UNQUOTED(OMPI_RANGE_F90_REAL4, $OMPI_RANGE_F90_REAL4,
    [range of fortran real*4])
AC_DEFINE_UNQUOTED(OMPI_RANGE_F90_REAL8, $OMPI_RANGE_F90_REAL8,
    [range of fortran real*8])
AC_DEFINE_UNQUOTED(OMPI_RANGE_F90_REAL16, $OMPI_RANGE_F90_REAL16,
    [range of fortran real*16])

AC_DEFINE_UNQUOTED(OMPI_RANGE_F90_COMPLEX8, $OMPI_RANGE_F90_COMPLEX8,
    [range of fortran complex*8])
AC_DEFINE_UNQUOTED(OMPI_RANGE_F90_COMPLEX16, $OMPI_RANGE_F90_COMPLEX16,
    [range of fortran complex*16])
AC_DEFINE_UNQUOTED(OMPI_RANGE_F90_COMPLEX32, $OMPI_RANGE_F90_COMPLEX32,
    [range of fortran complex*32])

# checkpoint results
AC_CACHE_SAVE

##################################
# Header files
##################################

ompi_show_title "Header file tests"

AC_CHECK_HEADERS([alloca.h aio.h arpa/inet.h dirent.h \
    dlfcn.h execinfo.h err.h fcntl.h inttypes.h libgen.h libutil.h \
    net/if.h netdb.h netinet/in.h netinet/tcp.h \
    poll.h pthread.h pty.h pwd.h sched.h stdint.h \
    string.h strings.h stropts.h sys/fcntl.h sys/ipc.h \
    sys/ioctl.h sys/mman.h  sys/param.h sys/queue.h \
    sys/resource.h sys/select.h sys/socket.h sys/sockio.h \
    sys/stat.h sys/statvfs.h sys/time.h sys/tree.h \
    sys/types.h sys/uio.h sys/utsname.h sys/wait.h syslog.h \
    time.h termios.h ulimit.h unistd.h util.h])

# Note that sometimes we have <stdbool.h>, but it doesn't work (e.g.,
# have both Portland and GNU installed; using pgcc will find GNU's
# <stdbool.h>, which all it does -- by standard -- is define "bool" to
# "_Bool" [see
# http://www.opengroup.org/onlinepubs/009695399/basedefs/stdbool.h.html],
# and Portland has no idea what to do with _Bool).

# So first figure out if we have <stdbool.h> (i.e., check the value of
# the macro HAVE_STDBOOL_H from the result of AC_CHECK_HEADERS,
# above).  If we do have it, then check to see if it actually works.
# Define OMPI_USE_STDBOOL_H as approrpaite.
AC_CHECK_HEADERS([stdbool.h], [have_stdbool_h=1], [have_stdbool_h=0])
AC_MSG_CHECKING([if <stdbool.h> works])
if test "$have_stdbool_h" = "1"; then
    AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
AC_INCLUDES_DEFAULT
#if HAVE_STDBOOL_H
#include <stdbool.h>
#endif]], 
[[bool bar, foo = true; bar = foo;]]),
[OMPI_USE_STDBOOL_H=1 MSG=yes],[OMPI_USE_STDBOOL_H=0 MSG=no])
else
    OMPI_USE_STDBOOL_H=0
    MSG="no (don't have <stdbool.h>)"
fi
AC_DEFINE_UNQUOTED(OMPI_USE_STDBOOL_H, $OMPI_USE_STDBOOL_H,
    [Whether to use <stdbool.h> or not])
AC_MSG_RESULT([$MSG])

# checkpoint results
AC_CACHE_SAVE


##################################
# Types
##################################

ompi_show_title "Type tests"

# Size of pid_t
AC_CHECK_SIZEOF(pid_t)

AC_CHECK_TYPES([socklen_t], [AC_DEFINE([HAVE_SOCKLEN_T], [1], 
                                       [Whether we have socklen_t or not])],
               [], [AC_INCLUDES_DEFAULT
#include <sys/socket.h>])

AC_CHECK_TYPES([struct sockaddr_in], [], [], [AC_INCLUDES_DEFAULT
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif])

# SA_RESTART in signal.h
AC_MSG_CHECKING([if SA_RESTART defined in signal.h])
AC_EGREP_CPP(yes, [
#include <signal.h>
#ifdef SA_RESTART
    yes
#endif ], [MSG=yes VALUE=1], [MSG=no VALUE=0])
AC_DEFINE_UNQUOTED(OMPI_HAVE_SA_RESTART, $VALUE, 
    [Whether we have SA_RESTART in <signal.h> or not])
AC_MSG_RESULT([$MSG])

# sa_len in struct sockaddr
AC_MSG_CHECKING([for sa_len in struct sockaddr])
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>], [struct sockaddr s; s.sa_len;],
[MSG=yes VALUE=1], [MSG=no VALUE=0])
AC_DEFINE_UNQUOTED(OMPI_HAVE_SA_LEN, $VALUE,
    [Whether we have the sa_len struct in <sys/socket.h> or not])
AC_MSG_RESULT([$MSG])

AC_CHECK_MEMBERS([struct dirent.d_type], [], [], [
#include <sys/types.h>
#include <dirent.h>])

AC_CHECK_MEMBERS([siginfo_t.si_fd],,,[#include <signal.h>])


# checkpoint results
AC_CACHE_SAVE


##################################
# Libraries
##################################

ompi_show_title "Library and Function tests"

AC_CHECK_LIB([util], [openpty], 
             [WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS -lutil" 
              LIBS="$LIBS -lutil"])

AC_CHECK_LIB([nsl], [gethostbyname],
             [WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS -lnsl"
              LIBS="$LIBS -lnsl"])

AC_CHECK_LIB([socket], [socket], 
             [WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS -lsocket"
              LIBS="$LIBS -lsocket"])

AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf openpty isatty htonl ntohl htons ntohs getpwuid fork waitpid execve pipe setsid mmap])

#
# Make sure we can copy va_lists (need check declared, not linkable)
#

AC_CHECK_DECL(va_copy, OMPI_HAVE_VA_COPY=1, OMPI_HAVE_VA_COPY=0, 
	      [#include <stdarg.h>])
AC_DEFINE_UNQUOTED(OMPI_HAVE_VA_COPY, $OMPI_HAVE_VA_COPY,
    [Whether we have va_copy or not])

AC_CHECK_DECL(__va_copy, OMPI_HAVE_UNDERSCORE_VA_COPY=1,
	      OMPI_HAVE_UNDERSCORE_VA_COPY=0, [#include <stdarg.h>])
AC_DEFINE_UNQUOTED(OMPI_HAVE_UNDERSCORE_VA_COPY, $OMPI_HAVE_UNDERSCORE_VA_COPY,
    [Whether we have __va_copy or not])

AC_CHECK_DECLS(__func__)

#
# Solaris has sched_yield in -lrt.  Can't use a simple AC_CHECK_LIB,
# though, because Linux has sched_yield in glic (so linking in librt
# will "find" sched_yield, even though it would have been found anyway
# -- so -lrt would be useless [and potentially harmful?] in this
# case).
# 

AC_MSG_CHECKING([if we need -lrt for sched_yield])
AC_LINK_IFELSE(AC_LANG_PROGRAM([[extern char *sched_yield;]],
[[char *bar = sched_yield;]]),
[MSG=no],[MSG=not_found])
if test "$MSG" = "not_found"; then
    LIBS_save="$LIBS"
    LIBS="$LIBS -lrt"
    AC_LINK_IFELSE(AC_LANG_PROGRAM([[extern char *sched_yield;]],
[[char *bar = sched_yield;]]),
[MSG=yes],[MSG=not_found])
    if test "$MSG" = "not_found"; then
        LIBS="$LIBS_save"
    fi
fi
AC_MSG_RESULT([$MSG])

# see if we actually have sched_yeild.  Use AC_CHECK_FUNCS so that it
# does the glibs "not implemented" check.  Will use the current LIBS,
# so will check in -lrt if we decided we needed it above
AC_CHECK_FUNCS([sched_yield])

#
# FreeBSD has backtrace in -lexecinfo.  Can't use a simple AC_CHECK_LIB,
# though, because Linux has backtrace in glic (so linking in libexecinfo
# will "find" backtrace, even though it would have been found anyway
# -- so -lexecinfo would be useless [and potentially harmful?] in this
# case).
# 

AC_MSG_CHECKING([if we need -lexecinfo for backtrace])
AC_LINK_IFELSE(AC_LANG_PROGRAM([[extern char *backtrace;]],
[[char *bar = backtrace;]]),
[MSG=no],[MSG=not_found])
if test "$MSG" = "not_found"; then
    LIBS_save="$LIBS"
    LIBS="$LIBS -lexecinfo"
    AC_LINK_IFELSE(AC_LANG_PROGRAM([[extern char *backtrace;]],
[[char *bar = backtrace;]]),
[MSG=yes],[MSG=not_found])
    if test "$MSG" = "not_found"; then
        LIBS="$LIBS_save"
    fi
fi
AC_MSG_RESULT([$MSG])

# see if we actually have backtrace.  Use AC_CHECK_FUNCS so that it
# does the glibs "not implemented" check.  Will use the current LIBS,
# so will check in -lexecinfo if we decided we needed it above
AC_CHECK_FUNCS([backtrace])

#
# See if we need the math library explicitly linked in
#

AC_CHECK_LIB([m], [ceil])

# checkpoint results
AC_CACHE_SAVE


##################################
# System-specific tests
##################################

ompi_show_title "System-specific tests"

#
# Test to determine type of MPI_Offset. This is searched in the following order
# int64_t, long long, long, int. If none of these are 8 bytes, then we should
# search for int32_t, long long, long, int.
#
MPI_OFFSET_TYPE="not found"
MPI_OFFSET_DATATYPE="not found"
AC_MSG_CHECKING([checking for type of MPI_Offset])
if test "$ac_cv_type_long_long" = "yes" -a "$ac_cv_sizeof_long_long" = 8; then
	MPI_OFFSET_TYPE="long long"
        MPI_OFFSET_DATATYPE=MPI_LONG_LONG
        MPI_OFFSET_SIZE=8
elif test "$ac_cv_type_long" = "yes" -a "$ac_cv_sizeof_long" = 8; then
	MPI_OFFSET_TYPE="long"
        MPI_OFFSET_DATATYPE=MPI_LONG
        MPI_OFFSET_SIZE=8
elif test "ac_cv_sizeof_int" = 8; then
	MPI_OFFSET_TYPE=int
        MPI_OFFSET_DATATYPE=MPI_INT
        MPI_OFFSET_SIZE=8
elif test "$ac_cv_type_long_long" = "yes" -a "$ac_cv_sizeof_long_long" = 4; then
	MPI_OFFSET_TYPE="long long"
        MPI_OFFSET_DATATYPE=MPI_LONG_LONG
        MPI_OFFSET_SIZE=4
elif test "$ac_cv_type_long" = "yes" -a "$ac_cv_sizeof_long" = 4; then
	MPI_OFFSET_TYPE="long"
        MPI_OFFSET_DATATYPE=MPI_LONG
        MPI_OFFSET_SIZE=4
elif test "ac_cv_sizeof_int" = 4; then
	MPI_OFFSET_TYPE=int
        MPI_OFFSET_DATATYPE=MPI_INT
        MPI_OFFSET_SIZE=4
fi
AC_MSG_RESULT([$MPI_OFFSET_TYPE])
if test "$MPI_OFFSET_TYPE" = "not found"; then
	AC_MSG_WARN([*** Unable to find the right definition for MPI_Offset])
	AC_MSG_ERROR([Cannot continue])
fi
AC_DEFINE_UNQUOTED(MPI_Offset, $MPI_OFFSET_TYPE, [Type of MPI_Offset])

#
# If we haven't already, figure out an MPI datatype that corresponds
# to the back-end C type of MPI_Offset.
#
AC_MSG_CHECKING([checking for an MPI datatype for MPI_Offset])
AC_MSG_RESULT([$MPI_OFFSET_DATATYPE])
if test "$MPI_OFFSET_DATATYPE" = "not found"; then
	AC_MSG_WARN([*** Unable to find an MPI datatype corresponding to MPI_Offset])
	AC_MSG_ERROR([Cannot continue])
fi
AC_DEFINE_UNQUOTED(OMPI_OFFSET_DATATYPE, $MPI_OFFSET_DATATYPE, [MPI datatype corresponding to MPI_Offset])

# all: endian

AC_WORDS_BIGENDIAN

OMPI_CHECK_BROKEN_QSORT

# all: SYSV semaphores
# all: SYSV shared memory
# all: size of FD_SET
# all: sizeof struct stat members
# all: type of getsockopt optlen
# all: type of recvfrom optlen

#
# Check out what thread support we have
#

OMPI_CONFIG_THREADS
CFLAGS="$CFLAGS $THREAD_CFLAGS"
CXXFLAGS="$CXXFLAGS $THREAD_CXXFLAGS"
CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS"
CXXCPPFLAGS="$CXXCPPFLAGS $THREAD_CXXCPPFLAGS"
LDFLAGS="$LDFLAGS $THREAD_LDFLAGS"
LIBS="$LIBS $THREAD_LIBS"

WRAPPER_EXTRA_CFLAGS="$WRAPPER_EXTRA_CFLAGS $THREAD_CFLAGS"
WRAPPER_EXTRA_CXXFLAGS="$WRAPPER_EXTRA_CXXFLAGS $THREAD_CXXFLAGS"
WRAPPER_EXTRA_FFLAGS="$WRAPPER_EXTRA_FFLAGS $THREAD_FFLAGS"
WRAPPER_EXTRA_FCFLAGS="$WRAPPER_EXTRA_FCFLAGS $THREAD_FFLAGS"
WRAPPER_EXTRA_LDFLAGS="$WRAPPER_EXTRA_LDFLAGS $THREAD_LDFLAGS"
WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS $THREAD_LIBS"

#
# What is the local equivalent of "ln -s"
#

AC_PROG_LN_S

#
# We need as and lex
#
AM_PROG_AS
AM_PROG_LEX

# If we don't have GNU Flex and we don't have a generated .c file
# (distribution tarballs will have the .c file included, but SVN
# checkouts will not), then error.  Must have GNU Flex -- other
# versions of Lex are not workable (all things being equal, since this
# is *only* required for developers, we decided that it really was not
# worth it to be portable between different versions of lex ;-).

if test -z "$LEX" -o -n "`echo $LEX | grep missing`" -o \
    "`basename $LEX`" != "flex"; then
    if test ! -f "$srcdir/opal/util/show_help_lex.c"; then
        AC_MSG_WARN([*** Could not find GNU Flex on your system.])
        AC_MSG_WARN([*** GNU Flex required for developer builds of Open MPI.])
        AC_MSG_WARN([*** Other versions of Lex are not supported.])
        AC_MSG_WARN([*** YOU DO NOT NEED FLEX FOR DISTRIBUTION TARBALLS!])
        AC_MSG_WARN([*** If you absolutely cannot install GNU Flex on this system])
        AC_MSG_WARN([*** consider using a distribution tarball, or generate the])
        AC_MSG_WARN([*** following files on another system (using Flex) and])
        AC_MSG_WARN([*** copy them here:])
        for lfile in `find . -name \*.l -print`; do
            cfile="`echo $lfile | cut -d. -f-2`"
            AC_MSG_WARN([***     $cfile.c])
        done
        AC_MSG_ERROR([Cannot continue])
    fi
fi

#
# File system case sensitivity
#

OMPI_CASE_SENSITIVE_FS_SETUP

# AIX: FIONBIO in sys/ioctl.h
# glibc: memcpy

# checkpoint results
AC_CACHE_SAVE


##################################
# MCA
##################################

ompi_show_title "Modular Component Architecture (MCA) setup" 

AC_MSG_CHECKING([for subdir args])
OMPI_CONFIG_SUBDIR_ARGS([ompi_subdir_args])
AC_MSG_RESULT([$ompi_subdir_args])

OMPI_MCA

# checkpoint results
AC_CACHE_SAVE


############################################################################
# Final top-level OMPI configuration
############################################################################

ompi_show_title "Final top-level OMPI configuration"

############################################################################
# Libevent setup
############################################################################

ompi_show_subtitle "Libevent 3rd party event handler"
CFLAGS_save="$CFLAGS"
CFLAGS="$OMPI_CFLAGS_BEFORE_PICKY"
OMPI_SETUP_LIBEVENT
CFLAGS="$CFLAGS_save"


############################################################################
# Libtool: part two
# (after C compiler setup)
############################################################################

ompi_show_subtitle "Libtool configuration"

# Use convenience libltdl for the moment, because we need to force the
# use of the newest libltdl (i.e., the one that ships with libtool
# 1.5) because it has support for a lot more things than older
# versions of libtool (which are generally installed by default).
AS_IF([test "$OMPI_ENABLE_DLOPEN_SUPPORT" = "1"], 
       [AC_LIBLTDL_CONVENIENCE(opal/libltdl)
        AC_LIBTOOL_DLOPEN])
AC_SUBST(LTDLINCL)
AC_SUBST(LIBLTDL)
AM_PROG_LIBTOOL

# AC_CONFIG_SUBDIRS appears to be broken for non-gcc compilers (i.e.,
# passing precious variables down to the sub-configure).  
#
# Note that we also did some magic scripty-foo in autogen.sh to rename
# the output libtool library "libompi_ltdl", so add -lompi_ltdl here.
# This is because so many systems have older versions of libltdl
# installed very early in ld.so's search path; if we installed our own
# libltdl in some non-standard path (e.g., $HOME/local or even
# /usr/local), the libltdl in /usr/lib might get found first.  And if
# it's older -- or just not matching the version that we need, Bad
# Things happen.  [sigh]
#
# Finally, make libompi_ltdl follow the same shared/static convention
# that was user for the main OMPI libraries.  So manually examine
# $enable_shared and $enable_static and pass down the corresponding
# flags.

ompi_show_subtitle "GNU libltdl setup" 

if test "$OMPI_ENABLE_DLOPEN_SUPPORT" = "1" ; then
    ompi_subdir_args="$ompi_subdir_args --enable-ltdl-convenience --disable-ltdl-install"
    if test "$enable_shared" = "yes"; then
        ompi_subdir_args="$ompi_subdir_args --enable-shared"
    else
        ompi_subdir_args="$ompi_subdir_args --disable-shared"
    fi
    if test "$enable_static" = "yes"; then
        ompi_subdir_args="$ompi_subdir_args --enable-static"
    else
        ompi_subdir_args="$ompi_subdir_args --disable-static"
    fi

    CFLAGS_save="$CFLAGS"
    CFLAGS="$OMPI_CFLAGS_BEFORE_PICKY"
    OMPI_CONFIG_SUBDIR(opal/libltdl, [$ompi_subdir_args], [HAPPY=1], [HAPPY=0])
    if test "$HAPPY" = "1"; then
        LIBLTDL_SUBDIR=libltdl
        LIBLTDL_LTLIB=libltdl/libltdlc.la
        WANT_LIBLTDL=1

        # Arrgh.  This is gross.  But I can't think of any other way to do
        # it.  :-(

        flags="`egrep ^LIBADD_DL opal/libltdl/Makefile | cut -d= -f2-`"
        OMPI_CHECK_LINKER_FLAGS([opal/libltdl/libtool], [-export-dynamic $flags])
        WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS $extra_ldflags"
        LDFLAGS="-export-dynamic $LDFLAGS"
    else
        LIBLTDL_SUBDIR=
        LIBLTDL_LTLIB=
        WANT_LIBLTDL=0
    fi
    CFLAGS="$CFLAGS_save"
else
    AC_MSG_WARN([libltdl support disabled (by --disable-dlopen)])

    LIBLTDL_SUBDIR=
    LIBLTDL_LTLIB=
    WANT_LIBLTDL=0
fi

AC_SUBST(LIBLTDL_SUBDIR)
AC_SUBST(LIBLTDL_LTLIB)
AM_CONDITIONAL(WANT_LIBLTDL, test "$WANT_LIBLTDL" = "1")
AC_DEFINE_UNQUOTED(OMPI_WANT_LIBLTDL, $WANT_LIBLTDL,
    [Whether to include support for libltdl or not])

# Have a variable that can be used to indicate where ltdl.h lives.  Do
# this specifically so that we get the included ltdl.h (which we know
# will work properly with the compiled code, including libltdl), not
# the system one (which is likely to be far too old and buggy).

OPAL_LTDL_CPPFLAGS='-I$(top_srcdir)/opal/libltdl'
AC_SUBST(OPAL_LTDL_CPPFLAGS)

############################################################################
# final compiler config
############################################################################

ompi_show_subtitle "Compiler flags"

#
# This is needed for VPATH builds, so that it will -I the appropriate
# include directory.  We delayed doing it until now just so that
# '-I$(top_srcdir)' doesn't show up in any of the configure output --
# purely aesthetic.
#
# JMS: Someday to remove the -I's for the individual ompi, orte, opal
# directories -- the top-level ones will suffice after all #include's
# throughout the tree are converted to use the full path of our header
# files.
#

CPPFLAGS='-I$(top_srcdir)/include -I$(top_srcdir) -I$(top_builddir) -I$(top_builddir)/include -I$(top_srcdir)/opal -I$(top_srcdir)/orte -I$(top_srcdir)/ompi'" $CPPFLAGS"
CXXCPPFLAGS='-I$(top_srcdir)/include -I$(top_srcdir) -I$(top_builddir) -I$(top_builddir)/include -I$(top_srcdir)/opal -I$(top_srcdir)/orte -I$(top_srcdir)/ompi'" $CXXCPPFLAGS"

#
# Do a final process of the CFLAGS to make a WITHOUT_OPTFLAGS version.
# We need this so that we can guarantee to build the TotalView stuff
# with -g and nothing else.
#

OMPI_MAKE_STRIPPED_FLAGS($CFLAGS)
CFLAGS_WITHOUT_OPTFLAGS="$s_result"
if test "$with_tv_debug_flags" != ""; then
    TOTALVIEW_DEBUG_FLAGS="$with_tv_debug_flags"
else
    TOTALVIEW_DEBUG_FLAGS="-g"
fi
AC_MSG_CHECKING([which of CFLAGS are ok for TotalView modules])
AC_MSG_RESULT([$CFLAGS_WITHOUT_OPTFLAGS])
AC_MSG_CHECKING([extra CFLAGS for TotalView modules])
AC_MSG_RESULT([$TOTALVIEW_DEBUG_FLAGS])

AC_SUBST(CFLAGS_WITHOUT_OPTFLAGS)
AC_SUBST(TOTALVIEW_DEBUG_FLAGS)

#
# Adding LIBMPI_* flags from the components that are necessary to
# compile with libmpi
#
# LIBMPI_EXTRA_LDFLAGS
#
AC_MSG_CHECKING([for libmpi additional LDFLAGS])
OMPI_UNIQ(LIBMPI_EXTRA_LDFLAGS)
AC_SUBST(LIBMPI_EXTRA_LDFLAGS)
AC_DEFINE_UNQUOTED(LIBMPI_EXTRA_LDFLAGS, "$LIBMPI_EXTRA_LDFLAGS",
    [Additional LDFLAGS to compile against libmpi])
AC_MSG_RESULT([$LIBMPI_EXTRA_LDFLAGS])

#
# LIBMPI_EXTRA_LIBS
#
AC_MSG_CHECKING([for libmpi additional LIBS])
AC_SUBST(LIBMPI_EXTRA_LIBS)
AC_DEFINE_UNQUOTED(LIBMPI_EXTRA_LIBS, "$LIBMPI_EXTRA_LIBS",
    [Additional LIBS to compile against libmpi])
AC_MSG_RESULT([$LIBMPI_EXTRA_LIBS])

#
# Delayed the substitution of CFLAGS and CXXFLAGS until now because
# they may have been modified throughout the course of this script.
#

AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(CXXFLAGS)
AC_SUBST(CXXCPPFLAGS)
AC_SUBST(FFLAGS)
AC_SUBST(FCFLAGS)

############################################################################
# final wrapper compiler config
############################################################################

ompi_show_subtitle "Wrapper compiler flags"
OMPI_SETUP_WRAPPER_FINAL

############################################################################
# Party on
############################################################################

ompi_show_subtitle "Final output" 

AM_CONFIG_HEADER([include/ompi_config.h include/mpi.h])
AC_CONFIG_FILES([
    Makefile

    config/Makefile

    include/Makefile
    include/mpif.h

    etc/Makefile
    contrib/Makefile

    opal/Makefile
    opal/include/Makefile
    opal/include/sys/Makefile
    opal/include/sys/alpha/Makefile
    opal/include/sys/amd64/Makefile
    opal/include/sys/ia32/Makefile
    opal/include/sys/ia64/Makefile
    opal/include/sys/mips/Makefile
    opal/include/sys/powerpc/Makefile
    opal/include/sys/sparc/Makefile
    opal/include/sys/sparcv9/Makefile
    opal/include/sys/win32/Makefile

    opal/asm/Makefile
    opal/class/Makefile
    opal/event/Makefile
    opal/event/compat/Makefile
    opal/event/compat/sys/Makefile
    opal/memoryhooks/Makefile
    opal/runtime/Makefile
    opal/threads/Makefile
    opal/util/Makefile

    opal/mca/Makefile
    opal/dynamic-mca/Makefile
    opal/mca/base/Makefile

    orte/Makefile
    orte/include/Makefile
    orte/class/Makefile
    orte/dps/Makefile
    orte/runtime/Makefile
    orte/util/Makefile

    orte/tools/Makefile
    orte/tools/orted/Makefile
    orte/tools/orteprobe/Makefile
    orte/tools/orterun/Makefile

    orte/mca/Makefile
    orte/dynamic-mca/Makefile

    ompi/Makefile
    ompi/include/Makefile
    ompi/class/Makefile

    ompi/attribute/Makefile
    ompi/communicator/Makefile
    ompi/datatype/Makefile
    ompi/debuggers/Makefile
    ompi/errhandler/Makefile
    ompi/file/Makefile
    ompi/group/Makefile
    ompi/info/Makefile
    ompi/op/Makefile
    ompi/proc/Makefile
    ompi/request/Makefile
    ompi/runtime/Makefile
    ompi/win/Makefile

    ompi/mpi/Makefile
    ompi/mpi/c/Makefile
    ompi/mpi/c/profile/Makefile
    ompi/mpi/cxx/Makefile
    ompi/mpi/f77/Makefile
    ompi/mpi/f77/profile/Makefile
    ompi/mpi/f90/Makefile
    ompi/mpi/f90/fortran_kinds.sh
    ompi/mpi/f90/fortran_sizes.h
    ompi/mpi/f90/scripts/Makefile

    ompi/tools/Makefile
    ompi/tools/ompi_info/Makefile
    ompi/tools/wrappers/Makefile

    ompi/mca/Makefile
    ompi/dynamic-mca/Makefile

    test/Makefile
    test/asm/Makefile
    test/class/Makefile
    test/dps/Makefile
    test/mca/Makefile
    test/mca/gpr/Makefile
    test/mca/ns/Makefile
    test/mca/oob/Makefile
    test/mca/ras/Makefile
    test/mca/rds/Makefile
    test/mca/rmaps/Makefile
    test/mca/schema/Makefile
    test/memory/Makefile
    test/runtime/Makefile
    test/support/Makefile
    test/threads/Makefile
    test/util/Makefile
])
AC_OUTPUT
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.