Skip to content

Consolidate build configuration under cmake/ - #112

Merged
skilledwolf merged 9 commits into
masterfrom
cleanup/root-layout
Aug 19, 2026
Merged

Consolidate build configuration under cmake/#112
skilledwolf merged 9 commits into
masterfrom
cleanup/root-layout

Conversation

@skilledwolf

@skilledwolf skilledwolf commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • move the project CMake modules and build helpers from config/ to cmake/
  • remove obsolete Debian sid packaging, SVN-era header tooling, and stale root files
  • add a default CMake preset, citation guidance, and refreshed root documentation
  • consistently document CMake 3.22 (enables presets) as floor
  • update standalone tutorial projects to the 3.22 floor
  • keep generated build-tree package files under build/cmake/ and remove a machine-specific tutorial path

Validation

  • clean CMake configuration with system Boost and a temporary install prefix
  • full alps library build
  • installation of the build component and verification of installed ALPSConfig.cmake
  • CMake preset discovery
  • git diff --check

skilledwolf and others added 4 commits August 17, 2026 14:14
Relocate the CMake modules and build helpers from config/ to cmake/
(git-tracked renames, contents unchanged) and drop dead legacy:

- remove Debian sid packaging (SVN/wheezy-era, unreferenced; superseded
  by the wheel + CPack packaging paths)
- remove SVN-era license-header tooling (preamble*.in, update_preamble*)
- remove stale root files (README.txt, README-package.txt, Welcome.txt,
  CTestConfig.cmake)
- add CITATION.md and CMakePresets.json

The config/ directory is now gone; cmake/ is the single home for build
configuration. No functional/build behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
version.h.in declared ALPS_VERSION_MAJOR/MINOR/PATCH with cmakedefine,
which emits "/* #undef NAME */" when the substituted value is false-y.
CMake counts 0 as false-y, so any x.y.0 release generated a header with
that component silently missing. 2.4.0 would have tripped it.

Use a plain #define for every macro the build unconditionally sets.
Keep cmakedefine only for ALPS_XML_ALTERNATE_DIR, which the build never
sets and parser/xslt_path.C guards with #ifdef.

Also add ALPS_VERSION_NUMBER/ALPS_VERSION_NUM() for preprocessor version
comparisons (BOOST_VERSION packing), and drop two macros: ALPS_SVN_REVISION,
which expanded a variable unset since the SVN migration and was always
#undef, and ALPS_SRCDIR, which baked the build machine's source path into
an installed header for one line of pconfig output.

Refs #95

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The version was hardcoded in CMakeLists.txt and had already drifted: CMake
said 2.3.3, the newest tag is v2.3.4, and pyalps' pyproject.toml says 2.3.4b1.

Put the numeric release in ALPS_VERSION.txt, read it in cmake/ALPSVersion.cmake
before project(), and derive ALPS_VERSION_MAJOR/MINOR/PATCH from
PROJECT_VERSION_*. The file holds MAJOR.MINOR.PATCH and nothing else, because
project(VERSION) rejects non-numeric input and neither SOVERSION nor
find_package() matching has any notion of prerelease ordering. A malformed
file is rejected with a message naming the file, rather than CMake's bare
"VERSION format invalid". Corrects the version to 2.3.4 in passing.

ALPS_VERSION_BUILD, which was always empty, becomes the ALPS_VERSION_PRERELEASE
cache variable: it carries "beta.2" into display strings while the numeric
version stays clean. "Prerelease" because a later change adds real build
metadata (a git hash), and two similarly-named slots would confuse.

Generate and install ALPSConfigVersion.cmake. Without it find_package(ALPS
<version>) accepted any version it found and silently discarded the
constraint. SameMinorVersion: within 2.3.x a patch release is drop-in, a minor
bump is not guaranteed to be. Note this is stricter than the SOVERSION of
MAJOR alone advertises; reconciling the soname is a packaging-visible change
and is left alone here.

Derive ALPS_YEAR with string(TIMESTAMP), which honours SOURCE_DATE_EPOCH, so
distro and conda reproducible builds still get a stable year.

ALPS_SRCDIR is dropped from the installed header by the preceding commit, but
two tests use it to locate reference .h5 inputs. Give those two targets a
private compile definition instead: a build-tree path belongs there, not in an
installed public header.

Refs #95

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@skilledwolf

Copy link
Copy Markdown
Collaborator Author

Please note: PRs #107 and #111, #112 and #114 were stacked (only #107 was targeted into master). That was my bad, I'm rebasing them now, so we can land them independently for the release.

@skilledwolf
skilledwolf changed the base branch from WIP/remove-lattice-preview to master August 17, 2026 19:26
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@skilledwolf skilledwolf self-assigned this Aug 17, 2026
Conflicts: README-package.txt and config/debian/sid/copyright were
reworded on master by the SPDX license sweep but are deleted by this
branch; both deletions are kept. The citation guidance formerly in
README-package.txt lives in CITATION.md on this branch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@skilledwolf
skilledwolf marked this pull request as ready for review August 18, 2026 08:05
@egull
egull requested review from Ooolab and egull August 18, 2026 15:41
Comment thread CITATION.md Outdated

@egull egull left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to merge this, but have a look at the comments I put and discuss (?) if they should be addressed. I'm not at all insisting.

Comment thread CITATION.md
Comment thread CONTRIBUTING.md Outdated
Comment thread README.md
@skilledwolf
skilledwolf requested a review from marcusr2ML August 18, 2026 20:27
3.21 was chosen as the CMakePresets v3 schema floor, but no supported
distro ships exactly 3.21, so that floor is never exercised. 3.22 is
what Ubuntu 22.04 (the oldest CI platform) ships, making the declared
minimum one that CI actually builds with. RHEL 9 (3.31) and Debian 12
(3.25) are unaffected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@skilledwolf
skilledwolf merged commit 867b91d into master Aug 19, 2026
83 checks passed
@skilledwolf
skilledwolf deleted the cleanup/root-layout branch August 19, 2026 03:09
skilledwolf added a commit that referenced this pull request Aug 19, 2026
Require C++17 and fix the CI standard matrix (after #112)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants