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
3 changes: 2 additions & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- master
pull_request:
workflow_dispatch:

jobs:
build_repo:
Expand Down Expand Up @@ -36,7 +37,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:
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 18 additions & 18 deletions export/cmake/CMakeLists.txt.export
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -369,20 +369,20 @@ 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
$<BUILD_INTERFACE:SRCDATADIR="${PROJECT_SOURCE_DIR}/lib/basis">
$<BUILD_INTERFACE:LIBINT_SRCDATADIR="${PROJECT_SOURCE_DIR}/lib/basis">
)
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
# * LIBINT2_INSTALL_DATADIR -> LIBINT2_INSTALL_BASISDIR
target_compile_definitions(
libint2_cxx_prerequisites
INTERFACE
$<INSTALL_INTERFACE:DATADIR="\$\{_IMPORT_PREFIX\}/${LIBINT2_INSTALL_DATADIR}">
$<INSTALL_INTERFACE:LIBINT_DATADIR="\$\{_IMPORT_PREFIX\}/${LIBINT2_INSTALL_DATADIR}">
)
endif()

Expand Down Expand Up @@ -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/")

Expand Down Expand Up @@ -609,7 +609,7 @@ if (ENABLE_FORTRAN)
DESTINATION "${LIBINT2_INSTALL_INCLUDEDIR}"
)

endif(ENABLE_FORTRAN)
endif(LIBINT2_ENABLE_FORTRAN)

# Configure files ======================================================================================================

Expand Down
22 changes: 11 additions & 11 deletions include/libint2/basis.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ namespace libint2 {
* The expected location of the file is determined by BasisSet::data_path as follows:
* <ol>
* <li> specified by LIBINT_DATA_PATH environmental variable, if defined </li>
* <li> specified by DATADIR macro variable, if defined </li>
* <li> specified by SRCDATADIR macro variable, if defined </li>
* <li> hardwired to directory \c @DATADIR_ABSOLUTE@/basis </li>
* <li> specified by LIBINT_DATADIR macro variable, if defined </li>
* <li> specified by LIBINT_SRCDATADIR macro variable, if defined </li>
* <li> hardwired to directory \c @LIBINT_DATADIR_ABSOLUTE@/basis </li>
* </ol>
*/
BasisSet(std::string name,
Expand Down Expand Up @@ -403,9 +403,9 @@ namespace libint2 {
/** determines the path to the data directory, as follows:
* <ol>
* <li> specified by LIBINT_DATA_PATH environmental variable, if defined </li>
* <li> specified by DATADIR macro variable, if defined </li>
* <li> specified by SRCDATADIR macro variable, if defined </li>
* <li> hardwired to directory \c @DATADIR_ABSOLUTE@/basis </li>
* <li> specified by LIBINT_DATADIR macro variable, if defined </li>
* <li> specified by LIBINT_SRCDATADIR macro variable, if defined </li>
* <li> hardwired to directory \c @LIBINT_DATADIR_ABSOLUTE@/basis </li>
* </ol>
* @throw std::system_error if the path is not valid, or cannot be determined
* @return valid path to the data directory
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tests/hartree-fock/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading