From 2e46a45a8bbb17cc460be04c94ef317ba0f224fb Mon Sep 17 00:00:00 2001 From: Nick Thompson Date: Tue, 17 Nov 2026 19:30:04 -0800 Subject: [PATCH] Replace Boost.Filesystem with std::filesystem in reporting The accuracy and performance reporting tools now need C++17. Co-Authored-By: Claude --- reporting/accuracy/Jamfile.v2 | 13 +++++----- reporting/accuracy/handle_test_result.hpp | 14 +++++------ reporting/performance/Jamfile.v2 | 29 ++++++++++++----------- reporting/performance/table_helper.cpp | 14 +++++------ 4 files changed, 36 insertions(+), 34 deletions(-) diff --git a/reporting/accuracy/Jamfile.v2 b/reporting/accuracy/Jamfile.v2 index 42080d3408..f8f6ac3906 100644 --- a/reporting/accuracy/Jamfile.v2 +++ b/reporting/accuracy/Jamfile.v2 @@ -20,6 +20,7 @@ using auto-index ; project : requirements ../../include_private + 17 ; if $(is_unix) @@ -81,42 +82,42 @@ rule all-tests { local result ; for local source in [ glob test*.cpp ] { - result += [ run $(source) /boost/system//boost_system /boost/filesystem//boost_filesystem /boost/test//boost_unit_test_framework /boost/interprocess//boost_interprocess /boost/multiprecision//boost_multiprecision /boost/type_index//boost_type_index quadmath mpfr + result += [ run $(source) /boost/test//boost_unit_test_framework /boost/interprocess//boost_interprocess /boost/multiprecision//boost_multiprecision /boost/type_index//boost_type_index quadmath mpfr : : : [ check-target-builds has_gsl : ALWAYS_TEST_DOUBLE : ] linux:-lpthread linux:-lrt gcc:$(OTHERFLAGS) ] ; - result += [ run $(source) /boost/system//boost_system /boost/filesystem//boost_filesystem /boost/test//boost_unit_test_framework /boost/interprocess//boost_interprocess /boost/multiprecision//boost_multiprecision /boost/type_index//boost_type_index quadmath mpfr + result += [ run $(source) /boost/test//boost_unit_test_framework /boost/interprocess//boost_interprocess /boost/multiprecision//boost_multiprecision /boost/type_index//boost_type_index quadmath mpfr : : : [ check-target-builds has_cxx17_cmath : TEST_CXX17_CMATH : no ] linux:-lpthread linux:-lrt gcc:$(OTHERFLAGS) : $(source:B)_cxx17_cmath ] ; - result += [ run $(source) /boost/system//boost_system /boost/filesystem//boost_filesystem /boost/test//boost_unit_test_framework /boost/interprocess//boost_interprocess /boost/multiprecision//boost_multiprecision /boost/type_index//boost_type_index quadmath mpfr + result += [ run $(source) /boost/test//boost_unit_test_framework /boost/interprocess//boost_interprocess /boost/multiprecision//boost_multiprecision /boost/type_index//boost_type_index quadmath mpfr : : : [ check-target-builds has_c99_cmath : TEST_C99 : no ] linux:-lpthread linux:-lrt gcc:$(OTHERFLAGS) : $(source:B)_c99 ] ; - result += [ run $(source) /boost/system//boost_system /boost/filesystem//boost_filesystem /boost/test//boost_unit_test_framework /boost/interprocess//boost_interprocess /boost/multiprecision//boost_multiprecision /boost/type_index//boost_type_index gsl gslcblas + result += [ run $(source) /boost/test//boost_unit_test_framework /boost/interprocess//boost_interprocess /boost/multiprecision//boost_multiprecision /boost/type_index//boost_type_index gsl gslcblas : : : [ check-target-builds has_gsl : TEST_GSL : no ] linux:-lpthread linux:-lrt gcc:$(OTHERFLAGS) : $(source:B)_gsl ] ; - result += [ run $(source) /boost/system//boost_system /boost/filesystem//boost_filesystem /boost/test//boost_unit_test_framework /boost/interprocess//boost_interprocess /boost/multiprecision//boost_multiprecision /boost/type_index//boost_type_index Rmath + result += [ run $(source) /boost/test//boost_unit_test_framework /boost/interprocess//boost_interprocess /boost/multiprecision//boost_multiprecision /boost/type_index//boost_type_index Rmath : : : [ check-target-builds has_rmath : TEST_RMATH : no ] linux:-lpthread linux:-lrt gcc:$(OTHERFLAGS) : $(source:B)_rmath ] ; - result += [ run $(source) /boost/system//boost_system /boost/filesystem//boost_filesystem /boost/test//boost_unit_test_framework /boost/interprocess//boost_interprocess /boost/multiprecision//boost_multiprecision /boost/type_index//boost_type_index cephes_double + result += [ run $(source) /boost/test//boost_unit_test_framework /boost/interprocess//boost_interprocess /boost/multiprecision//boost_multiprecision /boost/type_index//boost_type_index cephes_double : : : [ check-target-builds $(here)/third_party/cephes_double/acosh.c : TEST_CEPHES cephes_double : no ] linux:-lpthread linux:-lrt diff --git a/reporting/accuracy/handle_test_result.hpp b/reporting/accuracy/handle_test_result.hpp index 3410bb150d..4eecda7ee6 100644 --- a/reporting/accuracy/handle_test_result.hpp +++ b/reporting/accuracy/handle_test_result.hpp @@ -11,8 +11,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -30,7 +30,7 @@ inline std::string sanitize_string(const std::string& s) } static std::string content; -boost::filesystem::path path_to_content; +std::filesystem::path path_to_content; struct content_loader { @@ -38,14 +38,14 @@ struct content_loader boost::interprocess::scoped_lock lock; content_loader() : mu(boost::interprocess::open_or_create, "handle_test_result"), lock(mu) { - boost::filesystem::path p(__FILE__); + std::filesystem::path p(__FILE__); p = p.parent_path(); p /= "doc"; p /= "accuracy_tables.qbk"; path_to_content = p; - if(boost::filesystem::exists(p)) + if(std::filesystem::exists(p)) { - boost::filesystem::ifstream is(p); + std::ifstream is(p); if(is.good()) { do @@ -59,7 +59,7 @@ struct content_loader } ~content_loader() { - boost::filesystem::ofstream os(path_to_content); + std::ofstream os(path_to_content); os << content; } void instantiate()const diff --git a/reporting/performance/Jamfile.v2 b/reporting/performance/Jamfile.v2 index f1f94b23e8..11b35d11d1 100644 --- a/reporting/performance/Jamfile.v2 +++ b/reporting/performance/Jamfile.v2 @@ -25,6 +25,7 @@ import predef project : requirements ../../include_private + 17 ; if $(is_unix) @@ -97,13 +98,13 @@ lib dcdflib : $(here)/third_party/dcdflib/$(DCDFLIB_SOURCE) explicit dcdflib ; -obj table_helper : table_helper.cpp /boost/filesystem//boost_filesystem /boost/interprocess//boost_interprocess ; +obj table_helper : table_helper.cpp /boost/interprocess//boost_interprocess ; rule all-tests { local result ; for local source in [ glob test*.cpp ] { - result += [ run $(source) /boost/regex//boost_regex /boost/system//boost_system /boost/filesystem//boost_filesystem /boost/multiprecision//boost_multiprecision /boost/filesystem//boost_filesystem table_helper + result += [ run $(source) /boost/regex//boost_regex /boost/multiprecision//boost_multiprecision table_helper : : : release ../../test [ check-target-builds ../accuracy//has_c99_cmath : TEST_C99 ] [ check-target-builds has_libstdcxx_tr1 : TEST_LIBSTDCXX ] @@ -122,35 +123,35 @@ rule all-tests { # Special cases to test different compiler options, # cbrt first as an example of a trivial function: # -run test_cbrt.cpp /boost/regex//boost_regex /boost/system//boost_system /boost/filesystem//boost_filesystem table_helper +run test_cbrt.cpp /boost/regex//boost_regex table_helper : : : debug COMPILER_COMPARISON_TABLES [ predef-require "BOOST_COMP_MSVC" ] 32 : test_cbrt_msvc_debug ; -run test_cbrt.cpp /boost/regex//boost_regex /boost/system//boost_system /boost/filesystem//boost_filesystem table_helper +run test_cbrt.cpp /boost/regex//boost_regex table_helper : : : release COMPILER_COMPARISON_TABLES [ predef-require "BOOST_COMP_MSVC" ] -Ox 32 : test_cbrt_msvc_release_32 ; -run test_cbrt.cpp /boost/regex//boost_regex /boost/system//boost_system /boost/filesystem//boost_filesystem table_helper +run test_cbrt.cpp /boost/regex//boost_regex table_helper : : : release COMPILER_COMPARISON_TABLES [ predef-require "BOOST_COMP_MSVC" ] -Ox 64 : test_cbrt_msvc_release_64 ; -run test_cbrt.cpp /boost/regex//boost_regex /boost/system//boost_system /boost/filesystem//boost_filesystem table_helper +run test_cbrt.cpp /boost/regex//boost_regex table_helper : : : release COMPILER_COMPARISON_TABLES [ check-target-builds is_intel_win : : no ] intel:-Ox 64 : test_cbrt_intel_release ; # # Now jn as a little more complex: # -run test_jn.cpp /boost/regex//boost_regex /boost/system//boost_system /boost/filesystem//boost_filesystem table_helper +run test_jn.cpp /boost/regex//boost_regex table_helper : : : debug COMPILER_COMPARISON_TABLES ../../test [ predef-require "BOOST_COMP_MSVC" ] 32 : test_jn_msvc_debug ; -run test_jn.cpp /boost/regex//boost_regex /boost/system//boost_system /boost/filesystem//boost_filesystem table_helper +run test_jn.cpp /boost/regex//boost_regex table_helper : : : release COMPILER_COMPARISON_TABLES ../../test [ predef-require "BOOST_COMP_MSVC" ] -Ox 32 : test_jn_msvc_release_32 ; -run test_jn.cpp /boost/regex//boost_regex /boost/system//boost_system /boost/filesystem//boost_filesystem table_helper +run test_jn.cpp /boost/regex//boost_regex table_helper : : : release COMPILER_COMPARISON_TABLES ../../test [ predef-require "BOOST_COMP_MSVC" ] -Ox 64 : test_jn_msvc_release_64 ; -run test_jn.cpp /boost/regex//boost_regex /boost/system//boost_system /boost/filesystem//boost_filesystem table_helper +run test_jn.cpp /boost/regex//boost_regex table_helper : : : release COMPILER_COMPARISON_TABLES ../../test [ check-target-builds is_intel_win : : no ] 64 : test_jn_intel_release ; # # Then something really expensive, like the inverse-incomplete-beta: # -run test_ibeta_inv.cpp /boost/regex//boost_regex /boost/system//boost_system /boost/filesystem//boost_filesystem table_helper +run test_ibeta_inv.cpp /boost/regex//boost_regex table_helper : : : debug COMPILER_COMPARISON_TABLES ../../test [ predef-require "BOOST_COMP_MSVC" ] 32 : test_ibeta_inv_msvc_debug ; -run test_ibeta_inv.cpp /boost/regex//boost_regex /boost/system//boost_system /boost/filesystem//boost_filesystem table_helper +run test_ibeta_inv.cpp /boost/regex//boost_regex table_helper : : : release COMPILER_COMPARISON_TABLES ../../test [ predef-require "BOOST_COMP_MSVC" ] -Ox 32 : test_ibeta_inv_msvc_release_32 ; -run test_ibeta_inv.cpp /boost/regex//boost_regex /boost/system//boost_system /boost/filesystem//boost_filesystem table_helper +run test_ibeta_inv.cpp /boost/regex//boost_regex table_helper : : : release COMPILER_COMPARISON_TABLES ../../test [ predef-require "BOOST_COMP_MSVC" ] -Ox 64 : test_ibeta_inv_msvc_release_64 ; -run test_ibeta_inv.cpp /boost/regex//boost_regex /boost/system//boost_system /boost/filesystem//boost_filesystem table_helper +run test_ibeta_inv.cpp /boost/regex//boost_regex table_helper : : : release COMPILER_COMPARISON_TABLES ../../test [ check-target-builds is_intel_win : : no ] intel:-Ox 64 : test_ibeta_inv_intel_release ; test-suite report_gen : [ all-tests ] test_cbrt_msvc_debug test_cbrt_msvc_release_32 test_cbrt_msvc_release_64 test_cbrt_intel_release diff --git a/reporting/performance/table_helper.cpp b/reporting/performance/table_helper.cpp index 0fc84e1418..cc3e595025 100644 --- a/reporting/performance/table_helper.cpp +++ b/reporting/performance/table_helper.cpp @@ -9,8 +9,8 @@ #include #include -#include -#include +#include +#include #include #include #include @@ -45,7 +45,7 @@ std::string format_precision(double val, int digits) } static std::string content; -boost::filesystem::path path_to_content; +std::filesystem::path path_to_content; struct content_loader { @@ -54,14 +54,14 @@ struct content_loader { boost::interprocess::named_mutex mu(boost::interprocess::open_or_create, "handle_test_result"); boost::interprocess::scoped_lock lock(mu); - boost::filesystem::path p(__FILE__); + std::filesystem::path p(__FILE__); p = p.parent_path(); p /= "doc"; p /= "performance_tables.qbk"; path_to_content = p; - if(boost::filesystem::exists(p)) + if(std::filesystem::exists(p)) { - boost::filesystem::ifstream is(p); + std::ifstream is(p); if(is.good()) { do @@ -82,7 +82,7 @@ struct content_loader // // Write out the results: // - boost::filesystem::ofstream os(path_to_content); + std::ofstream os(path_to_content); os << content; } void instantiate()const