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 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131
|
dnl This is an autoconf script.
dnl To rebuild the `configure' script from this, execute the command
dnl autoconf
dnl in the directory containing this script. You must have autoconf
dnl version 1.7. This does *not* work with Autoconf 2.x, or with 1.8 or
dnl later (!).
dnl
dnl The following text appears in the resulting `configure' script,
dnl explaining how to rebuild it.
[#!/bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf.
# Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
progname="`echo $0 | sed 's:^\./\./:\./:'`"
print_error() {
echo "*# $*" 2>&1 ;
}
# The following are used to help move users to the eventual autoconf2 version
found_old=""
#
# print_dep is for deprecated argument styles (prepare users for autoconf2)
print_dep() {
echo "Use the argument $2 instead of $1"
found_old="$found_old
Use the argument $2 instead of $1"
}
print_useenv() {
msg="$1"
msg=`echo "$msg" | sed -e 's/=\([^ ]*\) \(.*\)$/="\1 \2"/'`
echo "Use the environment variable $2 instead of configure argument $msg"
found_old="$found_old
Use the environment variable $2 instead of configure argument $msg"
}
print_other() {
echo "Use $2 instead of $1"
found_old="$found_old
Use $2 instead of $1"
}
# Check that arg is newstyle; print message if it isn't
# Check_dep (arg, newstyle)
check_dep() {
case $1 in
-*with-* | -*without-* ) ;;
-*enable-* | -*disable-* ) ;;
*) print_dep "$1" "$2"
;;
esac
}
print_usage() {
cat <<EOF
Usage: ${progname} [--with-arch=ARCH_TYPE] [--with-comm=COMM_TYPE]
[--with-device=DEVICE]
[--with-mpe] [--without-mpe]
[--without-romio]
[--disable-f77] [--disable-f90] [--with-f90nag] [--with-f95nag]
[--disable-f90modules]
[--disable-gencat] [--disable-doc]
[--enable-cxx ] [--disable-cxx]
[--with-coll[=filename]]
[--enable-mpedbg] [--disable-mpedbg]
[--enable-devdebug] [--disable-devdebug]
[--enable-debug] [--disable-debug]
[--enable-traceback] [--disable-traceback]
[--enable-long-long] [--disable-long-long]
[--enable-long-double] [--disable-long-double]
[-prefix=INSTALL_DIR]
[-c++[=C++_COMPILER] ] [noc++]
[-opt=OPTFLAGS]
[-cc=C_COMPILER] [-fc=FORTRAN_COMPILER]
[-clinker=C_LINKER] [-flinker=FORTRAN_LINKER]
[-c++linker=CC_LINKER]
[-cflags=CFLAGS] [-fflags=FFLAGS] [-c++flags=CCFLAGS]
[-optcc=C_OPTFLAGS] [-optf77=F77_OPTFLAGS]
[-f90=F90_COMPILER] [-f90flags=F90_FLAGS]
[-f90inc=INCLUDE_DIRECTORY_SPEC_FORMAT_FOR_F90]
[-f90linker=F90_LINKER]
[-f90libpath=LIBRARY_PATH_SPEC_FORMAT_FOR_F90]
[-lib=LIBRARY] [-mpilibname=MPINAME]
[-mpe_opts=MPE_OPTS]
[-make=MAKEPGM ]
[-memdebug] [-ptrdebug] [-tracing] [-dlast]
[-listener_sig=SIGNAL_NAME]
[-cross]
[-adi_collective]
[-automountfix=AUTOMOUNTFIX]
[-noranlib] [-ar_nolocal]
[-rsh=RSHCOMMAND] [-rshnol]
[-file_system=FILE_SYSTEM]
[-p4_opts=P4_OPTS]
where
ARCH_TYPE = the type of machine that MPI is to be configured for
COMM_TYPE = communications layer or option to be used
DEVICE = communications device to be used
INSTALL_DIR = directory where MPI will be installed (optional)
MPE_OPTS = options to pass to the mpe configure
P4_OPTS = options to pass to the P4 configure (device=ch_p4)
C++_COMPILER = default is to use xlC, g++, or CC (optional)
OPTFLAGS = optimization flags to give the compilers (e.g. -g)
CFLAGS = flags to give C compiler
FFLAGS = flags to give Fortran compiler
MAKEPGM = version of make to use
LENGTH = Length of message at which ADI switches from short
to long message protocol
AUTOMOUNTFIX = Command to fix automounters
RSHCOMMAND = Command to use for remote shell
MPILIBNAME = Name to use instead of mpich in the name of the MPI
library. If set, libMPILIBNAME will be used instead
or libmpich. This can be used on systems with
several different MPI implementations.
FILE_SYSTEM = name of the file system ROMIO is to use. Currently
supported values are nfs, ufs, pfs (Intel),
piofs (IBM), hfs (HP), sfs (NEC), and xfs (SGI).
SIGNAL_NAME = name of the signal for the P4 (device=ch_p4) device to
use to indicate that a new connection is needed. By
default, it is SIGUSR1.
All arguments are optional, but if 'arch', 'comm', or 'prefix' arguments
are provided, there must be only one. 'arch' must be specified before
'comm' if they both appear.
Packages that may be included with MPICH
--with-device=name - Use the named device for communication. Known
names include ch_p4, ch_mpl, ch_shmem, and globus2.
If not specified, a default is chosen. Special
options for the device are specified after the
device name, separated by a colon. E.g.,
--with-device=globus2:-flavor=mpi,nothreads
--with-romio[=OPTIONS] - Use ROMIO to provide MPI-I/O from MPI-2 (default).
The options include -file_system=FSTYPE, where
fstype can be any combination of nfs, ufs,
pfs (intel), piofs (IBM), hfs (HP), sfs (NEC), and
xfs (SGI), combined with '+'. If romio is not
included, the Fortran 90 modules cannot be built.
--with-mpe - Build the MPE environment (default)
--with-coll[=name] - Select the implementation of the MPI collective
routines that should be used. By default, uses
the most advanced version. The name is the name of
the file (without the suffix) in src/coll that should
be used for the collective routines. Currently,
name may be either intra_fns_new (the default) or
intra_fns .
--with-f90nag - Choose the NAG f90 compiler for Fortran
(preliminary version intended for use *instead*
of a Fortran 77 compiler)
--with-f95nag - Choose the NAG f95 compiler for Fortran
--with-cross=file - Use the file for cross compilation. The file
should contain assignments of the form
CROSS_SIZEOF_INT=4
for each cross compilation variable. The command
egrep 'CROSS_[A-Z_]*=' configure | sed 's/=.*//g'
will list each variable.
You can use --without-<featurename> to turn off a feature (except for
device).
EOF
#
# For each device with a setup file, give the usage output
if test -z "$srcdir" ; then srcdir="." ; fi
for mpid in $srcdir/mpid/* ; do
if test -d $mpid ; then
DEVICE=`echo $mpid | sed 's%.*/%%g'`
device_setup=$mpid/setup_$DEVICE
if test -f $device_setup ; then
echo "Options for device $DEVICE:"
export DEVICE
eval $device_setup --usage 2>&1
echo " "
fi
fi
done
#
cat <<EOF
Features that may be included with MPICH
--enable-cxx - Build C++ interfaces to the MPI-1 routines
(default)
--enable-f77 - Build Fortran 77 interfaces to the MPI
routines (default)
--enable-weak-symbols - Use weak symbols for MPI/PMPI routines. This uses
weak symbols, if available, for the profiling
interface (default)
--enable-debug - Enable support for debuggers to access message
queues
--enable-traceback - Enable printing of a call stack when MPI and the
user's program is built with certain compilers
(currently only some versions of gcc are supported).
--enable-mpedbg - Enable the -mpedbg command-line argument (e.g.,
errors can start an xterm running a debugger).
Only works with some workstation systems.
--enable-sharedlib - Attempt to build shared libraries. Static
--enable-sharedlib=dir libraries are always built. If a directory is
specified, the shared libraries will be placed in
that directory. This can be used to place the
shared libraries in a uniform location in local
disks on a cluster.
--enable-f90modules - Build Fortran 90 module support (default if a
Fortran 90 or 95 compiler is found). If ROMIO
is not built, no Fortran 90 modules will be built.
The following are intended for MPI implementors and debugging of configure
--enable-strict - Try and build MPICH using strict options in Gnu gcc
--enable-echo - Cause configure to echo what it does
--enable-devdebug - Enable debugging code in the ADI.
You can use --disable-<featurename> to turn off a feature.
Notes on configure usage:
The suggestions for GNU configure usage suggest that configure not be used
to build different tools, only controlling some basics of the features
enabled or the packages included. Our use of configure does not follow
these rules because configure is too useful but we need the flexibility
that allows the user to produce variations of MPICH.
More notes on command-line parameters:
You can select a different C and Fortran compiler by using the '-cc' and
'fc' switches. The environment variables 'CC' and 'FC' can also provide
values for these but their settings may be overridden by the configure
script. Using '-cc=\$CC -fc=\$FC' will force configure to use those
compilers.
The option '-opt' allows you to specify optimization options for the
compilers (both C and Fortran). For example, '-opt=-O' chooses optimized
code generation on many systems. '-optcc' and '-optf77' allow you to
specify options for just the C or Fortran compilers. Use -cflags and
-fflags for options not related to optimization.
Note that the '-opt' options are not passed to the 'mpicc', 'mpif77',
'mpiCC', and 'mpif90' scripts. The '-opt' options are used only in
building MPICH.
The option '-lib' allows you to specify the location of a library that
may be needed by a particular device. Most devices do NOT need this
option; check the installation instructions for those that might.
The option '-make' may be used to select an alternate make program. For
example, to make use of VPATH builds (building in one directory with the
source in a different directory), -make=gnumake may be required.
The option '--disable-short-longs' may be used to suppress support for
the C types 'long long' (a common extension) and 'long double' (ANSI/ISO C)
when they are the same size as 'long' and 'double' respectively. Some
systems allow these long C types, but generate a warning message when
they are used; this option may be used to suppress these messages (and
support for these types). '--disable-long-long' disables just 'long long';
'--disable-long-double' disables just 'long double'.
The option '-ar_nolocal' prevents the library archive command from
attempting to use the local directory for temporary space. This option
should be used when (a) there isn't much space (less than 20 MB)
available in the partition where MPICH resides and (b) there is enough
space in /tmp (or wherever ar places temporary files by default).
The option '-noranlib' causes the 'ranlib' step (needed on some systems
to build an object library) to be skipped. This is particularly useful
on systems where 'ranlib' is optional (allowed but not needed; because it
is allowed, configure chooses to use it just in case) but can fail (some
'ranlib's are implemented as scripts using 'ar'; if they don't use the
local directory, they can fail (destroying the library in the process) if
the temporary directory (usually '/tmp') does not have enough space.
This has occured on some OSF systems.
The environment variable 'RSHCOMMAND' allows you to select an alternative
remote shell command (by default, configure will use 'rsh' or 'remsh' from
your 'PATH'). If your remote shell command does not support the '-l' option
(some AFS versions of 'rsh' have this bug), also give the option
'-rshnol'. These options are useful only when building a network version
of MPICH (e.g., '--with-device=ch_p4').
The configure option '-rsh' is supported for backward compatibility.
Special Tuning Options:
There are a number of options for tuning the behavoir of the ADI
(Abstract Device Interface) which is the low-level message-passing
interface. These should NOT be used unless you are sure you know what
you are doing.
The option '-pkt_size=LENGTH' allows you to choose the message length at
which the ADI (Abstract Device Interface) switches from its short to long
message format. LENGTH must be positive.
The option '-adi_collective' allows the ADI to provide some collective
operations in addition to the basic point-to-point operations.
Currently, most systems do not support this option (it is ignored) and on
the others it has not been extensively tested.
Options for Experts:
The option '-memdebug' enables extensive internal memory debugging code.
This should be used only if you are trying to find a memory problem (it
can be used to help find memory problems in user code as well). Running
programs with the option '-mpidb memdump' will produce a summary, when
'MPI_Finalize' is called, of all unfreed memory allocated my MPI. For
example, a user-created datatype that was not later freed would be
reported.
The option '-tracing' enables tracing of internal calls. This should be
used only for debugging the MPICH implementation itself.
The option '-dlast' enables tracing of the most recent operations performed
by the device. These can be output when a signal (like SIGINT), error,
or call to a special routine occurs. There is a performance penalty for
this option, but it can be very useful for implementors attempting to debug
problems.
Sample Configure Usage:
To make for running on Sun's running Solaris with ch_p4 as the device,
and with the installation directory equal to the current directory:
./configure --with-device=ch_p4 --with-arch=solaris
make
Known devices are
ch_nx (native Intel NX calls),
ch_mpl (native IBM EUI or MPL calls),
ch_p4 (p4)
ch_p4mpd (p4 with the MPD startup system)
globus2 (Globus: globus_io/vMPI)
ch_meiko (for Meiko CS2, using NX compatibility library),
ch_shmem (for shared memory systems, such as SMPs),
ch_lfshmem(for shared memory systems, such as SMPs; uses
lock-free message buffers),
ch_cenju3 (native NEC Cenju-3 calls)
ch_gm (native Myrinet GM, distributed and supported by Myricom)
The following devices were supported with ADI-1, but are currently
unsupported. Please contact us if you are interested in helping us
support these devices:
meiko (for Meiko CS2, using elan tport library), and
nx (for Intel Paragon),
t3d (for the Cray T3D, using Cray shmem library).
ch_nc (native nCUBE calls, requires -arch=ncube),
ch_cmmd (native TMC CM-5 CMMD calls)
These are no longer distributed with the MPICH distribution.
Known architectures include (case is important)
alpha (Compaq alpha)
CRAY (CRAY XMP, YMP, C90, J90, T90)
cray_t3d (CRAY T3D)
CYGWIN_NT (PCs using Cygwin)
EWS_UX_V (NEC EWS4800/360AD Series workstation. Untested.)
freebsd (PC clones running FreeBSD)
hpux (HP UX)
intelnx (Intel i860 or Intel Delta)
IRIX (synonym for sgi)
IRIX32 (IRIX with 32bit objects -32)
IRIXN32 (IRIX with -n32)
IRIX64 (IRIX with 64bit objects)
ksr (Kendall Square KSR1 and KSR2)
LINUX (PC clones running LINUX)
LINUX_ALPHA (Linux on Alpha processors)
meiko (Meiko CS2)
netbsd (PC clones running NetBSD)
paragon (Intel Paragon)
rs6000 (AIX for IBM RS6000)
sgi (Silicon Graphics IRIX 4.x, 5.x or 6.x)
sgi5 (Silicon Graphics IRIX 5.x on R4400's, for the MESHINE)
solaris (Solaris)
solaris86 (Solaris on Intel platforms)
sppux (SPP UX)
sun4 (SUN OS 4.x)
SX_4_float0
(NEC SX-4; Floating point format float0
Conforms IEEE 754 standard.
C: sizeof (int) = 4; sizeof (float) = 4
FORTRAN: sizeof (INTEGER) = 4; sizeof (REAL) = 4)
SX_4_float1
(NEC SX-4; Floating point format float1
IBM floating point format.
C: sizeof (int) = 4; sizeof (float) = 4
FORTRAN: sizeof (INTEGER) = 4; sizeof (REAL) = 4)
SX_4_float2
(NEC SX-4; Floating point format float2
CRAY floating point format.
C: sizeof (int) = 4; sizeof (float) = 8
FORTRAN: sizeof (INTEGER) = 8; sizeof (REAL) = 8)
!!! WARNING !!! This version will not run
together with FORTRAN routines.
sizeof (INTEGER) != sizeof (int)
SX_4_float2_int64
(NEC SX-4; Floating point format float2 and
64-bit int's)
C: sizeof (int) = 8; sizeof (float) = 8
FORTRAN: sizeof (INTEGER) = 8; sizeof (REAL) = 8)
tflops (Intel TFLOPS)
UXPM (UXP/M. Untested.)
uxpv (uxp/v. Untested.)
Others may be recognized.
Special notes:
For SGI (--with-arch=IRIX) multiprocessors running the ch_p4 device, use
-comm=ch_p4 to disable the use of the shared-memory p4 communication
device, and -comm=shared to enable the shared-memory p4 communication
device. The default is to enable the shared-memory communication device.
EOF
}
#
# Special environment variables
# MPICH_WARNING_SEP - if set, is echoed around warning messages. This is
# used to simplify automated testing where we want to ignore warning messages
# Specifically, echo '>'$MPICH_WARNING_SEP preceeds the warning and
# echo '<'$MPICH_WARNING_SEP follows it
# finderrors and findnosuccess use the same environment variable to
# skip output
#
UseSharedLibs=0
NEEDS_CC_SHARED_OPT=1
ARCH=""
CPP_DIR=""
MPE_DIR=""
LIB_PATH=""
FLIB_PATH=""
OPTFLAGS=""
OPTFLAGSF=""
F90=${F90:-""}
f90nag=0
f95nag=0
NOF77=0
NO_F90=0
NOMPE=0
ENABLE_MPEDBG=""
NOCXX=""
AR_LOCAL=${AR_LOCAL:-"l"}
NO_LONG_DOUBLE="no"
NO_LONG_LONG="no"
HAS_FORTRAN=1
MPILIBNAME=${MPILIBNAME:-"mpich"}
do_f90modules="yes"
HAVE_MPID_DEFS_H=0
#
MPI_AINT=long
CFLAGS=${CFLAGS:-""}
# Set this if we pick features that require gcc
needs_gcc=no
#
Use_Intercomm_coll="no"
# Attempt to use weak symbol support
TRY_WEAK_SYMBOLS=1
# We use @ because configure uses %
AUTOMOUNTFIX=${AUTOMOUNTFIX:-'sed -e s@/tmp_mnt/@/@g'}
#
# By not setting FFLAGS, we get the values from the environment
# Most of these should come from the environment if set
MAKE=${MAKE:-"make"}
P4_MDEPCFLAGS=""
ASMFILES_O=""
PREFIX=""
MPE_OPTS=""
P4_OPTS=""
DEVCFLAGS=""
CONFIGURE_ARGS="$*"
DEFAULT_MACHINE=''
DEVICE_KIND=MPP
rshcommand=${RSHCOMMAND}
#
# Some autoconf tests check for cross_compiling being empty, rather than
# having a value of 0 or 1 (or no or yes).
cross_compiling=""
cross_file=""
debug_version=0
#
FILE_SYSTEM=""
ROMIO=1
ROMIO_CFLAGS=""
ROMIO_FFLAGS=""
ROMIO_LFLAGS=""
ROMIO_TCFLAGS=""
ROMIO_TCPPFLAGS=""
ROMIO_TFFLAGS=""
usesysv=0
#
# -mpedbg
#MPE_MPI_EXT_C="$MPE_MPI_EXT_C dbxerr.c mpehname.c"
#MPE_MPI_EXT_O="$MPE_MPI_EXT_O dbxerr.o mpehname.o"
# dbxerr.c support has become too difficult to make part of the basic
# system (both because it is in MPE, which is now separately built and
# configured after MPICH, and because of diverging (even for a single vendor)
# command syntax for the debuggers. Add dbxdee.c/.o when we have a better
# solution.
MPE_MPI_EXT_C="$MPE_MPI_EXT_C mpehname.c"
MPE_MPI_EXT_O="$MPE_MPI_EXT_O mpehname.o"
#
# --with-coll
MPI_INTRA=intra_fns_new
# -devdebug
DEVDEBUGCFLAGS="-DMPID_DEBUG_NONE -DMPID_STAT_NONE"
# -dlast
DLAST=""
# Traceback
try_traceback=no
#
# This next variable is a version without quotes.
# We could also consider `echo $a | sed -e 's/"/\\"/g'`
CONFIGURE_ARGS_CLEAN=`echo $* | tr '"' ' '`
if test -n "$CONFIGURE_ARGS" ; then
echo "Configuring with args $CONFIGURE_ARGS"
fi
#
# Test for C++ support
# We can only set this if there is a C++ compiler....
buildcpp=0
#
if test -s include/patchlevel.h ; then
tmpsrcdir=.
else
# try to determine the source dir
tmpsrcdir=`echo $0 | sed -e 's%/configure%%' -e "s%^~/%$HOME/%"`
if test ! -s "$tmpsrcdir/include/patchlevel.h" ; then
tmpsrcdir=""
fi
fi
if test -n "$tmpsrcdir" ; then
MPIVERSION=`grep 'PATCHLEVEL ' $tmpsrcdir/include/patchlevel.h | awk '{print $3}'`
# Make sure to remove quotes...
mvk=`grep 'PATCHLEVEL_RELEASE_KIND' $tmpsrcdir/include/patchlevel.h | awk '{print $3}' | \
sed -e 's/"//g'`
mv1=`grep 'PATCHLEVEL_SUBMINOR' $tmpsrcdir/include/patchlevel.h | awk '{print $3}'`
mvtime=`grep 'Date:' $tmpsrcdir/include/patchlevel.h | sed -e 's/^.*$Date\(.*\)\$".*$/\1/g'`
if test -n "$mvk" ; then
MPIVERSION="$MPIVERSION.$mv1 ($mvk) of $mvtime"
else
MPIVERSION="$MPIVERSION.$mv1 of $mvtime"
fi
echo "Configuring MPICH Version $MPIVERSION"
fi
#
# IS_HETERO is set if the device supports heterogeneous machines.
# This requires additional coding, including checking for XDR
IS_HETERO=0
for arg
do
# Handle --exec-prefix with a space before the argument.
if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
# Handle --host with a space before the argument.
elif test x$next_host = xyes; then next_host=
# Handle --prefix with a space before the argument.
elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
# Handle --srcdir with a space before the argument.
elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
else
# Code from autoconf 2 to get any option after an =
case "$arg" in
-*=*) ac_optarg=`echo "$arg" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) ac_optarg= ;;
esac
case $arg in
# For backward compatibility, also recognize exact --exec_prefix.
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
next_exec_prefix=yes ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
PREFIX=`echo $arg | sed 's/[-a-z_]*=//'`
prefix=$PREFIX ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
next_prefix=yes ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
next_srcdir=yes ;;
-datadir=* | --datadir=* )
datadir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
-libdir=* | --libdir=* )
libdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
-bindir=* | --bindir=* )
bindir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
-sbindir=* | --sbindir=* )
sbindir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
-mandir=* | --mandir=* )
mandir=`echo A$arg | sed 's/A[-a-z_]*=//'` ;;
-docdir=* | --docdir=* )
docdir=`echo A$arg | sed 's/A[-a-z_]*=//'` ;;
-wwwdir=* | --wwwdir=* )
htmldir=`echo A$arg | sed 's/A[-a-z_]*=//'` ;;
-htmldir=* | --htmldir=* )
htmldir=`echo A$arg | sed 's/A[-a-z_]*=//'` ;;
-includedir=* | --includedir=* )
includedir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
-sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
| --sha=* | --sh=*)
sharedstatedir="$ac_optarg" ;;
#
# Here begin the MPICH options
-arch=* | --arch=* | -with-arch=* | --with-arch=*)
check_dep $arg "--with-arch=name"
package=`echo $arg|sed 's/-*[^=]*arch=//'`
# Delete all the valid chars; see if any are left.
if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
print_error "configure: $package: invalid architecture name"; exit 1
fi
# Extract arch-specific args
ARCH=`echo $package | sed 's/:.*//g'`
arch_args=`echo $package | sed 's/[^:]*://g'`
if test "$arch_args" = "$package" ; then arch_args='' ; fi
eval "arch_`echo $ARCH|sed s/-/_/g`=1"
;;
-comm=* | --comm=* | --with-comm=* | -with-comm=*)
check_dep $arg "--with-comm=type"
package=`echo $arg|sed 's/-*[^=]*comm=//'`
# Delete all the valid chars; see if any are left.
if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
print_error "configure: $package: invalid communications layer name";
exit 1
fi
COMM=`echo $package|sed s/-/_/g`
eval "comm_`echo $package|sed s/-/_/g`=1"
;;
-device=* | --device=* | --with-device=* | -with-device=*)
check_dep $arg "--with-device=name"
package=`echo $arg|sed 's/^-*[^=]*device[=]*//'`
# Delete all the valid chars; see if any are left.
# Extract device-specific args
DEVICE=`echo $package | sed 's/:.*//g'`
device_args=`echo $package | sed 's/[^:]*://'`
if test "$device_args" = "$package" ; then
device_args=''
else
# replace : with space
device_args="`echo A$device_args | sed -e 's/^A//g' -e 's/:/ /g'`"
fi
#DEVICE=$package #|sed s/-/_/g`
# Can't have - in variable names
package=`echo $DEVICE | sed s/-/_/g`
if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
print_error "configure: $package: invalid device name" ; exit 1
fi
eval "device_$package=1"
# Handle possible synonyms
if test -n "$device_ch_eui"; then
device_ch_mpl=1
DEVICE=ch_mpl
fi
;;
-mpedbg | --mpedbg | --enable-mpedbg | -enable-mpedbg)
check_dep $arg "--enable-mpedbg"
# Definitions of DEFS must follow the PREPARE
MPE_MPI_EXT_C="$MPE_MPI_EXT_C dbxerr.c mpehname.c"
MPE_MPI_EXT_O="$MPE_MPI_EXT_O dbxerr.o mpehname.o"
ENABLE_MPEDBG="--enable-mpedbg"
;;
-nompedbg | --nompedbg | --disable-mpedbg | -disable-mpedbg)
check_dep $arg "--disable-mpedbg"
# Definitions of DEFS must follow the PREPARE
MPE_MPI_EXT_C=""
MPE_MPI_EXT_O=""
;;
-sharedlib* | --sharedlib* | --enable-sharedlib* | -enable-sharedlib*)
check_dep $arg "--enable-sharedlib"
# Try to build shared libraries
sharedlib_dir=`echo A$arg|sed -e 's/A-.*sharedlib=//g'`
if test "$sharedlib_dir" = "A$arg" ; then sharedlib_dir="" ; fi
if test -z "$sharedlib_dir" ; then
enable_args="$enable_args --enable-sharedlib --enable-shared"
fi
UseSharedLibs=1
;;
-nosharedlib | --nosharedlib | --disable-sharedlib | -disable-sharedlib)
check_dep $arg "--disable-sharedlib"
# Done't use shared libraries
UseSharedLibs=0
enable_args="$enable_args --disable-shared --disable-sharedlib"
;;
--enable-strict|-enable-strict|-strict)
check_dep $arg "--enable-strict"
# Setup for gcc strict checking
# To get -Wuninitialized, we need -O
# The definition of GCC_WALL allows us to conditionally change the
# code when gcc generates a spurious error message, particularly
# for uninitialized data.
# -wshadow?
CFLAGS="$CFLAGS -O -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wundef -Wpointer-arith -Wbad-function-cast -DGCC_WALL"
USER_CFLAGS="$USER_CFLAGS -O -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wundef -Wpointer-arith -Wbad-function-casti -DGCC_WALL"
ROMIO_CFLAGS="$ROMIO_CFLAGS -O -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wundef -Wpointer-arith -Wbad-function-cast -DGCC_WALL"
needs_gcc=yes
if test -z "$CC" ; then
CC=gcc
USERCC=1
fi
COPTIONS="$COPTIONS -O -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -DGCC_WALL"
export COPTIONS
enable_args="$enable_args $arg"
enable_strict="yes"
;;
--enable-coverage|-enable-coverage)
CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
;;
--enable-weak-symbols|-enable-weak-symbols)
check_dep $arg "--enable-weak-symbols"
TRY_WEAK_SYMBOLS=1
enable_args="$enable_args $arg"
;;
--disable-weak-symbols|-disable-weak-symbols)
check_dep $arg "--disable-weak-symbols"
TRY_WEAK_SYMBOLS=0
ROMIO_ARGS="$ROMIO_ARGS --disable-weak-symbols"
enable_args="$enable_args $arg"
;;
-disable-gencat | --disable-gencat)
ignore_gencat="yes"
;;
-ar_nolocal | --ar_nolocal)
print_useenv $arg "AR_LOCAL=''"
AR_LOCAL=''
;;
-noranlib | -no_ranlib)
print_useenv $arg "RANLIB=':'"
RANLIB=':'
;;
# which device(s) - ch_shmem etc (device_args)
#dnl -usesysv)
#dnl usesysv=1
#dnl ;;
# end of ch_shmem /ch_lfshmem device
# This is a p4 option. It should be an env variable or a
#--with-device=ch_p4:-listenersig=SIGUSR2
-listenersig=*)
check_dep $arg "--with-device=ch_p4:-listenersig=name"
listener_sig=`echo A$arg|sed -e 's/A-listenersig=//g'`
;;
-listener_sig=*)
check_dep $arg "--with-device=ch_p4:-listenersig=name"
listener_sig=`echo A$arg|sed -e 's/A-listener_sig=//g'`
;;
-dlast | --dlast | --enable-dlast | -enable-dlast )
check_dep $arg "--enable-dlast"
DLAST="-dlast"
;;
-p4_opts=* | --p4_opts=*)
# Not yet - we don't have a good way to pass args to the p4 configure
# echo "This option is deprecated. Please use"
# echo "--with-device=ch_p4:<options to pass p4 configure>"
# echo "instead."
package="`echo $arg | sed 's/-*p4_opts=//'`"
if test -z "$P4_OPTS" ; then
P4_OPTS="$package"
else
P4_OPTS="$P4_OPTS $package"
fi
;;
## end of ch_p4 device
-nodevdebug | --nodevdebug | -disable-devdebug | --disable-devdebug)
check_dep $arg "--disable-devdebug"
NODEVDEBUG=1
DEVDEBUGCFLAGS="-DMPID_DEBUG_NONE -DMPID_STAT_NONE"
;;
-devdebug | --devdebug | -enable-devdebug | --enable-devdebug)
check_dep $arg "--enable-devdebug"
NODEVDEBUG=0
DEVDEBUGCFLAGS=""
;;
-debug | --debug | --enable-debug | -enable-debug )
check_dep $arg "--enable-debug"
debug_version=1
enable_args="$enable_args --enable-debug"
;;
-nodebug | --nodebug | --disable-debug | -disable-debug )
check_dep $arg "--disable-debug"
debug_version=0
enable_args="$enable_args --disable-debug"
;;
-enable-traceback | --enable-traceback)
try_traceback=yes
needs_gcc=yes
enable_args="$enable_args --enable-traceback"
;;
-disable-traceback | --disable-traceback)
try_traceback=no
enable_args="$enable_args --disable-traceback"
;;
-enable-g | --enable-g | --enable-g=* | -enable-g=* )
debug_version=1
OPTFLAGS="$OPTFLAGS -g"
if test "$ac_optarg" = "all" ; then
MEMDEBUG=1
PTRDEBUG=1
TRDEBUG=1
NODEVDEBUG=0
DEVDEBUGCFLAGS=""
DLAST="-dlast"
fi
enable_args="$enable_args $arg"
if test -z "$ac_optarg" ; then
enable_g="yes"
else
enable_g="$ac_optarg"
fi
;;
-disable-g | --disable-g )
enable_g="no"
enable_args="$enable_args --disable-g"
;;
# This is should be an env variable
-mpilibname=*)
print_useenv "$arg" "MPILIBNAME"
MPILIBNAME=`echo A$arg|sed 's/A-*mpilibname=//'`
;;
-no_short_longs | --no_short_longs | --disable-short-longs | -disable-short-longs)
check_dep $arg "--disable-short-longs"
NO_LONG_DOUBLE="yes"
NO_LONG_LONG="yes"
enable_args="$enable_args --disable-short-longs"
;;
--enable-short-longs | -enable-short-longs)
NO_LONG_DOUBLE="no"
NO_LONG_LONG="no"
enable_args="$enable_args --enable-short-longs"
;;
--disable-long-double | -disable-long-double)
NO_LONG_DOUBLE="yes"
enable_args="$enable_args --disable-long-double"
;;
--enable-long-double | --enable-long-double)
NO_LONG_DOUBLE="no"
enable_args="$enable_args --enable-long-double"
;;
--disable-long-long | -disable-long-long)
NO_LONG_LONG="yes"
enable_args="$enable_args --disable-long-long"
;;
--enable-long-long | --enable-long-long)
NO_LONG_LONG="no"
enable_args="$enable_args --enable-long-long"
;;
-memdebug | --memdebug)
print_other $arg "--enable-g=all"
MEMDEBUG=1
;;
-ptrdebug | --ptrdebug)
print_other $arg "--enable-g=all"
PTRDEBUG=1
;;
-tracing | --tracing)
print_other $arg "--enable-g=all"
TRDEBUG=1
;;
-with-cross* | --with-cross*)
withval=`echo $arg | sed 's/-*with-cross[=]*//g'`
cross_file=$withval
cross_compiling=1
with_args="$with_args $arg"
;;
-with-flibname* | --with-flibname*)
withval=`echo $arg | sed 's/-*with-flibname[=]*//g'`
flibname=$withval
;;
#dnl -pkt_size=* | --pkt_size=*)
#dnl pktsize=`echo $arg|sed 's/-*pkt_size=//'`
#dnl PKTSIZE=$pktsize
#dnl DEVCFLAGS="$DEVCFLAGS -DMPID_PKT_MAX_DATA_SIZE=$pktsize"
#dnl ;;
#dnl -limited_buffers | --limited_buffers)
#dnl LIMITEDBUFFERS=1
#dnl DEVCFLAGS="$DEVCFLAGS -DMPID_LIMITED_BUFFERS"
#dnl ;;
#dnl -tiny_buffers | --tiny_buffers)
#dnl TINYBUFFERS=1
#dnl DEVCFLAGS="$DEVCFLAGS -DMPID_TINY_BUFFERS"
#dnl ;;
#dnl -nolimited_buffers | --nolimited_buffers)
#dnl LIMITEDBUFFERS=0
#dnl DEVCFLAGS="$DEVCFLAGS -DMPID_NO_LIMITED_BUFFERS"
#dnl ;;
#dnl -notiny_buffers | --notiny_buffers)
#dnl TINYBUFFERS=0
#dnl DEVCFLAGS="$DEVCFLAGS -DMPID_NO_TINY_BUFFERS"
#dnl ;;
#dnl # This is for p4 (and p3?)
#dnl -socksize=*|--socksize=*)
#dnl SOCKSIZE="`echo $arg|sed 's/-*socksize=//'`"
#dnl ;;
-adi_collective | --adi_collective)
ADI_COLLECTIVE=1
;;
-f77idx)
# Force POINTER_64_BITS definition
F77IDX=1
;;
-f90nag | --with-f90nag | -with-f90nag)
check_dep $arg "--with-f90nag"
# Insert module
F90UNIX=" use f90_unix"
FC=f90
f90nag=1
# -mismatch allows type mismatches in arguments. This
# is necessary until we have a Fortran 90 module with
# generic paramters
FFLAGS="$FFLAGS -mismatch"
# Still to do - make sure that the Fortran interface is correctly
# selected.
;;
-f95nag | --with-f95nag | -with-f95nag)
check_dep $arg "--with-f95nag"
# Insert module
USER_SET_GETARG=1
F90UNIX=" use f90_unix_env"
FC=f95
F77GETARGDECL=""
F90GETARGDECL=""
FXX_MODULE=" use f90_unix_env"
F77_GETARGDECL=""
F77_GETARG=" call getarg(i,s)"
F77_IARGC=" iargc()"
f95nag=1
# -mismatch allows type mismatches in arguments. This
# is necessary until we have a Fortran 90 module with
# generic paramters
#FFLAGS="$FFLAGS -mismatch"
# Still to do - make sure that the Fortran interface is correctly
# selected.
;;
-f90=*)
print_useenv "$arg" "F90"
F90=`echo $arg|sed 's/-*f90=//'`
USERF90=1
;;
-f90flags=*)
print_useenv "$arg" "F90FLAGS"
USER_SET_F90FLAGS=1
F90FLAGS=`echo $arg|sed 's/-*f90flags=//'`
;;
-f90inc=*)
print_useenv "$arg" "F90INC"
USER_SET_F90INC=1
F90INC=`echo $arg|sed 's/-*f90inc=//'`
;;
-f90linker=*)
print_useenv "$arg" "F90LINKER"
USER_SET_F90LINKER=1
F90LINKER=`echo $arg|sed 's/-*f90linker=//'`
;;
-f90libpath=*)
print_useenv "$arg" "F90LIB_PATH"
USER_SET_F90LIB_PATH=1
F90LIB_PATH=`echo $arg|sed 's/-*f90libpath=//'`
;;
-enable-f90modules | --enable-f90modules)
do_f90modules="yes"
enable_args="$enable_args --enable-f90modules"
;;
-disable-f90modules | --disable-f90modules)
do_f90modules="no"
enable_args="$enable_args --disable-f90modules"
;;
-noc++ | --noc++ | --disable-c++ | -disable-c++ | -disable-cxx | --disable-cxx )
check_dep $arg "--disable-c++"
NOCXX="nocxx"
;;
--enable-c++ | -enable-c++ | --enable-cxx | -enable-cxx )
# enable_args="$enable_args --enable-c++"
;;
--enable-altcxx | -enable-altcxx)
# This is for testing an alternate c++ implementation.
# We use cxx instead of c++ to simplify (the eventual) use of
# autoconf v 2, which does not allow enable names with + in them.
CPP_DIR="src/cxx"
;;
--disable-altcxx | -disable-altcxx)
;;
-c++=* | --c++=*)
#dnl print_useenv "$arg" CPP_COMPILER and --enable-cxx
# We use .. instead of \+\+ because \+ is interpreted differently
# by various sed's
package=`echo $arg|sed 's/-*c..=//'`
# Delete all the valid chars; see if any are left.
#if test -n "`echo $package|sed 's/[-a-zA-Z0-9_+]*//g'`"; then
# print_error "configure: $package: invalid c++ compiler name"; exit 1
#fi
CPP_DIR="MPI-2-C++"
CPP_COMPILER=`echo $package`
if test -z "$package" ; then
echo "Use the environment variable CXX to specify a c++ compiler if"
echo "you do not want the default (often g++)."
fi
USERCPP=1
# We need to use mpCC for ch_mpl device!
if test "$CPP_COMPILER" = "xlC" -a "$DEVICE" = "ch_mpl" ; then
CPP_COMPILER=mpCC
fi
echo Compiling C++ interface with $CPP_COMPILER ;;
-cc=* | --cc=*)
print_useenv "$arg" CC
CC=`echo $arg|sed 's/-*cc=//'`
USERCC=1
;;
-fc=* | --fc=*)
print_useenv "$arg" FC
FC=`echo $arg|sed 's/-*fc=//'`
USERF77=1
;;
-f77=* | --f77=*)
print_useenv "$arg" FC
FC=`echo $arg|sed 's/-*f77=//'`
USERF77=1
;;
-fortnames=*)
# Valid values are
# FORTRANDOUBLEUNDERSCORE
# FORTRANUNDERSCORE
# FORTRANCAPS
# FORTRANNOUNDERSCORE
FORTRANNAMES="FORTRAN`echo $arg|sed 's/-*fortnames=//'`"
;;
-clinker=* | --clinker=*)
print_useenv "$arg" CLINKER
CLINKER=`echo $arg|sed 's/-*clinker=//'`
USERCLINKER=1
;;
-c++linker=* | --c++linker=*)
print_useenv "$arg" CCLINKER
# We use .. instead of \+\+ because \+ is interpreted differently
# by various sed's
CCLINKER=`echo $arg|sed 's/-*c..linker=//'`
# We need to use mpCC for ch_mpl device!
if test "$CCLINKER" = "xlC" -a "$DEVICE" = "ch_mpl" ; then
CCLINKER=mpCC
fi
USERCCLINKER=1
;;
-flinker=* | --flinker=*)
print_useenv "$arg" FLINKER
FLINKER=`echo $arg|sed 's/-*flinker=//'`
USERFLINKER=1
;;
-rsh=*)
print_useenv "$arg" RSHCOMMAND
rshcommand=`echo A$arg|sed 's/A-rsh=//'`
;;
-rshnol)
rshnol=1
;;
-lib=* | --lib=*)
package="`echo $arg|sed 's/-*lib=//'`"
USERLIB="$package" ;;
-opt=* | --opt=*)
package="`echo $arg|sed 's/-*opt=//'`"
OPTFLAGS="$package" ;;
-optcc=* | --optcc=*)
package="`echo $arg|sed 's/-*optcc=//'`"
OPTFLAGSC="$package" ;;
-optf77=* | --optf77=*)
package="`echo $arg|sed 's/-*optf77=//'`"
OPTFLAGSF="$package" ;;
-mpe_opts=* | --mpe_opts=*)
package="`echo $arg | sed 's/-*mpe_opts=//'`"
if test -z "$MPE_OPTS" ; then
MPE_OPTS="$package"
else
MPE_OPTS="$MPE_OPTS $package"
fi
;;
-cflags=* | --cflags=*)
print_useenv "$arg" CFLAGS
package="`echo $arg|sed 's/-*cflags=//'`"
USER_CFLAGS="$package"
ROMIO_CFLAGS="$package"
CFLAGS="$CFLAGS $package" ;;
-c++flags=* | --c++flags=*)
print_useenv "$arg" CCFLAGS
# We use .. instead of \+\+ because \+ is interpreted differently
# by various sed's
package="`echo $arg|sed 's/-*c..flags=//'`"
USER_CCFLAGS="$package"
CCFLAGS="$CCFLAGS $package" ;;
-fflags=* | --fflags=*)
print_useenv "$arg" FFLAGS
package="`echo $arg|sed 's/-*fflags=//'`"
ROMIO_FFLAGS="$package"
FFLAGS="$package" ;;
-nompe | --nompe | -without-mpe | --without-mpe)
check_dep $arg "--without-mpe"
MPE_DIR=""
NOMPE=1
echo "Make will not build MPE routines" ;;
-mpe | --mpe | -with-mpe | --with-mpe )
check_dep $arg "--with-mpe"
MPE_DIR="mpe"
NOMPE=0
with_args="$with_args $arg"
;;
# Another environment variable
-make=* | --make=*)
print_useenv "$arg" MAKE
package=`echo $arg|sed 's/-*make=//'`
MAKE="$package"
export MAKE
;;
-nof77 | --nof77 | -disable-f77 | --disable-f77 )
check_dep $arg "--disable-f77"
echo "Don't build the Fortran interfaces"
NOF77=1
NO_F90=1
HAS_FORTRAN=0
CFLAGS="-DMPID_NO_FORTRAN $CFLAGS"
romio_config_args="$romio_config_args --disable-f77"
enable_args="$enable_args --disable-f77"
;;
-nof90 | --nof90 | -disable-f90 | --disable-f90 )
check_dep $arg "--disable-f90"
enable_args="$enable_args --disable-f90"
NO_F90=1 ;;
-automountfix=* | --automountfix=*)
print_useenv "$arg" AUTOMOUNTFIX
AUTOMOUNTFIX="`echo $arg | sed 's/-*automountfix=//'`"
;;
-nobanner)
nobanner=1
;;
-echo | --enable-echo | -enable-echo )
check_dep $arg "--enable-echo"
set -x
configure_echo=1
enable_args="$enable_args --enable-echo"
;;
-noromio | --noromio | --without-romio | --with-romio=no )
check_dep $arg "--without-romio"
ROMIO=0
with_args="$with_args --without-romio --without-mpiio"
;;
-with-romio* | --with-romio*)
withval=`echo $arg | sed 's/-*with-romio[=]*//g'`
ROMIO_ARGS="$ROMIO_ARGS $withval"
;;
-with-intercommcoll | --with-intercommcoll)
Use_Intercomm_coll="yes"
;;
--with-coll* | -with-coll* )
# If there is a name, use it (no .c suffix on name)
if test -n "$ac_optarg" ; then
MPI_INTRA=$ac_optarg
fi
;;
-with-* | --with-* | --without-* | -without-* )
# Unrecognized with argument. Just remember it
with_args="$with_args $arg"
;;
-enable-* | --enable-*)
# Unrecognized enable argument. Create the enable_feature=value
# variable and remember the enable argument
ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
# Reject names that are not valid shell variable names.
if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
{ echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
fi
ac_feature=`echo $ac_feature| sed 's/-/_/g'`
case "$ac_option" in
*=*) ;;
*) ac_optarg=yes ;;
esac
eval "enable_${ac_feature}='$ac_optarg'"
enable_args="$enable_args $arg"
;;
-disable-* | --disable-*)
# Unrecognized disable argument. Create the enable_feature=no
ac_feature=`echo $ac_option|sed -e 's/-*disable-//' -e 's/=.*//'`
# Reject names that are not valid shell variable names.
if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
{ echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
fi
ac_feature=`echo $ac_feature| sed 's/-/_/g'`
eval "enable_${ac_feature}=no"
enable_args="$enable_args $arg"
;;
-file_system=* | --file_system=* )
print_dep $arg "--with-romio=-file_system=value"
FILE_SYSTEM="`echo $arg|sed 's/-*file_system=//'`"
;;
-u | -usage | --usage | --usag | --usa | --us | --u | -help | --help )
print_usage >& 2
#
# This produced too many long wrapped lines; fixing the wrapping
# broke the code to extract the usage without duplicating the
# boilerplate configure usage. We should fix this by extracting the
# messages as part of the "updateconfigure" process, rathter than
# by having the configure do it on the fly (tradeoff between being
# able to use better tools and portability).
#echo ; echo "Options acceptable by '-mpe_opts=' :" ; echo
#TSD=`echo $0 | sed 's%/[^/][^/]*$%%'`
#if [ "$TSD" = "$0" -o "X$TSD" = "X." ] ; then
# TSD=`pwd`
#fi
#$TSD/mpe/configure--help
exit 1 ;;
-v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
verbose=yes ;;
*)
print_error "Unrecognized configure option $arg"
exit 1
;;
esac
fi
done]
dnl Finish the initalization
rm -f config.log
AC_PREPARE()
dnl
dnl Place the definitions into a configuration file, rather than sedding
dnl them into Makefiles.
dnl Comment out this line (with dnl!) to force the definitions into
dnl the Makefiles. Also, make sure that this file gets moved into the
dnl library directory before the builds take place.
AC_CONFIG_HEADER(mpichconf.h)
# We may need to delete this
PAC_FIXUP_SRCDIR
# Check that file system understands different file name cases
CASE_SENSITIVE=no
AC_MSG_CHECKING([whether filesystem respects case in file names])
echo 1 > CONFTEST
echo 2 > conftest
if diff CONFTEST conftest 2>&1 >/dev/null ; then
AC_MSG_RESULT([no])
AC_MSG_WARN([You may encounter problems with the commands mpicc and MPICC])
CASE_SENSITIVE=yes
else
AC_MSG_RESULT([yes])
fi
rm -f CONFTEST conftest
AC_SUBST(CASE_SENSITIVE)
#
#
# Load any cross-compiling definitions
if test -n "$cross_file" -a -s "$cross_file" ; then
. $cross_file
fi
# There are definitions in aclocal.m4 that must be in the same directory
# as this configure file for autoconf to properly build configure.
#
# Set basic defintions based on flags set from commandline
#
if test "$ADI_COLLECTIVE" = 1 ; then
AC_DEFINE(MPID_USE_ADI_COLLECTIVE)
fi
if test -n "$DLAST" ; then
AC_DEFINE(USE_HOLD_LAST_DEBUG)
AC_DEFINE(USE_PRINT_LAST_ON_ERROR)
fi
#
if test -n "$DEVDEBUGCFLAGS" ; then
DEVCFLAGS="$DEVCFLAGS $DEVDEBUGCFLAGS"
fi
#
# Definitions for special debugging features.
if test $debug_version = 1 ; then
# Make the code keep separate send queues.
AC_DEFINE(MPI_KEEP_SEND_QUEUE)
fi
#
# Find the home directory if not specified
if test "X$srcdir" != "X." -a -s $srcdir/src/pt2pt/Makefile.in ; then
MPIR_TRIAL="$srcdir"
else
PAC_GETWD(MPIR_TRIAL,src/pt2pt/Makefile.in)
fi
MPIR_HOME=$MPIR_TRIAL
AC_SUBST(HASMPE)
if test "$NOMPE" = 0 ; then
MPE_DIR=$MPIR_HOME/mpe
HASMPE="yes"
else
HASMPE="no"
fi
hasMPE=$HASMPE
#
#
# Check that an ARCH was set
# If it wasn't set, try to guess using "bin/tarch"
#
if test -z "$ARCH" ; then
# First check for some special cases
if test -n "$device_t3d" ; then
ARCH=cray_t3d
arch_cray_t3d=1
fi
fi
if test -z "$ARCH" -a -x "$srcdir/bin/tarch" ; then
AC_MSG_CHECKING(for architecture)
ARCH=`$srcdir/bin/tarch | sed s/-/_/g`
if test -z "$ARCH" ; then
AC_MSG_RESULT(Unknown!)
print_error "Error: Couldn't guess target architecture, you must"
print_error " set an architecture type with -arch=<value>"
exit 1
fi
eval "arch_$ARCH=1"
AC_MSG_RESULT($ARCH)
fi
if test -n "$arch_ppc_vxworks" ; then
# VXWORKS (Thanks to Gary Cliff <gary.cliff@cdott.com>)
# 2/27/01
echo PPC
arch_IRIX=1
ARCH=IRIX
fi
if test -n "$arch_sgi" ; then
arch_IRIX=1
ARCH=IRIX
fi
# check whether --arch=tflops was given and set defaults
if test -n "$arch_tflops"; then
if test -z "$USERCC" ; then
CC="cicc"
USERCC=1
CFLAGS="$CFLAGS -I. -D__COUGAR__ -D__COUGAR -DCORE_FILES -DP_SCHED -DGDB -DEND_OF_USER_MEM=0xc0100000 -DHAVE_LONG_DOUBLE"
OPTFLAGS="-Knoieee -Mvect -O3"
fi
if test -z "$USERCPP" ; then CPP_COMPILER="ciCC" ; USERCPP=1 ; fi
if test -z "$USERF77" ; then FC="cif77" ; USERF77=1 ; fi
if test -z "$USERF90" ; then F90="cif90" ; USERF90=1 ; fi
if test -z "$DEVICE" ; then DEVICE="ptls" ; fi
if test -z "$FILE_SYSTEM" ; then FILE_SYSTEM="pfs+ufs+nfs" ; fi
DEFAULT_MACHINE="tflops"
CROSS_STRUCT_ALIGNMENT="basic"
CROSS_HAS_LONG_LONG=1
CROSS_HAS_LONG_DOUBLE="yes"
# See mpireq -show 5556
CROSS_SIZEOF_CHAR=${CROSS_SIZEOF_CHAR:-1}
CROSS_SIZEOF_SHORT=${CROSS_SIZEOF_SHORT:-2}
CROSS_SIZEOF_INT=${CROSS_SIZEOF_INT:-4}
CROSS_SIZEOF_LONG=${CROSS_SIZEOF_LONG:-4}
CROSS_SIZEOF_LONG_LONG=${CROSS_SIZEOF_LONG_LONG:-8}
CROSS_SIZEOF_FLOAT=${CROSS_SIZEOF_FLOAT:-4}
CROSS_SIZEOF_DOUBLE=${CROSS_SIZEOF_DOUBLE:-8}
CROSS_SIZEOF_LONG_DOUBLE=${CROSS_SIZEOF_LONG_DOUBLE:-8}
CROSS_SIZEOF_VOID_P=${CROSS_SIZEOF_VOID_P:-4}
CROSS_OFFSET_KIND=${CROSS_OFFSET_KIND:-4}
CROSS_ADDRESS_KIND=${CROSS_ADDRESS_KIND:-4}
CROSS_F77_SIZEOF_INTEGER=${CROSS_F77_SIZEOF_INTEGER:-4}
CROSS_F77_SIZEOF_REAL=${CROSS_F77_SIZEOF_REAL:-4}
CROSS_F77_SIZEOF_DOUBLE_PRECISION=${CROSS_F77_SIZEOF_DOUBLE_PRECISION:-8}
CROSS_BIGENDIAN=${CROSS_BIGENDIAN:-false}
FORT_INT8=1
# Romio now looks at the CROSS_args
# ROMIO_ARGS="-intsize=$CROSS_SIZEOF_INT -ptrsize=$CROSS_SIZEOF_VOID_P -longsize=$CROSS_SIZEOF_LONG -longlongsize=$CROSS_SIZEOF_LONG_LONG --without-setbytes"
fi
#
# When specifying a specific IRIX architecture, select the appropriate
# compiler (and we mean compiler; these aren't flags)
if test -n "$arch_IRIX64" ; then
arch_IRIX=1
if test -z "$USERCC" ; then CC="cc -64" ; USERCC=1 ; fi
if test -z "$USERCPP" ; then CPP_COMPILER="CC -64" ; USERCPP=1 ; fi
if test -z "$USERF77" ; then FC="f77 -64" ; USERF77=1 ; fi
if test -z "$USERF90" ; then F90="f90 -64" ; USERF90=1 ; fi
fi
if test -n "$arch_IRIX32" ; then
arch_IRIX=1
if test -z "$USERCC" ; then CC="cc -32" ; USERCC=1 ; fi
if test -z "$USERCPP" ; then CPP_COMPILER="CC -32" ; USERCPP=1 ; fi
if test -z "$USERF77" ; then FC="f77 -32" ; USERF77=1 ; fi
if test -z "$USERF90" ; then F90="f90 -32" ; USERF90=1 ; fi
fi
if test -n "$arch_IRIXN32" ; then
arch_IRIX=1
if test -z "$USERCC" ; then CC="cc -n32" ; USERCC=1 ; fi
if test -z "$USERCPP" ; then CPP_COMPILER="CC -n32" ; USERCPP=1 ; fi
if test -z "$USERF77" ; then FC="f77 -n32" ; USERF77=1 ; fi
if test -z "$USERF90" ; then F90="f90 -n32" ; USERF90=1 ; fi
fi
# Handle solaris on Intel platforms, needed to get heterogeneity right in p4
if test -n "$arch_solaris86" ; then
arch_solaris=1
ARCH=solaris86
fi
if test -n "$arch_sgi5" ; then
arch_IRIX5=1
ARCH=IRIX
fi
if test -n "$arch_cray" ; then
arch_CRAY=1
ARCH=CRAY
fi
# check whether --comm=pvm3 was given
if test -n "$comm_pvm3"; then
echo "PVM 3 no longer supported."
echo "Note that MPICH was NEVER implemented on top of PVM; PVM was merely"
echo "one of the many devices supported from the very beginning."
exit 1
fi
#
# Check that a DEVICE was set
# If it wasn't set, try to guess using "bin/tdevice"
#
if test -z "$DEVICE" -a -x "$srcdir/bin/tdevice" ; then
AC_MSG_CHECKING(device)
DEVICE=`$srcdir/bin/tdevice $ARCH`
if test ! -n "$DEVICE" ; then
AC_MSG_RESULT(Unknown!)
print_error "Error: Couldn't guess device, you must"
print_error " set a device with -device=<value>"
exit 1
fi
eval "device_$DEVICE=1"
AC_MSG_RESULT($DEVICE)
fi
#
# Check for a VALID device
if test ! -d "$srcdir/mpid/$DEVICE" ; then
print_error "$DEVICE is not a valid device!"
exit 1
fi
#
#
F77="${FC:-f77}"
if test -n "$FC" ; then
USERF77=1
fi
# CLINKER and FLINKER are set by PAC _GET_CC and F77
#
# Eventually we'll use install (need install-sh)
AC_PROG_INSTALL
#
# Using this autoconf macro for ranlib doesn't handle the problem
# of 'helpful' ranlib's that issue error messages (!). Once
# we've identified the proper compiler etc, we'll try this
# ranlib below; if it fails, we'll replace it with ':'
#
if test -z "$RANLIB" ; then
AC_PROG_RANLIB
fi
#
# Problem: Using the ar_local option can cause low performance; not using it
# can cause failures. Should we try to get disk space, and pick default
# based on a guess about the available space?
AR="ar cr$AR_LOCAL"
ARCMD="ar"
# CPRP is the version of cp that accepts -r and -p arguments.
# See CRAY below
CPRP="cp"
INCLUDE_PATH=""
LIB_LIST=""
# Fixup for make
PAC_MAKE_IS_GNUMAKE
PAC_MAKE_IS_BSD44
PAC_MAKE_IS_OSF
#
# WARNING: The AIX VPATH can't handle a trailing blank on the VPATH line (!)
# Use
# find . -name 'Makefile.in' -exec grep '@VPATH@ ' /dev/null \{\} \;
# to discover these problems
# We should add this as a .cvswrapper test for Makefile.in
PAC_MAKE_VPATH
#
# If we are relying on vpath and no vpath is set, then we must exit
if test ! -s src/pt2pt/isend.c -a -z "$VPATH" ; then
print_error "No virtual MAKE path command found."
print_error "You may need to set your make command"
print_error "The GNU make (sometimes available as gnumake) can be used."
exit 1
fi
#
# Check that a DEVICE was set or found
if test -z "$DEVICE" ; then
print_error "You must set a device type with -device=<value>"
exit 1
fi
#
# Check that an ARCH was set or found
if test -z "$ARCH" ; then
print_error "You must set an architecture type with -arch=<value>"
exit 1
fi
#
# If some extensions are set, mark the defs
if test -n "$MPE_MPI_EXT_C" ; then
AC_DEFINE(MPE_USE_EXTENSIONS)
fi
############################################################################
# In order to determine the correct compilers and options to use,
# we sometimes need to get more detailed information on the system
# This is osversion, osvminor, and cputype.
# Currently, only IRIX uses this
############################################################################
PAC_GET_SPECIAL_SYSTEM_INFO
# special case 'sgi5' for use on MESHINE which is much like an SGI running
# irix 5 with r4400 chips, but does not have 'hinv', so above code doesn't
# work
if test -n "$arch_sgi5"; then
osversion=5
cputype=4400
IRIXARCH="$ARCH_$osversion"
IRIXARCH="$IRIXARCH_$cputype"
echo "IRIX-specific architecture is $IRIXARCH"
fi
if test -n "$arch_EWS_UX_V" ; then
# This is a Unix System V system running on MIP/SGI processors
LIB_LIST="$LIB_LIST -lsocket -lnsl -lc"
fi
#
# End of architecture-specific tests
#
# Create the "autoconf" style directory names...
#
# When we build with the virtual path feature, we want these directories
# to be relative to the build directory, not the source directory.
# One possibility is to redefine the Makefiles to use a local directory,
# with the "installation" directory given by the usual autoconf symbols (e.g.,
# libdir, includedir
#
# Default includedir should use prefix. For installation in place, we should
# just use prefix=localdir
# Alternate is to use build/<arch>/<device>/include
# Include dir for USER PROGRAMS
if test -z "$prefix" ; then prefix=$MPIR_HOME ; fi
if test -z "$includedir" ; then includedir="${prefix}/include" ; fi
AC_SUBST(includedir)
#
# We can't use a relative srcdir path because autoconf1 has a bug that
# resets top_srcdir to srcdir!
# srcdir is the directory that contains SOURCE files.
if test -z "$srcdir" -o "$srcdir" = "." ; then srcdir="$MPIR_HOME" ; fi
AC_SUBST(srcdir)
if test -z "$exec_prefix" ; then
exec_prefix='${prefix}'
fi
# exec_prefix is the prefix for directories containing machine-specific
# files such as libraries and executables. For the USER
AC_SUBST(exec_prefix)
# bindir is for executable programs for the USER
if test -z "$bindir" ; then bindir='${exec_prefix}/bin' ; fi
AC_SUBST(bindir)
# sbindir is for executable programs for the ADMINISTRATOR
if test -z "$sbindir" ; then sbindir='${exec_prefix}/sbin' ; fi
AC_SUBST(sbindir)
# libdir is for libraries for the USER
if test -z "$libdir" ; then libdir='${exec_prefix}/lib' ; fi
AC_SUBST(libdir)
if test -z "$sharedstatedir" ; then sharedstatedir='${prefix}/com' ; fi
AC_SUBST(sharedstatedir)
if test -z "$localstatedir" ; then localstatedir='${prefix}/var' ; fi
AC_SUBST(localstatedir)
#
# There are two sharedlib dirs for the future, when we will distinguish
# between the common, visable everywhere (e.g., NFS mounted) location, and
# the local, visable only on the referenceing machine (e.g., UFS mounted,
# such as /tmp) locations. SHAREDLIB_LOCALDIR is the local location.
if test -z "$sharedlib_dir" ; then
sharedlib_dir='${libdir}/shared'
else
SHAREDLIB_LOCALDIR=$sharedlib_dir
fi
AC_SUBST(sharedlib_dir)
AC_SUBST(SHAREDLIB_LOCALDIR)
SHARED_LIB_LOCALDIR="$SHAREDLIB_LOCAL_DIR"
AC_SUBST(SHARED_LIB_LOCALDIR)
# prefix is used to construct the rest of the variables.
if test -z "$prefix" ; then prefix=$PREFIX ; fi
AC_SUBST(prefix)
# mandir is the root for the man pages
if test -z "$mandir" ; then mandir='${prefix}/man' ; fi
AC_SUBST(mandir)
if test -z "$docdir" ; then docdir='${prefix}/doc' ; fi
AC_SUBST(docdir)
if test -z "$htmldir" ; then htmldir='${prefix}/www' ; fi
AC_SUBST(htmldir)
# top_srcdir is the top level source code directory (mpich home)
if test -z "$top_srcdir" -o "$top_srcdir" = "." ; then
top_srcdir=$MPIR_HOME
fi
AC_SUBST(top_srcdir)
if test -z "$datadir" ; then
datadir='${prefix}/share'
fi
AC_SUBST(datadir)
#
# libbuild_dir is used to build the libraries in before they are installed.
# binbuild_dir is for the scripts/programs
# includebuild_dir is for all user header files
rootbuild_dir=`pwd`
#
# pwd may provide an effectively invalid directory because of the design
# of automounters
if test -n "$AUTOMOUNTFIX" ; then
rtest=`echo $rootbuild_dir | $AUTOMOUNTFIX`
if test -d $rtest ; then
rootbuild_dir=$rtest
fi
fi
builddir="$rootbuild_dir"
AC_SUBST(builddir)
# initialize libbuild_dir, binbuild_dir, includebuild_dir
for dir in lib bin include ; do
dirname=${dir}build_dir
eval dirvalue=\$"$dirname"
if test -z "$dirvalue" ; then
eval $dirname=$rootbuild_dir/$dir
fi
eval dirvalue=\$"$dirname"
if test ! -d $dirvalue ; then
if mkdir $dirvalue ; then
:
else
print_error "Could not create directory $dirvalue"
exit 1
fi
fi
done
# sharedlibbuild_dir is special; It is set only if shared libs are
# built (see below)
AC_SUBST(libbuild_dir)
AC_SUBST(sharedlibbuild_dir)
AC_SUBST(binbuild_dir)
AC_SUBST(includebuild_dir)
# arch-specific readonly data goes? (message catalogs). Into sysconfdir
if test -z "$sysconfdir" ; then sysconfdir='${exec_prefix}/etc' ; fi
AC_SUBST(sysconfdir)
if test -z "$NOCXX" ; then
CPP_DIR="${CPP_DIR:-MPI-2-C++}"
# Allow standard environment variable for the C++ compiler
if test -n "$CXX" ; then CPP_COMPILER="$CXX" ; fi
if test -n "$CPP_COMPILER" ; then
AC_MSG_CHECKING([if $CPP_COMPILER returns correct error code])
cat > conftest.cc <<EOF
int main(){int a=b;}
EOF
$CPP_COMPILER -c conftest.cc>conftest.out 2>&1
if test $? = 0 ; then
AC_MSG_RESULT([no!...Cannot use $CPP_COMPILER compiler])
CPP_COMPILER=""
else
AC_MSG_RESULT(yes)
fi
/bin/rm conftest*
elif test -z "$CPP_COMPILER" ; then
# aCC is the HPUX ANSI C++ compiler (CC is their older one)
# We need to use xlC in preference to g++ on AIX
# And we need to use mpCC for ch_mpl device!
# We need to check that the compiler actually works!
# (note that g++ doesn't work on some Solaris 2.7 (64bit) platforms)
# Allow user to use CXX or CCC as an alternative for the compiler
for program in "$GXX" "$CXX" "$CCC" xlC g++ c++ aCC CC cxx ; do
# Skip empty values
if test -z "$program" ; then continue ; fi
# Does program exist?
AC_PROGRAM_CHECK(GXXTRIAL,$program,$program,)
if test "$GXXTRIAL" = "xlC" -a "$DEVICE" = "ch_mpl" ; then
GXXTRIAL=mpCC
fi
# Test that this really works: compile iostream.h
# Don't assume that g++ works (it can be installed improperly;
# it also doesn't work with 64-bit Solaris 2.7)
# (the autoconf tests are too GNU-centric)
if test -n "$GXXTRIAL" ; then
cat > conftest.cc <<EOF
#include <iostream.h>
EOF
rm -f conftest.out
if $GXXTRIAL -c conftest.cc >conftest.out 2>&1 ; then
AC_MSG_CHECKING([if $GXXTRIAL returns correct error code])
cat > conftest1.cc <<EOF
int main(){int a=b;}
EOF
$GXXTRIAL -c conftest1.cc>conftest1.out 2>&1
if test $? = 0; then
AC_MSG_RESULT([no!])
else
AC_MSG_RESULT(yes)
echo Compiling C++ interface with $GXXTRIAL
CPP_COMPILER="$GXXTRIAL"
GXX="$GXXTRIAL"
fi
else
print_error "C++ compiler $GXXTRIAL failed to compile a simple program"
print_error "C++ interface will not be built with this compiler"
if test -s conftest.out ; then
cat conftest.out >>config.log
fi
if test -s conftest.out ; then
cat conftest.out >>config.log
fi
GXX=""
fi
/bin/rm -f conftest*
GXXTRIAL=""
fi
# If we found a working C++ compiler, then stop looking.
if test -n "$GXX" ; then break ; fi
done
fi
# If we have a compiler, check that it works.
# pgCC failed to compile iostream.h on some Linux platforms
# (we need this test here because the test for compiling iostream.h
# used above is used only to *find* a compiler; if the user selected
# a compiler that doesn't work, we still need the test.
if test -n "$CPP_COMPILER" ; then
AC_MSG_CHECKING([that selected C++ compiler can compile iostream.h])
rm -f conftest*
cat > conftest.cc <<EOF
#include <iostream.h>
EOF
if $CPP_COMPILER -c conftest.cc>conftest.out 2>&1 ; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT([no!...Cannot use $CPP_COMPILER compiler])
CPP_COMPILER=""
NOCXX=1
fi
/bin/rm conftest*
fi
# Note that C++ doesn't support VPATH build yet.
# It does (sort of!)
if test -d ${top_srcdir}/${CPP_DIR} -a -n "$CPP_COMPILER" ; then
echo ' '
if test -d ${top_srcdir}/${CPP_DIR}/balky ; then
echo 'Include C++ bindings for MPI from http://www.osl.iu.edu/research/mpi2c++'
echo 'Send bug reports about the C++ to mpi2cpp-devel@osl.iu.edu'
fi
echo ' '
if test ! -d ${CPP_DIR} ; then mkdir ${CPP_DIR} ; fi
buildcpp=1
else
# No compiler found; set the C++ directory to null
CPP_DIR=""
fi
fi
#
# Set Default values of variables
if test -z "$NOCXX" ; then
if test -n "$CPP_COMPILER" -a -z "$CCLINKER" ; then
CCLINKER="$CPP_COMPILER"
fi
# -O conflicted with -O3, which the C++ configure uses with IRIX64
# Note that the C++ configure takes -O by default!
# The following are suitable ONLY while building C++
# autoconf2 uses CPPFLAGS for C PreProcessor
# CXXFLAGS="-I$MPIR_HOME/$CPP_DIR/src -I`pwd`/$CPP_DIR"
# CXXLDFLAGS="-L`pwd`/$CPP_DIR/src"
# This is for the Notre Dame version. The altcxx version just uses
# the mpi include dir
if test "$CPP_DIR" = "MPI-2-C++" ; then
CXXFLAGS='-I${includedir}/mpi2c++'
fi
if test "$CPP_COMPILER" = "g++" ; then
# Particularly for LDFLAGS, -fhandle-exceptions must ONLY be used
# for GNU g++
AC_MSG_CHECKING([for g++ compiler exception flags])
cat > conftest.cc <<EOF
int main () {}
EOF
$CPP_COMPILER -c conftest.cc -fhandle-exceptions 2>conftest.out
if test ! -s conftest.out ; then
CXXFLAGS="$CXXFLAGS -fhandle-exceptions"
AC_MSG_RESULT(-fhandle-exceptions)
else
/bin/rm -f conftest.o conftest.out
$CPP_COMPILER -c conftest.cc -fexceptions 2>conftest.out
if test ! -s conftest.out ; then
CXXFLAGS="$CXXFLAGS -fexceptions"
AC_MSG_RESULT(-fexceptions)
else
AC_MSG_RESULT(not determined)
fi
/bin/rm -f conftest.o conftest.out conftest.cc
fi
# These LDFLAGS break configure tests that try to link when the
# compiler is not the C++ compiler.
# These should be CPPLDFLAGS, if those are required
#CPPLDFLAGS="$LDFLAGS -fhandle-exceptions"
fi
fi
if test -n "$CCC" ; then
CPP_COMPILER=${CCC}
fi
#
# For autoconf 2, we may need evaluated values for these routines (since
# the values for these can be Makefile expressions, rather than sh expressions)
# Check all of the devices first; they need to be known
# before doing the transport layer
#
# Get the C compiler, Fortran compiler, and archiver
CARCH=$ARCH
case $DEVICE in
ch_cenju3) CARCH=cenju3 ;;
ch_mpl|ch_eui) CARCH=ibmpoe ;;
ch_meiko|meiko) CARCH=meiko ;;
ch_nx|nx) CARCH=intelnx ;;
esac
# First, check for the basic CC
# Note that get_ansi_cc does a programs_check
if test -z "$USERCC" ; then
# We do NOT want to use PROG_CC because it prefers gcc over the
# vendor's compiler. This is ok for the GNU tools, but is not
# what we want for MPICH.
# PROG_CC simply looks for gcc and then cc. We just flip this around.
dnl _PROG_CC
PAC_PROGRAMS_CHECK(CC,cc gcc)
dnl This also eliminates the gcc short-circuit in the tests. A good
dnl thing too, since gcc might change!
fi
dnl GET_ANSI_CC looks for a compiler that accepts prototypes. It tries
dnl gcc if the selected CC doesn't accept prototypes
PAC_GET_ANSI_CC($CARCH)
if test "$needs_gcc" = "yes" ; then
# Check that compiler is gcc
dnl In autoconf 2, you can use AC_PROG_CC_GNU
AC_MSG_CHECKING([whether we are using GNU C])
dnl The semicolon is to pacify NeXT's syntax-checking cpp.
cat > conftest.c <<EOF
#ifdef __GNUC__
yes;
#endif
EOF
if ${CC-cc} -E conftest.c | egrep yes >/dev/null 2>&1 ; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
fi
AC_MSG_RESULT($ac_cv_prog_gcc)
if test $ac_cv_prog_gcc = "no" ; then
print_error "gcc required for these configure options"
exit 1
fi
rm -f conftest*
fi
if test $NOF77 = 0 ; then
PAC_GET_F77($CARCH)
else
HAS_F77=0
fi
if test -z "$TESTF77" ; then
TESTF77="$F77"
fi
# if HAS_F77 = 0, then define the same variables as if the -nof77 switch
# was given at configure time
if test "$HAS_F77" = "0" ; then
echo "Will not build the Fortran interfaces"
NOF77=1
HAS_FORTRAN=0
CFLAGS="-DMPID_NO_FORTRAN $CFLAGS"
romio_config_args="$romio_config_args -disable-f77"
fi
#
PAC_GET_AR($CARCH)
AC_SUBST(ARNAME)
#
# Check to see if the compilers work at all (you'd be surprised!)
AC_COMPILE_CHECK([whether compiler works],,,compile_check=yes,compile_check=no)
if test "$compile_check" = "no" ; then
print_error "Compiler $CC failed to compile a simple program!"
exit 1
fi
#
# Check to see if the compiler accepts prototypes
PAC_CHECK_CC_PROTOTYPES(AC_DEFINE(HAVE_PROTOTYPES))
#
# Check to see if compiler has old_style CPP concat
PAC_CHECK_CPP_CONCAT(,AC_DEFINE(OLD_STYLE_CPP_CONCAT))
#
# Check to see if it accepts const
HAVE_NO_C_CONST=0
AC_SUBST(HAVE_NO_C_CONST)
PAC_CHECK_CC_CONST(,AC_DEFINE(HAVE_NO_C_CONST)
HAVE_NO_C_CONST=1
ROMIO_CFLAGS="$ROMIO_CFLAGS -DHAVE_NO_C_CONST")
# Panic check to see if we have any compiler at all
if test -z "$CC" ; then
print_error "Could not find a C compiler!"
exit 1
fi
# We must NOT check for Unix variants until after we have determined the
# compiler that we will use. This is due to a bug in autoconf: it tries to
# use the C preprocessor directly, without invoking the compiler.
# Unfortunately, the preprocessor that it uses may bear no relationship to the
# compiler.
AC_PROG_CPP
# Check for Unix Variants
AC_AIX
AC_MINIX
#
# Before we go any farther, check for cross-compiling
# We can't do this yet, but we need to
#
# Check to see if it accepts volatile (needed in src/nerrmsgs.c as well as
# some devices)
PAC_HAVE_VOLATILE
# Check for shared library options
if test -z "$SHAREDKIND" ; then
SHAREDKIND="ignore"
fi
if test -z "$SHAREDKIND_FOR_TV" ; then
SHAREDKIND_FOR_TV="ignore"
fi
#
# This needs a script that makes the tests and returns the answer;
# we can later let autoconf figure out how to include the needed info
# One option is to use libtool if it is available.
if test "$UseSharedLibs" = 1 -o "$debug_version" = 1 ; then
# Options are -fPIC for C (gcc)
# -KPIC (Solaris SunPro)
# (none) (AIX, but making the library itself is a mess, and allows -KPIC
# as an option!)
# (none) (Alpha, but allows -fPIC as an option!)
# +Z for HPUX
#
# There are also needed linker options. For example, under solaris,
# -R<mpich-lib-dir>:$LD_RUN_PATH is needed; this should be determined
# at mpicc LINK time. These are provided by the makesharedlib script
if test "$CC" != "gcc" -a "$ARCH" = "rs6000" ; then
NEEDS_CC_SHARED_OPT=0
fi
if test "$CC" != "gcc" -a "$ARCH" = "alpha" ; then
NEEDS_CC_SHARED_OPT=0
fi
if test "$NEEDS_CC_SHARED_OPT" = 1 ; then
# CHECK_COMPILER_OPTION adds option if successful
CFLAGSSAV="$CFLAGS"
if test -z "$CC_SHARED_OPT" ; then
PAC_CHECK_COMPILER_OPTION(-fPIC,CC_SHARED_OPT=-fPIC;SHAREDKIND="gcc")
# Check that we can link with that option
# Note that this does NOT work with SunOS
fi
if test -z "$CC_SHARED_OPT" ; then
PAC_CHECK_COMPILER_OPTION(-KPIC,CC_SHARED_OPT=-KPIC)
if test $ARCH = "solaris" ; then
SHAREDKIND=solaris
# This only works with some compilers.
# Also note that this overrides LD_RUN_PATH
# -R is used for RUNTIME linking (dlopen)
#LDFLAGS="$LDFLAGS -R$libdir/shared"
elif test $ARCH = "IRIX" -o $ARCH = "IRIX64" -o $ARCH = "IRIXN32" ; then
# for testing only
SHAREDKIND=irix
elif test $ARCH = "ALPHA" -o $ARCH = "OSF" ; then
SHAREDKIND=osf
fi
if test -z "$CC_SHARED_OPT" -a "$ARCH" = "hpux" ; then
PAC_CHECK_COMPILER_OPTION(-KPIC,CC_SHARED_OPT=+Z)
fi
fi
CFLAGS="$CFLAGSSAV"
# This isn't quite right, but it will work for some systems
# Export the shared option to the MPI-2-C++ configure
CXXFLAGS_FOR_SHARED=$CC_SHARED_OPT
fi
if test "$SHAREDKIND" != "ignore" ; then
# Fortran choices
# (none)
# -PIC (SunOS)
# -KPIC (Solaris, IRIX)
# -fPIC (gcc/g77)
# This is made more compilicated by the fact that some systems
# accept -PIC, but for very different options (e.g., absoft).
#
# CHECK_COMPILER_OPTION adds option if successful
FFLAGSSAV="$FFLAGS"
if test -z "$FC_SHARED_OPT" ; then
PAC_CHECK_FC_COMPILER_OPTION(-PIC,FC_SHARED_OPT=-PIC)
fi
if test -z "$FC_SHARED_OPT" ; then
PAC_CHECK_FC_COMPILER_OPTION(-fPIC,FC_SHARED_OPT=-fPIC)
fi
if test -z "$FC_SHARED_OPT" ; then
PAC_CHECK_FC_COMPILER_OPTION(-KPIC,FC_SHARED_OPT=-KPIC)
fi
# Handle the special case of a predefined value of <none needed>
if test "$FC_SHARED_OPT" = "none" ; then
FC_SHARED_OPT=""
fi
FFLAGS="$FFLAGSSAV"
fi
# Check that the shared libraries work
export CC
export CLINKER
SHARED_LIB_PATH="-L."
export SHARED_LIB_PATH
SHARED_LIB_UTIL="${top_srcdir}/util/makesharedlib -noecho -kind=$SHAREDKIND -local -link -noverbose"
# We need to put the execution of makesharedlib within "" because the
# value may have a trailing blank.
AC_MSG_CHECKING([for argument used to indicate shared lib search dir])
SHARED_LIB_SEARCH_PATH_LEADER="`${top_srcdir}/util/makesharedlib -kind=$SHAREDKIND -getpathspec`"
AC_SUBST(SHARED_LIB_SEARCH_PATH_LEADER)
AC_MSG_RESULT([$SHARED_LIB_SEARCH_PATH_LEADER])
SHARED_LIB_SEARCH_PATH="${SHARED_LIB_SEARCH_PATH_LEADER}`pwd`"
PAC_SHARED_LIBS_OK(,SHAREDKIND=ignore)
# Note that configure uses CFLAGS for compiling and linking !
# Add the shared option only if we're building shared libraries
# (the shared option is also needed when building the totalview
# dynamically loadable queue library).
SHAREDKIND_FOR_TV="$SHAREDKIND"
if test "$SHAREDKIND" = "ignore" ; then
UseSharedLibs=0
SHARED_LIB_SEARCH_PATH_LEADER=""
SHARED_LIB_PATH=""
fi
if test "$UseSharedLibs" = 1 ; then
# If CFLAGS will have the SHARED_OPT, the TV build won't need its
# own copy. If we aren't building the shared libs, then
# we set the OPT_FOR_TV in the other branch of the if.
CFLAGS="$CC_SHARED_OPT $CFLAGS"
FFLAGS="$FC_SHARED_OPT $FFLAGS"
else
CC_SHARED_OPT_FOR_TV="$CC_SHARED_OPT"
CC_SHARED_OPT=""
FC_SHARED_OPT=""
CXXFLAGS_FOR_SHARED=""
SHAREDKIND="ignore"
fi
# If we can't find the appropriate options, we should switch to
# UseSharedLibs=0
fi
if test $UseSharedLibs = 1 ; then
if test -z "$sharedlibbuild_dir" ; then
sharedlibbuild_dir="$libbuild_dir/shared"
fi
if test ! -d $sharedlibbuild_dir ; then
if mkdir $sharedlibbuild_dir ; then
:
else
print_error "Could not create directory $sharedlibbuild_dir"
exit 1
fi
fi
# This allows us to pass this argument to the c++ configure.
CXXENABLE="--enable-shared"
AC_SUBST(CXXENABLE)
fi
AC_SUBST(CC_SHARED_OPT)
AC_SUBST(CC_SHARED_OPT_FOR_TV)
AC_SUBST(CXXFLAGS_FOR_SHARED)
AC_SUBST(SHAREDKIND)
AC_SUBST(SHAREDKIND_FOR_TV)
#
# Base size of MPI_Status is four integers. The selected device may need to
# increase the size in order to store extra information
#
MPI_STATUS_SIZE=4
export MPI_STATUS_SIZE
AC_SUBST(MPI_STATUS_SIZE)dnl
#
#
# Various systems have known special needs (particularly libraries);
# get thos here
#
DEFAULT_MACHINE=$DEVICE
#
#
# we could have some "blessed" devices using an dnl include
# statement, which would simplify some of the setup. However, it increases
# the inter-relationships between the main configure and the individual
# devices.
#
eval top_srcdir_val="$top_srcdir"
device_setupfile="setup_$DEVICE"
if test -f "$srcdir/mpid/$DEVICE/$device_setupfile" ; then
# Source the file. This way it inherits all variables and can
# change any that it wants. The alternative is to have an explicit
# import/export list.
# If this device has any special needs, such as #defines, it should
# use a configure with a header file specific for that device, rather
# than including them in the master mpichconf.h file.
# Should set DEFAULT_MACHINE type
# Should set MPIBOOT and MPIUNBOOT if provided
# Create any device-specific configuration header files
# This is run in the TOP directory; if the setup script needs to run in
# the device directory, it should change to that directory
#
# The setup program should also be careful to remove any
# configuration-specific files (such as config.h files) from both the
# local directory and the source directory in case a VPATH build is
# being done.
# if we're the developers, we may need to create the
# initial configure files.
if test ! -x "$top_srcdir_val/mpid/$DEVICE/configure" -a \
-s "$top_srcdir_val/mpid/$DEVICE/configure.in" -a \
-x "$top_srcdir_val/mpid/$DEVICE/makeconfigure" ; then
(cd "$top_srcdir_val/mpid/$DEVICE" ; ./makeconfigure)
fi
echo "Running device-specific setup program"
#
# Any device-specific args (--with-device=DEVICE:deviceargs) are
# in the variable device_args.
#
# Note that configure uses "set dummy $p" this resets the positional
# parameters. We clear this with
set dummy
shift
if test ! -d mpid/$DEVICE ; then
if test ! -d mpid ; then mkdir mpid ; fi
mkdir mpid/$DEVICE
fi
# We must run this from the relative directory, since we may be building
# a build tree in another location (. != $srcdir)
. "$srcdir/mpid/$DEVICE/$device_setupfile"
if test $? != 0 ; then
print_error "Setup of $DEVICE failed! Aborting configure"
exit 1
fi
# If we created an mpich-mpid.h file, add that definition
if test -s mpid/$DEVICE/mpich-mpid.h ; then
AC_DEFINE(HAVE_MPICH_MPID_H,,[define if the device creates an mpich-mpid.h include file])
fi
fi
#
# ch_shmem/ch_lfshmem have a setup_ch_shmem file
#
# ch_gm have a setup file
#
# meiko and ch_meiko have a setup file
#
# ch_mpl has a setup file
#
# Globus has a setup file (previously BEFORE the CC/FC find steps)
dnl if test -n "$device_ch_spp" ; then
dnl DEFAULT_MACHINE="convex_spp"
dnl if test -z "$OPTFLAGS" ; then
dnl # If optimization is turned on, the wrong code is generated for
dnl # some operations with unsigned chars.
dnl OPTFLAGS=-O0
dnl fi
dnl AC_RETSIGTYPE
dnl PAC_HAVE_VOLATILE
dnl PAC_SIGNALS_WORK
dnl #
dnl LIB_LIST="$LIB_LIST -lcnx_syscall /lib/libail.sl"
dnl fi
#
# The following is shared with some devices. How should we do this?
# It should be a common macro PAC _WORKING_ANON_MMAP
# Later devices use /dev/zero trick
if test \( -n "$device_ch_p4" -a "$COMM" = "shared" \) ; then
MMAP=0
PAC_HAVE_ANON_MMAP(MMAP=1,AC_DEFINE(HAVE_NO_ANON_MMAP))
# We need to check that semctl is ok.
PAC_SEMGET_WORKS(SEMGET=1,SEMGET=0,print_error)
if test $MMAP = 0 -a "$SEMGET" = 0; then
print_error "Configure detected that both anonymous mmap and semget fail."
print_error "Configuring MPICH for shared memory may cause problems!"
fi
fi
dnl
if test -n "$device_ch_p4"; then
P4EXT=""
fi
if test -n "$device_ch_p4mpd"; then
P4EXT="mpd"
if test "$COMM" = "ch_p4mpd"; then
COMM="ch_p4"
echo "Setting COMM to ch_p4 for ch_p4mpd device"
fi
fi
#
# Architecture-specific tests. These should go into aclocal files (e.g.,
# acarch_$archname, which aclocal.m4 loads with include
# PAC _OS_VERSION (already in special system macro)
# PAC _ARCH_CC_FLAGS
# PAC _ARCH_FC_FLAGS
# PAC _ARCH_SPECIFIC
#
# Note that some of these tests need to be made more generic
# (e.g., FORTRAN_SPECIAL_POINTER)
if test -n "$arch_IRIX"; then
# We now have to look at all sorts of things to determine the
# various flags. We need to set both the CFLAGS and various options
# for the linkers (by setting CLINKER and FLINKER).
# The OS version and chipset were determined above so that they could
# be used to set the P4_ARCH if necessary.
#
# Latest information we have is that (thanks to Winfrid Tschiedel
# <Winfrid.Tschiedel@mch.sni.de>):
# cputype Instruction sets
# R4X00 -mips2 -mips3 (mips2 requires -32)
# R5000, R8000 and R10000 : -mips2 (-32) and -mips3 (-n32 or -64)
# -mips4 (-n32 or -64)
# Also, IRIX 6.2 supports R4X00 only in 32 bit mode (requires -n32)
# EXCEPT for R4400, which also supports -64.
# In 6.2, the defaults SEEM to be -32 -mips 2
# but you may need -64 -mips3 OR -mips 4 OR -n32 -mips3 or -mips4
# Also, some systems REQUIRE -non_shared and others REQUIRE NOT
# -non_shared.
#
# Finally, compilation with optimization may stress the linker;
# include -TENV:large_GOT=ON in this case
#
if test $osversion = 4 ; then
# Nathan's tests showed that we needed this.
RANLIB="ar ts"
elif test $osversion = 5 ; then
# Turn off warnings about long doubles not being supported.
if test "$CC" != "gcc" ; then
CFLAGS="$CFLAGS -woff 728"
# Other useful woff values are: 852,635,813,831,835
fi
elif test $osversion = 6 ; then
# these flags settings are handled by including MDEPCFLAGS from p4
SYMTYPE=""
# We should not use/need these tests (I just had to add cputype =
# 12000)
if test $cputype -ge 8000 ; then
if test -n "$arch_IRIX64" ; then
SYMTYPE="-64 -mips4"
elif test -n "$arch_IRIXN32" ; then
SYMTYPE="-n32"
else
SYMTYPE="-32"
fi
elif test $cputype -gt 4000 ; then
if test -n "$arch_IRIX64" ; then
SYMTYPE="-64 -mips3"
elif test -n "$arch_IRIXN32" ; then
SYMTYPE="-n32"
else
SYMTYPE="-32"
fi
else
# According to winfrid.tschiedel@mch.sni.de, need -n32 for R4000
SYMTYPE="-n32"
# Not "-n32 -mips3"?
fi
if test -n "$P4_MDEPFFLAGS" ; then
# This no longer works. At least at MCS, the Fortran compiler
# won't accept these.
addflags=0
PAC_CHECK_FC_COMPILER_OPTION($P4_MDEPFFLAGS,addflags=1)
if test $addflags = 1 ; then
FFLAGS="$FFLAGS $P4_MDEPFFLAGS"
fi
fi
# Warning flags are > 1000
# CFLAGS="$CFLAGS -woff 1152,1174,1184"
# 1184 not in the p4 list
if test "$CC" != "gcc" ; then
CFLAGS="$CFLAGS -woff 1185,1184,1174"
fi
# Check whether we need to add SYMTYPE to CFLAGS and FFLAGS
hasarg=`echo A$CFLAGS | sed -n -e '/-n32/p' -e '/-32/p' -e '/-64/p'`
# override SYMTYPE computed above (2/21)
# !!!! overriding the SYMTYPE eliminates the ability to select compiler
# option for the symbol type. Instead, we MANDATE that IRIX64 implies
# -64 and IRIXN32 implies -n32.
SYMTYPE=""
if test -z "$hasarg" ; then
CC="$CC $SYMTYPE"
F77="$F77 $SYMTYPE"
CLINKER="$CC $SYMTYPE"
FLINKER="$F77 $SYMTYPE"
# else
# hasarg=`echo A$CLINKER | sed -n -e '/-n32/p' -e '/-32/p' -e '/-64/p'`
# if test -z "$hasarg" ; then
# # We need to make the linker compatible with the compiler.
# fi
fi
fi
echo "Messages about long doubles not being supported are being suppressed"
dnl AC_HAVE_ LIBRARY ( sun )
fi
# for symm_ptx, add the ptx_ifile to LIB_LIST
if test -n "$arch_symm_ptx"; then
LIB_LIST="$LIB_LIST $MPIR_HOME/util/ptx_ifile"
fi
# check whether --arch=intelnx was given
# Use this for both i860 and Delta
if test -n "$arch_intelnx"; then
DEFAULT_MACHINE="i860"
# Note that RANLIB may be set incorrectly if we are cross-compiling...
RANLIB=true
# inteldelta is used to select the appropriate args to killproc...
DEVCFLAGS="$DEVCFLAGS -Dinteldelta"
#
# X11 includes are in /usr/ipsc/XDEV/i860/include-ipsc/X11
# X11 libs are in /usr/ipsc/XDEV/i860/lib-coff
# at least on one system
fi
# check whether --arch=paragon was given
if test -n "$arch_paragon"; then
DEFAULT_MACHINE="paragon"
#OPTFLAGS="-O"
# Note that RANLIB may be set incorrectly if we are cross-compiling...
RANLIB=true
#echo "If you get errors about killproc, uncomment this line"
#DEVCFLAGS="$DEVCFLAGS -DPARAGON_HAS_NO_KILLPROC"
fi
if test -n "$arch_CRAY"; then
# The CRAY cp doesn't even support -r (!!) but at least there
# is a version that does work.
if test -x /usr/ucb/cp ; then
CPRP="/usr/ucb/cp"
else
print_error "Using default cp for copy; install may fail if -r and -p"
print_error "switches are not supported."
fi
# It might be better to use AR="bld qvz" than the regular ar clr
DEVCFLAGS="$DEVCFLAGS -DMPID_FLOAT_CRAY"
# According to Laurie Costello <lmc@cray.com>, the Triton needs this
# definition
dnl
# If tested code does NOT compile, then define _TWO_WORD_FCD
AC_COMPILE_CHECK([whether TWO_WORD_FCDs are used],
[#include <fortran.h>],[void *buf;_fcd temp;temp = _fcdtocp(buf);],
compile_check=yes,compile_check=no)
if test "$compile_check" = "no" ; then
TEMP_CFLAGS=$CFLAGS
CFLAGS="-D_TWO_WORD_FCD $CFLAGS"
AC_COMPILE_CHECK([whether program compiles if _TWO_WORD_FCD is defined ],
[#include <fortran.h>],[void *buf;_fcd temp;temp = _fcdtocp(buf);],
compile_check=yes,compile_check=no)
if test "$compile_check" = "no" ; then
print_error "You may have problems compiling the Fortran interface",
print_error "specifically calls to _fcdtocp"
elif test "$compile_check" = "yes" ; then
AC_DEFINE(_TWO_WORD_FCD)
fi
CFLAGS=$TEMP_CFLAGS
fi
#
dnl if test -n "$arch_CRAYTS" ; then
dnl AC_DEFINE(_TWO_WORD_FCD)
dnl fi
fi
#
# The compilers are in /mpp/bin (at least on some systems)
# You may also need
# setenv TARGET cray-t3d
# Also need -lsma library
if test -n "$arch_cray_t3d"; then
DEFAULT_MACHINE="cray_t3d"
LIB_LIST="$LIB_LIST -lsma"
RANLIB=true
# dbxerr not supported by T3D (-mpedbg)
MPE_MPI_EXT_C="mpehname.c"
MPE_MPI_EXT_O="mpehname.o"
AC_DEFINE(MPI_NO_MPEDBG)
# The CRAY cp doesn't even support -r (!!) but at least there
# is a version that does work.
if test -x /usr/ucb/cp ; then
CPRP="/usr/ucb/cp"
else
print_error "Using default cp for copy; install may fail if -r and -p"
print_error "switches are not supported."
fi
# ASMFILES_O="shmem_stack.o get_stack.o"
# Some users needed /mpp/bin/asm, others /opt/ctl/bin/cam
for asm in /mpp/bin/cam /opt/ctl/bin/cam /mpp/bin/asm ; do
if test -s $asm ; then
ASM=$asm
break
fi
done
if test -z "$ASM" ; then
print_error "Cannot find assembler needed to build MPICH"
print_error "Neither /mpp/bin/cam, /opt/ctl/bin/cam, nor "
print_error "/mpp/bin/asm is available."
exit 1
fi
#
# This is needed for the Fortran interfaces (also for the triton CRAY TS)
AC_DEFINE(_TWO_WORD_FCD)
fi
# In default (pre-ANSI) mode, nested #if's cause most of the file to
# be SILENTLY skipped.
if test -n "$arch_hpux" -o -n "$arch_sppux" ; then
if test -n "$device_ch_shmem" -o -n "$device_ch_lfshmem" ; then
ASMFILES_O="amem.o"
DEVCFILES="mem.c"
DEVOFILES="mem.o"
fi
if test -n "$device_ch_shmem" -a -n "$comm_convex_spp" ; then
DEVCFILES="shmem1stbar.c cnxCxdb.c cnxQuerySC.c cnxGlobalop.c cnxCopy.c"
DEVOFILES="shmem1stbar.o cnxCxdb.o cnxQuerySC.o cnxGlobalop.o cnxCopy.o"
fi
# We can also remove +U77 and -lU77 from the p4 lib/defs.all file.
fi
#
# We need to check for this - it is probably the Fujitsu problem with
# attributes.
if test -n "$arch_UXPM" ; then
# This asserts that Fortran passes functions by passing the address of the
# pointer to the function.
# We really need a TEST for this
dnl AC_DEFINE(FORTRAN_SPECIAL_FUNCTION_PTR)
# Suggested values for these are
#CFLAGS=-O
dnl #FFLAGS=-Oe,-U -Aabe ( Parameter e is not supported on uxp/m )
FLINKER=frt
FLIBS="$FLIB_PATH $LIB_LIST"
fi
if test -n "$arch_uxpv" ; then
# This asserts that Fortran passes functions by passing the address of the
# pointer to the function.
# We really need a TEST for this
dnl AC_DEFINE(FORTRAN_SPECIAL_FUNCTION_PTR)
# Suggested values for these are
#CFLAGS=-O
# Thanks to Winfrid Tschiedel <Winfrid.Tschiedel@mch.sni.de> for
# this information
dnl FLINKER="ld -dy -J /usr/ccs/lib/crt0.o /usr/lang/lib/fj90rt0.o /usr/ccs/lib/values-Xt.o"
FLINKER="frt -sc -Wl,-dy" # it works already and it is close the final solution
# This isn't quite correct, but at least this is a place to put this
# information.
dnl FLIBS="$FLIB_PATH $LIB_LIST -lfj90 -lfj90fv -lfj90f -lfjsamp -lm -lelf -lsocket -lnsl -lgen -lpx -ljsp -lvfl -lc"
FLIBS="$FLIB_PATH $LIB_LIST"
fi
#
# Not all versions of gcc support -munalign-doubles!
#if test -n "$arch_sun4" -o -n "$arch_solaris" ; then
# if test "$CC" = "gcc" -a "$NOF77" = 0 ; then
# CC="$CC -munaliged-doubles"
# fi
#fi
dnl if test -n "$arch_SX4" ; then
dnl CFLAGS="$CFLAGS -pvctl,nomsg -DCHAR_PTR_IS_ADDRESS"
dnl fi
# This really needs to look at arches of the form SX_4_float[012] and
# SX_4_float2_int64
issx4=`expr "$ARCH" : "\(SX_4_float\)[012]"`
if test "$issx4" = "SX_4_float" ; then
arch_SX4=1
fi
if test -n "$arch_SX4" ; then
# The -pvctl,nomsg option suppresses "vec inf: Unvectorized loop"
# messages from the compiler. Need to test that this is a valid
# option....
# Also note that it causes -hobjlst (assembly listing) to silently fail.
dnl CFLAGS="$CFLAGS -pvctl,nomsg -DCHAR_PTR_IS_ADDRESS"
if test -n "$device_ch_lfshmem" ; then
ASMFILES_O="vtest1.o syncvset0.o syncvset1.o vmemcpy.o tslock.o tsunlock.o tslock_init.o"
DEVCFLAGS="$DEVCFLAGS -DLOCKS_PICKED -DUSE_TSLOCKS -DMPID_USE_SX4_VOPS"
#
if test -z "$sx4int" ; then
if test "$ARCH" = SX_4_float2_int64 ; then
sx4int=int64
else
sx4int=int32
fi
fi
for file in $ASMFILES_O
do
files=`echo $file | sed -e "s/.o$/.s/"`
rm -f mpid/$DEVICE/$files
cp mpid/$DEVICE/sx4_$sx4int/$files mpid/$DEVICE/$files
done
else
DEVCFLAGS="$DEVCFLAGS -DLOCKS_PICKED -DUSE_SEMOP"
fi
DEVCFLAGS="$DEVCFLAGS -DHAVE_SHMAT=1 -DHAVE_SEMOP=1 -DRETSIGTYPE=void -DHAVE_SIGACTION -DMPI_SX_4 -DMPID_SETUP_SIGNALS"
dnl # We've learned that if Fortran is selected, you should use Fortran to
dnl # link with.
dnl if test "$USERCLINKER" != 1 -a "$NOF77" != 1 -a -n "$FLINKER" ; then
dnl CLINKER="$FLINKER"
dnl fi
fi
#
# Finally, we are ready to check to see if we are cross-compiling.
#
if test "$cross_compiling" = 0 -o -z "$cross_compiling" ; then
AC_CROSS_CHECK()
fi
#
if test "$cross_compiling" = 1 ; then
if test $DEVICE = ch_shmem -o $DEVICE = ch_p4 -o $DEVICE = ch_p4mpd \
-o $DEVICE = ch_lfshmem ; then
print_error "Configure was unable to compile and run a simple program."
fi
fi
#
# clock_gettime is the POSIX gettimeofday
# gethrtime is the Solaris high-resolution timer
AC_HAVE_FUNCS(gethrtime)
# POSIX *requires* that the include for clock_gettime is <time.h>.
# Unfortunately, FreeBSD incorrectly uses sys/time.h. Since time.h is
# provided, we need to check that CLOCK_REALTIME is defined
AC_FUNC_CHECK(clock_gettime,have_clock_gettime=yes,have_clock_gettime=no)
AC_FUNC_CHECK(clock_getres,have_clock_getres=yes,have_clock_getres=no)
if test "$have_clock_gettime" = "yes" -a "$have_clock_getres" = "yes" ; then
AC_COMPILE_CHECK([whether CLOCK_REALTIME is defined in time.h],
[#include <time.h>],[clockid_t cid = CLOCK_REALTIME;],
posix_time=yes,posix_time=no)
if test "$posix_time" = "yes" ; then
AC_DEFINE(HAVE_CLOCK_GETTIME,,[have posix gettime])
AC_DEFINE(HAVE_CLOCK_GETRES,,[have posix getres])
else
AC_MSG_WARN([Posix timers not correctly implemented])
fi
fi
#
# Some devices use gettimeofday. If this is one of them, check to see
# what form it is
PAC_IS_GETTIMEOFDAY_OK(,DEVCFLAGS="$DEVCFLAGS -DUSE_WIERDGETTIMEOFDAY")
# Look for sigaction routine (instead of signal)
# This is used in one of the TEST programs (sigchk.c)
# FIXME!!! (move to test configure?)
PAC_CHECK_HEADERS(signal.h)
AC_HAVE_FUNCS(sigaction)
AC_COMPILE_CHECK(for struct sigaction,[#include <signal.h>],[
struct sigaction act; sigaddset( &act.sa_mask, SIGINT );],sigaction_ok="yes",sigaction_ok="no")
#
# Test for weak symbol support...
# We can't put # in the message because it causes autoconf to generate
# incorrect code
HAS_WEAK_SYMBOLS=0
AC_SUBST(HAS_WEAK_SYMBOLS)
if test $TRY_WEAK_SYMBOLS = 1 ; then
AC_MSG_CHECKING(for weak symbol support)
AC_TRY_LINK([
extern int PFoo(int a);
#pragma weak PFoo = Foo
int Foo(a) { return a; }
],[return PFoo(1);],has_pragma_weak=1)
#
# Some systems (Linux ia64 and ecc, for example), support weak symbols
# only within a single object file! This tests that case.
if test "$has_pragma_weak" = 1 ; then
AC_MSG_RESULT([pragma weak])
AC_MSG_CHECKING([that weak symbols are visible to other files])
rm -f conftest*
cat >>conftest1.c <<EOF
extern int PFoo(int a);
#pragma weak PFoo = Foo
int Foo(int);
int Foo(a) { return a; }
EOF
cat >>conftest2.c <<EOF
int main() {
return PFoo(0);}
EOF
ac_link2='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest1.c conftest2.c $LIBS >conftest.out 2>&1'
if eval $ac_link2 ; then
AC_MSG_RESULT(yes)
else
echo "$ac_link2" >>config.log
echo "Failed program was" >>config.log
cat conftest1.c >>config.log
cat conftest2.c >>config.log
if test -s conftest.out ; then cat conftest.out >> config.log ; fi
AC_MSG_RESULT(no)
has_pragma_weak=0
fi
rm -f conftest*
fi
#
if test "$has_pragma_weak" = 1 ; then
dnl AC_MSG_RESULT([pragma weak]) (setup above)
HAS_WEAK_SYMBOLS=1
AC_DEFINE(HAVE_PRAGMA_WEAK)
else
AC_TRY_LINK([
#pragma _HP_SECONDARY_DEF Foo PFoo
int Foo(a) { return a; }
],[return PFoo(1);],has_pragma_hp_secondary=1)
if test "$has_pragma_hp_secondary" = 1 ; then
AC_MSG_RESULT([pragma _HP_SECONDARY_DEF])
HAS_WEAK_SYMBOLS=1
AC_DEFINE(HAVE_PRAGMA_HP_SEC_DEF)
else
AC_TRY_LINK([
#pragma _CRI duplicate PFoo as Foo
int Foo(a) { return a; }
],[return PFoo(1);],has_pragma_cri_duplicate=1)
if test "$has_pragma_cri_duplicate" = 1 ; then
AC_MSG_RESULT([pragma _CRI duplicate x as y])
HAS_WEAK_SYMBOLS=1
AC_DEFINE(HAVE_PRAGMA_CRI_DUP)
else
AC_MSG_RESULT(no)
fi
fi
fi
fi
if test "$HAS_WEAK_SYMBOLS" = "1" ; then
AC_DEFINE(HAVE_WEAK_SYMBOLS)
MPI_WITH_PMPI="yes"
else
MPI_WITH_PMPI="no"
fi
AC_SUBST(MPI_WITH_PMPI)
#
#
# Check for remote shell program (not needed for all devices)
# PARTIAL FIX: use only for DEVICE_KIND == network.
# FIXME: Who needs this?
if test $DEVICE_KIND = network -a -z "$rshcommand" ; then
PAC_PROGRAMS_CHECK(RSHCOMMAND,remsh rsh ssh)
# should check that it works
rshcommand="$RSHCOMMAND"
fi
#
# Check for perl and perl version
PAC_PROGRAMS_CHECK(PERL,perl5 perl,,,PERLFULLPATH)
if test -n "$PERL" ; then
PERL="$PERLFULLPATH"
changequote(<<,>>)
dnl perlversion=`$PERL -v | grep 'This is perl' | \
dnl sed -e 's/^.*version *\([0-9]\).*$/\1/'`
dnl This might not work in previous versions of perl.
dnl In particular, perl v 4 returns a long string for $] rather than
dnl a useful version number.
perlversion=`$PERL -e 'print <<substr>>($],0,1)."\n";' </dev/null`
changequote([,])
# Should do a test first for ch_p4 etc.
if test "$perlversion" != 5 ; then
if test "$perlversion" = "\$" ; then
# Get the entire string
perlversion=`$PERL -e 'print $]."\n";' </dev/null`
fi
echo "Some scripts require perl version 5, which configure did not find."
echo "You can set the environment variable PERL to contain the "
echo "location of perl version 5."
echo "Configure believes that $PERL is version $perlversion ."
PERL=""
fi
AC_SUBST(PERL)
fi
#
# Check for Fortran
if test $HAS_F77 = 0 -a "$NOF77" = 0 ; then
NOF77=1
HAS_FORTRAN=0
AC_DEFINE(MPID_NO_FORTRAN)
dnl CFLAGS="$CFLAGS -DMPID_NO_FORTRAN"
fi
# Check for byte ordering
PAC_WORDS_BIGENDIAN
#
# Check for xdr available and properly installed (our FreeBSD machines
# have incorrect xdr header files, for examples). Currently, we just
# set a dummy function body and see if rpc/xdr.h is available and
# can be included.
#
# Just to complicate things, some systems have "xdr.h" that is complete
# and can be used by itself; more frequently, xdr.h does NOT include
# definitions that it requires! rpc.h seems to be more reliable.
#
if test "$IS_HETERO" = 1 ; then
AC_COMPILE_CHECK("XDR includes and functions",[#include <rpc/rpc.h>],[
int a=1;
],HAS_XDR=1,HAS_XDR=0)
if test "$HAS_XDR" = 1 ; then
AC_DEFINE(HAS_XDR)
else
print_error "XDR not available on this system"
fi
fi
# Check for the functions that may be needed by the ADI to implement
# Processor_name. Save these defines in a special place.
SAVEDEFS="$DEFS"
DEFS=""
AC_FUNC_CHECK(uname,AC_DEFINE(HAVE_UNAME)haveuname=1)
PAC_CHECK_HEADERS(netdb.h)
AC_FUNC_CHECK(gethostbyname,AC_DEFINE(HAVE_GETHOSTBYNAME)havegethostbyname=1)
#
# Horrible problem. Some builds use a C compiler that has such libraries
# but the C++ compiler does not. In that case, the C++ compiler script will
# need to include additional libraries. We need a general check for
# this: for each function that is available in the default libraries,
# ensure that the other compilers can see it.
#
if test -z "$NOCXX" -a "$havegethostbyname" = 1 ; then
cat > conftest.C <<EOF
#include "confdefs.h"
extern "C" {
char gethostbyname(void);
}
int main() {
gethostbyname(); return 0; }
EOF
# Try to compile and link with the C++ compiler
AC_MSG_CHECKING([that C++ compiler also has gethostbyname])
if ${CPP_COMPILER} -o conftest conftest.C >>config.log 2>&1 ; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_CHECKING([for gethostbyname in libnsl])
if ${CPP_COMPILER} -o conftest conftest.C -lnsl >>config.log 2>&1 ; then
CPP_EXTRA_LIBS="$CPP_EXTRA_LIBS -lnsl"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
fi
rm -f conftest*
fi
dnl
dnl Another problem is long long. Some C compilers may handle these in
dnl a different way than the C compiler
AC_SUBST(CPP_EXTRA_LIBS)
#
# Warning: Under Solaris 5.8, -lnsl *must* be followed by -lthread, or the
# resulting executable may hang (even if it doesn't do anything). This is
# sometimes seen in the C++ configure when the first test program (sizeof int)
# is run.
if test -z "$havegethostbyname" ; then
# Try again after adding libnsl. We do it this way instead of just
# testing for nsl because some systems (IRIX for one) generate many
# warning messages when libnsl and libc are combined (!)
AC_HAVE_LIBRARY(nsl,LIB_LIST="$LIB_LIST -lnsl";havelibnsl=1)
if test "$havelibnsl" = 1 ; then
echo "checking for gethostbyname in libnsl"
AC_FUNC_CHECK(gethostbyname,AC_DEFINE(HAVE_GETHOSTBYNAME)havegethostbyname=1)
fi
fi
# If we have uname and gethostbyname, we can skip getdomainname ...
if test "$haveuname" != 1 -o "$havegethostbyname" != 1 ; then
AC_HAVE_FUNCS(gethostname sysinfo)
#
# systeminfo is needed for sysinfo
PAC_CHECK_HEADERS(sys/systeminfo.h)
#
# getdomainname is special BECAUSE IT MAY BE USELESS (!Network computing
# indeed - stuff like this is why Windows95/NT WILL WIN).
AC_CHECK_FUNC(getdomainname,has_getdomainname=1,has_getdomainname=0)
if test $has_getdomainname = 1 -a \
\( "$cross_compiling" = 0 -o -z "$cross_compiling" \) ; then
PAC_PROGRAM_CHECK(has_domainname,domainname,1,0,d_domainname)
PAC_PROGRAM_CHECK(has_hostname,hostname,1,0,d_hostname)
PAC_PROGRAM_CHECK(has_rup,rup,1,0,d_rup)
# Form hostname.domainname, do rup to it
# rup may not be enabled, but short of running a program to lookup the
# local host, there does not seem to be a better alternative.
#
if test $has_domainname = 1 -a $has_hostname = 1 -a $has_rup = 1 ; then
changequote(,)
fullhost=`$d_hostname | sed -e 's/^\([^\.]*\)\..*/\1/'`
changequote([,])
# echo $fullhost
fullhost="${fullhost}.`$d_domainname`"
response=`($d_rup $fullhost 2>&1) | egrep '(Unknown host|translation failed)'`
# echo $fullhost
if test -n "$response" ; then
print_error "The getdomainname system routine has been rendered USELESS"
print_error "on your system. This is not a bug and will not affect"
print_error "MPICH. Some MPE routines (particularly those that"
print_error "interact with X Windows) may not work."
else
AC_DEFINE(HAVE_GETDOMAINNAME)
fi
fi
fi
fi
GETNAME_DEFS="$DEFS"
DEFS="$SAVEDEFS"
#
# Test that the functions used by the device are availble to the C++ and
# Fortran compilers.
testfuncs="gethostbyname"
if test -n "$device_functions" ; then
testfuncs="$testfuncs $device_functions"
fi
if test -n "$testfuncs" ; then
save_LIBS="$LIBS"
LIBS="$LIB_LIST"
save_CXX_LIBS="$CXX_LIBS"
CXX_LIBS="$CXX_LIBS $CPP_EXTRA_LIBS"
save_F77_LIBS="$F77_LIBS"
F77_LIBS="$F77_LIBS $FLIB_LIST"
PAC_FUNC_INTER_LANG($testfuncs,fort_works,cxx_works)
LIBS="$save_LIBS"
CXX_LIBS="$save_CXX_LIBS"
F77_LIBS="$save_F77_LIBS"
if test "$NOF77" = 0 -a "$fort_works" = "no" ; then
AC_MSG_WARN([Fortran programs cannot be linked with the C libraries
Fortran support being turned off])
NOF77=1
HAS_FORTRAN=0
AC_DEFINE(MPID_NO_FORTRAN)
fi
if test -z "$NOCXX" -a "$cxx_works" = "no" ; then
AC_MSG_WARN([C++ programs cannot be linked with the C libraries
C++ support being turned off])
NOCXX=1
buildcpp=0
fi
fi
#
# Check for message archive routines (to be used for internationalization)
#
SAVEDEFS="$DEFS"
DEFS=""
#
# Some systems have these in /usr/xpg2lib/libxpg.a (our Suns did)
# The includes (for nl_types) might be in /usr/xpg2include
# This hasn't been handled yet.
AC_HAVE_FUNCS(catopen catclose catgets)
# Will need to generate binary form of file
# !!! We have a report that on Cray, gencat is a completely different command
# (parallel fscks?). We're supposed to use
# caterr -c cat_file msg_file. Instead, we'll skip it
GENCAT="true"
if test -n "$device_td3" ; then
# May try caterr -c cat_file msg_file
print_error "Configure needs the gencat program to generate message catalogs"
print_error "Some (all?) Cray T3D systems have a program named gencat"
print_error "that performs file system checks instead. For this reason,"
print_error "message catalogs will not be created for the T3D device."
print_error "You may be able to use the caterr command instead."
print_error "MPICH will work without the message catalogs (though the"
print_error "ability to generate error messages in languages other than"
print_error "US English will be lost)."
elif test "$ignore_gencat" = "yes" ; then
# Ignore message catalog
:
else
PAC_PROGRAM_CHECK(has_gencat,gencat,1,0,d_gencat)
GENCAT="gencat"
if test $has_gencat = 1 ; then
AC_DEFINE(HAVE_GENCAT)
PAC_CHECK_HEADERS(nl_types.h)
# Why separate NLS_DEFS?
NLS_DEFS="$DEFS"
# Having a separate message catalog directory allows unification
# of message catalogs.
messagecat_dir=${messagecat_dir:-'${libdir}'}
AC_SUBST(messagecat_dir)
fi
fi
AC_SUBST(GENCAT)
DEFS="$SAVEDEFS"
AC_STDC_HEADERS
SAVEDEFS="$DEFS"
DEFS=""
PAC_CHECK_HEADERS(stdlib.h string.h)
PAC_CHECK_HEADERS(unistd.h)
newflag=""
PAC_STDARG([newflag="-DUSE_STDARG"],
[newflag="-DUSE_STDARG -DUSE_OLDSTYLE_STDARG"])
if test -n "$newflag" ; then
USER_CFLAGS="$USER_CFLAGS $newflag"
fi
dnl PAC_CHECK_HEADER(stdarg.h,[AC_DEFINE(HAVE_STDARG_H)
dnl havestdarg=1])
#
# It isn't enough to check for stdarg. Even gcc doesn't get it right;
# on some systems, the gcc version of stdio.h loads stdarg.h WITH THE WRONG
# OPTIONS (causing it to choose the OLD STYLE va_start etc).
#
# The original test tried the two-arg version first; the old-style
# va_start took only a single arg.
# This turns out to be VERY tricky, because some compilers (e.g., Solaris)
# are quite happy to accept the *wrong* number of arguments to a macro!
# Instead, we try to find a clean compile version, using our special
# TRY_COMPILE_CLEAN command
#
dnl USE_STDARG=0
AC_SUBST(USE_STDARG)
dnl #
dnl AC_MSG_CHECKING([that stdarg is oldstyle])
dnl PAC_TRY_COMPILE_CLEAN([#include <stdio.h>
dnl #include <stdarg.h>],
dnl [int func( int a, ... ){
dnl int b;
dnl va_list ap;
dnl va_start( ap );
dnl b = va_arg(ap, int);
dnl printf( "%d-%d\n", a, b );
dnl va_end(ap);
dnl fflush(stdout);
dnl return 0;
dnl }
dnl int main() { func( 1, 2 ); return 0;}],check_compile)
dnl case $check_compile in
dnl 0) AC_MSG_RESULT(yes)
dnl AC_DEFINE(USE_STDARG)
dnl AC_DEFINE(USE_OLDSTYLE_STDARG)
dnl USER_CFLAGS="$USER_CFLAGS -DUSE_STDARG -DUSE_OLDSTYLE_STDARG"
dnl USE_STDARG=1
dnl ;;
dnl 1) AC_MSG_RESULT([hmm, warnings from compiler. Trying newstyle])
dnl ;;
dnl 2) AC_MSG_RESULT(no)
dnl ;;
dnl esac
dnl
dnl if test -n "$havestdarg" -a "$USE_STDARG" != 1 ; then
dnl AC_MSG_CHECKING([stdarg is correct])
dnl PAC_TRY_COMPILE_CLEAN([
dnl #include <stdio.h>
dnl #include <stdarg.h>],[
dnl int func( int a, ... ){
dnl int b;
dnl va_list ap;
dnl va_start( ap, a );
dnl b = va_arg(ap, int);
dnl printf( "%d-%d\n", a, b );
dnl va_end(ap);
dnl fflush(stdout);
dnl return 0;
dnl }
dnl int main() { func( 1, 2 ); return 0;}],check_compile)
dnl case $check_compile in
dnl 0) AC_MSG_RESULT(yes)
dnl AC_DEFINE(USE_STDARG)
dnl USE_STDARG=1
dnl USER_CFLAGS="$USER_CFLAGS -DUSE_STDARG"
dnl ;;
dnl 1) AC_MSG_RESULT([yes with warnings])
dnl AC_DEFINE(USE_STDARG)
dnl USE_STDARG=1
dnl USER_CFLAGS="$USER_CFLAGS -DUSE_STDARG"
dnl ;;
dnl 2) AC_MSG_RESULT(no)
dnl ;;
dnl esac
dnl fi
# FIXME: In the above, this should go into the include files for the
# device-specific case.
PAC_MALLOC_RETURNS_VOID()
USER_CFLAGS="$USER_CFLAGS $DEFS"
# FIXME: In the above, this should go into the include files for the
# device-specific case. IS THIS NEEDED?!!
DEFS="$SAVEDEFS $DEFS"
#
# System is used only in MPE; i860's do not support it.
# Should only be in mpe configure? (actually used in dbxerr.c?)
AC_HAVE_FUNCS(system)
#
# Nice is used only in env/init.c
AC_HAVE_FUNCS(nice)
#
# strdup is used in MPI_Info_xxx
AC_HAVE_FUNCS(strdup)
#
# Look for headers that might have memset()....
# (string.h might also, but it is also needed by MPE)
PAC_CHECK_HEADERS(memory.h)
#
# Check for header files needed to obtain list of networking interfaces
#
PAC_CHECK_HEADERS(sys/ioctl.h)
PAC_CHECK_HEADERS(sys/sockio.h)
#
# Turn off F77
# One problem with this is that some part of the ar will fail. Lets hope
# it isn't fatal.
if test $NOF77 = 1 ; then
F77="echo no Fortran compiler"
FLINKER="$F77"
enable_args="$enable_args --disable-f77"
fi
# This simplifies some of the Makefiles in the examples and tests
if test "$NO_F90" = 1 ; then
F90="echo no Fortran 90 compiler"
F90LINKER="$F90"
do_f90modules="no"
enable_args="$enable_args --disable-f90 --disable-f90modules"
fi
#
#
# Check for erroneous C compilers
broken=0
do_test=1
if test "$cross_compiling" = 1 ; then
if test "$CC" = mpcc ; then
TESTCC=xlc
elif test "$CC" = mpCC ; then
TESTCC=xlC
else
do_test=0
fi
elif test -z "$TESTCC" ; then
# If not cross compiling, testcc is just the compiler
TESTCC="$CC"
fi
#
# Should eventually use a file like $file.run to see if the program should
# be run or just compiled. And eventually, this should be run EARLY,
# before checking for things like functions and include files.
#
PAC_CHECK_COMPILER_OK(cc_works=1,cc_works=0)
if test $cc_works = 0 ; then
print_error "Could not compile a simple file with $CC!"
print_error "Check for license and path restrictions on $CC."
exit 1
fi
if test $NOF77 = 0 ; then
PAC_CHECK_F77_COMPILER_OK(,NOF77=1;HAS_FORTRAN=0;HAS_F77=0;
AC_DEFINE(MPID_NO_FORTRAN)
dnl CFLAGS="-DMPID_NO_FORTRAN $CFLAGS"
F77="echo no Fortran compiler"
FLINKER="$F77")
# Finally, add FLIBS to FLIB_LIST
# (FLIBS may have been set when finding how to access command-line
# arguments)
FLIB_LIST="$FLIB_LIST $FLIBS"
fi
if test $do_test = 1 ; then
PAC_CORRECT_COMPILER()
fi
#
if test "$RANLIB" != ":" ; then
PAC_RANLIB_WORKS
fi
#
# Some Sun SOLARIS systems don't have AR (at least, not in a typical user
# path)
# Remove any arguments from the string AR
ARTEST=`expr "$AR" : "\(.*\) "`
PAC_PROGRAM_CHECK(ARFOUND,$ARTEST,1,,ARLOC)
if test -z "$ARLOC" ; then
# Check for /usr/ccs/bin/ar ; Solaris likes to hide anything remotely
# useful in this directory
print_error "The library archiver $AR is not in your path"
print_error "MPICH cannot be built without this program, which"
print_error "should be part of ANY program development environment."
if test -x /usr/ccs/bin/ar ; then
print_error "You need /usr/ccs/bin in your path."
else
print_error "Check your path; contact your system vendor if your"
print_error "path appears to be ok."
fi
exit 1
fi
#
#
# Check for long pointers. All such options are placed into DEFS (see
# autoconf manual, AC _ DEFINE)
#
# replace these with autoconf-2 style tests for
# SIZEOF_VOID_P
# SIZEOF_INT
# Then the test in the files should be
# #if SIZEOF_INT != SIZEOF_VOID_P
# ...
# Alternately, do the test here and use a different value such as
# USE_INTEGER_INDEX
PAC_POINTER_64_BITS()
PAC_INT_LT_POINTER()
if test -n "$F77IDX" ; then
AC_DEFINE(POINTER_64_BITS)
fi
dnl
PAC_GET_TYPE_SIZE(void *,address_size)
if test "$address_size" != "unknown" ; then
AC_MSG_CHECKING([for C integer type for MPI_Aint])
AC_MSG_RESULT()
for c_type in int long short "long long" ; do
PAC_GET_TYPE_SIZE($c_type,type_len)
if test "$type_len" = "$address_size" ; then
MPI_AINT_FOUND=yes
MPI_AINT=$c_type
break
fi
done
AC_MSG(C integer type for MPI_Aint is)
if test "$MPI_AINT_FOUND" = yes ; then
AC_MSG_RESULT($MPI_AINT)
else
AC_MSG_RESULT(could not find matching C type!)
fi
fi
#
# Do not test
# PROBLEM: ROMIO depends on long long in some cases. For now, leave it
# outside the -no_short_longs test
if test "$NO_LONG_LONG" = "no" ; then
# This uses CROSS_HAS_LONG_LONG (0 or 1) if cross compiling
PAC_LONG_LONG_INT()
fi
if test "$NO_LONG_DOUBLE" = "no" ; then
# If not cross-compiling, we could dynamically check
dnl The A C _LONG_DOUBLE macro is junk (it doesn't check that
dnl long double exists at all!
PAC_LONG_DOUBLE()
PAC_CHECK_SIZEOF(double,SIZEOF_DOUBLE)
PAC_CHECK_SIZEOF(long double,SIZEOF_LONG_DOUBLE)
if test $SIZEOF_DOUBLE -eq $SIZEOF_LONG_DOUBLE ; then
# Suppress long double if == double?
print_error "If you get warning messages about long doubles not supported"
print_error "on $ARCH, use the -disable-long-double argument to configure."
fi
fi
#
# Check for structure alignment using util/structlayout.c
if test "$cross_compiling" = 0 -o -z "$cross_compiling" ; then
if test -n "$TESTCC" ; then
CCsav="$CC"
CC="$TESTCC"
fi
AC_MSG_CHECKING([for structure alignment])
rm -f conftest*
cat confdefs.h "$srcdir/util/structlayout.c" > conftest.c
eval $compile
if test ! -s conftest ; then
AC_MSG_RESULT([Could not build executable program to test alignment])
else
if test -x conftest && (./conftest; exit) 1>conftestout ; then
if test -s conftestout ; then
alignvalue=`cat conftestout`
else
alignvalue="Unknown"
fi
AC_MSG_RESULT($alignvalue)
else
AC_MSG_RESULT(Execution of test program failed)
fi
fi
rm -f conftest*
if test -n "$TESTCC" ; then
CC="$CCsav"
fi
else
# Pick value from CROSS or use default
CROSS_STRUCT_ALIGNMENT=${CROSS_STRUCT_ALIGNMENT:-"largest"}
alignvalue=$CROSS_STRUCT_ALIGNMENT
fi
# Make this the default. Eventually, use the --enable stuff to allow
# a user to turn this off.
if test "$alignvalue" = "two" ; then
AC_DEFINE(USE_BASIC_TWO_ALIGNMENT)
elif test "$alignvalue" = "four" ; then
AC_DEFINE(USE_BASIC_FOUR_ALIGNMENT)
elif test "$alignvalue" = "eight" ; then
AC_DEFINE(USE_BASIC_EIGHT_ALIGNMENT)
else
AC_DEFINE(USE_BASIC_ALIGNMENT)
fi
#### was
# We must not make USER_CFLAGS all of CFLAGS...
#
dnl definitions should be passed to the configuration file
dnl CFLAGS="$CFLAGS $DEFS"
# We really should use MPICHCONF_H instead of CONFIG_H
CFLAGS="$CFLAGS -DHAVE_MPICHCONF_H"
#
AC_DEFINE(MPI_ADI2)
# Don't include mpid/ch2 since that has default versions of the include
# files. If a device needs them, it should copy or link them into
# its directory.
# For now, add user_cflags to ccflags. This is needed to ensure that
# the few defines needed by mpi.h are included.
CCFLAGS="$CCFLAGS $USER_CFLAGS"
mpich_includes="-I$top_srcdir/include -I$includebuild_dir -I$rootbuild_dir/mpid/$DEVICE -I$top_srcdir/mpid/util"
if test "$top_srcdir" != "$rootbuild_dir" ; then
mpich_includes="$mpich_includes -I$top_srcdir/mpid/$DEVICE"
fi
#
# Check for traceback
if test "$try_traceback" = "yes" ; then
if test "$ac_cv_prog_gcc" = "yes" ; then
# Try the program to see if it actually works
AC_MSG_CHECKING([whether backtrace works])
bktrace_works=no
if $TESTCC -o conftest -DTEST_BACKTRACE "$top_srcdir_val/src/util/backtrace.c" ; then
if ./conftest >conftest.out 2>&1 ; then
#cat conftest.out
bktrace_works=yes
fi
fi
rm -f conftest*
if test "$bktrace_works" = "yes" ; then
BACKTRACE="backtrace.o"
AC_DEFINE(HAVE_PRINT_BACKTRACE)
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_SUBST(BACKTRACE)
fi
fi
#
AC_SUBST(mpich_includes)
if test "$MEMDEBUG" = "1" ; then
AC_DEFINE(MPIR_MEMDEBUG)
AC_DEFINE(MPIR_OBJDEBUG)
fi
if test "$TRDEBUG" = "1" ; then
AC_DEFINE(DEBUG_TRACE)
fi
if test "$PTRDEBUG" = 1 ; then
AC_DEFINE(MPIR_PTRDEBUG)
fi
# We really need separate library directories and path indicators.
LIB_PATH_LEADER="-L"
AC_SUBST(LIB_PATH_LEADER)
# This exact format is important: it lets us define LIB_PATH in terms
# of another variable (libdir) that we can set separately.
# Evenually, we should construct this from the LIB_PATH_LEADER and libdir
LIB_PATH='-L${libdir}'" $LIB_PATH"
#
if test -n "$F90" -a "$NO_F90" != 1 ; then
if test -z "$USER_SET_F90LIB_PATH" -a -z "$F90LIB_PATH" ; then
F90LIB_PATH="$FLIB_PATH_LEADER$FLIB_PATH"
fi
fi
# Add any user libraries
if test -n "$USERLIB" ; then
LIB_LIST="$LIB_LIST $USERLIB"
fi
#
# mpirun needs sync to try and fix NFS problems on some machines. Some
# users may not have sync in their path, so we try to find it here.
SYNCLOC=""
PAC_PROGRAM_CHECK(SYNCFOUND,sync,1,,SYNCLOC)
if test -z "$SYNCLOC" ; then SYNCLOC=true ; fi
#
#
# if the device uses the machines file and there is no machines.$ARCH,
# create one using hostname (or uname)
#
dnl # Where should util be if it is not local? top_srcdir? bindir?
dnl # This should be done by the device. (as part of the device setup)
dnl if test $DEVICE_KIND = network ; then
dnl if test ! -s util/machines/machines.$ARCH ; then
dnl if test ! -d util ; then mkdir util ; fi
dnl if test ! -d util/machines ; then mkdir util/machines ; fi
dnl HOST=""
dnl PAC_PROGRAM_CHECK(HOSTNAME_PGM,hostname,,,hostname)
dnl if test -x "$hostname" ; then
dnl HOST="`$hostname`"
dnl fi
dnl # Note that uname -n may not produce a usable hostname.
dnl # Any suggestions?
dnl if test "$HOST" = "" ; then
dnl HOST="`uname -n`"
dnl fi
dnl cat > util/machines/machines.$ARCH <<EOF
dnl # Change this file to contain the machines that you want to use
dnl # to run MPI jobs on. The format is one host name per line, with either
dnl # hostname
dnl # or
dnl # hostname:n
dnl # where n is the number of processors in an SMP. The hostname should
dnl # be the same as the result from the command "hostname"
dnl $HOST
dnl $HOST
dnl $HOST
dnl $HOST
dnl $HOST
dnl EOF
dnl print_machines_message=1
dnl fi
dnl fi
#
# BASE_LIB_LIST lets us separate the MPI library from the other libs
BASE_LIB_LIST="$LIB_LIST"
# used to be LIB_LIST="$LIB_LIST -lmpi" I switched it, inspired by HPUX
#
# Before we accept MPILIBNAME, we need to make sure that it does not conflict
# with other libraries. We had this problem at NCSA, where -L. -lmpich gives
# does not give libmpich.a in the current directory; instead, it uses
# libmpich.a in another, system directory. This is really a misconfigured
# ecc.cfg file, but here is the place to check for it.
AC_MSG_CHECKING([that $MPILIBNAME can be used as the library name])
canuse=yes
cat >conftest.c <<EOF
int foobar( int );
int foobar( int a ) { return a; }
EOF
if test -z "$ac_compile" ; then
ac_compile='${CC-cc} $CFLAGS $CPPFLAGS conftest.c -c 1>&AC_FD_CC 2>&AC_FD_CC'
fi
if test -z "$ac_link" ; then
ac_link='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS conftest.c -o conftest $LIBS 1>&AC_FD_CC 2>&AC_FD_CC'
fi
if eval $ac_compile ; then
# Create the library (AR includes the cr options)
rm -f lib$MPILIBNAME.a
${AR} lib$MPILIBNAME.a conftest.o
${RANLIB} lib$MPILIBNAME.a
rm -f conftest*
# create the main program
cat >conftest.c <<EOF
extern int foobar( int );
int main( int argc, char **argv ) { return foobar(0); }
EOF
save_LIBS="$LIBS"
LIBS="-L. -l$MPILIBNAME"
if eval $ac_link ; then
:
else
canuse=no
fi
LIBS="$save_LIBS"
fi
AC_MSG_RESULT($canuse)
if test "$canuse" = "no" ; then
AC_MSG_ERROR([$MPILIBNAME cannot be used as the name for the MPICH library
Pick another name and set the environment variable MPILIBNAME to that name
and rerun configure])
fi
#
rm -rf conftest* lib$MPILIBNAME.a
LIB_LIST="-l$MPILIBNAME $LIB_LIST"
#
# Generate the name for the MPI-C, MPI-CC, and MPI-F77 compilers (for use
# in Makefiles that should not be MPICH dependent
MPICC=$binbuild_dir/mpicc
if test $NOF77 = 0 ; then
MPIF77=$binbuild_dir/mpif77
else
# should this be "true"?
MPIF77=""
fi
if test "$NO_F90" = "0" ; then
MPIF90=$binbuild_dir/mpif90
fi
MPICPLUSPLUS=$binbuild_dir/mpiCC
### FIXME: IS THIS CORRECT OR NEEDED???
LIB_DIR=$exec_prefix
#
# Some mpi2 commands supported (for the testing scripts)
HAS_MPI2=1
#
# The FIRST subsystem to configure is the Fortran subsystem because it
# may make changes in the way Fortran is handled (e.g., force a different
# name mangling)
if test "$NOF77" != 1 ; then
# instead of ROMIO flags, should export CFLAGS, FFLAGS, and LDFLAGS
# (but not those names)
echo "Configuring Fortran subsystem"
# In case we are doing a VPATH build
if test ! -d src ; then mkdir src ; fi
if test ! -d src/fortran ; then mkdir src/fortran ; fi
# Combine the libraries by default
if test -z "$flibname" ; then
flibname=$MPILIBNAME
fi
if test -z "$fwrapname" ; then
fwrapname=f$MPILIBNAME
fi
# The brackets are necessary to prevent libname from being replaced by
# nsl (! a bug in HAVE_LIBRARY in autoconf 1.7)
# if we're the developers, we may need to create the
# initial configure files.
if test ! -x "$top_srcdir_val/src/fortran/configure" -a \
-s "$top_srcdir_val/src/fortran/configure.in" -a \
-x "$top_srcdir_val/src/fortran/makeconfigure" ; then
(cd "$top_srcdir_val/src/fortran" ; ./makeconfigure)
fi
# The test versions (e.g., TESTCC) are used for cross-compilation cases when
# they allow programs to be built and run
# We need prefix and libdir for the mpif77 scripts
# Export the F77_xxx and F90xxx incase they were set with the -nagxxx switch
(cd src/fortran ; \
export CC ;\
export CFLAGS ;\
export F77 ;\
export FFLAGS ;\
export F90 ;\
export LDFLAGS ;\
export TESTCC ;\
export TESTF77 ;\
export TESTF90 ;\
export mpich_includes ;\
export LIB_PATH ;\
export BASE_LIB_LIST ;\
export ROMIO_LFLAGS ;\
export ROMIO_TFFLAGS ;\
export MPILIBNAME ;\
export SHAREDKIND ;\
export SHARED_LIB_SEARCH_PATH_LEADER ;\
export SHARED_LIB_LOCALDIR ;\
export sharedlibbuild_dir ;\
export sharedlib_dir ;\
export MPI_WITH_PMPI ;\
export F90UNIX ;\
export F90INC ;\
export F90FLAGS ;\
export F90LINKER ;\
export F90LIB_PATH ;\
export f90nag ;\
export f95nag ;\
export F77GETARGDECL; \
export F90GETARGDECL; \
export FXX_MODULE; \
export F77_GETARGDECL; \
export F77_GETARG; \
export F77_IARGC; \
export MPIVERSION ;\
export MPIR_HOME ;\
export libbuild_dir ;\
export includebuild_dir ;\
export CROSS_SIZEOF_CHAR ;\
export CROSS_SIZEOF_SHORT ;\
export CROSS_SIZEOF_INT ;\
export CROSS_SIZEOF_LONG ;\
export CROSS_SIZEOF_LONG_LONG ;\
export CROSS_SIZEOF_FLOAT ;\
export CROSS_SIZEOF_DOUBLE ;\
export CROSS_SIZEOF_LONG_DOUBLE ;\
export CROSS_SIZEOF_VOID_P ;\
export CROSS_OFFSET_KIND ;\
export CROSS_ADDRESS_KIND ;\
export CROSS_F77_SIZEOF_INTEGER ;\
export CROSS_F77_SIZEOF_REAL ;\
export CROSS_F77_SIZEOF_DOUBLE_PRECISION ;\
export CROSS_HAS_LONG_DOUBLE ;\
export CROSS_HAS_LONG_LONG ;\
[${top_srcdir}/src/fortran/configure --with-mpichbuilding --with-mpich \
--with-flibname=$flibname $with_args $enable_args \
--with-fwrapname=$fwrapname \
--prefix=$prefix --libdir=$libdir --sysconfdir=$sysconfdir] )
if test $? != 0 ; then
echo "Error configuring the Fortran subsystem!"
echo "Turning off Fortran support"
NOF77=1
NO_F90=1
HAS_FORTRAN=0
HAS_F77=0
AC_DEFINE(MPID_NO_FORTRAN)
do_f90modules="no"
else
echo "Done configuring Fortran subsystem"
# Extract files into the "build" directories
# Note that we may update mpif.h after the romio step below
if test -s src/fortran/include/mpif.h ; then
cp src/fortran/include/mpif.h $includebuild_dir/mpif.h
# update includedir and libdir for the builddir versions
sed -e "s%^includedir=.*%includedir=$includebuild_dir%g" \
-e "s%^libdir=.*%libdir=$libbuild_dir%g" \
-e "s%^sharedlibdir=.*%sharedlibdir=$sharedlibbuild_dir%g" \
src/fortran/src/mpif77 > $binbuild_dir/mpif77
chmod a+x $binbuild_dir/mpif77
sed -e "s%^includedir=.*%includedir=$includebuild_dir%g" \
-e "s%^libdir=.*%libdir=$libbuild_dir%g" \
-e "s%^sharedlibdir=.*%sharedlibdir=$sharedlibbuild_dir%g" \
src/fortran/src/mpif90 > $binbuild_dir/mpif90
chmod a+x $binbuild_dir/mpif90
#cp src/fortran/src/mpif77 $binbuild_dir/mpif77
cp src/fortran/include/mpi_fortdefs.h $includebuild_dir/mpi_fortdefs.h
# Get updated version of F77 (in case we had to add args to it)
if test "$F77" = "$TESTF77" ; then
F77="`${MAKE} -f src/fortran/Makefile f77name`"
TESTF77="$F77"
else
# Just replace the "test" compiler
TESTF77="`${MAKE} -f src/fortran/Makefile f77name`"
fi
F77_IN_C_LIBS="`${MAKE} -f src/fortran/Makefile f77in_clibs`"
AC_SUBST(F77_IN_C_LIBS)
# We really need to do the same things with the F90 steps.
# These are needed for the test examples:
F90_SUFFIX="`${MAKE} -f src/fortran/Makefile f90_suffix`"
F90_MODINCFLAG="`${MAKE} -f src/fortran/Makefile f90_modincflag`"
AC_SUBST(F90_SUFFIX)
AC_SUBST(F90_MODINCFLAG)
changequote(<<,>>)
OFFSET_KIND=`grep 'MPI_OFFSET_KIND=' $includebuild_dir/mpif.h | \
sed -e 's/^.*=\([0-9]*\)).*$/\1/'`
FORT_INT8=`grep 'MPI_INTEGER8=' $includebuild_dir/mpif.h | \
sed -e 's/^.*=\([0-9]*\)).*$/\1/'`
changequote([,])
fi
fi
fi
FLIBNAME=$flibname
AC_SUBST(FLIBNAME)
#
# Configure ROMIO if specified
#
if test $ROMIO = 1 ; then
# If we find that we can't build ROMIO, set the appropriate
# --with args so that subdirectory configures won't assume that
# ROMIO is present
if test -d "${top_srcdir}/romio" ; then
echo "Configuring ROMIO, for support of MPI-IO"
# Check first for some ROMIO-specific requirements
PAC_MACRO_NAME_IN_MACRO(,ROMIO=0)
if test $ROMIO = 0 ; then
print_error "Cannot build ROMIO with the C compiler $CC"
with_args="$with_args --without-romio --without-mpiio"
fi
else
ROMIO=0
with_args="$with_args --without-romio --without-mpiio"
fi
fi
if test $ROMIO = 1 -a -d "${top_srcdir}/romio" ; then
# If integer*8 not supported, then tell ROMIO not to use it.
# We do this indirectly by telling ROMIO to use an offset type of int.
if test "$NOF77" = "0" ; then
if test -z "$FORT_INT8" -o "$FORT_INT8" = 0 ; then
if test -z "$f_integer_size" -o "$f_integer_size" = "unavailable" ; then
f_integer_size=4
fi
if test "$OFFSET_KIND" = 8 ; then
# F90 has an 8-byte integer kind but F77 doesn't support it
# as integer*8.
if test "$F90" != "FC" ; then
ROMIO_ARGS="$ROMIO_ARGS -longlongsize=int"
fi
else
ROMIO_ARGS="$ROMIO_ARGS -longlongsize=int"
fi
fi
fi
if test -z "$FILE_SYSTEM" ; then
ROMIO_FILE_SYSTEM=""
else
ROMIO_FILE_SYSTEM="--with-file-system=$FILE_SYSTEM"
fi
FROM_MPICH=yes
if test ! -d romio ; then mkdir romio ; fi
# We set -fc to F77 since we set F77 to either $FC or the value f77
# -mpiincdir=$includebuild_dir \
# -mpibindir=$binbuild_dir \
# -mpilib=$libbuild_dir/lib$MPILIBNAME.a \
# -mpiolib=$libbuild_dir/lib$MPILIBNAME.a \
# -cc="$CC" -cflags="$ROMIO_CFLAGS $CC_SHARED_OPT" \
# -fc="$F77" -fflags="$ROMIO_FFLAGS $FC_SHARED_OPT" \
# -f90="$F90"
MPI_BIN_DIR=$binbuild_dir
MPI_LIB=$libbuild_dir/lib$MPILIBNAME.a
MPI_INCLUDE_DIR=$includebuild_dir
(cd romio ; \
LIBNAME=$libbuild_dir/lib$MPILIBNAME.a ; export LIBNAME ; \
export MPI_BIN_DIR ; export MPI_LIB ; export MPI_INCLUDE_DIR ; \
export CROSS_SIZEOF_INT; \
export CROSS_SIZEOF_VOID_P; \
export CROSS_SIZEOF_LONG_LONG; \
export CROSS_SIZEOF_LONG;\
export MAKE;\
export ARCH;\
export CC; export F77; export F90; export MPILIBNAME ; \
export FROM_MPICH;\
export int_len ; export void_star_len ; export OFFSET_KIND ; \
export long_long_len ; \
"${top_srcdir}/romio/configure" $ROMIO_ARGS $ROMIO_FILE_SYSTEM \
--with-mpi=mpich $romio_config_args $enable_args $with_args )
rc=$?
if test "$rc" != 0 ; then
AC_MSG_ERROR([ROMIO Configure failed, aborting configure])
fi
rm -f include/mpio.h "${top_srcdir}/include/mpio.h"
cp romio/include/mpio.h include
ROMIO_LFLAGS="`$MAKE -f romio/Makefile romio_lflags`"
ROMIO_TCFLAGS="`$MAKE -f romio/Makefile romio_tcflags`"
ROMIO_TCPPFLAGS="`$MAKE -f romio/Makefile romio_tcppflags`"
ROMIO_TFFLAGS="`$MAKE -f romio/Makefile romio_tfflags`"
LIB_LIST="$LIB_LIST `$MAKE -f romio/Makefile romio_liblist`"
OLD_BASE_LIB_LIST="$BASE_LIB_LIST"
BASE_LIB_LIST="$BASE_LIB_LIST `$MAKE -f romio/Makefile romio_liblist`"
if test "$OLD_BASE_LIB_LIST" != "$BASE_LIB_LIST " -o \
-n "$ROMIO_LFLAGS" ; then
# Romio added a library. We need to update the Fortran compile
# scripts to include this value.
if test "$NOF77" = 0 -a -x src/fortran/src/mpif77 ; then
for file in mpif77 mpif77.conf mpif90 mpif90.conf ; do
if test ! -s src/fortran/src/$file ; then continue ; fi
rm -rf .tmp
make_x=no
if test -x src/fortran/src/$file ; then make_x=yes ; fi
cp src/fortran/src/$file .tmp
rm -f src/fortran/src/$file
sed -e 's%BASE_LIB_LIST=.*%BASE_LIB_LIST="'"$BASE_LIB_LIST"'"%' \
-e 's%F90_LDFLAGS="\(.*\)"%F90_LDFLAGS="\1'"$ROMIO_LFLAGS"'"%' \
-e 's%F77_LDFLAGS="\(.*\)"%F77_LDFLAGS="\1'"$ROMIO_LFLAGS"'"%' \
.tmp > src/fortran/src/$file
# update includedir and libdir for the builddir versions
if test -s $binbuild_dir/$file ; then
sed -e "s%^includedir=.*%includedir=$includebuild_dir%g" \
-e "s%^libdir=.*%libdir=$libbuild_dir%g" \
src/fortran/src/$file > $binbuild_dir/$file
if test "$make_x" = "yes" ; then
chmod a+x $binbuild_dir/$file
fi
fi
if test "$make_x" = "yes" ; then
chmod a+x src/fortran/src/$file
fi
done
rm -rf .tmp
fi
fi
# mpif.h prepared for ROMIO at end of configure
# If a VPATH build, the examples dir may not exist
if test ! -d examples ; then mkdir examples ; fi
if test ! -d examples/test ; then mkdir examples/test ; fi
(cd examples; \rm -f io; ln -s ../romio/test io; \
(cd test; \rm -f io; ln -s ../../romio/test io))
echo "Finished configuring ROMIO"
fi
if test "$ROMIO" = 1 ; then
NEWTESTDIRS="$NEWTESTDIRS io"
fi
#
# Configure MPE
# - MPE must be configured after Fortran in case the Fortran step
# modifies the Fortran compiler
# - the option to MPE configure, --with-f2cmpilibs, allows different
# Fortran to C MPI wrapper library name. This should allow MPICH
# to use a different name if it is needed.
if test "$NOMPE" = 0 -a -d "${top_srcdir}/mpe" ; then
MPE_ARGS="$ENABLE_MPEDBG $MPE_OPTS";
if test "$NOF77" != "0" ; then
MPE_ARGS="$MPE_ARGS --disable-f77"
fi
if test ! -d mpe ; then mkdir mpe ; fi
( cd mpe ; \
MAKE=$MAKE ; export MAKE ; \
MPI_CC=${binbuild_dir}/mpicc ; export MPI_CC ; \
MPI_F77=${binbuild_dir}/mpif77 ; export MPI_F77 ; \
CC="${TESTCC}" ; export CC ; \
F77="${TESTF77}" ; export F77 ; \
export CLINKER ; export FLINKER ; \
export CROSS_SIZEOF_CHAR ; \
export CROSS_SIZEOF_SHORT ; \
export CROSS_SIZEOF_INT ; \
export CROSS_SIZEOF_LONG_LONG ; \
export CROSS_BIGENDIAN ; \
"${top_srcdir}/mpe/configure" --enable-mpich --disable-checkMPI \
--with-f2cmpilibs=-lf$MPILIBNAME \
--with-flib_path_leader=$LIB_PATH_LEADER \
--prefix=${prefix} $enable_args $with_args \
--libdir=${libdir} --bindir=${bindir} \
--includedir=${includedir} \
$MPE_ARGS )
if test $? = 0 ; then
echo "Done configuring MPE Profiling Libraries" ; echo
else
echo "Error configuring MPE Profiling Libraries"
echo "Turning off building MPE Profiling Libraries" ; echo
NOMPE=1
fi
fi
#
if test "$Use_Intercomm_coll" = "yes" ; then
MPI2OPTIONAL="src/coll2"
fi
#
# Substitute variables
# Variables used in scripts only
AC_SUBST(AUTOMOUNTFIX)dnl
if test -z "$RSHCOMMAND" ; then
RSHCOMMAND=$rshcommand
fi
AC_SUBST(RSHCOMMAND)dnl
#
AC_SUBST(SYNCLOC)dnl
dnl # Variables defined ONLY for the doc/port file:
dnl AC_SUBST(CONFIGURE_ARGS)dnl
dnl AC_SUBST(NODEVDEBUG)dnl
dnl AC_SUBST(PKTSIZE)dnl
dnl AC_SUBST(LIMITEDBUFFERS)dnl
dnl AC_SUBST(ADI_COLLECTIVE)dnl
dnl AC_SUBST(cross_compiling)dnl
# Variables used by Makefile.in's:
AC_SUBST(ASM)dnl
AC_SUBST(ASMFILES_O)dnl
AC_SUBST(AR)dnl
AC_SUBST(ARCH)dnl
AC_SUBST(BASE_LIB_LIST)dnl
AC_SUBST(CC)dnl
AC_SUBST(CFLAGS)dnl
AC_SUBST(CLINKER)dnl
AC_SUBST(CCFLAGS)dnl
AC_SUBST(CCLINKER)dnl
AC_SUBST(CPP_COMPILER)dnl
AC_SUBST(CPP_DIR)dnl
AC_SUBST(CPPFLAGS)dnl
AC_SUBST(CXXFLAGS)dnl
AC_SUBST(LDFLAGS)dnl
AC_SUBST(CPPLDFLAGS)dnl
AC_SUBST(CPRP)dnl
AC_SUBST(DEFAULT_MACHINE)dnl
AC_SUBST(DEVCFLAGS)dnl
AC_SUBST(DEVCFILES)dnl
AC_SUBST(DEVOFILES)dnl
AC_SUBST(DEV_DEFS)dnl
AC_SUBST(DEVICE)dnl
AC_SUBST(DEVICE_MAKE_INCLUDE)dnl
AC_SUBST(F77)dnl
AC_SUBST(FAST_COPY)dnl
AC_SUBST(FFLAGS)dnl
AC_SUBST(FLIB_PATH)dnl
AC_SUBST(FLIB_PATH_LEADER)dnl
AC_SUBST(FLIB_LIST)dnl
AC_SUBST(FLINKER)dnl
AC_SUBST(GETNAME_DEFS)dnl
AC_SUBST(HAS_FORTRAN)dnl
AC_SUBST(HAS_MPI2)dnl
AC_SUBST(INCLUDE_PATH)dnl
AC_SUBST(LIB_LIST)dnl
AC_SUBST(LIB_PATH)dnl
AC_SUBST(LIB_DIR)dnl
AC_SUBST(MAKE)dnl
AC_SUBST(MPE_DIR)dnl
AC_SUBST(MPE_MPI_EXT_C)dnl
AC_SUBST(MPE_MPI_EXT_O)dnl
AC_SUBST(ENABLE_MPEDBG)
MPICH_VERSION="MPICH $MPIVERSION"
AC_SUBST(MPIVERSION)
AC_SUBST(CONFIGURE_ARGS_CLEAN)dnl
AC_SUBST(HAVE_MPID_DEFS_H)dnl
dnl initutil
dnl We can't put the quotes in '"' because the sed line generated by configure
dnl also uses quotes.
q='"'
AC_DEFINE_UNQUOTED(CONFIGURE_ARGS_CLEAN,$q$CONFIGURE_ARGS_CLEAN$q)
AC_DEFINE_UNQUOTED(MPIRUN_MACHINE,$q$DEFAULT_MACHINE$q)
#
# Because the Globus2 device can use a nested mpirun, it needs the
# option to ignore this step
if test "$define_mpirun_device" != "no" ; then
AC_DEFINE_UNQUOTED(MPIRUN_DEVICE,$q$DEVICE$q)
fi
# COMM is currently used in mpirun.ch_p4.in to decide if SMP support is
# turned on
AC_SUBST(COMM)
dnl This is used to make sure that we get the correct mpirun.
AC_SUBST(MPICH_VERSION)dnl
dnl do we need mpir_home?
AC_SUBST(MPIR_HOME)dnl
AC_SUBST(MPI_AINT)dnl
AC_SUBST(MPI_FINT)dnl
AC_SUBST(MPILIBNAME)dnl
dnl The next four should not be needed; they should build on bindir
AC_SUBST(MPICC)dnl
AC_SUBST(MPIF77)dnl
AC_SUBST(MPIF90)dnl
AC_SUBST(MPICPLUSPLUS)dnl
dnl
AC_SUBST(MPI2OPTIONAL)dnl
dnl
AC_SUBST(MEMDEBUG)dnl
AC_SUBST(NLS_DEFS)dnl
AC_SUBST(NEWTESTDIRS)dnl
AC_SUBST(OPTFLAGS)dnl
AC_SUBST(OPTFLAGSC)dnl
AC_SUBST(OPTFLAGSF)dnl
dnl Where are p4_arch/p4_dir used?
AC_SUBST(P4_ARCH)dnl
AC_SUBST(P4_DIR)dnl
AC_SUBST(RHS_COMMAND)dnl
# P4_MDEPCFLAGS now used only in doc/port.in - delete this
dnl AC_SUBST(P4_MDEPCFLAGS)dnl
AC_SUBST(PREFIX)dnl
AC_SUBST(RANLIB)dnl
AC_SUBST(USER_CFLAGS)dnl
AC_SUBST(ROMIO)dnl
AC_SUBST(ROMIO_LFLAGS)dnl
AC_SUBST(ROMIO_TCFLAGS)dnl
AC_SUBST(ROMIO_TCPPFLAGS)dnl
AC_SUBST(ROMIO_TFFLAGS)dnl
dnl why is this? Why not test on CCC or CPP_COMPILER?
AC_SUBST(buildcpp)dnl
AC_SUBST(NOF77)dnl
AC_SUBST(NO_F90)dnl
AC_SUBST(NOMPE)dnl
AC_SUBST(hasMPE)dnl
AC_SUBST(MPE_OPTS)dnl
dnl MPI_INTRA is the name of the file that implements the collective routines
dnl (intra_fns_new is the default)
AC_SUBST(MPI_INTRA)dnl
#
# End configuration file
#
# Make sure we remove any configuration file incase there is out-of-date data.
# We remove the version in include in case this is a vpath build
/bin/rm -f mpichconf.h "${top_srcdir}/include/mpichconf.h include/mpichconf.h"
# Make the directories that do not contain Makefiles (should they?) but
# are needed for the subsequent directories.
if test ! -d src ; then mkdir src ; fi
AC_OUTPUT(Makefile util/Makefile examples/Makefile src/pt2pt/Makefile \
src/coll/Makefile src/context/Makefile src/dmpi/Makefile \
src/env/Makefile src/topol/Makefile src/profile/Makefile \
src/coll2/Makefile \
src/util/Makefile src/infoexport/Makefile examples/basic/Makefile \
src/misc2/Makefile src/external/Makefile )
#
# Once we've done one output of the header file, we don't need to do it
# again. By defining the header as null, we hope to avoid messages about
# "mpichconf.h unchanged"
CONFIG_HEADERS=""
export CONFIG_HEADERS
# Removed mpif77 because it is created by the Fortran subsystem.
# Removed mpif90 for the same reason.
# Note that some of these scripts are needed only by some devices; they
# should eventually be built by only those devices (which should also know
# about installing them)
# FIXME: mv util/chkserv util/chkmachine and util/tstmachines elsewhere.
PAC_OUTPUT_EXEC(util/mpicc util/mpicxx util/mpiinstall \
util/mpirun util/mpichlib.conf util/mpiman \
util/chkserv util/chkmachine util/tstmachines, a+x )
dnl
dnl mpif.h created by the Fortran subsystem
rm -f $includebuild_dir/mpidefs.h
rm -f $includebuild_dir/mpif.f90
dnl rm -f $includebuild_dir/mpif.h
rm -f "$top_srcdir/include/mpidefs.h"
rm -f "$top_srcdir/include/mpif.f90"
dnl rm -f "$top_srcdir/include/mpif.h"
PAC_OUTPUT_EXEC(include/mpidefs.h,a+r)
PAC_OUTPUT_EXEC(include/mpif.f90,a+r)
dnl PAC_OUTPUT_EXEC(include/mpif.h,a+r)
# We must undo the assignment to CONFIG_HEADERS
unset CONFIG_HEADERS
# Get the files needed by USER programs into the includebuild_dir
if test ! -s "$includebuild_dir/mpi.h" ; then
cp "${top_srcdir}/include/mpi.h" "$includebuild_dir"
cp "${top_srcdir}/include/mpi_errno.h" "$includebuild_dir"
fi
if test ! -s "$includebuild_dir/mpidefs.h" ; then
cp "${top_srcdir}/include/mpidefs.h" "$includebuild_dir"
dnl cp ${top_srcdir}/include/mpif.h $includebuild_dir
fi
#
# Update mpif.h with mpiof.h if both romio and fortran were selected and
# successful
if test "$NOF77" = "0" -a "$ROMIO" = "1" -a -s romio/include/mpiof.h -a \
-s src/fortran/include/mpif.h ; then
echo "Creating mpif.h from Fortran and Romio contributions"
# Special case: Both ROMIO and the Fortran module may have defined
# MPI_OFFSET_KIND. If so, remove the Romio definition.
if grep MPI_OFFSET_KIND src/fortran/include/mpif.h >/dev/null 2>&1 ; then
sed -e '/OFFSET_KIND/d' romio/include/mpiof.h | \
cat src/fortran/include/mpif.h - > \
$includebuild_dir/mpif.h
else
cat src/fortran/include/mpif.h romio/include/mpiof.h > \
$includebuild_dir/mpif.h
fi
fi
dnl if test "$NOF77" = "0" ; then
dnl PAC_OUTPUT_EXEC(src/env/farg.f src/env/farg90.f)
dnl fi
#
# Configure the tests (now that the compiler scripts are built)
echo "Configuring the test suite..."
unset CONFIG_FILES
if test ! -d examples/test ; then
mkdir examples/test
fi
#
testargs=""
if test "$NO_LONG_LONG" = "yes" ; then
testargs="$testargs --disable-long-long"
fi
if test "$NO_LONG_DOUBLE" = "yes" ; then
testargs="$testargs --disable-long-double"
fi
if test "$HAS_F77" != "0" ; then
testargs="$testargs -basefc=\"$F77\" -fc=\"$MPIF77\""
else
testargs="$testargs -nof77"
fi
if test "$ROMIO" = "1" ; then
testargs="$testargs --enable-io"
else
testargs="$testargs --disable-io"
fi
#
# The eval causes the \" in the f77 case above to be properly expanded.
( cd examples/test ;
export MPIBOOT ; export MPIUNBOOT ; \
eval "$srcdir/examples/test/configure" -basecc=\"$CC\" -cc=\"$MPICC\" \
-make=\"$MAKE\" -device="$DEVICE" \
-mpichpath="$binbuild_dir" \
--enable-boot \
-cflags=\"$CFLAGS\" $testargs )
if test ! -d examples/perftest ; then
mkdir examples/perftest
fi
echo "Configuring the performance tests ..."
if test "$HAS_F77" = 0 ; then otherargs="--disable-fortran"
else otherargs=""
fi
# This is the autoconf 2 version.
# if we're the developers, we may need to create the
# initial configure files.
if test ! -x "$top_srcdir_val/examples/perftest/configure" -a \
-s "$top_srcdir_val/examples/perftest/configure.in" -a \
-x "$top_srcdir_val/examples/perftest/makeconfigure" ; then
(cd "$top_srcdir_val/examples/perftest" ; ./makeconfigure)
fi
(cd examples/perftest ; \
export MAKE ; export CC ; export F77 ; export MPICC ; export MPIF77 ; \
export MPILIBNAME ; export TESTCC ; export TESTF77 ; \
export F90 ; export TESTF90 ; \
"$srcdir/examples/perftest/configure" \
--with-mpichbuilding --with-mpich=$binbuild_dir \
-prefix=$prefix $otherargs )
#if test "$HAS_F77" != "0" ; then
# ( cd examples/perftest ; \
# $srcdir/examples/perftest/configure -cc="$MPICC" -basecc="$CC" \
# -fc="$MPIF77" -basefc="$F77" \
# -f77_extra_flag="$F77_EXTRA_FLAG" \
# -make="$MAKE" )
#else
# ( cd examples/perftest ; \
# $srcdir/examples/perftest/configure -cc="$MPICC" -basecc="$CC" -nof77 \
# -make="$MAKE" )
#fi
#
# Configure JUST the correct device file
CONFIG_FILES="mpid/$DEVICE/Makefile"
if test -f "$srcdir/mpid/tests/Makefile.in" ; then
CONFIG_FILES="$CONFIG_FILES mpid/tests/Makefile"
fi
export CONFIG_FILES
${CONFIG_SHELL-/bin/sh} ./config.status
CONFIG_FILES=""
unset CONFIG_FILES
#
# Set the final choices of flags
#
# If the test suite is part of the directory, generate its makefiles
# This should have it's own configure
if test -d tsuite ; then
CONFIG_FILES="tsuite/Makefile tsuite/coll/Makefile tsuite/mpitc2/Makefile"
export CONFIG_FILES
${CONFIG_SHELL-/bin/sh} ./config.status
CONFIG_FILES=""
unset CONFIG_FILES
fi
#
# If the bugs directory is available, generate its makefiles
if test -d bugs ; then
CONFIG_FILES=""
if test -s bugs/Makefile.in ; then
CONFIG_FILES="bugs/Makefile.in"
fi
for dir in irecv fort sockperf srleak ssend testsendrecv wait ; do
if test -s bugs/$dir/Makefile.in ; then
CONFIG_FILES="$CONFIG_FILES bugs/$dir/Makefile"
fi
done
export CONFIG_FILES
${CONFIG_SHELL-/bin/sh} ./config.status
CONFIG_FILES=""
unset CONFIG_FILES
fi
#
# If the mpich-ibm testsuite is available, generate its files
if test -d examples/test/mpitc ; then
CONFIG_FILES="examples/test/mpitc examples/test/mpitc/ccl examples/test/mpitc/comm examples/test/mpitc/dtyp examples/test/mpitc/env examples/test/mpitc/group examples/test/mpitc/pt2pt examples/test/mpitc/topo"
export CONFIG_FILES
${CONFIG_SHELL-/bin/sh} ./config.status
CONFIG_FILES=""
unset CONFIG_FILES
fi
#
if test ! -f .mpich -a -z "$nobanner" ; then
print_error "--->"
print_error You should register your copy of MPICH with us by sending mail
print_error to majordomo@mcs.anl.gov containing the message
print_error subscribe mpi-users
print_error This will allow us to notify you of new releases of MPICH.
print_error " "
print_error "You can also check the MPICH home page at "
print_error "http://www.mcs.anl.gov/mpi/mpich"
if test "$print_machines_message" = 1 ; then
print_error "Created util/machines/machines.$ARCH with five copies of $HOST"
print_error "You may want to edit this file to add and delete hosts"
print_error "(These hosts are used by mpirun.)"
fi
print_error "---< "
fi
if test -n "$found_old" ; then
echo "Old style arguments to configure were found:"
echo $found_old
echo ""
fi
echo 'Configuration completed.'
exit 0
|