Skip to content

Commit

Permalink
Update to spdlog 1.12 and fmt 10.1.1 (#473)
Browse files Browse the repository at this point in the history
Authors:
  - Keith Kraus (https://github.com/kkraus14)
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - Bradley Dice (https://github.com/bdice)

URL: #473
  • Loading branch information
kkraus14 authored Nov 30, 2023
1 parent 3271920 commit 28a3062
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 24 deletions.
13 changes: 0 additions & 13 deletions rapids-cmake/cpm/patches/fmt/no_debug_warnings.diff

This file was deleted.

41 changes: 41 additions & 0 deletions rapids-cmake/cpm/patches/spdlog/nvcc_constexpr_fix.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
diff --git a/include/spdlog/common.h b/include/spdlog/common.h
index 0a262eb2..29ef2324 100644
--- a/include/spdlog/common.h
+++ b/include/spdlog/common.h
@@ -62,17 +62,26 @@

// visual studio up to 2013 does not support noexcept nor constexpr
#if defined(_MSC_VER) && (_MSC_VER < 1900)
-# define SPDLOG_NOEXCEPT _NOEXCEPT
-# define SPDLOG_CONSTEXPR
-# define SPDLOG_CONSTEXPR_FUNC inline
+ #define SPDLOG_NOEXCEPT _NOEXCEPT
+ #define SPDLOG_CONSTEXPR
#else
-# define SPDLOG_NOEXCEPT noexcept
-# define SPDLOG_CONSTEXPR constexpr
-# if __cplusplus >= 201402L
-# define SPDLOG_CONSTEXPR_FUNC constexpr
-# else
-# define SPDLOG_CONSTEXPR_FUNC inline
-# endif
+ #define SPDLOG_NOEXCEPT noexcept
+ #define SPDLOG_CONSTEXPR constexpr
+#endif
+
+// If building with std::format, can just use constexpr, otherwise if building with fmt
+// SPDLOG_CONSTEXPR_FUNC needs to be set the same as FMT_CONSTEXPR to avoid situations where
+// a constexpr function in spdlog could end up calling a non-constexpr function in fmt
+// depending on the compiler
+// If fmt determines it can't use constexpr, we should inline the function instead
+#ifdef SPDLOG_USE_STD_FORMAT
+ #define SPDLOG_CONSTEXPR_FUNC constexpr
+#else // Being built with fmt
+ #if FMT_USE_CONSTEXPR
+ #define SPDLOG_CONSTEXPR_FUNC FMT_CONSTEXPR
+ #else
+ #define SPDLOG_CONSTEXPR_FUNC inline
+ #endif
#endif

#if defined(__GNUC__) || defined(__clang__)
22 changes: 11 additions & 11 deletions rapids-cmake/cpm/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,9 @@
"git_tag" : "7c76a124df0c2cd3fd66e3e080b9470a3b4707c6"
},
"fmt" : {
"version" : "9.1.0",
"version" : "10.1.1",
"git_url" : "https://github.com/fmtlib/fmt.git",
"git_tag" : "${version}",
"patches" : [
{
"file" : "fmt/no_debug_warnings.diff",
"issue" : "No warnings during debug builds [https://github.com/fmtlib/fmt/issues/3351]",
"fixed_in" : "10.0"
}
]
"git_tag" : "${version}"
},
"GTest" : {
"version" : "1.13.0",
Expand Down Expand Up @@ -76,9 +69,16 @@
"git_tag" : "branch-${version}"
},
"spdlog" : {
"version" : "1.11.0",
"version" : "1.12.0",
"git_url" : "https://github.com/gabime/spdlog.git",
"git_tag" : "v${version}"
"git_tag" : "v${version}",
"patches" : [
{
"file" : "spdlog/nvcc_constexpr_fix.diff",
"issue" : "Fix constexpr mismatch between spdlog and fmt [https://github.com/gabime/spdlog/issues/2856]",
"fixed_in" : "1.13"
}
]
},
"Thrust" : {
"version" : "1.17.2",
Expand Down

0 comments on commit 28a3062

Please sign in to comment.