From 22bec223c336af9c4c8bf093093087e8045a0599 Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Sun, 11 Jan 2026 08:16:10 -0500 Subject: [PATCH 1/3] add LIBINT_ "namespace" prefix to DATADIR macros/variables --- configure.ac | 4 ++-- export/cmake/CMakeLists.txt.export | 8 ++++---- include/libint2/basis.h.in | 22 +++++++++++----------- tests/hartree-fock/Makefile | 2 +- tests/unit/Makefile | 2 +- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/configure.ac b/configure.ac index 08b535d12..11256a605 100644 --- a/configure.ac +++ b/configure.ac @@ -1400,8 +1400,8 @@ LD="$LD" LDFLAGS="$LDFLAGS" LIBS="-lm $LIBS $FLIBS" \ LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" dnl --------- expand some variables ----------- -DATADIR_ABSOLUTE=`eval echo $datarootdir`/libint/$LIBINT_VERSION -AC_SUBST(DATADIR_ABSOLUTE) +LIBINT_DATADIR_ABSOLUTE=`eval echo $datarootdir`/libint/$LIBINT_VERSION +AC_SUBST(LIBINT_DATADIR_ABSOLUTE) dnl Check if sources compiled with CXX and CXXGEN can be linked together CXX_COMPATIBLE_WITH_CXXGEN=yes diff --git a/export/cmake/CMakeLists.txt.export b/export/cmake/CMakeLists.txt.export index 580d0b9c1..105eef143 100644 --- a/export/cmake/CMakeLists.txt.export +++ b/export/cmake/CMakeLists.txt.export @@ -369,12 +369,12 @@ if (LIBINT_HAS_CXX_API) ) endif() endif() - get_filename_component(DATADIR_ABSOLUTE "${CMAKE_INSTALL_PREFIX}/${LIBINT2_INSTALL_DATADIR}" ABSOLUTE) + get_filename_component(LIBINT_DATADIR_ABSOLUTE "${CMAKE_INSTALL_PREFIX}/${LIBINT2_INSTALL_DATADIR}" ABSOLUTE) target_compile_definitions(libint2_cxx_prerequisites INTERFACE - $ + $ ) if (NOT MSVC) - # TODO fix the DATADIR define escaping on Windows + # TODO fix the LIBINT_DATADIR define escaping on Windows # * below works fine in tests # * but fails in Psi4 compile # * prefix replacement in conda used instead on Windows @@ -382,7 +382,7 @@ if (LIBINT_HAS_CXX_API) target_compile_definitions( libint2_cxx_prerequisites INTERFACE - $ + $ ) endif() diff --git a/include/libint2/basis.h.in b/include/libint2/basis.h.in index 3f81e5713..60a5541f0 100644 --- a/include/libint2/basis.h.in +++ b/include/libint2/basis.h.in @@ -126,9 +126,9 @@ namespace libint2 { * The expected location of the file is determined by BasisSet::data_path as follows: *
    *
  1. specified by LIBINT_DATA_PATH environmental variable, if defined
  2. - *
  3. specified by DATADIR macro variable, if defined
  4. - *
  5. specified by SRCDATADIR macro variable, if defined
  6. - *
  7. hardwired to directory \c @DATADIR_ABSOLUTE@/basis
  8. + *
  9. specified by LIBINT_DATADIR macro variable, if defined
  10. + *
  11. specified by LIBINT_SRCDATADIR macro variable, if defined
  12. + *
  13. hardwired to directory \c @LIBINT_DATADIR_ABSOLUTE@/basis
  14. *
*/ BasisSet(std::string name, @@ -403,9 +403,9 @@ namespace libint2 { /** determines the path to the data directory, as follows: *
    *
  1. specified by LIBINT_DATA_PATH environmental variable, if defined
  2. - *
  3. specified by DATADIR macro variable, if defined
  4. - *
  5. specified by SRCDATADIR macro variable, if defined
  6. - *
  7. hardwired to directory \c @DATADIR_ABSOLUTE@/basis
  8. + *
  9. specified by LIBINT_DATADIR macro variable, if defined
  10. + *
  11. specified by LIBINT_SRCDATADIR macro variable, if defined
  12. + *
  13. hardwired to directory \c @LIBINT_DATADIR_ABSOLUTE@/basis
  14. *
* @throw std::system_error if the path is not valid, or cannot be determined * @return valid path to the data directory @@ -417,12 +417,12 @@ namespace libint2 { path = data_path_env; } else { -#if defined(DATADIR) - path = std::string{DATADIR}; -#elif defined(SRCDATADIR) - path = std::string{SRCDATADIR}; +#if defined(LIBINT_DATADIR) + path = std::string{LIBINT_DATADIR}; +#elif defined(LIBINT_SRCDATADIR) + path = std::string{LIBINT_SRCDATADIR}; #else - path = std::string("@DATADIR_ABSOLUTE@"); + path = std::string("@LIBINT_DATADIR_ABSOLUTE@"); #endif } // validate basis_path = path + "/basis" diff --git a/tests/hartree-fock/Makefile b/tests/hartree-fock/Makefile index 712ae40f1..f51d34f48 100644 --- a/tests/hartree-fock/Makefile +++ b/tests/hartree-fock/Makefile @@ -6,7 +6,7 @@ endif -include $(TOPDIR)/src/lib/libint/MakeVars.features # include headers the object include directory -CPPFLAGS += -I$(TOPDIR)/include -I$(TOPDIR)/include/libint2 -I$(SRCDIR)/$(TOPDIR)/src/lib/libint -DSRCDATADIR=\"$(SRCDIR)/$(TOPDIR)/lib/basis\" +CPPFLAGS += -I$(TOPDIR)/include -I$(TOPDIR)/include/libint2 -I$(SRCDIR)/$(TOPDIR)/src/lib/libint -DLIBINT_SRCDATADIR=\"$(SRCDIR)/$(TOPDIR)/lib/basis\" OBJSUF = o DEPSUF = d diff --git a/tests/unit/Makefile b/tests/unit/Makefile index d8eb10229..2dccb4571 100644 --- a/tests/unit/Makefile +++ b/tests/unit/Makefile @@ -10,7 +10,7 @@ CPPFLAGS += -I$(TOPDIR)/include # include headers from the library directory CPPFLAGS += -I$(SRCDIR)/$(TOPDIR)/src/lib/libint # include the data directory path as a definition -CPPFLAGS += -DSRCDATADIR=\"$(SRCDIR)/$(TOPDIR)/lib/basis\" +CPPFLAGS += -DLIBINT_SRCDATADIR=\"$(SRCDIR)/$(TOPDIR)/lib/basis\" # initialize statics explicitly in test.cc CPPFLAGS += -DLIBINT2_CONSTEXPR_STATICS=0 From c5db573d91fff2b3426389fa63983b02ba43ddbf Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Sun, 11 Jan 2026 11:11:45 -0500 Subject: [PATCH 2/3] [cmake] Namespacing CMake options - ENABLE_FORTRAN -> LIBINT2_ENABLE_FORTRAN - ENABLE_MPFR -> LIBINT2_ENABLE_MPFR - REQUIRE_CXX_API -> LIBINT2_REQUIRE_CXX_API - LIBINT_USE_BUNDLED_BOOST -> LIBINT2_USE_BUNDLED_BOOST --- .github/workflows/cmake.yml | 2 +- export/cmake/CMakeLists.txt.export | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index bd56eee19..651900266 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -36,7 +36,7 @@ jobs: -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DMPIEXEC_PREFLAGS='--bind-to;none;--allow-run-as-root' - -DENABLE_FORTRAN=ON + -DLIBINT2_ENABLE_FORTRAN=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/library/install -DPython_EXECUTABLE=${{ matrix.os == 'macos-15' && '/opt/homebrew/bin/python3.14' || '/usr/bin/python3' }} outputs: diff --git a/export/cmake/CMakeLists.txt.export b/export/cmake/CMakeLists.txt.export index 105eef143..5df77842d 100644 --- a/export/cmake/CMakeLists.txt.export +++ b/export/cmake/CMakeLists.txt.export @@ -36,20 +36,20 @@ set(pnv libint2) # projectnameversion # Options ============================================================================================================== -redefaultable_option(REQUIRE_CXX_API "C++11 Libint interface" ON) -redefaultable_option(ENABLE_FORTRAN "Fortran03+ Libint interface" OFF) -redefaultable_option(ENABLE_MPFR "Use GNU MPFR library for high-precision testing (EXPERTS ONLY)" OFF) +redefaultable_option(LIBINT2_REQUIRE_CXX_API "C++11 Libint interface" ON) +redefaultable_option(LIBINT2_ENABLE_FORTRAN "Fortran03+ Libint interface" OFF) +redefaultable_option(LIBINT2_ENABLE_MPFR "Use GNU MPFR library for high-precision testing (EXPERTS ONLY)" OFF) redefaultable_option(LIBINT2_BUILD_SHARED_AND_STATIC_LIBS "Build in one shot static and shared library variants. Uses -fPIC." OFF) redefaultable_option(LIBINT2_PYTHON "Python bindings" OFF) -redefaultable_option(LIBINT_USE_BUNDLED_BOOST "Force use of bundled Boost" OFF) +redefaultable_option(LIBINT2_USE_BUNDLED_BOOST "Force use of bundled Boost" OFF) if (NOT LIBINT2_REALTYPE) set(LIBINT2_REALTYPE double) endif() -if (ENABLE_FORTRAN) +if (LIBINT2_ENABLE_FORTRAN) enable_language(Fortran) -endif(ENABLE_FORTRAN) +endif(LIBINT2_ENABLE_FORTRAN) # SHG ordering # these are known orderings, must match config.h @@ -75,7 +75,7 @@ endif(HAVE_POSIX_MEMALIGN) # Features ============================================================================================================= -if (ENABLE_MPFR) +if (LIBINT2_ENABLE_MPFR) find_package(MPFR) if (TARGET MPFR::GMPXX) set(LIBINT_HAS_MPFR 1) @@ -116,11 +116,11 @@ if (TARGET libint2_Eigen) else(TARGET libint2_Eigen) set(LIBINT_HAS_CXX_API 0) endif(TARGET libint2_Eigen) -if (REQUIRE_CXX_API AND NOT ${LIBINT_HAS_CXX_API}) - message(FATAL_ERROR "C++ API cannot be built without Eigen3; configure (via CMake) and install Eigen3 and add the install prefix to CMAKE_PREFIX_PATH, or add -DREQUIRE_CXX_API=OFF to the CMake command line if the C++ API is not required") +if (LIBINT2_REQUIRE_CXX_API AND NOT ${LIBINT_HAS_CXX_API}) + message(FATAL_ERROR "C++ API cannot be built without Eigen3; configure (via CMake) and install Eigen3 and add the install prefix to CMAKE_PREFIX_PATH, or add -DLIBINT2_REQUIRE_CXX_API=OFF to the CMake command line if the C++ API is not required") endif() -if (NOT LIBINT_USE_BUNDLED_BOOST) +if (NOT LIBINT2_USE_BUNDLED_BOOST) if (NOT TARGET Boost::headers) find_package(Boost 1.29) endif() @@ -163,7 +163,7 @@ if (NOT LIBINT_USE_BUNDLED_BOOST) endif() # if usable Boost.Preprocessor not found install the bundled version -if (NOT LIBINT_HAS_SYSTEM_BOOST_PREPROCESSOR_VARIADICS OR LIBINT_USE_BUNDLED_BOOST) +if (NOT LIBINT_HAS_SYSTEM_BOOST_PREPROCESSOR_VARIADICS OR LIBINT2_USE_BUNDLED_BOOST) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/include/libint2) execute_process( COMMAND ${CMAKE_COMMAND} -E tar xzf ${PROJECT_SOURCE_DIR}/external/boost.tar.gz @@ -182,7 +182,7 @@ endif() # * And for Python bindings, it's required along with its headers. if (LIBINT2_PYTHON) find_package(Python COMPONENTS Interpreter Development REQUIRED) -elseif (ENABLE_FORTRAN) +elseif (LIBINT2_ENABLE_FORTRAN) find_package(Python COMPONENTS Interpreter REQUIRED) else() find_package(Python COMPONENTS Interpreter) @@ -532,7 +532,7 @@ endif (LIBINT_HAS_CXX_API) # Fortran bindings ===================================================================================================== -if (ENABLE_FORTRAN) +if (LIBINT2_ENABLE_FORTRAN) # specify the location of modules set(CMAKE_Fortran_MODULE_DIRECTORY "${PROJECT_BINARY_DIR}/fortran/modules/") @@ -609,7 +609,7 @@ if (ENABLE_FORTRAN) DESTINATION "${LIBINT2_INSTALL_INCLUDEDIR}" ) -endif(ENABLE_FORTRAN) +endif(LIBINT2_ENABLE_FORTRAN) # Configure files ====================================================================================================== From 9f4c2cab6d2c02b4794d886e267b00ce20d41ee6 Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Sun, 11 Jan 2026 11:30:56 -0500 Subject: [PATCH 3/3] [ci] enable manual runs (cherry picked from commit 105fd09104222ad7dfc50ebc7472a0c6f6e9e1b7) --- .github/workflows/cmake.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 651900266..93899bbc5 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -5,6 +5,7 @@ on: branches: - master pull_request: + workflow_dispatch: jobs: build_repo: