presents ints classes and deriv and AM options to user (CMakeLists.txt)
processes user options into L2 define variables (int_am.cmake)
writes the define variables to config.h.cmake.in
provides documentation (largely duplicates CMakeLists.txt) and upgrade helper (INSTALL.md)
[x] int_am.cmake both
[x] (1) does the defaulting logic that was in configure.ac and ends up in config.h . This adds a couple extra user input checks. The output I think is in good shape -- see the examples below. I can run others if you're curious.
[x] (2) constructs "candidate" vars containing the target AM per class and per deriv for assembling the eri_ffff_d0 cmake components. This imitates logic that in L2 lives in build_libint.cc. The component-constructing machinery has been reworked for the new component format, and it wasn't too hard to keep it in cmake and avoid a Python dependency. This makes configuration-gen.py redundant.
The only trouble here is that originally I had used both --with-max-am=N & --with-max-am=N0,N1,N2 in layers as defaults for ints classes. Whereas I'm pretty sure now that the latter has no role in defaulting (other than setting its max to LIBINT_MAX_AM) and is entirely directed at eri3. So the cmake components printed reflect this layered defaulting and likely not the true ints available. (Given the pattern, the cmake components are underpromising, not underdelivering, at least.) I've left this for now in case I'm mistaken again or in case you prefer this defaulting scheme, but probably it should be ripped out in the end to conform strictly with configure.ac/build_libint.cc .
[x] One potential plumbing bug: WITH_ONEBODY_[MAX|OPT]_AM with per-deriv N0,N1,N2 option is stated in the current docs and parsed by configure.ac into ONEBODY_MAX_AM_LIST/ONEBODY_OPT_AM_LIST and those defines are processed in build_libint.cc. But there's a handoff missing in include/libint2/config.h.in where the LIST never got defined. I've added them in to both the libtool config.h.in and the WIP cmake config.h.cmake.in.
May 2024 additions
[x] components extended to AM s & p. They're unlikely to be target configuration values, but useful for checks
[x] (2) above is now revised so that WITH_MAX_AM int or max of per-deriv list serves as default for specific integral classes and per-deriv list serves as paired for eri3
[x] the LIBINT_HARD_MAX_AM is new upstream, I think. I've got it in locally, but it isn't in this PR.
Note that literal translation throws an error: "Invalid value for WITH_MAXAM (6;5). Highest ENABLE derivative (2) requires list length 3, not 2." Input isn't technically wrong since list WITH_MAX_AM likely only relevant for ERI3. But in the interest of catching user slips, I'm leaving the check in and adjusting the input to WITH_MAX_AM="6;5;5".
REVISED
-- setting components multipole_nn_d0;multipole_mm_d0;multipole_ll_d0;multipole_kk_d0;multipole_ii_d0;multipole_hh_d0;multipole_gg_d0;multipole_ff_d0;multipole_dd_d0;multipole_pp_d0;multipole_ss_d0
-- setting components onebody_ii_d0;onebody_hh_d0;onebody_gg_d0;onebody_ff_d0;onebody_dd_d0;onebody_pp_d0;onebody_ss_d0
-- setting components onebody_ii_d1;onebody_hh_d1;onebody_gg_d1;onebody_ff_d1;onebody_dd_d1;onebody_pp_d1;onebody_ss_d1
-- setting components onebody_ii_d2;onebody_hh_d2;onebody_gg_d2;onebody_ff_d2;onebody_dd_d2;onebody_pp_d2;onebody_ss_d2
-- setting components eri_hhhh_d0;eri_gggg_d0;eri_ffff_d0;eri_dddd_d0;eri_pppp_d0;eri_ssss_d0
-- setting components eri_gggg_d1;eri_ffff_d1;eri_dddd_d1;eri_pppp_d1;eri_ssss_d1
-- setting components eri_iiI_d0;eri_hhI_d0;eri_ggI_d0;eri_ffI_d0;eri_ddI_d0;eri_ppI_d0;eri_ssI_d0;eri_hhH_d0;eri_ggH_d0;eri_ffH_d0;eri_ddH_d0;eri_ppH_d0;eri_ssH_d0;eri_ggG_d0;eri_ffG_d0;eri_ddG_d0;eri_ppG_d0;eri_ssG_d0;eri_ffF_d0;eri_ddF_d0;eri_ppF_d0;eri_ssF_d0;eri_ddD_d0;eri_ppD_d0;eri_ssD_d0;eri_ppP_d0;eri_ssP_d0;eri_ssS_d0
-- setting components eri_hhH_d1;eri_ggH_d1;eri_ffH_d1;eri_ddH_d1;eri_ppH_d1;eri_ssH_d1;eri_ggG_d1;eri_ffG_d1;eri_ddG_d1;eri_ppG_d1;eri_ssG_d1;eri_ffF_d1;eri_ddF_d1;eri_ppF_d1;eri_ssF_d1;eri_ddD_d1;eri_ppD_d1;eri_ssD_d1;eri_ppP_d1;eri_ssP_d1;eri_ssS_d1
-- setting components eri_iii_d0;eri_hhi_d0;eri_ggi_d0;eri_ffi_d0;eri_ddi_d0;eri_ppi_d0;eri_ssi_d0;eri_hhh_d0;eri_ggh_d0;eri_ffh_d0;eri_ddh_d0;eri_pph_d0;eri_ssh_d0;eri_ggg_d0;eri_ffg_d0;eri_ddg_d0;eri_ppg_d0;eri_ssg_d0;eri_fff_d0;eri_ddf_d0;eri_ppf_d0;eri_ssf_d0;eri_ddd_d0;eri_ppd_d0;eri_ssd_d0;eri_ppp_d0;eri_ssp_d0;eri_sss_d0;eri_hhh_d1;eri_ggh_d1;eri_ffh_d1;eri_ddh_d1;eri_pph_d1;eri_ssh_d1;eri_ggg_d1;eri_ffg_d1;eri_ddg_d1;eri_ppg_d1;eri_ssg_d1;eri_fff_d1;eri_ddf_d1;eri_ppf_d1;eri_ssf_d1;eri_ddd_d1;eri_ppd_d1;eri_ssd_d1;eri_ppp_d1;eri_ssp_d1;eri_sss_d1
-- setting components eri_II_d0;eri_HH_d0;eri_GG_d0;eri_FF_d0;eri_DD_d0;eri_PP_d0;eri_SS_d0
-- setting components eri_HH_d1;eri_GG_d1;eri_FF_d1;eri_DD_d1;eri_PP_d1;eri_SS_d1
-- setting components eri_ii_d0;eri_hh_d0;eri_gg_d0;eri_ff_d0;eri_dd_d0;eri_pp_d0;eri_ss_d0;eri_hh_d1;eri_gg_d1;eri_ff_d1;eri_dd_d1;eri_pp_d1;eri_ss_d1
-- setting components g12_gggg_d0;g12_ffff_d0;g12_dddd_d0;g12_pppp_d0;g12_ssss_d0
-- setting components g12_gggg_d1;g12_ffff_d1;g12_dddd_d1;g12_pppp_d1;g12_ssss_d1
-- Library will satisfy ERI AM components: multipole_nn_d0;multipole_mm_d0;multipole_ll_d0;multipole_kk_d0;multipole_ii_d0;multipole_hh_d0;multipole_gg_d0;multipole_ff_d0;multipole_dd_d0;multipole_pp_d0;multipole_ss_d0;onebody_ii_d0;onebody_hh_d0;onebody_gg_d0;onebody_ff_d0;onebody_dd_d0;onebody_pp_d0;onebody_ss_d0;onebody_ii_d1;onebody_hh_d1;onebody_gg_d1;onebody_ff_d1;onebody_dd_d1;onebody_pp_d1;onebody_ss_d1;onebody_ii_d2;onebody_hh_d2;onebody_gg_d2;onebody_ff_d2;onebody_dd_d2;onebody_pp_d2;onebody_ss_d2;eri_hhhh_d0;eri_gggg_d0;eri_ffff_d0;eri_dddd_d0;eri_pppp_d0;eri_ssss_d0;eri_gggg_d1;eri_ffff_d1;eri_dddd_d1;eri_pppp_d1;eri_ssss_d1;eri_iiI_d0;eri_hhI_d0;eri_ggI_d0;eri_ffI_d0;eri_ddI_d0;eri_ppI_d0;eri_ssI_d0;eri_hhH_d0;eri_ggH_d0;eri_ffH_d0;eri_ddH_d0;eri_ppH_d0;eri_ssH_d0;eri_ggG_d0;eri_ffG_d0;eri_ddG_d0;eri_ppG_d0;eri_ssG_d0;eri_ffF_d0;eri_ddF_d0;eri_ppF_d0;eri_ssF_d0;eri_ddD_d0;eri_ppD_d0;eri_ssD_d0;eri_ppP_d0;eri_ssP_d0;eri_ssS_d0;eri_hhH_d1;eri_ggH_d1;eri_ffH_d1;eri_ddH_d1;eri_ppH_d1;eri_ssH_d1;eri_ggG_d1;eri_ffG_d1;eri_ddG_d1;eri_ppG_d1;eri_ssG_d1;eri_ffF_d1;eri_ddF_d1;eri_ppF_d1;eri_ssF_d1;eri_ddD_d1;eri_ppD_d1;eri_ssD_d1;eri_ppP_d1;eri_ssP_d1;eri_ssS_d1;eri_iii_d0;eri_hhi_d0;eri_ggi_d0;eri_ffi_d0;eri_ddi_d0;eri_ppi_d0;eri_ssi_d0;eri_hhh_d0;eri_ggh_d0;eri_ffh_d0;eri_ddh_d0;eri_pph_d0;eri_ssh_d0;eri_ggg_d0;eri_ffg_d0;eri_ddg_d0;eri_ppg_d0;eri_ssg_d0;eri_fff_d0;eri_ddf_d0;eri_ppf_d0;eri_ssf_d0;eri_ddd_d0;eri_ppd_d0;eri_ssd_d0;eri_ppp_d0;eri_ssp_d0;eri_sss_d0;eri_hhh_d1;eri_ggh_d1;eri_ffh_d1;eri_ddh_d1;eri_pph_d1;eri_ssh_d1;eri_ggg_d1;eri_ffg_d1;eri_ddg_d1;eri_ppg_d1;eri_ssg_d1;eri_fff_d1;eri_ddf_d1;eri_ppf_d1;eri_ssf_d1;eri_ddd_d1;eri_ppd_d1;eri_ssd_d1;eri_ppp_d1;eri_ssp_d1;eri_sss_d1;eri_II_d0;eri_HH_d0;eri_GG_d0;eri_FF_d0;eri_DD_d0;eri_PP_d0;eri_SS_d0;eri_HH_d1;eri_GG_d1;eri_FF_d1;eri_DD_d1;eri_PP_d1;eri_SS_d1;eri_ii_d0;eri_hh_d0;eri_gg_d0;eri_ff_d0;eri_dd_d0;eri_pp_d0;eri_ss_d0;eri_hh_d1;eri_gg_d1;eri_ff_d1;eri_dd_d1;eri_pp_d1;eri_ss_d1;g12_gggg_d0;g12_ffff_d0;g12_dddd_d0;g12_pppp_d0;g12_ssss_d0;g12_gggg_d1;g12_ffff_d1;g12_dddd_d1;g12_pppp_d1;g12_ssss_d1
-- Libint Enabled features:
* general integral, config.h: LIBINT_MAX_AM=6 LIBINT_MAX_AM_LIST=6,5,5 LIBINT_OPT_AM=4 LIBINT_OPT_AM_LIST=
* integral class MULTIPOLE derivative 0, max_am 10
* integral class ONEBODY, config.h: INCLUDE_ONEBODY=2 ONEBODY_MAX_AM= ONEBODY_MAX_AM_LIST= ONEBODY_OPT_AM= ONEBODY_OPT_AM_LIST=
* integral class ONEBODY derivative 0, max_am 6
* integral class ONEBODY derivative 1, max_am 6
* integral class ONEBODY derivative 2, max_am 6
* integral class ERI, config.h: INCLUDE_ERI=1 ERI_MAX_AM= ERI_MAX_AM_LIST=5,4 ERI_OPT_AM= ERI_OPT_AM_LIST=
* integral class ERI derivative 0, max_am 5
* integral class ERI derivative 1, max_am 4
* integral class ERI3, config.h: INCLUDE_ERI3=1 ERI3_MAX_AM= ERI3_MAX_AM_LIST=6,5 ERI3_OPT_AM= ERI3_OPT_AM_LIST=
* integral class ERI3 derivative 0, max_am 6
* integral class ERI3 derivative 1, max_am 5
* integral class ERI2, config.h: INCLUDE_ERI2=1 ERI2_MAX_AM= ERI2_MAX_AM_LIST=6,5 ERI2_OPT_AM= ERI2_OPT_AM_LIST=
* integral class ERI2 derivative 0, max_am 6
* integral class ERI2 derivative 1, max_am 5
* integral class G12, config.h: INCLUDE_G12=1 G12_MAX_AM=4 G12_OPT_AM=4
* integral class G12 derivative 0, max_am 4
* integral class G12 derivative 1, max_am 4
-- Libint Disabled features:
* integral class G12DKH, config.h: INCLUDE_G12DKH=-1 G12DKH_MAX_AM= G12DKH_OPT_AM=
~This is an example of how the current CMake defaulting uses the list WITH_MAX_AM to default other classes rather than only using scalar WITH_MAX_AM for defaulting and reserving list WITH_MAX_AM for ERI3 paired: ONEBODY shows max_am=6 for ene and =5 for grad rather than 6 for both. For now, though, this inconsistency is only going to affect the cmake components, not the config.h (comparison below has only the deliberate LIBINT_MAX_AM_LIST difference) or the library.~
@evaleev , I've got all the PR frontmatter examples revised, so I think this is ready for consideration. If you'd like any more configurations run to compare libtool and cmake, please let me know.
~currently atop #299 . here's the diff of the new stuff: https://github.com/loriab/libint/compare/extras...loriab:libint:intconfig~
eri_ffff_d0
cmake components. This imitates logic that in L2 lives in build_libint.cc. The component-constructing machinery has been reworked for the new component format, and it wasn't too hard to keep it in cmake and avoid a Python dependency. This makes configuration-gen.py redundant. The only trouble here is that originally I had used both--with-max-am=N
&--with-max-am=N0,N1,N2
in layers as defaults for ints classes. Whereas I'm pretty sure now that the latter has no role in defaulting (other than setting its max to LIBINT_MAX_AM) and is entirely directed at eri3. So the cmake components printed reflect this layered defaulting and likely not the true ints available. (Given the pattern, the cmake components are underpromising, not underdelivering, at least.) I've left this for now in case I'm mistaken again or in case you prefer this defaulting scheme, but probably it should be ripped out in the end to conform strictly with configure.ac/build_libint.cc .WITH_ONEBODY_[MAX|OPT]_AM
with per-derivN0,N1,N2
option is stated in the current docs and parsed by configure.ac intoONEBODY_MAX_AM_LIST
/ONEBODY_OPT_AM_LIST
and those defines are processed in build_libint.cc. But there's a handoff missing ininclude/libint2/config.h.in
where the LIST never got defined. I've added them in to both the libtoolconfig.h.in
and the WIP cmakeconfig.h.cmake.in
.May 2024 additions
GHA example
part of cmake printout
compare _AM lines in libtool-generated and cmake-generated config.h
empty
MPQC4
c-f/psi4 "basic" for windows
Note that literal translation throws an error: "Invalid value for WITH_MAXAM (6;5). Highest ENABLE derivative (2) requires list length 3, not 2." Input isn't technically wrong since list WITH_MAX_AM likely only relevant for ERI3. But in the interest of catching user slips, I'm leaving the check in and adjusting the input to
WITH_MAX_AM="6;5;5"
.~This is an example of how the current CMake defaulting uses the list WITH_MAX_AM to default other classes rather than only using scalar WITH_MAX_AM for defaulting and reserving list WITH_MAX_AM for ERI3 paired: ONEBODY shows max_am=6 for ene and =5 for grad rather than 6 for both. For now, though, this inconsistency is only going to affect the cmake components, not the config.h (comparison below has only the deliberate LIBINT_MAX_AM_LIST difference) or the library.~
psi4 trial "bigAM" for linux
stress max-am int (new, so REVISED)
stress max-am empty (new, so REVISED)