Skip to content

build, vendor self-contained header-only Boost uBLAS (1.89) so examples build without system Boost #293

@steven-varga

Description

@steven-varga

Symptom

With BUILD_EXAMPLES=ON (now the default for off-CI CDash submissions, #278), hosts without a system Boost fail to build:

examples/attributes/attributes.cpp:31:10: fatal error:
  boost/numeric/ublas/matrix.hpp: No such file or directory

Seen on gauss (no Boost). CI (libboost-dev) and dev boxes with Boost pass — masking the problem.

Root cause

thirdparty/ublas/v1.74.0 is mis-laid: its headers sit at v1.74.0/numeric/..., v1.74.0/config/... with no boost/ prefix directory, so #include <boost/numeric/ublas/matrix.hpp> (and uBLAS's own internal #include <boost/config.hpp>) cannot resolve against it. The build has been silently relying on system Boost (find_path(boost/config.hpp) in examples/CMakeLists.txt), so the vendored copy is effectively unused. uBLAS is header-only and needs no BLAS/LAPACK, so this should never have required a system package.

Also: v1.74 uses std::allocator::construct, removed in C++20 — hence the C++20 test skip.

Fix

Vendor a correctly-laid-out, header-only closure of a recent Boost uBLAS via bcp (no compiled libs, no BLAS/LAPACK):

  • thirdparty/ublas/v1.89.0/boost/numeric/ublas/... + its transitive Boost header deps (config, core, mpl, type_traits, preprocessor, ...), boost/-prefixed so includes resolve standalone.
  • Point libublas at the new version dir.
  • Drop the system-Boost requirement in examples/CMakeLists.txt (and test/examples) — the vendored target is now self-sufficient; the C++20 skip can be retired (1.89 uBLAS is C++20-clean).

Acceptance

  • examples/attributes/attributes.cpp and the ublas example/test build against the vendored headers with no system Boost present.
  • g++ -M shows boost/numeric/ublas/* resolving from thirdparty/ublas/..., not /usr/include.
  • Unblocks the BUILD_EXAMPLES=ON default from ci, off-CI CDash submissions from any architecture #278.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions