From d2384a320a10b82507a6b02a86dfc6a0f8003455 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Wed, 20 Dec 2023 16:58:57 -0500 Subject: [PATCH 1/5] the orderings trio --- CMakeLists.txt | 29 +++++++++++++++ INSTALL.md | 38 +++++++++++++++++++ cmake/modules/int_orderings.cmake | 61 +++++++++++++++++++++++++++++++ include/libint2/config.h.cmake.in | 30 +++++++++++++++ 4 files changed, 158 insertions(+) create mode 100644 cmake/modules/int_orderings.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 16dc7a82e..830fbe519 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,6 +118,34 @@ option_with_print(ENABLE_T1G12_SUPPORT # <<< Ordering Conventions >>> +option_with_default(LIBINT2_SHGAUSS_ORDERING + "Ordering for shells of solid harmonic Gaussians: + standard -- standard ordering (-l, -l+1 ... l) + gaussian -- the Gaussian ordering (0, 1, -1, 2, -2, ... l, -l) + See https://github.com/evaleev/libint/blob/master/INSTALL.md#solid-harmonic-ordering-scope-and-history ." standard) +option_with_default(LIBINT2_CARTGAUSS_ORDERING + "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) + bagel -- axis-permuted version of intv3 (xxx, xxy, xyy, yyy, xxz, xyz, yyz, xzz, yzz, zzz)" standard) +option_with_default(LIBINT2_SHELL_SET + "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)" standard) # <<< How High Angular Momentum >>> @@ -186,6 +214,7 @@ option_with_default(WITH_G12DKH_OPT_AM ######################## Process & Validate Options ########################### include(FeatureSummary) +include(int_orderings) include(int_am) booleanize01(ERI3_PURE_SH) diff --git a/INSTALL.md b/INSTALL.md index 24a990225..d47c60a16 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -26,6 +26,41 @@ ### Which Ordering Conventions (G) +* `LIBINT2_SHGAUSS_ORDERING` — G — Ordering for shells of solid harmonic Gaussians. [Default=standard] + * `standard` — standard ordering (-l, -l+1 ... l) + * `gaussian` — the Gaussian ordering (0, 1, -1, 2, -2, ... l, -l) + See [Solid Harmonic Ordering Scope and History](solid-harmonic-ordering-scope-and-history) +* `LIBINT2_CARTGAUSS_ORDERING` — G — Orderings for shells of cartesian Gaussians. [Default=standard] + * `standard` — standard ordering (xxx, xxy, xxz, xyy, xyz, xzz, yyy, ...) This is ordering of the Common Component Architecture (CCA) standard for molecular integral data exchange described in ["Components for Integral Evaluation in Quantum Chemistry", J. P. Kenny, C. L. Janssen, E. F. Valeev, and T. L. Windus, J. Comp. Chem. 29, 562 (2008)](http://dx.doi.org/10.1002/jcc.20815). + * `intv3` — intv3 ordering (yyy, yyz, yzz, zzz, xyy, xyz, xzz, xxy, xxz, xxx) This is used by IntV3, the default integral engine of [MPQC](https://github.com/evaleev/libint/wiki/www.mpqc.org). Use this to make Libint and IntV3 engines in MPQC interoperable. + * `gamess` — [GAMESS](http://www.msg.ameslab.gov/gamess/) ordering (xxx, yyy, zzz, xxy, xxz, yyx, yyz, zzx, zzy, xyz) + * `orca` — [ORCA](http://cec.mpg.de/forum/) ordering (hydrid between GAMESS and standard) + * `bagel` — [BAGEL](https://github.com/evaleev/libint/wiki/nubakery.org) axis-permuted version of intv3 (xxx, xxy, xyy, yyy, xxz, xyz, yyz, xzz, yzz, zzz) +* `LIBINT2_SHELL_SET` — G — Support computation of shell sets sets subject to these restrictions. [Default=standard] + * `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) + +#### Solid Harmonic Ordering Scope and History + +The use of the `LIBINT2_SHGAUSS_ORDERING` option has changed recently (Dec 2023). See also discussion in the "2023-12-12: 2.8.0" section of [CHANGES](https://github.com/evaleev/libint/blob/master/CHANGES) and in the "cdbb9f3" comment of [engine.h](https://github.com/evaleev/libint/blob/master/include/libint2/engine.h). + +Previous to v2.8.0, `LIBINT2_SHGAUSS_ORDERING` was set at generator-build-time for `Operator::sphemultipole` but was re-set-able at library-build-time for other integral classes for both the C and C++ interfaces. Certain macros, `INT_SOLIDHARMINDEX` and `FOR_SOLIDHARM` depended on the library-build-time choice for both the C and C++ interfaces. + +Starting at v2.8.0, the generator-build-time construction of `Operator::sphemultipole` has been _fixed at Standard ordering_; thus, the `LIBINT2_SHGAUSS_ORDERING` setting does not influence it. For the C++ interface, solid harmonic ordering for other integrals classes can be toggled at library runtime through `libint2::set_solid_harmonics_ordering`, and the "SOLIDHARM" macros have different forms for accessing either ordering; thus the library build-time `LIBINT2_SHGAUSS_ORDERING` setting is non-constraining. For the C interface, solid harmonic ordering for other integrals classes and the output of "SOLIDHARM" macros _is constrained_ by the `LIBINT2_SHGAUSS_ORDERING` setting. Currently, this setting is fixed at generator-build-time. The build system could be adjusted so that it's re-set-able at library-build-time, but the C interface is discouraged anyways. + +Note that options, docs, and CMake components are focused on the C++ interface, and the only remaining constraining influence of the `LIBINT2_SHGAUSS_ORDERING` option -- for the C interface -- may never be acknowledged beyond the previous paragraph. ### How High Angular Momentum (G) @@ -86,6 +121,9 @@ * `--enable-eri3=N` --> `-D ENABLE_ERI3=N` * `--enable-eri2=N` --> `-D ENABLE_ERI2=N` +* `--with-shgauss-ordering=label` --> `-D LIBINT2_SHGAUSS_ORDERING=label` +* `--with-cartgauss-ordering=label` --> `-D LIBINT2_CARTGAUSS_ORDERING=label` +* `--with-shell-set=label` --> `-D LIBINT2_SHELL_SET=label` * `--enable-eri3-pure-sh` --> `-D ERI3_PURE_SH=ON` * `--enable-eri2-pure-sh` --> `-D ERI2_PURE_SH=ON` diff --git a/cmake/modules/int_orderings.cmake b/cmake/modules/int_orderings.cmake new file mode 100644 index 000000000..5732fbfd5 --- /dev/null +++ b/cmake/modules/int_orderings.cmake @@ -0,0 +1,61 @@ +# handle the setting of the following variables +# * LIBINT_SHGSHELL_ORDERING* +# * LIBINT_CGSHELL_ORDERING* +# * LIBINT_SHELL_SET* + + +# <<< solid harmonic Gaussian orderings >>> + +set(LIBINT_SHGSHELL_ORDERING_STANDARD 1) +set(LIBINT_SHGSHELL_ORDERING_GAUSSIAN 2) + +string(TOLOWER "${LIBINT2_SHGAUSS_ORDERING}" LIBINT2_SHGAUSS_ORDERING_lower) + +if (LIBINT2_SHGAUSS_ORDERING_lower STREQUAL "standard") + set(LIBINT_SHGSHELL_ORDERING ${LIBINT_SHGSHELL_ORDERING_STANDARD}) +elseif (LIBINT2_SHGAUSS_ORDERING_lower STREQUAL "gaussian") + set(LIBINT_SHGSHELL_ORDERING ${LIBINT_SHGSHELL_ORDERING_GAUSSIAN}) +else() + message(FATAL_ERROR "Invalid value for LIBINT2_SHGAUSS_ORDERING (${LIBINT2_SHGAUSS_ORDERING})") +endif() + + +# <<< Cartesian Gaussian orderings >>> + +set(LIBINT_CGSHELL_ORDERING_STANDARD 1) +set(LIBINT_CGSHELL_ORDERING_INTV3 2) +set(LIBINT_CGSHELL_ORDERING_GAMESS 3) +set(LIBINT_CGSHELL_ORDERING_ORCA 4) +set(LIBINT_CGSHELL_ORDERING_BAGEL 5) + +string(TOLOWER "${LIBINT2_CARTGAUSS_ORDERING}" LIBINT2_CARTGAUSS_ORDERING_lower) + +if (LIBINT2_CARTGAUSS_ORDERING_lower STREQUAL "standard") + set(LIBINT_CGSHELL_ORDERING ${LIBINT_CGSHELL_ORDERING_STANDARD}) +elseif (LIBINT2_CARTGAUSS_ORDERING_lower STREQUAL "intv3") + set(LIBINT_CGSHELL_ORDERING ${LIBINT_CGSHELL_ORDERING_INTV3}) +elseif (LIBINT2_CARTGAUSS_ORDERING_lower STREQUAL "gamess") + set(LIBINT_CGSHELL_ORDERING ${LIBINT_CGSHELL_ORDERING_GAMESS}) +elseif (LIBINT2_CARTGAUSS_ORDERING_lower STREQUAL "orca") + set(LIBINT_CGSHELL_ORDERING ${LIBINT_CGSHELL_ORDERING_ORCA}) +elseif (LIBINT2_CARTGAUSS_ORDERING_lower STREQUAL "bagel") + set(LIBINT_CGSHELL_ORDERING ${LIBINT_CGSHELL_ORDERING_BAGEL}) +else() + message(FATAL_ERROR "Invalid value for LIBINT2_CARTGAUSS_ORDERING (${LIBINT2_CARTGAUSS_ORDERING})") +endif() + + +# <<< shell subset orderings >>> + +set(LIBINT_SHELL_SET_STANDARD 1) +set(LIBINT_SHELL_SET_ORCA 2) + +string(TOLOWER "${LIBINT2_SHELL_SET}" LIBINT2_SHELL_SET_lower) + +if (LIBINT2_SHELL_SET_lower STREQUAL "standard") + set(LIBINT_SHELL_SET ${LIBINT_SHELL_SET_STANDARD}) +elseif (LIBINT2_SHELL_SET_lower STREQUAL "orca") + set(LIBINT_SHELL_SET ${LIBINT_SHELL_SET_ORCA}) +else() + message(FATAL_ERROR "Invalid value for LIBINT2_SHELL_SET (${LIBINT2_SHELL_SET})") +endif() diff --git a/include/libint2/config.h.cmake.in b/include/libint2/config.h.cmake.in index 9bbd9f439..79e731fa7 100644 --- a/include/libint2/config.h.cmake.in +++ b/include/libint2/config.h.cmake.in @@ -149,6 +149,36 @@ /* Max optimized AM for G12DKH method integrals */ #cmakedefine G12DKH_OPT_AM @G12DKH_OPT_AM@ +/* Specifies the ordering of cartesian Gaussians in a shell. Allowed values are defined at the bottom of this file -- also see CMakeLists.txt */ +#cmakedefine LIBINT_CGSHELL_ORDERING @LIBINT_CGSHELL_ORDERING@ + +/* Specifies the ordering of solid harmonics Gaussians in a shell. Allowed values are defined at the bottom of this file -- also see CMakeLists.txt */ +#cmakedefine LIBINT_SHGSHELL_ORDERING @LIBINT_SHGSHELL_ORDERING@ + +/* Specifies the class of shell sets generated. Allowed values are defined at the bottom of this file -- also see CMakeLists.txt */ +#cmakedefine LIBINT_SHELL_SET @LIBINT_SHELL_SET@ + +/* + Known orderings of cartesian Gaussians +*/ +#cmakedefine LIBINT_CGSHELL_ORDERING_STANDARD @LIBINT_CGSHELL_ORDERING_STANDARD@ +#cmakedefine LIBINT_CGSHELL_ORDERING_INTV3 @LIBINT_CGSHELL_ORDERING_INTV3@ +#cmakedefine LIBINT_CGSHELL_ORDERING_GAMESS @LIBINT_CGSHELL_ORDERING_GAMESS@ +#cmakedefine LIBINT_CGSHELL_ORDERING_ORCA @LIBINT_CGSHELL_ORDERING_ORCA@ +#cmakedefine LIBINT_CGSHELL_ORDERING_BAGEL @LIBINT_CGSHELL_ORDERING_BAGEL@ + +/* + Known orderings of solid harmonic Gaussians +*/ +#cmakedefine LIBINT_SHGSHELL_ORDERING_STANDARD @LIBINT_SHGSHELL_ORDERING_STANDARD@ +#cmakedefine LIBINT_SHGSHELL_ORDERING_GAUSSIAN @LIBINT_SHGSHELL_ORDERING_GAUSSIAN@ + +/* + Known sets of shell sets +*/ +#cmakedefine LIBINT_SHELL_SET_STANDARD @LIBINT_SHELL_SET_STANDARD@ +#cmakedefine LIBINT_SHELL_SET_ORCA @LIBINT_SHELL_SET_ORCA@ + /* compiler type detection */ #define LIBINT_COMPILER_ID_GNU 0 #define LIBINT_COMPILER_ID_Clang 1 From 6f6b3f8eb7305a911fedc762b14809d7dae48c06 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Thu, 21 Dec 2023 14:32:03 -0500 Subject: [PATCH 2/5] another step --- CMakeLists.txt | 19 +++-- cmake/libint2-config.cmake.in | 44 ++++++++++++ cmake/modules/int_computed.cmake.in | 88 ++++++++++++++++++++++++ include/libint2/config.h.cmake.in | 3 + src/CMakeLists.txt | 1 + src/lib/CMakeLists.txt | 1 + src/lib/libint/CMakeLists.txt | 64 +++++++++++++++++ src/lib/libint/CMakeLists.txt.export | 45 ++++++++++++ src/lib/libint/configuration.cc | 47 ++----------- src/lib/libint/configuration.cc.cmake.in | 65 +++++++++++++++++ src/lib/libint/features.cmake.in | 1 + 11 files changed, 330 insertions(+), 48 deletions(-) create mode 100644 cmake/libint2-config.cmake.in create mode 100644 cmake/modules/int_computed.cmake.in create mode 100644 src/CMakeLists.txt create mode 100644 src/lib/CMakeLists.txt create mode 100644 src/lib/libint/CMakeLists.txt create mode 100644 src/lib/libint/CMakeLists.txt.export create mode 100644 src/lib/libint/configuration.cc.cmake.in create mode 100644 src/lib/libint/features.cmake.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 830fbe519..b43e98fae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ dynamic_version( PROJECT_PREFIX Libint2Compiler_ GIT_ARCHIVAL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/.git_archival.txt OUTPUT_COMMIT LibintRepository_COMMIT - OUTPUT_VERSION LibintRepository_VERSION + OUTPUT_VERSION LibintRepository_VERSION OUTPUT_DESCRIBE LibintRepository_DESCRIBE OUTPUT_DISTANCE LibintRepository_DISTANCE ) @@ -30,7 +30,7 @@ project( # * http://libint.valeyev.net/ redirects to https://github.com/evaleev/libint set(${PROJECT_NAME}_AUTHORS "Edward F. Valeev") -set(${PROJECT_NAME}_LICENSE "GPL-3.0 for generator; LGPL-3.0 for generated") +set(${PROJECT_NAME}_LICENSE "GPL-3.0-only for generator; LGPL-3.0-only for generated library") # along with project(... VERSION) above scanned by dynamic_version() from `git # describe`, these are the authoritative version source (formerly in configure.ac) @@ -222,12 +222,21 @@ booleanize01(ERI2_PURE_SH) booleanize01(DISABLE_ONEBODY_PROPERTY_DERIVS) booleanize01(SUPPORT_T1G12) + ################################## Main Project ################################# -configure_file(include/libint2/config.h.cmake.in include/libint2/config.h @ONLY) +set(EXPORT_STAGE_DIR ${PROJECT_BINARY_DIR}/libint-${LIBINT_EXT_VERSION}) + +configure_file( + cmake/modules/int_computed.cmake.in + cmake/modules/int_computed.cmake + @ONLY) +configure_file( + include/libint2/config.h.cmake.in + include/libint2/config.h + @ONLY) -# STRICTLY TEMPORARY FOR DEMONSTRATION PURPOSES -configure_file(src/lib/libint/configuration.cc configuration.cc @ONLY) +add_subdirectory(src) message("") feature_summary(WHAT ENABLED_FEATURES DESCRIPTION "Libint Enabled features:") diff --git a/cmake/libint2-config.cmake.in b/cmake/libint2-config.cmake.in new file mode 100644 index 000000000..107b2ec73 --- /dev/null +++ b/cmake/libint2-config.cmake.in @@ -0,0 +1,44 @@ +# libint2-config.cmake +# -------------------- +# +# Libint2 cmake module. +# This module sets the following variables in your project: +# +# :: +# Libint2_MAX_AM_ERI - maximum angular momentum level of Libint2 libraries for 4-center energy +# integrals. Prefer target variable. +# +# +# Available components: +# +# :: +# +# +# cart shell_set used_by +# -------- --------- ------- +# ( psi4 requires runtime-setting of ) +# ss - search for standard + standard = mpqc4, cp2k, psi4 ( solid harmonic ordering to Gaussian ) +# so - search for + orca +# is - search for intv3 + standard = mpqc3 +# io - search for + orca +# gs - search for gamess + standard = gamess +# go - search for + orca +# os - search for orca + standard +# oo - search for + orca = orca +# bs - search for bagel + standard = bagel +# bo - search for + orca + +@PACKAGE_INIT@ + +set(pnv libint2) # projectnameversion +set(L2 Libint2) # NameSpace + + +# check orderings, AM, & derivatives components +set(${L2}_MAX_AM_ERI @Libint2_MAX_AM_ERI@) # Libint2_MAX_AM_ERI +foreach(_eri @Libint2_CONFIG_COMPONENTS@) # Libint2_CONFIG_COMPONENTS + set(${L2}_${_eri}_FOUND 1) +endforeach() + + + diff --git a/cmake/modules/int_computed.cmake.in b/cmake/modules/int_computed.cmake.in new file mode 100644 index 000000000..504be6b8d --- /dev/null +++ b/cmake/modules/int_computed.cmake.in @@ -0,0 +1,88 @@ +# This file communicates top-level CMake configuration results to +# export stage (in a very minor way that could be worked around) and to +# library stage (in a major way). If the superbuild was run continuously +# (generator->export->library), these would be more properly passed +# through the ExternalProject_Add commands. However, since library is +# commonly built separately from tarball, this file is better storage. +# To contrast, config.h transmits CMake data to C++, while this file transmits +# CMake data to (discontinuous) CMake. + + +# <<< Sortable Version >>> + +# for configuration.cc and `project(Libint2 VERSION` in CMakeLists.txt.export files +set(LIBINT_DESCRIPTION "@LIBINT_DESCRIPTION@") + +# for configuration.cc file +set(LIBINT_DOI "@LIBINT_DOI@") +set(LIBINT_GIT_COMMIT "@LIBINT_GIT_COMMIT@") +set(LIBINT_VERSION_YEAR "@LIBINT_VERSION_YEAR@") +set(LIBINT_SORTABLE_VERSION "@LIBINT_SORTABLE_VERSION@") + + +# <<< Build Version >>> + +# for `project(Libint2 VERSION` in CMakeLists.txt.export +set(LIBINT_MAJOR_VERSION "@LIBINT_MAJOR_VERSION@") +set(LIBINT_MINOR_VERSION "@LIBINT_MINOR_VERSION@") +set(LIBINT_MICRO_VERSION "@LIBINT_MICRO_VERSION@") +set(LIBINT_VERSION ${LIBINT_MAJOR_VERSION}.${LIBINT_MINOR_VERSION}.${LIBINT_MICRO_VERSION}) + + + + +# <<< Features List >>> + +if ((@LIBINT_CGSHELL_ORDERING@ EQUAL 1) AND (@LIBINT_SHELL_SET@ EQUAL 1)) + set(_ordering "ss") +elseif((@LIBINT_CGSHELL_ORDERING@ EQUAL 1) AND (@LIBINT_SHELL_SET@ EQUAL 2)) + set(_ordering "so") +elseif((@LIBINT_CGSHELL_ORDERING@ EQUAL 2) AND (@LIBINT_SHELL_SET@ EQUAL 1)) + set(_ordering "is") +elseif((@LIBINT_CGSHELL_ORDERING@ EQUAL 2) AND (@LIBINT_SHELL_SET@ EQUAL 2)) + set(_ordering "io") +elseif((@LIBINT_CGSHELL_ORDERING@ EQUAL 3) AND (@LIBINT_SHELL_SET@ EQUAL 1)) + set(_ordering "gs") +elseif((@LIBINT_CGSHELL_ORDERING@ EQUAL 3) AND (@LIBINT_SHELL_SET@ EQUAL 2)) + set(_ordering "go") +elseif((@LIBINT_CGSHELL_ORDERING@ EQUAL 4) AND (@LIBINT_SHELL_SET@ EQUAL 1)) + set(_ordering "os") +elseif((@LIBINT_CGSHELL_ORDERING@ EQUAL 4) AND (@LIBINT_SHELL_SET@ EQUAL 2)) + set(_ordering "oo") +elseif((@LIBINT_CGSHELL_ORDERING@ EQUAL 5) AND (@LIBINT_SHELL_SET@ EQUAL 1)) + set(_ordering "bs") +elseif((@LIBINT_CGSHELL_ORDERING@ EQUAL 5) AND (@LIBINT_SHELL_SET@ EQUAL 2)) + set(_ordering "bo") +elseif((@LIBINT_CGSHELL_ORDERING@ EQUAL 1) AND (@LIBINT_SHELL_SET@ EQUAL 1)) + set(_ordering "ss") +elseif((@LIBINT_CGSHELL_ORDERING@ EQUAL 1) AND (@LIBINT_SHELL_SET@ EQUAL 2)) + set(_ordering "so") +elseif((@LIBINT_CGSHELL_ORDERING@ EQUAL 2) AND (@LIBINT_SHELL_SET@ EQUAL 1)) + set(_ordering "is") +elseif((@LIBINT_CGSHELL_ORDERING@ EQUAL 2) AND (@LIBINT_SHELL_SET@ EQUAL 2)) + set(_ordering "io") +elseif((@LIBINT_CGSHELL_ORDERING@ EQUAL 3) AND (@LIBINT_SHELL_SET@ EQUAL 1)) + set(_ordering "gs") +elseif((@LIBINT_CGSHELL_ORDERING@ EQUAL 3) AND (@LIBINT_SHELL_SET@ EQUAL 2)) + set(_ordering "go") +elseif((@LIBINT_CGSHELL_ORDERING@ EQUAL 4) AND (@LIBINT_SHELL_SET@ EQUAL 1)) + set(_ordering "os") +elseif((@LIBINT_CGSHELL_ORDERING@ EQUAL 4) AND (@LIBINT_SHELL_SET@ EQUAL 2)) + set(_ordering "oo") +elseif((@LIBINT_CGSHELL_ORDERING@ EQUAL 5) AND (@LIBINT_SHELL_SET@ EQUAL 1)) + set(_ordering "bs") +elseif((@LIBINT_CGSHELL_ORDERING@ EQUAL 5) AND (@LIBINT_SHELL_SET@ EQUAL 2)) + set(_ordering "bo") +else() + message(STATUS "int_computed.cmake: indeterminate orderings") +endif() + +# for configuration.cc and libint2-config.cmake files +set(Libint2_CONFIG_COMPONENTS "@Libint2_ERI_COMPONENTS@") +list(PREPEND Libint2_CONFIG_COMPONENTS "${_ordering}") + + +# <<< AM Components >>> + +# for features and libint2-config.cmake files +set(Libint2_MAX_AM_ERI "@_candidate_ERI_d0@") diff --git a/include/libint2/config.h.cmake.in b/include/libint2/config.h.cmake.in index 79e731fa7..80da8c8ee 100644 --- a/include/libint2/config.h.cmake.in +++ b/include/libint2/config.h.cmake.in @@ -142,6 +142,9 @@ /* Support [Ti,G12] ? */ #cmakedefine01 SUPPORT_T1G12 +#ifndef INCLUDE_G12 +#undef SUPPORT_T1G12 +#endif /* Max AM for G12DKH method integrals */ #cmakedefine G12DKH_MAX_AM @G12DKH_MAX_AM@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 000000000..3ea7a4199 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(lib) diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt new file mode 100644 index 000000000..b68f43a45 --- /dev/null +++ b/src/lib/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(libint) diff --git a/src/lib/libint/CMakeLists.txt b/src/lib/libint/CMakeLists.txt new file mode 100644 index 000000000..f07b88711 --- /dev/null +++ b/src/lib/libint/CMakeLists.txt @@ -0,0 +1,64 @@ +list(APPEND CMAKE_MODULE_PATH ${PROJECT_BINARY_DIR}/cmake/modules) + +include(int_computed) # for macros.tex and features + +add_custom_target(libint-library-generate DEPENDS "CMakeLists.txt.export") # TODO "${EXPORT_STAGE_DIR}/src/libint2_params.h") + +# <<< Add Metadata To The Library Source >>> + +configure_file( + "features.cmake.in" + "${EXPORT_STAGE_DIR}/features" + @ONLY) + +add_custom_command( + OUTPUT + ${EXPORT_STAGE_DIR}/CMakeLists.txt + DEPENDS + "${CMAKE_CURRENT_SOURCE_DIR}/populate.cmake" + libint-library-generate + COMMAND ${CMAKE_COMMAND} + "-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}" + "-DPROJECT_BINARY_DIR=${PROJECT_BINARY_DIR}" + "-DEXPORT_STAGE_DIR=${EXPORT_STAGE_DIR}" + -P ${CMAKE_CURRENT_SOURCE_DIR}/populate.cmake + COMMENT "Populating Libint2 library" + ) +add_custom_target(libint-library-populate DEPENDS ${EXPORT_STAGE_DIR}/CMakeLists.txt) + + +# <<< Export The Library Source >>> + +add_custom_command( + OUTPUT + "${EXPORT_STAGE_DIR}.tgz" + COMMAND ${CMAKE_COMMAND} -E tar "cfz" "${EXPORT_STAGE_DIR}.tgz" "${EXPORT_STAGE_DIR}" + DEPENDS + libint-library-generate + libint-library-populate + WORKING_DIRECTORY "${EXPORT_STAGE_DIR}/.." + COMMENT "Exporting tarball of Libint2 library source" + ) +add_custom_target(libint-library-export DEPENDS "${EXPORT_STAGE_DIR}.tgz") + + + # <<< Build Library >>> + + include(ExternalProject) + ExternalProject_Add( + library + DEPENDS + libint-library-export + BUILD_ALWAYS 1 + # download generalized to generating source by unpacking source tarball + # * DOWNLOAD_DIR is tidier but fails on Windows + URL "${EXPORT_STAGE_DIR}.tgz" + LOG_DOWNLOAD 1 + CMAKE_CACHE_ARGS + -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} + -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS} + -DCMAKE_CXX_COMPILER_ARG1:STRING=${CMAKE_CXX_COMPILER_ARG1} + -DCMAKE_C_COMPILER_ARG1:STRING=${CMAKE_C_COMPILER_ARG1} + -DCMAKE_PREFIX_PATH:STRING=${CMAKE_PREFIX_PATH} + ) + diff --git a/src/lib/libint/CMakeLists.txt.export b/src/lib/libint/CMakeLists.txt.export new file mode 100644 index 000000000..a50fb8f10 --- /dev/null +++ b/src/lib/libint/CMakeLists.txt.export @@ -0,0 +1,45 @@ +cmake_minimum_required(VERSION 3.16) # 3.16: unity build + # 3.15: new Python detection + # 3.8: introduced C++ standards as features +cmake_policy(SET CMP0074 NEW) +cmake_policy(SET CMP0079 NEW) + +############################# Version and Metadata ############################# + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) +include(int_computed) + +project( + Libint2 + VERSION ${LIBINT_VERSION} + DESCRIPTION ${LIBINT_DESCRIPTION} + HOMEPAGE_URL "http://libint.valeyev.net" + LANGUAGES CXX + ) + +set(${PROJECT_NAME}_AUTHORS "Edward F. Valeev") +set(${PROJECT_NAME}_LICENSE "LGPL-3.0-only") + +set(L2 Libint2) # Namespace +set(pnv libint2) # projectnameversion + +################################# Main Project ################################# +include(CMakePackageConfigHelpers) + +configure_package_config_file( + cmake/${pnv}-config.cmake.in + "${CMAKE_CURRENT_BINARY_DIR}/${pnv}-config.cmake" + INSTALL_DESTINATION "lib/cmake/libint2" # TODO ${LIBINT2_INSTALL_CMAKEDIR} + NO_SET_AND_CHECK_MACRO + ) + +install( + DIRECTORY + ${PROJECT_BINARY_DIR}/include/ + ${PROJECT_SOURCE_DIR}/include/ + TYPE INCLUDE + COMPONENT ${L2}_Development + FILES_MATCHING + PATTERN "*.h" + PATTERN "*.hpp" + ) diff --git a/src/lib/libint/configuration.cc b/src/lib/libint/configuration.cc index aa4edc5e6..1ce3108e7 100644 --- a/src/lib/libint/configuration.cc +++ b/src/lib/libint/configuration.cc @@ -18,49 +18,10 @@ * */ -#include - -#include -#include - -const char *configuration_accessor(void) { +/* Runtime accessor for the library configuration: + integral derivatives, AM, orderings, etc. + @return the semicolon-separated strings from CMake components */ +const char* configuration_accessor() { // return "@Libint2_CONFIG_COMPONENTS@"; return "(nyi)"; } - -void libint_version(int *major, int *minor, int *micro) { - *major = -1; - *minor = -1; - *micro = -1; - std::sscanf(libint_version_string(false), "%d.%d.%d", major, minor, micro); -} - -const char *libint_version_string(bool ext) { - if (ext) - return "@LIBINT_SORTABLE_VERSION@"; - else - return "@LIBINT_VERSION@"; -} - -const char *libint_commit(void) { return "@LIBINT_GIT_COMMIT@"; } - -const char *libint_reference(void) { - std::string ref = "Libint: @LIBINT_DESCRIPTION@, Version " + - std::string(libint_version_string(true)) + - " Edward F. Valeev, http://libint.valeyev.net/"; - - auto slen = ref.length(); - char *cref = new char[slen + 1]; - std::memcpy(cref, ref.c_str(), slen); - cref[slen] = '\0'; - return cref; -} - -const char *libint_reference_doi(void) { return "@LIBINT_DOI@"; } - -const char *libint_bibtex(void) { - return "@Misc{Libint2,\n author = {E.~F.~Valeev},\n title = " - "{\\textsc{Libint}: @LIBINT_DESCRIPTION@},\n " - "howpublished = {http://libint.valeyev.net/},\n note = {version " - "@Libint2_VERSION@},\n year = {@LIBINT_VERSION_YEAR@}\n}\n"; -} diff --git a/src/lib/libint/configuration.cc.cmake.in b/src/lib/libint/configuration.cc.cmake.in new file mode 100644 index 000000000..d1777ead7 --- /dev/null +++ b/src/lib/libint/configuration.cc.cmake.in @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2004-2023 Edward F. Valeev + * + * This file is part of Libint. + * + * Libint is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Libint is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Libint. If not, see . + * + */ + +#include + +#include +#include + +const char *configuration_accessor(void) { + return "@Libint2_CONFIG_COMPONENTS@"; +} + +void libint_version(int *major, int *minor, int *micro) { + *major = -1; + *minor = -1; + *micro = -1; + std::sscanf(libint_version_string(false), "%d.%d.%d", major, minor, micro); +} + +const char *libint_version_string(bool ext) { + if (ext) + return "@LIBINT_SORTABLE_VERSION@"; + else + return "@LIBINT_VERSION@"; +} + +const char *libint_commit(void) { return "@LIBINT_GIT_COMMIT@"; } + +const char *libint_reference(void) { + std::string ref = "Libint: @LIBINT_DESCRIPTION@, Version " + + std::string(libint_version_string(true)) + + " Edward F. Valeev, http://libint.valeyev.net/"; + + auto slen = ref.length(); + char *cref = new char[slen + 1]; + std::memcpy(cref, ref.c_str(), slen); + cref[slen] = '\0'; + return cref; +} + +const char *libint_reference_doi(void) { return "@LIBINT_DOI@"; } + +const char *libint_bibtex(void) { + return "@Misc{Libint2,\n author = {E.~F.~Valeev},\n title = " + "{\\textsc{Libint}: @LIBINT_DESCRIPTION@},\n " + "howpublished = {http://libint.valeyev.net/},\n note = {version " + "@Libint2_VERSION@},\n year = {@LIBINT_VERSION_YEAR@}\n}\n"; +} diff --git a/src/lib/libint/features.cmake.in b/src/lib/libint/features.cmake.in new file mode 100644 index 000000000..83066c072 --- /dev/null +++ b/src/lib/libint/features.cmake.in @@ -0,0 +1 @@ +LIBINT_ERI_MAX_AM = @Libint2_MAX_AM_ERI@ From 3745b83900b54bc137649ee6db95920a8a1fcbf2 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Thu, 21 Dec 2023 19:12:50 -0500 Subject: [PATCH 3/5] tidy again --- CMakeLists.txt | 15 ++++++++++++ cmake/libint2-config.cmake.in | 3 +++ cmake/modules/int_computed.cmake.in | 8 +++++++ include/libint2/config.h.cmake.in | 4 ++++ include/libint2/config2.h.cmake.in | 36 ++++++++++++++++++++++++++++ src/lib/libint/CMakeLists.txt.export | 31 ++++++++++++++++++++++-- src/lib/libint/features.cmake.in | 7 ++++++ src/lib/libint/populate.cmake | 27 +++++++++++++++++++++ 8 files changed, 129 insertions(+), 2 deletions(-) create mode 100644 include/libint2/config2.h.cmake.in create mode 100644 src/lib/libint/populate.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index b43e98fae..2175aed7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -231,10 +231,25 @@ configure_file( cmake/modules/int_computed.cmake.in cmake/modules/int_computed.cmake @ONLY) + +# CMake data transmitted to C++ via config.h for generator/compiler (_EXPORT_MODE=0). +# Same info is positioned for the library export, but _EXPORT_MODE=1 turns on +# inclusion of config2.h to be filled in later by user re-set-able options at +# library build time. +set(_EXPORT_MODE 0) configure_file( include/libint2/config.h.cmake.in include/libint2/config.h @ONLY) +set(_EXPORT_MODE 1) +configure_file( + include/libint2/config.h.cmake.in + ${EXPORT_STAGE_DIR}/include/libint2/config.h + @ONLY) +configure_file( + include/libint2/config2.h.cmake.in + ${EXPORT_STAGE_DIR}/include/libint2/config2.h.cmake.in + COPYONLY) add_subdirectory(src) diff --git a/cmake/libint2-config.cmake.in b/cmake/libint2-config.cmake.in index 107b2ec73..802cf0cfe 100644 --- a/cmake/libint2-config.cmake.in +++ b/cmake/libint2-config.cmake.in @@ -35,6 +35,9 @@ set(L2 Libint2) # NameSpace # check orderings, AM, & derivatives components +# * LIBINT2_SHGAUSS_ORDERING = @LIBINT2_SHGAUSS_ORDERING@ +# * LIBINT2_CARTGAUSS_ORDERING = @LIBINT2_CARTGAUSS_ORDERING@ +# * LIBINT2_SHELL_SET = @LIBINT2_SHELL_SET@ set(${L2}_MAX_AM_ERI @Libint2_MAX_AM_ERI@) # Libint2_MAX_AM_ERI foreach(_eri @Libint2_CONFIG_COMPONENTS@) # Libint2_CONFIG_COMPONENTS set(${L2}_${_eri}_FOUND 1) diff --git a/cmake/modules/int_computed.cmake.in b/cmake/modules/int_computed.cmake.in index 504be6b8d..6ae871b8e 100644 --- a/cmake/modules/int_computed.cmake.in +++ b/cmake/modules/int_computed.cmake.in @@ -31,6 +31,14 @@ set(LIBINT_VERSION ${LIBINT_MAJOR_VERSION}.${LIBINT_MINOR_VERSION}.${LIBINT_MICR +# <<< Fixed Orderings >>> + +# for CMakeLists.txt.export and libint2-config.cmake +set(LIBINT2_SHGAUSS_ORDERING "@LIBINT2_SHGAUSS_ORDERING@") # added Jan 2023 +set(LIBINT2_CARTGAUSS_ORDERING "@LIBINT2_CARTGAUSS_ORDERING@") +set(LIBINT2_SHELL_SET "@LIBINT2_SHELL_SET@") + + # <<< Features List >>> if ((@LIBINT_CGSHELL_ORDERING@ EQUAL 1) AND (@LIBINT_SHELL_SET@ EQUAL 1)) diff --git a/include/libint2/config.h.cmake.in b/include/libint2/config.h.cmake.in index 80da8c8ee..54c8a2094 100644 --- a/include/libint2/config.h.cmake.in +++ b/include/libint2/config.h.cmake.in @@ -233,4 +233,8 @@ #define LIBINT_DEPRECATED(msg) LIBINT_XPRAGMA( LIBINT_CONCAT(message, msg) ) #endif +#if @_EXPORT_MODE@ +#include "libint2/config2.h" +#endif + #endif /* header guard */ diff --git a/include/libint2/config2.h.cmake.in b/include/libint2/config2.h.cmake.in new file mode 100644 index 000000000..bf9d976f9 --- /dev/null +++ b/include/libint2/config2.h.cmake.in @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2004-2023 Edward F. Valeev + * + * This file is part of Libint. + * + * Libint is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Libint is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Libint. If not, see . + * + */ + +/* This file is automatically processed by configure script. + It MUST NOT be changed manually after configuration, otherwise + the library will likely fail to compile or produce erroneous results + */ + +/* EXTRA DEFINES DETERMINED BY CONFIGURE OF THE EXPORTED LIBRARY */ + +#ifndef _libint2_include_libint2_config_h_1 +#define _libint2_include_libint2_config_h_1 + +/* retired Jan 2023 #undef LIBINT_SHGSHELL_ORDERING */ + +/* Specifies the ordering of solid harmonics Gaussians in a shell. Retired Jan 2023 in favor of becoming a generator-time-only option */ +/* #cmakedefine LIBINT_SHGSHELL_ORDERING @LIBINT_SHGSHELL_ORDERING@ */ + +#endif /* header guard */ diff --git a/src/lib/libint/CMakeLists.txt.export b/src/lib/libint/CMakeLists.txt.export index a50fb8f10..55d5cb237 100644 --- a/src/lib/libint/CMakeLists.txt.export +++ b/src/lib/libint/CMakeLists.txt.export @@ -23,9 +23,37 @@ set(${PROJECT_NAME}_LICENSE "LGPL-3.0-only") set(L2 Libint2) # Namespace set(pnv libint2) # projectnameversion +################################### Options #################################### +include(options) + +# <<< Ordering Conventions >>> + +# retired Jan 2023 # option_with_default(LIBINT2_SHGAUSS_ORDERING "Ordering for shells of solid harmonic Gaussians: standard or gaussian" standard) +set(LIBINT2_SHGAUSS_ORDERING ${LIBINT2_SHGAUSS_ORDERING}) +message(STATUS "Setting option LIBINT2_SHGAUSS_ORDERING: ${LIBINT2_SHGAUSS_ORDERING} (read-only from generation-time)") + +set(LIBINT2_CARTGAUSS_ORDERING ${LIBINT2_CARTGAUSS_ORDERING}) +message(STATUS "Setting option LIBINT2_CARTGAUSS_ORDERING: ${LIBINT2_CARTGAUSS_ORDERING} (read-only from generation-time)") + +set(LIBINT2_SHELL_SET ${LIBINT2_SHELL_SET}) +message(STATUS "Setting option LIBINT2_SHELL_SET: ${LIBINT2_SHELL_SET} (read-only from generation-time)") + + ################################# Main Project ################################# include(CMakePackageConfigHelpers) +configure_file( + include/libint2/config2.h.cmake.in + include/libint2/config2.h + @ONLY) +# configuration.cc defines a string summary of capabilities. @ONLY is maximally +# deferred in case config2 changes the summary (as it used to when +# LIBINT_SHGSHELL_ORDERING was library-config-time selected). +configure_file( + src/configuration.cc.cmake.in + src/configuration.cc + @ONLY) + configure_package_config_file( cmake/${pnv}-config.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/${pnv}-config.cmake" @@ -35,8 +63,7 @@ configure_package_config_file( install( DIRECTORY - ${PROJECT_BINARY_DIR}/include/ - ${PROJECT_SOURCE_DIR}/include/ + ${PROJECT_SOURCE_DIR}/include2/ # TODO temp for skeleton TYPE INCLUDE COMPONENT ${L2}_Development FILES_MATCHING diff --git a/src/lib/libint/features.cmake.in b/src/lib/libint/features.cmake.in index 83066c072..1c2ca9344 100644 --- a/src/lib/libint/features.cmake.in +++ b/src/lib/libint/features.cmake.in @@ -1 +1,8 @@ +LIBINT_SUPPORTS_ONEBODY = @LIBINT_SUPPORTS_ONEBODY@ +LIBINT_ONEBODY_DERIV = @LIBINT_ONEBODY_DERIV@ +LIBINT_SUPPORTS_ERI = @LIBINT_SUPPORTS_ERI@ LIBINT_ERI_MAX_AM = @Libint2_MAX_AM_ERI@ +LIBINT_ERI_DERIV = @LIBINT_ERI_DERIV@ +LIBINT_SHELL_SET = @LIBINT_SHELL_SET@ +LIBINT_SHGSHELL_ORDERING = @LIBINT_SHGSHELL_ORDERING@ +LIBINT_SHGSHELL_ORDERING_STANDARD = @LIBINT_SHGSHELL_ORDERING_STANDARD@ diff --git a/src/lib/libint/populate.cmake b/src/lib/libint/populate.cmake new file mode 100644 index 000000000..333d6f479 --- /dev/null +++ b/src/lib/libint/populate.cmake @@ -0,0 +1,27 @@ +set(LIBRARY_SOURCE_DIR ${PROJECT_SOURCE_DIR}/src/lib/libint) + +file( + INSTALL + "${PROJECT_SOURCE_DIR}/cmake/modules/int_orderings.cmake" + "${PROJECT_SOURCE_DIR}/cmake/modules/options.cmake" + "${PROJECT_BINARY_DIR}/cmake/modules/int_computed.cmake" + DESTINATION "${EXPORT_STAGE_DIR}/cmake/modules" + ) + +file( + INSTALL + "${PROJECT_SOURCE_DIR}/cmake/libint2-config.cmake.in" + DESTINATION "${EXPORT_STAGE_DIR}/cmake" + ) + +configure_file( + "${LIBRARY_SOURCE_DIR}/CMakeLists.txt.export" + "${EXPORT_STAGE_DIR}/CMakeLists.txt" + COPYONLY) + +file( + INSTALL + "${PROJECT_SOURCE_DIR}/src/lib/libint/configuration.cc.cmake.in" + DESTINATION "${EXPORT_STAGE_DIR}/src" + ) + From 58d2ec54696a34f08a1b1fdc70d7a7878f14ac00 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Thu, 21 Dec 2023 23:47:31 -0500 Subject: [PATCH 4/5] rest --- CMakeLists.txt | 2 +- cmake/libint2-config.cmake.in | 15 +++++++++++++++ cmake/modules/int_computed.cmake.in | 15 ++++++++++++++- cmake/modules/int_versions.cmake | 16 ++++++++-------- include/libint2/config.h.cmake.in | 12 ++++++++++++ src/lib/libint/CMakeLists.txt.export | 4 ++++ 6 files changed, 54 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2175aed7f..2a0142cd9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ set(${PROJECT_NAME}_LICENSE "GPL-3.0-only for generator; LGPL-3.0-only for gener # along with project(... VERSION) above scanned by dynamic_version() from `git # describe`, these are the authoritative version source (formerly in configure.ac) set(LIBINT_BUILDID "post999") -set(LIBINT_SOVERSION "2:3:0") +set(LIBINT_SO_VERSION "2:3:0") set(LIBINT_DOI "10.5281/zenodo.10369117") # 2.8.0 include(int_versions) diff --git a/cmake/libint2-config.cmake.in b/cmake/libint2-config.cmake.in index 802cf0cfe..99cfc6d2b 100644 --- a/cmake/libint2-config.cmake.in +++ b/cmake/libint2-config.cmake.in @@ -5,6 +5,8 @@ # This module sets the following variables in your project: # # :: +# +# Libint2_EXT_VERSION - Libint2 version including buildid, such as beta.3. Prefer target variable. # Libint2_MAX_AM_ERI - maximum angular momentum level of Libint2 libraries for 4-center energy # integrals. Prefer target variable. # @@ -13,6 +15,17 @@ # # :: # +# See https://github.com/evaleev/libint/blob/master/INSTALL.md#configuration-codes +# for more details on these codes. +# +# multipole_hh_dD - search for including spherical multipole integrals +# onebody_hh_dD - search for library including 1-body integrals +# eri_hhhh_dD - search for library including 2-body integrals with 4 centers +# eri_hhL_dD - search for library including 2-body integrals with 3 centers +# eri_hhl_dD - ditto +# eri_HH_dD - search for library including 2-body integrals with 2 centers +# eri_hh_dD - ditto +# g12_hhhh_dD - search for library including F12 integrals with Gaussian factors # # cart shell_set used_by # -------- --------- ------- @@ -33,6 +46,8 @@ set(pnv libint2) # projectnameversion set(L2 Libint2) # NameSpace +set(Libint2_EXT_VERSION "@LIBINT_EXT_VERSION@") + # check orderings, AM, & derivatives components # * LIBINT2_SHGAUSS_ORDERING = @LIBINT2_SHGAUSS_ORDERING@ diff --git a/cmake/modules/int_computed.cmake.in b/cmake/modules/int_computed.cmake.in index 6ae871b8e..1511d08bb 100644 --- a/cmake/modules/int_computed.cmake.in +++ b/cmake/modules/int_computed.cmake.in @@ -22,13 +22,26 @@ set(LIBINT_SORTABLE_VERSION "@LIBINT_SORTABLE_VERSION@") # <<< Build Version >>> -# for `project(Libint2 VERSION` in CMakeLists.txt.export +# for libint2-config.cmake and `project(Libint2 VERSION` in CMakeLists.txt.export files set(LIBINT_MAJOR_VERSION "@LIBINT_MAJOR_VERSION@") set(LIBINT_MINOR_VERSION "@LIBINT_MINOR_VERSION@") set(LIBINT_MICRO_VERSION "@LIBINT_MICRO_VERSION@") set(LIBINT_VERSION ${LIBINT_MAJOR_VERSION}.${LIBINT_MINOR_VERSION}.${LIBINT_MICRO_VERSION}) +# <<< Dev Version >>> + +# for libint2-config.cmake +set(LIBINT_EXT_VERSION "@LIBINT_EXT_VERSION@") +message(STATUS "Version: Full ${LIBINT_EXT_VERSION} Numeric ${LIBINT_VERSION} Sortable ${LIBINT_SORTABLE_VERSION}") + + +# <<< ABI Version >>> + +# for SOVERSION in CMakeLists.txt.export +set(LIBINT_SO_VERSION "@LIBINT_SO_VERSION@") +set(LIBINT_MAJOR_SO_VERSION "@LIBINT_MAJOR_SO_VERSION@") +message(STATUS "SO Version: Full ${LIBINT_SO_VERSION} Major ${LIBINT_MAJOR_SO_VERSION}") # <<< Fixed Orderings >>> diff --git a/cmake/modules/int_versions.cmake b/cmake/modules/int_versions.cmake index 973e51b46..35c6e9d13 100644 --- a/cmake/modules/int_versions.cmake +++ b/cmake/modules/int_versions.cmake @@ -2,7 +2,7 @@ # * PROJECT_VERSION_{MAJOR|MINOR|PATCH} through `project(... VERSION)` # * Libint2Compiler_DESCRIPTION through `project(... DESCRIPTION)` # * LIBINT_BUILDID -# * LIBINT_SOVERSION +# * LIBINT_SO_VERSION # * LIBINT_DOI # * LibintRepository_{VERSION|DESCRIBE|COMMIT|DISTANCE} through `dynamic_version()` @@ -56,17 +56,17 @@ message(STATUS "Version: Full ${LIBINT_EXT_VERSION} Numeric ${LIBINT_VERSION} So if (NOT(LibintRepository_VERSION STREQUAL LIBINT_VERSION)) message(AUTHOR_WARNING - "Version processing has gone wrong: ${LibintRepository_VERSION STREQUAL} != ${LIBINT_VERSION}") + "Version processing has gone wrong: ${LibintRepository_VERSION} != ${LIBINT_VERSION}") endif() # <<< ABI Version >>> -string(REPLACE ":" ";" LIBINT_SOVERSION_LIST ${LIBINT_SOVERSION}) +string(REPLACE ":" ";" LIBINT_SO_VERSION_LIST ${LIBINT_SO_VERSION}) -list(GET LIBINT_SOVERSION_LIST 0 LIBINT_CURRENT_SOVERSION) -list(GET LIBINT_SOVERSION_LIST 1 LIBINT_REVISION_SOVERSION) -list(GET LIBINT_SOVERSION_LIST 2 LIBINT_AGE_SOVERSION) +list(GET LIBINT_SO_VERSION_LIST 0 LIBINT_CURRENT_SO_VERSION) +list(GET LIBINT_SO_VERSION_LIST 1 LIBINT_REVISION_SO_VERSION) +list(GET LIBINT_SO_VERSION_LIST 2 LIBINT_AGE_SO_VERSION) -math(EXPR LIBINT_MAJOR_SOVERSION "${LIBINT_CURRENT_SOVERSION} - ${LIBINT_AGE_SOVERSION}") -message(STATUS "SO Version: Full ${LIBINT_SOVERSION} Major ${LIBINT_MAJOR_SOVERSION}") +math(EXPR LIBINT_MAJOR_SO_VERSION "${LIBINT_CURRENT_SO_VERSION} - ${LIBINT_AGE_SO_VERSION}") +message(STATUS "SO Version: Full ${LIBINT_SO_VERSION} Major ${LIBINT_MAJOR_SO_VERSION}") diff --git a/include/libint2/config.h.cmake.in b/include/libint2/config.h.cmake.in index 54c8a2094..08e7d9d26 100644 --- a/include/libint2/config.h.cmake.in +++ b/include/libint2/config.h.cmake.in @@ -26,6 +26,18 @@ #ifndef _libint2_include_libint2config_h_ #define _libint2_include_libint2config_h_ +/* The version number. */ +#cmakedefine LIBINT_VERSION "@LIBINT_VERSION@" + +/* The major version number. */ +#define LIBINT_MAJOR_VERSION @LIBINT_MAJOR_VERSION@ + +/* The minor version number. */ +#define LIBINT_MINOR_VERSION @LIBINT_MINOR_VERSION@ + +/* The micro version number. */ +#define LIBINT_MICRO_VERSION @LIBINT_MICRO_VERSION@ + /* Max AM (same for all derivatives; if not defined see LIBINT_MAX_AM_LIST) */ #cmakedefine LIBINT_MAX_AM @LIBINT_MAX_AM@ diff --git a/src/lib/libint/CMakeLists.txt.export b/src/lib/libint/CMakeLists.txt.export index 55d5cb237..762bb3042 100644 --- a/src/lib/libint/CMakeLists.txt.export +++ b/src/lib/libint/CMakeLists.txt.export @@ -23,6 +23,10 @@ set(${PROJECT_NAME}_LICENSE "LGPL-3.0-only") set(L2 Libint2) # Namespace set(pnv libint2) # projectnameversion +#################################### Guide ##################################### + +# See "TARBALL" labels in INSTALL.md for elaboration of options, dependencies, & targets. + ################################### Options #################################### include(options) From a82a0bdc4dd2666a03b4e83785af1c72d21df799 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Fri, 22 Dec 2023 00:13:51 -0500 Subject: [PATCH 5/5] extra file --- src/lib/libint/configuration.cc | 47 ++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/src/lib/libint/configuration.cc b/src/lib/libint/configuration.cc index 1ce3108e7..aa4edc5e6 100644 --- a/src/lib/libint/configuration.cc +++ b/src/lib/libint/configuration.cc @@ -18,10 +18,49 @@ * */ -/* Runtime accessor for the library configuration: - integral derivatives, AM, orderings, etc. - @return the semicolon-separated strings from CMake components */ -const char* configuration_accessor() { +#include + +#include +#include + +const char *configuration_accessor(void) { // return "@Libint2_CONFIG_COMPONENTS@"; return "(nyi)"; } + +void libint_version(int *major, int *minor, int *micro) { + *major = -1; + *minor = -1; + *micro = -1; + std::sscanf(libint_version_string(false), "%d.%d.%d", major, minor, micro); +} + +const char *libint_version_string(bool ext) { + if (ext) + return "@LIBINT_SORTABLE_VERSION@"; + else + return "@LIBINT_VERSION@"; +} + +const char *libint_commit(void) { return "@LIBINT_GIT_COMMIT@"; } + +const char *libint_reference(void) { + std::string ref = "Libint: @LIBINT_DESCRIPTION@, Version " + + std::string(libint_version_string(true)) + + " Edward F. Valeev, http://libint.valeyev.net/"; + + auto slen = ref.length(); + char *cref = new char[slen + 1]; + std::memcpy(cref, ref.c_str(), slen); + cref[slen] = '\0'; + return cref; +} + +const char *libint_reference_doi(void) { return "@LIBINT_DOI@"; } + +const char *libint_bibtex(void) { + return "@Misc{Libint2,\n author = {E.~F.~Valeev},\n title = " + "{\\textsc{Libint}: @LIBINT_DESCRIPTION@},\n " + "howpublished = {http://libint.valeyev.net/},\n note = {version " + "@Libint2_VERSION@},\n year = {@LIBINT_VERSION_YEAR@}\n}\n"; +}