From eaf6a5c00286ea16b38e2b576ef7ccf852d7aa70 Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Sun, 21 Jul 2024 20:42:53 +0200 Subject: [PATCH 01/11] Update the CMake code for locating Boost. --- CMakeLists.txt | 9 ++++++++- mp++-config.cmake.in | 8 +++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dae63626..99f8597b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -411,7 +411,14 @@ endif() # Optional dependency on Boost s11n. set(_MPPP_MIN_BOOST_VERSION "1.60") if(MPPP_WITH_BOOST_S11N) - find_package(Boost ${_MPPP_MIN_BOOST_VERSION} REQUIRED COMPONENTS serialization) + # NOTE: we look in CONFIG mode first, as that has become the official supported way + # of locating Boost in recent Boost/CMake versions. If we fail, we try again in + # MODULE mode as last resort. + find_package(Boost ${_MPPP_MIN_BOOST_VERSION} QUIET COMPONENTS serialization CONFIG) + if(NOT ${Boost_FOUND}) + find_package(Boost ${_MPPP_MIN_BOOST_VERSION} QUIET MODULE REQUIRED COMPONENTS serialization) + endif() + message(STATUS "Found Boost version ${Boost_VERSION}.") target_link_libraries(mp++ PUBLIC Boost::serialization Boost::disable_autolinking) endif() diff --git a/mp++-config.cmake.in b/mp++-config.cmake.in index f55303e4..c27d39f4 100644 --- a/mp++-config.cmake.in +++ b/mp++-config.cmake.in @@ -20,7 +20,13 @@ endif() set(mp++_WITH_MPC @MPPP_WITH_MPC@) if(@MPPP_WITH_BOOST_S11N@) - find_package(Boost @_MPPP_MIN_BOOST_VERSION@ REQUIRED COMPONENTS serialization) + # NOTE: we look for Boost in CONFIG mode first, as that has become the official supported way + # of locating Boost in recent Boost/CMake versions. If we fail, we try again in + # MODULE mode as last resort. + find_package(Boost @_MPPP_MIN_BOOST_VERSION@ QUIET COMPONENTS serialization CONFIG) + if(NOT ${Boost_FOUND}) + find_package(Boost @_MPPP_MIN_BOOST_VERSION@ QUIET MODULE REQUIRED COMPONENTS serialization) + endif() endif() set(mp++_WITH_BOOST_S11N @MPPP_WITH_BOOST_S11N@) From 5038ad357bfb56fc919b8ac6f839b33fc8793876 Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Sun, 21 Jul 2024 20:50:47 +0200 Subject: [PATCH 02/11] Minor. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 99f8597b..acedf783 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -411,7 +411,7 @@ endif() # Optional dependency on Boost s11n. set(_MPPP_MIN_BOOST_VERSION "1.60") if(MPPP_WITH_BOOST_S11N) - # NOTE: we look in CONFIG mode first, as that has become the official supported way + # NOTE: we look for Boost in CONFIG mode first, as that has become the official supported way # of locating Boost in recent Boost/CMake versions. If we fail, we try again in # MODULE mode as last resort. find_package(Boost ${_MPPP_MIN_BOOST_VERSION} QUIET COMPONENTS serialization CONFIG) From dabd08208f3f30bbd8dc8084ec9a343c91181eee Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Sun, 21 Jul 2024 20:51:04 +0200 Subject: [PATCH 03/11] Fix for recent fmt versions. --- include/mp++/detail/fmt.hpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/include/mp++/detail/fmt.hpp b/include/mp++/detail/fmt.hpp index 202a851e..d30f3ab8 100644 --- a/include/mp++/detail/fmt.hpp +++ b/include/mp++/detail/fmt.hpp @@ -44,14 +44,10 @@ struct to_string_formatter { } // LCOV_EXCL_START -#if FMT_VERSION < 100000 throw std::invalid_argument("Invalid format"); -#else - fmt::throw_format_error("Invalid format"); -#endif - // LCOV_EXCL_STOP return it; + // LCOV_EXCL_STOP } template From f295552081643ade375710644169070440000383 Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Sun, 21 Jul 2024 20:52:35 +0200 Subject: [PATCH 04/11] Tentative build fix. --- tools/gha_debuggmp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gha_debuggmp.sh b/tools/gha_debuggmp.sh index 408cd34c..313a9a21 100644 --- a/tools/gha_debuggmp.sh +++ b/tools/gha_debuggmp.sh @@ -25,7 +25,7 @@ unset CFLAGS unset CXXFLAGS # Download and compile locally GMP in debug mode. -GMP_VERSION="6.2.1" +GMP_VERSION="6.3.0" wget https://github.com/esa/manylinux_x86_64_with_deps/raw/master/gmp-${GMP_VERSION}.tar.bz2 -O gmp.tar.bz2 tar xjvf gmp.tar.bz2 cd gmp-${GMP_VERSION} From 944666e7b1d8c64837129de818b89c23dfd389c3 Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Sun, 21 Jul 2024 20:52:57 +0200 Subject: [PATCH 05/11] Squashed 'cmake/yacma/' changes from 4244193e..bd69e665 bd69e665 Disable -Wnon-virtual-dtor. 138c9c06 Minor. 94850834 Some tweaks to the clang warning flags. 2b6de485 Add GCC debug warning flag. git-subtree-dir: cmake/yacma git-subtree-split: bd69e665c00a5fc73ba9f8e24045ea527665fad5 --- YACMACompilerLinkerSettings.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/YACMACompilerLinkerSettings.cmake b/YACMACompilerLinkerSettings.cmake index edafe6d4..3d9cd9da 100644 --- a/YACMACompilerLinkerSettings.cmake +++ b/YACMACompilerLinkerSettings.cmake @@ -82,6 +82,7 @@ if(NOT _YACMACompilerLinkerSettingsRun) # Configuration bits specific for GCC. if(YACMA_COMPILER_IS_GNUCXX) _YACMA_CHECK_ENABLE_CXX_FLAG(-fdiagnostics-color=auto) + _YACMA_CHECK_ENABLE_CXX_FLAG(-Woverloaded-virtual) # New in GCC 9. _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Waddress-of-packed-member) endif() @@ -109,7 +110,6 @@ if(NOT _YACMACompilerLinkerSettingsRun) _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wc99-designator) _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wreorder-init-list) _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wsizeof-pointer-div) - _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wsizeof-array-div) _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wxor-used-as-pow) _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wfinal-dtor-non-final-class) # New warnings in clang 11. @@ -122,13 +122,19 @@ if(NOT _YACMACompilerLinkerSettingsRun) # NOTE: this is a new flag in Clang 13 which seems to give # incorrect warnings for UDLs. _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wno-reserved-identifier) + _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Warray-bounds-pointer-arithmetic) + # New warnings in clang 14. + _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Warray-parameter) endif() # Common configuration for GCC, clang and Intel. if(YACMA_COMPILER_IS_CLANGXX OR YACMA_COMPILER_IS_INTELXX OR YACMA_COMPILER_IS_GNUCXX) _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wall) _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wextra) - _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wnon-virtual-dtor) + # NOTE: this flag has been superseded by "-Wdelete-non-virtual-dtor" + # (enabled by "-Wall"). See: + # https://gcc.gnu.org/pipermail/gcc-cvs/2022-November/374730.html + # _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wnon-virtual-dtor) # NOTE: this flag is a bit too chatty, let's disable it for the moment. #_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wnoexcept) _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wlogical-op) From 220272d6d1ff61c9418a6d28abd1f0aa9311431b Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Sun, 21 Jul 2024 21:26:00 +0200 Subject: [PATCH 06/11] Revert the recent UDL changes. --- include/mp++/complex.hpp | 2 +- include/mp++/detail/fmt.hpp | 8 ++++++++ include/mp++/detail/integer_literals.hpp | 2 +- include/mp++/detail/rational_literals.hpp | 2 +- include/mp++/detail/real_literals.hpp | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/include/mp++/complex.hpp b/include/mp++/complex.hpp index 6416c08f..c3b72221 100644 --- a/include/mp++/complex.hpp +++ b/include/mp++/complex.hpp @@ -3169,7 +3169,7 @@ inline namespace literals #define MPPP_DECLARE_COMPLEX_UDL(prec) \ template \ - inline complex operator"" _icr##prec() \ + inline complex operator""_icr##prec() \ { \ return complex{real{real_kind::zero, prec}, detail::real_literal_impl(prec)}; \ } diff --git a/include/mp++/detail/fmt.hpp b/include/mp++/detail/fmt.hpp index d30f3ab8..398e8b59 100644 --- a/include/mp++/detail/fmt.hpp +++ b/include/mp++/detail/fmt.hpp @@ -44,9 +44,17 @@ struct to_string_formatter { } // LCOV_EXCL_START + + // NOTE: strangely enough, fmt::throw_format_error() was promoted + // to the public API in fmt 10 and then promptly deprecated. +#if FMT_VERSION < 100000 || FMT_VERSION >= 110000 throw std::invalid_argument("Invalid format"); +#else + fmt::throw_format_error("Invalid format"); +#endif return it; + // LCOV_EXCL_STOP } diff --git a/include/mp++/detail/integer_literals.hpp b/include/mp++/detail/integer_literals.hpp index 0f7a7898..bc6fb77b 100644 --- a/include/mp++/detail/integer_literals.hpp +++ b/include/mp++/detail/integer_literals.hpp @@ -402,7 +402,7 @@ inline namespace literals #define MPPP_DECLARE_INTEGRAL_UDL(n) \ template \ - inline integer operator"" _z##n() \ + inline integer operator""_z##n() \ { \ return detail::integer_literal_impl(); \ } diff --git a/include/mp++/detail/rational_literals.hpp b/include/mp++/detail/rational_literals.hpp index 47f014ab..5e72a7b9 100644 --- a/include/mp++/detail/rational_literals.hpp +++ b/include/mp++/detail/rational_literals.hpp @@ -18,7 +18,7 @@ inline namespace literals #define MPPP_DECLARE_RATIONAL_UDL(n) \ template \ - inline rational operator"" _q##n() \ + inline rational operator""_q##n() \ { \ return rational{detail::integer_literal_impl()}; \ } diff --git a/include/mp++/detail/real_literals.hpp b/include/mp++/detail/real_literals.hpp index a6044968..7d3e4ef5 100644 --- a/include/mp++/detail/real_literals.hpp +++ b/include/mp++/detail/real_literals.hpp @@ -49,7 +49,7 @@ inline namespace literals #define MPPP_DECLARE_REAL_UDL(prec) \ template \ - inline real operator"" _r##prec() \ + inline real operator""_r##prec() \ { \ return detail::real_literal_impl(prec); \ } From a3dbc32993cc2b40b8458a20619416de8c465699 Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Sun, 21 Jul 2024 21:36:19 +0200 Subject: [PATCH 07/11] Attempt CI cleanup, add OSX arm64 build. --- .github/workflows/gh_actions_ci.yml | 29 +++++++++++++++++------------ tools/circleci_conda_arm64.sh | 1 - tools/circleci_conda_coverage.sh | 1 - tools/circleci_conda_docs.sh | 1 - tools/circleci_conda_release.sh | 1 - tools/gha_conda_asan.sh | 1 - tools/gha_conda_tsan.sh | 1 - tools/gha_conda_ubsan.sh | 1 - tools/gha_osx.sh | 1 - tools/travis_ubuntu_ppc64.sh | 2 +- 10 files changed, 18 insertions(+), 21 deletions(-) diff --git a/.github/workflows/gh_actions_ci.yml b/.github/workflows/gh_actions_ci.yml index 9b1434fd..58c4c9d3 100644 --- a/.github/workflows/gh_actions_ci.yml +++ b/.github/workflows/gh_actions_ci.yml @@ -7,55 +7,60 @@ on: branches: - master jobs: - osx_11: - runs-on: macos-11 + osx_13_x86: + runs-on: macos-13 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - name: Build + run: bash tools/gha_osx.sh + osx_14_arm64: + runs-on: macos-14 + steps: + - uses: actions/checkout@v4 - name: Build run: bash tools/gha_osx.sh conda_asan: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: bash tools/gha_conda_asan.sh conda_ubsan: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: bash tools/gha_conda_ubsan.sh conda_tsan: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: bash tools/gha_conda_tsan.sh conda_debuggmp: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: bash tools/gha_debuggmp.sh windows_2022: runs-on: windows-2022 steps: - - uses: actions/checkout@v3 - - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.1 - - uses: conda-incubator/setup-miniconda@v2 + - uses: actions/checkout@v4 + - uses: conda-incubator/setup-miniconda@v3 with: auto-update-conda: true python-version: "3.10" channels: conda-forge channel-priority: strict + - uses: ilammy/msvc-dev-cmd@v1 - name: Build shell: pwsh run: | conda install -y cmake mpir mpfr 'libflint<3' arb mpc fmt libboost-devel mkdir build cd build - cmake ../ -G "Visual Studio 17 2022" -A x64 -DCMAKE_CXX_STANDARD=20 -DMPPP_GMP_INCLUDE_DIR=C:\Miniconda\envs\test\Library\include -DMPPP_GMP_LIBRARY=C:\Miniconda\envs\test\Library\lib\mpir.lib -DMPPP_BUILD_TESTS=yes -DBoost_NO_BOOST_CMAKE=yes -DMPPP_WITH_BOOST_S11N=yes -DMPPP_WITH_FMT=yes -DMPPP_WITH_MPFR=yes -DMPPP_WITH_MPC=yes -DMPPP_WITH_ARB=yes -DMPPP_ENABLE_IPO=yes + cmake ../ -G "Visual Studio 17 2022" -A x64 -DCMAKE_CXX_STANDARD=20 -DMPPP_BUILD_TESTS=yes -DMPPP_WITH_BOOST_S11N=yes -DMPPP_WITH_FMT=yes -DMPPP_WITH_MPFR=yes -DMPPP_WITH_MPC=yes -DMPPP_WITH_ARB=yes -DMPPP_ENABLE_IPO=yes cmake --build . --config Release -j2 copy Release\mp++.dll test\Release\ ctest -j4 -V -C Release diff --git a/tools/circleci_conda_arm64.sh b/tools/circleci_conda_arm64.sh index 9571e1be..61ccfcd2 100644 --- a/tools/circleci_conda_arm64.sh +++ b/tools/circleci_conda_arm64.sh @@ -30,7 +30,6 @@ cmake ../ -G Ninja \ -DCMAKE_CXX_STANDARD=20 \ -DCMAKE_BUILD_TYPE=Debug \ -DMPPP_BUILD_TESTS=yes \ - -DBoost_NO_BOOST_CMAKE=yes \ -DMPPP_WITH_BOOST_S11N=yes \ -DMPPP_WITH_FMT=yes \ -DMPPP_WITH_MPFR=yes \ diff --git a/tools/circleci_conda_coverage.sh b/tools/circleci_conda_coverage.sh index ffd47bd1..2c0071b5 100644 --- a/tools/circleci_conda_coverage.sh +++ b/tools/circleci_conda_coverage.sh @@ -30,7 +30,6 @@ cmake ../ -G Ninja \ -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_BUILD_TYPE=Debug \ -DMPPP_BUILD_TESTS=yes \ - -DBoost_NO_BOOST_CMAKE=yes \ -DMPPP_WITH_MPFR=yes \ -DMPPP_WITH_MPC=yes \ -DMPPP_WITH_ARB=yes \ diff --git a/tools/circleci_conda_docs.sh b/tools/circleci_conda_docs.sh index 417f1407..95c8ed72 100644 --- a/tools/circleci_conda_docs.sh +++ b/tools/circleci_conda_docs.sh @@ -30,7 +30,6 @@ cmake ../ -G Ninja \ -DCMAKE_INSTALL_PREFIX=$deps_dir \ -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_BUILD_TYPE=Debug \ - -DBoost_NO_BOOST_CMAKE=yes \ -DMPPP_WITH_BOOST_S11N=yes \ -DMPPP_WITH_FMT=yes \ -DMPPP_WITH_MPFR=yes \ diff --git a/tools/circleci_conda_release.sh b/tools/circleci_conda_release.sh index d86611ba..8867bc80 100644 --- a/tools/circleci_conda_release.sh +++ b/tools/circleci_conda_release.sh @@ -27,7 +27,6 @@ cmake ../ -G Ninja \ -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_BUILD_TYPE=Release \ -DMPPP_BUILD_TESTS=yes \ - -DBoost_NO_BOOST_CMAKE=yes \ -DMPPP_WITH_BOOST_S11N=yes \ -DMPPP_WITH_FMT=yes \ -DMPPP_WITH_MPFR=yes \ diff --git a/tools/gha_conda_asan.sh b/tools/gha_conda_asan.sh index 2c1f9054..b7bca626 100644 --- a/tools/gha_conda_asan.sh +++ b/tools/gha_conda_asan.sh @@ -29,7 +29,6 @@ cmake ../ -G Ninja \ -DCMAKE_CXX_STANDARD=20 \ -DCMAKE_BUILD_TYPE=Debug \ -DMPPP_BUILD_TESTS=yes \ - -DBoost_NO_BOOST_CMAKE=yes \ -DMPPP_WITH_BOOST_S11N=yes \ -DMPPP_WITH_FMT=yes \ -DMPPP_WITH_MPFR=yes \ diff --git a/tools/gha_conda_tsan.sh b/tools/gha_conda_tsan.sh index dec257d7..219448f1 100644 --- a/tools/gha_conda_tsan.sh +++ b/tools/gha_conda_tsan.sh @@ -29,7 +29,6 @@ cmake ../ -G Ninja \ -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_BUILD_TYPE=Debug \ -DMPPP_BUILD_TESTS=yes \ - -DBoost_NO_BOOST_CMAKE=yes \ -DMPPP_WITH_BOOST_S11N=yes \ -DMPPP_WITH_FMT=yes \ -DMPPP_WITH_MPFR=yes \ diff --git a/tools/gha_conda_ubsan.sh b/tools/gha_conda_ubsan.sh index bc9e14b3..8c0f3933 100644 --- a/tools/gha_conda_ubsan.sh +++ b/tools/gha_conda_ubsan.sh @@ -29,7 +29,6 @@ cmake ../ -G Ninja \ -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_BUILD_TYPE=Debug \ -DMPPP_BUILD_TESTS=yes \ - -DBoost_NO_BOOST_CMAKE=yes \ -DMPPP_WITH_BOOST_S11N=yes \ -DMPPP_WITH_FMT=yes \ -DMPPP_WITH_MPFR=yes \ diff --git a/tools/gha_osx.sh b/tools/gha_osx.sh index 948b0649..8b071a17 100644 --- a/tools/gha_osx.sh +++ b/tools/gha_osx.sh @@ -27,7 +27,6 @@ cmake ../ -G Ninja \ -DCMAKE_CXX_STANDARD=20 \ -DCMAKE_BUILD_TYPE=Debug \ -DMPPP_BUILD_TESTS=yes \ - -DBoost_NO_BOOST_CMAKE=yes \ -DMPPP_WITH_BOOST_S11N=yes \ -DMPPP_WITH_FMT=yes \ -DMPPP_WITH_MPFR=yes \ diff --git a/tools/travis_ubuntu_ppc64.sh b/tools/travis_ubuntu_ppc64.sh index 950396d0..7ddb1188 100755 --- a/tools/travis_ubuntu_ppc64.sh +++ b/tools/travis_ubuntu_ppc64.sh @@ -20,7 +20,7 @@ mkdir build cd build # GCC build. -cmake ../ -DCMAKE_PREFIX_PATH=$deps_dir -DCMAKE_CXX_STANDARD=17 -DCMAKE_BUILD_TYPE=Debug -DMPPP_BUILD_TESTS=YES -DBoost_NO_BOOST_CMAKE=ON -DMPPP_WITH_BOOST_S11N=yes -DMPPP_WITH_FMT=yes -DMPPP_WITH_QUADMATH=yes -DMPPP_WITH_MPFR=yes -DMPPP_WITH_MPC=yes -DMPPP_WITH_ARB=yes -DMPPP_TEST_PYBIND11=yes -DPYBIND11_PYTHON_VERSION=3.8 +cmake ../ -DCMAKE_PREFIX_PATH=$deps_dir -DCMAKE_CXX_STANDARD=17 -DCMAKE_BUILD_TYPE=Debug -DMPPP_BUILD_TESTS=YES -DMPPP_WITH_BOOST_S11N=yes -DMPPP_WITH_FMT=yes -DMPPP_WITH_QUADMATH=yes -DMPPP_WITH_MPFR=yes -DMPPP_WITH_MPC=yes -DMPPP_WITH_ARB=yes -DMPPP_TEST_PYBIND11=yes -DPYBIND11_PYTHON_VERSION=3.8 make -j1 VERBOSE=1 # Run the tests. ctest -V -j2 From d1b4c5edefd7075a51a6fbd318be338ac38c348a Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Sun, 21 Jul 2024 21:57:42 +0200 Subject: [PATCH 08/11] Try quenching MSV warning. --- include/mp++/integer.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/mp++/integer.hpp b/include/mp++/integer.hpp index c2303346..c39414e3 100644 --- a/include/mp++/integer.hpp +++ b/include/mp++/integer.hpp @@ -423,14 +423,14 @@ constexpr int integral_sign(T n) // On compilers other than MSVC, this just returns the input value. template inline auto make_uai(T *ptr) -> -#if defined(_MSC_VER) +#if defined(_MSC_VER) && _MSC_VER < 1930 decltype(stdext::make_unchecked_array_iterator(ptr)) #else decltype(ptr) #endif { return -#if defined(_MSC_VER) +#if defined(_MSC_VER) && _MSC_VER < 1930 stdext::make_unchecked_array_iterator(ptr); #else ptr; @@ -1357,8 +1357,8 @@ class integer : integer(c.imag() == 0 ? c.real() : throw std::domain_error( - "Cannot construct an integer from a complex C++ value with a non-zero imaginary part of " - + detail::to_string(c.imag()))) + "Cannot construct an integer from a complex C++ value with a non-zero imaginary part of " + + detail::to_string(c.imag()))) { } From 173a2e00adfd7febb0300b1d9656c81e8de43477 Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Sun, 21 Jul 2024 22:06:20 +0200 Subject: [PATCH 09/11] More build system tweaks. --- CMakeLists.txt | 6 +++++- mp++-config.cmake.in | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index acedf783..6eccc3ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -416,7 +416,11 @@ if(MPPP_WITH_BOOST_S11N) # MODULE mode as last resort. find_package(Boost ${_MPPP_MIN_BOOST_VERSION} QUIET COMPONENTS serialization CONFIG) if(NOT ${Boost_FOUND}) - find_package(Boost ${_MPPP_MIN_BOOST_VERSION} QUIET MODULE REQUIRED COMPONENTS serialization) + message(STATUS "Boost not found in CONFIG mode, retrying in MODULE mode.") + find_package(Boost ${_MPPP_MIN_BOOST_VERSION} QUIET MODULE COMPONENTS serialization) + endif() + if(NOT ${Boost_FOUND}) + message(FATAL_ERROR "Could not locate Boost in either CONFIG or MODULE mode.") endif() message(STATUS "Found Boost version ${Boost_VERSION}.") target_link_libraries(mp++ PUBLIC Boost::serialization Boost::disable_autolinking) diff --git a/mp++-config.cmake.in b/mp++-config.cmake.in index c27d39f4..4f67cb40 100644 --- a/mp++-config.cmake.in +++ b/mp++-config.cmake.in @@ -25,7 +25,10 @@ if(@MPPP_WITH_BOOST_S11N@) # MODULE mode as last resort. find_package(Boost @_MPPP_MIN_BOOST_VERSION@ QUIET COMPONENTS serialization CONFIG) if(NOT ${Boost_FOUND}) - find_package(Boost @_MPPP_MIN_BOOST_VERSION@ QUIET MODULE REQUIRED COMPONENTS serialization) + find_package(Boost @_MPPP_MIN_BOOST_VERSION@ QUIET MODULE COMPONENTS serialization) + endif() + if(NOT ${Boost_FOUND}) + message(FATAL_ERROR "Could not locate Boost in either CONFIG or MODULE mode.") endif() endif() set(mp++_WITH_BOOST_S11N @MPPP_WITH_BOOST_S11N@) From 4d4b82eb47b49c1d4a70d6ad3db3bd96dba362e4 Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Sun, 21 Jul 2024 22:11:14 +0200 Subject: [PATCH 10/11] Bump to 1.0.3. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6eccc3ef..6fd31fee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ if(NOT CMAKE_BUILD_TYPE) FORCE) endif() -project(mp++ VERSION 1.0.2 LANGUAGES CXX C) +project(mp++ VERSION 1.0.3 LANGUAGES CXX C) # Setup the mp++ ABI version number. set(MPPP_ABI_VERSION 15) From 4dc6481025ff48caeb090eb4fd25543077881d5d Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Sun, 21 Jul 2024 22:11:48 +0200 Subject: [PATCH 11/11] Update changelog. --- doc/changelog.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/doc/changelog.rst b/doc/changelog.rst index 3d6ed007..26e28b33 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -1,6 +1,20 @@ Changelog ========= +1.0.3 (unreleased) +------------------ + +Fix +~~~ + +- Fix compilation failure with fmt 11 + (`#314 `__). +- Fix warnings in the build system when using recent + versions of Boost/CMake + (`#314 `__). +- Fix compiler warnings on recent MSVC versions + (`#314 `__). + 1.0.2 (2023-12-22) ------------------