diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0af18a6f1..6866a0b73 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,7 +18,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
)
@@ -34,12 +34,12 @@ 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)
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)
@@ -122,6 +122,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 >>>
@@ -190,6 +218,7 @@ option_with_default(WITH_G12DKH_OPT_AM
######################## Process & Validate Options ###########################
include(FeatureSummary)
+include(int_orderings)
include(int_am)
booleanize01(ERI3_PURE_SH)
@@ -197,12 +226,36 @@ 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)
+################################## Main Project #################################
-# STRICTLY TEMPORARY FOR DEMONSTRATION PURPOSES
-configure_file(src/lib/libint/configuration.cc configuration.cc @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)
+
+# 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)
message("")
feature_summary(WHAT ENABLED_FEATURES DESCRIPTION "Libint Enabled features:")
diff --git a/INSTALL.md b/INSTALL.md
index 80bfe5748..dbee81795 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/libint2-config.cmake.in b/cmake/libint2-config.cmake.in
new file mode 100644
index 000000000..99cfc6d2b
--- /dev/null
+++ b/cmake/libint2-config.cmake.in
@@ -0,0 +1,62 @@
+# libint2-config.cmake
+# --------------------
+#
+# Libint2 cmake module.
+# 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.
+#
+#
+# Available components:
+#
+# ::
+#
+# 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
+# -------- --------- -------
+# ( 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
+
+set(Libint2_EXT_VERSION "@LIBINT_EXT_VERSION@")
+
+
+# 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)
+endforeach()
+
+
+
diff --git a/cmake/modules/int_computed.cmake.in b/cmake/modules/int_computed.cmake.in
new file mode 100644
index 000000000..1511d08bb
--- /dev/null
+++ b/cmake/modules/int_computed.cmake.in
@@ -0,0 +1,109 @@
+# 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 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 >>>
+
+# 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))
+ 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/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/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 a8d126377..1825f81f6 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@
@@ -142,6 +154,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@
@@ -149,6 +164,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
@@ -219,4 +264,8 @@
/* maps angular momentum to the corresponding symbol: 0 -> s, 1 -> p, etc. */
#define LIBINT_AM2SYMBOL "spdfghiklmnoqrtuvwxyz"
+#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/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..762bb3042
--- /dev/null
+++ b/src/lib/libint/CMakeLists.txt.export
@@ -0,0 +1,76 @@
+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
+
+#################################### Guide #####################################
+
+# See "TARBALL" labels in INSTALL.md for elaboration of options, dependencies, & targets.
+
+################################### 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"
+ INSTALL_DESTINATION "lib/cmake/libint2" # TODO ${LIBINT2_INSTALL_CMAKEDIR}
+ NO_SET_AND_CHECK_MACRO
+ )
+
+install(
+ DIRECTORY
+ ${PROJECT_SOURCE_DIR}/include2/ # TODO temp for skeleton
+ TYPE INCLUDE
+ COMPONENT ${L2}_Development
+ FILES_MATCHING
+ PATTERN "*.h"
+ PATTERN "*.hpp"
+ )
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..1c2ca9344
--- /dev/null
+++ b/src/lib/libint/features.cmake.in
@@ -0,0 +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"
+ )
+