Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1dc8469
build overhaul
ryanmrichard Jul 1, 2026
0f86430
adds upstream dependencies
ryanmrichard Jul 2, 2026
e56e47d
code factorization
ryanmrichard Jul 6, 2026
2e07d2d
adds mac files to gitignore
ryanmrichard Jul 7, 2026
c522935
Build py_test_tensorwrapper via nwx_python_module
ryanmrichard Jul 9, 2026
bb76f1c
Retarget NWChemEx/ -> ryanmrichard/ for fork testing; adopt test_nwx_…
ryanmrichard Jul 9, 2026
99e2e64
Retrigger CI now that Actions are enabled on fork
ryanmrichard Jul 9, 2026
c09a217
Add requirements.txt (numpy) for Python tests; fix .gitignore missing…
ryanmrichard Jul 9, 2026
b23e648
Add session-scoped RuntimeView pytest fixture; fix isort ordering for…
ryanmrichard Jul 9, 2026
d4b2b7d
Fix Sigma toolchain cmake_opts: github.workspace is empty in the call…
ryanmrichard Jul 9, 2026
47d0935
Retrigger CI: workflow write permissions now enabled
ryanmrichard Jul 9, 2026
5480c4f
deploy_to_pypi: add needs_boost (Boost was never actually installed i…
ryanmrichard Jul 10, 2026
c1fc2e3
Retarget NWXCMake build dependency to fork
ryanmrichard Jul 10, 2026
56a4269
Retrigger CI: use boost169-devel with BOOST_INCLUDEDIR
ryanmrichard Jul 10, 2026
349ac94
Simplify Sigma CI job to a plain cmake_opts, drop stale ENABLE_SIGMA …
ryanmrichard Jul 10, 2026
4e5e46e
Re-trigger CI to rebuild wheel with OpenMPI 4.1.6 fix (matches Ubuntu…
ryanmrichard Jul 12, 2026
1a789fe
Re-trigger CI to rebuild wheel with OpenMPI --enable-mpirun-prefix-by…
ryanmrichard Jul 12, 2026
7181a65
Re-trigger CI to rebuild wheel with OpenMPI --disable-dlopen fix
ryanmrichard Jul 12, 2026
cd963f4
Republish: pick up build_pypi_dist fix (stop vendoring MPI, require s…
ryanmrichard Jul 12, 2026
fb80400
Republish: fix build_pypi_dist to use exact sonames for auditwheel --…
ryanmrichard Jul 13, 2026
210720a
use fork
ryanmrichard Jul 15, 2026
2c861b2
fix typo
ryanmrichard Jul 15, 2026
c9645be
add pre-commit to gitignore
ryanmrichard Aug 3, 2026
5c67a9b
update pyproject.toml
ryanmrichard Aug 3, 2026
4feff34
works in dev mode
ryanmrichard Aug 3, 2026
977c4ae
adds python build
ryanmrichard Aug 4, 2026
a203232
move nwxcmake/pybind11 to project
ryanmrichard Aug 5, 2026
0874fb1
update nightly
ryanmrichard Aug 5, 2026
7b01914
Migrate CI and dependencies from ryanmrichard to NWChemEx
ryanmrichard Aug 5, 2026
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
47 changes: 47 additions & 0 deletions .github/workflows/merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,50 @@ jobs:
with:
doc_target: "tensorwrapper_cxx_api"
secrets: inherit

platform_matrix:
uses: NWChemEx/.github/.github/workflows/platform_matrix.yaml@master

build_pypi_dist:
needs: [tag-commit, platform_matrix]
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.platform_matrix.outputs.release_matrix) }}
runs-on: ${{ matrix.os }}
steps:
- name: Build PyPI Distribution
uses: NWChemEx/.github/.github/actions/build_pypi_dist@master
with:
cibw_build: ${{ matrix.cibw_build }}
build_sdist: ${{ matrix.os == 'ubuntu-latest' && 'true' || 'false' }}
needs_mpi: "true"
needs_boost: "true"

- name: Upload Distribution Artifact
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}
path: dist/

# A separate, ubuntu-only publish job (rather than a publish step per
# build_pypi_dist leg) because pypa/gh-action-pypi-publish only runs on
# Linux, and because PyPI trusted publishing does not support reusable
# workflows (this job must be defined directly here, not delegated).
deploy_to_pypi:
needs: build_pypi_dist
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Download All Distributions
uses: actions/download-artifact@v4
with:
pattern: dist-*
path: dist
merge-multiple: true

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
21 changes: 14 additions & 7 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,26 @@
#

name: Nightly Workflow
# Re-runs the same build/test jobs pull_request.yaml runs, on a schedule, to
# catch breakage that originates outside the repo (upstream dependency
# releases, refreshed GitHub runner images) rather than from a code change.
# Keep the job list below in sync with pull_request.yaml.

on:
schedule:
- cron: "0 6 * * *" # Every day at 06:00 UTC (00:00 CST)

jobs:
test_library:
uses: NWChemEx/.github/.github/workflows/test_nwx_library.yaml@master
test_cmake_build:
uses: NWChemEx/.github/.github/workflows/test_nwx_cmake_build.yaml@master
with:
compilers: '["gcc-14", "clang-18"]'
run_python_tests: "true"

test_library_with_sigma:
uses: NWChemEx/.github/.github/workflows/test_nwx_library.yaml@master
test_cmake_build_with_sigma:
uses: NWChemEx/.github/.github/workflows/test_nwx_cmake_build.yaml@master
with:
compilers: '["gcc-14", "clang-18"]'
repo_toolchain: ".github/enable_sigma.cmake"
run_python_tests: "true"
cmake_opts: "-DENABLE_SIGMA=ON"

test_pip_build:
uses: NWChemEx/.github/.github/workflows/test_nwx_pip_build.yaml@master
17 changes: 10 additions & 7 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@ jobs:
with:
doc_target: "tensorwrapper_cxx_api"

test_library:
uses: NWChemEx/.github/.github/workflows/test_nwx_library.yaml@master
test_cmake_build:
uses: NWChemEx/.github/.github/workflows/test_nwx_cmake_build.yaml@master
with:
compilers: '["gcc-14", "clang-18"]'
run_python_tests: "true"

test_library_with_sigma:
uses: NWChemEx/.github/.github/workflows/test_nwx_library.yaml@master
test_cmake_build_with_sigma:
uses: NWChemEx/.github/.github/workflows/test_nwx_cmake_build.yaml@master
with:
compilers: '["gcc-14", "clang-18"]'
repo_toolchain: ".github/enable_sigma.cmake"
run_python_tests: "true"
cmake_opts: "-DENABLE_SIGMA=ON"

test_pip_build:
uses: NWChemEx/.github/.github/workflows/test_nwx_pip_build.yaml@master
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,9 @@ install/
toolchain.cmake

.devcontainers/

# These are MacOS files
.DS_Store

# Automatically installed in dev mode
.pre-commit-config.yaml
196 changes: 48 additions & 148 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 NWChemEx-Project
# Copyright 2026 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 @@ -14,168 +14,68 @@

cmake_minimum_required(VERSION 3.14)

# Downloads common CMake modules used throughout NWChemEx
# Downloads common CMake modules used throughout NWChemEx. Included before
# project() so nwx_set_version() is available to compute the version.
include(cmake/get_nwx_cmake.cmake)

#Sets the version to whatever git thinks it is
include(get_version_from_git)
get_version_from_git(tensorwrapper_version "${CMAKE_CURRENT_LIST_DIR}")
set(CMAKE_CXX_STANDARD 20)
project(tensorwrapper VERSION "${tensorwrapper_version}" LANGUAGES CXX)
# Version from scikit-build-core (wheels/sdists) or the latest git tag.
include(nwx_set_version)
nwx_set_version(tw_version "${CMAKE_CURRENT_LIST_DIR}")
project(tensorwrapper VERSION "${tw_version}" LANGUAGES CXX)

include(get_cmaize)
include(disable_in_source_builds)
include(set_default_nwx_options)
option(ENABLE_CUTENSOR "Enable cuTENSOR GPU backend" OFF)

# Work out full paths to the project's include/src dirs
set(project_inc_dir "${CMAKE_CURRENT_LIST_DIR}/include/${PROJECT_NAME}")
set(project_src_dir "${CMAKE_CURRENT_LIST_DIR}/src/${PROJECT_NAME}")

# Documentation
# Documentation target
include(nwx_cxx_api_docs)
nwx_cxx_api_docs("${project_inc_dir}" "${project_src_dir}")

## Extensions ##
set(SOURCE_EXTS "cpp")
set(INCLUDE_EXTS "hpp")
nwx_cxx_api_docs("cxx/include" "cxx/src")

### Options ###
cmaize_option_list(
BUILD_TESTING OFF "Should we build the tests?"
BUILD_PYBIND11_PYBINDINGS ON "Should we build Python3 bindings?"
ENABLE_SIGMA OFF "Should we enable Sigma for uncertainty tracking?"
ENABLE_CUTENSOR OFF "Should we enable cuTENSOR?"
)
# Dependencies
include(get_dependencies)
get_dependencies(utilities parallelzone wtf eigen boost)

if("${ENABLE_CUTENSOR}")
if("${ENABLE_SIGMA}")
set(MSG "Sigma is not compatible with cuTENSOR. Turning Sigma OFF.")
message(WARNING ${MSG})
set(ENABLE_SIGMA OFF)
endif()
enable_language(CUDA)
set(SOURCE_EXTS ${SOURCE_EXTS} cu)
set(INCLUDE_EXTS ${INCLUDE_EXTS} cuh hu)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --expt-relaxed-constexpr")
endif()
# TODO: ENABLE_CUTENSOR handling

### Dependendencies ###
include(get_utilities)
# Build the library
include(nwx_library)
nwx_library(${PROJECT_NAME} "cxx/include" "cxx/src"
utilities parallelzone wtf
PUBLIC eigen boost)

include(get_parallelzone)
# Generated config headers (e.g. from configure_file) live in binary dir
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)

find_package(Boost REQUIRED)
# Python module
include(nwx_python_module)
nwx_python_module(${PROJECT_NAME} "cxx/src")

cmaize_find_or_build_dependency(
eigen
NAME Eigen3
URL https://www.gitlab.com/libeigen/eigen
VERSION 2e76277bd049f7bec36b0f908c69734a42c5234f
BUILD_TARGET eigen
FIND_TARGET Eigen3::Eigen
)

cmaize_find_or_build_optional_dependency(
sigma
ENABLE_SIGMA
URL github.com/QCUncertainty/sigma
VERSION main
BUILD_TARGET sigma
FIND_TARGET sigma::sigma
CMAKE_ARGS BUILD_TESTING=OFF
ENABLE_EIGEN_SUPPORT=ON
)

cmaize_find_or_build_dependency(
WeaklyTypedFloat
NAME wtf
URL https://www.github.com/NWChemEx/weaklytypedfloat
VERSION master
BUILD_TARGET wtf
FIND_TARGET nwx::wtf
CMAKE_ARGS BUILD_TESTING=OFF
)

set(DEPENDENCIES
utilities parallelzone Boost::boost eigen sigma WeaklyTypedFloat
# C++ tests
include(catch2_tests_from_dir)
catch2_tests_from_dir(
"unit_test_${PROJECT_NAME}"
"tests/cxx/unit_tests/${PROJECT_NAME}"
${PROJECT_NAME}
PRIVATE_INCLUDES cxx/src
)

if("${ENABLE_CUTENSOR}")
include(cmake/FindcuTENSOR.cmake)
list(APPEND DEPENDENCIES cuTENSOR::cuTENSOR)
endif()

cmaize_add_library(
catch2_tests_from_dir(
"test_acceptance_${PROJECT_NAME}"
"tests/cxx/acceptance_tests/${PROJECT_NAME}"
${PROJECT_NAME}
SOURCE_DIR "${project_src_dir}"
SOURCE_EXTS "${SOURCE_EXTS}"
INCLUDE_DIRS "${project_inc_dir}"
INCLUDE_EXTS "${INCLUDE_EXTS}"
DEPENDS "${DEPENDENCIES}"
PRIVATE_INCLUDES cxx/src
)
target_include_directories(${PROJECT_NAME} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}")

if("${ENABLE_CUTENSOR}")
target_compile_definitions("${PROJECT_NAME}" PUBLIC ENABLE_CUTENSOR)
endif()

include(nwx_pybind11)
nwx_add_pybind11_module(
catch2_tests_from_dir(
"test_performance_${PROJECT_NAME}"
"tests/cxx/performance_tests/${PROJECT_NAME}"
${PROJECT_NAME}
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/src/python"
DEPENDS "${PROJECT_NAME}"
PRIVATE_INCLUDES cxx/src
)


if("${BUILD_TESTING}")
set(cxx_test_dir "${CMAKE_CURRENT_LIST_DIR}/tests/cxx")
set(cxx_unit_test_dir "${cxx_test_dir}/unit_tests/${PROJECT_NAME}")
set(
cxx_acceptance_test_dir
"${cxx_test_dir}/acceptance_tests/${PROJECT_NAME}"
)
set(
cxx_performance_test_dir
"${cxx_test_dir}/performance_tests/${PROJECT_NAME}"
)
set(python_test_dir "${CMAKE_CURRENT_LIST_DIR}/tests/python")
set(python_unit_test_dir "${python_test_dir}/unit_tests")

include(get_catch2)

cmaize_add_tests(
test_unit_${PROJECT_NAME}
SOURCE_DIR "${cxx_unit_test_dir}"
INCLUDE_DIRS "${project_src_dir}"
DEPENDS Catch2 ${PROJECT_NAME}
)

cmaize_add_tests(
test_performance_${PROJECT_NAME}
SOURCE_DIR "${cxx_performance_test_dir}"
INCLUDE_DIRS "${project_src_dir}"
DEPENDS Catch2 ${PROJECT_NAME}
)

cmaize_add_tests(
acceptance_test_${PROJECT_NAME}
SOURCE_DIR "${cxx_acceptance_test_dir}"
INCLUDE_DIRS "${project_src_dir}"
DEPENDS Catch2 ${PROJECT_NAME}
)


nwx_add_pybind11_module(
py_test_${PROJECT_NAME}
INSTALL OFF
SOURCE_DIR "${python_unit_test_dir}"
INCLUDE_DIRS "${project_inc_dir}"
DEPENDS ${PROJECT_NAME}
)

nwx_pybind11_tests(
py_${PROJECT_NAME} ${python_unit_test_dir}/test_tensorwrapper.py
SUBMODULES parallelzone pluginplay
DEPENDS py_test_${PROJECT_NAME}
)
# py_test_tensorwrapper: a pybind11 module exposing C++ test fixtures to
# tests/python/unit_tests/*.py (e.g. tensor/test_tensor.py imports
# py_test_tensorwrapper.testing). Not part of the installed package --
# test-only, built in place alongside the other test binaries.
if(BUILD_PYBIND11_BINDINGS AND BUILD_TESTING)
nwx_python_module(py_test_tensorwrapper "tests/python/unit_tests" NO_INSTALL)
endif()

cmaize_add_package(${PROJECT_NAME} NAMESPACE nwx::)
Loading
Loading