Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 572624318f
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 1065 lines (944 sloc) 28.903 kb
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
define([libint_mmm_version],[2.0.0])
define([libint_buildid],[stable])
define([libint_so_version],[2:0:0])

dnl --------- Begin ---------
dnl Process this file with autoconf to produce a configure script.
define([AC_CACHE_LOAD], )dnl for debugging configure.in
define([AC_CACHE_SAVE], )dnl for debugging configure.in
AC_PREREQ(2.57)
AC_INIT([Libint2],[libint_mmm_version],[libint@valeyev.net],[libint2])
AC_CONFIG_SRCDIR(src/bin/libint/rr.h)
AC_CONFIG_HEADER(include/libint2_config.h)
AC_CONFIG_AUX_DIR(bin)
AC_CONFIG_MACRO_DIR([config])

dnl --- Compiling C++ only ---
AC_LANG(C++)

AC_CANONICAL_TARGET
AC_DEFINE_UNQUOTED(LIBINT_HOST_ARCH, "$host")
AC_DEFINE_UNQUOTED(LIBINT_TARGET_ARCH, "$target")

define([default_prefix_dash],ifelse(libint_buildid, ,[],[-]))
define([default_prefix],"/usr/local")

LIBINT_MMM_VERSION=libint_mmm_version
LIBINT_BUILDID=libint_buildid
AC_SUBST(LIBINT_MMM_VERSION)
AC_SUBST(LIBINT_BUILDID)
changequote(<<, >>)dnl
LIBINT_MAJOR_VERSION=`echo $LIBINT_MMM_VERSION|sed 's/\([0-9]*\)\.[0-9]*\.[0-9]*/\1/'`
LIBINT_MINOR_VERSION=`echo $LIBINT_MMM_VERSION|sed 's/[0-9]*\.\([0-9]*\)\.[0-9]*/\1/'`
LIBINT_MICRO_VERSION=`echo $LIBINT_MMM_VERSION|sed 's/[0-9]*\.[0-9]*\.\([0-9]*\)/\1/'`
changequote([, ])dnl
AC_DEFINE_UNQUOTED(LIBINT_MAJOR_VERSION,$LIBINT_MAJOR_VERSION)
AC_DEFINE_UNQUOTED(LIBINT_MINOR_VERSION,$LIBINT_MINOR_VERSION)
AC_DEFINE_UNQUOTED(LIBINT_MICRO_VERSION,$LIBINT_MICRO_VERSION)
AC_SUBST(LIBINT_MAJOR_VERSION)
AC_SUBST(LIBINT_MINOR_VERSION)
AC_SUBST(LIBINT_MICRO_VERSION)


LIBINT_SO_VERSION=libint_so_version
AC_SUBST(LIBINT_SO_VERSION)

dnl --------- Features ---------

AC_ARG_WITH(api-prefix,
[ --with-api-prefix Prepend this string to every name in the library API (except for the types).],
[
AC_DEFINE_UNQUOTED(LIBINT_API_PREFIX,"$withval")
echo Using API prefix: $withval
])

LIBINT_CGSHELL_ORDERING_STANDARD=1 AC_SUBST(LIBINT_CGSHELL_ORDERING_STANDARD)
LIBINT_CGSHELL_ORDERING_INTV3=2 AC_SUBST(LIBINT_CGSHELL_ORDERING_INTV3)
LIBINT_CGSHELL_ORDERING_GAMESS=3 AC_SUBST(LIBINT_CGSHELL_ORDERING_GAMESS)
LIBINT_CGSHELL_ORDERING_ORCA=4 AC_SUBST(LIBINT_CGSHELL_ORDERING_ORCA)
libint_cgshell_ordering=standard
AC_ARG_WITH(cartgauss-ordering,
[ --with-cartgauss-ordering Use one of the following known orderings for shells of cartesian Gaussians:
                               standard -- standard ordering (xxx, xxy, xxz, xyy, xyz, xzz, yyy, ...)
                               intv3 -- intv3 ordering (yyy, yyz, yzz, zzz, xyy, xyz, xzz, xxy, xxz, xxx)
                               gamess -- GAMESS ordering (xxx, yyy, zzz, xxy, xxz, yyx, yyz, zzx, zzy, xyz)
                               orca -- ORCA ordering (hydrid between GAMESS and standard)
                               The default is standard.],
[
libint_cgshell_ordering=$withval
])
AC_MSG_RESULT([Using $libint_cgshell_ordering ordering of cartesian Gaussians])
case $libint_cgshell_ordering in
  standard)
    libint_cgshell_ordering=$LIBINT_CGSHELL_ORDERING_STANDARD
  ;;
  intv3)
    libint_cgshell_ordering=$LIBINT_CGSHELL_ORDERING_INTV3
  ;;
  gamess)
    libint_cgshell_ordering=$LIBINT_CGSHELL_ORDERING_GAMESS
  ;;
  orca)
    libint_cgshell_ordering=$LIBINT_CGSHELL_ORDERING_ORCA
  ;;
  *)
    AC_MSG_ERROR([Invalid value for --with-cartgauss-ordering ($withval)])
  ;;
esac
AC_DEFINE_UNQUOTED(LIBINT_CGSHELL_ORDERING,$libint_cgshell_ordering)
AC_DEFINE_UNQUOTED(LIBINT_CGSHELL_ORDERING_STANDARD,$LIBINT_CGSHELL_ORDERING_STANDARD)
AC_DEFINE_UNQUOTED(LIBINT_CGSHELL_ORDERING_INTV3,$LIBINT_CGSHELL_ORDERING_INTV3)
AC_DEFINE_UNQUOTED(LIBINT_CGSHELL_ORDERING_GAMESS,$LIBINT_CGSHELL_ORDERING_GAMESS)
AC_DEFINE_UNQUOTED(LIBINT_CGSHELL_ORDERING_ORCA,$LIBINT_CGSHELL_ORDERING_ORCA)

LIBINT_SHELL_SET_STANDARD=1 AC_SUBST(LIBINT_SHELL_SET_STANDARD)
LIBINT_SHELL_SET_ORCA=2 AC_SUBST(LIBINT_SHELL_SET_ORCA)
libint_shell_set=standard
AC_ARG_WITH(shell-set,
[ --with-shell-set The library will support computation of shell sets sets subject to these restrictions:
                               standard -- standard ordering:
                                           for (ab|cd):
                                           l(a) >= l(b),
                                           l(c) >= l(d),
                                           l(a)+l(b) <= l(c)+l(d)
                                           for (b|cd):
                                           l(c) >= l(d)
                               orca -- ORCA ordering:
                                           for (ab|cd):
                                           l(a) <= l(b),
                                           l(c) <= l(d),
                                           l(a) < l(c) || (l(a) == l(c) && l(b) < l(d))
                                           for (b|cd):
                                           l(c) <= l(d)
                               The default is standard.],
[
libint_shell_set=$withval
])
AC_MSG_RESULT([Will generate $libint_shell_set shell quartet sets])
case $libint_shell_set in
  standard)
    libint_shell_set=$LIBINT_SHELL_SET_STANDARD
  ;;
  orca)
    libint_shell_set=$LIBINT_SHELL_SET_ORCA
  ;;
  *)
    AC_MSG_ERROR([Invalid value for --with-shell-set ($withval)])
  ;;
esac
LIBINT_SHELL_SET=$libint_shell_set AC_SUBST(LIBINT_SHELL_SET)
AC_DEFINE_UNQUOTED(LIBINT_SHELL_SET,$libint_shell_set)
AC_DEFINE_UNQUOTED(LIBINT_SHELL_SET_STANDARD,$LIBINT_SHELL_SET_STANDARD)
AC_DEFINE_UNQUOTED(LIBINT_SHELL_SET_ORCA,$LIBINT_SHELL_SET_ORCA)

AC_ARG_ENABLE(debug,
[ --enable-debug Compile with debugging options],
[
case $enableval in
  yes)
    DEBUG=yes
  ;;
  no)
    DEBUG=no
  ;;
  opt)
    DEBUG=opt
  ;;
  *)
    AC_MSG_ERROR([Invalid value for --enable-debug ($enableval)])
  ;;
esac
],[
    DEBUG=no
]
)

# can be used in the future to exclude source directories
EXCLUDED_DIRS=

#AC_ARG_ENABLE(1body,
#[ --enable-1body=N Compile with support for up to N-th derivatives of 1-body integrals],
#[
#case $enableval in
# yes)
# INCLUDE_ONEBODY=0
# ;;
# no)
# INCLUDE_ONEBODY=no
# ;;
# *)
# if test $enableval -lt 0; then
# AC_MSG_ERROR([Invalid value for --enable-1body ($enableval)])
# fi
# INCLUDE_ONEBODY=$enableval
# ;;
#esac
#],[
# INCLUDE_ONEBODY=0
#]
#)

AC_ARG_ENABLE(eri,
[ --enable-eri=N Compile with support for up to N-th derivatives of electron repulsion integrals],
[
case $enableval in
  yes)
    INCLUDE_ERI=0
  ;;
  no)
    INCLUDE_ERI=no
  ;;
  *)
    if test $enableval -lt 0; then
      AC_MSG_ERROR([Invalid value for --enable-eri ($enableval)])
    fi
    INCLUDE_ERI=$enableval
  ;;
esac
],[
    INCLUDE_ERI=0
]
)

AC_ARG_ENABLE(eri3,
[ --enable-eri3=N Compile with support for up to N-th derivatives of 3-center electron repulsion integrals],
[
case $enableval in
  yes)
    INCLUDE_ERI3=0
  ;;
  no)
    INCLUDE_ERI3=no
  ;;
  *)
    if test $enableval -lt 0; then
      AC_MSG_ERROR([Invalid value for --enable-eri3 ($enableval)])
    fi
    INCLUDE_ERI3=$enableval
  ;;
esac
],[
    INCLUDE_ERI3=0
]
)

AC_ARG_ENABLE(eri2,
[ --enable-eri3=N Compile with support for up to N-th derivatives of 2-center electron repulsion integrals],
[
case $enableval in
  yes)
    INCLUDE_ERI2=0
  ;;
  no)
    INCLUDE_ERI2=no
  ;;
  *)
    if test $enableval -lt 0; then
      AC_MSG_ERROR([Invalid value for --enable-eri2 ($enableval)])
    fi
    INCLUDE_ERI2=$enableval
  ;;
esac
],[
    INCLUDE_ERI2=0
]
)

AC_ARG_ENABLE(g12,
[ --enable-g12=N Compile with support for N-th derivatives of MP2-F12 energies with Gaussian factors],
[
case $enableval in
  yes)
    INCLUDE_G12=0
  ;;
  no)
    INCLUDE_G12=no
  ;;
  *)
    if test $enableval -lt 0; then
      AC_MSG_ERROR([Invalid value for --enable-g12 ($enableval)])
    fi
    INCLUDE_G12=$enableval
  ;;
esac
],[
    INCLUDE_G12=no
]
)

AC_ARG_ENABLE(g12dkh,
[ --enable-g12dkh=N Compile with support for N-th derivatives of DKH-MP2-F12 energies with Gaussian factors],
[
case $enableval in
  yes)
    INCLUDE_G12DKH=0
  ;;
  no)
    INCLUDE_G12DKH=no
  ;;
  *)
    if test $enableval -lt 0; then
      AC_MSG_ERROR([Invalid value for --enable-g12dkh ($enableval)])
    fi
    INCLUDE_G12DKH=$enableval
  ;;
esac
],[
    INCLUDE_G12DKH=no
]
)

LIBINT_MAX_AM=4
AC_ARG_WITH(max-am,
[ --with-max-am=N Support Gaussians of angular momentum up to N.],
if test $withval -le 0; then
  AC_MSG_ERROR([Invalid value for --with-max-am ($withval)])
else
  LIBINT_MAX_AM=$withval
fi
if test $LIBINT_MAX_AM -ge 8; then
  AC_MSG_ERROR([Value for --with-max-am too high ($withval). Are you sure you know what you are doing?])
fi
)
LIBINT_OPT_AM=$((($LIBINT_MAX_AM/2)+1))
AC_ARG_WITH(opt-am,
[ --with-opt-am=N Optimize maximally for up to angular momentum N (N <= max-am).],
if test $withval -le $LIBINT_MAX_AM; then
  LIBINT_OPT_AM=$withval
fi
)
AC_SUBST(LIBINT_MAX_AM)
AC_SUBST(LIBINT_OPT_AM)
AC_DEFINE_UNQUOTED(LIBINT_MAX_AM,$LIBINT_MAX_AM)
AC_DEFINE_UNQUOTED(LIBINT_OPT_AM,$LIBINT_OPT_AM)


ERI_MAX_AM=$LIBINT_MAX_AM
AC_ARG_WITH(eri-max-am,
[ --with-eri-max-am=N Support ERIs for Gaussians of angular momentum up to N.],
if test $withval -le 0; then
  AC_MSG_ERROR([Invalid value for --with-eri-max-am ($withval)])
else
  ERI_MAX_AM=$withval
fi
if test $ERI_MAX_AM -ge 8; then
  AC_MSG_ERROR([Value for --with-eri-max-am too high ($withval). Are you sure you know what you are doing?])
fi
)

ERI_OPT_AM=$LIBINT_OPT_AM
AC_ARG_WITH(eri-opt-am,
[ --with-eri-opt-am=N Optimize ERIs maximally for up to angular momentum N (N <= max-am).],
if test $withval -le $ERI_MAX_AM; then
  ERI_OPT_AM=$withval
fi
)

if test X$INCLUDE_ERI != Xno; then
  AC_DEFINE_UNQUOTED(INCLUDE_ERI,$INCLUDE_ERI)
  AC_SUBST(ERI_MAX_AM)
  AC_SUBST(ERI_OPT_AM)
  AC_DEFINE_UNQUOTED(ERI_MAX_AM,$ERI_MAX_AM)
  AC_DEFINE_UNQUOTED(ERI_OPT_AM,$ERI_OPT_AM)
fi

# check max am for 3-center ERIs, if needed
ERI3_MAX_AM=$LIBINT_MAX_AM
AC_ARG_WITH(eri3-max-am,
[ --with-eri3-max-am=N Support 3-center ERIs for Gaussians of angular momentum up to N.],
if test $withval -le 0; then
  AC_MSG_ERROR([Invalid value for --with-eri3-max-am ($withval)])
else
  ERI3_MAX_AM=$withval
fi
if test $ERI3_MAX_AM -ge 8; then
  AC_MSG_ERROR([Value for --with-eri3-max-am too high ($withval). Are you sure you know what you are doing?])
fi
)

ERI3_OPT_AM=$LIBINT_OPT_AM
AC_ARG_WITH(eri3-opt-am,
[ --with-eri3-opt-am=N Optimize 3-center ERIs maximally for up to angular momentum N (N <= max-am).],
if test $withval -le $ERI3_MAX_AM; then
  ERI3_OPT_AM=$withval
fi
)

if test X$INCLUDE_ERI3 != Xno; then
  AC_DEFINE_UNQUOTED(INCLUDE_ERI3,$INCLUDE_ERI3)
  AC_SUBST(ERI3_MAX_AM)
  AC_SUBST(ERI3_OPT_AM)
  AC_DEFINE_UNQUOTED(ERI3_MAX_AM,$ERI3_MAX_AM)
  AC_DEFINE_UNQUOTED(ERI3_OPT_AM,$ERI3_OPT_AM)
fi

# check max am for 2-center ERIs, if needed
ERI2_MAX_AM=$LIBINT_MAX_AM
AC_ARG_WITH(eri2-max-am,
[ --with-eri2-max-am=N Support 2-center ERIs for Gaussians of angular momentum up to N.],
if test $withval -le 0; then
  AC_MSG_ERROR([Invalid value for --with-eri2-max-am ($withval)])
else
  ERI2_MAX_AM=$withval
fi
if test $ERI2_MAX_AM -ge 8; then
  AC_MSG_ERROR([Value for --with-eri2-max-am too high ($withval). Are you sure you know what you are doing?])
fi
)

ERI2_OPT_AM=$LIBINT_OPT_AM
AC_ARG_WITH(eri2-opt-am,
[ --with-eri2-opt-am=N Optimize 2-center ERIs maximally for up to angular momentum N (N <= max-am).],
if test $withval -le $ERI2_MAX_AM; then
  ERI2_OPT_AM=$withval
fi
)

if test X$INCLUDE_ERI2 != Xno; then
  AC_DEFINE_UNQUOTED(INCLUDE_ERI2,$INCLUDE_ERI2)
  AC_SUBST(ERI2_MAX_AM)
  AC_SUBST(ERI2_OPT_AM)
  AC_DEFINE_UNQUOTED(ERI2_MAX_AM,$ERI2_MAX_AM)
  AC_DEFINE_UNQUOTED(ERI2_OPT_AM,$ERI2_OPT_AM)
fi

# check max am for G12 integrals, if needed
G12_MAX_AM=$LIBINT_MAX_AM
AC_ARG_WITH(g12-max-am,
[ --with-g12-max-am=N Support integrals for G12 methods of angular momentum up to N.],
if test $withval -le 0; then
  AC_MSG_ERROR([Invalid value for --with-g12-max-am ($withval)])
else
  G12_MAX_AM=$withval
fi
)

G12_OPT_AM=$LIBINT_OPT_AM
AC_ARG_WITH(g12-opt-am,
[ --with-g12-opt-am=N Optimize G12 integrals for up to angular momentum N (N <= max-am).],
if test $withval -le $G12_MAX_AM; then
  G12_OPT_AM=$withval
fi
)

AC_ARG_ENABLE(t1g12-support,
[ --disable-t1g12-support Libint will not support [Ti,G12] integrals],
[
case $enableval in
  yes)
    SUPPORT_T1G12=1
  ;;
  no)
    SUPPORT_T1G12=0
  ;;
  *)
    SUPPORT_T1G12=$enableval
  ;;
esac
],[
    SUPPORT_T1G12=1
]
)

AC_ARG_ENABLE(composite-evaluators,
[ --disable-composite-evaluators Libint will not use composite evaluators (i.e. every evaluator wil compute one integral type only)],
[
case $enableval in
  yes)
    LIBINT_USE_COMPOSITE_EVALUATORS=1
    AC_MSG_RESULT([Will generate composite evaluators for multiple integral types])
  ;;
  no)
    LIBINT_USE_COMPOSITE_EVALUATORS=0
    AC_MSG_RESULT([Will generate separate evaluators for each integral type])
  ;;
  *)
    LIBINT_USE_COMPOSITE_EVALUATORS=$enableval
  ;;
esac
],[
    LIBINT_USE_COMPOSITE_EVALUATORS=1
    AC_MSG_RESULT([Will generate composite evaluators for multiple integral types])
]
)
AC_DEFINE_UNQUOTED(LIBINT_USE_COMPOSITE_EVALUATORS,$LIBINT_USE_COMPOSITE_EVALUATORS)

if test "X$INCLUDE_G12" != "Xno"; then
  AC_DEFINE_UNQUOTED(INCLUDE_G12,$INCLUDE_G12)
  AC_SUBST(G12_MAX_AM)
  AC_SUBST(G12_OPT_AM)
  AC_SUBST(SUPPORT_T1G12)
  AC_DEFINE_UNQUOTED(G12_MAX_AM,$G12_MAX_AM)
  AC_DEFINE_UNQUOTED(G12_OPT_AM,$G12_OPT_AM)
  AC_DEFINE_UNQUOTED(SUPPORT_T1G12,$SUPPORT_T1G12)
fi

# check max am for G12DKH integrals, if needed
G12DKH_MAX_AM=$LIBINT_MAX_AM
AC_ARG_WITH(g12dkh-max-am,
[ --with-g12dkh-max-am=N Support integrals for relativistic G12 methods of angular momentum up to N.],
if test $withval -le 0; then
  AC_MSG_ERROR([Invalid value for --with-g12dkh-max-am ($withval)])
else
  G12DKH_MAX_AM=$withval
fi
)

G12DKH_OPT_AM=$LIBINT_OPT_AM
AC_ARG_WITH(g12dkh-opt-am,
[ --with-g12dkh-opt-am=N Optimize G12DKH integrals for up to angular momentum N (N <= max-am).],
if test $withval -le $G12DKH_MAX_AM; then
  G12DKH_OPT_AM=$withval
fi
)

if test "X$INCLUDE_G12DKH" != "Xno"; then
  AC_DEFINE_UNQUOTED(INCLUDE_G12DKH,$INCLUDE_G12DKH)
  AC_SUBST(G12DKH_MAX_AM)
  AC_SUBST(G12DKH_OPT_AM)
  AC_DEFINE_UNQUOTED(G12DKH_MAX_AM,$G12DKH_MAX_AM)
  AC_DEFINE_UNQUOTED(G12DKH_OPT_AM,$G12DKH_OPT_AM)
fi

AC_ARG_ENABLE(unrolling,
[ --enable-unrolling Allow computation in terms of integrals rather than sets of integrals.],
[
case $enableval in
  yes)
  AC_DEFINE(LIBINT_ENABLE_UNROLLING)
  AC_MSG_RESULT([Integral sets can be unrolled])
  ;;
  no)
  AC_MSG_RESULT([Integral sets will not be unrolled])
  ;;
esac
])

AC_ARG_ENABLE(generic-code,
[ --enable-generic-code Use manually-written generic code.],
[
AC_DEFINE(LIBINT_ENABLE_GENERIC_CODE)
AC_MSG_RESULT([Use generic code])
])

LIBINT_VECTOR_LENGTH=1
AC_ARG_WITH(vector-length,
[ --with-vector-length=N Compute integrals in vectors of length N.],
[
if test $withval -gt 0; then
  LIBINT_VECTOR_LENGTH=$withval
  AC_DEFINE_UNQUOTED(LIBINT_VECTOR_LENGTH,$withval)
  AC_MSG_RESULT([Using vector length: $withval])
fi
])

if test $LIBINT_VECTOR_LENGTH -gt 1; then
  LIBINT_VECTOR_METHOD=block
  AC_ARG_WITH(vector-method,
  [ --with-vector-method Specifies how to vectorize integrals. Allowed values are 'block' (default) and 'line'.],
  [
  LIBINT_VECTOR_METHOD=$withval
  ])
  case $LIBINT_VECTOR_METHOD in
    block)
    ;;
    line)
    ;;
    *)
    AC_MSG_ERROR([Unrecognized vector method: $LIBINT_VECTOR_METHOD])
    ;;
  esac
  AC_DEFINE_UNQUOTED(LIBINT_VECTOR_METHOD,"$LIBINT_VECTOR_METHOD")
  AC_MSG_RESULT([Using vector method: $LIBINT_VECTOR_METHOD])
fi

AC_ARG_WITH(float-type,
[ --with-float-type Compute all integrals using the given float type.],
[
AC_DEFINE_UNQUOTED(LIBINT_USER_DEFINED_FLOAT,"$withval")
echo Using floating-point type: $withval
])

AC_ARG_ENABLE(single-evaltype,
 AS_HELP_STRING([--enable-single-evaltype],[Generate single evaluator type (i.e. all tasks use the same evaluator)]),
 [
  if test X$enableval = Xyes; then
    enable_single_evaltype=1
  else
    enable_single_evaltype=0
  fi
 ],
 [
  enable_single_evaltype=1
 ]
)
if test X$enable_single_evaltype = X1; then
  AC_DEFINE(LIBINT_SINGLE_EVALTYPE)
  AC_MSG_RESULT([Will generate single evaluator type])
else
  AC_MSG_RESULT([Will generate specialized evaluator types for each task])
  AC_MSG_ERROR([Cannot generate specialized evaluator types yet])
fi

AC_ARG_ENABLE(accum-ints,
[ --enable-accum-ints Accumulate integrals to the buffer, rather than copy.],
[
AC_DEFINE(LIBINT_ACCUM_INTS)
AC_MSG_RESULT([Will accumulate integrals to the buffer])
],
[
AC_MSG_RESULT([Will copy integrals to the buffer])
])

AC_ARG_ENABLE(flop-counter,
[ --enable-flop-counter Support FLOP counting by the library.],
[
AC_DEFINE(LIBINT_FLOP_COUNT)
AC_MSG_RESULT([FLOP counter will be supported])
])

AC_ARG_ENABLE(contracted-ints,
[ --enable-contracted-ints Turn on support for contracted integrals.],
[
AC_DEFINE(LIBINT_CONTRACTED_INTS)
AC_MSG_RESULT([Will support contracted integrals])
],
[
AC_MSG_RESULT([Will not support contracted integrals])
])

dnl
dnl Preferred strategies for evaluation
dnl
AC_ARG_WITH(eri-strategy,
[ --with-eri-strategy Compute ERIs using the following strategy. This option is for experts ONLY.],
[
  case $withval in
    OS)
      AC_DEFINE_UNQUOTED(LIBINT_ERI_STRATEGY,0)
    ;;
    HGP)
      AC_DEFINE_UNQUOTED(LIBINT_ERI_STRATEGY,1)
    ;;
    HL)
      AC_DEFINE_UNQUOTED(LIBINT_ERI_STRATEGY,2)
    ;;
  esac
AC_MSG_RESULT([Using ERI strategy: $withval])
],
[AC_DEFINE(LIBINT_ERI_STRATEGY,1)]
)


BUILDID="libint_buildid"
AC_ARG_WITH(build-id,
[ --with-build-id Gives an identifier for the build.],
BUILDID=$withval
)
AC_SUBST(BUILDID)
AC_DEFINE_UNQUOTED(LIBINT_BUILDID,"$BUILDID")

if test "$BUILDID"; then
  LIBINT_VERSION="$LIBINT_MMM_VERSION-$BUILDID"
else
  LIBINT_VERSION="$LIBINT_MMM_VERSION"
fi

AC_DEFINE_UNQUOTED(LIBINT_VERSION, "$LIBINT_VERSION")
AC_SUBST(LIBINT_VERSION)

ac_default_prefix="/usr/local/libint/$LIBINT_VERSION"

AC_ARG_WITH(cxx,
[ --with-cxx Gives the name of the C++ compiler to use.],
CXX=$withval
)

CXXFLAGS_OPT=
AC_ARG_WITH(cxx-optflags,
[ --with-cxx-optflags Gives optimization flags for the C++ compiler.],
CXXFLAGS_OPT=$withval
)

AC_ARG_WITH(cxxgen,
[ --with-cxxgen Gives the name of the C++ compiler to compile generated code.],
CXXGEN=$withval
)

CXXFLAGS_GEN_OPT=
AC_ARG_WITH(cxxgen-optflags,
[ --with-cxxgen-optflags Gives optimization flags for the C++ compiler for generated source.],
CXXFLAGS_GEN_OPT=$withval
)

AC_ARG_WITH(cxxdepend,
[ --with-cxxdepend Gives the name of the C++ compiler with which to extract dependency information.],
CXXDEPEND=$withval,CXXDEPEND=$CXX
)
AC_SUBST(CXXDEPEND)

AC_ARG_WITH(ranlib,
[ --with-ranlib Gives the name of the ranlib program.],
RANLIB=$withval
)

AC_ARG_WITH(ar,
[ --with-ar Names the archive creator.],
AR=$withval
)

ARFLAGS=r
AC_ARG_WITH(ar-flags,
[ --with-ar-flags Flags for the the archive creator.],
ARFLAGS=$withval
)
AC_SUBST(ARFLAGS)

AC_ARG_WITH(ld,
[ --with-ld Names the object linker.],
LD=$withval
)

libintincludedir=$includedir
AC_ARG_WITH(libint-includedir,
[ --with-libint-includedir Specifies include file install subdir.],
libintincludedir=$withval
)
AC_SUBST(libintincludedir)

EXPORTDIR=libint-$LIBINT_VERSION
AC_ARG_WITH(libint-exportdir,
[ --with-libint-exportdir Specifies export directory name. Default is libint-<version>.],
EXPORTDIR=$withval
)
AC_SUBST(EXPORTDIR)

AC_ARG_WITH(incdirs,
[ --with-incdirs Specifies include directories (-Idir1 -Idir2).],
EXTRAINCDIRS=$withval
CPPFLAGS=$withval
echo Using extra include directories: $withval
)

AC_ARG_WITH(libs,
[ --with-libs Specifies libraries (-llib1 -llib2).],
LIBS=$withval
echo Using extra libraries: $withval
)

LDFLAGS=
LIBDIRS=
AC_ARG_WITH(libdirs,
[ --with-libdirs Specifies library directories (-Ldir1 -Ldir2).],
LIBDIRS=$withval
LDFLAGS=$withval
echo Using extra library directories: $withval
)

SCRATCHDIR=tmp
AC_ARG_WITH(scratchdir,
[ --with-scratchdir Specifies the location for the machine-generated library source and object files.],
SCRATCHDIR=$withval
)
AC_SUBST(SCRATCHDIR)

dnl --------- Want absolute path for srcdir, not relative. ---------

if test X$ac_srcdir_defaulted = Xyes; then
  case $srcdir in
    ../*)
      srcdir=`(cd $srcdir; pwd)`
      #srcdir=`(cd $srcdir; echo $PWD)`
      ;;
  esac
fi

dnl --------- Checks for programs. ---------
AC_PROG_MAKE_SET
AC_PROG_LN_S
AC_PROG_INSTALL
AC_PROG_RANLIB

# discard CXXFLAGS provided by the C++ detection macros
initial_CXXFLAGS="$CXXFLAGS"
AC_PROG_CXX
AC_PROG_CXXCPP
CXXFLAGS="$initial_CXXFLAGS"

AC_CHECK_PROG(AR,ar,ar)
AC_CHECK_PROG(PERL,perl,perl)
AC_PATH_PROG(DOXYGEN,doxygen,,$PATH:/usr/local/bin)
AC_PATH_PROG(PDFLATEX,pdflatex,,$PATH:/usr/local/bin)
AC_PATH_PROG(PSLATEX,pslatex,,$PATH:/usr/local/bin)
AC_PATH_PROG(BIBTEX,bibtex,,$PATH:/usr/local/bin)
if test X$LD = X; then
  LD=$CXX
  AC_SUBST(LD)
fi

dnl The lack of certain tools is a show stopper

changequote(<<, >>)dnl

if [ X$PERL = X ]; then
  echo "Could not find the program perl!"
  echo "Most system vendors provide it."
  echo "It can also be obtained at"
  echo "ftp://prep.ai.mit.edu/pub/gnu"
  exit 1
fi

changequote([, ])dnl

dnl -------- Checks for compiler/linker options. ----------

# if user provided CXXFLAGS, I'm set; else ...
if test "X$CXXFLAGS" = X; then
  # options needed only for optimization
  if test "X$CXXFLAGS_OPT" = X; then
    CXXFLAGS_OPT=-O2
  fi
  # options needed only for debugging
  CXXFLAGS_DBG=-g
  # options that are always needed
  CXXFLAGS_MISC=
fi

OBJSUF=o
LIBSUF=a

dnl -- check how dependency information is built --

# The GNU compilers work with:
CXXDEPENDSUF=none
CXXDEPENDFLAGS=-M

/bin/rm -f depcheck.u depcheck.c depcheck.o

# Check for an IBM visual age C++ compiler
echo "#include <iostream>" > depcheck.cc
$CXX $CPPFLAGS $CXXFLAGS -M -E depcheck.cc > /dev/null 2>&1
if test -f depcheck.u; then
  CXXDEPENDSUF=u
  CXXDEPENDFLAGS="-M -E"
fi
/bin/rm -f depcheck.u depcheck.c depcheck.o

dnl -- special architecture options --

if test "X$CXXFLAGS_GEN_OPT" = X; then
  AC_MSG_WARN([C++ optimization options are not given! For optimum performance use --with-cxxgen-optflags configure option])
fi

if test $DEBUG = yes; then
  CXXFLAGS="$CXXFLAGS $CXXFLAGS_DBG $CXXFLAGS_MISC"
  LDFLAGS="$LDFLAGS -g"
elif test $DEBUG = opt; then
  CXXFLAGS="$CXXFLAGS $CXXFLAGS_DBG $CXXOPTIONS_OPT $CXXFLAGS_MISC"
  LDFLAGS="$LDFLAGS -g"
else
  CXXFLAGS="$CXXFLAGS $CXXFLAGS_OPT $CXXFLAGS_MISC"
fi

AC_SUBST(EXTRAINCLUDE)

AC_SUBST(CXXFLAGS)
AC_SUBST(LIBDIRS)
AC_SUBST(OBJSUF)
AC_SUBST(LIBSUF)
AC_SUBST(CXXDEPENDSUF)
AC_SUBST(CXXDEPENDFLAGS)


dnl --------- configure compiler for generated source ---------
if test "X$CXXGEN" = X; then
  CXXGEN=$CXX
  CXXFLAGS_GEN_OPT=$CXXFLAGS_OPT
fi
if test $DEBUG = yes; then
  CXXGENFLAGS="$CXXFLAGS_DBG $CXXFLAGS_GEN_MISC"
elif test $DEBUG = opt; then
  CXXGENFLAGS="$CXXFLAGS_DBG $CXXFLAGS_GEN_OPT $CXXFLAGS_GEN_MISC"
else
  CXXGENFLAGS="$CXXFLAGS_GEN_OPT $CXXFLAGS_GEN_MISC"
fi
AC_SUBST(CXXGEN)
AC_SUBST(CXXGENFLAGS)

dnl Check if sources compiled with CXX and CXXGEN can be linked together
CXX_COMPATIBLE_WITH_CXXGEN=yes
if test "X$CXX" != "X$CXXGEN"; then
AC_MSG_CHECKING([[for compatible cxx and cxxgen compilers]])
echo "extern void func1(); int main(int argc, char**argv) { func1(); } " > linkcheck1.cc
echo "void func1() {}" > linkcheck2.cc
$CXX $CPPFLAGS $CXXFLAGS -c linkcheck1.cc > /dev/null 2>&1
$CXXGEN $CPPFLAGS $CXXGENFLAGS -c linkcheck2.cc > /dev/null 2>&1
$LD $LDFLAGS -o linkcheck1 linkcheck1.o linkcheck2.o > /dev/null 2>&1
$CXX $LDFLAGS -o linkcheck2 linkcheck1.o linkcheck2.o > /dev/null 2>&1
$CXXGEN $LDFLAGS -o linkcheck3 linkcheck1.o linkcheck2.o > /dev/null 2>&1
if test -f linkcheck1 -a -f linkcheck2 -a -f linkcheck3; then
  AC_MSG_RESULT([[yes]])
else
  AC_MSG_RESULT([[no]])
  AC_MSG_WARN([[Compilers cxx and cxxgen produce incompatible code! You will not be able to test generated code.]])
  CXX_COMPATIBLE_WITH_CXXGEN=no
fi
/bin/rm -f linkcheck1 linkcheck2 linkcheck3 linkcheck1.cc linkcheck2.cc linkcheck1.o linkcheck2.o
fi

AC_SUBST(CXX_COMPATIBLE_WITH_CXXGEN)

dnl -------- Checks for architecture specific features. --------
dnl (Doesn't work for cross compilation.)
dnl AC_CHECK_SIZEOF(void*)

AC_SUBST(EXTRADEFINES)

dnl ---------- Checks for "standard" header files. -----------

AC_HEADER_STDC
AC_CHECK_HEADERS(limits.h stdint.h)

dnl ------------------ Check for gmp C++ interface -----------------------

AC_CHECK_HEADER(gmpxx.h,[
  AC_MSG_CHECKING([if GMP C++ library is usable])
  LIBS="-lgmpxx -lgmp $LIBS"
  AC_LINK_IFELSE(
   [AC_LANG_PROGRAM(
    [[#include <gmpxx.h>
    ]],
    [[
     mpz_class a = 1;
    ]]
    )
   ],
   [AC_MSG_RESULT([yes])
   ],
   [
    AC_MSG_RESULT([no])
    AC_MSG_ERROR([cannot link against GMP libraries. Please get the latest GMP with support for C++. It can be obtained at gmplib.org .])
   ]
  )
 ],
 [AC_MSG_ERROR([GMP C++ support is required. Please get the latest GMP with support for C++. It can be obtained at gmplib.org .])]
)

dnl ------------------ Check for shared_ptr -----------------------

HAVE_SHARED_PTR=no
AC_MSG_CHECKING([for Boost::shared_ptr])
AC_COMPILE_IFELSE(
  [AC_LANG_PROGRAM(
    [[#include <boost/shared_ptr.hpp>
    ]],
    [[
     boost::shared_ptr<int> a(new int);
     boost::shared_ptr<int> b = a;
    ]]
   )
  ],
  [AC_MSG_RESULT([yes])
   HAVE_SHARED_PTR=boost
   AC_DEFINE(HAVE_SHARED_PTR_IN_BOOST)
  ],
  [
    AC_MSG_RESULT([no])
  ]
)

if test "X$HAVE_SHARED_PTR" = "Xno"; then
  AC_MSG_CHECKING([for std::shared_ptr])
  AC_COMPILE_IFELSE(
    [AC_LANG_PROGRAM(
      [[#include <memory>
      ]],
      [[
        std::shared_ptr<int> a(new int);
        std::shared_ptr<int> b = a;
      ]]
     )
    ],
    [AC_MSG_RESULT([yes])
     HAVE_SHARED_PTR=std
    ],
    [
      AC_MSG_RESULT([no])
      AC_MSG_ERROR([shared_ptr is required. Please download Boost from boost.org or use C++ compiler that supports shared_ptr.])
    ]
  )
fi

AC_MSG_CHECKING([for Boost::mpl::for_each])
AC_COMPILE_IFELSE(
  [AC_LANG_PROGRAM(
    [[#include <boost/mpl/list.hpp>
      #include <boost/mpl/for_each.hpp>
      #include <iostream>
      struct P {
      template <class T> void operator()(T x) const { std::cout << x << std::endl; }
      };
    ]],
    [[
      typedef boost::mpl::list<int,double,char> tlist;
      boost::mpl::for_each<tlist>(P());
    ]]
   )
  ],
  [AC_MSG_RESULT([yes])
  ],
  [
    AC_MSG_RESULT([no])
    AC_MSG_ERROR([Boost::mpl is required. Please use the latest Boost library from boost.org and/or most standard-compliant C++ compiler.])
  ]
)

dnl -- Checks for typedefs, structures, and compiler characteristics. --
AC_TYPE_SIZE_T

CPPFLAGS="$CPPFLAGS" CXX="$CXX" CXXFLAGS="$CXXFLAGS" \
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="-lm $LIBS $FLIBS" \
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \

dnl --------- Shared library configuration. ---------

enablelibtool=yes
AC_ARG_ENABLE(libtool,
[ --disable-libtool Do not use libtool.],
[
case $enableval in
  yes)
  ;;
  no)
    enablelibtool=no
  ;;
  *)
    AC_MSG_ERROR([Invalid value for --(dis|en)able-libtool ($enableval)])
  ;;
esac
])

if test "$enablelibtool" = yes; then

dnl by default make only static libraries
AC_DISABLE_SHARED
AC_PROG_LIBTOOL

OBJSUF=lo
LIBSUF=la

else

enable_shared=no

fi

if test "$enable_shared" = "no"; then
  OBJSUF=o
  LIBSUF=a
fi

ENABLESHARED=$enable_shared
AC_SUBST(ENABLESHARED)

dnl -- configure tester --
TESTER_ARGS="(\"1 0 1 0 1\", \"1 0 1 0 10000\", \"1 1 1 1 1\", \"1 1 1 1 10000\", \"2 0 2 0 1\", \"2 1 2 0 10000\", \"1 1 1 1 10000 16 0\", \"1 1 1 1 10000 16 1\", \"1 1 1 1 10000 1 1\", \"1 1 1 1 1 16 0\", \"1 1 1 1 1 16 1\", \"1 1 1 1 10000 16 0 1\")"
TESTER_ARGS_LONG="(\"3 0 3 0 10000\", \"4 0 4 0 10000\", \"2 2 2 2 1\", \"2 2 2 2 10000\")"
AC_SUBST(TESTER_ARGS)
AC_SUBST(TESTER_ARGS_LONG)

dnl -- make Makefiles in object tree --
$PERL $srcdir/bin/objectdir.pl $EXCLUDED_DIRS $srcdir

AC_CONFIG_FILES([src/bin/test_eri/test_eri.pl],[chmod +x src/bin/test_eri/test_eri.pl])
AC_CONFIG_FILES([src/bin/test_eri/time_eri.pl],[chmod +x src/bin/test_eri/time_eri.pl])
AC_CONFIG_FILES([src/bin/test_eri/run_time_eri.pl],[chmod +x src/bin/test_eri/run_time_eri.pl])
AC_CONFIG_FILES([src/bin/test_eri/stdtests.pl],[chmod +x src/bin/test_eri/stdtests.pl])
AC_CONFIG_FILES([src/bin/test_eri/run_timing_suite.pl],[chmod +x src/bin/test_eri/run_timing_suite.pl])
AC_CONFIG_FILES(src/bin/MakeVars src/lib/MakeVars src/lib/MakeRules
                doc/MakeVars doc/MakeRules doc/macros.tex doc/classdoc/doxygen.cfg
                src/bin/libint/cgshell_ordering.h)

dnl --------- Done! ---------
AC_OUTPUT

Something went wrong with that request. Please try again.