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 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807
|
#!/bin/sh
#****************************************************************************
#* TAU Portable Profiling Package **
#* http://www.cs.uoregon.edu/research/tau **
#****************************************************************************
#* Copyright 1997-2003 **
#* Department of Computer and Information Science, University of Oregon **
#* Advanced Computing Laboratory, Los Alamos National Laboratory **
#* Research Center Juelich, ZAM Germany **
#****************************************************************************
#*
#* Permission to use, copy, modify, and distribute this software and its
#* documentation for any purpose and without fee is hereby granted,
#* provided that the above copyright notice appear in all copies and that
#* both that copyright notice and this permission notice appear in
#* supporting documentation, and that the name of University of Oregon (UO)
#* and Los Alamos National Laboratory (LANL) not be
#* used in advertising or publicity pertaining to distribution of
#* the software without specific, written prior permission. The
#* University of Oregon and LANL makes no representations about the
#* suitability of this software for any purpose. It is provided "as is"
#* without express or implied warranty.
#*
#* THE UNIVERSITY OF OREGON AND LANL DISCLAIMS ALL WARRANTIES WITH REGARD TO
#* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
#* FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF OREGON OR LANL BE LIABLE FOR
#* ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
#* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
#* CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
#* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#****************************************************************************
#****************************************************************************
#* Authors : Sameer Shende (sameer@cs.uoregon.edu) (UO, LANL)
#* Peter Beckman, Steve Karmesin (ACL, LANL)
#* Kathleen Lindlan, Ariya Lohavanichbutr (UO)
#* Principal Investigators :
#* Janice Cuny, Allen Malony (UO)
#* TAU project was developed by Bernd Mohr, Lars Hansen, Kurt Windisch,
#* Darryl Brown, et. al. and directed by Allen Malony at University of Oregon.
#* The TAU Portable Profiling Package uses part of TAU.
#****************************************************************************
# Configure script for TAU
# Sameer Shende 11/12/97 for TAU Portable Profiling Package
# Kurt Windisch 12/9/96
# Based on the configure script for Sage/pC++ by:
# Pete Beckman 9/6/93
# Lars Thomas Hansen 2/27/95 (Solaris fix)
#
# New options for TAU/HPC++:
# -pcxx <sageroot directory>
# -sage2 <edg-sage2 directory>
# -pstl <pstl directory>
# -hpnx <hpc++lib/nexus directory>
#
# Options for Configure :
# ./configure -cc=<C Compiler> -c++=<C++ Compiler> -useropt=<User options>
# -gnu -PROFILE -TRACE
#
# Recommended configuration for testing on SGI:
# ./configure -useropt=-64 -PROFILE
# For testing with KAI's KCC compiler
# ./configure -cc=cc -c++=KCC -PROFILE
# If your C++ compiler does not support STL, you could use something like:
# ./configure -useropt='-I/usr/local/packages/SGI-STL/'
# after downloading the Standard Templates Library.
# This configure script has been tested on SGI, LINUX, SOLARIS2 and HP
#
# Currently this configure file modifies Makefiles within Sage to the
# following architecture names (see ./utils/archfind) :
# ptx a Sequent Symmetry running DYNIX/ptx (386/486 based)
# symmetry a Sequent Symmetry running DYNIX 3 (386/486 based)
# hp9000s700 an HP 9000, series 700, running hpux
# hp9000s800 an HP 9000, series 800, running hpux
# decstation a DecStation XXXX
# rs6000 an IBM RS6000 running AIX
# sun4 a Sun Microsystems series 4 workstation (SPARC based)
# solaris2 a Sun Workstation running SVR4 Solaris
# next a NeXT computer
# sgi4k an SGI R4K-based machine
# sgi8k an SGI R8K-based (Power) machine
# cm5 a Thinking Machines Corporation CM-5
# paragon an Intel paragon
# tc2000 a BBN Butterfly tc2000
# ksr1 a Kendall Square KSR1
# unknown default setup, no machine selected (original)
# alpha an HP/Compaq Alpha running OSF/1 Tru64
# c90 a Cray C90 running Unicos
# t3d a Cray T3D (Alpha-based) computer array
# i386_linux an Intel ix86 PC running LINUX
# default Returns all files to "distribution" snapshot.
# This MUST be done before any CVS commands are called
#
# The tkfile may contain definitions of environment variables in the
# style of /bin/sh, e.g. (these are the defaults)
#
# tcltkheader="-I/usr/local/include"
# tcltklib="-L/usr/local/lib -ltk4.0 -ltcl7.4"
# x11header="-I/usr/include"
# x11lib="-L/usr/lib -lX11"
#
# If a file name is given, it must contain all these definitions.
# No checking is done to ensure that it does so.
default=false
for arg in "$@"; do
case $arg in
default)
default=true
;;
-help)
echo "TAU Configuration Utility "
echo "***********************************************************************"
echo "Usage: configure [OPTIONS]"
echo " where [OPTIONS] are:"
echo ""
echo "Compiler Options:"
echo "-c++=<compiler> ............................ specify the C++ compiler."
echo " options [CC|KCC|g++|*xlC*|cxx|pgCC|FCC|guidec++|aCC|c++|ecpc|"
echo " icpc|scgcc|scpathCC|pathCC|orCC]."
echo "-cc=<compiler> ................................ specify the C compiler."
echo " options [cc|gcc|scgcc|KCC|pgcc|guidec|*xlc*|ecc|pathcc|orcc]."
echo "-fortran=<compiler> ..................... specify the Fortran compiler."
echo " options [gnu|sgi|ibm|ibm64|hp|cray|pgi|absoft|fujitsu|sun|compaq|"
echo " g95|open64|kai|nec|hitachi|intel|absoft|lahey|nagware|pathscale]"
echo "-pdt=<dir> ........ Specify location of PDT (Program Database Toolkit)."
echo "-pdt_c++=<compiler> ............ specify a different PDT C++ compiler."
echo " options [CC|KCC|g++|*xlC*|cxx|pgCC|FCC|guidec++|aCC|c++|ecpc|"
echo " icpc|scgcc|pathCC|orCC]."
echo "-useropt='<parameters>' ... optional arguments to compilers (e.g. -O3)."
echo ""
echo "Installation Options:"
echo "-prefix=<dir> ................ Specify a target installation directory."
echo "-exec-prefix=<arch> .......... Specify a target architecture directory."
echo "-arch=<architecture> ................... Specify a target architecture."
echo " options [xt3|craycnl|bgp|bgl|ibm64|ibm64linux|sunx86_64"
echo " |solaris2-64|mips32|sgin32|sgi64|sgio32]"
echo ""
echo "MPI Options:"
echo "-mpi .......................... Specify use of TAU MPI wrapper library."
echo "-mpiinc=<dir> ............. Specify location of MPI include dir and use"
echo " the TAU MPI Profiling and Tracing Interface."
echo "-mpilib=<dir> ............. Specify location of MPI library dir and use"
echo " the TAU MPI Profiling and Tracing Interface."
echo "-mpilibrary=<library> ................ Specify a different MPI library."
echo " e.g., -mpilibrary=-lmpi_r "
echo ""
echo "OpenMP Options:"
echo "-openmp ........................................... Use OpenMP threads."
echo "-opari ..................................................... Use Opari."
echo "-opari_region ......... Report performance data for all OpenMP regions."
echo "-opari_construct ... Report performance data for all OpenMP constructs."
echo ""
echo "SHMEM Options:"
echo "-shmem ...................... Specify use of TAU SHMEM wrapper library."
echo "-shmeminc=<dir> ......... Specify location of SHMEM include dir and use"
echo " the TAU SHMEM Profiling and Tracing Interface."
echo "-shmemlib=<dir> ......... Specify location of SHMEM library dir and use"
echo " the TAU MPI Profiling and Tracing Interface."
echo "-shmemlibrary=<library> ............ Specify a different SHMEM library."
echo " e.g., -shmemlibrary=-lsmac "
echo ""
echo "Other Options:"
echo "-iowrapper .................................... Build POSIX IO Wrapper."
echo "-pthread .................................. Use pthread thread package."
echo "-papithread .................................. Use PAPI thread package."
echo "-papi=<dir> ............... Specify location of PAPI (Performance API)."
echo "-jdk=<dir> Build a library for profiling Java code with specified jdk."
echo "-vtf=<dir> ......... Specify location of VTF3 Trace Generation Package."
echo "-otf=<dir> ....... Specify location of Open Trace Format (OTF) Package."
echo "-slog2 ........ Specify use of TAU internal SLOG2 SDK/Jumpshot Package."
echo "-nocomm ........ Disable tracking communication events in MPI library."
echo "-epilog=<dir> ............ Specify location of EPILOG Tracing package."
echo "-epiloglib=<dir> ........... Specify full path to EPILOG lib directory."
echo "-epilogbin=<dir> ........... Specify full path to EPILOG bin directory."
echo "-epiloginc=<dir> ....... Specify full path to EPILOG include directory."
echo "-vampirtrace=<dir> .. Specify location of VampirTrace Tracing package."
echo "-pythoninc=<dir> ........ Specify location of Python include directory."
echo "-pythonlib=<dir> ............ Specify location of Python lib directory."
echo "-tag=<unique name> ........ Specify a tag to identify the installation."
echo "-TRACE ..................................... Generate TAU event traces."
echo "-MPITRACE ... Generate event traces for MPI events and their ancestors."
echo "-PROFILE ............ Generate profiles (summary statistics) (default)."
echo "-PROFILECALLPATH ......................... Generate call path profiles."
echo "-PROFILEPARAM .... Generate profiles with parameter mapped event data ."
echo "-PROFILEPHASE .......................... Generate phase based profiles."
echo "-PROFILESTATS .................. Enable standard deviation calculation."
echo "-DEPTHLIMIT ........... Disable instrumentation beyond a certain depth."
echo "-PROFILEMEMORY .. Track heap memory utilization at each function entry."
echo "-PROFILEHEADROOM .. Track memory free (or headroom) at each func entry."
echo "-MULTIPLECOUNTERS ............ Use multiple hardware counters and time."
echo "-COMPENSATE ........ Compensate for profiling measurement perturbation."
echo "-BGLTIMERS .... Use fast low-overhead timers on IBM BlueGene/L systems."
echo "-BGPTIMERS .... Use fast low-overhead timers on IBM BlueGene/P systems."
echo "-SGITIMERS .......... Use fast nanosecond timers on SGI R10000 systems."
echo "-CRAYTIMERS ............ Use fast nanosecond timers on Cray X1 systems."
echo "-LINUXTIMERS ......... Use low overhead TSC Counter for wallclock time."
echo "-CPUTIME .......... Use usertime+system time instead of wallclock time."
echo "-PAPIWALLCLOCK ........ Use PAPI to access wallclock time. Needs -papi."
echo "-PAPIVIRTUAL .......... Use PAPI for virtual (user) time calculation."
echo "-INTELCXXLIBICC ......... Use Intel -cxxlib-icc option for compiling."
echo "-noex .................. Use no exceptions while compiling the library."
echo "-DISABLESHARED .................. Do not build libTAU.so shared object."
echo "-help ...................................... display this help message."
echo "-fullhelp .............................. display the full help message."
echo ""
echo "More advanced options are available, use -fullhelp to see them."
exit
;;
-fullhelp)
echo "TAU Configuration Utility "
echo "***********************************************************************"
echo "Usage: configure [OPTIONS]"
echo " where [OPTIONS] are:"
echo "-c++=<compiler> ............................ specify the C++ compiler."
echo " options [CC|KCC|g++|*xlC*|cxx|pgCC|FCC|guidec++|aCC|c++|ecpc|"
echo " icpc|scgcc|scpathCC|pathCC|orCC]."
echo "-cc=<compiler> ................................ specify the C compiler."
echo " options [cc|gcc|scgcc|KCC|pgcc|guidec|*xlc*|ecc|pathcc|orcc]."
echo "-pdt_c++=<compiler> ............ specify a different PDT C++ compiler."
echo " options [CC|KCC|g++|*xlC*|cxx|pgCC|FCC|guidec++|aCC|c++|ecpc|"
echo " icpc|scgcc|pathCC|orCC]."
echo "-pdtcompdir=<compilerdir> . specify a different PDT compiler directory."
echo "-pdtarchdir=<archdir> . specify a different PDT architecture directory."
echo "-fortran=<compiler> ..................... specify the Fortran compiler."
echo " options [gnu|sgi|ibm|ibm64|hp|cray|pgi|absoft|fujitsu|sun|compaq|"
echo " g95|open64|kai|nec|hitachi|intel|absoft|lahey|nagware|pathscale]"
echo "-useropt='<parameters>' ............... list of commandline parameters."
echo "-extrashlibopts='<parameters>' ...... arguments for building libTAU.so."
echo "-prefix=<dir> ................ Specify a target installation directory."
echo "-exec-prefix=<arch> .......... Specify a target architecture directory."
echo "-arch=<architecture> ................... Specify a target architecture."
echo " options [xt3|craycnl|bgp|bgl|ibm64|ibm64linux|sunx86_64"
echo " |solaris2-64|mips32|sgin32|sgi64|sgio32]"
echo "-iowrapper .................................... Build POSIX IO Wrapper."
echo "-pthread .................................. Use pthread thread package."
echo "-papithread .................................. Use PAPI thread package."
echo "-charm=<dir> .............................. Use charm++ thread package."
echo "-sproc .................................. Use SGI sproc thread package."
echo "-tulipthread=<dir> .......... Specify location of Tulip/Smarts package."
echo "-smarts .................. Use SMARTS API for threads (use with above)."
echo "-openmp ........................................... Use OpenMP threads."
echo "-opari ..................................................... Use Opari."
echo "-opari_region ......... Report performance data for all OpenMP regions."
echo "-opari_construct ... Report performance data for all OpenMP constructs."
echo "-pcl=<dir> ..... Specify location of PCL (Performance Counter Library)."
echo "-papi=<dir> ............... Specify location of PAPI (Performance API)."
echo "-pdt=<dir> ........ Specify location of PDT (Program Database Toolkit)."
echo "-jdk=<dir> Build a library for profiling Java code with specified jdk."
echo "-dyninst=<dir> ................... Specify location of DynInst Package."
echo "-vtf=<dir> ......... Specify location of VTF3 Trace Generation Package."
echo "-otf=<dir> ....... Specify location of Open Trace Format (OTF) Package."
echo "-slog2=<dir> .......... Specify location of SLOG2 SDK/Jumpshot Package."
echo "-slog2 ........ Specify use of TAU internal SLOG2 SDK/Jumpshot Package."
echo "-mpi .......................... Specify use of TAU MPI wrapper library."
echo "-mpiinc=<dir> ............. Specify location of MPI include dir and use"
echo " the TAU MPI Profiling and Tracing Interface."
echo "-mpilib=<dir> ............. Specify location of MPI library dir and use"
echo " the TAU MPI Profiling and Tracing Interface."
echo "-mpilibrary=<library> ................ Specify a different MPI library."
echo " e.g., -mpilibrary=-lmpi_r "
echo "-shmem ...................... Specify use of TAU SHMEM wrapper library."
echo "-shmeminc=<dir> ......... Specify location of SHMEM include dir and use"
echo " the TAU SHMEM Profiling and Tracing Interface."
echo "-shmemlib=<dir> ......... Specify location of SHMEM library dir and use"
echo " the TAU MPI Profiling and Tracing Interface."
echo "-shmemlibrary=<library> ............ Specify a different SHMEM library."
echo " e.g., -shmemlibrary=-lsmac "
echo "-nocomm ........ Disable tracking communication events in MPI library."
echo "-epilog=<dir> ............ Specify location of EPILOG Tracing package."
echo "-epiloglib=<dir> ........... Specify full path to EPILOG lib directory."
echo "-epilogbin=<dir> ........... Specify full path to EPILOG bin directory."
echo "-epiloginc=<dir> ....... Specify full path to EPILOG include directory."
echo "-vampirtrace=<dir> .. Specify location of VampirTrace Tracing package."
echo "-pythoninc=<dir> ........ Specify location of Python include directory."
echo "-pythonlib=<dir> ............ Specify location of Python lib directory."
echo "-tag=<unique name> ........ Specify a tag to identify the installation."
echo "-perfinc=<dir> ............. Specify a Perflib[LANL] include directory."
echo "-perflib=<dir> ................. Specify a Perflib[LANL] lib directory."
echo "-perflibrary=<library> ... Specify a different perflib runtime library."
echo "-ktau ........................................... Kernel TAU Profiling."
echo "-ktau_shctr ........................ Kernel TAU Profiling with shared- "
echo " OS counters support."
echo "-ktauinc=<dir> ............... Specify location of Linux Kernel source."
echo "-ktauincuser=<dir> ............... Specify location of KTAU user incls."
echo "-ktaulib=<dir> ............ Specify location of KTAU library libktau.a."
echo "-ktausym=<path to System.map> ...... Specify location of Linux Kernel."
echo " Symbol Table."
echo "-muse ................................. Specify the use of MAGNET/MUSE."
echo "-muse_event ............................Specify the use of MAGNET/MUSE."
echo " w/ non-monotonically increasing values."
echo "-muse_multiple ........................ Specify the use of MAGNET/MUSE."
echo " w/ monotonically increasing values."
echo "-stff=<dir> .... Location of RENCI Scalable Time-series filter library."
echo "-sddf=<dir> ...... SDDF library location; Only required for RENCI STFF."
echo "-TRACE ..................................... Generate TAU event traces."
echo "-MPITRACE ... Generate event traces for MPI events and their ancestors."
echo "-PROFILE ............ Generate profiles (summary statistics) (default)."
echo "-PROFILECALLPATH ......................... Generate call path profiles."
echo "-PROFILEPARAM .... Generate profiles with parameter mapped event data ."
echo "-PROFILEPHASE .......................... Generate phase based profiles."
echo "-PROFILESTATS .................. Enable standard deviation calculation."
echo "-DEPTHLIMIT ........... Disable instrumentation beyond a certain depth."
echo "-PROFILEMEMORY .. Track heap memory utilization at each function entry."
echo "-PROFILEHEADROOM .. Track memory free (or headroom) at each func entry."
echo "-MULTIPLECOUNTERS ............ Use multiple hardware counters and time."
echo "-COMPENSATE ........ Compensate for profiling measurement perturbation."
echo "-BGLTIMERS .... Use fast low-overhead timers on IBM BlueGene/L systems."
echo "-BGPTIMERS .... Use fast low-overhead timers on IBM BlueGene/P systems."
echo "-SGITIMERS .......... Use fast nanosecond timers on SGI R10000 systems."
echo "-CRAYTIMERS ............ Use fast nanosecond timers on Cray X1 systems."
echo "-LINUXTIMERS ......... Use low overhead TSC Counter for wallclock time."
echo "-CPUTIME .......... Use usertime+system time instead of wallclock time."
echo "-JAVACPUTIME ...................... Use JVMPI thread specific cpu time."
echo "-PAPIWALLCLOCK ........ Use PAPI to access wallclock time. Needs -papi."
echo "-PAPIVIRTUAL .......... Use PAPI for virtual (user) time calculation."
echo "-INTELCXXLIBICC ......... Use Intel -cxxlib-icc option for compiling."
echo "-noex .................. Use no exceptions while compiling the library."
echo "-DISABLESHARED .................. Do not build libTAU.so shared object."
echo "-help ...................................... display this help message."
echo "-fullhelp .............................. display the full help message."
exit
;;
esac
done
rm -f .clean
if [ $default = false ] ; then
rm -f .last_config
fi
# This method will escape spaces so that you can use ./configure `cat .last_config` when you've used them
for arg in "$@"; do
# Thanks to Bernd Mohr for the following that handles quotes and spaces
# -e 's/^x//' removes the x at the start
# -e 's/"/\\\"/g' replaces " with \"
# -e s,\',%@%\',g replaces ' with %@%'
# -e 's/%@%/\\\/g' replaces %@% \
# -e 's/ /\\\ /g' replaces space with \space
modarg=`echo "x$arg" | sed -e 's/^x//' -e 's/"/\\\"/g' -e s,\',%@%\',g -e 's/%@%/\\\/g' -e 's/ /\\\ /g'`
modargs="$modargs $modarg"
done
if [ $default = false ] ; then
# echo "configured with:"
# echo ""
# echo "$modargs"
# echo ""
echo "$modargs" >> .all_configs
echo "$modargs" > .last_config
fi
# test if we're using the bash shell
usingbash=no
readlink=`which readlink`
if [ "x$readlink" != "x" ] ; then
if [ -x "$readlink" ] ; then
symlink=`readlink /bin/sh`
if [ "x$symlink" = "xbash" ] ; then
usingbash=yes
fi
fi
fi
# write tau_config.h that's used as meta-data containing the TAU configuration
if [ "$usingbash" = "yes" ] ; then
modmodargs=`echo "x$modargs" | sed -e 's/^x//' -e 's#\\\#\\\\\\\\#g'`
else
modmodargs=`echo "x$modargs" | sed -e 's/^x//' -e 's#\\\#\\\\\\\\\\\#g'`
fi
echo "#define TAU_CONFIG \"$modmodargs\"" > include/tau_config.h
START_DIR=`pwd`
# Record all the arguments
arguments=$*
# Default compilers and options
c_compiler=default
cxx_compiler=default
pdt_cxx_compiler=default
fixmakeargs=""
pcxxopt=-g
useropt=
tag=no
tautag=
orig_useropt=
mpi=no
mpi2=no
mpiio=no
mpiinc=
mpilib=
mpilibrary=no
ibmmpi=no
shmem=no
shmeminc=
shmemlib=
shmemlibrary=no
threadsafe=no
additional_mpiincs=
additional_mpilibs=
pythoninc=
pythonlib=
python=no
sicortex=no
extradir=
extrashlibopts=
awe=no
pthread=no
papithread=no
papipfm=no
papisubdir=
charm=no
muse=no
muse_event=no
muse_multiple=no
comm=yes
sproc=no
noex=no
disableshared=no
setnode0=no
tulipthread=no
compensate=no
smarts=no
pcl=no
papi=no
perf=no
perfincdir=
perflibdir=
perflibrary=
task=no
lwp=no
tcltk=yes
tcltkfile="/"
kai=no
pgi=no
fujitsu=no
guidef90=no
stdcxxlib=no
inteltflop=no
intelcxxlibicc=no
intelifort=no
intel=no
gnu=no
profile=no
monitor=no
profilecounters=no
multiplecounters=no
profilestats=no
profilememory=no
profileheadroom=no
callpath=no
profileparam=no
depthlimit=no
phase=no
profilecalls=no
profilecallstack=no
trace=no
mpitrace=no
debugprof=no
bgltimers=no
bgptimers=no
sgitimers=no
craytimers=no
linuxtimers=no
alphatimers=no
cputime=no
javacputime=no
papiwallclock=no
papivirtual=no
use_pcxx=no
use_hpcxx=no
use_ansic=no
use_sage2=no
use_pstl=no
use_hpnx=no
tauarch=unknown
pdtcompdir=unknown
pdtarchdir=unknown
tauprefix=unknown
execprefix=unknown
taugcclibdir=unknown
tautoplevel=
tauoptions=
pdt_root_dir="."
pdt=no
vtf=no
otf=no
slog2=no
internalslog2=no
opari=no
epilog=no
scalasca=no
epilogextralinkcmd=
epiloglib=no
epilogbin=no
epiloginc=no
epilogdir=no
epiloglibdir=no
epilogbindir=bin
epilogincdir=
vampirtrace=no
opari_region=no
opari_construct=no
dyninst=no
java=no
openmp=no
ibmxlc=no
ibmxlc_r=no
fortran_compiler=no
ktau=no
ktau_merge=no
ktau_shctr=no
ktauinc=
ktauincuser=
ktaulib=
ktausym=
catamount=no
gpshmem=no
stff=no
stffdir=
sddf=no
sddfdir=
iowrapper=no
home=$HOME
# debug:
# echo $arguments
# Reset include/Makefile before starting anything else
for i in include/Makefile
do
sed -f utils/FixMakefile.sed.default < ${i} > ${i}~~0
mv ${i}~~0 ${i}
done
# PARSE COMMAND LINE SWITCHES
###############################################################
for arg in "$@";
do
case $arg in
-cc=*)
myarg=`echo $arg | sed 's/-cc=//'`
if [ $myarg = cc -o $myarg = gcc -o $myarg = KCC -o $myarg = pgcc -o $myarg = guidec -o $myarg = xlc -o $myarg = ecc -o $myarg = icc -o $myarg = powerpc64-linux-gcc -o $myarg = pathcc -o $myarg = fcc -o $myarg = orcc -o $myarg = qk-pgcc -o $myarg = scgcc -o $myarg = scpathcc -o $myarg = mips64el-gentoo-linux-gnu-gcc -o $myarg = powerpc-bgp-linux-gcc ]
then
c_compiler=$myarg
else
testxlc=`echo $myarg | sed -e 's/xlc//'`
testmp=`echo $myarg | sed -e 's/^mp//'`
if [ "y$testxlc" = "y$myarg" -a "y$testmp" = "y$myarg" ]
then
echo "WARNING: valid options for cc are 'cc', 'gcc', 'KCC', 'guidec', '*xlc*', 'ecc', 'icc', 'pathcc', 'fcc', 'orcc', 'qk-pgcc', 'powerpc-bgp-linux-gcc', and 'pgcc' "
# exit 1
else
if [ "y$testxlc" != "y$myarg" ]
then
c_compiler=$myarg
else
c_compiler=`$myarg -show | awk '{ print $1; }'`
fi
fi
fi
shift
;;
-c++=*)
myarg=`echo $arg | sed 's/-c++=//'`
if [ $myarg = CC -o $myarg = KCC -o $myarg = g++ -o $myarg = cxx -o $myarg = NCC -o $myarg = pgCC -o $myarg = egcs -o $myarg = FCC -o $myarg = guidec++ -o $myarg = aCC -o $myarg = c++ -o $myarg = ecpc -o $myarg = icpc -o $myarg = powerpc64-linux-g++ -o $myarg = pathCC -o $myarg = orCC -o $myarg = qk-pgCC -o $myarg = scg++ -o $myarg = scpathCC -o $myarg = mips64el-gentoo-linux-gnu-g++ -o $myarg = powerpc-bgp-linux-g++ -o $myarg = mpicxx ]
then
cxx_compiler=$myarg
else
testxlc=`echo $myarg | sed -e 's/xl//'`
testmp=`echo $myarg | sed -e 's/^mp//'`
if [ "y$testxlc" = "y$myarg" -a "y$testmp" = "y$myarg" ]
then
echo "WARNING: valid options for c++ are 'CC', 'KCC', 'g++', '*xlC*', 'cxx' , 'NCC', 'egcs', 'pgCC', 'FCC', 'guidec++', 'aCC', 'ecpc', 'icpc', 'pathCC', 'c++', 'qk-pgCC', and 'orCC'"
# exit 1
else
if [ "y$testxlc" != "y$myarg" ]
then
cxx_compiler=$myarg
else
cxx_compiler=`$myarg -show | awk '{ print $1; }'`
fi
fi
fi
shift
;;
-pdt_c++=*)
pdt_cxx_full_path=`echo $arg | sed 's@-pdt_c++=@@g'`
myarg=`echo $arg | echo $arg | sed 's@-pdt_c++=@@g' | sed 's@.*/@@g'`
if [ $myarg = CC -o $myarg = KCC -o $myarg = g++ -o $myarg = cxx -o $myarg = NCC -o $myarg = pgCC -o $myarg = egcs -o $myarg = FCC -o $myarg = guidec++ -o $myarg = aCC -o $myarg = c++ -o $myarg = ecpc -o $myarg = icpc -o $myarg = powerpc64-linux-g++ -o $myarg = pathCC -o $myarg = orCC -o $myarg = qk-pgCC -o $myarg = scg++ -o $myarg = scpathCC -o $myarg = mips64el-gentoo-linux-gnu-g++ -o $myarg = powerpc-bgp-linux-g++ ]
then
pdt_cxx_compiler=$myarg
else
testxlc=`echo $myarg | sed -e 's/xl//'`
if [ "y$testxlc" = "y$myarg" ]
then
echo "WARNING: valid options for pdt_c++ are 'CC', 'KCC', 'g++', '*xlC*', 'cxx' , 'egcs', 'pgCC', 'FCC', 'guidec++', 'aCC', 'c++', and 'orCC'"
# exit 1
else
pdt_cxx_compiler=$myarg
fi
fi
shift
;;
-fortran=*)
myarg=`echo $arg | sed 's/-fortran=//'`
if [ $myarg = gnu -o $myarg = sgi -o $myarg = ibm -o $myarg = ibm64 -o $myarg = hp -o $myarg = cray -o $myarg = pgi -o $myarg = absoft -o $myarg = fujitsu -o $myarg = sun -o $myarg = compaq -o $myarg = kai -o $myarg = hitachi -o $myarg = intel -o $myarg = nec -o $myarg = absoft -o $myarg = lahey -o $myarg = nagware -o $myarg = pathscale -o $myarg = gfortran -o $myarg = g95 -o $myarg = open64 ]
then
fortran_compiler=$myarg
else
echo "WARNING: valid options for fortran are 'gnu', 'sgi', 'ibm', 'ibm64', 'hp', 'cray', 'pgi', 'absoft', 'fujitsu', 'sun', 'compaq', 'kai', 'hitachi', 'intel', 'nec' , 'absoft', 'lahey', 'nagware', 'pathscale', 'gfortran', 'g95', and 'open64'"
exit 1
fi
shift
;;
-gnu)
c_compiler=gcc
cxx_compiler=g++
shift
;;
-dec)
c_compiler=cc
cxx_compiler=g++
shift
;;
-ibm)
c_compiler=xlc_r
cxx_compiler=xlC_r
shift
;;
-cfront)
c_compiler=cc
cxx_compiler=CC
shift
;;
-sgi)
c_compiler=cc
cxx_compiler=CC
shift
;;
-task)
task=yes
shift
;;
-awe=*)
awe=yes
awedir=`echo $arg | sed -e 's/-awe=//'`
shift
;;
-tag=*)
tag=yes
tautag=`echo $arg | sed -e 's/-tag=//'`
shift
;;
-lwp)
lwp=yes
shift
;;
-pthread=*)
pthread=yes
ptdir=`echo $arg | sed -e 's/-pthread=//'`
shift
;;
-pthread)
pthread=yes
shift
;;
-papithread)
papithread=yes
shift
;;
-iowrapper)
iowrapper=yes
shift
;;
-charm=*)
pthread=yes
charm=yes
charmdir=`echo $arg | sed -e 's/-charm=//'`
shift
;;
-COMPENSATE)
compensate=yes
shift
;;
-forceshared)
fixmakeargs="$fixmakeargs FORCESHARED"
shift
;;
-ktau)
ktau=yes
shift
;;
-ktau_merge)
ktau_merge=no
shift
;;
-ktau_shctr)
ktau_shctr=yes
shift
;;
-ktauinc=*)
ktauinc=`echo $arg | sed -e 's/-ktauinc=//' -e 's/ /#/g'`
if [ ! -d $ktauinc ]
then
echo "Error: Cannot access KTAU include directory $ktauinc"
exit 1
fi
shift
;;
-ktauincuser=*)
ktauincuser=`echo $arg | sed -e 's/-ktauincuser=//' -e 's/ /#/g'`
if [ ! -d $ktauincuser ]
then
echo "Error: Cannot access KTAU user include directory $ktauincuser"
exit 1
fi
shift
;;
-ktaulib=*)
ktaulib=`echo $arg | sed -e 's/-ktaulib=//' -e 's/ /#/g'`
if [ ! -d $ktaulib ]
then
echo "Error: Cannot access KTAU user lib $ktaulib"
exit 1
fi
shift
;;
-ktausym=*)
ktausym=`echo $arg | sed -e 's/-ktausym=//' -e 's/ /#/g'`
if [ ! -e $ktausym ]
then
echo "Warning: Cannot access KTAU Linux Kernel Symbol Table $ktausym locally (Does it exist on the compute nodes?). Continuing."
fi
shift
;;
-muse)
muse=yes
shift
;;
-muse_event)
muse_event=yes
shift
;;
-muse_multiple)
muse_multiple=yes
shift
;;
-nocomm)
comm=no
shift
;;
-sproc)
sproc=yes
shift
;;
-smarts)
smarts=yes
shift
;;
-tulipthread=*)
tulipthread=yes
tulipdir=`echo $arg | sed -e 's/-tulipthread=//'`
if [ ! -d $tulipdir ]
then
echo "Error: Cannot access TULIP directory $tulipdir"
exit 1
fi
shift
;;
-pcl=*)
pcl=yes
pcldir=`echo $arg | sed -e 's/-pcl=//'`
if [ ! -d $pcldir ]
then
echo "Error: Cannot access PCL directory $pcldir"
exit 1
fi
shift
;;
-papi=*)
papi=yes
papidir=`echo $arg | sed -e 's/-papi=//'`
if [ ! -d $papidir ]
then
echo "Error: Cannot access PAPI directory $papidir"
exit 1
fi
shift
;;
-perfinc=*)
perf=yes
perfincdir=`echo $arg | sed -e 's/-perfinc=//'`
if [ ! -d $perfincdir ]
then
echo "Error: Cannot access PERF include directory $perfincdir"
exit 1
fi
shift
;;
-perflib=*)
perf=yes
perflibdir=`echo $arg | sed -e 's/-perflib=//'`
if [ ! -d $perflibdir ]
then
echo "Error: Cannot access PERF lib directory $perflibdir"
exit 1
fi
shift
;;
-perflibrary=*)
perf=yes
perflibrary=`echo $arg | sed -e 's/-perflibrary=//' -e 's/ /#/g'`
shift
;;
-opari)
opari=yes
openmp=yes
shift
;;
-opari=*)
opari=yes
openmp=yes
shift
;;
-opari_region)
opari_region=yes
shift
;;
-opari_construct)
opari_construct=yes
shift
;;
-vampirtrace=*)
vampirtrace=yes
trace=yes
vampirtracedir=`echo $arg | sed -e 's/-vampirtrace=//'`
if [ ! -d $vampirtracedir ]
then
echo "Error: Cannot access VAMPIRTRACE directory $vampirtracedir"
exit 1
fi
shift
;;
-epilog=*)
epilog=yes
trace=yes
epilogdir=`echo $arg | sed -e 's/-epilog=//'`
if [ ! -d $epilogdir ]
then
echo "Error: Cannot access EPILOG directory $epilogdir"
exit 1
fi
shift
;;
-epiloglib=*)
epilog=yes
epiloglib=yes
trace=yes
epiloglibdir=`echo $arg | sed -e 's/-epiloglib=//'`
shift
;;
-epilogbin=*)
epilog=yes
epilogbin=yes
trace=yes
epilogbindir=`echo $arg | sed -e 's/-epilogbin=//'`
shift
;;
-epiloginc=*)
epilog=yes
epiloginc=yes
trace=yes
epilogincdir=`echo $arg | sed -e 's/-epiloginc=//'`
shift
;;
-pdt=*)
pdt=yes
pdtdir=`echo $arg | sed -e 's/-pdt=//'`
if [ ! -d $pdtdir ]
then
echo "Error: Cannot access PDT directory $pdtdir"
exit 1
fi
shift
;;
-vtf=*)
vtf=yes
trace=yes
vtfdir=`echo $arg | sed -e 's/-vtf=//'`
if [ ! -d $vtfdir ]
then
echo "Error: Cannot access VTF3 directory $vtfdir"
exit 1
fi
shift
;;
-otf=*)
otf=yes
trace=yes
otfdir=`echo $arg | sed -e 's/-otf=//'`
if [ ! -d $otfdir ]
then
echo "Error: Cannot access OTF directory $otfdir"
exit 1
fi
shift
;;
-dyninst=*)
dyninst=yes
dyninstdir=`echo $arg | sed -e 's/-dyninst=//'`
if [ ! -d $dyninstdir ]
then
echo "Error: Cannot access DyninstAPI directory $dyninstdir"
exit 1
fi
shift
;;
-openmp)
openmp=yes
shift
;;
-jdk=*)
java=yes
jdkdir=`echo $arg | sed -e 's/-jdk=//'`
if [ ! -d $jdkdir ]
then
echo "Error: Cannot access JDK directory $jdkdir"
exit 1
fi
jv=`$jdkdir/bin/java -version 2>&1 | grep version | awk '{ print $3; }'| sed -e s/\"//g`
if [ `echo $jv | sed -e s/1.6\.*// | wc -c` -eq 1 ] || [ `echo $jv | sed -e s/1.7\.*// | wc -c` -eq 1 ]
then
echo "Error: Specify a JDK of version 1.5 or earlier"
exit 1
fi
shift
;;
-slog2=*)
slog2=yes
trace=yes
slog2dir=`echo $arg | sed -e 's/-slog2=//'`
if [ ! -d $slog2dir ]
then
echo "Error: Cannot access SLOG2 directory $slog2dir"
exit 1
fi
shift
;;
-slog2)
slog2=yes
trace=yes
internalslog2=yes
shift
;;
-pcxxopt=*)
pcxxopt=`echo $arg | sed -e 's/-pcxxopt=//' -e 's/ /_/g'`
shift
;;
-useropt=*)
# Note you might be passed -g#-O3 which becomes -g -O3
orig_useropt=`echo $arg | sed -e 's/-useropt=//' -e 's/#/ /g'`
# Note you might be passed -g -O3 which becomes -g#-O3 here
useropt=`echo $arg | sed -e 's/-useropt=//' -e 's/ /#/g'`
shift
;;
-extrashlibopts=*)
# Note you might be passed -g#-O3 which becomes -g -O3
extrashlibopts=`echo $arg | sed -e 's/-extrashlibopts=//' -e 's/ /#/g'`
# Note you might be passed -g -O3 which becomes -g#-O3 here
shift
;;
-mpi)
mpi=yes
shift
;;
-mpiinc=*)
mpi=yes
mpiinc=`echo $arg | sed -e 's/-mpiinc=//' -e 's/ /#/g'`
if [ ! -d $mpiinc ]
then
echo "Error: Cannot access MPI include directory $mpiinc"
exit 1
fi
shift
;;
-mpilib=*)
mpi=yes
mpilib=`echo $arg | sed -e 's/-mpilib=//' -e 's/ /#/g'`
if [ ! -d $mpilib ]
then
echo "Error: Cannot access MPI lib directory $mpilib"
exit 1
fi
shift
;;
-mpilibrary=*)
# you may be passed -lmpich#-L/usr/opt/gm#-lgm#-lpthread#-ldl by installtau
mpilibrary=`echo $arg | sed -e 's/-mpilibrary=//' -e 's/#/ /g'`
shift
;;
-shmem)
shmem=yes
shift
;;
-shmeminc=*)
shmeminc=`echo $arg | sed -e 's/-shmeminc=//' -e 's/ /#/g'`
if [ ! -d $shmeminc ]
then
echo "Error: Cannot access SHMEM include directory $shmeminc"
exit 1
fi
shmem=yes
shift
;;
-shmemlib=*)
shmemlib=`echo $arg | sed -e 's/-shmemlib=//' -e 's/ /#/g'`
if [ ! -d $shmemlib ]
then
echo "Error: Cannot access SHMEM lib directory $shmemlib"
exit 1
fi
shmem=yes
shift
;;
-shmemlibrary=*)
shmemlibrary=`echo $arg | sed -e 's/-shmemlibrary=//' -e 's/ /#/g'`
shmem=yes
shift
;;
-stff=*)
stffdir=`echo $arg | sed -e 's/-stff=//' -e 's/ /#/g'`
if [ ! -d $stffdir ] ; then
echo "Error: couldn't find RENCI STFF library in $stffdir"
exit 1
fi
stff=yes
shift
;;
-sddf=*)
sddfdir=`echo $arg | sed -e 's/-sddf=//' -e 's/ /#/g'`
if [ ! -d $sddfdir ] ; then
echo "Error: couldn't find sddf library in $sddfdir"
exit 1
fi
sddf=yes
shift
;;
-pythoninc=*)
pythoninc=`echo $arg | sed -e 's/-pythoninc=//' -e 's/ /#/g'`
if [ ! -d $pythoninc ]
then
echo "Error: Cannot access Python include directory $pythoninc"
exit 1
fi
python=yes
shift
;;
-pythonlib=*)
pythonlib=`echo $arg | sed -e 's/-pythonlib=//' -e 's/ /#/g'`
if [ ! -d $pythonlib ]
then
echo "Error: Cannot access Python lib directory $pythonlib"
exit 1
fi
python=yes
shift
;;
-opt=*)
pcxxopt=`echo $arg | sed -e 's/-opt=//' -e 's/ /_/g'`
useropt="$pcxxopt"
shift
;;
-pcxx=*)
use_pcxx=yes
sage1dir=`echo $arg | sed -e 's/-pcxx=//' -e 's/ /_/g'`
shift
;;
-sage2=*)
use_sage2=yes
sage2dir=`echo $arg | sed -e 's/-sage2=//' -e 's/ /_/g'`
shift
;;
-hpcxx)
use_hpcxx=yes
shift
;;
-hpcxx=*)
use_hpcxx=yes
sage2dir=`echo $arg | sed -e 's/-hpcxx=//' -e 's/ /_/g'`
shift
;;
-pstl=*)
use_pstl=yes
pstldir=`echo $arg | sed -e 's/-pstl=//' -e 's/ /_/g'`
shift
;;
-hpnx=*)
use_hpnx=yes
hpnxdir=`echo $arg | sed -e 's/-hpnx=//' -e 's/ /_/g'`
shift
;;
-tkfile=*)
tcltkfile=`echo $arg | sed -e 's/-tkfile=//' -e 's/ /_/g'`
shift
;;
-ansic)
use_ansic=yes
shift
;;
-PROFILE)
profile=yes
shift
;;
-PROFILECOUNTERS)
profile=yes
profilecounters=yes
shift
;;
-MULTIPLECOUNTERS)
multiplecounters=yes
shift
;;
-PROFILECALLS)
profile=yes
profilecalls=yes
shift
;;
-PROFILEPHASE)
phase=yes
shift
;;
-PROFILECALLPATH)
profile=yes
callpath=yes
shift
;;
-PROFILEPARAM)
profile=yes
profileparam=yes
shift
;;
-DEPTHLIMIT)
depthlimit=yes
shift
;;
-PROFILESTATS)
profile=yes
profilestats=yes
shift
;;
-PROFILEMEMORY)
profile=yes
profilememory=yes
shift
;;
-PROFILEHEADROOM)
profile=yes
profileheadroom=yes
shift
;;
-PROFILECALLSTACK)
profile=yes
profilecallstack=yes
shift
;;
-TRACE)
trace=yes
shift
;;
-MPITRACE)
mpitrace=yes
shift
;;
-MONITOR)
monitor=yes
shift
;;
-DEBUGPROF)
debugprof=yes
shift
;;
-BGLTIMERS)
bgltimers=yes
shift
;;
-BGPTIMERS)
bgptimers=yes
shift
;;
-SGITIMERS)
sgitimers=yes
shift
;;
-CRAYTIMERS)
craytimers=yes
shift
;;
-LINUXTIMERS)
linuxtimers=yes
shift
;;
-ALPHATIMERS)
alphatimers=yes
shift
;;
-CPUTIME)
cputime=yes
shift
;;
-JAVACPUTIME)
javacputime=yes
shift
;;
-PAPIWALLCLOCK)
papiwallclock=yes
shift
;;
-PAPIVIRTUAL)
papivirtual=yes
shift
;;
-INTELCXXLIBICC)
intelcxxlibicc=yes
shift
;;
-INTELTFLOP)
inteltflop=yes
shift
;;
-noex)
# NO exceptions to be used while building the lib.
noex=yes
shift
;;
-DISABLESHARED)
# NO exceptions to be used while building the lib.
disableshared=yes
shift
;;
-setnode0)
# When this option is invoked, TAU sets the default node no to 0 instead
# of using -1. So, profile.0.0.0 is created even if TAU_PROFILE_SET_NODE(0)
# is not called in the application. Do not use with tracing
setnode0=yes
shift
;;
-arch=*)
tauarch=`echo $arg | sed -e 's/-arch=//' -e 's/ /_/g'`
shift
;;
-pdtcompdir=*)
pdtcompdir=`echo $arg | sed -e 's/-pdtcompdir=//' -e 's/ /_/g'`
shift
;;
-pdtarchdir=*)
pdtarchdir=`echo $arg | sed -e 's/-pdtarchdir=//' -e 's/ /_/g'`
shift
;;
-prefix=*)
tauprefix=`echo $arg | sed -e 's/-prefix=//' -e 's/ /_/g'`
echo "tauprefix = $tauprefix "
fixmakeargs="$fixmakeargs tauprefix=$tauprefix"
shift
;;
-exec-prefix=*)
execprefix=`echo $arg | sed -e 's/-exec-prefix=//' -e 's/ /_/g'`
fixmakeargs="$fixmakeargs execprefix=$execprefix"
shift
;;
default)
echo "Fixing Makefiles"
;;
'')
#echo "NULL switch!"
# Required for HP/Compaq Tru64 machines.
;;
*)
echo "ERROR: Command line switch \`$arg' not recognized" 1>&2
echo "Run configure with -help to see a list of options" 1>&2
exit 1
;;
esac
done
# -- some functions
configure_java () {
echo "TAU: installing TAU's ParaProf profile browser"
taushell=sh
if [ $machine = solaris2* -o $machine = alpha ]
then
taushell=ksh
fi
x=`java -version 2>&1 | grep version | awk '{ print $3; }'| sed -e s/\"//g`
oldjdk=no
if [ `echo $x | sed -e s/1.1\.*// | wc -c` -eq 1 ]
then
oldjdk=no
else
if [ `echo $x | sed -e s/1.2\.*// | wc -c` -eq 1 ]
then
echo "jdk version 1.2 found"
oldjdk=yes
else
if [ `echo $x | sed -e s/1.3\.*// | wc -c` -eq 1 ]
then
echo "jdk version 1.3 found"
oldjdk=yes
else
echo "jdk version 1.4 or better found"
oldjdk=no;
fi
fi
fi
if [ $oldjdk = yes ]
then
paraprofjar=paraprof-1.3.jar
else
paraprofjar=paraprof.jar
fi
}
configure_perfexplorer () {
echo "TAU: installed TAU's PerfDMF database utilities in ${targetdir}/${architecture}/bin"
cat ${tauroot}/tools/src/perfdmf/bin/configure.skel |
sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' \
> ${targetdir}/${architecture}/bin/perfdmf_configure
chmod a+rx ${targetdir}/${architecture}/bin/perfdmf_configure
cat ${tauroot}/tools/src/perfdmf/bin/createapp.skel |
sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' \
> ${targetdir}/${architecture}/bin/perfdmf_createapp
chmod a+rx ${targetdir}/${architecture}/bin/perfdmf_createapp
cat ${tauroot}/tools/src/perfdmf/bin/createexp.skel |
sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' \
> ${targetdir}/${architecture}/bin/perfdmf_createexp
chmod a+rx ${targetdir}/${architecture}/bin/perfdmf_createexp
cat ${tauroot}/tools/src/perfdmf/bin/loadtrial.skel |
sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' \
> ${targetdir}/${architecture}/bin/perfdmf_loadtrial
chmod a+rx ${targetdir}/${architecture}/bin/perfdmf_loadtrial
cat ${tauroot}/tools/src/perfdmf/bin/phaseconvert.skel |
sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' \
> ${targetdir}/${architecture}/bin/phaseconvert
chmod a+rx ${targetdir}/${architecture}/bin/phaseconvert
if [ ! -d ${home}/.ParaProf ]
then
mkdir -p ${home}/.ParaProf
fi
cat ${tauroot}/tools/src/perfdmf/bin/derby.properties.skel |
sed -e 's,@HOME@,'${home}',' > ${home}/.ParaProf/derby.properties
cat ${tauroot}/tools/src/perfexplorer/bin/configure.skel |
sed -e 's,@TAUROOTDIR@,'$tauroot',' \
-e 's,@SHELL@,'$taushell',' \
-e 's,@ARCH@,'$architecture',' \
-e 's,@TARGETDIR@,'$targetdir',' \
> ${tauroot}/tools/src/perfexplorer/configure
chmod a+rx ${tauroot}/tools/src/perfexplorer/configure
cat ${tauroot}/tools/src/perfexplorer/bin/perfexplorer_configure.skel |
sed -e 's,@TAUROOTDIR@,'$targetdir',' \
-e 's,@SHELL@,'$taushell',' \
-e 's,@ARCH@,'$architecture',' \
-e 's,@TARGETDIR@,'$targetdir',' \
> ${targetdir}/${architecture}/bin/perfexplorer_configure
chmod a+rx ${targetdir}/${architecture}/bin/perfexplorer_configure
if [ ! -d ${targetdir}/etc ]
then
mkdir -p ${targetdir}/etc
fi
cp ${tauroot}/tools/src/perfexplorer/bin/perfexplorer.skel ${targetdir}/etc/.
cp ${tauroot}/tools/src/perfexplorer/etc/dbschema.derby ${targetdir}/etc/.
cp ${tauroot}/tools/src/perfexplorer/etc/dbschema.mysql ${targetdir}/etc/.
cp ${tauroot}/tools/src/perfexplorer/etc/dbschema.oracle ${targetdir}/etc/.
cp ${tauroot}/tools/src/perfexplorer/etc/dbschema.postgresql ${targetdir}/etc/.
cp ${tauroot}/tools/src/perfexplorer/etc/dbschema.db2 ${targetdir}/etc/.
cp ${tauroot}/tools/src/perfexplorer/etc/java.policy ${targetdir}/etc/.
BINTARGET=${targetdir}/${architecture}/bin
JARTARGET=${targetdir}/${architecture}/lib
# install paraprof
cat ${tauroot}/tools/src/paraprof/bin/paraprof.skel |
sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' \
-e 's,@OLDJDK@,'$oldjdk',' > $BINTARGET/paraprof
chmod a+rx $BINTARGET/paraprof
# install ppscript
cat ${tauroot}/tools/src/ppscript.skel |
sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' \
-e 's,@OLDJDK@,'$oldjdk',' > $BINTARGET/ppscript
chmod a+rx $BINTARGET/ppscript
# install portal utils
cat ${tauroot}/tools/src/tau_portal/bin/perfdmfdb.py.skel | sed -e 's,@BINDIR@,'$BINTARGET',' > $BINTARGET/perfdmfdb.py
cat ${tauroot}/tools/src/tau_portal/bin/portal.py.skel | sed -e 's,@BINDIR@,'$BINTARGET',' > $BINTARGET/portal.py
cp ${tauroot}/tools/src/tau_portal/bin/tau_portal.py $BINTARGET
chmod a+rx $BINTARGET/tau_portal.py $BINTARGET/portal.py $BINTARGET/perfdmfdb.py
cat ${tauroot}/tools/src/perfexplorer/bin/perfexplorer.skel |
sed -e 's,@TAUROOT@,'$targetdir',' \
-e 's,@TAUSHELL@,'$taushell',' \
-e 's,@TAUARCH@,'$architecture',' \
-e 's,@RROOT@,'$rroot',' \
-e 's,@ANALYSIS_ENGINE@,'weka',' \
-e 's,@SERVER_HOSTNAME@,'$serverhostname',' \
-e 's,@SERVER_OBJECT_PORT@,'$objectport',' \
-e 's,@SERVER_RMIREGISTRY_PORT@,'$registryport',' \
-e 's,@CONFIGFILE@,'$configfile',' \
> $BINTARGET/perfexplorer
chmod a+rx $BINTARGET/perfexplorer
if [ ! -f $BINTARGET/jracy ] ; then
cd $BINTARGET/; ln -s paraprof jracy; cd ${tauroot};
fi
cp ${tauroot}/tools/src/paraprof/bin/$paraprofjar $JARTARGET
cp ${tauroot}/tools/src/perfdmf/bin/perfdmf.jar $JARTARGET
cp ${tauroot}/tools/src/perfexplorer/perfexplorer.jar $JARTARGET
cp ${tauroot}/src/Profile/TAU.jar $JARTARGET
cp ${tauroot}/tools/src/perfexplorer/perfexplorer-1.4.jar $JARTARGET
cp ${tauroot}/tools/src/vis/bin/vis.jar $JARTARGET
cp ${tauroot}/tools/src/common/bin/tau-common.jar $JARTARGET
cp ${tauroot}/tools/src/contrib/jargs.jar $JARTARGET
cp ${tauroot}/tools/src/contrib/batik-combined.jar $JARTARGET
cp ${tauroot}/tools/src/contrib/jfreechart-0.9.21.jar $JARTARGET
cp ${tauroot}/tools/src/contrib/jcommon-0.9.6.jar $JARTARGET
cp ${tauroot}/tools/src/contrib/jgraph.jar $JARTARGET
cp ${tauroot}/tools/src/contrib/jgraph-1.3.jar $JARTARGET
cp ${tauroot}/tools/src/contrib/jython.jar $JARTARGET
cp ${tauroot}/tools/src/contrib/jogl/jogl.jar $JARTARGET
cp ${tauroot}/tools/src/contrib/derby.jar $JARTARGET
cp ${tauroot}/tools/src/contrib/xerces.jar $JARTARGET
cp ${tauroot}/tools/src/common/resources/tau16x16.gif $JARTARGET
echo "TAU: installed ParaProf, PerfDMF, PerfExplorer and supporting jars in:"
echo "$JARTARGET"
case $machine in
apple)
gunzip -c tools/src/contrib/jogl/apple/libjogl.jnilib.gz > $JARTARGET/libjogl.jnilib
gunzip -c tools/src/contrib/jogl/apple/libjogl_awt.jnilib.gz > $JARTARGET/libjogl_awt.jnilib
gunzip -c tools/src/contrib/jogl/apple/libjogl_cg.jnilib.gz > $JARTARGET/libjogl_cg.jnilib
;;
i386_linux)
gunzip -c tools/src/contrib/jogl/i386_linux/libjogl.so.gz > $JARTARGET/libjogl.so
gunzip -c tools/src/contrib/jogl/i386_linux/libjogl_awt.so.gz > $JARTARGET/libjogl_awt.so
gunzip -c tools/src/contrib/jogl/i386_linux/libjogl_cg.so.gz > $JARTARGET/libjogl_cg.so
gunzip -c tools/src/contrib/jogl/i386_linux/libjogl_drihack.so.gz > $JARTARGET/libjogl_drihack.so
;;
x86_64)
gunzip -c tools/src/contrib/jogl/x86_64/libjogl.so.gz > $JARTARGET/libjogl.so
gunzip -c tools/src/contrib/jogl/x86_64/libjogl_awt.so.gz > $JARTARGET/libjogl_awt.so
gunzip -c tools/src/contrib/jogl/x86_64/libjogl_drihack.so.gz > $JARTARGET/libjogl_drihack.so
gunzip -c tools/src/contrib/jogl/x86_64/libjogl_cg.so.gz > $JARTARGET/libjogl_cg.so
;;
ia64)
gunzip -c tools/src/contrib/jogl/ia64/libjogl.so.gz > $JARTARGET/libjogl.so
gunzip -c tools/src/contrib/jogl/ia64/libjogl_awt.so.gz > $JARTARGET/libjogl_awt.so
gunzip -c tools/src/contrib/jogl/ia64/libjogl_drihack.so.gz > $JARTARGET/libjogl_drihack.so
;;
solaris2)
gunzip -c tools/src/contrib/jogl/solaris2/libjogl.so.gz > $JARTARGET/libjogl.so
gunzip -c tools/src/contrib/jogl/solaris2/libjogl_awt.so.gz > $JARTARGET/libjogl_awt.so
gunzip -c tools/src/contrib/jogl/solaris2/libjogl_drihack.so.gz > $JARTARGET/libjogl_drihack.so
;;
solaris2-64)
gunzip -c tools/src/contrib/jogl/solaris2-64/libjogl.so.gz > $JARTARGET/libjogl.so
gunzip -c tools/src/contrib/jogl/solaris2-64/libjogl_awt.so.gz > $JARTARGET/libjogl_awt.so
gunzip -c tools/src/contrib/jogl/solaris2-64/libjogl_drihack.so.gz > $JARTARGET/libjogl_drihack.so
;;
sun386i)
gunzip -c tools/src/contrib/jogl/sun386i/libjogl.so.gz > $JARTARGET/libjogl.so
gunzip -c tools/src/contrib/jogl/sun386i/libjogl_awt.so.gz > $JARTARGET/libjogl_awt.so
gunzip -c tools/src/contrib/jogl/sun386i/libjogl_drihack.so.gz > $JARTARGET/libjogl_drihack.so
;;
sunx86_64)
gunzip -c tools/src/contrib/jogl/sunx86_64/libjogl.so.gz > $JARTARGET/libjogl.so
gunzip -c tools/src/contrib/jogl/sunx86_64/libjogl_awt.so.gz > $JARTARGET/libjogl_awt.so
gunzip -c tools/src/contrib/jogl/sunx86_64/libjogl_drihack.so.gz > $JARTARGET/libjogl_drihack.so
;;
*)
echo "Platform does not support JOGL, no 3d displays will be available in ParaProf"
;;
esac
}
make_directories () {
if [ $tauprefix = unknown ]
then
fixmakeargs="$fixmakeargs tauprefix=$tauroot"
# make bin dir if it does not exist
if [ ! -d ./$architecture ]
then
mkdir -p ./$architecture
fi
if [ ! -d ./$architecture/bin ]
then
mkdir ./$architecture/bin
fi
# make lib dir if it does not exist
if [ ! -d ./$architecture/lib ]
then
mkdir ./$architecture/lib
fi
fi
# make XtraP directories
if [ -d XtraP ]
then
if [ ! -d XtraP/lib/$architecture ]
then
mkdir XtraP/lib/$architecture
fi
fi
}
# -- set up portable echo command
case "`echo 'x\c'`" in
'x\c') echo="echo -n" nnl= ;; #BSD
x) echo="echo" nnl="\c";; #SysV
*) echo 'Cannot setup echo. What weird machine do you have?' 1>2&
exit 1;;
esac
# lth@cs.uoregon.edu: don't mess with the compiler if it is 'default'.
# The user may define TAU_CCOM as an environment variable or let it be blank;
# if blank, it is defaulted in archfind.
if [ "$c_compiler" != "" -a "$c_compiler" != "default" ]; then
TAU_CCOM="$c_compiler" # for 'archfind'
export TAU_CCOM
fi
echo "-------------------- TAU configure script ---------------"
tauroot=`pwd | sed -e 's,^/tmp_mnt/nfs,,' -e 's,^/tmp_mnt,,'`
echo \#define TAUROOT \"$tauroot\" > include/tauroot.h
if [ $tauprefix != unknown ]
then
echo \#define TAUROOT \"$tauprefix\" > include/tauroot.h
fi
echo " The TAU source code has just been configured to use the"
echo " tau root directory $tauroot."
echo " If you move the Tau distribution, you must either"
echo " * set an environment variable TAUROOT containing the new"
echo " location before running any TAU tools"
echo " or"
echo " * run configure again and recompile"
echo "-----------------------------------------------------------------"
fixmakeargs="$fixmakeargs tauroot=$tauroot"
# Try and figure out architecture
detectarch=unknown
cd utils
detectarch=`./archfind`
detectxdev=`./archfind -x`
detectspec=`./archfind -s`
cd ..
if [ "x$detectarch" = "x" ]
then
detectarch=unknown
fi
###############################################################
# if there are no arguments, GUESS at system configuration
if [ $tauarch = unknown -o $tauarch = none ]
then
if [ $# = 1 ]
then
if [ $1 = default ]
then
machine=$1
fi
else
echo Attempting to auto-configure system, determining architecture...
machine=$detectarch
if [ $machine = unknown ]
then
echo I could not determine the architecture of this host
echo You must give me a hint.
echo Perhaps, the C compiler is not working.
echo Please check the licenses.
exit 0
fi
echo I think this is a $machine...
fi
else
machine=$tauarch
if [ $detectarch != unknown -a $machine != unknown ]
then
detectxdev=$machine
if [ $detectarch != $machine ]
then
echo WARNING\!\! Auto-detect:$detectarch overridden with $machine
fi
fi
fi
if [ ${tauprefix} = unknown ]
then
targetdir=${tauroot}
else
targetdir=${tauprefix}
fi
# use -m32 when specifying 32 bit on an Opteron/EM64T
if [ "x$detectarch" = "xx86_64" -a "x$machine" = "xi386_linux" ] ; then
fixmakeargs="$fixmakeargs FORCEIA32"
fi
if [ $machine = mips ] ; then
sicortex=yes
fi
if [ $machine = mips32 ] ; then
sicortex=yes
fi
if [ $sicortex = yes ] ; then
sicortexlink=""
sicortexmpi=""
if [ $epilog = yes ] ; then
elglibrary="-lelg"
if [ $mpi = yes -a $openmp = yes ] ; then
# hybrid
sicortexlink="-L$epiloglibdir#-Wl,-whole-archive#-lfmpi#-lelg.ompi#-Wl,-no-whole-archive#-Wl,-Bstatic#-lbfd#-liberty#-Wl,-Bdynamic#-lscmpi"
elif [ $mpi = yes ] ; then
# mpi
sicortexlink="-L$epiloglibdir#-lfmpi#-lelg.mpi#-Wl,-Bstatic#-lbfd#-liberty#-Wl,-Bdynamic#-lscmpi"
elif [ $openmp = yes ] ; then
# openmp
sicortexlink="-L$epiloglibdir#-Wl,-whole-archive#-lelg.omp#-Wl,-no-whole-archive#-Wl,-Bstatic#-lbfd#-liberty#-Wl,-Bdynamic"
else
# serial
sicortexlink="-L$epiloglibdir#-lelg#-Wl,-Bstatic#-lbfd#-liberty#-Wl,-Bdynamic"
fi
fi
if [ $vampirtrace = yes ] ; then
if [ $mpi = yes -a $openmp = yes ] ; then
# hybrid
sicortexlink="-L$vampirtracedir/$vampirtracelibdir#-Wl,-whole-archive#-lvt.fmpi#-lvt.ompi#-lotf#-Wl,-no-whole-archive#-Wl,-Bstatic#-lbfd#-liberty#-Wl,-Bdynamic#-lscmpi"
elif [ $mpi = yes ] ; then
# mpi
sicortexlink="-L$vampirtracedir/$vampirtracelibdir#-lvt.fmpi#-lvt.mpi#-lotf#-Wl,-Bstatic#-lbfd#-liberty#-Wl,-Bdynamic#-lscmpi"
elif [ $openmp = yes ] ; then
# openmp
sicortexlink="-L$vampirtracedir/$vampirtracelibdir#-Wl,-whole-archive#-lvt.omp#-lotf#-Wl,-no-whole-archive#-Wl,-Bstatic#-lbfd#-liberty#-Wl,-Bdynamic"
else
# serial
sicortexlink="-L$vampirtracedir/$vampirtracelibdir#-lvt#-lotf#-Wl,-Bstatic#-lbfd#-liberty#-Wl,-Bdynamic"
fi
fi
fixmakeargs="$fixmakeargs SICORTEX sicortexlink=${sicortexlink}"
fi
######################################################################
# If the default gcc/g++ is not used, Modify the Makefiles...
# Choose the c++ and cc compiler
case $machine in
tc2000 | ksr1 | c90 | cray | t3e | crayx1 | craysv1)
if [ $cxx_compiler = default ]
then
cxx_compiler=CC
fi
if [ $c_compiler = default ]
then
c_compiler=cc
fi
;;
nec)
if [ $cxx_compiler = default ]
then
cxx_compiler=c++
fi
if [ $c_compiler = default ]
then
c_compiler=cc
fi
;;
apple)
if [ $cxx_compiler = default ]
then
cxx_compiler=g++
fi
# To fix the make install clash with INSTALL file in file systems
# that are case insensitive. Move INSTALL file to INSTALL.txt
if [ -f INSTALL ]
then
mv INSTALL INSTALL.txt
fi
if [ $c_compiler = default ]
then
c_compiler=gcc
fi
;;
cygwin)
if [ $cxx_compiler = default ]
then
cxx_compiler=g++
fi
# To fix the make install clash with INSTALL file in file systems
# that are case insensitive. Move INSTALL file to INSTALL.txt
if [ -f INSTALL ]
then
mv INSTALL INSTALL.txt
fi
if [ $c_compiler = default ]
then
c_compiler=gcc
fi
;;
alpha)
if [ $cxx_compiler = default ]
then
# If it has the HP/Compaq cxx compiler, use it
if [ -d /lib/cmplrs/cxx ]
then
cxx_compiler=cxx
else
cxx_compiler=g++
fi
c_compiler=cc
fi
if [ $c_compiler = default ]
then
c_compiler=gcc
fi
;;
rs6000 | ibm64)
if [ $cxx_compiler = default ]
then
# If it has the IBM xlC compiler, use it
if [ -f /usr/bin/xlC -o -f /usr/vacpp/bin/xlC ]
then
cxx_compiler=xlC_r
c_compiler=xlc_r
else
cxx_compiler=g++
fi
fi
if [ $c_compiler = default ]
then
c_compiler=gcc
fi
;;
bgl)
if [ $cxx_compiler = default ]
then
cxx_compiler=blrts_xlC
c_compiler=blrts_xlc
fi
;;
bgp)
if [ $cxx_compiler = default ] ; then
cxx_compiler=mpixlcxx_r
c_compiler=mpixlc_r
elif [ $cxx_compiler = mpicxx ] ; then
cxx_compiler=mpicxx
c_compiler=mpicc
gnu=yes
fixmakeargs="$fixmakeargs GNU BGP_GFORTRAN"
fi
;;
xt3)
catamount=yes
if [ $cxx_compiler = default ] ; then
cxx_compiler=CC
c_compiler=cc
default_fortran=pgi
if [ "x$PE_ENV" = xPGI ] ; then
#tauoptions="${tauoptions}-pgi"
pgi=yes
default_fortran=pgi
elif [ "x$PE_ENV" = xGNU ] ; then
gnu=yes
tauoptions="${tauoptions}-gnu"
default_fortran=gnu
elif [ "x$PE_ENV" = xPATHSCALE ] ; then
tauoptions="${tauoptions}-pathscale"
default_fortran=pathscale
fi
if [ $fortran_compiler = no ] ; then
fortran_compiler=$default_fortran
fi
fi
;;
craycnl)
if [ $cxx_compiler = default ] ; then
cxx_compiler=CC
c_compiler=cc
default_fortran=pgi
if [ "x$PE_ENV" = xPGI ] ; then
#tauoptions="${tauoptions}-pgi"
pgi=yes
default_fortran=pgi
elif [ "x$PE_ENV" = xGNU ] ; then
gnu=yes
tauoptions="${tauoptions}-gnu"
default_fortran=gfortran
elif [ "x$PE_ENV" = xPATHSCALE ] ; then
tauoptions="${tauoptions}-pathscale"
default_fortran=pathscale
fi
if [ $fortran_compiler = no ] ; then
fortran_compiler=$default_fortran
fi
fi
;;
hitachi)
if [ $cxx_compiler = default ]
then
cxx_compiler=KCC
c_compiler=cc
fi
if [ $fortran_compiler = no ]
then
fixmakeargs="$fixmakeargs HITACHI_FORTRAN"
fortran_compiler=yes
fi
;;
sgi4k | sgi8k | sgin32 | sgi64)
if [ $cxx_compiler = default ]
then
# SGI has no 64 bit C++ compiler except "CC", so if we are an
# R8K, we have to use "CC"
if [ $machine = sgi8k -o $machine = sgin32 -o $machine = sgi64 ]
then
cxx_compiler=CC
c_compiler=cc
else
# We are an SGI R4K-based machine, use NCC if available
if [ -f /bin/NCC ]
then
cxx_compiler=NCC
c_compiler=cc
else
cxx_compiler=g++
fi
fi
fi
if [ $c_compiler = default ]
then
c_compiler=gcc
fi
;;
*)
if [ $cxx_compiler = default ]
then
cxx_compiler=g++
if [ $fortran_compiler = no ] ; then
fortran_compiler=gfortran
fi
fi
if [ $c_compiler = default ]
then
c_compiler=gcc
fi
;;
esac
if [ "$machine" = "apple" ] ; then
compiler_name=`which $cxx_compiler | awk '{print $1;}'`
if [ "$compiler_name" = "no" -o "$compiler_name" = "" ]; then
echo "NOTE: No compilers found, please use option '-c++=<compilername>' if you have a C++ compiler"
architecture=$machine
make_directories
configure_java
configure_perfexplorer
cp tools/src/common/resources/tau-medium.png apple/lib/
exit 0
fi
fi
######################################################################
# For template instantiations in the library -ptused for CC compilers
if [ $machine = sgi8k -o $machine = sgin32 -o $machine = sgi64 ]
then
if [ $cxx_compiler = CC ]
then
fixmakeargs="$fixmakeargs SGICC"
if [ $pdt = yes -a $pdt_cxx_compiler = default ]
then
fixmakeargs="$fixmakeargs PDTSGICC"
fi
fi
fi
if [ $machine = hitachi ]
then
fixmakeargs="$fixmakeargs HITACHI"
fi
if [ $machine = t3e -a $cxx_compiler = CC ]
then
fixmakeargs="$fixmakeargs CRAYCC"
fi
if [ $machine = crayx1 -o $machine = craysv1 -a $cxx_compiler = CC ]
then
fixmakeargs="$fixmakeargs CRAYX1CC"
fi
######################################################################
# Set default Profiling Options in Makefiles
if [ $profile = no -a $trace = no -a $mpitrace = no -a $machine != default ]
then
echo "-PROFILE and/or -TRACE should be specified. Choosing -PROFILE as the default"
profile=yes
fi
if [ $profile = yes ]
then
fixmakeargs="$fixmakeargs PROFILE"
fi
if [ $java = yes ]
then
tauoptions="${tauoptions}-jdk"
fi
if [ $profilecalls = yes ]
then
fixmakeargs="$fixmakeargs PROFILECALLS"
fi
if [ $profilestats = yes ]
then
fixmakeargs="$fixmakeargs PROFILESTATS"
fi
if [ $profilememory = yes ]
then
fixmakeargs="$fixmakeargs PROFILEMEMORY"
tauoptions="${tauoptions}-memory"
fi
if [ $profileheadroom = yes ]
then
fixmakeargs="$fixmakeargs PROFILEHEADROOM"
tauoptions="${tauoptions}-headroom"
fi
if [ $tag = yes ]
then
tauoptions="${tauoptions}-${tautag}"
fi
if [ $callpath = yes ]
then
fixmakeargs="$fixmakeargs PROFILECALLPATH"
tauoptions="${tauoptions}-callpath"
fi
if [ $profileparam = yes ]
then
fixmakeargs="$fixmakeargs PROFILEPARAM"
tauoptions="${tauoptions}-param"
fi
if [ $depthlimit = yes ]
then
fixmakeargs="$fixmakeargs DEPTHLIMIT"
tauoptions="${tauoptions}-depthlimit"
fi
if [ $phase = yes ]
then
fixmakeargs="$fixmakeargs PROFILECALLPATH PROFILEPHASE"
tauoptions="${tauoptions}-phase"
if [ $callpath = yes ]
then
echo "ERROR: Incompatible options specified."
echo "You must choose between -PROFILECALLPATH and -PROFILEPHASE. You cannot choose both!!"
exit 1
fi
fi
if [ $setnode0 = yes -a $trace = no ]
then
fixmakeargs="$fixmakeargs SETNODE0"
tauoptions="${tauoptions}-setnode"
fi
if [ $comm = no ]
then
fixmakeargs="$fixmakeargs NOCOMM"
tauoptions="${tauoptions}-nocomm"
fi
if [ $iowrapper = yes ] ; then
fixmakeargs="$fixmakeargs IOWRAPPER"
fi
if [ $profilecallstack = yes ]
then
fixmakeargs="$fixmakeargs CALLSTACK"
fi
if [ $stff = yes ]
then
fixmakeargs="$fixmakeargs RENCI_STFF stffdir=${stffdir} sddfdir=${sddfdir}"
tauoptions="${tauoptions}-stff"
if [ $sddf = no -o "x$sddfdir" = "x" ]; then
echo "Error: Must specify -sddf=/path/to/sddflib along with -stff=/path/to/stfflib!"
fi
fi
if [ $trace = yes ]
then
cat <<EOF > tau_type_test.c
#include <include/Profile/tau_types.h>
int main(int argc, char **argv) {
if (sizeof(x_int8) != 1 ||
sizeof(x_int16) != 2 ||
sizeof(x_int32) != 4 ||
sizeof(x_int64) != 8) {
return -1;
}
return 0;
}
EOF
if [ $catamount = no -a ! $machine = bgl -a ! $machine = bgp -a ! $machine = mips -a ! $machine = mips32 ] ; then
$echo "Checking type sizes... ${nnl}"
if $c_compiler -I. $orig_useropt tau_type_test.c -o tau_type_test 1> /dev/null 2>&1 ; then
if ./tau_type_test 1> /dev/null 2>&1 ; then
echo "ok"
else
echo ""
echo ""
echo "Warning: couldn't find correct type sizes!"
echo "Please contact tau-bugs@cs.uoregon.edu with your system details"
echo ""
fi
else
echo ""
echo ""
echo "Warning: couldn't find correct type sizes!"
echo "Please contact tau-bugs@cs.uoregon.edu with your system details"
echo ""
fi
rm -f tau_type_test.c tau_type_test
fi
fixmakeargs="$fixmakeargs TRACE"
fi
if [ $mpitrace = yes ]
then
fixmakeargs="$fixmakeargs MPITRACE"
fi
if [ $monitor = yes ]
then
fixmakeargs="$fixmakeargs MONITOR"
fi
if [ $machine = sgi8k -o $machine = sgin32 -o $machine = sgi64 ]
then
if [ $profilecounters = yes ]
then
fixmakeargs="$fixmakeargs SGICOUNTERS"
tauoptions="${tauoptions}-counters"
fi
fi
if [ $linuxtimers = yes ]
then
fixmakeargs="$fixmakeargs LINUXTIMERS"
tauoptions="${tauoptions}-linuxtimers"
fi
if [ $alphatimers = yes ]
then
fixmakeargs="$fixmakeargs ALPHATIMERS"
tauoptions="${tauoptions}-alphatimers"
fi
if [ $machine = sgi8k -o $machine = sgin32 -o $machine = sgi64 ]
then
if [ $profilecounters = no -a $sgitimers = yes ]
then
fixmakeargs="$fixmakeargs SGITIMERS"
tauoptions="${tauoptions}-sgitimers"
fi
fi
if [ $bgltimers = yes -a $machine = bgp ]
then
echo "WARNING: You configured -BGLTIMERS on BGP. Changing it to -BGPTIMERS."
bgptimers=yes
bgltimers=no
fi
if [ $bgptimers = yes -a $machine = bgl ]
then
echo "WARNING: You configured -BGPTIMERS on BGL. Changing it to -BGLTIMERS."
bgptimers=no
bgltimers=yes
fi
if [ $bgltimers = yes ]
then
fixmakeargs="$fixmakeargs BGLTIMERS"
tauoptions="${tauoptions}-bgltimers"
fi
if [ $bgptimers = yes ]
then
fixmakeargs="$fixmakeargs BGPTIMERS"
tauoptions="${tauoptions}-bgptimers"
fi
if [ $craytimers = yes ]
then
fixmakeargs="$fixmakeargs CRAYTIMERS"
tauoptions="${tauoptions}-craytimers"
fi
if [ $cputime = yes ]
then
fixmakeargs="$fixmakeargs CPUTIME"
fi
if [ $javacputime = yes ]
then
fixmakeargs="$fixmakeargs JAVACPUTIME"
fi
if [ $papiwallclock = yes ]
then
fixmakeargs="$fixmakeargs PAPIWALLCLOCK"
tauoptions="${tauoptions}-papiwallclock"
fi
if [ $multiplecounters = yes ]
then
fixmakeargs="$fixmakeargs MULTIPLECOUNTERS"
tauoptions="${tauoptions}-multiplecounters"
if [ $profilecalls = yes -o $profilestats = yes -o $profilecounters = yes ]
then
echo "******** ERROR : -MULTIPLECOUNTERS option is incompatible with "
echo "**************** -PROFILECOUNTERS, -PROFILECALLS, or -PROFILESTATS"
echo "**************** Please reconfigure TAU without these."
echo "******** EXITING .... "
exit 1
fi
fi
if [ $papivirtual = yes ]
then
fixmakeargs="$fixmakeargs PAPIVIRTUAL"
tauoptions="${tauoptions}-papivirtual"
fi
if [ $machine = sgi8k -o $machine = sgin32 -o $machine = sgi64 ]
then
if [ $cxx_compiler = g++ ]
then
fixmakeargs="$fixmakeargs SGIGNU"
fi
fi
if [ $machine = freebsd ]
then
fixmakeargs="$fixmakeargs FREEBSD"
fi
if [ $machine = apple ]
then
if [ $cxx_compiler = g++ -o $cxx_compiler = c++ -o $cxx_compiler = icpc ]
then
fixmakeargs="$fixmakeargs APPLECXX"
fi
if [ $fortran_compiler = ibm -o $fortran_compiler = ibm64 ]
then
fixmakeargs="$fixmakeargs IBMXLFAPPLE"
extradir=`which xlf90 | sed s/xlf90/../`
fortran_compiler=yes
fi
# xlc++ doesn't like include/Memory. Move this directory
if [ -d include/Memory -a ! -d include/MemoryWrapper ]
then
mv include/Memory include/MemoryWrapper
else
if [ -d include/Memory -a -d include/MemoryWrapper ]
then
/bin/rm -rf include/Memory
fi
fi
fi
if [ $machine = ppc64 -o $machine = bgl -o $machine = bgp ]
then
if [ $cxx_compiler = g++ ]
then
if [ $fortran_compiler = no ]
then
extradir=`which xlf90 | sed s/xlf90/../`
fixmakeargs="$fixmakeargs IBM_FORTRAN"
fi
fi
fi
if [ $machine = ibm64 -o $machine = ibm64linux ]
then
if [ $cxx_compiler = g++ -o $cxx_compiler = powerpc64-linux-g++ ]
then
if [ $fortran_compiler = no ]
then
extradir=`which xlf90 | sed s/xlf90/../`
fixmakeargs="$fixmakeargs IBM64_FORTRAN"
fi
fi
fi
if [ $machine = t3e -a $cxx_compiler = KCC ]
then
fixmakeargs="$fixmakeargs CRAYKAI"
if [ $fortran_compiler = no ]
then
fixmakeargs="$fixmakeargs CRAY_FORTRAN"
fortran_compiler=yes
fi
fi
if [ $machine = crayx1 -o $machine = craysv1 ]
then
if [ $fortran_compiler = no ]
then
fixmakeargs="$fixmakeargs CRAY_X1_FORTRAN"
fortran_compiler=yes
fi
fi
if [ $debugprof = yes ]
then
fixmakeargs="$fixmakeargs DEBUGPROF"
fi
if [ $inteltflop = yes ]
then
fixmakeargs="$fixmakeargs INTELTFLOP"
fi
######################################################################
# Set default C++ compiler in all Makefiles
case $cxx_compiler in
CC)
echo "Default C++ compiler will be CC"
fixmakeargs="$fixmakeargs USE_CFRONT"
;;
*g++)
echo "Default C++ compiler will be " \
`gcc -v 2>&1 | tail -1 | sed 's/gcc/g++/g'`
gnu=yes
# No fixmakeargs needed because it is the default
;;
egcs)
echo "Default C++ compiler will be " \
`egcs -v 2>&1 | tail -1 | sed 's/gcc/egcs/g'`
# No fixmakeargs needed because it is the default
;;
cxx)
echo "Default C++ compiler will be the HP Tru64 cxx C++ compiler"
fixmakeargs="$fixmakeargs USE_DECCXX"
if [ $fortran_compiler = no ]
then
f90loaded=`which f90 | sed -e 's/f90/../g' | grep "^no"`
if [ "x$f90loaded" = "x" ]
then
# f90 module has been loaded and which f90 returns a path
extradir="`which f90 | sed s/f90/../`"
echo "Found f90 in `which f90`"
fi
fixmakeargs="$fixmakeargs COMPAQ_FORTRAN"
fortran_compiler=yes
fi
;;
*xl*)
echo "Default C++ compiler will be IBMs xlC C++ compiler"
fixmakeargs="$fixmakeargs USE_IBMXLC COMPINST_XL"
if [ "$machine" = "apple" ]
then
fixmakeargs="$fixmakeargs IBMXLCAPPLE"
if [ $fortran_compiler = no ]
then
fixmakeargs="$fixmakeargs IBMXLFAPPLE"
fi
fi
ibmxlc=yes
if [ "$machine" = "bgp" ] ; then
ibm_compiler=bgxlC_r
else
ibm_compiler=$cxx_compiler
fi
compilerLocation=`which $ibm_compiler`
if [ "x$compilerLocation" = "x/usr/bin/$ibm_compiler" ] ; then
# if xlc or blrts_xlc is found in /usr/bin, it is likely a
# symlink. Since we use ../lib to locate the libraries
# we will dereference the symlink once. Don't do it more
# than once, or you'll end up with the wrong thing
# check for readlink first
readlink=`which readlink`
if [ "x$readlink" != "x" ] ; then
if [ -x "$readlink" ] ; then
if [ -h $compilerLocation ] ; then
compilerLocation=`readlink $compilerLocation`
fi
fi
fi
fi
extradircxx=`echo $compilerLocation | sed s/$ibm_compiler/../`
extradir=`which xlf90 | sed s/xlf90/../`
if [ $fortran_compiler = no ]
then
if [ "$machine" = "ibm64" -o "$machine" = "ibm64linux" ]
then
fixmakeargs="$fixmakeargs IBM64_FORTRAN"
else
fixmakeargs="$fixmakeargs IBM_FORTRAN"
fi
fortran_compiler=yes
fi
threadtest=`echo $ibm_compiler | sed -e 's/_r//'`
if [ "y$threadtest" = "y$ibm_compiler" ]
then
echo "Not using the thread-safe version of the IBM compiler"
else
ibmxlc_r=yes
fixmakeargs="$fixmakeargs THREADSAFE_COMPILERS"
echo "Using thread-safe version of the IBM compiler"
threadsafe=yes
fi
;;
NCC)
echo "Default C++ compiler will be SGI's Delta C++ compiler"
fixmakeargs="$fixmakeargs USE_SGINCC"
;;
KCC)
echo "Default C++ compiler will be KAI KCC C++ Compiler"
kai=yes
fixmakeargs="$fixmakeargs KAI"
;;
pgCC)
echo "Default C++ compiler will be PGI pgCC C++ Compiler"
pgi=yes
pgiflag=`pgCC -help | head -1 | grep 1.7 | wc -l`
fixmakeargs="$fixmakeargs COMPINST_PGI"
if [ $pgiflag = 1 ]
then
echo "Using PGI ver 1.7 Compiler"
fixmakeargs="$fixmakeargs PGI PGI1.7"
else
fixmakeargs="$fixmakeargs PGI PGICC"
fi
if [ $fortran_compiler = no ]
then
extradir=`which pgCC | sed s/pgCC/../`
fixmakeargs="$fixmakeargs PGI_FORTRAN"
fortran_compiler=yes
fi
;;
FCC)
echo "Default C++ compiler will be Fujitsu C++ Compiler"
fujitsu=yes
fixmakeargs="$fixmakeargs FUJITSU"
if [ $fortran_compiler = no ]
then
extradir=`which FCC | sed s/FCC/../`
fixmakeargs="$fixmakeargs FUJITSU_FORTRAN"
fortran_compiler=yes
fi
if [ $machine = solaris2 -o $machine = solaris2-64 ]
then
extradir=`which FCC | sed s/FCC/../`
fixmakeargs="$fixmakeargs FUJITSU_SOLARIS"
fortran_compiler=yes
fi
;;
guidec++)
echo "Default C++ compiler will be KAI KAP/Pro OpenMP guidec++ Compiler"
kai=yes
fixmakeargs="$fixmakeargs KAI GUIDE OPENMP"
openmp=yes
tauoptions="${tauoptions}-guide"
if [ $fortran_compiler = no ]
then
fixmakeargs="$fixmakeargs KAI_FORTRAN"
guidef90=yes
fortran_compiler=yes
fi
;;
aCC)
echo "Default C++ compiler will be HP aCC Compiler"
fixmakeargs="$fixmakeargs ACC"
tauoptions="${tauoptions}-acc"
if [ $fortran_compiler = no ]
then
fixmakeargs="$fixmakeargs HP_FORTRAN"
fortran_compiler=yes
fi
;;
orCC)
echo "Default C++ compiler will ORC Open64 orCC compiler"
fixmakeargs="$fixmakeargs OPEN64ORC"
tauoptions="${tauoptions}-orcc"
if [ $c_compiler = default ]
then
c_compiler=orcc
fi
if [ $fortran_compiler = no ]
then
fixmakeargs="$fixmakeargs OPEN64ORC_FORTRAN"
fortran_compiler=yes
fi
if [ $openmp = yes ]
then
fixmakeargs="$fixmakeargs OPEN64_OPENMP"
fi
;;
c++)
if [ $machine = nec ]
then
echo "Default C++ compiler will be NEC c++ compiler"
fixmakeargs="$fixmakeargs USE_NECCXX"
tauoptions="${tauoptions}-cxx"
if [ $fortran_compiler = no ]
then
extradir=`which f90 | sed s/f90/../`
fixmakeargs="$fixmakeargs NEC_FORTRAN"
fortran_compiler=yes
fi
else
echo "Default C++ compiler will be Apple c++ compiler"
fixmakeargs="$fixmakeargs APPLECXX"
tauoptions="${tauoptions}-cxx"
fi
;;
ecpc)
echo "Default C++ compiler will be Intel ecpc C++ compiler"
fixmakeargs="$fixmakeargs USE_INTELCXX"
tauoptions="${tauoptions}-ecpc"
intel=yes
if [ $fortran_compiler = no ]
then
fixmakeargs="$fixmakeargs INTEL_FORTRAN"
fortran_compiler=intel
extradir=`which efc | sed s/efc/../`
fi
if [ $intelcxxlibicc = yes ]
then
fixmakeargs="$fixmakeargs INTELCXXLIBICC"
fi
;;
icpc)
echo "Default C++ compiler will be Intel icpc C++ compiler"
fixmakeargs="$fixmakeargs USE_INTELCXX COMPINST_INTEL9"
tauoptions="${tauoptions}-icpc"
intel=yes
if [ $fortran_compiler = no ]
then
fixmakeargs="$fixmakeargs INTEL32_FORTRAN"
fortran_compiler=intel
intelifort=`which ifort 2>/dev/null`
if [ "y$intelifort" != "y" -a -x "$intelifort" ]
then
extradir=`which ifort | sed -e 's/\/bin\/ifort$//'`
fi
fi
if [ $intelcxxlibicc = yes ]
then
fixmakeargs="$fixmakeargs INTELCXXLIBICC"
fi
;;
pathCC|scpathCC)
echo "Default C++ compiler will be PathScale pathCC C++ compiler"
fixmakeargs="$fixmakeargs USE_PATHCC COMPINST_GNU"
tauoptions="${tauoptions}-pathcc"
pathscale=yes
if [ $fortran_compiler = no ]
then
fixmakeargs="$fixmakeargs PATHSCALE_FORTRAN"
fortran_compiler=pathscale
fi
;;
qk-pgCC)
echo "Default C++ compiler will be PGI pgCC C++ Compiler"
pgi=yes
fixmakeargs="$fixmakeargs PGI PGICC COMPINST_PGI"
fixmakeargs="$fixmakeargs PGINOPRELINK"
if [ $fortran_compiler = no ]
then
extradir=`which pgCC | sed s/pgCC/../`
fixmakeargs="$fixmakeargs PGI_FORTRAN PGI_CATAMOUNT"
fortran_compiler=yes
fi
;;
mpicxx)
if [ $machine = bgp ] ; then
echo "Using GNU Compilers for BGP"
tauoptions="${tauoptions}-gnu"
else
echo "ERROR Unknown C++ compiler: $cxx_compiler"
exit 1
fi
;;
*)
echo "ERROR Unknown C++ compiler: $cxx_compiler"
exit 1
;;
esac
######################################################################
# Set default F90 compiler in all Makefiles
case $fortran_compiler in
gnu)
echo "Default Fortran compiler will be GNU g77"
fixmakeargs="$fixmakeargs GNU_FORTRAN"
;;
gfortran)
echo "Default Fortran compiler will be GNU gfortran"
if [ $cxx_compiler = scg++ ]
then
fixmakeargs="$fixmakeargs SC_GFORTRAN"
else
taugfortranlibdir=`gfortran -print-libgcc-file-name | sed s/libgcc.a//`
fixmakeargs="$fixmakeargs taugfortranlibdir=$taugfortranlibdir"
fixmakeargs="$fixmakeargs GNU_GFORTRAN"
fi
;;
g95)
echo "Default Fortran compiler will be G95"
fixmakeargs="$fixmakeargs G95_FORTRAN"
extradir=`g95 -print-libgcc-file-name | sed s/libgcc.a//`
echo extra=$extradir
;;
sgi)
echo "Default Fortran compiler will be SGI f90"
fixmakeargs="$fixmakeargs SGI_FORTRAN"
;;
ibm)
echo "Default Fortran compiler will be IBM xlf90"
extradir=`which xlf90 | sed s/xlf90/../`
fixmakeargs="$fixmakeargs IBM_FORTRAN"
;;
ibm64)
echo "Default Fortran compiler will be IBM xlf90 (64 bits)"
extradir=`which xlf90 | sed s/xlf90/../`
fixmakeargs="$fixmakeargs IBM64_FORTRAN"
;;
hp)
echo "Default Fortran compiler will be HP f90"
extradir=`which f90 | sed s/f90/../`
fixmakeargs="$fixmakeargs HP_FORTRAN"
;;
cray)
echo "Default Fortran compiler will be Cray f90"
if [ $machine = crayx1 -o $machine = craysv1 ]
then
fixmakeargs="$fixmakeargs CRAY_X1_FORTRAN"
else
fixmakeargs="$fixmakeargs CRAY_FORTRAN"
fi
;;
pgi)
echo "Default Fortran compiler will be PGI"
extradir=`which pgCC | sed s/pgCC/../`
fixmakeargs="$fixmakeargs PGI_FORTRAN"
;;
absoft)
echo "Default Fortran compiler will be Absoft f90"
extradir="`which f90 | sed s/f90/../`"
fixmakeargs="$fixmakeargs ABSOFT_FORTRAN"
;;
fujitsu)
echo "Default Fortran compiler will be Fujitsu F90"
extradir=`which FCC | sed s/FCC/../`
fixmakeargs="$fixmakeargs FUJITSU_FORTRAN"
;;
nec)
echo "Default Fortran compiler will be NEC f90"
extradir=`which f90 | sed s/f90/../`
fixmakeargs="$fixmakeargs NEC_FORTRAN"
;;
lahey)
echo "Default Fortran compiler will be Lahey lf95"
extradir=`which lf95 | sed s/lf95/../`
if [ -d $extradir/lib64 ]
then
fixmakeargs="$fixmakeargs LAHEY64_FORTRAN"
else
fixmakeargs="$fixmakeargs LAHEY_FORTRAN"
fi
;;
nagware)
echo "Default Fortran compiler will be Nagware f95"
extradir=`which f95 | sed s@\/f95@\/..@`
fixmakeargs="$fixmakeargs NAGWARE_FORTRAN"
;;
pathscale)
echo "Default Fortran compiler will be Pathscale pathf95"
if [ $cxx_compiler = scpathCC -o $cxx_compiler = scg++ ]
then
extradir=`which scpathf95 | sed s@\/scpathf95@\/..@`
fixmakeargs="$fixmakeargs SC_PATHSCALE"
else
extradir=`which pathf95 | sed s@\/pathf95@\/..@`
fixmakeargs="$fixmakeargs PATHSCALE_FORTRAN"
fi
;;
sun)
echo "Default Fortran compiler will be SUN f90"
fixmakeargs="$fixmakeargs SUN_FORTRAN"
;;
compaq)
echo "Default Fortran compiler will be HP Tru64 f90"
f90loaded=`which f90 | sed -e 's/f90/../g' | grep "^no"`
if [ "x$f90loaded" = "x" ]
then
# f90 module has been loaded and which f90 returns a path
extradir="`which f90 | sed s/f90/../`"
echo "Found f90 in `which f90`"
fi
fixmakeargs="$fixmakeargs COMPAQ_FORTRAN"
;;
kai)
echo "Default Fortran compiler will be KAI guidef90"
fixmakeargs="$fixmakeargs KAI_FORTRAN"
guidef90=yes
;;
open64)
echo "Default Fortran compiler will be ORC Open64 orf90"
fixmakeargs="$fixmakeargs OPEN64ORC_FORTRAN"
;;
intel)
if [ $cxx_compiler = ecpc ]
then
echo "Default Fortran compiler will be Intel efc"
fixmakeargs="$fixmakeargs INTEL_FORTRAN"
else
echo "Default Fortran compiler will be Intel ifort"
fixmakeargs="$fixmakeargs INTEL32_FORTRAN"
intelifort=`which ifort 2>/dev/null`
if [ "y$intelifort" != "y" -a -x "$intelifort" ]
then
extradir=`which ifort | sed -e 's/\/bin\/ifort$//'`
fi
fi
;;
no)
;;
*)
;;
esac
# Encode the full path of the C++/C compiler in the stub Makefile
full_cxx_compiler=`which $cxx_compiler`
full_cc_compiler=`which $c_compiler`
fixmakeargs="$fixmakeargs fullcxx=$full_cxx_compiler fullcc=$full_cc_compiler"
######################################################################
# Set MPI options. First set the include dir if it is not specified
if [ $mpi = yes -a $machine = ibm64 ]
then
ibmxlc_r=yes
echo "Enabling threaded MPI libraries for IBM64"
if [ $threadsafe = no ]
then
fixmakeargs="$fixmakeargs THREADSAFE_COMPILERS"
threadsafe=yes
fi
fi
if [ $mpi = yes -a "x$mpiinc" = "x" ]
then
case $machine in
rs6000|ibm64)
mpiinc=/usr/lpp/ppe.poe/include
mpiincf90dir='-I/usr/lpp/ppe.poe/include/thread'
if [ $machine = ibm64 ]
then
mpiincf90dir='-I/usr/lpp/ppe.poe/include/thread64'
fi
if [ $ibmxlc_r = yes ]
then
additional_mpiincs='-I/usr/lpp/ssp/css/include'
fi
additional_mpiincs="$additional_mpiincs $mpiincf90dir"
;;
bgl)
mpiinc=/bgl/BlueLight/ppcfloor/bglsys/include
;;
bgp)
mpiinc=/bgsys/drivers/ppcfloor/comm/include
;;
t3e|crayx1|craysv1)
mpiinc=/opt/ctl/mpt/mpt/include
;;
xt3)
mpiinc=/opt/xt-mpt/default/mpich2-64/P2/include
;;
craycnl)
mpiinc=/opt/xt-mpt/default/mpich2-64/P/include
;;
solaris2*)
mpiinc=/opt/SUNWhpc/include
;;
*)
mpiinc=`which mpirun | sed -e 's/\/bin\/mpirun$//'`/include
if [ -d $mpiinc ]
then
echo "Using MPI include directory $mpiinc"
fi
;;
esac
fi
# Add threaded include dir to the MPI include dir for IBM
if [ "x$mpiinc" != "x" ]
then
case $machine in
rs6000)
if [ -d /usr/lpp/ppe.poe/include/thread ]
then
mpiincf90dir='-I/usr/lpp/ppe.poe/include/thread'
fi
if [ $ibmxlc_r = yes ]
then
additional_mpiincs='-I/usr/lpp/ssp/css/include'
fi
additional_mpiincs="$additional_mpiincs $mpiincf90dir"
;;
ibm64)
if [ -d /usr/lpp/ppe.poe/include/thread64 ]
then
mpiincf90dir='-I/usr/lpp/ppe.poe/include/thread64'
fi
if [ $ibmxlc_r = yes ]
then
additional_mpiincs='-I/usr/lpp/ssp/css/include'
fi
additional_mpiincs="$additional_mpiincs $mpiincf90dir"
;;
*)
;;
esac
fi
if [ $mpi = yes -a "x$mpilib" = "x" ]
then
case $machine in
rs6000|ibm64)
mpilib=/usr/lpp/ppe.poe/lib
if [ $ibmxlc_r = yes ]
then
additional_mpilibs='-L/usr/lpp/ppe.poe/lib/threads -L/usr/lpp/ssp/css/lib -llapi_r'
fi
;;
bgl)
mpilib=/bgl/BlueLight/ppcfloor/bglsys/lib
additional_mpilibs='-lmsglayer.rts -ldevices.rts -lrts.rts -ldevices.rts'
;;
bgp)
mpilib=/bgsys/drivers/ppcfloor/comm/lib
additional_mpilibs='-ldcmfcoll.cnk -ldcmf.cnk -lpthread -L/bgsys/drivers/ppcfloor/runtime/SPI -lSPI.cna'
;;
t3e|crayx1|craysv1)
mpilib=/opt/ctl/mpt/mpt/lib/
;;
xt3)
mpilib=/opt/xt-mpt/default/mpich2-64/P2/lib
;;
craycnl)
mpilib=/opt/xt-mpt/default/mpich2-64/P/lib
;;
solaris2*)
mpilib=/opt/SUNWhpc/lib
;;
*)
mpilib=`which mpirun | sed -e 's/\/bin\/mpirun$//'`/lib
if [ -d $mpilib ]
then
echo "Using MPI lib directory $mpilib"
fi
;;
esac
fi
# Next, check the properties of the MPI implementation.
if [ "x$mpiinc" != "x" -o "x$mpilib" != "x" -o $mpi = yes ]
then
#echo "MPI is specified"
mpi=yes
fixmakeargs="$fixmakeargs MPI"
tauoptions="${tauoptions}-mpi"
mpicompiler=$cxx_compiler
msuf=C
if [ $machine = t3e ]
then
mpicompiler=$c_compiler
msuf=c
fi
cat <<EOF > mpi_thread_test.$msuf
#include <mpi.h>
int main(int argc, char **argv)
{
int ret, req, provided;
ret = PMPI_Init_thread(&argc, &argv, req, &provided);
return ret;
}
EOF
if [ "x$mpiinc" != "x" ]
then
# echo "mpiinc is specified"
mpi_include=-I$mpiinc
fi
cat <<EOF > mpi2.$msuf
#include <mpi.h>
int foo(MPI_Win win)
{
int ret;
ret = MPI_Win_fence(MPI_MODE_NOPRECEDE, win);
return ret;
}
EOF
cat <<EOF > mpi2iorequest.$msuf
#include <mpi.h>
int foo (MPI_File fh, void *buf, int count,
MPI_Datatype datatype, MPIO_Request *request)
{
return MPI_File_iread_shared (fh, buf, count, datatype, request);
}
EOF
cat <<EOF > mpi2attr.$msuf
#include <mpi.h>
int foo(MPI_Win_copy_attr_function *f1, MPI_Type_copy_attr_function *f2,
MPI_Comm_copy_attr_function *f3)
{
return 0;
}
int MPI_Type_get_attr(MPI_Datatype type, int type_keyval, void *attribute, int *flag)
{
return PMPI_Type_get_attr(type, type_keyval, attribute, flag);
}
EOF
cat <<EOF > mpi2typeex.$msuf
#include <mpi.h>
int f1( void * sendbuf, void * recvbuf, int count, MPI_Datatype datatype
, MPI_Op op, MPI_Comm comm)
{
return MPI_Exscan( sendbuf, recvbuf, count, datatype, op, comm) ;
}
int f2( MPI_Datatype type, MPI_Datatype * newtype)
{
return MPI_Type_dup( type, newtype) ;
}
int f3( int p, int r, MPI_Datatype * newtype)
{
return MPI_Type_create_f90_real( p, r, newtype) ;
}
int f4( int p, int r, MPI_Datatype * newtype)
{
return MPI_Type_create_f90_complex( p, r, newtype) ;
}
EOF
cat <<EOF > mpi2add.$msuf
#include <mpi.h>
int f1( int * errorclass)
{
return MPI_Add_error_class( errorclass) ;
}
int f2( char * datarep, int incount, MPI_Datatype datatype, MPI_Aint * size)
{
return MPI_Pack_external_size( datarep, incount, datatype, size) ;
}
EOF
cat <<EOF > mpi2grequest.$msuf
#include <mpi.h>
int foo(MPI_Grequest_query_function *grequest_query_fn,
MPI_Grequest_free_function *grequest_free_fn,
MPI_Grequest_cancel_function *grequest_cancel_fn,
void *extra_state, MPI_Request *request)
{
return MPI_Grequest_start(grequest_query_fn,
grequest_free_fn,
grequest_cancel_fn,
extra_state, request);
}
int bar(MPI_Request request)
{
return MPI_Grequest_complete(request);
}
EOF
cat <<EOF > mpi2datarep.$msuf
#include <mpi.h>
int foo( char * datarep, MPI_Datarep_conversion_function * read_conversion_fn, MPI_Datarep_conversion_function * write_conversion_fn, MPI_Datarep_extent_function * dtype_file_extent_fn, void * extra_state)
{
return MPI_Register_datarep( datarep, read_conversion_fn, write_conversion_fn, dtype_file_extent_fn, extra_state);
}
EOF
cat <<EOF > mpi2errhandler.$msuf
#include <mpi.h>
int foo (MPI_Comm_errhandler_fn *a, MPI_Errhandler *b)
{
return MPI_Comm_create_errhandler(a,b);
}
int bar (MPI_File_errhandler_fn * function, MPI_Errhandler * errhandler)
{
return MPI_File_create_errhandler(function, errhandler);
}
EOF
cat <<EOF > mpi2hpconst.$msuf
#include <mpi.h>
/* HP MPI uses const char * instead of char * in the
prototypes of the following routines */
int foo(MPI_Info Info, const char *key, const char *value)
{
return PMPI_Info_set(Info, key, value);
}
int f1(MPI_Info a, const char * b, int c, char * d, int *e)
{
return PMPI_Info_get(a,b,c,d,e);
}
int f2(MPI_Info a, const char *b)
{
return PMPI_Info_delete(a,b);
}
int MPI_Info_get_valuelen(MPI_Info a, const char * b, int * c, int * d)
{ /* above decl triggers an error on T3E */
return PMPI_Info_get_valuelen(a,b,c,d);
}
EOF
cat << EOF > mpistatus.$msuf
#include <mpi.h>
#include <memory.h>
int foo(MPI_Fint *status)
{
MPI_Status s;
return MPI_Status_f2c(status, &s);
}
EOF
if [ $machine = sgi64 -a $cxx_compiler = CC ]
then
orig_useropt="$orig_useropt -64"
fi
if $mpicompiler $orig_useropt $mpi_include -c mpi_thread_test.$msuf 1> /dev/null 2>&1
then
echo "Thread-safe MPI interface is defined... "
fixmakeargs="$fixmakeargs MPI_THREADED"
fi
if [ -d "$mpiinc/ulm" ] ; then
echo "LA-MPI detected, working around broken MPI_Request_c2f()"
fixmakeargs="$fixmakeargs LAMPI"
fi
if $mpicompiler $orig_useropt $mpi_include -c mpi2.$msuf 1> /dev/null 2>&1
then
echo "MPI-2 Interface is defined..."
# Wait don't enable this for SGI Altix. Their MPI2 is not complete
if [ -r $mpilib/libmpi.so -a -r $mpilib/libmpi++.so -a -r $mpilib/libsma.so -a -r $mpilib/libxmpi.so ]
then
echo "SGI MPI detected. Disabling MPI2 wrappers for SGI MPI"
elif [ -r $mpilib/libfmpi.so -a -r $mpilib/libmpio.so -a -r $mpilib/libtvscampi.so ]
then
# Wait. Scali does not use MPI2 PMPI interface properly.
echo "Scali MPI detected. Disabling MPI2 wrappers for Scali MPI"
elif [ -r $mpilib/liblam.a -o -r $mpilib/liblam.la ]
then
# Wait. LAM MPI's MPI2 PMPI interface is broken.
echo "LAM MPI detected. Disabling MPI2 wrappers for LAM MPI"
elif [ "$mpilibrary" = "-lscmpi" ]
then
# Wait. SiCortex's MPI2 interface is broken.
echo "SiCortex detected. Disabling MPI2 wrappers"
fixmakeargs="$fixmakeargs MPICH_IGNORE_CXX_SEEK"
elif [ "$tauarch" = "bgp" ] ; then
echo "BGP MPI detected. Disabling MPI2 wrappers"
fixmakeargs="$fixmakeargs MPICH_IGNORE_CXX_SEEK"
else
fixmakeargs="$fixmakeargs MPI2"
mpi2=yes
fi
fi
if $mpicompiler $orig_useropt $mpi_include -c mpi2grequest.$msuf 1> /dev/null 2>&1
then
if [ $mpi2 = yes ]
then
echo "MPI-2 Grequest Interface is defined..."
fixmakeargs="$fixmakeargs MPIGREQUEST"
fi
fi
if [ -f $mpilib/liblam.a -o -f $mpilib/liblammpi++.a ] ; then
if $mpicompiler $orig_useropt $mpi_include -c mpi2iorequest.$msuf 1> /dev/null 2>&1
then
if [ $mpi2 = yes ]
then
echo "MPI-2 MPIO_Request Interface is defined..."
fixmakeargs="$fixmakeargs MPIOREQUEST"
mpiio=yes
fi
fi
fi
if $mpicompiler $orig_useropt $mpi_include -c mpi2datarep.$msuf 1> /dev/null 2>&1
then
if [ $mpi2 = yes ]
then
echo "MPI-2 MPI_Datarep_conversion_function Interface is defined..."
fixmakeargs="$fixmakeargs MPIDATAREP"
fi
fi
if $mpicompiler $orig_useropt $mpi_include -c mpi2errhandler.$msuf 1> /dev/null 2>&1
then
if [ $mpi2 = yes ]
then
echo "MPI-2 Comm_create_errhandler Interface is defined..."
fixmakeargs="$fixmakeargs MPIERRHANDLER"
fi
fi
if $mpicompiler $orig_useropt $mpi_include -c mpi2hpconst.$msuf 1> /dev/null 2>&1
then
if [ $mpi2 = yes ]
then
echo "MPI-2 MPI_Info_set takes const char * instead of char * args"
fixmakeargs="$fixmakeargs MPICONSTCHAR"
fi
fi
if $mpicompiler $orig_useropt $mpi_include -c mpi2attr.$msuf 1> /dev/null 2>&1
then
echo "MPI-2 MPI*attr_functions are defined..."
fixmakeargs="$fixmakeargs MPIATTR"
fi
if $mpicompiler $orig_useropt $mpi_include -c mpi2typeex.$msuf 1> /dev/null 2>&1
then
echo "MPI-2 MPI_Type_dup and MPI_Exscan are defined..."
fixmakeargs="$fixmakeargs MPITYPEEX"
fi
if $mpicompiler $orig_useropt $mpi_include -c mpi2add.$msuf 1> /dev/null 2>&1
then
echo "MPI-2 MPI_Add_error* functions are defined..."
fixmakeargs="$fixmakeargs MPIADDERROR"
fi
if $mpicompiler $orig_useropt $mpi_include -c mpistatus.$msuf 1> /dev/null 2>&1
then
echo "MPI_Status f2c/c2f found..."
else
echo "MPI_Status c2f/f2c functions are needed"
fixmakeargs="$fixmakeargs MPINEEDSTATUSCONV"
fi
/bin/rm -rf mpi_thread_test.$msuf mpi_thread_test.o mpi2.$msuf mpi2.o mpi2iorequest.o mpi2iorequest.$msuf mpi2grequest.o mpi2grequest.$msuf mpi2datarep.$msuf mpi2datarep.o mpi2errhandler.o mpi2errhandler.$msuf mpi2hpconst.o mpi2hpconst.$msuf mpi2attr.o mpi2attr.$msuf mpi2typeex.o mpi2typeex.$msuf mpi2add.o mpi2add.$msuf mpistatus.o mpistatus.$msuf
else
fixmakeargs="$fixmakeargs mpiincargs=$mpiincargs mpilibargs=$mpilibargs mpiflibargs=$mpiflibargs mpilib=$mpilib"
fi
if [ "x$mpiinc" != "x" ]
then
# Check for OpenMPI and add additional include directory
if [ -d $mpiinc/openmpi ]
then
echo "NOTE: Using OpenMPI"
additional_mpiincs="-I$mpiinc/openmpi/ompi -I$mpiinc/openmpi"
fi
if [ -d $mpiinc ]
then
#echo "Include dir found. adding -I$mpiinc to INC"
mpiincargs="$mpiincargs -I$mpiinc $additional_mpiincs"
mpiincargs=`echo $mpiincargs | sed -e 's/ /#/g'`
fixmakeargs="$fixmakeargs mpiincargs=$mpiincargs"
fi
fi
if [ $tauprefix != unknown ]
then
tautoplevel=$tauprefix
else
tautoplevel=$tauroot
fi
if [ $perf = yes ]
then
fixmakeargs="$fixmakeargs PERFLIB"
tauoptions="${tauoptions}-perf"
if [ "x$perfincdir" != "x" ]
then
fixmakeargs="$fixmakeargs perfincdir=$perfincdir"
fi
if [ "x$perflibdir" != "x" ]
then
fixmakeargs="$fixmakeargs perflibdir=$perflibdir"
fi
if [ "x$perflibrary" != "x" ]
then
fixmakeargs="$fixmakeargs perflibrary=$perflibrary"
else
if [ -f $perflibdir/libpapi.a ]
then
perflibrary="-lperfrt#-lpapi"
else
perflibrary="-lperfrt"
fi
fixmakeargs="$fixmakeargs perflibrary=$perflibrary"
fi
fi
if [ $epilog = yes -a $epiloginc = no -a $epilogdir != no ]
then
if [ -f $epilogdir/include/elg_rw.h ]
then
epilogincdir=$epilogdir/include
else
epilogincdir=$epilogdir/src
fi
fi
if [ $epilog = yes -a $epilogbin = no -a $epilogdir != no ]
then
if [ -f $epilogdir/bin/opari ]
then
epilogbindir=$epilogdir/bin
else
epilogbindir=$epilogdir/src
fi
fi
if [ $epilog = yes -a -f $epilogbindir/skin ]
then
fixmakeargs="$fixmakeargs SCALASCA"
scalasca=yes
fi
if [ $epilog = yes -a $epiloglib = no -a $epilogdir != no ]
then
if [ -f $epilogdir/lib/libelg.base.a ]
then
epiloglibdir=$epilogdir/lib
elif [ -f $epilogdir/src/libelg.base.a ]
then
epiloglibdir=$epilogdir/src
elif [ -f $epilogdir/lib/be/libelg.base.a ]
then
epiloglibdir=$epilogdir/lib/be
elif [ -f $epilogdir/lib/fe/libelg.base.a ]
then
epiloglibdir=$epilogdir/lib/fe
elif [ -f $epilogdir/lib64/libelg.base.a ]
then
epiloglibdir=$epilogdir/lib64
elif [ -f $epilogdir/lib32/libelg.base.a ]
then
epiloglibdir=$epilogdir/lib32
else
echo "ERROR: PLEASE SPECIFY A VALID -epiloglib=<dir> option."
fi
fi
if [ $vampirtrace = yes ]
then
if [ -f $vampirtracedir/lib/libvt.a ]
then
vampirtracelibdir=lib
else
vampirtracelibdir=vtlib
fi
fi
if [ $papi = yes ] ; then
fixmakeargs="$fixmakeargs PAPI papidir=$papidir"
tauoptions="${tauoptions}-papi"
p=$papidir/lib
papisubdir=lib
if [ $machine = "mips32" ] ; then
papisubdir=lib32
fixmakeargs="$fixmakeargs papisubdir=lib32"
else
if [ -f $p/libpapi.so -o -f $p/libpapi.a -o -f $p/libpapi64.so -o -f $p/libpapi64.a -o -f $p/libpapi.rts.a ] ; then
papisubdir=lib
fixmakeargs="$fixmakeargs papisubdir=lib"
else
if [ -f $p/cnos64/libpapi.so ] ; then
papisubdir=lib/cnos64
fixmakeargs="$fixmakeargs papisubdir=lib/cnos64"
else
if [ -f $p/xt-cnl/lib/libpapi.so ] ; then
papisubdir=xt-cnl/lib
fixmakeargs="$fixmakeargs papisubdir=xt-cnl/lib"
else
if [ -f $papidir/lib64/libpapi.so ] ; then
papisubdir=lib64
fixmakeargs="$fixmakeargs papisubdir=lib64"
else
papisubdir=src
fixmakeargs="$fixmakeargs papisubdir=src"
fi
fi
fi
fi
fi
if [ -f $papidir/lib/libpfm.a ] ; then
cat <<EOF > tau_papi_test.c
#include <papi.h>
int main (int argc, char **argv) {
int papi_ver;
papi_ver = PAPI_library_init(PAPI_VER_CURRENT);
}
EOF
if $c_compiler $orig_useropt tau_papi_test.c -I$papidir/include -L$papidir/$papisubdir -lpfm -lpapi -lpfm -o tau_papi_test 1> /dev/null 2>&1 ; then
fixmakeargs="$fixmakeargs PAPIPFM"
papipfm=yes
fi
/bin/rm -f tau_papi_test.c tau_papi_test
fi
fi
if [ $mpi = yes ]
then
wrapperlib="-L$tautoplevel/$machine/lib -lTauMpi\$(TAU_CONFIG)"
if [ $epilog = yes -a $mpi = yes ]
then
if [ $sicortex = yes ] ; then
wrapperlib="-L$epiloglibdir -Wl,-whole-archive -lelg.mpi -Wl,-no-whole-archive"
else
wrapperlib="-L$epiloglibdir -lelg.mpi"
fi
# kconfig puts -Wl,-rpath <papidir>/lib and this messes up ifort
# if [ $scalasca = yes ]
# then
# if [ -f $epilogbindir/kconfig ]
# then
# echo "NOTE: Using kconfig to determine libs used in Scalasca/Epilog"
# wrapperlib=`$epilogbindir/kconfig --for --mpi --libs`
# fi
# fi
if [ $openmp = yes ] ; then
if [ $sicortex = yes ] ; then
wrapperlib="-L$epiloglibdir -Wl,-whole-archive -lelg.ompi -Wl,-no-whole-archive -Wl,-Bstatic#-lbfd#-liberty#-Wl,-Bdynamic"
else
wrapperlib="-L$epiloglibdir -lelg.ompi"
fi
fi
fi
if [ $vampirtrace = yes -a $mpi = yes ] ; then
if [ $vampirtrace = yes -a -f $vampirtracedir/$vampirtracelibdir/libvt.fmpi.a -o -f $vampirtracedir/$vampirtracelibdir/libvt.fmpi.a ] ; then
vtfortranwrapper="-lvt.fmpi"
else
vtfortranwrapper=""
fi
wrapperlib="-L$tautoplevel/$machine/lib -ltau\$(TAU_CONFIG) -L$vampirtracedir/$vampirtracelibdir $vtfortranwrapper -lvt.mpi -lotf -lz"
if [ $openmp = yes ] ; then
# should we have a -lvt.fmpi here?
fixmakeargs="pcxxopt=$pcxxopt useropt=$useropt extrashlibopts=$extrashlibopts $fixmakeargs"
if [ $sicortex = yes ] ; then
wrapperlib="$sicortexlink"
#-L$tautoplevel/$machine/lib -ltau\$(TAU_CONFIG) -L$vampirtracedir/$vampirtracelibdir -Wl,-whole-archive $vtfortranwrapper -lvt.ompi -lotf -lbfd -Wl,-no-whole-archive -lz"
else
wrapperlib="-L$tautoplevel/$machine/lib -ltau\$(TAU_CONFIG) -L$vampirtracedir/$vampirtracelibdir -Wl,-whole-archive $vtfortranwrapper -lvt.ompi -lotf -Wl,-no-whole-archive -lz"
fi
fi
fi
if [ $perf = yes ]
then
wrapperlib="-L$\(PERFLIBDIR) \$(PERFLIBRARY)"
fi
mpilibargs=$wrapperlib
wrapperC=$wrapperlib
if [ -d $mpilib ] ; then
#echo "Lib dir found. adding -L$mpilib to LIB"
mpilibargs="$mpilibargs -L$mpilib"
if [ -r $mpilib/libmpi_r.a -a -r $mpilib/libmpi.a ] ; then
fixmakeargs="$fixmakeargs IBMMPI"
ibmmpi=yes
fi
if [ -f $mpilib/libfmpi.a -o -f $mpilib/libfmpi.so ] ; then
#echo "Fortran fmpi.* found"
mpiflibargs="-L$mpilib -lfmpi $wrapperlib"
else
if [ $epilog = yes -a -f $epiloglibdir/libfmpi.a ] ; then
mpiflibargs="-lfmpi"
wrapperlib="$wrapperlib -lfmpi"
fi
if [ $epilog = yes -a -f $epiloglibdir/libelgfmpi.a ] ; then
mpiflibargs="-lelgfmpi"
wrapperlib="$wrapperlib -lelgfmpi"
fi
if [ $epilog = yes -a -f $epiloglibdir/libepk.ad.fmpi.a ] ; then
mpiflibargs="-lepk.ad.fmpi"
wrapperlib="$wrapperlib -lepk.ad.fmpi"
fi
if [ -f $mpilib/libfmpich.cnk.a -o -f $mpilib/libfmpich.cnk.so ] ; then
mpiflibargs="-lfmpich.cnk"
# wrapperlib="$wrapperlib -lfmpich.cnk"
fi
if [ -f $mpilib/libfmpich.a -o -f $mpilib/libfmpich.so ] ; then
#echo "Fortran fmpich.* found"
if [ $mpi2 = "yes" ] ; then
#mpich2, must not use -lfmpich
if [ -f /usr/lib/librt.a -a $catamount = no ] ; then
# mpich2 uses librt for aio_* routines
mpiflibargs="-L$mpilib $wrapperlib -lpthread -lrt"
mpilibargs="$mpilibargs -lpthread -lrt"
else
mpiflibargs="-L$mpilib $wrapperlib"
fi
else
#mpich1, must use -lfmpich
mpiflibargs="-L$mpilib -lfmpich $wrapperlib"
fi
# Does MPI_Init have weak bindings for Fortran (Infiniband MPI)
weakmpi=T
# by default it has a T for defined symbol in nm output */
weakmpi=`nm $mpilib/libfmpich.a | grep mpi_init | awk '{ print $2 ; }' | head -n 1 `
if [ "x$weakmpi" = "xW" ]
then
echo "MPI has weak bindings for mpi_init Fortran bindings..."
fixmakeargs="$fixmakeargs WEAKMPIINIT"
fi
else
if [ -f $mpilib/liblamf77mpi.a -o -f $mpilib/liblamf77mpi.so ] ; then
#echo "Fortran liblamf77mpi.* found"
mpiflibargs="-L$mpilib -llamf77mpi $wrapperlib"
else
if [ -f $mpilib/libmpi_f77.so ] ; then
#echo "Fortran libmpi_f77.* found"
mpiflibargs="-L$mpilib -lmpi_f77 $wrapperlib"
else
#echo "No Fortran interface found"
mpiflibargs="$mpiflibargs $wrapperlib -L$mpilib"
fi
fi
fi
fi
# Cases
if [ -r $mpilib/libmpi.a -o -r $mpilib/libmpi.so ] ; then
#echo "libmpi.* found!!"
if [ "x$mpilibrary" = "xno" ] ; then
mpilibrary=-lmpi
if [ -r $mpilib/libmpi++.so ] ; then
mpilibrary='-lmpi -lmpi++'
# SGI MPT
fi
# OpenMPI
if [ -r $mpilib/libmpi_cxx.so ] ; then
mpilibrary='-lmpi -lmpi_cxx'
fi
if [ -r $mpilib/libopen-pal.a -a ! -r $mpilib/libmpi_cxx.so ]; then
echo "NOTE: OpenMPI configured with --disable_shared"
mpilibrary='-lmpi_cxx -lmpi -lopen-rte -lopen-pal -lrt -lnuma -ldl -lpthread -lutil'
# check for -libverbs, sometimes necessary with OpenMPI
if [ -r /usr/lib64/libibverbs.a -o -r /usr/lib64/libibverbs.so ] ; then
mpilibrary="$mpilibrary -libverbs"
fi
fi
# See if threaded MPI should be used on AIX
if [ $ibmxlc_r = yes -a -r $mpilib/libmpi_r.a ] ; then
mpilibrary="-lmpi_r $additional_mpilibs"
fi
fi
if [ -r $mpilib/libpmpi.a -o -r $mpilib/libpmpi.so ] ; then
#echo "libpmpi.* found "
mpilibargs="$mpilibargs -lpmpi $mpilibrary"
mpiflibargs="$mpiflibargs -lpmpi $mpilibrary"
else
#echo "libpmpi.* not found -lmpi probably contains PMPI routines"
mpilibargs="$mpilibargs $mpilibrary"
mpiflibargs="$mpiflibargs $mpilibrary"
fi
else
#echo "libmpi.* not found!! Checking for mpich.*..."
if [ -r $mpilib/libmpich.a -o -r $mpilib/libpmpich.so -o -r $mpilib/libmpich.rts.a -o -r $mpilib/libmpich.cnk.a ] ; then
fixmakeargs="$fixmakeargs MPICH_IGNORE_CXX_SEEK"
if [ $mpi2 = yes ] ; then
fixmakeargs="$fixmakeargs MPICH2_MPI_INPLACE"
fi
#echo "MPICH found "
if [ "x$mpilibrary" = "xno" ] ; then
if [ -r $mpilib/libmpich.rts.a ] ; then
# For BG/L
mpilibrary="-lmpich.rts $additional_mpilibs"
else
if [ -r $mpilib/libmpich.cnk.a ]; then
# For BG/P
mpilibrary="-lmpich.cnk $additional_mpilibs"
else
mpilibrary=-lmpich
fi
fi
fi
if [ -r $mpilib/libpmpich++.a -o -r $mpilib/libpmpich++.so ] ; then
#echo "pmpich++ found"
mpilibrary="-lpmpich++ $mpilibrary"
fi
if [ -r $mpilib/libmpichcxx.a -o -r $mpilib/libmpichcxx.so ] ; then
#echo "mpichcxx found"
mpilibrary="-lmpichcxx $mpilibrary"
fi
if [ -r $mpilib/libpmpich.a -o -r $mpilib/libpmpich.so ] ; then
#echo "pmpich found"
mpilibargs="$mpilibargs -lpmpich $mpilibrary"
mpiflibargs="$mpiflibargs -lpmpich $mpilibrary"
else
#echo "pmpich not found"
mpilibargs="$mpilibargs $mpilibrary"
mpiflibargs="$mpiflibargs $mpilibrary"
fi
if [ -r /usr/lib/librt.a -o -r /usr/lib/librt.so ] ; then
#echo "librt found"
mpilibargs="$mpilibargs -lrt"
mpiflibargs="$mpiflibargs -lrt"
fi
if [ -r /usr/lib64/libibverbs.a -o -r /usr/lib64/libibverbs.so ] ; then
#echo "libibverbs found"
mpilibargs="$mpilibargs -libverbs"
mpiflibargs="$mpiflibargs -libverbs"
fi
if [ -r $mpilib/libscdma.a -a -r $mpilib/libpmi.a ] ; then
# echo "add -lscdma -lpmi to the SiCortex link line"
mpilibargs="$mpilibargs -lscdma -lpmi"
mpiflibargs="$mpiflibargs -lscdma -lpmi"
fi
else
if [ "x$mpilibrary" != "xno" ] ; then
mpilibargs="$mpilibargs $mpilibrary"
mpiflibargs="$mpiflibargs $mpilibrary"
fi
fi
fi
# libmpi.* found. But libpmpi* not found.
# both found.
# libmpi.* not found - look for libmpich.*
# For fortran libfmpich.* look for libpmpi
# Check for libmpio.a
if [ -r $mpilib/libmpio.a ]
then
mpilibargs="$mpilibargs -lmpio"
mpiflibargs="$mpiflibargs -lmpio"
fi
# Special check for LAM MPI
if [ -r $mpilib/liblam.a ]
then
echo "This looks like a LAM MPI installation. Adding -llam to link command line"
if [ -r $mpilib/liblammpi++.a ] ; then
mpilibargs="$mpilibargs -llammpi++ -lmpi"
mpiflibargs="$mpiflibargs -llammpi++ -lmpi"
fi
mpilibargs="$mpilibargs -llam"
mpiflibargs="$mpiflibargs -llam"
if [ -f /usr/lib/libutil.a ]
then
# This is a Linux box, add -lutil to the mpi libraries
echo "Adding -lutil to link command line for LAM MPI"
mpilibargs="$mpilibargs -lutil -ldl -lpthread"
mpiflibargs="$mpiflibargs -lutil -ldl -lpthread"
fi
fi
# Special check for Intel MPI
if [ -r $mpilib/libmpiif.a ]
then
echo "This looks like an Intel MPI installation."
mpilibargs="$mpilibargs -lmpiif -ldl -lrt"
mpiflibargs="$mpiflibargs -lmpiif -ldl -lrt"
fi
# Special check for HPMPI
if [ -r $mpilib/libmpi_hmp.a ]
then
echo "This looks like an HP/MPI installation."
mpilibargs="$mpilibargs -ldl"
mpiflibargs="$mpiflibargs -ldl"
fi
# Special check for ChaMPIon/Pro
if [ -r $mpilib/libcmpi.a ]
then
echo "This looks like a ChaMPIon/Pro installation."
mpiextraargs=`cmpicc -v -echo | cut -c8- `
mpilibargs="$mpilibargs $mpiextraargs"
mpiflibargs="$mpiflibargs $mpiextraargs -lcmpi_fort"
fi
# Special check for VMI [NCSA] MPICH
if [ -r $mpilib/libvmi.a ]
then
echo "This looks like a VMI MPICH installation. Adding -lvmi -lpthread -ldl to link command line"
mpilibargs="$mpilibargs -lvmi -lpthread -ldl"
mpiflibargs="$mpiflibargs -lvmi -lpthread -ldl"
fi
mpilibargs=`echo $mpilibargs | sed -e 's/ /#/g'`
mpiflibargs=`echo $mpiflibargs | sed -e 's/ /#/g'`
if [ $papipfm = yes -a "x$mpilib" = "x/usr/lib" ]
then
echo "NOTE: Adding -L<papidir> before -L<mpidir> to use PAPI's libpfm"
mpilibargs="-L$papidir/$\(PAPISUBDIR\)#$mpilibargs"
mpiflibargs="-L$papidir/$\(PAPISUBDIR\)#$mpiflibargs"
fi
fixmakeargs="$fixmakeargs mpilibargs=$mpilibargs mpiflibargs=$mpiflibargs mpilib=$mpilib"
# now throw in non-wrapped MPI library lines
wrapperF=$wrapperlib
nowrapC=`echo $wrapperC | sed -e 's/ /#/g'`
nowrapF=`echo $wrapperF | sed -e 's/ /#/g'`
notaumpilibargs=`echo $mpilibargs | sed -e "s@$nowrapC@@"`
notaumpiflibargs=`echo $mpiflibargs | sed -e "s@$nowrapF@@"`
fixmakeargs="$fixmakeargs mpinowraplibargs=$notaumpilibargs mpinowrapflibargs=$notaumpiflibargs mpilib=$mpilib"
# Check to see if the MPI library contains a _r
mpithreadtest=`echo $mpilibrary | sed -e 's/_r//'`
if [ "y$mpithreadtest" = "y$mpilibrary" ]
then
echo "NOTE: MPI library does not have a threaded _r suffix "
else
echo "NOTE: MPI library has a threaded _r suffix "
fixmakeargs="$fixmakeargs MPI_R_SUFFIX"
fi # mpi _r check
fi # If -d mpilib
else # if mpilib is specified
if [ $openmp = yes ]
then
if [ $epilog = yes ] ; then
if [ $sicortex = yes ] ; then
wrapperlib="-L$epiloglibdir#-Wl,-whole-archive#-lelg.omp#-Wl,-Bstatic#-lbfd#-liberty#-Wl,-Bdynamic#-Wl,-no-whole-archive#-ldl"
else
wrapperlib="-L$epiloglibdir#-lelg.omp#-ldl"
fi
fixmakeargs="extrashlibopts=$wrapperlib $fixmakeargs"
elif [ $vampirtrace = yes ] ; then
if [ $sicortex = yes ] ; then
wrapperlib="-L$vampirtracedir/$vampirtracelibdir#-Wl,-whole-archive#-lvt.omp#-lotf#-Wl,-no-whole-archive#-lz#-Wl,-Bstatic#-lbfd#-liberty#-Wl,-Bdynamic#-ldl"
else
wrapperlib="-L$vampirtracedir/$vampirtracelibdir#-Wl,-whole-archive#-lvt.omp#-lotf#-Wl,-no-whole-archive#-lz#-ldl"
fi
fixmakeargs="extrashlibopts=$wrapperlib $fixmakeargs"
fi
else
if [ $epilog = yes ]
then
wrapperlib="-L$epiloglibdir#-lelg#-ldl"
fixmakeargs="extrashlibopts=$wrapperlib $fixmakeargs"
elif [ $vampirtrace = yes ]
then
wrapperlib="-L$vampirtracedir/$vampirtracelibdir#-lvt#-lotf#-lz#-Wl,-Bstatic#-lbfd#-liberty#-Wl,-Bdynamic#-ldl"
fixmakeargs="extrashlibopts=$wrapperlib $fixmakeargs"
fi
fi
fi
######################################################################
# Set default CC compiler in all Makefiles
if [ "$mpi" = "yes" -a "$ibmxlc_r" = "no" -a "$ibmxlc" = "yes" -a "$machine" = "ibm64" ]
then
echo "WARNING: PLEASE use xlC_r instead of xlC with MPI in 64 bit mode!! Reconfigure."
echo "----------------------------------------------------------------"
fi
# Now check for SHMEM options
if [ $shmem = yes ]
then
if [ "x$shmeminc" != "x" ]
then
if [ -d $shmeminc ]
then
#echo "Include dir found. adding -I$mpiinc to INC"
shmemincargs="-I$shmeminc"
gpshmem=no
if [ -r $shmeminc/gpshmem.h ]
then
fixmakeargs="$fixmakeargs GPSHMEM"
gpshmem=yes
fi
fi
else
if [ $catamount = yes ]
then
shmemincargs="-I/opt/xt-mpt/default/include/mpp"
fi
fi
if [ $shmemlibrary = no ]
then
shmemlibrary=-lsma
if [ $gpshmem = yes ]
then
shmemlibrary=-lgpshmem
fi
fi
if [ "x$shmemlib" != "x" ]
then
if [ -d $shmemlib ]
then
#echo "Lib dir found. adding -L$shmemlib to LIB"
shmemlibargs="$shmemlibargs -L$shmemlib"
fi
else
if [ $catamount = yes ]
then
shmemlibargs="$shmemlibargs -L/opt/xt-mpt/default/lib/cnos64"
fi
fi
shmemlibargs="$shmemlibargs $shmemlibrary"
shmemlibargs=`echo $shmemlibargs | sed -e 's/ /#/g'`
fixmakeargs="$fixmakeargs SHMEM"
tauoptions="${tauoptions}-shmem"
fixmakeargs="$fixmakeargs shmemlibargs=$shmemlibargs shmemincargs=$shmemincargs"
fi
gcclibdir=unknown
if [ $c_compiler != gcc ]
then
echo Default C compiler will be $c_compiler
fixmakeargs="$fixmakeargs USE_CC"
else
echo "Default C compiler will be " `gcc -v 2>&1 | tail -1`
# I must set the gcclibdir in the Makefiles if we combine gcc, cc, and CC
gcclibdir=`gcc -v 2>&1 | awk '{print $4;}' | \
awk -F/ '{for (i=2; i<NF; i++) printf("/%s",$i); printf("\n"); }'`
# echo $gcclibdir
fi
######################################################################
# Set default compiler options
if [ $use_pcxx = yes ]
then
opt=`echo $pcxxopt | sed -e 's/_/ /g' -e 's/^$/(none)/'`
echo "Default compiler options for pC++ programs are $opt"
opt=`echo $useropt | sed -e 's/_/ /g' -e 's/^$/(none)/'`
echo "Default compiler options for pC++ user programs are $opt"
fixmakeargs="pcxxopt=$pcxxopt useropt=$useropt extrashlibopts=$extrashlibopts $fixmakeargs"
fi
fixmakeargs="c_compiler=$c_compiler cxx_compiler=$cxx_compiler useropt=$useropt extradir=$extradir extradircxx=$extradircxx extrashlibopts=$extrashlibopts $fixmakeargs"
######################################################################
# discover the paths for standard system include directories
cat << EOF > get_stdinc.C
#include <stddef.h>
#include <iostream>
EOF
cat << EOF > find_stdinc.awk
BEGIN {cinc=""; cppinc="";}
/^#[0123456789]+ ".+\/stddef.h"/ {cinc = substr(\$2, 2, length(\$2)-11);}
/^#line [0123456789]+ ".+\/stddef.h"/ {cinc = substr(\$3, 2, length(\$3)-11);}
/^# [0123456789]+ ".+\/stddef.h"/ {cinc = substr(\$3, 2, length(\$3)-11);}
/^#[0123456789]+ ".+\/iostream.h"/ {cppinc = substr(\$2, 2, length(\$2)-13);}
/^#line [0123456789]+ ".+\/iostream.h"/ {cppinc = substr(\$3, 2, length(\$3)-13);}
/^# [0123456789]+ ".+\/iostream.h"/ {cppinc = substr(\$3, 2, length(\$3)-13);}
END {printf("-I%s -I%s\n", cinc, cppinc);}
EOF
if [ $machine = hitachi ]
then
stdinc="-I/usr/include"
else
stdinc=`$cxx_compiler -E get_stdinc.C | awk -f find_stdinc.awk`
fi
rm -f get_stdinc.C find_stdinc.awk
#####################################################################
cat << EOF > f1.c
#define _LARGEFILE64_SOURCE 1
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(int argc, char** argv) {
int file = open ("asdf", O_LARGEFILE, 0600);
}
EOF
$echo "Checking if open takes O_LARGEFILE... ${nnl}"
if $c_compiler $orig_useropt -c f1.c 1> /dev/null 2>&1 ; then
fixmakeargs="$fixmakeargs TAU_LARGEFILE"
echo "yes"
else
echo "no"
fi
/bin/rm -f f1.o f1.c
######################################################################
# Check for BFD
######################################################################
cat <<EOF > conftest_bfd.c
#include <bfd.h>
EOF
$echo "Checking for bfd.h... ${nnl}"
if $c_compiler $orig_useropt -c conftest_bfd.c 1> /dev/null 2>&1 ; then
fixmakeargs="$fixmakeargs TAU_BFD"
echo "yes"
else
echo "no"
fi
/bin/rm -f conftest_bfd.o conftest_bfd.c
######################################################################
######################################################################
cat <<EOF > get_typeinfo1.C
#include <typeinfo>
using std::type_info;
#ifdef __GNUC__
#include <cxxabi.h>
using namespace std;
#endif /* GNUC */
EOF
if $cxx_compiler $orig_useropt -c get_typeinfo1.C 1> /dev/null 2>&1
then
echo "C++ compiler supports Std Runtime Type Information (default)"
if [ $cxx_compiler = g++ -o $cxx_compiler = c++ -o $cxx_compiler = powerpc64-linux-g++ ]
then
echo "Supporting GNU RTTI options"
fi
else
cat <<EOF > get_typeinfo2.C
#include <typeinfo.h>
EOF
if $cxx_compiler $orig_useropt -c get_typeinfo2.C 1> /dev/null 2>&1
then
echo "C++ compiler supports RTTI"
fixmakeargs="$fixmakeargs RTTI"
else
echo "C++ compiler doesn't support Runtime Type Information"
fixmakeargs="$fixmakeargs NORTTI"
fi
fi
rm -f get_typeinfo1.C get_typeinfo2.C get_typeinfo*.o *.ti *.ii
######################################################################
if [ $cxx_compiler = pgCC ]
then
cat <<EOF > pgitest.C
int foo(int x)
{
return x;
}
EOF
if $cxx_compiler $orig_useropt -c pgitest.C 1> /dev/null 2>&1
then
if $cxx_compiler $orig_useropt --prelink_objects pgitest.o 1> /dev/null 2>&1
then
echo "PGI compiler supports the --prelink_objects option"
else
echo "PGI compiler should not use --prelink_objects option for making libs"
fixmakeargs="$fixmakeargs PGINOPRELINK"
fi
else
echo "ERROR: Your PGI compiler is not working! Please check the license file"
fi
rm -f pgitest.o pgitest.C libpgitest.a
fi
######################################################################
# If epilog is used, check and see if it supports v2.1s write interface
if [ $epilog = yes ]
then
echo "Checking epilog write interface:"
cat << EOF > elgtest.C
#include <elg_rw.h>
int foo(ElgOut *out, elg_ui4 eventc)
{
return ElgOut_write_NUM_EVENTS(out, eventc);
}
EOF
if $cxx_compiler $orig_useropt -I$epilogincdir -c elgtest.C 1> /dev/null 2>&1
then
fixmakeargs="$fixmakeargs TAU2EPILOG"
fi
rm -f elgtest.C elgtest.o
fi
######################################################################
# Save C++ compiler, C compiler, and USEROPT for build
echo "$machine: cxx = $cxx_compiler" >> ./build/Config.info
echo "$machine: cc = $c_compiler" >> ./build/Config.info
opt=`echo $useropt | sed -e 's/_/ /g'`
echo "$machine: useropt = $opt" >> ./build/Config.info
echo "$machine: stdincludes = $stdinc" >> ./build/Config.info
echo "" >> ./build/Config.info
######################################################################
## STATIC ANALYSIS: Ductape/Program Database Toolkit/IL Analyser
# NOW PDT configuration handled in PDT
######################################################################
######################################################################
# test whether C++ compiler supports AT&T task library
echo "#include <task.h>" > /tmp/tau$$.C
echo "class IamReallyATTtask : public object {};" >> /tmp/tau$$.C
if $cxx_compiler -c /tmp/tau$$.C 1> /dev/null 2>&1
then
# echo "AT&T task library found; using it"
task=yes
fi
rm -f /tmp/tau$$.C tau$$.o
######################################################################
# test whether C++ compiler supports Std C++ Library (KAI KCC compiler)
echo "Testing for Standard C++ Library support for string class"
cat <<EOF > /tmp/tau$$.C
#include <string>
#include <vector>
#include <list>
#include <map>
using std::string;
using std::vector;
using std::pair;
using std::list;
using std::map;
void foo(void) { string s1; return; }
EOF
if $cxx_compiler -c /tmp/tau$$.C 1> /dev/null 2>&1
then
echo "Found support for Standard C++ Library string"
echo "NOTE: Compiling Profiling Library and Applications with -DTAU_STDCXXLIB"
echo "***********************************************************************"
stdcxxlib=yes
else
echo "Did not find <string> Standard C++ Library header file. Using <bstring.h> "
fi
rm -f /tmp/tau$$.C tau$$.o
######################################################################
# test whether C++ compiler supports SUN LWP thread library
if [ -f /usr/include/lwp/lwp.h ]
then
echo "SUN LWP thread library found; using it"
lwp=yes
fi
######################################################################
# Set some more Profiling options
if [ $stdcxxlib = yes ]
then
fixmakeargs="$fixmakeargs STDCXXLIB"
fi
######################################################################
if [ $machine = craycnl ]
then
#echo "This looks like a Cray Compute Node Linux (CNL) system..."
fixmakeargs="$fixmakeargs CRAYCNL"
fi
######################################################################
if [ $catamount = yes ]
then
#echo "This looks like a CATAMOUNT Cray RS system..."
fixmakeargs="$fixmakeargs CATAMOUNT"
if [ $fortran_compiler = pgi ]
then
fixmakeargs="$fixmakeargs PGI_CATAMOUNT"
fi
fi
######################################################################
if [ $cxx_compiler = g++ -o $cxx_compiler = egcs -o $cxx_compiler = powerpc64-linux-g++ -o $cxx_compiler = c++ -o $cxx_compiler = scg++ -o $cxx_compiler = mips64el-gentoo-linux-gnu-g++ -o $cxx_compiler = powerpc-bgp-linux-g++ ]
then
fixmakeargs="$fixmakeargs GNU COMPINST_GNU"
if [ $machine = ibm64 -o $machine = rs6000 -o $machine = ppc64 -o $machine = bgl -o $machine = bgp -o $machine = ibm64linux ]
then
tauoptions="${tauoptions}-gnu"
fi
taugcclibdir=`$c_compiler -print-libgcc-file-name | sed -e 's,[^/]*$,,'`
echo "Using GNU lib dir as $taugcclibdir"
fixmakeargs="$fixmakeargs taugcclibdir=$taugcclibdir"
fi
######################################################################
# TEST FOR ALL MACHINE TYPES
case $machine in
hp9000s700 | hp9000s800)
echo Found a \"$machine\" configuration definition
fixmakeargs="arch=$machine NO_RANLIB HP $fixmakeargs"
# HP-ALLOCA HP_CFLAGS
if [ `/bin/uname -r | cut -d. -f2` = 10 ]
then
echo This machine uses HPUX Version 10
fixmakeargs="HPUX10 $fixmakeargs"
fi
if [ $c_compiler = cc ]
then
fixmakeargs="HP_CFLAGS HP-ALLOCA $fixmakeargs"
fi
if [ $cxx_compiler = g++ ]
then
fixmakeargs="HPGNU $fixmakeargs"
fi
if [ $pdt_cxx_compiler = aCC ]
then
fixmakeargs="PDTHPACC $fixmakeargs"
fi
# Check for Convex SPP enviroment
if [ $detectxdev = cnxspp ]
then
fixmakeargs="$fixmakeargs CNXSPP"
fi
;;
decstation)
echo Found a \"$machine\" configuration definition
# fixmakeargs="arch=$machine MIPS_CC $fixmakeargs"
# with gcc, there are no changes needed...
fixmakeargs="arch=$machine $fixmakeargs"
;;
ppc64)
echo "Found an IBM PPC-64 Linux configuration definition"
fixmakeargs="arch=$machine PPC64 $fixmakeargs"
if [ $papi = yes ]
then
fixmakeargs="$fixmakeargs PPC64PAPI"
fi
;;
bgp)
echo "Found an IBM PPC-64 BG/P Linux configuration definition"
fixmakeargs="arch=$machine BGP $fixmakeargs"
if [ $papi = yes ] ; then
p=$papidir/lib
if [ -f $p/libpapi.a ] ; then
fixmakeargs="$fixmakeargs BGPPAPI"
fi
fi
;;
bgl)
echo "Found an IBM PPC-64 BGL Linux configuration definition"
fixmakeargs="arch=$machine BGL $fixmakeargs"
if [ $papi = yes ] ; then
p=$papidir/lib
if [ -f $p/libpapi.a ] ; then
fixmakeargs="$fixmakeargs BGLPAPI"
else
fixmakeargs="$fixmakeargs BGLPAPI_RTS"
fi
fi
;;
ia64)
echo "Found an IA-64 configuration definition"
fixmakeargs="arch=$machine $fixmakeargs"
if [ $papi = yes ]
then
fixmakeargs="$fixmakeargs IA64PAPI"
fi
;;
x86_64|xt3|craycnl)
echo "Found an x86_64 configuration definition"
fixmakeargs="arch=$machine $fixmakeargs"
if [ $papi = yes ]
then
fixmakeargs="$fixmakeargs X86_64PAPI"
fi
;;
ibm64)
echo Found a \"$machine\" configuration definition
if [ `uname -s` = AIX ]
then
fixmakeargs="arch=$machine $fixmakeargs SP1 IBM64"
else
if [ `uname -s ` = Linux ]
then
fixmakeargs="arch=$machine $fixmakeargs PPC64 IBM64"
else
fixmakeargs="arch=$machine $fixmakeargs IBM64"
fi
fi
if [ $papi = yes ]
then
fixmakeargs="$fixmakeargs IBM64PAPI"
fi
;;
ibm64linux)
echo Found a \"$machine\" configuration definition
fixmakeargs="arch=$machine $fixmakeargs PPC64 IBM64LINUX"
if [ $papi = yes ]
then
fixmakeargs="$fixmakeargs IBM64PAPILINUX"
fi
;;
mips32)
echo Found a \"$machine\" configuration definition
fixmakeargs="arch=$machine $fixmakeargs MIPS32 MIPS32LINUX"
sicortex=yes
if [ $papi = yes ]
then
fixmakeargs="$fixmakeargs MIPS32PAPI"
fi
;;
mips)
echo Found a \"$machine\" configuration definition
fixmakeargs="arch=$machine $fixmakeargs MIPS64 MIPS64LINUX"
sicortex=yes
if [ $papi = yes ]
then
fixmakeargs="$fixmakeargs MIPS64PAPI"
fi
;;
rs6000)
echo Found a \"$machine\" configuration definition
fixmakeargs="arch=$machine $fixmakeargs SP1"
if [ $papi = yes ]
then
fixmakeargs="$fixmakeargs IBMPAPI"
fi
# Check for SP1 xdev enviroment
# if [ $detectxdev = sp1 ]
# then
# fixmakeargs="$fixmakeargs SP1"
# fi
;;
alpha)
if [ $papi = yes ]
then
fixmakeargs="$fixmakeargs ALPHAPAPI"
fi
echo Found a \"$machine\" configuration definition
fixmakeargs="arch=$machine $fixmakeargs"
fixmakeargs="COMPAQ_ALPHA $fixmakeargs"
if [ $pdt_cxx_compiler = cxx ]
then
fixmakeargs="$fixmakeargs PDTALPHACXX"
fi
if [ $guidef90 = yes ]
then
f90loaded=`which f90 | sed -e 's/f90/../g' | grep "^no"`
if [ "x$f90loaded" = "x" ]
then
# f90 module has been loaded and which f90 returns a path
extradir="`which f90 | sed s/f90/../`"
echo "Found f90 in `which f90`"
fi
fixmakeargs="$fixmakeargs extradir=$extradir COMPAQ_GUIDEF90"
fi
;;
sgi4k | sgi8k | sgi32 | sgin32 | sgi64)
echo Found a \"$machine\" configuration definition
fixmakeargs="arch=$machine $fixmakeargs"
if [ $c_compiler = cc ]
then
# Check CPU type for compiler optimization flags... (-mips2) (-mips4)
if [ $machine = sgi4k ]
then
fixmakeargs="$fixmakeargs MIPS_CC"
fixmakeargs="$fixmakeargs MIPSR4K"
echo "NOTE: *** This is an SGI Challenge (R4K) ***"
else
fixmakeargs="$fixmakeargs MIPSR8K"
echo "NOTE: *** This is an SGI POWER Challenge/Origin (R8K, R10K) ***"
fi
fi
if [ $machine = sgin32 ]
then
fixmakeargs="$fixmakeargs ENABLEN32BIT"
fi
if [ $machine = sgi64 ]
then
fixmakeargs="$fixmakeargs ENABLE64BIT"
if [ $papi = yes ]
then
if [ -f $papidir/lib/libpapi64.so -o -f $papidir/src/libpapi64.so ]
then
fixmakeargs="$fixmakeargs SGI64PAPI"
fi
fi
fi
if [ $machine = sgi32 ]
then
fixmakeargs="$fixmakeargs ENABLE32BIT"
fi
# Check for sgimp xdev enviroment
if [ $detectxdev = sgimp -o $machine = sgi8k -o $machine = sgin32 -o $machine = sgi64 ]
then
fixmakeargs="$fixmakeargs SGIMP"
if [ $fortran_compiler = no ]
then
fixmakeargs="$fixmakeargs SGI_FORTRAN"
fortran_compiler=yes
fi
fi
;;
next)
echo Found a \"$machine\" configuration definition
fixmakeargs="arch=$machine NEXT_CLIB $fixmakeargs"
;;
# Currently cm5 cross-development environments are NOT supported
# for solaris2 machines....
solaris2*)
echo Found a \"$machine\" configuration definition
fixmakeargs="arch=$machine SOL2 $fixmakeargs"
if [ "$tauarch" = "solaris2-64" ]
then
fixmakeargs="$fixmakeargs SOLARIS64"
fi
if [ $papi = yes ]
then
fixmakeargs="$fixmakeargs SOL2PAPI"
fi
if [ $cxx_compiler = CC ]
then
fixmakeargs="$fixmakeargs SOL2CC"
if [ $openmp = yes ]
then
fixmakeargs="$fixmakeargs SOL2CC_OPENMP"
fi
if [ $fortran_compiler = no ]
then
fixmakeargs="$fixmakeargs SUN_FORTRAN"
fortran_compiler=yes
fi
fi
# Check for Meiko CS2 xdev enviroment
if [ $detectxdev = cs2 ]
then
fixmakeargs="$fixmakeargs CS2"
fi
;;
sun386i)
echo Found a \"$machine\" configuration definition
fixmakeargs="arch=$machine SUN386I $fixmakeargs"
if [ $cxx_compiler = CC ]
then
fixmakeargs="$fixmakeargs SOL2CC"
if [ $openmp = yes ]
then
fixmakeargs="$fixmakeargs SOL2CC_OPENMP"
fi
if [ $fortran_compiler = no ]
then
fixmakeargs="$fixmakeargs SUN_FORTRAN"
fortran_compiler=yes
fi
fi
;;
sunx86_64)
echo Found a \"$machine\" configuration definition
fixmakeargs="arch=$machine $fixmakeargs SUNX86_64"
if [ $cxx_compiler = CC ]
then
fixmakeargs="$fixmakeargs SOL2CC"
if [ $openmp = yes ]
then
fixmakeargs="$fixmakeargs SOL2CC_OPENMP"
fi
if [ $fortran_compiler = no ]
then
fixmakeargs="$fixmakeargs SUN_FORTRAN"
fortran_compiler=yes
fi
fi
;;
sun4 | cm5)
echo Found a \"$machine\" configuration definition
fixmakeargs="arch=$machine $fixmakeargs"
# Check for cm5 xdev enviroment
if [ $machine = cm5 -o $detectxdev = cm5 ]
then
fixmakeargs="$fixmakeargs CM5"
fi
;;
ptx)
echo Found a \"$machine\" configuration definition
fixmakeargs="arch=$machine PTX HP-ALLOCA $fixmakeargs"
;;
tc2000)
echo Found a \"$machine\" configuration definition
fixmakeargs="arch=$machine TC2000 $fixmakeargs"
;;
c90)
echo Found a \"$machine\" configuration definition
fixmakeargs="arch=$machine C90 CRAY-ALLOCA $fixmakeargs"
# Check for T3D xdev enviroment
if [ $detectxdev = t3d ]
then
fixmakeargs="$fixmakeargs T3D"
fi
;;
t3e)
echo Found a \"$machine\" configuration definition
fixmakeargs="arch=$machine T3E CRAY-ALLOCA $fixmakeargs"
if [ $fortran_compiler = no ]
then
fixmakeargs="$fixmakeargs CRAY_FORTRAN"
fortran_compiler=yes
fi
;;
ksr1)
echo Found a \"$machine\" configuration definition
fixmakeargs="arch=$machine KSR NO_RANLIB $fixmakeargs"
;;
paragon)
echo Found a \"$machine\" configuration definition
fixmakeargs="arch=$machine PARAGON $fixmakeargs"
;;
symmetry)
echo Found a \"$machine\" configuration definition
fixmakeargs="arch=$machine SYMMETRY $fixmakeargs"
;;
unknown)
echo unknown architecture.
fixmakeargs="arch=$machine $fixmakeargs"
;;
default)
fixmakeargs="arch=$machine $fixmakeargs"
;;
-*)
echo "Invalid option \`$1'" 1>&2
exit 1
;;
*)
echo No special modifications found for architecture \"$machine\"
fixmakeargs="arch=$machine $fixmakeargs"
;;
esac
if [ $machine = x86_64 -o $machine = i386_linux -o $machine = ia64 ]
then
if [ $cxx_compiler = CC ]
then
fixmakeargs="$fixmakeargs SUNCC"
if [ $openmp = yes ]
then
fixmakeargs="$fixmakeargs SUNCC_OPENMP"
fi
if [ $fortran_compiler = no ]
then
fixmakeargs="$fixmakeargs SUN_FORTRAN"
fortran_compiler=yes
fi
fi
fi
if [ $tauarch = none ]
then
architecture=
fixmakeargs="$fixmakeargs arch= "
else
if [ $execprefix = unknown ]
then
architecture=$machine
else
architecture=$execprefix
fi
fi
# write out .h file to define this architecture __easily__
echo \#define TAU_$machine > ./include/tauarch.h
echo \#define TAU_ARCH \"$machine\" >> ./include/tauarch.h
make_directories
if [ $awe = yes ]
then
fixmakeargs="$fixmakeargs AWE_AVAILABLE awedir=$awedir"
echo "$machine: AWEDIR = $awedir" >> ./build/Config.info
fi
if [ $pthread = yes ]
then
fixmakeargs="$fixmakeargs PTHREAD_AVAILABLE ptdir=$ptdir"
echo "$machine: PTDIR = $ptdir" >> ./build/Config.info
tauoptions="${tauoptions}-pthread"
fi
if [ $papithread = yes ] ; then
if [ $papi = no ] ; then
echo ""
echo "Error: To use the PAPI thread layer, you must specify -papi=<dir>"
echo ""
exit
fi
if [ ! `uname -s ` = Linux ] ; then
echo ""
echo "Error: The PAPI thread layer only works on Linux"
echo ""
exit
fi
fixmakeargs="$fixmakeargs TAU_PAPI_THREADS"
tauoptions="${tauoptions}-papithread"
fi
if [ $charm = yes ]
then
fixmakeargs="$fixmakeargs TAU_CHARM charmdir=$charmdir"
echo "$machine: CHARMDIR = $charmdir" >> ./build/Config.info
tauoptions="${tauoptions}-charm"
fi
if [ $compensate = yes ]
then
fixmakeargs="$fixmakeargs COMPENSATE"
tauoptions="${tauoptions}-compensate"
fi
if [ $muse = yes ]
then
fixmakeargs="$fixmakeargs MUSE"
tauoptions="${tauoptions}-muse"
fi
if [ $muse_event = yes ]
then
fixmakeargs="$fixmakeargs MUSE_EVENT"
tauoptions="${tauoptions}-muse_event"
fi
if [ $muse_multiple = yes ]
then
fixmakeargs="$fixmakeargs MUSE_MULTIPLE"
tauoptions="${tauoptions}-muse_multiple"
fi
if [ $sproc = yes ]
then
fixmakeargs="$fixmakeargs TAU_SPROC"
tauoptions="${tauoptions}-sproc"
fi
if [ $pcl = yes ]
then
fixmakeargs="$fixmakeargs PCL pcldir=$pcldir"
tauoptions="${tauoptions}-pcl"
fi
if [ $python = yes ]
then
fixmakeargs="$fixmakeargs PYTHON pythoninc=$pythoninc pythonlib=$pythonlib"
tauoptions="${tauoptions}-python"
if [ $machine = rs6000 -a "x$pythonlib" = "x" ]
then
echo "ERROR: For IBM systems, please specify the -pythonlib=<dir> flag where *.py files and the config directory are located!"
exit 1
fi
fi
if [ $ktau = yes ]
then
fixmakeargs="$fixmakeargs KTAU ktauinc=$ktauinc ktauincuser=$ktauincuser ktaulib=$ktaulib ktausym=$ktausym"
tauoptions="${tauoptions}-ktau"
fi
if [ $ktau_merge = yes ]
then
fixmakeargs="$fixmakeargs KTAU_MERGE ktauinc=$ktauinc ktauincuser=$ktauincuser ktaulib=$ktaulib ktausym=$ktausym"
tauoptions="${tauoptions}-ktau_merge"
fi
if [ $ktau_shctr = yes ]
then
fixmakeargs="$fixmakeargs KTAU_SHCTR ktauinc=$ktauinc ktauincuser=$ktauincuser ktaulib=$ktaulib ktausym=$ktausym"
tauoptions="${tauoptions}-ktau_shctr"
fi
if [ $vtf = yes ]
then
fixmakeargs="$fixmakeargs VTF vtfdir=$vtfdir"
fi
if [ $otf = yes ]
then
fixmakeargs="$fixmakeargs OTF otfdir=$otfdir"
if [ ! -d $otfdir/${architecture} ]
then
fixmakeargs="$fixmakeargs OTFSRC"
fi
fi
if [ $slog2 = yes ]
then
if [ $internalslog2 = yes ]
then
slog2dir=$tauroot/tools/src/contrib/slog2sdk/
if [ ! -d $slog2dir ]
then
echo "Error: Cannot access SLOG2 directory $slog2dir"
exit 1
fi
fi
fixmakeargs="$fixmakeargs SLOG2 slog2dir=$slog2dir"
if [ "x$jdkdir" = "x" ]
then
jdkdir=$JAVA_HOME
#`which javac | sed s/javac/../`
if [ "x$jdkdir" = "x" ]
then
echo "You must set the JAVA_HOME environment variable to compile the jni version of tau2slog2. Please re-configure TAU."
fi
fixmakeargs="$fixmakeargs jdkdir=$jdkdir"
fi
fi
if [ $pdt = yes ]
then
fixmakeargs="$fixmakeargs PDT pdtdir=$pdtdir"
tauoptions="${tauoptions}-pdt"
if [ $pdtcompdir != unknown ]
then
fixmakeargs="$fixmakeargs PDTARCH pdtcompdir=$pdtcompdir"
fi
if [ $pdtarchdir != unknown ]
then
fixmakeargs="$fixmakeargs PDTARCHITECTURE pdtarchdir=$pdtarchdir"
fi
if [ $pdt_cxx_compiler != default ]
then
# Check if they specified -pdt_c++=/usr/bin/g++ instead of just g++
if [ "x$pdt_cxx_full_path" != "x$pdt_cxx_compiler" ]
then
pdt_cxx_used=$pdt_cxx_full_path
else
pdt_cxx_used=$pdt_cxx_compiler
fi
fixmakeargs="$fixmakeargs PDTCXX pdtcxx=$pdt_cxx_used"
if [ $machine = sgi8k -o $machine = sgin32 -o $machine = sgi64 ]
then
if [ $pdt_cxx_compiler = CC ]
then
fixmakeargs="$fixmakeargs PDTSGICC"
fi
fi
fi
# Check if PDT has Fortran statement level information
cat <<EOF > checkpdt.cpp
#include <pdbAll.h>
int IsFortranDoStatement(pdbStmt::stmt_t k)
{
if (k == pdbStmt::ST_FDO) return 1;
else return 0;
}
EOF
if [ $machine = alpha -a $cxx_compiler = cxx ]; then
orig_useropt="$orig_useropt -x c++ -D__USE_STD_IOSTREAM"
fi
if $cxx_compiler $orig_useropt -I$pdtdir/include -c checkpdt.cpp 1> /dev/null 2>&1
then
echo "PDT supports Fortran Loop Level information"
else
echo "IMPORTANT NOTE: Your PDT does not support Fortran Loop Level information."
echo "***************You may want to upgrade to a newer release."
echo "See http://www.cs.uoregon.edu/research/pdt"
fixmakeargs="$fixmakeargs PDTNOFSTMTS"
fi
/bin/rm -f checkpdt.o checkpdt.cpp
fi
if [ $vampirtrace = yes ]; then
cat <<EOF>vttest.cpp
#include "Profile/Profiler.h"
#include "Profile/TauVampirTrace.h"
int foo(void)
{
uint64_t x;
return 0;
}
EOF
if $cxx_compiler $orig_useropt -Iinclude -I$vampirtracedir/include -c vttest.cpp -DTRACING_ON -DTAU_DOT_H_LESS_HEADERS 1> /dev/null 2>&1
then
echo "VampirTrace check successful"
else
echo "Using VampirTrace options for compiling"
fixmakeargs="$fixmakeargs VAMPIRTRACEINTS"
fi
/bin/rm -f vttest.cpp
fi
if [ $java = yes ]
then
fixmakeargs="$fixmakeargs JAVA jdkdir=$jdkdir"
fi
if [ $openmp = yes ]
then
fixmakeargs="$fixmakeargs OPENMP"
tauoptions="${tauoptions}-openmp"
fi
if [ $opari = yes ] ; then
fixmakeargs="$fixmakeargs KOJAKOPARI"
fixmakeargs="$fixmakeargs OPARI oparidir=$oparidir"
tauoptions="${tauoptions}-opari"
fi
if [ $vampirtrace = yes ]
then
fixmakeargs="$fixmakeargs VAMPIRTRACE vampirtracedir=$vampirtracedir"
tauoptions="${tauoptions}-vampirtrace"
if [ $mpi = yes ]
then
if [ $openmp = yes ]
then
fixmakeargs="$fixmakeargs VAMPIRTRACEOMPI"
else
fixmakeargs="$fixmakeargs VAMPIRTRACEMPI"
fi
else
if [ $openmp = yes ]
then
fixmakeargs="$fixmakeargs VAMPIRTRACEOMP"
fi
fi
fi
if [ $epilog = yes ]
then
if [ -f $epiloglibdir/libsz.a ]
then
epilogextralinkcmd="-lsz"
fi
if [ -f $epiloglibdir/libcubew3.a ]
then
epilogextralinkcmd="$epilogextralinkcmd#-lcubew3"
fi
if [ -f $epiloglibdir/libepk.util.a ]
then
epilogextralinkcmd="$epilogextralinkcmd#-lepk.util"
fi
if [ $scalasca = yes -a -f /usr/lib/libswclock.a ]
then
epilogextralinkcmd="$epilogextralinkcmd#-lswclock"
fi
fixmakeargs="$fixmakeargs EPILOG epilogdir=$epilogdir epiloglibdir=$epiloglibdir epilogbindir=$epilogbindir epilogextralinkcmd=$epilogextralinkcmd epilogincdir=$epilogincdir"
tauoptions="${tauoptions}-epilog"
if [ $scalasca = yes ]
then
tauoptions="${tauoptions}-scalasca"
fi
if [ $mpi = yes ]
then
if [ $openmp = yes ]
then
fixmakeargs="$fixmakeargs EPILOGOMPI"
else
fixmakeargs="$fixmakeargs EPILOGMPI"
fi
else
if [ $openmp = yes ]
then
fixmakeargs="$fixmakeargs EPILOGOMP"
fi
fi
fi
if [ $dyninst = yes ]
then
fixmakeargs="$fixmakeargs DYNINST dyninstdir=$dyninstdir"
if [ ! -d $dyninstdir/lib ]
then
fixmakeargs="$fixmakeargs DYNINST41"
fi
if [ ! -d $dyninstdir/$PLATFORM/lib/libcommon.so ] ; then
fixmakeargs="$fixmakeargs DYNINST6"
fi
if [ ! -d $dyninstdir/src/include -o ! -d $dyninstdir/include ] ; then
fixmakeargs="$fixmakeargs DYNINST5.2"
fi
fi
if [ $pcl = yes ]
then
if [ $pthread = yes -o $openmp = yes ]
then
fixmakeargs="$fixmakeargs PCLPTHREAD"
fi
fi
if [ $papi = yes ]
then
if [ $pthread = yes -o $openmp = yes ]
then
fixmakeargs="$fixmakeargs PAPIPTHREAD"
fi
fi
if [ $opari = yes ]
then
if [ $pthread = yes -o $tulipthread = yes -o $smarts = yes -o $java = yes ]
then
echo "ERROR: -opari option requires OpenMP threads package."
echo "*****************************************************"
exit 1
fi
if [ $opari_construct = yes -a $opari_region = no ]
then
fixmakeargs="$fixmakeargs OPARI_CONSTRUCT"
fi
if [ $opari_construct = no -a $opari_region = yes ]
then
fixmakeargs="$fixmakeargs OPARI_REGION"
fi
fi
if [ $tulipthread = yes ]
then
fixmakeargs="$fixmakeargs TULIPTHREADS tulipdir=$tulipdir"
echo "$machine: TULIPDIR = $tulipdir" >> ./build/Config.info
if [ $smarts = yes ]
then
fixmakeargs="$fixmakeargs SMARTS"
tauoptions="${tauoptions}-smarts"
else
tauoptions="${tauoptions}-tulip"
fi
fi
if [ $trace = yes ]
then
if [ $profile = yes ]
then
tauoptions="${tauoptions}-profile"
fi
if [ $profilestats = yes ]
then
tauoptions="${tauoptions}-profilestats"
fi
tauoptions="${tauoptions}-trace"
fi
if [ $mpitrace = yes ]
then
tauoptions="${tauoptions}-mpitrace"
fi
if [ $kai = yes ]
then
tauoptions="${tauoptions}-kcc"
fi
if [ $pgi = yes ]
then
tauoptions="${tauoptions}-pgi"
if [ $openmp = yes ]
then
fixmakeargs="$fixmakeargs PGIOPENMP"
fi
fi
if [ $intel = yes ]
then
if [ $openmp = yes ]
then
fixmakeargs="$fixmakeargs INTELOPENMP"
fi
fi
if [ $gnu = yes ]
then
if [ $openmp = yes ]
then
fixmakeargs="$fixmakeargs GNUOPENMP"
fi
fi
if [ $fortran_compiler = intel ] ; then
intelifort=`which ifort 2>/dev/null`
if [ "y$intelifort" != "y" ] ; then
if [ -x $intelifort ]
then
echo "Using Intel ifort as the Fortran Compiler"
fixmakeargs="$fixmakeargs INTELIFORT"
fi
fi
fi
# CHECK if Intel 8.0 compilers are available.
if [ $cxx_compiler = icpc ] ; then
echo "Checking version (8.0/8.1+) of Intel compilers"
# Intel compilers changed from -cxxlib-icc to -cxxlib-gcc (default) in 8.1
cat << EOF > f1.cpp
#include <iostream>
using namespace std;
extern "C" {
void foo(int *x) {
cout << "x = "<<*x<<endl;
}
}
EOF
cat << EOF > f2.c
int foo();
int main(int argc, char **argv) {
return foo();
}
EOF
$cxx_compiler -c f1.cpp
icc -c f2.c
if icc f1.o f2.o -o foo -lcprts 1>/dev/null 2>&1 ; then
echo "Intel v8.0 compilers used"
else
$cxx_compiler -c -cxxlib-icc f1.cpp 1>/dev/null 2>&1
$cxx_compiler -c f1.cpp
tau_opt_bits=
if [ `uname -m` = x86_64 -a $machine = i386_linux ]; then
# if someone is using the 32-bit intel compilers on an x86_64
# then we need to use -m32 with g++ to get the 32-bit libstdc++
tau_opt_bits=-m32
fixmakeargs="$fixmakeargs INTEL32_ON_64"
fi
taugcclibdir=`g++ $tau_opt_bits -print-libgcc-file-name | sed -e 's,[^/]*$,,'`
taugcclib=`g++ $tau_opt_bits -print-libgcc-file-name `
taugcclib2dir=`which g++ | sed s/g++/../`
if icc f1.o f2.o -o foo -L$taugcclib2dir/lib -L$taugcclibdir -lstdc++ $taugcclib 1>/dev/null 2>&1 ; then
# echo "Confirmed - links with gcc libs"
echo "Intel v8.1+ compilers used"
if [ "x$taugcclib2dir" != "x/usr/bin/../lib" ] ; then
if [ "x$machine" = "xx86_64" ] ; then
tauextralibopts="taugcclibopts=-L$taugcclib2dir/lib64"
else
tauextralibopts="taugcclibopts=-L$taugcclib2dir/lib"
fi
# Here a different version of gcc is used (other than the one installed in /usr/bin)
fi
fixmakeargs="$fixmakeargs $tauextralibopts taugcclibdir=$taugcclibdir INTEL81FIX"
fi
fi
/bin/rm -f f1.o f2.o f1.cpp f2.c foo
# Check over!
fi
if [ $fortran_compiler = intel ] ; then
intelifort=`which ifort 2>/dev/null`
if [ "y$intelifort" != "y" ] ; then
if [ -x $intelifort ] ; then
echo "Checking version (10.0+) of Intel compilers"
ifort -v 2>&1 | grep "Version 10" > /dev/null
if [ $? = 0 ] ; then
echo "Intel v10.0+ compilers used"
fixmakeargs="$fixmakeargs INTEL10FIX COMPINST_GNU"
fi
fi
fi
fi
if [ $ibmxlc = yes ]
then
if [ $openmp = yes ]
then
fixmakeargs="$fixmakeargs IBMXLC_OPENMP"
fi
fi
if [ $machine = hitachi ]
then
if [ $openmp = yes ]
then
fixmakeargs="$fixmakeargs HITACHI_OPENMP"
fi
fi
if [ $cxx_compiler = cxx ]
then
if [ $openmp = yes ]
then
fixmakeargs="$fixmakeargs COMPAQCXX_OPENMP"
fi
if [ $pthread = yes ]
then
fixmakeargs="$fixmakeargs COMPAQCXX_PTHREAD"
fi
fi
if [ $fujitsu = yes ]
then
tauoptions="${tauoptions}-fujitsu"
fi
if [ $disableshared = yes ]
then
fixmakeargs="$fixmakeargs NOSHARED"
fi
if [ $noex = yes ]
then
tauoptions="${tauoptions}-noex"
if [ $kai = yes ]
then
fixmakeargs="$fixmakeargs KAINOEX"
else
# OTHER COMPILERS NO EXCEPTIONS... SGICC needs this
fixmakeargs="$fixmakeargs SGICCNOEX"
fi
fi
#### END OF TAU OPTIONS. Make changes above this line
fixmakeargs="$fixmakeargs tauoptions=$tauoptions"
if [ $lwp = yes ]
then
fixmakeargs="$fixmakeargs LWP_AVAILABLE"
fi
if [ $task = yes ]
then
if [ -d XtraP ]
then
XtraPRoot=${tauroot}/XtraP
if [ $machine != default ]
then
echo \#define XTRAPROOT \"$XtraPRoot\"> ${XtraPRoot}/include/XtraPRoot.h
fixmakeargs="$fixmakeargs TASK_AVAILABLE"
else
echo \#define XTRAPROOT \"\" > ${XtraPRoot}/include/XtraPRoot.h
fi
fi
fi
if [ $use_pcxx = yes ]
then
fixmakeargs="$fixmakeargs PCXX sage1dir=$sage1dir"
fi
if [ $use_hpcxx = yes ]
then
fixmakeargs="$fixmakeargs HPCXX"
fi
if [ $use_ansic = yes ]
then
fixmakeargs="$fixmakeargs ANSIC"
fi
if [ $use_sage2 = yes ]
then
fixmakeargs="sage2dir=$sage2dir $fixmakeargs"
fi
if [ $tcltk = yes ]
then
fixmakeargs="$fixmakeargs TCLTK"
fi
if [ $sicortex = yes ] ; then
fixmakeargs="$fixmakeargs SICORTEX extrashlibopts=${sicortexlink}"
fi
configure_java
if [ ${tauprefix} = unknown ] ; then
targetdir=${tauroot}
else
targetdir=${tauprefix}
if [ ! -d ${tauprefix} ] ; then
echo "making directory $tauprefix "
mkdir -p ${tauprefix}
# Copy INSTALL README LICENSE files over there
cp README LICENSE CREDITS ${tauprefix}
fi
if [ ! -d ${tauprefix}/${architecture} ] ; then
echo "making directory $tauprefix/$architecture lib bin"
mkdir ${tauprefix}/${architecture}
mkdir ${tauprefix}/${architecture}/lib
mkdir ${tauprefix}/${architecture}/bin
else
if [ "x$architecture" = "x" ] ; then
echo "making directory $tauprefix lib bin"
if [ ! -d ${tauprefix}/bin ] ; then
mkdir ${tauprefix}/bin
fi
if [ ! -d ${tauprefix}/lib ] ; then
mkdir ${tauprefix}/lib
fi
fi
fi
fi
BINTARGET=${targetdir}/${architecture}/bin
JARTARGET=${targetdir}/${architecture}/lib
# Install tau_compiler.sh
if [ ! -f /bin/bash ] ; then
bashpath=`which bash`
if [ ! -f $bashpath ] ; then
echo "ERROR: You need a working bash shell in your path to use tau_compiler.sh"
echo "Please add bash to your path and re-run configure."
echo "**************************************************"
else
cat ${tauroot}/tools/src/tau_compiler.sh | sed -e 's#/bin/bash#'$bashpath'#' > $BINTARGET/tau_compiler.sh
fi
else
cp ${tauroot}/tools/src/tau_compiler.sh $BINTARGET
fi
echo "TAU: installed tau_compiler.sh in $BINTARGET"
cp ${tauroot}/tools/src/tau_treemerge.pl $BINTARGET
cp ${tauroot}/tools/src/tauex $BINTARGET
cp ${tauroot}/tools/src/taucc $BINTARGET
cp ${tauroot}/tools/src/taucxx $BINTARGET
cp ${tauroot}/tools/src/tauf90 $BINTARGET
cp ${tauroot}/tools/src/tauex.multiple $BINTARGET
cp ${tauroot}/tools/src/tau_cxx.sh $BINTARGET
cp ${tauroot}/tools/src/tau_cc.sh $BINTARGET
cp ${tauroot}/tools/src/tau_f90.sh $BINTARGET
cp ${tauroot}/tools/src/contrib/tcollect10.ini $BINTARGET
# Copy over tau_load.sh
if [ $mpi = yes ]
then
cat ${tauroot}/tools/src/tau_load.sh | sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@ARCH@,'$architecture',' > ${targetdir}/${architecture}/bin/tau_load.sh
chmod a+rx ${targetdir}/${architecture}/bin/tau_load.sh
echo "TAU: installed tau_load.sh in ${targetdir}/${architecture}/bin"
fi
if [ $ibmmpi = yes ]
then
cat ${tauroot}/tools/src/tau_poe | sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@ARCH@,'$architecture',' > ${targetdir}/${architecture}/bin/tau_poe
chmod a+rx ${targetdir}/${architecture}/bin/tau_poe
echo "TAU: installed tau_poe in ${targetdir}/${architecture}/bin"
fi
cp ${tauroot}/tools/src/jtau_tf/bin/TAU_tf.jar ${targetdir}/${architecture}/lib
echo "TAU: installed Java trace reader/writer api in ${targetdir}/${architecture}/lib"
#if [ $trace = yes ]
#then
cat ${tauroot}/tools/src/contrib/slog2sdk/bin/jumpshot.skel |
sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' > ${targetdir}/${architecture}/bin/jumpshot
chmod a+rx ${targetdir}/${architecture}/bin/jumpshot
cat ${tauroot}/tools/src/contrib/slog2sdk/bin/slog2print.skel |
sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' > ${targetdir}/${architecture}/bin/slog2print
chmod a+rx ${targetdir}/${architecture}/bin/slog2print
cat ${tauroot}/tools/src/tau2slog2/bin/tau2slog2.skel |
sed -e 's,@OLDJDK@,'$oldjdk',' -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' > ${targetdir}/${architecture}/bin/tau2slog2
chmod a+rx ${targetdir}/${architecture}/bin/tau2slog2
echo "TAU: installed tau2slog2, slog2print and jumpshot in ${targetdir}/${architecture}/bin"
cp ${tauroot}/tools/src/contrib/slog2sdk/lib/jumpshot.jar ${targetdir}/${architecture}/lib
cp ${tauroot}/tools/src/contrib/slog2sdk/lib/traceTOslog2.jar ${targetdir}/${architecture}/lib
cp ${tauroot}/tools/src/contrib/slog2sdk/lib/slog2printserial.jar ${targetdir}/${architecture}/lib
cp ${tauroot}/tools/src/tau2slog2/bin/tau2slog2.jar ${targetdir}/${architecture}/lib
echo "TAU: installed required slog2sdk jars in ${targetdir}/${architecture}/lib"
#fi
if [ $slog2 = yes ]
then
if [ $internalslog2 = yes ]
then
cat ${tauroot}/tools/src/contrib/slog2sdk/bin/jumpshot.skel |
sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' > ${targetdir}/${architecture}/bin/jumpshot
chmod a+rx ${targetdir}/${architecture}/bin/jumpshot
cat ${tauroot}/tools/src/contrib/slog2sdk/bin/slog2print.skel |
sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' > ${targetdir}/${architecture}/bin/slog2print
chmod a+rx ${targetdir}/${architecture}/bin/slog2print
echo "TAU: installed slog2print and jumpshot in ${targetdir}/${architecture}/bin"
cp ${tauroot}/tools/src/contrib/slog2sdk/lib/jumpshot.jar ${targetdir}/${architecture}/lib
cp ${tauroot}/tools/src/contrib/slog2sdk/lib/traceTOslog2.jar ${targetdir}/${architecture}/lib
cp ${tauroot}/tools/src/contrib/slog2sdk/lib/slog2printserial.jar ${targetdir}/${architecture}/lib
echo "TAU: installed required slog2sdk jars in ${targetdir}/${architecture}/lib"
slog2dir=$targetdir/$architecture
fi
utils/slogconverter/tau2slog2.skel $jdkdir $targetdir $slog2dir $architecture > $targetdir/$architecture/bin/tau2slog2JNI
chmod a+rx ${targetdir}/${architecture}/bin/tau2slog2JNI
echo "TAU: installed tau2slog2JNI in ${targetdir}/${architecture}/bin"
fi
cat ${tauroot}/tools/src/tau-config.in |
sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' \
> ${targetdir}/${architecture}/bin/tau-config
chmod a+rx ${targetdir}/${architecture}/bin/tau-config
echo "TAU: installed tauinc.pl in ${targetdir}/${architecture}/bin"
cp ${tauroot}/tools/src/tauinc.pl ${targetdir}/${architecture}/bin
chmod a+rx ${targetdir}/${architecture}/bin/tauinc.pl
configure_perfexplorer
cat ${tauroot}/tools/src/TauIL/bin/tau_analyze.skel |
sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' \
> ${targetdir}/${architecture}/bin/tau_analyze
chmod a+rx ${targetdir}/${architecture}/bin/tau_analyze
echo "TAU: installed tau_analyze in ${targetdir}/${architecture}/bin"
cat ${tauroot}/tools/src/TauIL/Makefile.inc.skel |
sed -e 's,@TAUROOTDIR@,'$tauroot',' \
> ${tauroot}/tools/src/TauIL/Makefile.inc
echo "TAU: installed Makefile.inc in ${tauroot}/tools/src/TauIL"
cp ${tauroot}/tools/src/TauIL/bin/*.jar ${targetdir}/${architecture}/lib
echo "TAU: installed TauIL and supporting jars in ${targetdir}/${architecture}/lib"
cp ${tauroot}/tools/src/tau_throttle.sh ${targetdir}/${architecture}/bin
echo "TAU: installed tau_throttle script"
wishname=wish
tk_path="/usr/local/bin/tkman"
# -- set name of remote shell command
if [ $machine = "hp9000s700" -o $machine = "hp9000s800" ]
then
remotesh=remsh
else
remotesh=rsh
fi
# -- now install the TAU tools
#TAUTOOLS="tau taud fancy classy cagey racy dandy cosy dumpy speedy handy spiffy"
# TAU Portable profiling package just needs racy
TAUTOOLS="taud racy"
echo " "
echo "TAU: installing tools in ${tauroot}/${architecture}/bin"
for tool in $TAUTOOLS ; do
rm -f ${tauroot}/${architecture}/bin/$tool
cat ${tauroot}/tools/tool.skel |
sed -e 's,@TAUROOT@,'$targetdir',' -e 's,@ARCH@,'$architecture',' -e 's,@TOOL@,'$tool',' \
-e 's,@REMSH@,'$remotesh',' -e 's,@TKMANPATH@,'$tk_path',' \
-e 's,@WISHNAME@,'$wishname',' \
> ${targetdir}/${architecture}/bin/${tool}
chmod a+rx ${targetdir}/${architecture}/bin/${tool}
done
if [ $use_pcxx = yes ]
then
$echo "TAU: installing breezy... ${nnl}"
rm -f ${tauroot}/bin/${architecture}/breezy
cat lang_support/pc++/breezy/userAgent/tool.skel |
sed -e 's,@TAUROOT@,'${tauroot}',' -e 's,@ARCH@,'${architecture}',' -e 's,@TOOL@,'breezy',' \
> ${tauroot}/bin/${architecture}/breezy
chmod a+rx ${tauroot}/bin/${architecture}/breezy
echo "done"
if [ $tcltkfile = "/" ]
then
echo ""
echo "For compiling the breezy user interface, we need the very"
echo "site-specific locations for header files and libraries for"
echo "X11 and Tcl/Tk. Typing <return> after the questions will use"
echo "the specified default locations in brackets."
echo ""
echo "Options for including Tcl/Tk headers [-I/usr/local/include]"
$echo "? ${nnl}"
read tcltkheader
if [ "x$tcltkheader" = "x" ]; then tcltkheader="-I/usr/local/include"; fi
foo="`echo $tcltkheader | sed -e 's/-I/-L/' -e 's/include/lib/'` -ltk4.0 -ltcl7.4"
echo "Options for linking Tcl/Tk [$foo]"
$echo "? ${nnl}"
read tcltklib
if [ "x$tcltklib" = "x" ]; then tcltklib="$foo"; fi
echo "Options for including X11 headers [-I/usr/include]"
$echo "? ${nnl}"
read x11header
if [ "x$x11header" = "x" ]; then x11header="-I/usr/include"; fi
foo="`echo $x11header | sed -e 's/-I/-L/' -e 's/include/lib/'` -lX11"
echo "Options for linking X11 [$foo]"
$echo "? ${nnl}"
read x11lib
if [ "x$x11lib" = "x" ]; then x11lib="$foo"; fi
echo ""
else
echo "TAU: using make info from file $tcltkfile"
. $tcltkfile
fi
sed -e 's,^TCLTKHEADER =.*$,TCLTKHEADER = '"$tcltkheader"',' \
-e 's,^X11HEADER =.*$,X11HEADER = '"$x11header"',' \
-e 's,^X11LIB =.*$,X11LIB = '"$x11lib"',' \
-e 's,^TCLTKLIB =.*$,TCLTKLIB = '"$tcltklib"',' \
lang_support/pc++/breezy/userAgent/Makefile > tmpmake
mv tmpmake lang_support/pc++/breezy/userAgent/Makefile
fi # if breezy
if [ $use_hpcxx = yes ]
then
# Fix the file info for preprocessor in lang_support/hpc++/include-clean
sed -e 's,^#1 ".*/lang_support/hpc++/include/hpc++.h",'#1\ \"$tauroot/lang_support/hpc++/include/hpc++.h\"',' lang_support/hpc++/include-clean/hpc++.h > tmplib
mv tmplib lang_support/hpc++/include-clean/hpc++.h
fi
# Save the FixMakefile args
# Clear any old data
grep "^#" ./utils/FixMakefile.info > ./utils/FixMakefile.info~~0
/bin/mv ./utils/FixMakefile.info~~0 ./utils/FixMakefile.info
echo $fixmakeargs >> ./utils/FixMakefile.info
# Now FINALLY FixMakefile with the string I have built
utils/FixMakefile $fixmakeargs
# Use default setups, forget everything else (PHB)
if [ $machine = default ]
then
/bin/cp ./utils/FixMakefile.sed.default ./utils/FixMakefile.sed
/bin/cp ./utils/FixMakefile.info.default ./utils/FixMakefile.info
/bin/cp ./build/Config.info.default ./build/Config.info
fi
sedout="./utils/FixMakefile.sed"
echo "Applying script to all Makefiles, please wait, this may take a while..."
# Change back to $START_DIR (defined at the top) to ensure we're in the tau2 directory
# before we execute this fairly dangerous 'find' command
cd $START_DIR
for i in `find . -name Makefile -print `
#for i in $tauroot/include/Makefile $tauroot/src/Profile/Makefile $tauroot/utils/Makefile $tauroot/Makefile
do
$echo ".${nnl}"
sed -f $sedout < ${i} > ${i}~~0
mv ${i}~~0 ${i}
done
echo .
if [ $tauprefix != unknown ]
then
echo "TAU: Copying include directory to ${tauprefix}"
cp -r include ${tauprefix}
echo "TAU: Copying man directory to ${tauprefix}"
cp -r man ${tauprefix}
fi
# Attempt to install metatext (jev)
if [ -f ./metatext/configure ]
then
cd ./metatext
./configure 1> /dev/null 2>&1
cd ..
fi
#############################################################################
# Set up TAU-specific build system
echo " "
echo "Configuring TAU Build scripts..."
# -- Save C++ compiler, C compiler, and USEROPT for pC++
if [ $use_pcxx = yes ]
then
echo "$machine: pcxx_root = $sage1dir" >> \
./build/pc++/Config.info
echo "$machine: pcxx_cxx = $cxx_compiler" >> \
./build/pc++/Config.info
echo "$machine: pcxx_cc = $c_compiler" >> \
./build/pc++/Config.info
opt=`echo $useropt | sed -e 's/_/ /g'`
echo "$machine: pcxx_useropt = $opt" >> \
./build/pc++/Config.info
echo "" >> ./build/pc++/Config.info
fi
# -- Save C++ compiler, C compiler, and USEROPT for HPC++
if [ $use_hpcxx = yes ]
then
opt=`echo $useropt | sed -e 's/_/ /g'`
echo "$machine: hpcxx_useropt = $opt" >> \
./build/hpc++/Config.info
echo "$machine: hpcxx_sage1 = $sage1dir" >> \
./build/hpc++/Config.info
echo "$machine: hpcxx_sage2 = $sage2dir" >> \
./build/hpc++/Config.info
echo "$machine: hpcxx_pstl = $pstldir" >> \
./build/hpc++/Config.info
echo "$machine: hpcxx_hpnx = $hpnxdir" >> \
./build/hpc++/Config.info
echo "" >> ./build/hpc++/Config.info
fi
# Modify the Makefiles so include/Makefile is replaced by the TAU options
# for specific examples
echo "s@include \(.*\)TAUROOTDIR\(.*\)@include $\(TAUROOTDIR\)/$architecture/lib/Makefile.tau$tauoptions@g" > utils/sedexamples.out
#echo "s@include/Makefile@$machine/lib/Makefile.tau$tauoptions@g" >utils/sedexamples.out
sedex="./utils/sedexamples.out"
echo "Modifying Makefiles in the examples subdirectory..."
# Prefix start from examples directory
pr=examples
exampleslist="instrument/Makefile mapping/embedded/Makefile \
mapping/external/Makefile fork/Makefile selectiveAccess/Makefile"
if [ $fortran_compiler != no ]
then
exampleslist="$exampleslist fortran/Makefile f90/Makefile"
fi
# Rules for adding examples follow...
# If PDT is specified, then modify the following makefiles
if [ $pdt = yes ]
then
exampleslist="$exampleslist autoinstrument/Makefile reduce/Makefile cinstrument/Makefile"
if [ $fortran_compiler != no ]
then
exampleslist="$exampleslist selective/Makefile"
fi
fi
# If PDT is specified WITH MPI
if [ $pdt = yes -a $mpi = yes ]
then
exampleslist="$exampleslist pdt_mpi/c++/Makefile pdt_mpi/c/Makefile"
if [ $pthread = yes ]
then
exampleslist="$exampleslist mixedmode/Makefile"
fi
if [ $fortran_compiler != no ]
then
exampleslist="$exampleslist pdt_mpi/f90/Makefile"
fi
fi
if [ $mpi = yes ]
then
exampleslist="$exampleslist pi/Makefile mpishlib/Makefile"
if [ $fortran_compiler != no ]
then
exampleslist="$exampleslist NPB2.3/config/make.def"
fi
if [ $openmp = yes ]
then
exampleslist="$exampleslist openmpi/Makefile"
fi
fi
if [ $opari = yes ]
then
exampleslist="$exampleslist opari/c++/Makefile"
if [ $pdt = yes -a $fortran_compiler != no ]
then
exampleslist="$exampleslist opari/pdt_f90/Makefile"
fi
if [ $mpi = yes ]
then
exampleslist="$exampleslist opari/openmpi/Makefile"
fi
fi
if [ $trace = yes ]
then
exampleslist="$exampleslist traceinput/c++/Makefile traceinput/c/Makefile"
fi
if [ $callpath = yes ]
then
exampleslist="$exampleslist callpath/Makefile"
fi
if [ $python = yes -o $java = yes -o $dyninst = yes ]
then
# RESET the exampleslist, the C, C++, F90 examples don't matter!
exampleslist=""
fi
if [ $pthread = yes ]
then
exampleslist="$exampleslist threads/Makefile cthreads/Makefile"
fi
if [ $sproc = yes ]
then
exampleslist="$exampleslist sproc/Makefile"
fi
if [ $papi = yes -o $pcl = yes ]
then
exampleslist="$exampleslist papi/Makefile multicounter/Makefile"
if [ $pthread = yes ]
then
exampleslist="$exampleslist papithreads/Makefile"
fi
fi
######################################################################
# If the default gcc/g++ is not used, Modify the Makefiles...
# Choose the c++ and cc compiler
# Modify the Makefiles only if prefix is not specified.
if [ $tauprefix = unknown ]
then
for i in $exampleslist
do
$echo ".${nnl}"
sed -f $sedex < $pr/${i} > $pr/${i}~~0
mv $pr/${i}~~0 $pr/${i}
done
# Copy over the Makefile so make clean works
cp include/Makefile $machine/lib/Makefile.tau$tauoptions
fi
echo .
# If it is default, restore to original state
if [ "y$1" = "ydefault" ]
then
echo "Fixing examples Makefiles..."
echo "s@include \(.*\)TAUROOTDIR\(.*\)@include $\(TAUROOTDIR\)/include/Makefile@g" >utils/sedexamples.out
sedex="./utils/sedexamples.out"
for i in `find examples -name Makefile -print` examples/NPB2.3/config/make.def
do
$echo ".${nnl}"
sed -f $sedex < ${i} > ${i}~~0
mv ${i}~~0 ${i}
done
fi
if [ $perf = yes ]
then
cp include/Makefile $tautoplevel/$architecture/lib/Makefile.tau$tauoptions
fi
if [ $slog2 = yes ]
then
/bin/rm -f utils/slogconverter/trace_impl.h
utils/slogconverter/slogtest $jdkdir > utils/slogconverter/trace_impl.h
fi
if [ $tauprefix != unknown ]
then
cp -r examples ${tauprefix}
cp .all_configs .last_config ${tauprefix}
fi
# bye bye
echo
echo "Configuration complete!"
if [ $tauprefix != unknown ]
then
echo " Please add " $tauprefix/$architecture/bin " to your path"
else
echo " Please add " $tauroot/$architecture/bin " to your path"
fi
echo ' Type "make install" to begin compilation'
exit 0
|