Skip to content

Commit

Permalink
Merge pull request #152 from bluescarni/pr/iter
Browse files Browse the repository at this point in the history
Fixes for recent fmt versions, CI update
  • Loading branch information
bluescarni authored Oct 13, 2024
2 parents 22ce43c + 24e7209 commit bb8f732
Show file tree
Hide file tree
Showing 23 changed files with 244 additions and 458 deletions.
63 changes: 32 additions & 31 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,45 @@
version: 2.1

jobs:
focal_gcc9_docs:
# focal_gcc9_docs:
# docker:
# - image: circleci/buildpack-deps:focal
# steps:
# - checkout
# - run:
# name: Build and test
# command: bash ./tools/circleci_focal_gcc9_docs.sh
# focal_gcc9_coverage:
# docker:
# - image: circleci/buildpack-deps:focal
# steps:
# - checkout
# - run:
# name: Build and test
# command: bash ./tools/circleci_focal_gcc9_coverage.sh
# focal_gcc9_ubsan:
# docker:
# - image: circleci/buildpack-deps:focal
# steps:
# - checkout
# - run:
# name: Build and test
# command: bash ./tools/circleci_focal_gcc9_ubsan.sh
conda_asan:
docker:
- image: circleci/buildpack-deps:focal
- image: cimg/base:current
resource_class: large
steps:
- checkout
- run:
name: Build and test
command: bash ./tools/circleci_focal_gcc9_docs.sh
focal_gcc9_coverage:
docker:
- image: circleci/buildpack-deps:focal
steps:
- checkout
- run:
name: Build and test
command: bash ./tools/circleci_focal_gcc9_coverage.sh
focal_gcc9_ubsan:
docker:
- image: circleci/buildpack-deps:focal
steps:
- checkout
- run:
name: Build and test
command: bash ./tools/circleci_focal_gcc9_ubsan.sh
focal_gcc9_asan:
docker:
- image: circleci/buildpack-deps:focal
steps:
- checkout
- run:
name: Build and test
command: bash ./tools/circleci_focal_gcc9_asan.sh
command: bash ./tools/conda_asan.sh

workflows:
version: 2.1
all_builds:
jobs:
- focal_gcc9_docs
- focal_gcc9_coverage
- focal_gcc9_ubsan
- focal_gcc9_asan
# - focal_gcc9_docs
# - focal_gcc9_coverage
# - focal_gcc9_ubsan
- conda_asan
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

35 changes: 17 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ endif()
# enable C here, on some configurations (e.g., Ubuntu
# + clang) the threading detection/setup seems to break
# down.
project(obake VERSION 0.8.0 LANGUAGES CXX C)
project(obake VERSION 0.9.0 LANGUAGES CXX C)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/yacma")

Expand Down Expand Up @@ -160,11 +160,21 @@ if(${mp++_VERSION} VERSION_LESS ${_OBAKE_MIN_MPPP_VERSION})
message(FATAL_ERROR "The minimum mp++ version required by obake is ${_OBAKE_MIN_MPPP_VERSION}, but version ${mp++_VERSION} was found instead.")
endif()

# abseil.
find_package(absl REQUIRED)

# Boost setup.
include(ObakeFindBoost)
# NOTE: need 1.81 for unordered_flat_set.
set(_OBAKE_MIN_BOOST_VERSION "1.81")
# 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 ${_OBAKE_MIN_BOOST_VERSION} QUIET COMPONENTS serialization CONFIG)
if(NOT ${Boost_FOUND})
message(STATUS "Boost not found in CONFIG mode, retrying in MODULE mode.")
find_package(Boost ${_OBAKE_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}.")

# libbacktrace.
if(OBAKE_WITH_LIBBACKTRACE)
Expand Down Expand Up @@ -294,7 +304,6 @@ if(YACMA_COMPILER_IS_MSVC)
"${CMAKE_CURRENT_LIST_DIR}/include/obake/key/key_tex_stream_insert.hpp"
"${CMAKE_CURRENT_LIST_DIR}/include/obake/key/key_trim.hpp"
"${CMAKE_CURRENT_LIST_DIR}/include/obake/key/key_trim_identify.hpp"
"${CMAKE_CURRENT_LIST_DIR}/include/obake/detail/abseil.hpp"
"${CMAKE_CURRENT_LIST_DIR}/include/obake/detail/atomic_flag_array.hpp"
"${CMAKE_CURRENT_LIST_DIR}/include/obake/detail/atomic_lock_guard.hpp"
"${CMAKE_CURRENT_LIST_DIR}/include/obake/detail/fcast.hpp"
Expand Down Expand Up @@ -329,8 +338,8 @@ if(OBAKE_BUILD_STATIC_LIBRARY)
else()
# Setup of the obake shared library.
add_library(obake SHARED "${OBAKE_SRC_FILES}")
set_property(TARGET obake PROPERTY VERSION "8.0")
set_property(TARGET obake PROPERTY SOVERSION 8)
set_property(TARGET obake PROPERTY VERSION "9.0")
set_property(TARGET obake PROPERTY SOVERSION 9)
set_target_properties(obake PROPERTIES CXX_VISIBILITY_PRESET hidden)
set_target_properties(obake PROPERTIES VISIBILITY_INLINES_HIDDEN TRUE)
endif()
Expand All @@ -347,13 +356,6 @@ target_compile_options(obake PRIVATE
target_compile_features(obake PUBLIC cxx_std_20)
# Ensure vanilla C++ is being used.
set_property(TARGET obake PROPERTY CXX_EXTENSIONS NO)
if(YACMA_COMPILER_IS_MSVC)
# NOTE: older abseil versions have a problem on MSVC
# when using C++20:
# https://github.com/abseil/abseil-cpp/issues/649
# Hopefully we can eventually remove this.
target_compile_definitions(obake PUBLIC -D_HAS_DEPRECATED_RESULT_OF=1)
endif()
if(YACMA_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10")
# GCC < 10 still needs the -fconcepts flag, even if C++20 is in use.
message(STATUS "Activating the '-fconcepts' flag for GCC < 10.")
Expand All @@ -370,8 +372,6 @@ target_include_directories(obake PUBLIC
target_link_libraries(obake PUBLIC
Threads::Threads
mp++::mp++
absl::flat_hash_map
absl::flat_hash_set
Boost::boost
Boost::serialization
Boost::disable_autolinking
Expand Down Expand Up @@ -421,7 +421,6 @@ install(FILES
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindDbgEng.cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindTBB.cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Findlibbacktrace.cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/ObakeFindBoost.cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/ObakeFindDl.cmake"
DESTINATION "${OBAKE_INSTALL_LIBDIR}/cmake/obake")
install(EXPORT obake_export NAMESPACE obake:: DESTINATION "${OBAKE_INSTALL_LIBDIR}/cmake/obake")
Expand Down
53 changes: 0 additions & 53 deletions appveyor.yml

This file was deleted.

35 changes: 0 additions & 35 deletions cmake/ObakeFindBoost.cmake

This file was deleted.

22 changes: 20 additions & 2 deletions cmake/yacma/YACMACompilerLinkerSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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.
Expand All @@ -122,13 +122,31 @@ 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)
# NOTE: clang 17 enables by default a new compiler flag called "-fassume-unique-vtables":
#
# https://releases.llvm.org/17.0.1/tools/clang/docs/ReleaseNotes.html#c-language-changes
#
# This flag however seems to be buggy:
#
# https://github.com/llvm/llvm-project/issues/71196
#
# On our part, in several projects we are experiencing Boost.serialization failures when
# (de)serialising derived objects through pointers to bases. Thus, we forcibly disable
# this new flag.
_YACMA_CHECK_ENABLE_CXX_FLAG(-fno-assume-unique-vtables)
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)
Expand Down
3 changes: 1 addition & 2 deletions doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ Requirements
Currently, obake has the following mandatory dependencies:

* the `mp++ <https://bluescarni.github.io/mppp/>`_ multiprecision library (at least version 0.27),
* the `Boost <https://www.boost.org/>`_ C++ libraries (at least version 1.65),
* the `Abseil <https://abseil.io/>`_ C++ libraries,
* the `Boost <https://www.boost.org/>`_ C++ libraries (at least version 1.81),
* the `Intel TBB <https://github.com/oneapi-src/oneTBB>`__ library,
* the `{fmt} <https://fmt.dev/latest/index.html>`__ library.

Expand Down
37 changes: 0 additions & 37 deletions include/obake/detail/abseil.hpp

This file was deleted.

2 changes: 1 addition & 1 deletion include/obake/detail/fmt_compat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct ostream_formatter {
}

template <typename T, typename FormatContext>
auto format(const T &x, FormatContext &ctx)
auto format(const T &x, FormatContext &ctx) const
{
std::ostringstream oss;
oss << x;
Expand Down
2 changes: 1 addition & 1 deletion include/obake/polynomials/d_packed_monomial.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ inline void key_tex_stream_insert(::std::ostream &os, const d_packed_monomial<T,

// Raise to power, if the exponent is not one.
if (!tmp_mp.is_one()) {
*cur_oss << fmt::format("^{{{}}}", tmp_mp);
*cur_oss << fmt::format(fmt::runtime("^{{{}}}"), tmp_mp);
}
}
}
Expand Down
Loading

0 comments on commit bb8f732

Please sign in to comment.