From a764784ccf0e198a43c75bd70ac509f66c2f421c Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Fri, 27 Sep 2019 19:09:57 -0400 Subject: [PATCH 001/118] this builds a library entirely with cmake --- CMakeLists.txt | 320 +++++++++++++++++++++++++++ cmake/autocmake_safeguards.cmake | 26 +++ cmake/ints_types.cmake | 105 +++++++++ cmake/psi4OptionsTools.cmake | 156 +++++++++++++ cmake/shell_orderings.cmake | 46 ++++ cmake/user_has_defined.cmake | 31 +++ export/cmake/modules/FindMPFR.cmake | 82 ++++--- include/libint2/config.h.cmake.in | 329 ++++++++++++++++++++++++++++ src/CMakeLists.txt | 34 +++ src/bin/libint/CMakeLists.txt | 91 ++++++++ src/lib/libint/CMakeLists.txt | 66 ++++++ 11 files changed, 1261 insertions(+), 25 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 cmake/autocmake_safeguards.cmake create mode 100644 cmake/ints_types.cmake create mode 100644 cmake/psi4OptionsTools.cmake create mode 100644 cmake/shell_orderings.cmake create mode 100644 cmake/user_has_defined.cmake create mode 100644 include/libint2/config.h.cmake.in create mode 100644 src/CMakeLists.txt create mode 100644 src/bin/libint/CMakeLists.txt create mode 100644 src/lib/libint/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..c713777d2 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,320 @@ +#cmake_policy(SET CMP0048 NEW) # project_VERSION* variables populated from project(... VERSION x.x.x) string + +project(Libint2 +# VERSION 1.2.1 +# LANGUAGES C CXX) + LANGUAGES C CXX) +set(Libint_AUTHORS "Edward F. Valeev") +set(Libint_DESCRIPTION "High-performance library for computing Gaussian integrals in quantum mechanics") +set(Libint_URL "https://github.com/evaleev/libint") +#set(Libint_LICENSE "GPL-3.0 for generator; LGPL-3.0 for generated") + +cmake_minimum_required(VERSION 3.0) #TODO +cmake_policy(SET CMP0074 NEW) +list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake + ${PROJECT_SOURCE_DIR}/export/cmake/modules) + + +################################### Options #################################### +include(user_has_defined) +include(psi4OptionsTools) + +# <<< General >>> + +option_with_default(CMAKE_BUILD_TYPE "Build type" Release) + +# <<< Which Integrals Classes, Which Derivative Levels >>> + +option_with_default(ENABLE_1BODY + "Compile with support for up to N-th derivatives of 1-body integrals (-1 for OFF)" 0) +option_with_default(ENABLE_ERI + "Compile with support for up to N-th derivatives of electron repulsion integrals (-1 for OFF)" 0) +option_with_default(ENABLE_ERI3 + "Compile with support for up to N-th derivatives of 3-center electron repulsion integrals (-1 for OFF)" -1) +option_with_default(ENABLE_ERI2 + "Compile with support for up to N-th derivatives of 2-center electron repulsion integrals (-1 for OFF)" -1) + +# <<< 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)" 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 >>> + +option_with_default(LIBINT_MAX_AM + "Support Gaussians of angular momentum up to N. + Can specify values for each derivative levels as a semicolon-separated string N0,N1,N2..." 4) +option_with_default(LIBINT_OPT_AM + "Optimize maximally for up to angular momentum N (N <= max-am). (default: (max_am/2)+1)" 3) +option_with_default(ERI_MAX_AM + "Support ERIs for Gaussians of angular momentum up to N. + Can specify values for each derivative levels as a semicolon-separated string N0;N1;N2..." 4) +option_with_default(ERI_OPT_AM + "Optimize ERIs maximally for up to angular momentum N (N <= max-am). + Can specify values for each derivative levels as a semicolon-separated string N0,N1,N2... (default: (eri_max_am/2)+1)" -1) + +# <<< Miscellaneous >>> + +option_with_default(LIBINT_ERI_STRATEGY + "Compute ERIs using the following strategy. This option is for experts ONLY. + LAB: looks to be hardcoded in configure. NO" 1) +option_with_print(LIBINT_USE_COMPOSITE_EVALUATORS + "Libint will use composite evaluators (i.e. every evaluator will compute one integral type only)" ON) +option_with_print(LIBINT_SINGLE_EVALTYPE + "Generate single evaluator type (i.e. all tasks use the same evaluator) + LAB: looks effectively hardcoded in configure, RT error if OFF" ON) + +#option_with_print(BUILD_SHARED_LIBS "Build final library as shared, not static" OFF) +#option_with_default(BUILD_FPIC "Libraries will be compiled with position independent code" ON) +#if(${BUILD_SHARED_LIBS} AND NOT ${BUILD_FPIC}) +# message(FATAL_ERROR "BUILD_SHARED_LIBS ON and BUILD_FPIC OFF are incompatible, as shared library requires position independent code") +#endif() +#option_with_print(ENABLE_GENERIC "Enable mostly static linking in shared library" OFF) +#option_with_flags(ENABLE_XHOST "Enable processor-specific optimization" ON +# "-xHost" "-march=native") +#option_with_print(MERGE_LIBDERIV_INCLUDEDIR "Install libderiv headers to libint namespace. Psi4 1.1-1.3 wants ON" OFF) +option_with_print(ENABLE_FORTRAN "Build Fortran 90 interface" OFF) + +#CONFIGURE System types: +#CONFIGURE --build=BUILD configure for building on BUILD [guessed] +#CONFIGURE --host=HOST cross-compile to build programs to run on HOST [BUILD] +#CONFIGURE --target=TARGET configure for building compilers for TARGET [HOST] +#CONFIGURE +#CONFIGURE Optional Features: +#CONFIGURE --disable-option-checking ignore unrecognized --enable/--with options +#CONFIGURE --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) +#CONFIGURE --enable-FEATURE[=ARG] include FEATURE [ARG=yes] +#CONFIGURE --enable-debug Compile with debugging options +#CONFIGURE --enable-1body-property-derivs +#CONFIGURE Enable geometric derivatives of 1-body property +#CONFIGURE integrals (all but overlap, kinetic, elecpot). These +#CONFIGURE derivatives are disabled by default to save compile +#CONFIGURE time. +#CONFIGURE --enable-g12=N Compile with support for N-th derivatives of MP2-F12 +#CONFIGURE energies with Gaussian factors +#CONFIGURE --enable-g12dkh=N Compile with support for N-th derivatives of +#CONFIGURE DKH-MP2-F12 energies with Gaussian factors +#CONFIGURE --enable-eri3-pure-sh Assume the "unpaired" center of 3-center electron +#CONFIGURE repulsion integrals will be transformed to pure +#CONFIGURE solid harmonics +#CONFIGURE --enable-eri2-pure-sh Assume the 2-center electron repulsion integrals +#CONFIGURE will be transformed to pure solid harmonics +#CONFIGURE --disable-t1g12-support Libint will not support [Ti,G12] integrals +#CONFIGURE --enable-unrolling Unroll shell sets into integrals +#CONFIGURE (--enable-unrolling=S will unroll shell sets larger +#CONFIGURE than S). +#CONFIGURE --enable-generic-code Use manually-written generic code. +#CONFIGURE --enable-fma Generate FMA (fused multiply-add) instructions +#CONFIGURE (CXXGEN must support C++11; to benefit must have +#CONFIGURE FMA-capable hardware and compiler) +#CONFIGURE --enable-accum-ints Accumulate integrals to the buffer, rather than +#CONFIGURE copy. +#CONFIGURE --enable-flop-counter Support (approximate) FLOP counting by the library. +#CONFIGURE CXXGEN must support C++11! +#CONFIGURE --enable-profile Turn on profiling instrumentation of the library. +#CONFIGURE CXXGEN must support C++11! +#CONFIGURE --enable-contracted-ints +#CONFIGURE Turn on support for contracted integrals. +#CONFIGURE --enable-mpfr Use MPFR library to test Libint integrals in high +#CONFIGURE precision. +#CONFIGURE --enable-shared[=PKGS] build shared libraries [default=no] +#CONFIGURE --enable-static[=PKGS] build static libraries [default=yes] +#CONFIGURE --enable-fast-install[=PKGS] +#CONFIGURE optimize for fast installation [default=yes] +#CONFIGURE --disable-libtool-lock avoid locking (might break parallel builds) +#CONFIGURE +#CONFIGURE Optional Packages: +#CONFIGURE --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] +#CONFIGURE --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) +#CONFIGURE --with-api-prefix Prepend this string to every name in the library API +#CONFIGURE (except for the types). +#CONFIGURE --with-1body-max-am=N Support 1-e ints for Gaussians of angular momentum +#CONFIGURE up to N. Can specify values for each derivative +#CONFIGURE levels as a list N0,N1,N2... +#CONFIGURE --with-1body-opt-am=N Optimize 1-e ints maximally for up to angular +#CONFIGURE momentum N (N <= max-am). Can specify values for +#CONFIGURE each derivative levels as a list N0,N1,N2... +#CONFIGURE --with-multipole-max-order=N +#CONFIGURE Maximum order of spherical multipole integrals. The +#CONFIGURE default is 4. There is no maximum +#CONFIGURE --with-eri3-max-am=N Support 3-center ERIs for Gaussians of angular +#CONFIGURE momentum up to N. Can specify values for each +#CONFIGURE derivative levels as a list N0,N1,N2... +#CONFIGURE --with-eri3-opt-am=N Optimize 3-center ERIs maximally for up to angular +#CONFIGURE momentum N (N <= max-am). Can specify values for +#CONFIGURE each derivative levels as a list N0,N1,N2... +#CONFIGURE --with-eri2-max-am=N Support 2-center ERIs for Gaussians of angular +#CONFIGURE momentum up to N. Can specify values for each +#CONFIGURE derivative levels as a list N0,N1,N2... +#CONFIGURE --with-eri2-opt-am=N Optimize 2-center ERIs maximally for up to angular +#CONFIGURE momentum N (N <= max-am). Can specify values for +#CONFIGURE each derivative levels as a list N0,N1,N2... +#CONFIGURE --with-g12-max-am=N Support integrals for G12 methods of angular +#CONFIGURE momentum up to N. +#CONFIGURE --with-g12-opt-am=N Optimize G12 integrals for up to angular momentum N +#CONFIGURE (N <= max-am). +#CONFIGURE --with-g12dkh-max-am=N Support integrals for relativistic G12 methods of +#CONFIGURE angular momentum up to N. +#CONFIGURE --with-g12dkh-opt-am=N Optimize G12DKH integrals for up to angular momentum +#CONFIGURE N (N <= max-am). +#CONFIGURE --with-vector-length=N Compute integrals in vectors of length N. +#CONFIGURE --with-vector-method Specifies how to vectorize integrals. Allowed values +#CONFIGURE are 'block' (default), and 'line'. +#CONFIGURE --with-build-id Gives an identifier for the build. +#CONFIGURE --with-cxx Gives the name of the C++ compiler to use. +#CONFIGURE --with-cxx-optflags Gives optimization flags for the C++ compiler. +#CONFIGURE --with-cxxgen Gives the name of the C++ compiler to compile +#CONFIGURE generated code. +#CONFIGURE --with-cxxgen-optflags Gives optimization flags for the C++ compiler for +#CONFIGURE generated source. +#CONFIGURE --with-cxxdepend Gives the name of the C++ compiler with which to +#CONFIGURE extract dependency information. +#CONFIGURE --with-ranlib Gives the name of the ranlib program. +#CONFIGURE --with-ar Names the archive creator. +#CONFIGURE --with-ar-flags Flags for the the archive creator. +#CONFIGURE --with-ld Names the object linker. +#CONFIGURE --with-libint-includedir +#CONFIGURE Specifies include file install subdir. +#CONFIGURE --with-libint-exportdir Specifies export directory name. Default is +#CONFIGURE libint-. +#CONFIGURE --with-incdirs Specifies include directories (-Idir1 -Idir2). +#CONFIGURE --with-libs Specifies libraries (-llib1 -llib2). +#CONFIGURE --with-libdirs Specifies library directories (-Ldir1 -Ldir2). +#CONFIGURE --with-scratchdir Specifies the location for the machine-generated +#CONFIGURE library source and object files. +#CONFIGURE --with-pkgconfigdir Specifies the location to put pkg-config's data +#CONFIGURE file. Default is $(libdir)/pkgconfig. +#CONFIGURE --with-cmakedir Specifies the location to put FindLibint2.cmake +#CONFIGURE file. Default is $(libdir)/cmake/libint2. +#CONFIGURE --with-align-size (EXPERT) if posix_memalign is available, this will +#CONFIGURE specify alignment of Libint data, in units of +#CONFIGURE sizeof(LIBINT2_REALTYPE). Default is to use built-in +#CONFIGURE heuristics. +#CONFIGURE --with-boost[=ARG] use Boost library from a standard location +#CONFIGURE (ARG=yes), from the specified location (ARG=), +#CONFIGURE or disable it (ARG=no) [ARG=yes] +#CONFIGURE --with-boost-libdir=LIB_DIR +#CONFIGURE Force given directory for boost libraries. Note that +#CONFIGURE this will override library path detection, so use +#CONFIGURE this parameter only if default library detection +#CONFIGURE fails and you know exactly where your boost +#CONFIGURE libraries are located. +#CONFIGURE --with-real-type Compute all integrals using the given real type +#CONFIGURE (default: double). +#CONFIGURE --with-real-type-includes +#CONFIGURE Additional includes necessary to use the real type +#CONFIGURE (default: none). +#CONFIGURE --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use +#CONFIGURE both] +#CONFIGURE --with-aix-soname=aix|svr4|both +#CONFIGURE shared library versioning (aka "SONAME") variant to +#CONFIGURE provide on AIX, [default=aix]. +#CONFIGURE --with-gnu-ld assume the C compiler uses GNU ld [default=no] +#CONFIGURE --with-sysroot[=DIR] Search for dependent libraries within DIR (or the +#CONFIGURE compiler's sysroot if not specified). +#CONFIGURE +#CONFIGURE Some influential environment variables: +#CONFIGURE CXX C++ compiler command +#CONFIGURE CXXFLAGS C++ compiler flags +#CONFIGURE LDFLAGS linker flags, e.g. -L if you have libraries in a +#CONFIGURE nonstandard directory +#CONFIGURE LIBS libraries to pass to the linker, e.g. -l +#CONFIGURE CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if +#CONFIGURE you have headers in a nonstandard directory +#CONFIGURE CXXCPP C++ preprocessor +#CONFIGURE CC C compiler command +#CONFIGURE CFLAGS C compiler flags +#CONFIGURE LT_SYS_LIBRARY_PATH +#CONFIGURE User-defined run-time library search path. + +######################## Process & Validate Options ########################### +include(autocmake_safeguards) +include(shell_orderings) +include(ints_types) + +# req'd for now (no FindGMP.cmake, though one at Elemental project) +find_package(MPFR REQUIRED) +get_property(_loc TARGET MPFR::Library PROPERTY INTERFACE_INCLUDE_DIRECTORIES) +message("iid ${_loc}") +get_property(_loc TARGET MPFR::Library PROPERTY INTERFACE_LINK_LIBRARIES) +message("ill ${_loc}") +if (TARGET MPFR::GMPXX) + set(LIBINT_HAS_MPFR 1) + message("top linking") +endif() +message("MPFR ${MPFR_INCLUDES}") +message("GMP ${GMPXX_INCLUDES}") + +unset(_temp_h CACHE) +find_path(_temp_h + NAMES stdint.h) +if(_temp_h) + set (HAVE_STDINT_H 1) +endif() + +################################# Main Project ################################# +set(STAGED_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/stage) + +add_subdirectory(src) +include(GNUInstallDirs) +include(CMakePackageConfigHelpers) + +set(PN ${PROJECT_NAME}) + +if (ENABLE_FORTRAN) + enable_language(Fortran) +endif() + +configure_file(include/libint2/config.h.cmake.in include/libint2/config.h @ONLY) +##configure_file(cmake/libint.pc.in libint.pc @ONLY) + +## <<< Install >>> +# +#install(DIRECTORY ${STAGED_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} +# ${STAGED_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR} +# ${STAGED_INSTALL_PREFIX}/share +# DESTINATION ${CMAKE_INSTALL_PREFIX} +# USE_SOURCE_PERMISSIONS +# PATTERN "*header*" EXCLUDE) +# +## <<< Export Config >>> +# +## GNUInstallDirs "DATADIR" wrong here; CMake search path wants "share". +#set(CMAKECONFIG_INSTALL_DIR "share/cmake/${PN}") +#configure_package_config_file(cmake/${PN}Config.cmake.in +# "${CMAKE_CURRENT_BINARY_DIR}/${PN}Config.cmake" +# INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}) +#write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PN}ConfigVersion.cmake +# VERSION ${${PN}_VERSION} +# COMPATIBILITY SameMajorVersion) +#install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PN}Config.cmake +# ${CMAKE_CURRENT_BINARY_DIR}/${PN}ConfigVersion.cmake +# DESTINATION ${CMAKECONFIG_INSTALL_DIR}) +# +#install(FILES ${PROJECT_BINARY_DIR}/libint.pc +# DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig/) diff --git a/cmake/autocmake_safeguards.cmake b/cmake/autocmake_safeguards.cmake new file mode 100644 index 000000000..7c0a2a9fd --- /dev/null +++ b/cmake/autocmake_safeguards.cmake @@ -0,0 +1,26 @@ +# Downloaded from +# https://github.com/coderefinery/autocmake/blob/master/modules/safeguards.cmake +# * changed text of in-source message + +#.rst: +# +# Provides safeguards against in-source builds and bad build types. +# +# Variables used:: +# +# PROJECT_SOURCE_DIR +# PROJECT_BINARY_DIR +# CMAKE_BUILD_TYPE + +if(${PROJECT_SOURCE_DIR} STREQUAL ${PROJECT_BINARY_DIR}) + message(FATAL_ERROR "In-source builds not allowed. Please run CMake from top directory and specify a build directory (e.g., cmake -H. -Bbuild).") +endif() + +string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_tolower) +string(TOUPPER "${CMAKE_BUILD_TYPE}" cmake_build_type_toupper) + +if(NOT cmake_build_type_tolower STREQUAL "debug" AND + NOT cmake_build_type_tolower STREQUAL "release" AND + NOT cmake_build_type_tolower STREQUAL "relwithdebinfo") + message(FATAL_ERROR "Unknown build type \"${CMAKE_BUILD_TYPE}\". Allowed values are Debug, Release, RelWithDebInfo (case-insensitive).") +endif() diff --git a/cmake/ints_types.cmake b/cmake/ints_types.cmake new file mode 100644 index 000000000..23ca02da1 --- /dev/null +++ b/cmake/ints_types.cmake @@ -0,0 +1,105 @@ + +#LIBINT_OPT_AM_LIST +#LIBINT_MAX_AM_LIST +# +#ERI_OPT_AM +#ERI_OPT_AM_LIST +#ERI_MAX_AM +#ERI_MAX_AM_LIST +# +#ERI2_OPT_AM +#ERI2_OPT_AM_LIST +#ERI2_MAX_AM +#ERI2_MAX_AM_LIST +# +#ERI3_OPT_AM +#ERI3_OPT_AM_LIST +#ERI3_MAX_AM +#ERI3_MAX_AM_LIST +# +#LIBINT_ONEBODY_DERIV +#LIBINT_SUPPORTS_ONEBODY +#ONEBODY_OPT_AM +#ONEBODY_OPT_AM_LIST +#ONEBODY_MAX_AM +#ONEBODY_MAX_AM_LIST +# +#G12_OPT_AM +#G12_MAX_AM +# +#G12DKH_OPT_AM +#G12DKH_MAX_AM + + +# <<< ERI >>> + +if (ENABLE_ERI GREATER_EQUAL 0) + set(INCLUDE_ERI ${ENABLE_ERI}) +else() + set(INCLUDE_ERI "-1") +endif() +message("ERI ${INCLUDE_ERI}") + +list(LENGTH ERI_MAX_AM _lam) +#message("ERI_MAX_AM ${ERI_MAX_AM} ${_lam}") +if (_lam GREATER 1) + list(JOIN ERI_MAX_AM "," _sam) + #message("_sam ${_sam}") + execute_process (COMMAND bash -c "echo ${_sam} | tr , '\n' | sort -n | tail -n1" + OUTPUT_VARIABLE _max_ERI_MAX_AM) + set(ERI_MAX_AM_LIST ${_sam}) + set(ERI_MAX_AM "") + #message("LIST ${ERI_MAX_AM} ${ERI_MAX_AM_LIST}") +else() + if (ERI_MAX_AM GREATER_EQUAL 8) + message(FATAL "Value for ERI_MAX_AM too high (${ERI_MAX_AM}). Are you sure you know what you are doing?") + elseif (ERI_MAX_AM LESS_EQUAL 0) + message(FATAL "Invalid value for ERI_MAX_AM (${ERI_MAX_AM}).") + endif() + #message("SCAL ${ERI_MAX_AM} ${ERI_MAX_AM_LIST}") + set(_max_ERI_MAX_AM ${ERI_MAX_AM}) +endif() + +list(LENGTH ERI_OPT_AM _lam) +#message("ERI_OPT_AM ${ERI_OPT_AM} ${_lam}") +if (_lam GREATER 1) + list(JOIN ERI_OPT_AM "," _sam) + #message("_sam ${_sam}") + execute_process (COMMAND bash -c "echo ${_sam} | tr , '\n' | sort -n | tail -n1" + OUTPUT_VARIABLE _max_ERI_OPT_AM) + set(ERI_OPT_AM_LIST ${_sam}) + set(ERI_OPT_AM "") + #message("LIST ${ERI_OPT_AM} ${ERI_OPT_AM_LIST}") +else() + if (ERI_OPT_AM EQUAL -1) + #math(EXPR ERI_OPT_AM "${_max_ERI_MAX_AM}/2 + ${_max_ERI_MAX_AM}%2") + math(EXPR ERI_OPT_AM "${_max_ERI_MAX_AM}/2 + 1") + endif() + if (ERI_OPT_AM GREATER ERI_MAX_AM) + message(FATAL "Invalid value for ERI_OPT_AM (${ERI_OPT_AM} !<= ${ERI_MAX_AM}).") + endif() + #message("SCAL ${ERI_OPT_AM} ${ERI_OPT_AM_LIST}") +endif() + +# temp +set(LIBINT_MAX_AM ${_max_ERI_MAX_AM}) +set(LIBINT_OPT_AM ${ERI_OPT_AM}) + +# <<< ERI3 >>> + +if (ENABLE_ERI3 GREATER_EQUAL 0) + set(INCLUDE_ERI3 ${ENABLE_ERI3}) +else() + set(INCLUDE_ERI3 "-1") +endif() +message("ERI3 ${INCLUDE_ERI3}") + + +# <<< ERI2 >>> + +if (ENABLE_ERI2 GREATER_EQUAL 0) + set(INCLUDE_ERI2 ${ENABLE_ERI2}) +else() + set(INCLUDE_ERI2 "-1") +endif() +message("ERI2 ${INCLUDE_ERI2}") diff --git a/cmake/psi4OptionsTools.cmake b/cmake/psi4OptionsTools.cmake new file mode 100644 index 000000000..165797868 --- /dev/null +++ b/cmake/psi4OptionsTools.cmake @@ -0,0 +1,156 @@ +###This file contains functions used throughout the Psi4 build. Like source +###code, the build system should be factored and common code extracted out into +###functions/macros. If you find repetitive code throughout the build scripts +###this is the place to add it (make sure you document it too). + +#Macro for printing an option in a consistent manner +# +#Syntax: print_option(