reverse-monte-carlo 1.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- reverse_monte_carlo-1.0.2/.clang-format +2 -0
- reverse_monte_carlo-1.0.2/.github/workflows/ci.yml +154 -0
- reverse_monte_carlo-1.0.2/.github/workflows/release.yml +323 -0
- reverse_monte_carlo-1.0.2/.github/workflows/weekly-release.yml +78 -0
- reverse_monte_carlo-1.0.2/.gitignore +62 -0
- reverse_monte_carlo-1.0.2/.python-version +1 -0
- reverse_monte_carlo-1.0.2/BENCHMARKS.md +119 -0
- reverse_monte_carlo-1.0.2/CMakeLists.txt +396 -0
- reverse_monte_carlo-1.0.2/CMakePresets.json +169 -0
- reverse_monte_carlo-1.0.2/DESIGN.md +340 -0
- reverse_monte_carlo-1.0.2/LICENSE +201 -0
- reverse_monte_carlo-1.0.2/NOTICE +74 -0
- reverse_monte_carlo-1.0.2/PKG-INFO +170 -0
- reverse_monte_carlo-1.0.2/README.md +641 -0
- reverse_monte_carlo-1.0.2/WORKFLOW.md +174 -0
- reverse_monte_carlo-1.0.2/examples/CMakeLists.txt +24 -0
- reverse_monte_carlo-1.0.2/examples/agitations/CMakeLists.txt +46 -0
- reverse_monte_carlo-1.0.2/examples/agitations/data/waterBox.pdb +100 -0
- reverse_monte_carlo-1.0.2/examples/agitations/main.cpp +115 -0
- reverse_monte_carlo-1.0.2/examples/angles_constraint/CMakeLists.txt +44 -0
- reverse_monte_carlo-1.0.2/examples/angles_constraint/main.cpp +78 -0
- reverse_monte_carlo-1.0.2/examples/angular_distribution/CMakeLists.txt +44 -0
- reverse_monte_carlo-1.0.2/examples/angular_distribution/main.cpp +90 -0
- reverse_monte_carlo-1.0.2/examples/atomic_niti/CMakeLists.txt +44 -0
- reverse_monte_carlo-1.0.2/examples/atomic_niti/main.cpp +138 -0
- reverse_monte_carlo-1.0.2/examples/axis_translations/CMakeLists.txt +46 -0
- reverse_monte_carlo-1.0.2/examples/axis_translations/data/atom.pdb +2 -0
- reverse_monte_carlo-1.0.2/examples/axis_translations/data/tetrahedron.pdb +5 -0
- reverse_monte_carlo-1.0.2/examples/axis_translations/main.cpp +105 -0
- reverse_monte_carlo-1.0.2/examples/benchmark/CMakeLists.txt +45 -0
- reverse_monte_carlo-1.0.2/examples/benchmark/main.cpp +359 -0
- reverse_monte_carlo-1.0.2/examples/bonds_constraint/CMakeLists.txt +44 -0
- reverse_monte_carlo-1.0.2/examples/bonds_constraint/main.cpp +71 -0
- reverse_monte_carlo-1.0.2/examples/coordination_constraint/CMakeLists.txt +44 -0
- reverse_monte_carlo-1.0.2/examples/coordination_constraint/main.cpp +66 -0
- reverse_monte_carlo-1.0.2/examples/dihedral_constraint/CMakeLists.txt +44 -0
- reverse_monte_carlo-1.0.2/examples/dihedral_constraint/main.cpp +68 -0
- reverse_monte_carlo-1.0.2/examples/generator_collector/CMakeLists.txt +46 -0
- reverse_monte_carlo-1.0.2/examples/generator_collector/data/thf.pdb +31 -0
- reverse_monte_carlo-1.0.2/examples/generator_collector/main.cpp +123 -0
- reverse_monte_carlo-1.0.2/examples/improper_constraint/CMakeLists.txt +44 -0
- reverse_monte_carlo-1.0.2/examples/improper_constraint/main.cpp +68 -0
- reverse_monte_carlo-1.0.2/examples/molecular_co2/CMakeLists.txt +44 -0
- reverse_monte_carlo-1.0.2/examples/molecular_co2/main.cpp +111 -0
- reverse_monte_carlo-1.0.2/examples/molecular_thf/CMakeLists.txt +44 -0
- reverse_monte_carlo-1.0.2/examples/molecular_thf/main.cpp +130 -0
- reverse_monte_carlo-1.0.2/examples/orientation/CMakeLists.txt +46 -0
- reverse_monte_carlo-1.0.2/examples/orientation/data/co2.pdb +19 -0
- reverse_monte_carlo-1.0.2/examples/orientation/main.cpp +112 -0
- reverse_monte_carlo-1.0.2/examples/path_generators/CMakeLists.txt +46 -0
- reverse_monte_carlo-1.0.2/examples/path_generators/data/atom.pdb +2 -0
- reverse_monte_carlo-1.0.2/examples/path_generators/data/tetrahedron.pdb +5 -0
- reverse_monte_carlo-1.0.2/examples/path_generators/main.cpp +97 -0
- reverse_monte_carlo-1.0.2/examples/reduced_sq/CMakeLists.txt +46 -0
- reverse_monte_carlo-1.0.2/examples/reduced_sq/data/experimental.fq +61 -0
- reverse_monte_carlo-1.0.2/examples/reduced_sq/data/system.pdb +33 -0
- reverse_monte_carlo-1.0.2/examples/reduced_sq/main.cpp +80 -0
- reverse_monte_carlo-1.0.2/examples/rotations/CMakeLists.txt +44 -0
- reverse_monte_carlo-1.0.2/examples/rotations/main.cpp +81 -0
- reverse_monte_carlo-1.0.2/examples/si_ox_nanosphere/CMakeLists.txt +44 -0
- reverse_monte_carlo-1.0.2/examples/si_ox_nanosphere/main.cpp +95 -0
- reverse_monte_carlo-1.0.2/examples/smart_selector/CMakeLists.txt +44 -0
- reverse_monte_carlo-1.0.2/examples/smart_selector/main.cpp +67 -0
- reverse_monte_carlo-1.0.2/examples/swap_centers/CMakeLists.txt +46 -0
- reverse_monte_carlo-1.0.2/examples/swap_centers/data/dimers.pdb +17 -0
- reverse_monte_carlo-1.0.2/examples/swap_centers/main.cpp +108 -0
- reverse_monte_carlo-1.0.2/examples/translations/CMakeLists.txt +44 -0
- reverse_monte_carlo-1.0.2/examples/translations/main.cpp +61 -0
- reverse_monte_carlo-1.0.2/extensions/mcsqs/AtatFormats.cpp +178 -0
- reverse_monte_carlo-1.0.2/extensions/mcsqs/AtatFormats.hpp +48 -0
- reverse_monte_carlo-1.0.2/extensions/mcsqs/CMakeLists.txt +93 -0
- reverse_monte_carlo-1.0.2/extensions/mcsqs/McsqsRunner.cpp +307 -0
- reverse_monte_carlo-1.0.2/extensions/mcsqs/McsqsRunner.hpp +26 -0
- reverse_monte_carlo-1.0.2/extensions/mcsqs/SeitzClusters.cpp +210 -0
- reverse_monte_carlo-1.0.2/extensions/mcsqs/SeitzClusters.hpp +45 -0
- reverse_monte_carlo-1.0.2/extensions/mcsqs/mcsqs_rmc.cpp +3 -0
- reverse_monte_carlo-1.0.2/include/RMC/Engine.hpp +131 -0
- reverse_monte_carlo-1.0.2/include/RMC/EngineBase.hpp +209 -0
- reverse_monte_carlo-1.0.2/include/RMC/EnginePolicies.hpp +96 -0
- reverse_monte_carlo-1.0.2/include/RMC/Ensemble.hpp +150 -0
- reverse_monte_carlo-1.0.2/include/RMC/RMCRunner.hpp +124 -0
- reverse_monte_carlo-1.0.2/include/RMC/analysis/AngularDistribution.hpp +56 -0
- reverse_monte_carlo-1.0.2/include/RMC/analysis/Composition.hpp +74 -0
- reverse_monte_carlo-1.0.2/include/RMC/analysis/RadialDistribution.hpp +50 -0
- reverse_monte_carlo-1.0.2/include/RMC/analysis/detail/InputCheck.hpp +40 -0
- reverse_monte_carlo-1.0.2/include/RMC/callbacks/Chi2CollectorCallback.hpp +50 -0
- reverse_monte_carlo-1.0.2/include/RMC/callbacks/HistogramCallback.hpp +38 -0
- reverse_monte_carlo-1.0.2/include/RMC/callbacks/PDBSnapshotCallback.hpp +18 -0
- reverse_monte_carlo-1.0.2/include/RMC/constraints/AngularDistributionConstraint.hpp +194 -0
- reverse_monte_carlo-1.0.2/include/RMC/constraints/ClusterCorrelationConstraint.hpp +224 -0
- reverse_monte_carlo-1.0.2/include/RMC/constraints/Constraint.hpp +186 -0
- reverse_monte_carlo-1.0.2/include/RMC/constraints/ConstraintCollection.hpp +67 -0
- reverse_monte_carlo-1.0.2/include/RMC/constraints/CoordinationConstraint.hpp +86 -0
- reverse_monte_carlo-1.0.2/include/RMC/constraints/DistanceConstraint.hpp +115 -0
- reverse_monte_carlo-1.0.2/include/RMC/constraints/GeometricConstraints.hpp +130 -0
- reverse_monte_carlo-1.0.2/include/RMC/constraints/IncrementalCache.hpp +152 -0
- reverse_monte_carlo-1.0.2/include/RMC/constraints/IncrementalHistogram.hpp +111 -0
- reverse_monte_carlo-1.0.2/include/RMC/constraints/PairCorrelationConstraint.hpp +6 -0
- reverse_monte_carlo-1.0.2/include/RMC/constraints/PairDistributionConstraint.hpp +6 -0
- reverse_monte_carlo-1.0.2/include/RMC/constraints/PairHistogram.hpp +268 -0
- reverse_monte_carlo-1.0.2/include/RMC/constraints/ReducedStructureFactorConstraint.hpp +3 -0
- reverse_monte_carlo-1.0.2/include/RMC/constraints/StructureFactorConstraint.hpp +126 -0
- reverse_monte_carlo-1.0.2/include/RMC/core/AtomsCollector.hpp +60 -0
- reverse_monte_carlo-1.0.2/include/RMC/core/BoundaryConditions.hpp +50 -0
- reverse_monte_carlo-1.0.2/include/RMC/core/Group.hpp +27 -0
- reverse_monte_carlo-1.0.2/include/RMC/core/NeighborGrid.hpp +71 -0
- reverse_monte_carlo-1.0.2/include/RMC/core/Parallel.hpp +75 -0
- reverse_monte_carlo-1.0.2/include/RMC/core/RandomStructure.hpp +35 -0
- reverse_monte_carlo-1.0.2/include/RMC/core/RngGenerator.hpp +29 -0
- reverse_monte_carlo-1.0.2/include/RMC/core/SpeciesIndex.hpp +57 -0
- reverse_monte_carlo-1.0.2/include/RMC/core/Structure.hpp +55 -0
- reverse_monte_carlo-1.0.2/include/RMC/core/Types.hpp +84 -0
- reverse_monte_carlo-1.0.2/include/RMC/generators/Agitations.hpp +64 -0
- reverse_monte_carlo-1.0.2/include/RMC/generators/Combined.hpp +56 -0
- reverse_monte_carlo-1.0.2/include/RMC/generators/GradientOracle.hpp +80 -0
- reverse_monte_carlo-1.0.2/include/RMC/generators/LangevinRotationGenerator.hpp +38 -0
- reverse_monte_carlo-1.0.2/include/RMC/generators/LangevinTranslationGenerator.hpp +36 -0
- reverse_monte_carlo-1.0.2/include/RMC/generators/LeapfrogTranslationGenerator.hpp +82 -0
- reverse_monte_carlo-1.0.2/include/RMC/generators/MoveGenerator.hpp +108 -0
- reverse_monte_carlo-1.0.2/include/RMC/generators/Path.hpp +49 -0
- reverse_monte_carlo-1.0.2/include/RMC/generators/Removes.hpp +23 -0
- reverse_monte_carlo-1.0.2/include/RMC/generators/Rotations.hpp +85 -0
- reverse_monte_carlo-1.0.2/include/RMC/generators/SpeciesSwap.hpp +67 -0
- reverse_monte_carlo-1.0.2/include/RMC/generators/Swaps.hpp +54 -0
- reverse_monte_carlo-1.0.2/include/RMC/generators/Translations.hpp +112 -0
- reverse_monte_carlo-1.0.2/include/RMC/io/Checkpoint.hpp +29 -0
- reverse_monte_carlo-1.0.2/include/RMC/io/DataReader.hpp +16 -0
- reverse_monte_carlo-1.0.2/include/RMC/io/LammpsReader.hpp +48 -0
- reverse_monte_carlo-1.0.2/include/RMC/io/PdbReader.hpp +18 -0
- reverse_monte_carlo-1.0.2/include/RMC/io/StructFormat.hpp +36 -0
- reverse_monte_carlo-1.0.2/include/RMC/io/VaspReader.hpp +43 -0
- reverse_monte_carlo-1.0.2/include/RMC/sampling/AnnealingSampler.hpp +44 -0
- reverse_monte_carlo-1.0.2/include/RMC/sampling/GreedySampler.hpp +25 -0
- reverse_monte_carlo-1.0.2/include/RMC/sampling/MetropolisSampler.hpp +37 -0
- reverse_monte_carlo-1.0.2/include/RMC/sampling/Sampler.hpp +22 -0
- reverse_monte_carlo-1.0.2/include/RMC/selectors/DirectionalOrderSelector.hpp +46 -0
- reverse_monte_carlo-1.0.2/include/RMC/selectors/GroupSelector.hpp +108 -0
- reverse_monte_carlo-1.0.2/include/RMC/selectors/OrderedSelector.hpp +12 -0
- reverse_monte_carlo-1.0.2/include/RMC/selectors/RandomSelector.hpp +44 -0
- reverse_monte_carlo-1.0.2/include/RMC/selectors/SmartRandomSelector.hpp +80 -0
- reverse_monte_carlo-1.0.2/plot_adf.py +181 -0
- reverse_monte_carlo-1.0.2/plot_gr.py +189 -0
- reverse_monte_carlo-1.0.2/plot_pdb.py +126 -0
- reverse_monte_carlo-1.0.2/pyproject.toml +112 -0
- reverse_monte_carlo-1.0.2/python/CMakeLists.txt +100 -0
- reverse_monte_carlo-1.0.2/python/README.md +159 -0
- reverse_monte_carlo-1.0.2/python/rmc/__init__.py +171 -0
- reverse_monte_carlo-1.0.2/python/rmc/_core/__init__.pyi +2444 -0
- reverse_monte_carlo-1.0.2/python/rmc/_core/mcsqs.pyi +132 -0
- reverse_monte_carlo-1.0.2/python/rmc/_protocols.py +50 -0
- reverse_monte_carlo-1.0.2/python/rmc/config.py +197 -0
- reverse_monte_carlo-1.0.2/python/rmc/errors.py +21 -0
- reverse_monte_carlo-1.0.2/python/rmc/mcsqs.py +82 -0
- reverse_monte_carlo-1.0.2/python/rmc/py.typed +0 -0
- reverse_monte_carlo-1.0.2/python/src/analysis.cpp +138 -0
- reverse_monte_carlo-1.0.2/python/src/casters.hpp +59 -0
- reverse_monte_carlo-1.0.2/python/src/constraints.cpp +454 -0
- reverse_monte_carlo-1.0.2/python/src/constraints.hpp +27 -0
- reverse_monte_carlo-1.0.2/python/src/core.cpp +315 -0
- reverse_monte_carlo-1.0.2/python/src/describe.hpp +173 -0
- reverse_monte_carlo-1.0.2/python/src/engine.cpp +261 -0
- reverse_monte_carlo-1.0.2/python/src/errors.cpp +72 -0
- reverse_monte_carlo-1.0.2/python/src/errors.hpp +94 -0
- reverse_monte_carlo-1.0.2/python/src/generators.cpp +335 -0
- reverse_monte_carlo-1.0.2/python/src/io.cpp +121 -0
- reverse_monte_carlo-1.0.2/python/src/mcsqs.cpp +112 -0
- reverse_monte_carlo-1.0.2/python/src/module.cpp +50 -0
- reverse_monte_carlo-1.0.2/python/src/runner.cpp +174 -0
- reverse_monte_carlo-1.0.2/python/src/sampling.cpp +71 -0
- reverse_monte_carlo-1.0.2/python/src/selectors.cpp +109 -0
- reverse_monte_carlo-1.0.2/python/src/trampolines.hpp +149 -0
- reverse_monte_carlo-1.0.2/python/tests/conftest.py +41 -0
- reverse_monte_carlo-1.0.2/python/tests/test_analysis.py +68 -0
- reverse_monte_carlo-1.0.2/python/tests/test_config.py +148 -0
- reverse_monte_carlo-1.0.2/python/tests/test_constraints.py +372 -0
- reverse_monte_carlo-1.0.2/python/tests/test_engine.py +265 -0
- reverse_monte_carlo-1.0.2/python/tests/test_ensemble.py +166 -0
- reverse_monte_carlo-1.0.2/python/tests/test_errors.py +63 -0
- reverse_monte_carlo-1.0.2/python/tests/test_generators.py +247 -0
- reverse_monte_carlo-1.0.2/python/tests/test_io.py +146 -0
- reverse_monte_carlo-1.0.2/python/tests/test_lifetimes.py +61 -0
- reverse_monte_carlo-1.0.2/python/tests/test_mcsqs.py +117 -0
- reverse_monte_carlo-1.0.2/python/tests/test_numpy.py +197 -0
- reverse_monte_carlo-1.0.2/python/tests/test_package.py +34 -0
- reverse_monte_carlo-1.0.2/python/tests/test_samplers_selectors.py +119 -0
- reverse_monte_carlo-1.0.2/python/tests/test_stubs.py +27 -0
- reverse_monte_carlo-1.0.2/src/Engine.cpp +74 -0
- reverse_monte_carlo-1.0.2/src/RMCRunner.cpp +517 -0
- reverse_monte_carlo-1.0.2/src/analysis/AngularDistribution.cpp +105 -0
- reverse_monte_carlo-1.0.2/src/analysis/RadialDistribution.cpp +98 -0
- reverse_monte_carlo-1.0.2/src/callbacks/Chi2CollectorCallback.cpp +51 -0
- reverse_monte_carlo-1.0.2/src/callbacks/HistogramCallback.cpp +39 -0
- reverse_monte_carlo-1.0.2/src/callbacks/PDBSnapshotCallback.cpp +21 -0
- reverse_monte_carlo-1.0.2/src/constraints/AngularDistributionConstraint.cpp +346 -0
- reverse_monte_carlo-1.0.2/src/constraints/ClusterCorrelationConstraint.cpp +346 -0
- reverse_monte_carlo-1.0.2/src/constraints/ConstraintCollection.cpp +85 -0
- reverse_monte_carlo-1.0.2/src/constraints/CoordinationConstraint.cpp +174 -0
- reverse_monte_carlo-1.0.2/src/constraints/PairConstraintBase.cpp +212 -0
- reverse_monte_carlo-1.0.2/src/core/NeighborGrid.cpp +148 -0
- reverse_monte_carlo-1.0.2/src/core/Parallel.cpp +22 -0
- reverse_monte_carlo-1.0.2/src/core/RandomStructure.cpp +80 -0
- reverse_monte_carlo-1.0.2/src/core/Structure.cpp +52 -0
- reverse_monte_carlo-1.0.2/src/io/Checkpoint.cpp +76 -0
- reverse_monte_carlo-1.0.2/src/io/DataReader.cpp +65 -0
- reverse_monte_carlo-1.0.2/src/io/LammpsReader.cpp +208 -0
- reverse_monte_carlo-1.0.2/src/io/PdbReader.cpp +137 -0
- reverse_monte_carlo-1.0.2/src/io/StructFormat.cpp +92 -0
- reverse_monte_carlo-1.0.2/src/io/TextParse.hpp +93 -0
- reverse_monte_carlo-1.0.2/src/io/VaspReader.cpp +165 -0
- reverse_monte_carlo-1.0.2/src/main.cpp +3 -0
- reverse_monte_carlo-1.0.2/tests/bench_adf.cpp +93 -0
- reverse_monte_carlo-1.0.2/tests/bench_scaling.cpp +636 -0
- reverse_monte_carlo-1.0.2/tests/bench_thf.cpp +248 -0
- reverse_monte_carlo-1.0.2/tests/test_angular_distribution.cpp +835 -0
- reverse_monte_carlo-1.0.2/tests/test_atat_pipeline.cpp +227 -0
- reverse_monte_carlo-1.0.2/tests/test_boundary_conditions.cpp +94 -0
- reverse_monte_carlo-1.0.2/tests/test_callbacks.cpp +289 -0
- reverse_monte_carlo-1.0.2/tests/test_constraints.cpp +807 -0
- reverse_monte_carlo-1.0.2/tests/test_engine.cpp +178 -0
- reverse_monte_carlo-1.0.2/tests/test_examples.cpp +452 -0
- reverse_monte_carlo-1.0.2/tests/test_generators.cpp +425 -0
- reverse_monte_carlo-1.0.2/tests/test_io_readers.cpp +436 -0
- reverse_monte_carlo-1.0.2/tests/test_radial_distribution.cpp +305 -0
- reverse_monte_carlo-1.0.2/tests/test_sampler.cpp +166 -0
- reverse_monte_carlo-1.0.2/tests/test_selectors.cpp +130 -0
- reverse_monte_carlo-1.0.2/tests/test_species_swap.cpp +423 -0
- reverse_monte_carlo-1.0.2/tools/bench_plot.py +293 -0
- reverse_monte_carlo-1.0.2/tools/build_boost.sh +37 -0
- reverse_monte_carlo-1.0.2/tools/fix_core_stubs.py +115 -0
- reverse_monte_carlo-1.0.2/tools/wheel_deps.sh +39 -0
- reverse_monte_carlo-1.0.2/uv.lock +597 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
# CI keeps builds portable and fast: MKL off, native-arch off, LTO off.
|
|
14
|
+
# Real optimised builds use the CMake presets (release / relwithdebinfo).
|
|
15
|
+
jobs:
|
|
16
|
+
linux:
|
|
17
|
+
name: ${{ matrix.compiler }} (Linux)
|
|
18
|
+
runs-on: ubuntu-24.04
|
|
19
|
+
strategy:
|
|
20
|
+
fail-fast: false
|
|
21
|
+
matrix:
|
|
22
|
+
include:
|
|
23
|
+
- compiler: gcc
|
|
24
|
+
cc: gcc-15
|
|
25
|
+
cxx: g++-15
|
|
26
|
+
- compiler: clang
|
|
27
|
+
cc: clang-20
|
|
28
|
+
cxx: clang++-20
|
|
29
|
+
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v4
|
|
32
|
+
|
|
33
|
+
# seitz transcribes its data tables at configure time with Python.
|
|
34
|
+
- uses: actions/setup-python@v5
|
|
35
|
+
with:
|
|
36
|
+
python-version: '3.12'
|
|
37
|
+
|
|
38
|
+
# seitz needs GCC 15 (<generator>, std::from_range); clang uses its libstdc++.
|
|
39
|
+
- name: Install dependencies
|
|
40
|
+
run: |
|
|
41
|
+
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
|
42
|
+
sudo apt-get update
|
|
43
|
+
sudo apt-get install -y --no-install-recommends \
|
|
44
|
+
ninja-build ccache \
|
|
45
|
+
libspdlog-dev libtbb-dev catch2 \
|
|
46
|
+
g++-15
|
|
47
|
+
pip install numpy pandas pygments
|
|
48
|
+
|
|
49
|
+
- name: Install clang 20
|
|
50
|
+
if: matrix.compiler == 'clang'
|
|
51
|
+
run: wget -qO- https://apt.llvm.org/llvm.sh | sudo bash -s -- 20
|
|
52
|
+
|
|
53
|
+
# tools/build_boost.sh: the compiled Boost libs from the 1.89 source
|
|
54
|
+
# release (ubuntu-24.04 ships 1.83), cached as an install tree.
|
|
55
|
+
- name: Cache Boost 1.89
|
|
56
|
+
id: cache-boost
|
|
57
|
+
uses: actions/cache@v4
|
|
58
|
+
with:
|
|
59
|
+
path: ~/boost
|
|
60
|
+
key: boost-1.89.0-fullheaders-graph-nowide-${{ matrix.cxx }}
|
|
61
|
+
|
|
62
|
+
- name: Build Boost 1.89
|
|
63
|
+
if: steps.cache-boost.outputs.cache-hit != 'true'
|
|
64
|
+
run: bash tools/build_boost.sh "$HOME/boost" ${{ matrix.compiler == 'clang' && 'clang' || 'gcc' }} ${{ matrix.cxx }}
|
|
65
|
+
|
|
66
|
+
# Eigen 5 is fetched from source by CMake (FetchContent) — no system pkg.
|
|
67
|
+
|
|
68
|
+
- name: ccache
|
|
69
|
+
uses: hendrikmuhs/ccache-action@v1.2
|
|
70
|
+
with:
|
|
71
|
+
key: linux-${{ matrix.compiler }}
|
|
72
|
+
|
|
73
|
+
- name: Configure
|
|
74
|
+
env:
|
|
75
|
+
CC: ${{ matrix.cc }}
|
|
76
|
+
CXX: ${{ matrix.cxx }}
|
|
77
|
+
run: >
|
|
78
|
+
cmake -S . -B build -G Ninja
|
|
79
|
+
-DBOOST_ROOT="$HOME/boost"
|
|
80
|
+
-DPython_EXECUTABLE=${{ env.pythonLocation }}/bin/python
|
|
81
|
+
-DCMAKE_BUILD_TYPE=Release
|
|
82
|
+
-DENABLE_MKL=OFF
|
|
83
|
+
-DENABLE_LTO=OFF
|
|
84
|
+
-DENABLE_NATIVE_ARCH=OFF
|
|
85
|
+
-DRMC_BUILD_TESTS=ON
|
|
86
|
+
|
|
87
|
+
- name: Build
|
|
88
|
+
run: cmake --build build --parallel
|
|
89
|
+
|
|
90
|
+
- name: Test
|
|
91
|
+
run: |
|
|
92
|
+
export LD_LIBRARY_PATH="$HOME/boost/lib:${LD_LIBRARY_PATH:-}"
|
|
93
|
+
ctest --test-dir build --output-on-failure
|
|
94
|
+
|
|
95
|
+
# The Python extension (rmc._core) through the python preset: pytest as a
|
|
96
|
+
# ctest, then the committed stubs regenerated and diffed. LTO off as above;
|
|
97
|
+
# the wheels in release.yml build with it.
|
|
98
|
+
python:
|
|
99
|
+
name: python bindings
|
|
100
|
+
runs-on: ubuntu-24.04
|
|
101
|
+
env:
|
|
102
|
+
CC: gcc-15
|
|
103
|
+
CXX: g++-15
|
|
104
|
+
steps:
|
|
105
|
+
- uses: actions/checkout@v4
|
|
106
|
+
|
|
107
|
+
- name: Install dependencies
|
|
108
|
+
run: |
|
|
109
|
+
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
|
110
|
+
sudo apt-get update
|
|
111
|
+
sudo apt-get install -y --no-install-recommends \
|
|
112
|
+
ninja-build ccache libspdlog-dev libtbb-dev g++-15
|
|
113
|
+
|
|
114
|
+
# The gcc leg's key above, so the two jobs share one Boost build.
|
|
115
|
+
- name: Cache Boost 1.89
|
|
116
|
+
id: cache-boost
|
|
117
|
+
uses: actions/cache@v4
|
|
118
|
+
with:
|
|
119
|
+
path: ~/boost
|
|
120
|
+
key: boost-1.89.0-fullheaders-graph-nowide-g++-15
|
|
121
|
+
|
|
122
|
+
- name: Build Boost 1.89
|
|
123
|
+
if: steps.cache-boost.outputs.cache-hit != 'true'
|
|
124
|
+
run: bash tools/build_boost.sh "$HOME/boost" gcc g++-15
|
|
125
|
+
|
|
126
|
+
- name: ccache
|
|
127
|
+
uses: hendrikmuhs/ccache-action@v1.2
|
|
128
|
+
with:
|
|
129
|
+
key: linux-python
|
|
130
|
+
|
|
131
|
+
- uses: astral-sh/setup-uv@v7
|
|
132
|
+
|
|
133
|
+
# The dev tools and the interpreter the preset points at (.venv). Not an
|
|
134
|
+
# editable install: its meta-path finder would shadow this build tree.
|
|
135
|
+
- name: Sync the dev tools
|
|
136
|
+
run: uv sync
|
|
137
|
+
|
|
138
|
+
- name: Configure and build
|
|
139
|
+
run: |
|
|
140
|
+
cmake --preset python -DBOOST_ROOT="$HOME/boost" -DENABLE_LTO=OFF
|
|
141
|
+
cmake --build --preset python
|
|
142
|
+
|
|
143
|
+
- name: Test
|
|
144
|
+
run: |
|
|
145
|
+
export LD_LIBRARY_PATH="$HOME/boost/lib:${LD_LIBRARY_PATH:-}"
|
|
146
|
+
ctest --preset python
|
|
147
|
+
|
|
148
|
+
- name: Check the committed stubs are current
|
|
149
|
+
env:
|
|
150
|
+
PYTHONPATH: ${{ github.workspace }}/build/python/python
|
|
151
|
+
run: |
|
|
152
|
+
export LD_LIBRARY_PATH="$HOME/boost/lib:${LD_LIBRARY_PATH:-}"
|
|
153
|
+
uv run --no-sync python tools/fix_core_stubs.py
|
|
154
|
+
git diff --exit-code python/rmc/_core
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
# RMC_run and libRMC.so, built with GCC 15 and Clang 20, as self-contained
|
|
2
|
+
# Linux tarballs attached to a GitHub Release. A tag `vX.Y.Z` builds and
|
|
3
|
+
# publishes -- pushed by hand, or cut on Mondays by weekly-release.yml; a
|
|
4
|
+
# workflow_dispatch run on a branch builds the same tarballs, leaves them on the
|
|
5
|
+
# run page and publishes nothing, which is how a change to this pipeline is
|
|
6
|
+
# tried before a version rides on it.
|
|
7
|
+
#
|
|
8
|
+
# The build is CI's: same dependencies, same Boost cache, same flags (MKL, LTO
|
|
9
|
+
# and native-arch off), minus tests, examples and mcsqs. ENABLE_NATIVE_ARCH=OFF
|
|
10
|
+
# means -march=x86-64-v3, so the binaries need an AVX2 CPU; building on
|
|
11
|
+
# ubuntu-24.04 means they need glibc 2.39 or newer.
|
|
12
|
+
#
|
|
13
|
+
# The same tag also builds the Python wheels (cibuildwheel, manylinux_2_28,
|
|
14
|
+
# CPython 3.11-3.14) and an sdist. Binaries live on GitHub, Python on PyPI: the
|
|
15
|
+
# GitHub Release carries only the RMC_run tarballs, and the wheels and sdist go
|
|
16
|
+
# to PyPI as reverse-monte-carlo by Trusted Publishing: the `pypi`
|
|
17
|
+
# job's OIDC token is exchanged for a one-off upload credential against the
|
|
18
|
+
# publisher registered for this repository, this workflow file and the `pypi`
|
|
19
|
+
# environment (deployable from v* tags only). No API token is stored anywhere.
|
|
20
|
+
# A workflow_dispatch run builds and checks the wheels and uploads nothing.
|
|
21
|
+
name: Release
|
|
22
|
+
|
|
23
|
+
on:
|
|
24
|
+
push:
|
|
25
|
+
tags: ["v*"]
|
|
26
|
+
workflow_dispatch:
|
|
27
|
+
|
|
28
|
+
permissions:
|
|
29
|
+
contents: read
|
|
30
|
+
|
|
31
|
+
jobs:
|
|
32
|
+
# First and cheap: a tag that does not name the CMake version stops here.
|
|
33
|
+
version:
|
|
34
|
+
runs-on: ubuntu-24.04
|
|
35
|
+
outputs:
|
|
36
|
+
version: ${{ steps.read.outputs.version }}
|
|
37
|
+
steps:
|
|
38
|
+
- uses: actions/checkout@v4
|
|
39
|
+
- id: read
|
|
40
|
+
run: |
|
|
41
|
+
version=$(sed -nE 's/^project\(ReverseMonteCarlo VERSION ([0-9.]+).*/\1/p' CMakeLists.txt)
|
|
42
|
+
[[ -n "$version" ]] || { echo "::error::no project(ReverseMonteCarlo VERSION ...) in CMakeLists.txt"; exit 1; }
|
|
43
|
+
echo "version=$version" >> "$GITHUB_OUTPUT"
|
|
44
|
+
echo "CMakeLists.txt says $version"
|
|
45
|
+
if [[ "$GITHUB_REF_TYPE" == tag && "$GITHUB_REF_NAME" != "v$version" ]]; then
|
|
46
|
+
echo "::error::tag $GITHUB_REF_NAME does not name CMakeLists.txt's version $version"
|
|
47
|
+
exit 1
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
native:
|
|
51
|
+
name: ${{ matrix.compiler }} (linux-x86_64)
|
|
52
|
+
needs: version
|
|
53
|
+
runs-on: ubuntu-24.04
|
|
54
|
+
strategy:
|
|
55
|
+
fail-fast: false
|
|
56
|
+
matrix:
|
|
57
|
+
include:
|
|
58
|
+
- compiler: gcc
|
|
59
|
+
cc: gcc-15
|
|
60
|
+
cxx: g++-15
|
|
61
|
+
- compiler: clang
|
|
62
|
+
cc: clang-20
|
|
63
|
+
cxx: clang++-20
|
|
64
|
+
env:
|
|
65
|
+
ARCHIVE: ReverseMonteCarlo-${{ needs.version.outputs.version }}-linux-x86_64-${{ matrix.compiler }}.tar.gz
|
|
66
|
+
steps:
|
|
67
|
+
- uses: actions/checkout@v4
|
|
68
|
+
|
|
69
|
+
# seitz transcribes its data tables at configure time with Python.
|
|
70
|
+
- uses: actions/setup-python@v5
|
|
71
|
+
with:
|
|
72
|
+
python-version: '3.12'
|
|
73
|
+
|
|
74
|
+
# seitz needs GCC 15 (<generator>, std::from_range); clang uses its libstdc++.
|
|
75
|
+
- name: Install dependencies
|
|
76
|
+
run: |
|
|
77
|
+
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
|
78
|
+
sudo apt-get update
|
|
79
|
+
sudo apt-get install -y --no-install-recommends \
|
|
80
|
+
ninja-build ccache \
|
|
81
|
+
libspdlog-dev libtbb-dev \
|
|
82
|
+
g++-15
|
|
83
|
+
pip install numpy pandas pygments
|
|
84
|
+
|
|
85
|
+
- name: Install clang 20
|
|
86
|
+
if: matrix.compiler == 'clang'
|
|
87
|
+
run: wget -qO- https://apt.llvm.org/llvm.sh | sudo bash -s -- 20
|
|
88
|
+
|
|
89
|
+
# Same key as ci.yml, so a release reuses the Boost CI already built.
|
|
90
|
+
- name: Cache Boost 1.89
|
|
91
|
+
id: cache-boost
|
|
92
|
+
uses: actions/cache@v4
|
|
93
|
+
with:
|
|
94
|
+
path: ~/boost
|
|
95
|
+
key: boost-1.89.0-fullheaders-graph-nowide-${{ matrix.cxx }}
|
|
96
|
+
|
|
97
|
+
- name: Build Boost 1.89
|
|
98
|
+
if: steps.cache-boost.outputs.cache-hit != 'true'
|
|
99
|
+
run: bash tools/build_boost.sh "$HOME/boost" ${{ matrix.compiler == 'clang' && 'clang' || 'gcc' }} ${{ matrix.cxx }}
|
|
100
|
+
|
|
101
|
+
- name: ccache
|
|
102
|
+
uses: hendrikmuhs/ccache-action@v1.2
|
|
103
|
+
with:
|
|
104
|
+
key: release-${{ matrix.compiler }}
|
|
105
|
+
|
|
106
|
+
- name: Configure
|
|
107
|
+
env:
|
|
108
|
+
CC: ${{ matrix.cc }}
|
|
109
|
+
CXX: ${{ matrix.cxx }}
|
|
110
|
+
run: >
|
|
111
|
+
cmake -S . -B build -G Ninja
|
|
112
|
+
-DBOOST_ROOT="$HOME/boost"
|
|
113
|
+
-DPython_EXECUTABLE=${{ env.pythonLocation }}/bin/python
|
|
114
|
+
-DCMAKE_BUILD_TYPE=Release
|
|
115
|
+
-DENABLE_MKL=OFF
|
|
116
|
+
-DENABLE_LTO=OFF
|
|
117
|
+
-DENABLE_NATIVE_ARCH=OFF
|
|
118
|
+
-DRMC_BUILD_TESTS=OFF
|
|
119
|
+
-DRMC_BUILD_EXAMPLES=OFF
|
|
120
|
+
-DRMC_BUILD_MCSQS=OFF
|
|
121
|
+
|
|
122
|
+
- name: Build
|
|
123
|
+
run: cmake --build build --target RMC_run --parallel
|
|
124
|
+
|
|
125
|
+
# The `runtime` component is RMC_run, libRMC.so and their bundled
|
|
126
|
+
# dependencies -- not seitz's headers or CMake package.
|
|
127
|
+
- name: Stage and pack
|
|
128
|
+
run: |
|
|
129
|
+
cmake --install build --component runtime --prefix stage
|
|
130
|
+
ls -lR stage
|
|
131
|
+
mkdir -p dist
|
|
132
|
+
tar czf "dist/$ARCHIVE" -C stage .
|
|
133
|
+
|
|
134
|
+
# The assertion that the tarball is self-contained: a stock image with no
|
|
135
|
+
# Boost, TBB or spdlog, and only GCC 14's libstdc++.
|
|
136
|
+
- name: Runs on a stock Ubuntu 24.04
|
|
137
|
+
run: docker run --rm -v "$PWD/stage:/rmc:ro" ubuntu:24.04 /rmc/bin/RMC_run --help
|
|
138
|
+
|
|
139
|
+
- uses: actions/upload-artifact@v4
|
|
140
|
+
with:
|
|
141
|
+
name: native-${{ matrix.compiler }}
|
|
142
|
+
path: dist/*
|
|
143
|
+
|
|
144
|
+
# The Python wheels. RMC_CACHE_DIR lives outside the checkout, under /host:
|
|
145
|
+
# cibuildwheel tar-copies the checkout into the container and copies only the
|
|
146
|
+
# wheelhouse back out. Two caches: the dependency tree (FetchContent + the
|
|
147
|
+
# Boost/oneTBB prefix) keyed exactly, saved only on a miss; ccache rolling.
|
|
148
|
+
wheels:
|
|
149
|
+
name: wheels (manylinux_2_28 x86_64)
|
|
150
|
+
needs: version
|
|
151
|
+
runs-on: ubuntu-24.04
|
|
152
|
+
timeout-minutes: 180
|
|
153
|
+
steps:
|
|
154
|
+
- uses: actions/checkout@v4
|
|
155
|
+
|
|
156
|
+
- uses: actions/setup-python@v5
|
|
157
|
+
with:
|
|
158
|
+
python-version: '3.12'
|
|
159
|
+
|
|
160
|
+
- name: Restore the dependency tree
|
|
161
|
+
id: deps
|
|
162
|
+
uses: actions/cache/restore@v4
|
|
163
|
+
with:
|
|
164
|
+
path: |
|
|
165
|
+
${{ runner.temp }}/rmc-cache/fc
|
|
166
|
+
${{ runner.temp }}/rmc-cache/prefix
|
|
167
|
+
key: wheels-deps-manylinux_2_28-${{ hashFiles('CMakeLists.txt', 'tools/build_boost.sh', 'tools/wheel_deps.sh') }}
|
|
168
|
+
|
|
169
|
+
- name: Restore the compiler cache
|
|
170
|
+
id: cc
|
|
171
|
+
uses: actions/cache/restore@v4
|
|
172
|
+
with:
|
|
173
|
+
path: ${{ runner.temp }}/rmc-cache/ccache
|
|
174
|
+
key: wheels-ccache-manylinux_2_28-${{ github.run_id }}
|
|
175
|
+
restore-keys: wheels-ccache-manylinux_2_28-
|
|
176
|
+
|
|
177
|
+
# v4.2.1, not 3.x: 3.4.1's manylinux_2_28 image (2026.03.20) ships
|
|
178
|
+
# patchelf 0.17.2, whose rewrite of the bundled libtbb during auditwheel
|
|
179
|
+
# repair leaves its init code zeroed -- `import rmc` segfaulted in
|
|
180
|
+
# ld.so. 4.2.1's image (2026.09.05) ships patchelf 0.19.1; this exact
|
|
181
|
+
# version and pyproject.toml were run locally for cp311-cp314.
|
|
182
|
+
- uses: pypa/cibuildwheel@v4.2.1
|
|
183
|
+
env:
|
|
184
|
+
RMC_CACHE_DIR: /host${{ runner.temp }}/rmc-cache
|
|
185
|
+
|
|
186
|
+
# The container wrote through /host as root; actions/cache tars as the
|
|
187
|
+
# runner user.
|
|
188
|
+
- name: Reclaim the cache directory
|
|
189
|
+
if: always()
|
|
190
|
+
run: sudo chown -R "$(id -u):$(id -g)" "$RUNNER_TEMP/rmc-cache" || true
|
|
191
|
+
|
|
192
|
+
# A shell test, not hashFiles(): hashFiles only sees GITHUB_WORKSPACE.
|
|
193
|
+
- name: Did the dependency tree complete?
|
|
194
|
+
if: always()
|
|
195
|
+
id: deps-state
|
|
196
|
+
run: |
|
|
197
|
+
if compgen -G "$RUNNER_TEMP/rmc-cache/prefix/.boost-*" >/dev/null && compgen -G "$RUNNER_TEMP/rmc-cache/prefix/.tbb-*" >/dev/null; then
|
|
198
|
+
echo "complete=true" >> "$GITHUB_OUTPUT"
|
|
199
|
+
fi
|
|
200
|
+
|
|
201
|
+
- name: Save the dependency tree
|
|
202
|
+
if: always() && steps.deps.outputs.cache-hit != 'true' && steps.deps-state.outputs.complete == 'true'
|
|
203
|
+
uses: actions/cache/save@v4
|
|
204
|
+
with:
|
|
205
|
+
path: |
|
|
206
|
+
${{ runner.temp }}/rmc-cache/fc
|
|
207
|
+
${{ runner.temp }}/rmc-cache/prefix
|
|
208
|
+
key: ${{ steps.deps.outputs.cache-primary-key }}
|
|
209
|
+
|
|
210
|
+
- name: Save the compiler cache
|
|
211
|
+
if: always()
|
|
212
|
+
uses: actions/cache/save@v4
|
|
213
|
+
with:
|
|
214
|
+
path: ${{ runner.temp }}/rmc-cache/ccache
|
|
215
|
+
key: ${{ steps.cc.outputs.cache-primary-key }}
|
|
216
|
+
|
|
217
|
+
# The wheel's shape: one extension, the pure-Python package, the typed
|
|
218
|
+
# marker and both stubs, and nothing vendored but Boost and oneTBB (RMC,
|
|
219
|
+
# seitz and spdlog are linked in).
|
|
220
|
+
- name: Check the wheels
|
|
221
|
+
run: |
|
|
222
|
+
python - <<'PY'
|
|
223
|
+
import glob, re, sys, zipfile
|
|
224
|
+
bad = False
|
|
225
|
+
for w in sorted(glob.glob("wheelhouse/*.whl")):
|
|
226
|
+
names = set(zipfile.ZipFile(w).namelist())
|
|
227
|
+
print(f"=== {w}")
|
|
228
|
+
for want in ("rmc/__init__.py", "rmc/config.py", "rmc/mcsqs.py", "rmc/py.typed",
|
|
229
|
+
"rmc/_core/__init__.pyi", "rmc/_core/mcsqs.pyi"):
|
|
230
|
+
if want not in names:
|
|
231
|
+
print(f"::error::{w}: missing {want}"); bad = True
|
|
232
|
+
ext = [n for n in names if re.fullmatch(r"rmc/_core\.[^/]+\.so", n)]
|
|
233
|
+
if len(ext) != 1:
|
|
234
|
+
print(f"::error::{w}: expected exactly one extension, got {ext}"); bad = True
|
|
235
|
+
# Files only: the zip also lists the directory entry itself.
|
|
236
|
+
vendored = [n for n in names if n.startswith("reverse_monte_carlo.libs/") and not n.endswith("/")]
|
|
237
|
+
stray = [n for n in vendored if not re.search(r"/lib(boost_|tbb)", n)]
|
|
238
|
+
if stray:
|
|
239
|
+
print(f"::error::{w}: unexpected vendored libraries {stray}"); bad = True
|
|
240
|
+
sys.exit(1 if bad else 0)
|
|
241
|
+
PY
|
|
242
|
+
|
|
243
|
+
# Stricter than the in-container import test: the image's LD_LIBRARY_PATH
|
|
244
|
+
# reaches gcc-toolset-14's newer libstdc++, a user's stock system does not.
|
|
245
|
+
- name: The wheels need nothing newer than the manylinux_2_28 baseline
|
|
246
|
+
run: |
|
|
247
|
+
python3 -m pip install --quiet auditwheel
|
|
248
|
+
for w in wheelhouse/*.whl; do
|
|
249
|
+
echo "=== $w"
|
|
250
|
+
python3 -m auditwheel show "$w"
|
|
251
|
+
rm -rf /tmp/unpack && python3 -m zipfile -e "$w" /tmp/unpack
|
|
252
|
+
nm -D --undefined-only /tmp/unpack/rmc/_core*.so \
|
|
253
|
+
| grep -oE 'GLIBCXX_[0-9.]+|CXXABI_[0-9.]+|GLIBC_[0-9.]+' \
|
|
254
|
+
| sort -uV | tee /tmp/vers
|
|
255
|
+
if grep -qE 'GLIBCXX_3\.4\.(2[5-9]|[3-9][0-9])' /tmp/vers; then
|
|
256
|
+
echo "::error::$w requires a post-3.4.24 GLIBCXX; see the wheels comment in pyproject.toml"
|
|
257
|
+
exit 1
|
|
258
|
+
fi
|
|
259
|
+
done
|
|
260
|
+
|
|
261
|
+
- uses: actions/upload-artifact@v4
|
|
262
|
+
with:
|
|
263
|
+
name: wheels
|
|
264
|
+
path: wheelhouse/*.whl
|
|
265
|
+
|
|
266
|
+
# `pipx run build`, not `uv build`: pyproject.toml sets [tool.uv]
|
|
267
|
+
# package = false, which uv overrides for an explicit build (astral-sh/uv#12352).
|
|
268
|
+
sdist:
|
|
269
|
+
name: sdist
|
|
270
|
+
needs: version
|
|
271
|
+
runs-on: ubuntu-24.04
|
|
272
|
+
steps:
|
|
273
|
+
- uses: actions/checkout@v4
|
|
274
|
+
- run: pipx run build --sdist
|
|
275
|
+
- uses: actions/upload-artifact@v4
|
|
276
|
+
with:
|
|
277
|
+
name: sdist
|
|
278
|
+
path: dist/*.tar.gz
|
|
279
|
+
|
|
280
|
+
# Only on a tag. A workflow_dispatch run stops before this, which is what
|
|
281
|
+
# makes a dispatch a rehearsal.
|
|
282
|
+
publish:
|
|
283
|
+
if: github.ref_type == 'tag'
|
|
284
|
+
needs: [version, native]
|
|
285
|
+
runs-on: ubuntu-24.04
|
|
286
|
+
permissions:
|
|
287
|
+
contents: write
|
|
288
|
+
steps:
|
|
289
|
+
- uses: actions/checkout@v4
|
|
290
|
+
# The RMC_run tarballs only; the wheels and sdist go to PyPI.
|
|
291
|
+
- uses: actions/download-artifact@v4
|
|
292
|
+
with:
|
|
293
|
+
pattern: native-*
|
|
294
|
+
path: dist
|
|
295
|
+
merge-multiple: true
|
|
296
|
+
- run: ls -l dist
|
|
297
|
+
- env:
|
|
298
|
+
GH_TOKEN: ${{ github.token }}
|
|
299
|
+
run: gh release create "$GITHUB_REF_NAME" dist/* --verify-tag --generate-notes
|
|
300
|
+
|
|
301
|
+
# Trusted Publishing: no token. Only the wheels and the sdist are downloaded,
|
|
302
|
+
# so the RMC_run tarballs never reach the upload.
|
|
303
|
+
pypi:
|
|
304
|
+
name: PyPI
|
|
305
|
+
if: github.ref_type == 'tag'
|
|
306
|
+
needs: [version, wheels, sdist]
|
|
307
|
+
runs-on: ubuntu-24.04
|
|
308
|
+
environment:
|
|
309
|
+
name: pypi
|
|
310
|
+
url: https://pypi.org/project/reverse-monte-carlo/${{ needs.version.outputs.version }}/
|
|
311
|
+
permissions:
|
|
312
|
+
id-token: write
|
|
313
|
+
steps:
|
|
314
|
+
- uses: actions/download-artifact@v4
|
|
315
|
+
with:
|
|
316
|
+
name: wheels
|
|
317
|
+
path: dist
|
|
318
|
+
- uses: actions/download-artifact@v4
|
|
319
|
+
with:
|
|
320
|
+
name: sdist
|
|
321
|
+
path: dist
|
|
322
|
+
- run: ls -l dist
|
|
323
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Every Monday, main becomes a release: the patch number in project() goes up by
|
|
2
|
+
# one, the bump is committed and tagged, and Release builds and publishes the
|
|
3
|
+
# artifacts for that tag. A week in which main did not move produces nothing --
|
|
4
|
+
# the test is whether HEAD is already the commit the latest tag names -- and a
|
|
5
|
+
# red main is never released. "Run workflow" is the same thing on demand.
|
|
6
|
+
#
|
|
7
|
+
# The bump is pushed over SSH with the release-agent deploy key
|
|
8
|
+
# (RELEASE_DEPLOY_KEY holds the private half) rather than with GITHUB_TOKEN: a
|
|
9
|
+
# token push does not fire release.yml's `push: tags` trigger, and main's
|
|
10
|
+
# ruleset requires a pull request, which deploy keys bypass.
|
|
11
|
+
#
|
|
12
|
+
# Minor and major bumps are written into project() by hand and tagged the same
|
|
13
|
+
# way; the next Monday finds HEAD already tagged and does nothing.
|
|
14
|
+
name: Weekly release
|
|
15
|
+
|
|
16
|
+
on:
|
|
17
|
+
schedule:
|
|
18
|
+
- cron: "0 6 * * 1"
|
|
19
|
+
workflow_dispatch:
|
|
20
|
+
|
|
21
|
+
permissions:
|
|
22
|
+
contents: read
|
|
23
|
+
actions: read
|
|
24
|
+
|
|
25
|
+
jobs:
|
|
26
|
+
release:
|
|
27
|
+
runs-on: ubuntu-24.04
|
|
28
|
+
steps:
|
|
29
|
+
# "Run workflow" offers a branch picker, and the push below is HEAD:main
|
|
30
|
+
# whatever was checked out.
|
|
31
|
+
- name: main only
|
|
32
|
+
if: github.ref_name != 'main'
|
|
33
|
+
run: |
|
|
34
|
+
echo "::error::releases are cut from main; this run is on ${{ github.ref_name }}"
|
|
35
|
+
exit 1
|
|
36
|
+
|
|
37
|
+
- uses: actions/checkout@v4
|
|
38
|
+
with:
|
|
39
|
+
fetch-depth: 0
|
|
40
|
+
ssh-key: ${{ secrets.RELEASE_DEPLOY_KEY }}
|
|
41
|
+
|
|
42
|
+
- name: Anything since the last tag?
|
|
43
|
+
id: since
|
|
44
|
+
run: |
|
|
45
|
+
last=$(git describe --tags --abbrev=0 --match 'v*' 2>/dev/null || true)
|
|
46
|
+
if [[ -z "$last" ]]; then
|
|
47
|
+
echo "no v* tag yet; this will be the first release"
|
|
48
|
+
elif [[ $(git rev-parse "$last^{commit}") == $(git rev-parse HEAD) ]]; then
|
|
49
|
+
echo "main is still $last; nothing to release"
|
|
50
|
+
echo "skip=true" >> "$GITHUB_OUTPUT"
|
|
51
|
+
else
|
|
52
|
+
echo "$(git rev-list --count "$last"..HEAD) commits since $last"
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
# CI covers both GCC and Clang, so one workflow is the whole check.
|
|
56
|
+
- name: Is main green?
|
|
57
|
+
if: steps.since.outputs.skip != 'true'
|
|
58
|
+
env:
|
|
59
|
+
GH_TOKEN: ${{ github.token }}
|
|
60
|
+
run: |
|
|
61
|
+
c=$(gh run list --workflow CI --commit "$GITHUB_SHA" --branch main \
|
|
62
|
+
--json conclusion --jq '.[0].conclusion')
|
|
63
|
+
[[ "$c" == success ]] || { echo "::error::CI on $GITHUB_SHA: ${c:-no run}"; exit 1; }
|
|
64
|
+
|
|
65
|
+
- name: Bump, commit, tag, push
|
|
66
|
+
if: steps.since.outputs.skip != 'true'
|
|
67
|
+
run: |
|
|
68
|
+
cur=$(sed -nE 's/^project\(ReverseMonteCarlo VERSION ([0-9]+\.[0-9]+\.[0-9]+).*/\1/p' CMakeLists.txt)
|
|
69
|
+
[[ -n "$cur" ]] || { echo "::error::no project(ReverseMonteCarlo VERSION ...) in CMakeLists.txt"; exit 1; }
|
|
70
|
+
new="${cur%.*}.$(( ${cur##*.} + 1 ))"
|
|
71
|
+
sed -i -E "s/^(project\(ReverseMonteCarlo VERSION )$cur\b/\1$new/" CMakeLists.txt
|
|
72
|
+
grep -q "^project(ReverseMonteCarlo VERSION $new" CMakeLists.txt \
|
|
73
|
+
|| { echo "::error::the version bump did not apply"; exit 1; }
|
|
74
|
+
git config user.name "github-actions[bot]"
|
|
75
|
+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
76
|
+
git commit -am "Release $new"
|
|
77
|
+
git tag -a "v$new" -m "Release $new"
|
|
78
|
+
git push --follow-tags origin HEAD:main
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# CMake build artefacts
|
|
2
|
+
build/
|
|
3
|
+
cmake-build-*/
|
|
4
|
+
CMakeCache.txt
|
|
5
|
+
CMakeFiles/
|
|
6
|
+
cmake_install.cmake
|
|
7
|
+
Makefile
|
|
8
|
+
*.cmake
|
|
9
|
+
!CMakeLists.txt
|
|
10
|
+
# Hand-written CMake modules live under cmake/ and must be tracked, despite the
|
|
11
|
+
# blanket *.cmake ignore above (which targets generated files in build trees).
|
|
12
|
+
!cmake/*.cmake
|
|
13
|
+
|
|
14
|
+
# Compiled output
|
|
15
|
+
*.o
|
|
16
|
+
*.obj
|
|
17
|
+
*.a
|
|
18
|
+
*.lib
|
|
19
|
+
*.dll
|
|
20
|
+
*.so
|
|
21
|
+
*.exe
|
|
22
|
+
|
|
23
|
+
# IDE folders
|
|
24
|
+
.vscode/
|
|
25
|
+
.idea/
|
|
26
|
+
*.user
|
|
27
|
+
*.suo
|
|
28
|
+
*.vcxproj.user
|
|
29
|
+
|
|
30
|
+
# Misc
|
|
31
|
+
*.DS_Store
|
|
32
|
+
Thumbs.db
|
|
33
|
+
/*.out
|
|
34
|
+
.clangd/
|
|
35
|
+
.cache/
|
|
36
|
+
!/extern/
|
|
37
|
+
|
|
38
|
+
# fullrmc / pyrep benchmark scratch (regenerated by tools/, never committed)
|
|
39
|
+
*.rmc/
|
|
40
|
+
.pyrep*
|
|
41
|
+
trajectory.xyz
|
|
42
|
+
restart.pdb
|
|
43
|
+
tools/cpp_*.xml
|
|
44
|
+
tools/frmc_ncores.json
|
|
45
|
+
tools/gr_scaling.png
|
|
46
|
+
|
|
47
|
+
# CTest artifacts (created when `ctest` is run from the source tree)
|
|
48
|
+
Testing/
|
|
49
|
+
|
|
50
|
+
!RMC/Testing
|
|
51
|
+
!/extern/
|
|
52
|
+
|
|
53
|
+
# Python: uv's venv, wheel/sdist output, caches
|
|
54
|
+
.venv/
|
|
55
|
+
dist/
|
|
56
|
+
wheelhouse/
|
|
57
|
+
__pycache__/
|
|
58
|
+
*.egg-info/
|
|
59
|
+
|
|
60
|
+
# Internal fullrmc comparison harness (never committed; see compare/README.md)
|
|
61
|
+
/compare/
|
|
62
|
+
/build_compare/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|