Skip to content

Licence hygiene: add LICENSE, header the unheadered files, quarantine the GPL modules - #35

Merged
transfix merged 19 commits into
masterfrom
chore/licence-hygiene
Nov 7, 2026
Merged

transfix merged 19 commits into
masterfrom
chore/licence-hygiene

Conversation

@transfix

@transfix transfix commented Sep 3, 2026 •

Copy link
Copy Markdown
Owner

Cleans up the licensing state of the repository, from a licence audit run on 2026-09-03 (full analysis in cvc-engagement-docs/modernization/f2dock-port-hamiltonian-docking-acceleration.md §4.2). This is Track D item D0 / FoldHub P0.4, and item F1 in cy-pca/cyconv's plan (docs/plan/PLAN.md §9.4). Reentrancy, the libf2dock API and the bindings all wait on it.

Two findings are deliberately not addressed here and need UT rulings. See Still open.

What was wrong

  • The repository asserted LGPL-2.1 in prose only. There was no LICENSE file, and CPACK_RESOURCE_FILE_LICENSE pointed at INSTALL, so every package shipped with no licence text. 44 sources had no header.
  • GPL-2.0-or-later code was compiled into the LGPL binary by default (sparsefft3, which was the default FFT path, and libicp), and a GPL header was #included into the LGPL core header.
  • FFTW, which every binary linked, is itself GPL-2.0-or-later, so every F2Dock binary was a combined work under the GPL whatever the vendored code did.

What this PR does

Change Commits
LGPL-2.1 LICENSE, shipped by CPack and install() 2a52b2e
UT Austin LGPL banner on the 44 unheadered files (six skipped as not this project's work); SPDX tags aligned to 2.1-only 7023738, df91564
F2DOCK_ENABLE_GPL_COMPONENTS (default OFF) gates sparsefft3 and libicp; inc/fft-utils/sparsefft3-api.h is the seam, so the core never includes a GPL header; useSparseFFT / icpRefine in a default build are refused with an explanation 9db11f5
THIRD-PARTY.md: every vendored tree, its upstream, licence and whether the default build compiles it 3ae5b59, e835c0c, fa03c6d
F2DOCK_FFT_PROVIDER: fft_provider.h seam behind the existing FFTW_* macros, PocketFFT (BSD-3) by default, FFTW opt-in with a configure warning and a GPL startup banner 13801a8, 3b9d432
libcvc and GoogleTest from cvcpkg, no FetchContent; cvcpkg/recipes/f2dock/ recipe 2c7b226, a0a5b9a, a681d38, ef43d6a
CI: dependencies from cvcpkg only, one GPL lane so the gated code cannot rot 4c73df5, e2fbe60, cf76799, c7285bf
Windows: find the cvcpkg pthreads4w bundle, which has no package config d23170f, ff60e10

What changed on 2026-11-06

The branch had been red on every build and package job since September. Master had not moved (still 0883fd3) and there were no reviews, so the six new commits sit on top of cf76799 with no merge or rebase.

Why every job failed at "Provision dependencies (cvcpkg)". The September logs have expired and the run could not be re-run, so this comes from reading the action's source. .github/actions/cvcpkg-deps delegated to transfix/libcvc-deps/.github/actions/cvcpkg-install@master and passed it include_host_tools and fallback_to_source. Those inputs were expected from transfix/libcvc-deps#564, which never added them (it is an unrelated change, still open), and that repository is now archived: cvcpkg moved to cy-pca/cvcpkg. So every lane ran install-deps with no host tools and no fallback. The first tuple the catalog lacked failed it (cf76799 quotes googletest for linux-debug and macOS), the action swallowed that and reported an empty prefix, and the next step turned it into the red step.

  • c7285bf ci: install cvcpkg directly and provision release bundles. The action pip-installs cvcpkg from cy-pca/cvcpkg at the cvcpkg-v2.5.11 tag (install.sh has no Windows build, and cvcpkg is not on PyPI). It runs install-deps --include-host-tools --no-fallback-to-source, so cmake and ninja come from the catalog and a missing tuple names itself. Dependency bundles are always the release ones, as in libcvc's recipe CI.
    • The matrix pins ubuntu-24.04 (gcc 13, what the tree is verified with; ubuntu-latest has moved to a newer gcc without notice) and windows-2022 (VS2022 v143, the toolchain the bundles are built with; windows-latest's VS2026 CL.exe ICEs on libcvc's C++20 headers).
    • Windows Debug is dropped. The catalog publishes no windows-debug libcvc, and a /MDd F2Dock against /MD bundles is a CRT mismatch across the libcvc DLL boundary. The integration cases that lane ran now run on Windows Release.
    • The GPL lane now selects the FFTW provider and runs the golden integration cases, so it is the one lane that checks them against the transform they were recorded with.
    • No apt left in ci.yml. clang-format 18.1.8 and lcov 2.0 come from cvcpkg; dpkg-dev is gone (CPack's DEB generator needs only the base image's dpkg). The Linux tarball now bundles every library resolved from the cvcpkg prefix; it used to match libfftw only.
  • 3b9d432 build: accept only FFT providers that exist; sparsefft3 needs FFTW.
    • mkl and cufft named fft_mkl.cpp / fft_cufft.cpp, which do not exist. Selecting either is now a configure error saying the backend is planned (cyconv F16).
    • F2DOCK_ENABLE_GPL_COMPONENTS=ON with the default provider did not compile: sparsefft3 calls FFTW_plan_many_dft / FFTW_execute_dft. It is now built only with F2DOCK_FFT_PROVIDER=fftw as well; with any other provider the option builds libicp alone.
    • The startup banner names the provider and counts an FFTW link as GPL.
  • ef43d6a cvcpkg: drop fftw3 from the f2dock recipe; depend on pocketfft. The recipe schema has no optional dependencies, so FFTW is out of the recipe entirely, and a build that opts in to the FFTW provider adds it with cvcpkg install fftw3. CI's GPL lane does that through the action's new extra input. build.sh / build.ps1 pass -DF2DOCK_FFT_PROVIDER=pocketfft explicitly.
  • fa03c6d docs. README and THIRD-PARTY.md caught up with the provider seam (they still said every binary links FFTW, and that pip install cvcpkg works).
  • d23170f, ff60e10 Windows. These came out of the first CI run on the new provisioning.
    • Configure failed at find_package(PThreads4W): that package config came from vcpkg's port, and the cvcpkg bundle ships only pthread.h, pthreadVC3.lib and the DLL. CMake/FindPThreads4W.cmake uses a config if there is one and otherwise defines the same PThreads4W::PThreads4W target, finding the header through _ptw32.h so MinGW's winpthreads cannot match.
    • The build then failed in a dozen static libraries whose headers include <pthread.h> without linking the target. vcpkg's MSBuild integration had been adding its include directory to every project. The include directory now goes on every target on Windows.

Verification

Local, against cvcpkg's libcvc 3.7.11, gcc 13, Release:

Configuration Unit tests Golden integration (4 runs + server)
default: PocketFFT, GPL off 187/187 5/5
PocketFFT + GPL (libicp only) 197/197 —
FFTW + GPL (sparse + libicp; master's configuration) 197/197 4/4 (server test not rerun)
FFTW, GPL off 187/187 4/4
mkl, cufft configure error naming the missing backend

master's 197 cases all pass with PocketFFT. The 10 beyond 187 are the ICP tests, which build only with the GPL option.

Poses with PocketFFT. Largest difference over every row of each golden case. The tests compare the first 50 rows at ABS_TOL 1e-3 / REL_TOL 1e-5; no tolerance was changed.

Case Rows PocketFFT dense vs golden FFTW + sparse vs golden PocketFFT dense vs FFTW dense
1ACB 54 2e-5 abs, 6.95e-6 rel 2e-5 abs, 6.95e-6 rel 0
1A2K 108 1e-5 abs, 1.56e-6 rel 1e-5 abs, 1.56e-6 rel 0
1A2K_flex 108 0 0 0
1A2K_domain 108 0 0 0
  • Poses, ranks, RMSDs, rotations and translations are identical. What differs is the fifth printed decimal of a score and the sign of printed zeros (-0.00000 vs 0.00000).
  • PocketFFT and FFTW agree exactly at the printed precision.
  • The deltas against the baselines appear with FFTW + sparse too, the configuration they were recorded with, so they come from the build that recorded them, not from the provider.

Licence of the default build. ldd on F2Dock, GB-Rerank, FilterOutput and F2DockServer finds no libfftw3. libcvc 3.7.11's cvcConfig.cmake has its FFTW lookup compiled out, which closes the transitive gap 13801a8 recorded. The only sparse3DFFT* symbols in F2Dock are the stubs. clang-format --dry-run --Werror over the whole tree is clean with 18.1.8.

PocketFFT costs 1.4-1.7x in FFT throughput at equal core count (THIRD-PARTY.md has the measurements). MKL or cuFFT (F16) is the way to get that back without GPL.

CI

Run 42292607979 at ff60e10: all 10 jobs green.

Job Result
clang-format (whole codebase) pass (cvcpkg clang-format 18.1.8)
ubuntu-24.04 / Debug pass: 187/187 unit + 5/5 integration, lcov 2.0 from cvcpkg
ubuntu-24.04 / Release pass: 187/187
ubuntu-24.04 / Release / GPL components pass: 197/197 + 5/5 integration on FFTW + sparse
windows-2022 / Release pass: 187/187 + 5/5 integration (MSVC 19.44, PocketFFT)
macos-latest / Debug pass: 187/187 + 5/5 integration (arm64, PocketFFT)
macos-latest / Release pass: 187/187
package / linux pass
package / windows pass
package / macos pass: provision, configure, build, .dmg and .zip

Every lane resolves libcvc 3.7.11 from cvcpkg; no lane compiles libcvc or installs anything from apt or Homebrew.

Still open

Neither of the first two is touched by this PR. Both need a decision, probably from UT counsel, rather than a commit.

  1. libmol (72 of 76 files). Needs a UT ruling. The Boston University notice at inc/libmol/mask.h:3-16 grants copy-and-modify rights only to "US Universities and US Government supported Research Institutions", only for educational and research purposes, and says the software "may not be distributed to any other institution without express permission". That is a class-of-licensee and field-of-use restriction incompatible with the LGPL, the GPL and redistribution generally. HAVE_LIBMOL is OFF, so it is not compiled, but it is in the published source tree, and source redistribution is what the notice restricts. Neither CVC-Lab/F2Dock nor CVC-Lab/F3Dock ships it.
  2. inc/f2dock/ElementInformation.h provenance. Needs a UT ruling. GPL-2.0-or-later in both CVC-Lab repositories, LGPL-2.1-only here, with the copyright year moved 2003 → 2011. UT holds both, so UT can relicense its own work, but nothing in the tree or the history records the decision.
  3. Smaller items recorded in THIRD-PARTY.md and left alone: src/f3dock-loop-closure/tripep_closure.{h,cpp} (bare copyright, no grant, built by default); inc/libicp/kdtree.h (AFL-1.1, referencing a LICENSE with "additional provisions" that is not in the tree; now unbuilt by default); inc/PG-range/dsexceptions.h (provenance unknown, trivially replaceable).
  4. Publishing the f2dock recipe to the cvcpkg catalog is not done here. The README says it is not published yet.
  5. Follow-ups outside this PR: the macOS .app / .dmg packaging bundles only libfftw dylibs, so it is not self-contained against the libcvc closure (it was not before either). The vendored BSD-2 fftw3.h header is still included for its type names (dropping it is cyconv F3). MKL / cuFFT backends are cyconv F16.

These are observations about the source tree, not legal advice.

The repository asserted LGPL-2.1 only in prose (README.md, OVERVIEW.md) and
had no LICENSE file at any root. CPACK_RESOURCE_FILE_LICENSE pointed at
INSTALL -- a build-instructions file with no licence text -- so every
generated DEB/TGZ shipped with no licence at all.

Add the FSF LGPL-2.1 text as LICENSE, point CPack at it, and install it
alongside README.md. The copy is the canonical FSF text whose "how to apply"
address matches the per-file banners already in the tree.
44 sources carried no licence header at all. Each now gets the same UT
Austin LGPL-2.1 banner the rest of the tree uses, with the copyright year
taken from when the file first appeared and the author line taken from a
sibling in the same module where the tree already records one.

Files deliberately left alone, because they are not this project's work and
stamping a UT banner on them would be a false claim:

  src/f3dock-loop-closure/sturm.h   Graphics Gems (Hook & McAree), via
                                    Chaok Seok; provenance comment, no grant
  inc/PG-range/dsexceptions.h       nine lines, provenance unknown
  inc/libmol/newgetline.h           libmol; Boston University notice applies
  src/libmol/newgetline.cpp         to the whole tree
  src/libmol/test.cpp
  src/libmol/testHbond.cpp

inc/PG-range/cuckoo.h and src/PG-range/cuckoo.cc already carry a permissive
BRICS grant and needed nothing. All six abstentions are recorded in
THIRD-PARTY.md.
DockMode.h and test_dock_mode.cpp were the only files carrying an SPDX tag,
and it read LGPL-2.1-or-later. Every other LGPL file in the tree grants
"version 2.1 as published by the Free Software Foundation" with no
"or (at your option) any later version" clause -- that is 2.1-only -- and
README.md and the new LICENSE both say 2.1. Align the tags.

Both files are UT Austin's own work, so this records the project's stated
licence rather than changing anyone's grant. Revert this commit alone if the
intent was in fact to relicense the project as 2.1-or-later.
@transfix
transfix force-pushed the chore/licence-hygiene branch from a1b6351 to 8d7c0f7 Compare September 3, 2026 23:20
…ult OFF)

F2Dock is LGPL-2.1-only, but two vendored modules are GPL-2.0-or-later and
one of them was built by default:

  sparsefft3  MIT 2000, modified at CVC Lab -- the `useSparseFFT` transform
  libicp      Andreas Geiger / KIT -- the `icpRefine` pose refinement

Linking either makes the F2Dock binary a combined work covered by the GPL.
Worse, inc/f2dock/Docking.h -- the LGPL core header -- #included
fft-utils/sparsefft3.h, which carries structs, enums and macros rather than
bare declarations, so the GPL text was pulled into LGPL translation units.

Both are now behind one explicitly-named option, OFF by default. With it OFF
neither source is compiled and neither object is linked.

The seam is inc/fft-utils/sparsefft3-api.h (LGPL): it forwards to the real
header when the module is built, and otherwise declares the same three entry
points against an incomplete plan type -- which is all the core needs, since
the plan is only ever held and passed as an opaque pointer.
src/fft-utils/sparsefft3-stub.cpp satisfies the link and fails loudly if a
future caller reaches it. Docking.h and fastfft.h now include the seam.
sparsefft3-timers.h was in Docking.h's include list but is used only by
sparsefft3-plan.cpp, so that include is simply gone.

The default FFT path changes as a result -- pr.useSparseFFT was
unconditionally true. It now follows the build. The dense FFTW path this
falls back to was already complete and already selected by
`useSparseFFT false`: Docking.cpp pins both plan pointers to NULL at the
`if (!useSparseFFT)` branch and every call site tests for that, so the
switch is the existing, exercised path rather than a new one. It is slower
and produces the same scores.

Asking for either feature in a parameter file is now an error with an
explanation, following the F2DOCK_HAVE_NFFT precedent, rather than a silent
downgrade. F2Dock prints its licence posture and FFT path at startup:

  GPL components: sparseFFT=no libicp=no (build licence: LGPL-2.1-only)
  FFT path: dense (FFTW)

f2dock::refine_pose_point_to_plane keeps its signature in both
configurations and becomes a no-op returning refined == false -- the same
result Docking.cpp already handles when ICP does not converge.

Verified: both configurations configure, build and pass. Default build,
187/187 unit tests; the only sparse3DFFT symbols in the binary are the
stubs, against the opaque type, so no GPL header was reached.
Nine vendored trees, with upstream, author, licence, and whether the default
build compiles them. Four are permissive and need nothing (SSEApproxMath,
the vendored fftw3.h, cuckoo). Two are the GPL modules now behind
F2DOCK_ENABLE_GPL_COMPONENTS. Three are open questions, marked as such:

  libmol                  Boston University notice restricting both the class
                          of licensee and the field of use. Not free, not
                          redistributable. Not compiled, but it is in the
                          published source tree, and source redistribution is
                          what the notice restricts.
  tripep_closure.{h,cpp}  bare copyright, no grant of any kind -- and built
                          by default.
  dsexceptions.h          provenance unknown; nine lines, probably not
                          copyrightable, but nobody knows where it came from.

Also records, without resolving, that ElementInformation.h is
GPL-2.0-or-later in both CVC-Lab repositories and LGPL-2.1-only here with the
copyright year moved 2003 -> 2011.

README points at the file from both the layout and licence sections.
F2DOCK_ENABLE_GPL_COMPONENTS is OFF by default, so after the previous commit
nothing in the matrix compiled sparsefft3 or libicp -- the code would break
silently and only surface for whoever next needed the sparse FFT. One extra
ubuntu-latest/Release job builds and tests with the option ON.

The job name, concurrency group and artifact name all pick up a suffix so the
new entry does not collide with the existing ubuntu-latest/Release one.

Also notes the licence gate in doc/F3DOCK_MIGRATION_MATRIX.md, whose Phase 2
and Phase 4 sections describe an ICP pass that a default build no longer
contains.
Every macOS and Windows job fails while compiling libcvc, not F2Dock:

  CGAL/.../Static_filters/Static_filter_error.h:110:10: error: expected
    member name or ';' after declaration specifiers
    110 |   double error()  const { return _e; }
  note: expanded from macro 'error'
    libcvc-src/src/cvc/SDF/SignDistanceFunction_v2/reg3data.h:12

libcvc's reg3data.h defines a function-like `error(x)` macro at file scope.
CGAL 6 deprecated AABB_traits.h into AABB_traits_3.h, which now pulls in
Static_filter_error and its `double error() const`; `error()` matches the
one-parameter macro with an empty argument. Homebrew and vcpkg both ship
CGAL 6.2 now, so libcvc stopped compiling on both platforms. Fixed upstream
in transfix/libcvc#324.

Picking the fix up means moving off the v3.2.1-era pin. Two consequences for
F2Dock, both confined to src/vol/RAWIV.cpp, the only file here that touches
libcvc:

  - 3.3.0 moved the public headers into subdirectories: cvc/app.h ->
    cvc/core/app.h, cvc/types.h -> cvc/core/types.h, and bounding_box /
    dimension / volume / volume_file_info under cvc/volume/.
  - CVC_NAMESPACE is gone; cvc/core/namespace.h now just declares
    `namespace cvc {}`. The 17 CVC_NAMESPACE:: qualifiers become cvc::.

LIBCVC_VERSION moves to 3.3.0 as well, so it acts as a compatibility floor:
an older installed or prebuilt libcvc now fails the find_package() version
check and falls through to the source build, instead of being accepted and
then failing to compile against the new include paths. There is no v3.3.0
GitHub release, so the prebuilt strategy misses and the source path is what
runs -- same as it already did for v3.2.1.

The SHA is pinned one commit past v3.3.0 because the tag itself still has
the macro.

Verified locally: configures, builds, 187/187 unit tests, and a 1A2K docking
run produces output identical to the same run against the old pin.
F2Dock now gets every third-party library from the cvcpkg catalog and builds
libcvc never. Removed outright: the FetchContent source build of libcvc, the
release-tarball download, the legacy fetch-libcvc-deps action, the apt/brew
dependency installs, and the entire vcpkg apparatus on Windows (the D: drive
re-routing for disk space, the cache save/restore, and the 5-attempt retry
loop that existed because gmp's GNU mirror timed out on ~1 cold run in 3).

Why the source build had to go rather than stay as a fallback: compiling
libcvc is what pulled CGAL and the host toolchain into F2Dock's build, and it
broke on both non-Linux platforms at once. Homebrew and vcpkg have both moved
to CGAL 6.2, which collides with a `#define error(x)` in libcvc's reg3data.h;
windows-latest's VS18 v180 crashes CL.exe outright on cvc.vcxproj. A fallback
that only runs when the fast path fails is a fallback that only runs on the
broken platforms.

  cvcpkg/recipes/f2dock/   the recipe: libcvc + fftw3 (+ pthreads4w on
                           Windows), everything else transitive through
                           libcvc. Builds F2Dock/GB-Rerank/FilterOutput/
                           F2DockServer with the GPL components OFF, so the
                           published bundle is unambiguously LGPL-2.1.
  cvcpkg/recipes/_common/  env-windows.ps1, so the Windows recipe build pins
                           cl.exe and the CRT instead of letting CMake pick
                           MinGW off the runner PATH.
  .github/actions/cvcpkg-deps/  one composite action, used by all six jobs
                           across ci.yml and release.yml.

CMakeLists.txt drops the three-strategy resolution for a plain
find_package(cvc 3.3.0 CONFIG) plus an explicit cvc::xmlrpc check, each with
an error that names the fix. --include-host-tools brings cmake and ninja from
the catalog too, so the runner image's toolchain is not in play either.

The only apt left anywhere is clang-format (lint job), lcov (coverage
report) and dpkg-dev (.deb packaging) -- none participate in compiling or
linking F2Dock.

Verified end to end against a locally-built stand-in for the libcvc 3.3.0
+cvc.4 bundle (CVC_USING_XMLRPC=ON, exported version fixed):

  configure   8.1s, "Using libcvc 3.3.0 from <prefix>/lib/cmake/cvc"
  build       24s, and zero libcvc objects compiled (was ~35 min)
  ctest       187/187
  1A2K run    pose output identical to the pre-change build

This needs libcvc 3.3.0+cvc.4. Every bundle published so far exports no
cvc::xmlrpc and reports PACKAGE_VERSION "3.0", so both checks reject them --
which is exactly why F2Dock always fell back to the source build.
tests/unit/CMakeLists.txt FetchContent'd googletest v1.14.0 from github by
commit SHA at configure time. That was the only thing left in the build that
reached the network, and the only dependency not resolved through the
recipe. It now comes from the catalog like everything else:

    find_package(GTest CONFIG REQUIRED)

with `googletest` added to cvcpkg/recipes/f2dock's BUILD deps only -- the
tests need it, the published f2dock bundle does not, so it stays out of the
runtime closure.

Needs the googletest recipe in transfix/libcvc-deps#563 (1.17.0, gtest +
gmock, gtest_force_shared_crt=ON on Windows so the CRT matches the link
mode).

Verified against a prefix carrying the catalog build of googletest 1.17.0
alongside libcvc:

  configure   no FetchContent at all
  build       22.6s, zero _deps/ objects compiled
  ctest       187/187

The suite was written against 1.14 and needed no changes for 1.17.
…question

THIRD-PARTY.md noted in passing that "the FFTW library itself is
GPL-2.0-or-later and is linked dynamically". That understates it. SetupFFTW()
is unconditional at CMakeLists.txt:32 and FFTW_LIB is linked unconditionally,
and the cvcpkg recipe agrees (license: GPL-2.0-or-later) -- so every F2Dock
binary is a combined work with GPL code regardless of the sparsefft3/libicp
gating. Quarantining those cleaned up the vendored tree; it did not make the
shipped binary LGPL.

So an FFT-provider swap is load-bearing for the licence, not an optimisation.
Documents the measured trade rather than asserting one, since that is the
decision:

  * PocketFFT (BSD-3) agrees with FFTW to float64 round-off (<= 7.3e-12 across
    N=64..256), so it is a valid drop-in on correctness.
  * At F2Dock's real numFreq=120 a single transform is 1.31x slower, but the
    number that matters is throughput at equal core count -- F2Dock
    parallelises over rotations with single-threaded transforms -- and there
    FFTW is 1.41-1.73x faster. That is the honest cost.
  * A latency-only comparison flatters PocketFFT (nthreads=4 makes one
    transform 2.6x faster than single-threaded FFTW), but that spends four
    cores on one transform while F2Dock already spends them on four rotations.

Also records how small the swap is -- the whole FFTW surface is already behind
the FFTW_* macros in fftwPrecision.h and is ~25 call shapes with no threads,
guru interface, wisdom or advanced plans -- and lists MKL/cuFFT (proprietary
but redistributable, which LGPL permits linking) and FFTW's commercial licence
as the alternatives to eating the 1.4-1.7x.

Benchmarks were run on this workstation against fftw3 from the catalog; they
are a decision aid, not a portable claim.
`pip install cvcpkg` fails -- cvcpkg is not published to PyPI:

    ERROR: Could not find a version that satisfies the requirement cvcpkg
      (from versions: none)

which failed every lane on this branch. The supported entry point is
libcvc-deps' own cvcpkg-install composite action, which provisions cvcpkg and
runs `cvcpkg install-deps` against a recipe; libcvc consumes it the same way.

Passes include_host_tools so cmake, ninja and googletest come from the
catalog. Without it a hermetic build has nothing to fall back on, since the
apt/brew/vcpkg steps are gone.

NOTE: include_host_tools is added by transfix/libcvc-deps#564 and is not on
that repo's master yet, so this pins @master and will fail with "Unexpected
input" until #564 lands. Sequencing, not a defect.
F2Dock is LGPL-2.1-only and FFTW is GPL-2.0-or-later, so every binary built
so far has been a combined work under the GPL. Gating the vendored GPL modules
(sparsefft3, libicp) cleaned the source tree but left that untouched -- the
linked library was always the larger question.

  -DF2DOCK_FFT_PROVIDER=pocketfft   (default) BSD-3
                        mkl         Intel oneMKL
                        cufft       NVIDIA cuFFT
                        fftw        GPL, opt-in, warns

Choosing fftw prints a boxed configure-time warning that the resulting binary
is GPL and must not be shipped under F2Dock's licence, and SetupFFTW() now runs
ONLY on that path -- an LGPL build no longer even searches for a GPL library.

The seam is small because the engine never called FFTW directly: every
transform already went through the FFTW_* macros in fftwPrecision.h. Those
macros now resolve either to FFTW (unchanged) or to cvc::fft, a provider-neutral
API that deliberately keeps FFTW's semantics -- unnormalised in both
directions, half-complex r2c layout, plans that capture their buffers -- so
swapping providers is not a change in behaviour. Docking.cpp is untouched.

Two smaller things fell out:

  * fftwPrecision.h no longer defines plan_many_dft, execute_dft or the wisdom
    pair on the neutral path. Those were used only by the GPL sparsefft3 module
    and by rank-fftw, so leaving them undefined turns any future non-FFTW use
    into a compile error naming the symbol instead of a silent fallback.
  * rank-fftw builds for every provider now, which is more correct: the
    efficient grid sizes it measures should reflect the transform actually in
    use. Its only FFTW-specific calls were the wisdom pair, already dead behind
    #ifdef SAVE_WISDOM_TO_FILE, which is defined nowhere in the tree.

Verified on PocketFFT, against the FFTW build as baseline:
  build           clean, no fftw3 on F2Dock's own link line
  ctest           187/187
  1A2K docking    pose output IDENTICAL -- every score, rank, rmsd, rotation
                  and translation

KNOWN GAP: the binary still resolves libfftw3 transitively, because libcvc
itself is built with CVC_ENABLE_FFTW and exports it to consumers. F2Dock's
own dependency is gone; finishing the job needs libcvc built without FFTW
(F2Dock uses it for volume I/O and xmlrpc, not transforms) or moved to a
permissive provider too. That is a libcvc packaging decision, not one to make
here.
googletest is published for linux-release and both windows configs, but this
matrix also builds linux-debug and macOS, and cvcpkg fails hard on a missing
tuple:

    Error: requested component(s) not found in the catalog for this platform
    tuple: googletest

Tying F2Dock's CI to the completeness of libcvc-deps' publish matrix makes it
red for reasons no change here can cause or fix. fallback_to_source builds the
gap from the recipe's pinned source instead -- slower for that one component,
still hermetic, and it closes on its own as the tuples get published.

Needs transfix/libcvc-deps#564, which adds the input.
Two configurations named in CMake could not build:

  * F2DOCK_FFT_PROVIDER=mkl / =cufft listed src/fft-utils/fft_mkl.cpp and
    fft_cufft.cpp, which do not exist, so either choice failed at generate
    time on a missing source. Both are now a configure error that says the
    provider is planned but has no backend yet. The accepted set is
    pocketfft (default) and fftw.

  * F2DOCK_ENABLE_GPL_COMPONENTS=ON with the default PocketFFT provider
    failed to compile sparsefft3, which calls FFTW_plan_many_dft and
    FFTW_execute_dft directly:

        sparsefft3.cpp:47:5: error: 'FFTW_execute_dft' was not declared
        sparsefft3-plan.cpp:190:27: error: 'FFTW_plan_many_dft' was not
          declared

    sparsefft3 is now built only when the FFTW provider is selected as
    well. libicp does no transforms, so with any other provider the option
    builds libicp alone. F2DOCK_WITH_SPARSEFFT and F2DOCK_WITH_LIBICP are
    defined from what is actually built rather than from the option.

The startup banner now names the provider and counts an FFTW link toward
"build licence: GPL-2.0-or-later", which the CMake comment already claimed
it did:

    GPL components: sparseFFT=no libicp=no (build licence: LGPL-2.1-only)
    FFT path: dense, provider PocketFFT (BSD-3-Clause)

The .deb depends on the system libfftw3-3 only when FFTW is the provider.

Verified with libcvc 3.7.11 from cvcpkg, Release, gcc 13:

  pocketfft                 187/187 unit tests
  pocketfft + GPL (libicp)  197/197
  fftw + GPL (all)          197/197
  fftw                      187/187
  mkl, cufft                configure error naming the missing backend
The recipe still declared fftw3 as a build and runtime dependency after
PocketFFT became the default provider, so the bundle it describes would
have pulled a GPL library into an LGPL package's closure, and it did not
declare the pocketfft header F2Dock now builds against at all (it only
resolved because libcvc happens to depend on it).

  build:    libcvc, pocketfft, googletest, pthreads4w (windows)
  runtime:  libcvc, pthreads4w (windows)

pocketfft is header-only, so it is a build dependency only. The recipe
schema has no optional dependencies, so a local build that opts in to
-DF2DOCK_FFT_PROVIDER=fftw adds FFTW itself (`cvcpkg install fftw3`);
the comment in the recipe says so.

build.sh and build.ps1 now pass -DF2DOCK_FFT_PROVIDER=pocketfft alongside
-DF2DOCK_ENABLE_GPL_COMPONENTS=OFF, so a change of default cannot change
the published bundle's licence.

`cvcpkg validate cvcpkg/recipes/f2dock` passes apart from `libcvc`, which
lives in the libcvc repository rather than the default recipe set.
Every build and package job failed at "Provision dependencies (cvcpkg)".
The composite action delegated to
transfix/libcvc-deps/.github/actions/cvcpkg-install@master and passed it
include_host_tools and fallback_to_source, expecting
transfix/libcvc-deps#564 to add them. It never did (#564 is an unrelated
change, still open), and that repository has since been archived: cvcpkg
moved to cy-pca/cvcpkg. So every lane ran install-deps without host tools
or fallback, and the first tuple the catalog lacked failed it (cf76799
quotes the one it hit then: googletest for linux-debug and macOS). The
action swallows that failure and reports an empty prefix, which the next
step turns into the red "Provision dependencies" seen on every lane. The
September logs have expired; this is reconstructed from the action's
source and those commit messages.

The action now does the install itself:

  * cvcpkg from cy-pca/cvcpkg at the cvcpkg-v2.5.11 tag, pip-installed
    from a sparse checkout as libcvc's CI does. install.sh has no Windows
    build, and cvcpkg is not on PyPI.
  * `cvcpkg install-deps cvcpkg/recipes/f2dock --include-host-tools
    --no-fallback-to-source`, so cmake and ninja come from the catalog
    and a missing tuple is a red lane that names it.
  * Release bundles whatever the build type. Debug coverage on the
    catalog is partial, and a Debug F2Dock links the release shared
    bundles fine on Linux and macOS; libcvc's recipe CI does the same.
  * An `extra` input for components a lane opts in to and the recipe
    leaves out (fftw3 for the FFTW provider).

Matrix:

  * ubuntu-24.04 instead of ubuntu-latest, which has moved to a newer gcc
    without notice; gcc 13 is what the tree is verified with.
  * Windows is Release only, on windows-2022. The catalog has no
    windows-debug libcvc, and a /MDd F2Dock against /MD bundles is a CRT
    mismatch across the libcvc DLL boundary. windows-latest's VS2026 CL.exe
    ICEs on libcvc's C++20 headers; the bundles are built with v143. The
    integration cases the Windows Debug lane ran now run on Release.
  * The GPL lane selects the FFTW provider (sparsefft3 needs it) and runs
    the golden integration cases, which makes it the one lane that checks
    them against the transform they were recorded with.

No apt left in ci.yml: clang-format (18.1.8) and lcov (2.0) come from
cvcpkg, and dpkg-dev is gone, since CPack's DEB generator needs only the
base image's dpkg. The Linux tarball now bundles every library the
binaries resolve from the cvcpkg prefix; it used to match libfftw only,
which the default build no longer links. release.yml gets the same
runner pins and bundling.
THIRD-PARTY.md and README.md were written before the provider seam, so
they still said every binary links FFTW, that the default build uses
dense FFTW, and that `pip install cvcpkg` works (cvcpkg is not on PyPI).

  * THIRD-PARTY.md: the FFTW section becomes "FFTW, the linked library",
    marked resolved for the default build, with the evidence: no libfftw3
    in `ldd` of any of the four default binaries, and the libcvc 3.7.11
    bundles are FFTW-free too, which closes the transitive gap 13801a8
    recorded. Adds the end-to-end comparison on the golden integration
    cases, and records that sparsefft3 needs the FFTW provider.
  * README.md: a provider table, the real cvcpkg install commands, the
    new startup banner, the GPL build line with -DF2DOCK_FFT_PROVIDER=fftw,
    and the f2dock package marked as not yet published.
  * doc/F3DOCK_MIGRATION_MATRIX.md: the sparse FFT note follows suit.

Golden cases, largest difference over every row:

  case         PocketFFT dense   FFTW + sparse     PocketFFT dense
               vs golden         vs golden         vs FFTW dense
  1ACB         2e-5 / 6.95e-6    2e-5 / 6.95e-6    0
  1A2K         1e-5 / 1.56e-6    1e-5 / 1.56e-6    0
  1A2K_flex    0                 0                 0
  1A2K_domain  0                 0                 0

(abs / rel). Poses, ranks, RMSDs, rotations and translations are identical
throughout; the rest is the fifth printed decimal of a score and the sign
of printed zeros. The deltas against the baselines appear with FFTW +
sparse as well, so they are not the provider's.
The first CI run on cvcpkg provisioning got both Windows jobs through
"Provision dependencies" -- all 50 components resolved, libcvc 3.7.11
included -- and then stopped at configure:

    CMake Error at CMakeLists.txt:22 (find_package):
      Could not find a package configuration file provided by
      "PThreads4W" with any of the following names:
        PThreads4WConfig.cmake
        pthreads4w-config.cmake

PThreads4WConfig.cmake came from vcpkg's port. The cvcpkg pthreads4w
bundle ships none: only include/pthread.h, lib/pthreadVC3.lib and
bin/pthreadVC3.dll. CMake/FindPThreads4W.cmake uses a config when there
is one and otherwise defines PThreads4W::PThreads4W over the library it
finds, so the four targets that link it are unchanged. The header is
located through _ptw32.h, which only pthreads4w ships, so it cannot pick
up the MinGW winpthreads pthread.h of another bundle in the closure.

CMAKE_MODULE_PATH moves above the lookup so the module is seen.

Checked on Linux against the real windows/x86_64 bundle with the .lib
suffix forced: resolves pthreadVC3.lib and its include/.
With pthreads4w found, the Windows build got through configure and then
failed in a dozen static libraries:

    inc\utils\utils.h(34,10): error C1083: Cannot open include file:
      'pthread.h': No such file or directory [...\utils.vcxproj]

and the same from fast-GB, fast-clash, fast-hydro, fast-LJ,
fast-resCont and misc-ident. Their headers include <pthread.h>, but only
the executables link PThreads4W::PThreads4W. vcpkg's MSBuild integration
used to put its include directory on every project, which hid that; a
cvcpkg prefix is not added implicitly. The include directory of the
target now goes on all of F2Dock's targets when building for Windows.

The rest of that build was clean: fft-utils (PocketFFT), vol (libcvc),
F2DockServer (cvc::xmlrpc) and the unit tests that do not reach those
headers all built with MSVC 19.44.
@transfix
transfix merged commit a65e223 into master Nov 7, 2026
10 checks passed
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.

1 participant