Skip to content
Open
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
7 changes: 4 additions & 3 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ jobs:
- name: Install prerequisite MacOS packages
if: ${{ steps.skip_check.outputs.should_skip != 'true' && matrix.os == 'macos-15' }}
run: |
brew install ninja gcc@11 gmp boost eigen@3 bison ccache automake python
echo "FC=/opt/homebrew/Cellar/gcc@11/11.5.0/bin/gfortran-11" >> $GITHUB_ENV
brew untap aws/tap || true
brew install ninja gcc gmp boost eigen@3 bison ccache automake python
echo "FC=$(brew --prefix gcc)/bin/gfortran" >> $GITHUB_ENV
/opt/homebrew/bin/pip3 install --break-system-packages pytest numpy scipy scikit-image
/opt/homebrew/bin/pip3 show pytest numpy scipy scikit-image

Expand Down Expand Up @@ -217,6 +218,7 @@ jobs:
libargs: >
-D BUILD_SHARED_LIBS=ON
-D LIBINT2_ENABLE_FORTRAN=ON
-D CMAKE_EXE_LINKER_FLAGS="-Wl,-rpath-link,${CONDA_PREFIX}/lib"
testargs: ""

- runs-on: windows-latest
Expand Down Expand Up @@ -324,7 +326,6 @@ jobs:
-B build \
-G Ninja \
-D CMAKE_INSTALL_PREFIX="${{github.workspace}}/installed" \
-D CMAKE_CXX_COMPILER=${CXX} \
-D LIBINT2_REQUIRE_CXX_API_COMPILED=ON \
-D LIBINT2_ENABLE_PYTHON=ON \
-D CMAKE_PREFIX_PATH="${CONDA_PREFIX}" \
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ set(pnv libint2) # projectnameversion
# build libint-library-export target before library build targets appear
# - (4) unpack the export tarball and build the library and install into \<build\>/library-install-stage/
# - duration depends on number of integrals requested; runs in parallel
# - consumes language-interface and the CMAKE_INSTALL_[DATA|INCLUDE|LIB]DIR paths options
# - consumes language-interface, the CMAKE_INSTALL_[DATA|INCLUDE|LIB]DIR paths
# options, and LIBINT2_INSTALL_FMODDIR
# - the default build target includes this final library build
# - (5) optionally testable
# - (6) install into CMAKE_INSTALL_PREFIX
Expand Down
7 changes: 4 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The Libint build is structured into three parts:
or dependency (FetchContent or ExternalProject)
- (4) unpack the export tarball and build the library and install into \<build\>/library-install-stage/
- duration depends on number of integrals requested; runs in parallel
- consumes language-interface and the CMAKE_INSTALL_[DATA|INCLUDE|LIB]DIR paths options
- consumes language-interface, the CMAKE_INSTALL_[DATA|INCLUDE|LIB]DIR paths options, and LIBINT2_INSTALL_FMODDIR
- the default build target includes this final library build
- (5) optionally testable
- (6) install into CMAKE_INSTALL_PREFIX
Expand Down Expand Up @@ -329,6 +329,7 @@ Note that options, docs, and CMake components are focused on the C++ interface,

### Install Paths (L) (TARBALL)

* `LIBINT2_INSTALL_FMODDIR` - L - For `LIBINT2_ENABLE_FORTRAN=ON`, the directory below `CMAKE_INSTALL_PREFIX` into which `libint_f.mod` is installed and which the `Libint2::fortran` target adds to its interface. Distribution packages that keep Fortran modules in a compiler-specific location (e.g. `lib64/gfortran/modules`) can set it at configure time rather than relocating the module after install. [Default=`CMAKE_INSTALL_INCLUDEDIR`]
* `LIBINT2_PREFIX_PYTHON_INSTALL` - L - For `LIBINT2_ENABLE_PYTHON=ON`, whether to install the Python module in the Linux manner to `CMAKE_INSTALL_PREFIX` or to not install it. Note: not a path; the installation sub-path below `CMAKE_INSTALL_PREFIX` is determined by querying `Python_EXECUTABLE`. For alternate installation in the Python manner to `Python_EXECUTABLE`'s site-packages, see target libint2-python-wheel. [Default=OFF]


Expand Down Expand Up @@ -383,13 +384,13 @@ Note that options, docs, and CMake components are focused on the C++ interface,
| `Libint2::int2` | `C` | yes | always | impossible | `int-{static,shared}` | `libint2` |
| `Libint2::cxx` | `CXX_ho` | yes | `LIBINT2_REQUIRE_CXX_API=ON` | `LIBINT2_REQUIRE_CXX_API=OFF` & withhold Eigen3 & `LIBINT2_REQUIRE_CXX_API_COMPILED=OFF` & `LIBINT2_ENABLE_PYTHON=OFF` | `int-cxx-headeronly-{static,shared}` | `libint2_cxx` |
| `Libint2::int2-cxx` | `CXX` | yes | `LIBINT2_REQUIRE_CXX_API_COMPILED=ON` | `LIBINT2_REQUIRE_CXX_API_COMPILED=OFF` | `int-cxx-{static,shared}` | |
| Fortran local[^19] | (NYI) | no | `LIBINT2_ENABLE_FORTRAN=ON` | `LIBINT2_ENABLE_FORTRAN=OFF` | `libint_f` | |
| `Libint2::fortran` | `fortran` | no | `LIBINT2_ENABLE_FORTRAN=ON` | `LIBINT2_ENABLE_FORTRAN=OFF` | `int_f`, `libint_f`[^19] | |

[^15]: Targets for library consumer use. These are available after `find_package(Libint2)` or `add_subdirectory()`.
[^16]: Ensure target found in installation after `find_package(Libint2 COMPONENTS ...)`.
[^17]: Targets in export/CMakeLists.txt.export . Names subject to change. Use namespaced target names in any consuming code.
[^18]: Deprecated legacy aliases. Update any uses to namespaced target.
[^19]: The `libint_f` internal target defines the Fortran interface to Libint2. One must also link to `Libint2::int2` or `Libint2::cxx`. At present, it is not exported, and a namespaced target is not defined.
[^19]: `libint_f` compiles the Fortran module; `int_f` archives it and carries the usage requirements, so linking `Libint2::fortran` alone brings in the Fortran module directory, the generated Fortran headers, and the Libint2 C library. Set `LIBINT2_INSTALL_FMODDIR` to control where `libint_f.mod` is installed.


-----------------------------------------------------------------------------
Expand Down
28 changes: 8 additions & 20 deletions cmake/libint2-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
# 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
# fortran - search for library including the fortran interface target
#
# cart shell_set used_by
# -------- --------- -------
Expand Down Expand Up @@ -93,30 +94,17 @@ foreach(_eri @Libint2_CONFIG_COMPONENTS@) # Libint2_CONFIG_COMPONENTS
set(${L2}_${_eri}_FOUND 1)
endforeach()

check_required_components(${L2})
# N.B. check_required_components() is deferred to the end of this file so that
# the language components can be resolved from the imported targets below
# rather than from configure-time options

# Import library targets
if(NOT TARGET ${L2}::int-shared AND NOT TARGET ${L2}::int-static)
if(NOT TARGET ${L2}::int2)
include("${CMAKE_CURRENT_LIST_DIR}/${pnv}-targets.cmake")
endif()

# Create convenience aliases matching the build-tree names
if (TARGET ${L2}::int-shared)
if (NOT TARGET ${L2}::int2)
add_library(${L2}::int2 ALIAS ${L2}::int-shared)
endif()
elseif (TARGET ${L2}::int-static)
if (NOT TARGET ${L2}::int2)
add_library(${L2}::int2 ALIAS ${L2}::int-static)
endif()
if (TARGET ${L2}::fortran)
set(${L2}_fortran_FOUND 1)
endif()

if (TARGET ${L2}::int-cxx-headeronly-shared)
if (NOT TARGET ${L2}::cxx)
add_library(${L2}::cxx ALIAS ${L2}::int-cxx-headeronly-shared)
endif()
elseif (TARGET ${L2}::int-cxx-headeronly-static)
if (NOT TARGET ${L2}::cxx)
add_library(${L2}::cxx ALIAS ${L2}::int-cxx-headeronly-static)
endif()
endif()
check_required_components(${L2})
Loading
Loading