Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 60 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -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)
Expand Down Expand Up @@ -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 >>>

Expand Down Expand Up @@ -190,19 +218,44 @@ option_with_default(WITH_G12DKH_OPT_AM

######################## Process & Validate Options ###########################
include(FeatureSummary)
include(int_orderings)
include(int_am)

booleanize01(ERI3_PURE_SH)
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:")
Expand Down
38 changes: 38 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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`

Expand Down
62 changes: 62 additions & 0 deletions cmake/libint2-config.cmake.in
Original file line number Diff line number Diff line change
@@ -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()



109 changes: 109 additions & 0 deletions cmake/modules/int_computed.cmake.in
Original file line number Diff line number Diff line change
@@ -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@")
61 changes: 61 additions & 0 deletions cmake/modules/int_orderings.cmake
Original file line number Diff line number Diff line change
@@ -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()
Loading
Loading