Skip to content

Commit 34e1f4d

Browse files
committed
[#293]:svarga:build, vendor self-contained header-only Boost uBLAS (1.89) so examples build without system Boost
1 parent db16477 commit 34e1f4d

1,393 files changed

Lines changed: 281349 additions & 1504 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/CMakeLists.txt

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -222,19 +222,11 @@ else()
222222
endif()
223223
endif()
224224

225-
# ublas headers are vendored but rely on system Boost config/compiler headers
226-
find_path(H5CPP_BOOST_CONFIG_INCLUDE_EX NAMES boost/config.hpp)
227-
if(H5CPP_BOOST_CONFIG_INCLUDE_EX)
228-
message( "-- Vendored: ublas added to examples" )
229-
# examples/attributes/attributes.cpp uses the boost/* layout
230-
# (#include <boost/numeric/ublas/matrix.hpp>); the vendored libublas only
231-
# exposes the numeric/* layout, so propagate the system/vcpkg Boost include
232-
# dir through libublas for any target that links it.
233-
target_include_directories(libublas INTERFACE ${H5CPP_BOOST_CONFIG_INCLUDE_EX})
234-
add_h5cpp_example(ublas linalg/ublas.cpp LIBRARIES libublas)
235-
else()
236-
message("-- Boost config headers not found — ublas example disabled")
237-
endif()
225+
# uBLAS is fully vendored (header-only closure under thirdparty/ublas, #293) —
226+
# libublas resolves <boost/numeric/ublas/...> standalone, so no system Boost is
227+
# required and the example always builds.
228+
message("-- Vendored: ublas added to examples")
229+
add_h5cpp_example(ublas linalg/ublas.cpp LIBRARIES libublas)
238230

239231
# ------------------------------------------------------------------------------
240232
# Sparse linalg examples (CSC group layout, scipy/Julia interop)

test/examples/CMakeLists.txt

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,11 @@ add_example_test(test_arma_io LIBRARIES libarmadillo)
4141
add_example_test(test_blaze_io LIBRARIES libblaze)
4242
add_example_test(test_dlib_io LIBRARIES libdlib)
4343

44-
# ublas v1.74 uses std::allocator::construct which was removed in C++20.
45-
# Skip the ublas test under C++20 builds.
46-
if(CMAKE_CXX_STANDARD LESS 20)
47-
find_path(H5CPP_BOOST_CONFIG_INCLUDE NAMES boost/config.hpp)
48-
if(H5CPP_BOOST_CONFIG_INCLUDE)
49-
add_example_test(test_ublas_io LIBRARIES libublas)
50-
else()
51-
message(STATUS "Boost config headers not found — skipping test_ublas_io")
52-
endif()
53-
else()
54-
message(STATUS "C++20 build — skipping test_ublas_io (ublas v1.74 requires std::allocator::construct, removed in C++20)")
55-
endif()
44+
# uBLAS is fully vendored (header-only, #293). The bundled 1.89 is C++20-clean
45+
# (the std::allocator::construct removal that forced v1.74 to be skipped under
46+
# C++20 is long fixed), and libublas resolves <boost/...> without system Boost,
47+
# so the test builds unconditionally.
48+
add_example_test(test_ublas_io LIBRARIES libublas)
5649

5750
add_example_test(test_blitz_io LIBRARIES libblitz)
5851

thirdparty/ublas/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ set(name ublas)
88
set(libname lib${name})
99
project(${libname} LANGUAGES CXX)
1010

11-
set(current_version_dir "v1.74.0")
11+
set(current_version_dir "v1.89.0")
1212
add_library(${libname} INTERFACE)
13+
# The vendored tree is a bcp-extracted, header-only closure laid out under a
14+
# `boost/` prefix, so <boost/numeric/ublas/...> resolves entirely from here —
15+
# no system Boost, no compiled libs, no BLAS/LAPACK. uBLAS ships its own (slow)
16+
# fallbacks; BLAS bindings are a separate opt-in we do not use.
1317
target_include_directories(${libname} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/${current_version_dir})

thirdparty/ublas/v1.74.0/LICENSE

Lines changed: 0 additions & 23 deletions
This file was deleted.

thirdparty/ublas/v1.74.0/preprocessor/arithmetic/add.hpp

Lines changed: 0 additions & 51 deletions
This file was deleted.

thirdparty/ublas/v1.74.0/preprocessor/arithmetic/sub.hpp

Lines changed: 0 additions & 50 deletions
This file was deleted.

thirdparty/ublas/v1.74.0/preprocessor/list/fold_right.hpp

Lines changed: 0 additions & 40 deletions
This file was deleted.

thirdparty/ublas/v1.74.0/preprocessor/list/reverse.hpp

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)