Skip to content

Commit

Permalink
[fmt] Update to 10.0.0 (#31378)
Browse files Browse the repository at this point in the history
* [fmt] Update to version 10.0.0.

* [fmt] Update portfile.

- Remove dead code. It is no longer necessary to manually move DLLs and
edit CMake configs.
- Use vcpkg_install_copyright.

* [fmt] Update baseline.

* [cachelib] Update to 2023.05.08.00, support fmt 10

* Update to 2023.05.08.00.
* Add patch to support fmt 10.
* Update baseline.

* [spdlog] Add upstream patch for fmt 10.

* Add upstream patch to support fmt 10.
* Update portfile.
* Add usage.
* Update baseline.

* [seacas] Add upstream patch to support fmt 10.0.0.

* Add patch to support fmt 10.0.0.
* Update baseline.

* [coolprop] Update patch to support fmt 10.

* Update patch to support fmt 10.0.0. See CoolProp/CoolProp#2252
* Update baseline.

* [wasmedge] Add patch for fmt 10 support.

* Add patch to support fmt 10
* Update baseline
  • Loading branch information
FtZPetruska committed May 22, 2023
1 parent f8b9c6a commit 656fcc6
Show file tree
Hide file tree
Showing 24 changed files with 364 additions and 88 deletions.
44 changes: 44 additions & 0 deletions ports/cachelib/fmt-10.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
diff --git a/cachelib/cachebench/cache/ItemRecords.h b/cachelib/cachebench/cache/ItemRecords.h
index 80fe7489..e581d78e 100644
--- a/cachelib/cachebench/cache/ItemRecords.h
+++ b/cachelib/cachebench/cache/ItemRecords.h
@@ -102,11 +102,11 @@ class ItemRecords {
}
if (record.destructCount != 0) {
XLOGF(ERR, "unexpected destructCount {} for item {}, context {}|{}",
- record.destructCount, item.getKey(), data.context, record.context);
+ record.destructCount, item.getKey().data(), data.context, record.context);
}
if (record.version != ptr->getVersion()) {
XLOGF(ERR, "unexpected version {}|{} for item {}", record.version,
- ptr->getVersion(), item.getKey());
+ ptr->getVersion(), item.getKey().data());
}
++record.destructCount;

diff --git a/cachelib/cachebench/runner/FastShutdown.cpp b/cachelib/cachebench/runner/FastShutdown.cpp
index 82c878eb..5ceb342d 100644
--- a/cachelib/cachebench/runner/FastShutdown.cpp
+++ b/cachelib/cachebench/runner/FastShutdown.cpp
@@ -27,7 +27,7 @@ namespace cachebench {
FastShutdownStressor::FastShutdownStressor(const CacheConfig& cacheConfig,
uint64_t numOps)
: numOps_(numOps),
- cacheDir_{folly::sformat("/tmp/cache_bench_fss_{}", getpid())},
+ cacheDir_{folly::sformat("/tmp/cache_bench_fss_{}", std::to_string(getpid()))},
cache_(std::make_unique<Cache<LruAllocator>>(
cacheConfig, nullptr, cacheDir_)) {}

diff --git a/cachelib/navy/admission_policy/DynamicRandomAP.cpp b/cachelib/navy/admission_policy/DynamicRandomAP.cpp
index 3a8a1aa0..2ab0fa45 100644
--- a/cachelib/navy/admission_policy/DynamicRandomAP.cpp
+++ b/cachelib/navy/admission_policy/DynamicRandomAP.cpp
@@ -189,7 +189,7 @@ void DynamicRandomAP::updateThrottleParamsLocked(std::chrono::seconds curTime) {
XLOGF(INFO,
"max write rate {} will be used because target current write rate {} "
"exceeds it.",
- maxRate_, curTargetRate);
+ maxRate_.load(std::memory_order_relaxed), curTargetRate);
curTargetRate = maxRate_;
}
writeStats_.curTargetRate = curTargetRate;
3 changes: 2 additions & 1 deletion ports/cachelib/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO facebook/CacheLib
REF "v${VERSION}"
SHA512 53f2eb4de0d1c5d4184d7e1d8ceb958625d9426eebaf434227179c9b2a6ed3a3bf063758f86c2e517ca910556230a764bfd54890dc718c2f45aec1d5a806788c
SHA512 fac41a2cb477f252034b932b1499b32b100d164eec4638d387af0487eeb1f84d430cd5908652914e615b188264d2806d6374343938165ebd47dd2494d1e7450d
HEAD_REF master
PATCHES
fix-build.patch
fmt-10.patch
)

FIND_PATH(NUMA_INCLUDE_DIR NAME numa.h
Expand Down
2 changes: 1 addition & 1 deletion ports/cachelib/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cachelib",
"version-string": "2023.02.27.00",
"version-string": "2023.05.08.00",
"description": "facebook cachelib",
"homepage": "https://github.com/facebook/CacheLib",
"license": "Apache-2.0",
Expand Down
160 changes: 138 additions & 22 deletions ports/coolprop/fmt-fix.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/include/CPstrings.h b/include/CPstrings.h
index 711981c..9d379d2 100644
index 711981cd..fda2f055 100644
--- a/include/CPstrings.h
+++ b/include/CPstrings.h
@@ -6,6 +6,8 @@
Expand All @@ -11,30 +11,146 @@ index 711981c..9d379d2 100644

#if !defined(NO_FMTLIB)
# ifndef FMT_HEADER_ONLY
@@ -14,9 +16,6 @@
# include "fmt/format.h" // For addition of the string formatting functions and macros from fmtlib
# include "fmt/printf.h" // For sprintf
# undef FMT_HEADER_ONLY
-#else
-# include <vector>
-# include <string>
#endif

#include "Exceptions.h"
@@ -75,11 +74,12 @@ inline bool endswith(const std::string& s1, const std::string& s2) {
@@ -74,17 +76,16 @@ inline bool endswith(const std::string& s1, const std::string& s2) {
#if defined(NO_FMTLIB)
// Missing string formatting function, this old guy is needed for ancient gcc compilers on PowerPC for VxWorks
inline std::string format(const char* fmt, ...);
+#elif FMT_VERSION >= 50000
+template <typename... Args>
+inline std::string format(const char* format_str, const Args&... args) {
+ return fmt::sprintf(format_str, args...);
+}
#else
-// Missing std::string formatting function - provided by the fmtlib library
-inline std::string format(const char* format, fmt::ArgList args) {
- return fmt::sprintf(format, args);
+template<class...Args>
+std::string format(const Args & ... args)
+{
+ return fmt::sprintf(args...);
inline std::string format(const char* format, fmt::ArgList args) {
return fmt::sprintf(format, args);
}
-FMT_VARIADIC(std::string, format, const char*)
FMT_VARIADIC(std::string, format, const char*)
-// For latest FMTLIB
-/*template <typename... Args>
- inline std::string format(const char *format_str, const Args & ... args) {
- return fmt::sprintf(format_str, args);
- }*/
#endif

// Missing string split - like in Python
diff --git a/include/CoolPropFluid.h b/include/CoolPropFluid.h
index 80fb9ff3..093bd294 100644
--- a/include/CoolPropFluid.h
+++ b/include/CoolPropFluid.h
@@ -562,5 +562,19 @@ class CoolPropFluid
};
};

+#if !defined(NO_FMTLIB) && FMT_VERSION >= 90000
+static int format_as(ViscosityDiluteVariables::ViscosityDiluteType type) {
+ return fmt::underlying(type);
+}
+
+static int format_as(TransportPropertyData::ViscosityHardcodedEnum viscosity) {
+ return fmt::underlying(viscosity);
+}
+
+static int format_as(TransportPropertyData::ConductivityHardcodedEnum conductivity) {
+ return fmt::underlying(conductivity);
+}
+#endif
+
} /* namespace CoolProp */
#endif /* COOLPROPFLUID_H_ */
diff --git a/include/DataStructures.h b/include/DataStructures.h
index 0aebc0b4..5265ac82 100644
--- a/include/DataStructures.h
+++ b/include/DataStructures.h
@@ -473,5 +473,40 @@ void extract_backend_families(std::string backend_string, backend_families& f1,
void extract_backend_families_string(std::string backend_string, backend_families& f1, std::string& f2);
std::string get_backend_string(backends backend);

+#if !defined(NO_FMTLIB) && FMT_VERSION >= 90000
+/// Allows enums to be formatted
+static int format_as(parameters parameter) {
+ return fmt::underlying(parameter);
+}
+
+static int format_as(phases phase) {
+ return fmt::underlying(phase);
+}
+
+static int format_as(schemes scheme) {
+ return fmt::underlying(scheme);
+}
+
+static int format_as(composition_types type) {
+ return fmt::underlying(type);
+}
+
+static int format_as(fluid_types type) {
+ return fmt::underlying(type);
+}
+
+static int format_as(input_pairs pair) {
+ return fmt::underlying(pair);
+}
+
+static int format_as(backend_families family) {
+ return fmt::underlying(family);
+}
+
+static int format_as(backends backend) {
+ return fmt::underlying(backend);
+}
+#endif
+
} /* namespace CoolProp */
#endif /* DATASTRUCTURES_H_ */
diff --git a/include/IncompressibleFluid.h b/include/IncompressibleFluid.h
index 1ea41775..b641d2e0 100644
--- a/include/IncompressibleFluid.h
+++ b/include/IncompressibleFluid.h
@@ -44,6 +44,12 @@ struct IncompressibleData
};
};

+#if !defined(NO_FMTLIB) && FMT_VERSION >= 90000
+static int format_as(IncompressibleData::IncompressibleTypeEnum type) {
+ return fmt::underlying(type);
+}
+#endif
+
/// A property provider for incompressible solutions and pure fluids
/**
This fluid instance is populated using an entry from a JSON file
diff --git a/src/Backends/Helmholtz/VLERoutines.h b/src/Backends/Helmholtz/VLERoutines.h
index e13c0295..c63d0cbc 100644
--- a/src/Backends/Helmholtz/VLERoutines.h
+++ b/src/Backends/Helmholtz/VLERoutines.h
@@ -97,6 +97,12 @@ struct saturation_PHSU_pure_options
}
};

+#if !defined(NO_FMTLIB) && FMT_VERSION >= 90000
+static int format_as(saturation_PHSU_pure_options::specified_variable_options option) {
+ return fmt::underlying(option);
+}
+#endif
+
void saturation_PHSU_pure(HelmholtzEOSMixtureBackend& HEOS, CoolPropDbl specified_value, saturation_PHSU_pure_options& options);

/* \brief This is a backup saturation_p solver for the case where the Newton solver cannot approach closely enough the solution
diff --git a/src/HumidAirProp.cpp b/src/HumidAirProp.cpp
index 640bd843..eb586a63 100644
--- a/src/HumidAirProp.cpp
+++ b/src/HumidAirProp.cpp
@@ -76,6 +76,12 @@ enum givens
GIVEN_ISENTROPIC_EXPONENT
};

+#if !defined(NO_FMTLIB) && FMT_VERSION >= 90000
+int format_as(givens given) {
+ return fmt::underlying(given);
+}
+#endif
+
// For latest FMTLIB
/*template <typename... Args>
inline std::string format(const char *format_str, const Args & ... args) {
void _HAPropsSI_inputs(double p, const std::vector<givens>& input_keys, const std::vector<double>& input_vals, double& T, double& psi_w);
double _HAPropsSI_outputs(givens OuputType, double p, double T, double psi_w);
double MoleFractionWater(double, double, int, double);
2 changes: 1 addition & 1 deletion ports/coolprop/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "coolprop",
"version-semver": "6.4.3",
"port-version": 1,
"port-version": 2,
"description": "Thermophysical properties for the masses",
"homepage": "https://github.com/CoolProp/CoolProp",
"license": "MIT",
Expand Down
50 changes: 11 additions & 39 deletions ports/fmt/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO fmtlib/fmt
REF 9.1.0
SHA512 a18442042722dd48e20714ec034a12fcc0576c9af7be5188586970e2edf47529825bdc99af366b1d5891630c8dbf6f63bfa9f012e77ab3d3ed80d1a118e3b2be
REF "${VERSION}"
SHA512 6188508d74ca1ed75bf6441b152c07ca83971d3104b37f33784a7b55dfcc614d6243e77e0a14220018586fdb86207cc033eece834e7acd5e0907ed4c97403f3b
HEAD_REF master
PATCHES
fix-write-batch.patch
Expand All @@ -18,49 +18,21 @@ vcpkg_cmake_configure(
)

vcpkg_cmake_install()
file(INSTALL "${SOURCE_PATH}/LICENSE.rst" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
if(VCPKG_TARGET_IS_WINDOWS)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/fmtd.dll")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/fmtd.dll" "${CURRENT_PACKAGES_DIR}/debug/bin/fmtd.dll")
endif()
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/fmt.dll")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/fmt.dll" "${CURRENT_PACKAGES_DIR}/bin/fmt.dll")
endif()
endif()
endif()
vcpkg_cmake_config_fixup()
vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()

if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/fmt/core.h
"defined(FMT_SHARED)"
"1"
)
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

vcpkg_cmake_config_fixup()
vcpkg_fixup_pkgconfig()

if(VCPKG_TARGET_IS_WINDOWS)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake
"lib/fmtd.dll"
"bin/fmtd.dll"
)
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-release.cmake
"lib/fmt.dll"
"bin/fmt.dll"
)
endif()
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
)

# Handle post-build CMake instructions
vcpkg_copy_pdbs()
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.rst")
3 changes: 1 addition & 2 deletions ports/fmt/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "fmt",
"version": "9.1.0",
"port-version": 1,
"version": "10.0.0",
"description": "Formatting library for C++. It can be used as a safe alternative to printf or as a fast alternative to IOStreams.",
"homepage": "https://github.com/fmtlib/fmt",
"license": "MIT",
Expand Down
28 changes: 28 additions & 0 deletions ports/seacas/fix-fmt-10.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From 5a576de57ee1664d845c83f552f2100cc9303a26 Mon Sep 17 00:00:00 2001
From: Greg Sjaardema <gsjaardema@gmail.com>
Date: Wed, 10 May 2023 15:28:53 -0600
Subject: [PATCH] IOSS: Fix enum printing to work with fmt-10

---
.../seacas/libraries/ioss/src/text_mesh/Iotm_DatabaseIO.C | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/packages/seacas/libraries/ioss/src/text_mesh/Iotm_DatabaseIO.C b/packages/seacas/libraries/ioss/src/text_mesh/Iotm_DatabaseIO.C
index b6827aa177..59507085fc 100644
--- a/packages/seacas/libraries/ioss/src/text_mesh/Iotm_DatabaseIO.C
+++ b/packages/seacas/libraries/ioss/src/text_mesh/Iotm_DatabaseIO.C
@@ -1,4 +1,4 @@
-// Copyright(C) 1999-2020, 2022 National Technology & Engineering Solutions
+// Copyright(C) 1999-2020, 2022, 2023 National Technology & Engineering Solutions
// of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
// NTESS, the U.S. Government retains certain rights in this software.
//
@@ -802,7 +802,7 @@ namespace Iotm {
std::ostringstream errmsg;
fmt::print(errmsg,
"Error: Failed to find entity of type {} with name {} for Assembly {}.\n",
- type, members[j], assem->name());
+ Ioss::Utils::entity_type_to_string(type), members[j], assem->name());
IOSS_ERROR(errmsg);
}
}
1 change: 1 addition & 0 deletions ports/seacas/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ vcpkg_from_github(
deps-and-shared.patch
fix-mpi.patch
fix-headers.patch
fix-fmt-10.patch
)

if(HDF5_WITH_PARALLEL AND NOT "mpi" IN_LIST FEATURES)
Expand Down
2 changes: 1 addition & 1 deletion ports/seacas/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "seacas",
"version-date": "2022-11-22",
"port-version": 3,
"port-version": 4,
"description": "The Sandia Engineering Analysis Code Access System (SEACAS) is a suite of preprocessing, postprocessing, translation, and utility applications supporting finite element analysis software using the Exodus database file format.",
"homepage": "https://github.com/sandialabs/seacas",
"license": null,
Expand Down
Loading

0 comments on commit 656fcc6

Please sign in to comment.