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
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ jobs:
with:
config_file: '.github/.licenserc.yaml'
source_dir: 'include src tests'
compilers: '["gcc-11"]'
compilers: '["gcc-11", "clang-14"]'
doc_target: 'integrals_cxx_api'
secrets: inherit
83 changes: 31 additions & 52 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,105 +13,84 @@
# limitations under the License.

cmake_minimum_required(VERSION 3.14)
set(VERSION 1.0.0) #TODO: get from git
project(integrals VERSION "${VERSION}" LANGUAGES CXX)

include(FetchContent)
FetchContent_Declare(
nwx_cmake
GIT_REPOSITORY https://github.com/NWChemEx/NWXCMake
)
FetchContent_MakeAvailable(nwx_cmake)
list(APPEND CMAKE_MODULE_PATH "${nwx_cmake_SOURCE_DIR}/cmake")
# Downloads common CMake modules used throughout NWChemEx
include(cmake/get_nwx_cmake.cmake)

set(
CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${PROJECT_SOURCE_DIR}/cmake"
CACHE STRING "" FORCE
)

include(get_cmaize)
#Sets the version to whatever git thinks it is
include(get_version_from_git)
get_version_from_git(integrals_version "${CMAKE_CURRENT_LIST_DIR}")
project(integrals VERSION "${integrals_version}" LANGUAGES CXX)

include(nwx_versions)
include(get_cmaize)
include(nwx_cxx_api_docs)
nwx_cxx_api_docs("${CMAKE_CURRENT_SOURCE_DIR}/integrals")

### Options ###
option(BUILD_TESTING "Should we build the tests?" OFF)
option(BUILD_PYBIND11_PYBINDINGS "Use pybind11 to build Python3 bindings?" OFF)
option(BUILD_CPPYY_PYBINDINGS "Use Cppyy to build Python3 bindings?" OFF)
### Paths ###
set(INTEGRALS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(INTEGRALS_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
set(INTEGRALS_TESTS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tests")

nwx_cxx_api_docs("${INTEGRALS_SOURCE_DIR}" "${INTEGRALS_INCLUDE_DIR}")

### Options ###
cmaize_option_list(
BUILD_TESTING OFF "Should we build the tests?"
BUILD_PYBIND11_PYBINDINGS ON "Build pybind11 python3 bindings?"
)

# Can't build from github due to Libint setup.
# Will find prebuilt. Probably for the best.
cmaize_find_or_build_dependency(
Libint2
URL github.com/evaleev/libint
VERSION ${NWX_LIBINT2_VERSION}
BUILD_TARGET int2
FIND_TARGET Libint2::int2
)

cmaize_find_or_build_dependency(
simde
URL github.com/NWChemEx/SimDE
PRIVATE TRUE
VERSION ${NWX_SIMDE_VERSION}
BUILD_TARGET simde
FIND_TARGET nwx::simde
CMAKE_ARGS BUILD_TESTING=OFF
BUILD_PYBIND11_PYBINDINGS=${BUILD_PYBIND11_PYBINDINGS}
)

set(project_src_dir "${CMAKE_CURRENT_LIST_DIR}/src/${PROJECT_NAME}")
set(project_inc_dir "${CMAKE_CURRENT_LIST_DIR}/include/${PROJECT_NAME}")

cmaize_add_library(
${PROJECT_NAME}
SOURCE_DIR "${project_src_dir}"
INCLUDE_DIRS "${project_inc_dir}"
SOURCE_DIR "${INTEGRALS_SOURCE_DIR}/${PROJECT_NAME}"
INCLUDE_DIRS "${INTEGRALS_INCLUDE_DIR}/${PROJECT_NAME}"
DEPENDS Libint2 simde
)

include(nwx_pybind11)
nwx_add_pybind11_module(
${PROJECT_NAME}
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/src/python"
SOURCE_DIR "${INTEGRALS_SOURCE_DIR}/python"
DEPENDS "${PROJECT_NAME}"
)

include(nwx_python_mods)
cppyy_make_python_package(PACKAGE integrals NAMESPACES integrals DEPPACKAGES simde )

if("${BUILD_TESTING}")
set(CXX_TEST_DIR ${CMAKE_CURRENT_LIST_DIR}/tests/cxx)
set(PYTHON_TEST_DIR ${CMAKE_CURRENT_LIST_DIR}/tests/python)
set(CXX_TEST_DIR ${INTEGRALS_TESTS_DIR}/cxx/)
set(PYTHON_TEST_DIR ${INTEGRALS_TESTS_DIR}/python)

cmaize_find_or_build_dependency(
Catch2
URL github.com/catchorg/Catch2
BUILD_TARGET Catch2
FIND_TARGET Catch2::Catch2
VERSION ${NWX_CATCH2_VERSION}
)
cmaize_find_or_build_dependency(
mokup
URL github.com/NWChemEx/Mokup
PRIVATE TRUE
VERSION ${NWX_MOKUP_VERSION}
BUILD_TARGET mokup
FIND_TARGET nwx::mokup
CMAKE_ARGS BUILD_TESTING=OFF
VERSION v3.6.0
)

cmaize_add_tests(
test_unit_integrals
SOURCE_DIR "${CXX_TEST_DIR}/unit"
INCLUDE_DIRS "${project_src_dir}"
DEPENDS Catch2 mokup ${PROJECT_NAME}
)
cmaize_add_tests(
test_integration_integrals
SOURCE_DIR "${CXX_TEST_DIR}/integration"
INCLUDE_DIRS "${project_src_dir}"
DEPENDS Catch2 mokup ${PROJECT_NAME}
SOURCE_DIR "${CXX_TEST_DIR}/unit/${PROJECT_NAME}"
INCLUDE_DIRS "${INTEGRALS_SOURCE_DIR}/${PROJECT_NAME}"
DEPENDS Catch2 ${PROJECT_NAME}
)

nwx_pybind11_tests(
py_integrals "${PYTHON_TEST_DIR}/unit_tests/test_integrals.py"
SUBMODULES pluginplay chemist parallelzone simde
Expand Down
52 changes: 0 additions & 52 deletions cmake/Findlibint.cmake

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 NWChemEx-Project
# Copyright 2024 NWChemEx-Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,3 +12,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.

include_guard()

macro(get_nwx_cmake)
include(FetchContent)
FetchContent_Declare(
nwx_cmake
GIT_REPOSITORY https://github.com/NWChemEx/NWXCMake
)
FetchContent_MakeAvailable(nwx_cmake)
set(
CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${nwx_cmake_SOURCE_DIR}/cmake"
CACHE STRING ""
FORCE
)
endmacro()

get_nwx_cmake()
5 changes: 3 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
sphinx
sphinx_rtd_theme
GitPython
sphinx==v7.2.6
sphinx_rtd_theme==1.3.0
75 changes: 39 additions & 36 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,44 +21,55 @@
# http://www.sphinx-doc.org/en/master/config

import os
import git

# -- Project information -----------------------------------------------------

project = u'LibChemist'
project = u'Integrals'
copyright = u'2020, NWChemEx Team'
author = u'NWChemEx Team'

# Get the version from version.txt
with open('../../version.txt', 'r') as file:
version = file.read().replace('\n', '')
# The full version, including alpha/beta/rc tags
release = version

##############################################################################
# Shouldn't need to change anything below this point #
##############################################################################

# -- Project Paths -----------------------------------------------------------

dir_path = os.path.dirname(os.path.realpath(__file__))
doc_path = os.path.dirname(dir_path)
root_path = os.path.dirname(doc_path)

# -- Package Version ---------------------------------------------------------

# Read the git tags, from ../../.git and find the most recent one
repo = git.Repo(root_path)
tags = sorted(repo.tags, key=lambda t: t.commit.committed_datetime)

if len(tags):
last_tag = tags[-1]
else:
last_tag = "1.0.0"

# This is the strictly numeric version (e.g., no "beta" qualifier)
version = str(last_tag)

# This is the full version (includes qualifiers like "beta" or
# "release candidate")
release = version

# -- General configuration ---------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
needs_sphinx = '7.2.6'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.githubpages'
'sphinx.ext.autodoc', 'sphinx.ext.mathjax', 'sphinx.ext.githubpages',
'sphinx.ext.autosummary', 'sphinx_rtd_theme', 'sphinx.ext.intersphinx'
]
dir_path = os.path.dirname(os.path.realpath(__file__))
doc_path = os.path.dirname(dir_path)
root_path = os.path.dirname(doc_path)

# Add any paths that contain templates here, relative to this directory.
#templates_path = ['_templates']
Expand All @@ -77,7 +88,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand All @@ -87,6 +98,8 @@
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

numfig = True
numfig_secnum_depth = 0

# -- Options for HTML output -------------------------------------------------

Expand Down Expand Up @@ -116,13 +129,11 @@
#
# html_sidebars = {}


# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = project + 'doc'


# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
Expand All @@ -147,38 +158,30 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, project + '.tex',project + ' Documentation', author, 'manual'),
(master_doc, project + '.tex', project + ' Documentation', author,
'manual'),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, project.lower(), project + ' Documentation', [author], 1)
]

man_pages = [(master_doc, project.lower(), project + ' Documentation',
[author], 1)]

# -- Options for Texinfo output ----------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, project, project + ' Documentation',
author, project, 'One line description of project.', 'Miscellaneous'),
(master_doc, project, project + ' Documentation', author, project,
'One line description of project.', 'Miscellaneous'),
]


# -- Extension configuration -------------------------------------------------

# -- Options for intersphinx extension ---------------------------------------

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}

# -- Options for todo extension ----------------------------------------------

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}
Loading
Loading