Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
833c7e0
uses updated build system
ryanmrichard Jul 1, 2026
114cdbd
adds upstream dependencies
ryanmrichard Jul 2, 2026
71b4f6e
code cleanup
ryanmrichard Jul 6, 2026
cac6c95
adds mac files to gitignore
ryanmrichard Jul 7, 2026
2513ce2
Retarget NWChemEx/ -> ryanmrichard/ for fork testing; adopt test_nwx_…
ryanmrichard Jul 9, 2026
2ecb16e
Retrigger CI: workflow write permissions now enabled
ryanmrichard Jul 9, 2026
81cc644
Retarget NWXCMake build dependency to fork
ryanmrichard Jul 10, 2026
649b921
Add TestPyPI publish job to merge.yaml (needs_mpi, needs_boost, extra…
ryanmrichard Jul 10, 2026
f87a391
Re-trigger CI to rebuild wheel with OpenMPI 4.1.6 fix (matches Ubuntu…
ryanmrichard Jul 12, 2026
eb43e8e
Re-trigger CI to rebuild wheel with OpenMPI --enable-mpirun-prefix-by…
ryanmrichard Jul 12, 2026
6dc38cc
Re-trigger CI to rebuild wheel with OpenMPI --disable-dlopen fix
ryanmrichard Jul 12, 2026
7f729a8
Republish: pick up build_pypi_dist fix (stop vendoring MPI, require s…
ryanmrichard Jul 12, 2026
eb6c033
Republish: fix build_pypi_dist to use exact sonames for auditwheel --…
ryanmrichard Jul 13, 2026
993deda
use fork
ryanmrichard Jul 15, 2026
3a766a6
add pre-commit to gitignore
ryanmrichard Aug 3, 2026
ce268ec
update pyproject.toml
ryanmrichard Aug 3, 2026
4bc8040
adds python build
ryanmrichard Aug 4, 2026
a244cb4
move nwxcmake/pybind11 to project
ryanmrichard Aug 5, 2026
e438428
update nightly
ryanmrichard Aug 5, 2026
cd326c7
Migrate CI/CD to NWChemEx org, master branch, real PyPI
ryanmrichard Aug 6, 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: "simde_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/
13 changes: 10 additions & 3 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,20 @@
#

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_pip_build:
uses: NWChemEx/.github/.github/workflows/test_nwx_pip_build.yaml@master
11 changes: 7 additions & 4 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
#

name: .github Pull Request Workflow
name: Pull Request Workflow

on:
pull_request:
Expand All @@ -29,7 +29,10 @@ jobs:
with:
doc_target: "simde_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_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 @@ toolchain.cmake

# Commonly install to a subdirectory called install
install/

# These are MacOS files
.DS_Store

# Automatically installed in dev mode
.pre-commit-config.yaml
93 changes: 30 additions & 63 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,72 +14,39 @@

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(simde_version "${CMAKE_CURRENT_LIST_DIR}")
# Version from scikit-build-core (wheels/sdists) or the latest git tag.
include(nwx_set_version)
nwx_set_version(simde_version "${CMAKE_CURRENT_LIST_DIR}")
project(simde VERSION "${simde_version}" LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)

include(get_cmaize)
include(nwx_cxx_api_docs)

### Paths ###
set(SIMDE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(SIMDE_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
set(SIMDE_TESTS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tests")
set(SIMDE_EXP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/experimental")

nwx_cxx_api_docs("${SIMDE_SOURCE_DIR}" "${SIMDE_INCLUDE_DIR}")

### Options ###
cmaize_option_list(
BUILD_TESTING OFF "Should we build the tests?"
BUILD_PYBIND11_PYBINDINGS ON "Build pybind11 python3 bindings?"
ENABLE_SIGMA OFF "Should we enable Sigma for uncertainty tracking?"
)
include(disable_in_source_builds)
include(set_default_nwx_options)

include(get_chemist)

include(get_pluginplay)

cmaize_add_library(
${PROJECT_NAME}
SOURCE_DIR "${SIMDE_SOURCE_DIR}/${PROJECT_NAME}"
INCLUDE_DIRS "${SIMDE_INCLUDE_DIR}/${PROJECT_NAME}"
DEPENDS chemist pluginplay
)

# N.B. this is a no-op if BUILD_PYBIND11_PYBINDINGS is not turned on
include(nwx_pybind11)
nwx_add_pybind11_module(
# Documentation target
include(nwx_cxx_api_docs)
nwx_cxx_api_docs("cxx/include" "cxx/src")

# Dependencies: simde is header-only; its C++ deps come from chemist+pluginplay
include(get_dependencies)
get_dependencies(chemist pluginplay)

# Build the library (header-only → nwx_library creates INTERFACE target)
include(nwx_library)
nwx_library(${PROJECT_NAME} "cxx/include" "cxx/src"
chemist pluginplay)

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

# C++ tests
include(catch2_tests_from_dir)
catch2_tests_from_dir(
"unit_test_${PROJECT_NAME}"
"tests/cxx/unit_tests"
${PROJECT_NAME}
SOURCE_DIR "${SIMDE_SOURCE_DIR}/python"
DEPENDS "${PROJECT_NAME}"
)

if("${BUILD_TESTING}")
set(CXX_TEST_DIR ${SIMDE_TESTS_DIR}/cxx)
set(PYTHON_TEST_DIR ${SIMDE_TESTS_DIR}/python)

include(get_catch2)

cmaize_add_tests(
test_unit_${PROJECT_NAME}
SOURCE_DIR "${CXX_TEST_DIR}/unit_tests"
INCLUDE_DIRS "${SIMDE_SOURCE_DIR}/${PROJECT_NAME}"
DEPENDS Catch2 ${PROJECT_NAME}
)

# N.B. these are no-ops if BUILD_PYBIND11_PYBINDINGS is not turned on
nwx_pybind11_tests(
py_simde "${PYTHON_TEST_DIR}/unit_tests/test_simde.py"
SUBMODULES pluginplay chemist tensorwrapper parallelzone
)
endif()

cmaize_add_package(
${PROJECT_NAME} NAMESPACE nwx::
)
72 changes: 60 additions & 12 deletions cmake/get_nwx_cmake.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 NWChemEx-Project
# Copyright 2024 NWChemEx Community
#
# 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,18 +14,66 @@

include_guard()

# Puts the shared NWXCMake modules on CMAKE_MODULE_PATH. This runs *before*
# project() so factored helpers (e.g. nwx_set_version) are available to feed
# project(VERSION ...).
#
# Resolution order:
# 1. A pip-installed `nwxcmake` package (query it for its cmake/ dir). An
# editable install (`pip install -e /path/to/NWXCMake`) points at a local
# working copy, so NWXCMake edits are picked up with no git push.
# 2. Fallback: FetchContent from github.com/NWChemEx/NWXCMake.
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
)
if(NOT _NWX_CMAKE_MODULE_DIR)
# find_package(Python) needs no enabled language, so it is safe here,
# before project(). Request only the interpreter to avoid a dev/compiler
# probe this early.
find_package(Python QUIET COMPONENTS Interpreter)

set(_gnc_local_dir "")
if(Python_Interpreter_FOUND)
execute_process(
COMMAND "${Python_EXECUTABLE}" -c
"import nwxcmake,sys;sys.stdout.write(nwxcmake.cmake_dir())"
OUTPUT_VARIABLE _gnc_local_dir
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE _gnc_rc
ERROR_QUIET
)
if(NOT _gnc_rc EQUAL 0)
set(_gnc_local_dir "")
endif()
endif()

if(_gnc_local_dir AND IS_DIRECTORY "${_gnc_local_dir}")
message(STATUS
"NWXCMake: using local pip package at ${_gnc_local_dir}"
)
set(_gnc_resolved "${_gnc_local_dir}")
else()
message(STATUS
"NWXCMake: pip package not found; fetching from git"
)
include(FetchContent)
FetchContent_Declare(
nwx_cmake
GIT_REPOSITORY https://github.com/NWChemEx/NWXCMake
)
FetchContent_MakeAvailable(nwx_cmake)
set(_gnc_resolved "${nwx_cmake_SOURCE_DIR}/cmake")
endif()

# Cache the resolved directory (not CMAKE_MODULE_PATH itself) so
# reconfigures are stable. Clear this var (or the build dir) to
# re-resolve after switching between the pip and git sources.
set(_NWX_CMAKE_MODULE_DIR "${_gnc_resolved}"
CACHE INTERNAL "Resolved NWXCMake module directory"
)
endif()

# Prepend so NWXCMake modules win; set in the caller's scope (macro), do not
# FORCE-cache CMAKE_MODULE_PATH (avoids accumulating stale entries).
list(PREPEND CMAKE_MODULE_PATH "${_NWX_CMAKE_MODULE_DIR}")
endmacro()

get_nwx_cmake()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
52 changes: 52 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

[build-system]
requires = [
"scikit-build-core>=0.10",
"setuptools-scm>=8",
]
build-backend = "scikit_build_core.build"

[project]
name = "nwchemex-simde"
dynamic = ["version"]
description = "Simulation Domain Extensions for the NWChemEx ecosystem"
license = { text = "Apache-2.0" }
requires-python = ">=3.8"
dependencies = [
"pybind11",
"nwchemex-nwxcmake>=0.1.0",
"nwchemex-pluginplay>=1.0.63",
"nwchemex-chemist>=1.3.44",
]

[project.optional-dependencies]
dev = ["pytest", "pre-commit"]

[tool.scikit-build]
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
cmake.build-type = "Release"
cmake.args = ["-DBUILD_PYBIND11_BINDINGS=ON", "-DBUILD_TESTING=OFF"]
# All installed content comes from the CMake install; no pure-Python packages.
wheel.packages = []
build-dir = "build"

[tool.setuptools_scm]
fallback_version = "0.0.0"

# For editable (developer) installs, also build the tests.
[[tool.scikit-build.overrides]]
if.state = "editable"
cmake.args = ["-DDEVELOPER_SETUP=ON"]
35 changes: 35 additions & 0 deletions tests/python/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#
# 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

import parallelzone as pz
import pytest


@pytest.fixture(scope="session", autouse=True)
def _session_runtime_view():
"""
Holds a single RuntimeView for the whole pytest session.

MPI may only be initialized/finalized once per process. The first
RuntimeView constructed owns that responsibility; individual test
modules construct their own RuntimeView per test (e.g. in setUp),
which is safe only as long as this session-scoped instance is still
alive to keep MPI initialized in between. Without this, pytest would
run each test module independently and MPI would be finalized after
the first module's tests finished, breaking every module after it.
"""
rv = pz.runtime.RuntimeView()
yield rv
Loading