[coolprop,if97,msgpack,refprop-headers] Cleanup (#31694)

* [coolprop] Cleanup

* Fix uwp

* [refprop-headers] Update

* [if97] Avoid encoding warnings

* [msgpack] More boost dependencies

Cf. https://github.com/msgpack/msgpack-c/wiki/install_boost

* [coolprop] Use msgpack endianess

---------

Co-authored-by: Cheney-Wang <850426846@qq.com>
This commit is contained in:
Kai Pastor 2023-05-31 21:27:10 +02:00 committed by GitHub
parent 50a5ff3563
commit 3e93bb69a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 137 additions and 82 deletions

View File

@ -0,0 +1,3 @@
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()

View File

@ -1,3 +1,15 @@
diff --git a/include/CPmsgpack.h b/include/CPmsgpack.h
index e11f6be..948cc65 100644
--- a/include/CPmsgpack.h
+++ b/include/CPmsgpack.h
@@ -6,7 +6,6 @@
// Workaround MSVC endiannes issues
#if defined(_MSC_VER) && ( defined(_M_ARM) || defined(_M_ARM64) )
-# define MSGPACK_ENDIAN_LITTLE_BYTE
#endif
#include "msgpack.hpp"
diff --git a/src/ODEIntegrators.cpp b/src/ODEIntegrators.cpp
index 23bd4c4..beab710 100644
--- a/src/ODEIntegrators.cpp

View File

@ -2,7 +2,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7bbf8d6..617ac93 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -247,13 +247,11 @@ list(REMOVE_ITEM APP_SOURCES
@@ -247,13 +247,10 @@ list(REMOVE_ITEM APP_SOURCES
list(REMOVE_ITEM APP_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/CoolPropLib.cpp")
set(APP_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}")
@ -16,8 +16,7 @@ index 7bbf8d6..617ac93 100644
+find_package(Eigen3 CONFIG REQUIRED)
+find_package(msgpack-cxx CONFIG REQUIRED)
+find_package(fmt CONFIG REQUIRED)
+link_libraries(Eigen3::Eigen fmt::fmt)
+include_directories(msgpackc-cxx)
+link_libraries(Eigen3::Eigen msgpack-cxx fmt::fmt)
list(APPEND APP_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include")
list(APPEND APP_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")

View File

@ -11,59 +11,14 @@ vcpkg_from_github(
fix-dependency.patch
fix-install.patch
)
vcpkg_replace_string("${SOURCE_PATH}/CMakeLists.txt" "CACHE LIST" "CACHE STRING")
vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON3_DIR ${PYTHON3} DIRECTORY)
vcpkg_add_to_path(${PYTHON3_DIR})
file(REMOVE_RECURSE ${SOURCE_PATH}/externals)
# Patch up the file locations
file(COPY
${CURRENT_INSTALLED_DIR}/include/catch.hpp
DESTINATION ${SOURCE_PATH}/externals/Catch/single_include
)
file(COPY
${CURRENT_INSTALLED_DIR}/include/eigen3/Eigen
DESTINATION ${SOURCE_PATH}/externals/Eigen
)
file(COPY
${CURRENT_INSTALLED_DIR}/include/eigen3/unsupported/Eigen
DESTINATION ${SOURCE_PATH}/externals/Eigen/unsupported
)
file(COPY
${CURRENT_INSTALLED_DIR}/include/rapidjson
DESTINATION ${SOURCE_PATH}/externals/rapidjson/include
)
file(COPY
${CURRENT_INSTALLED_DIR}/include/IF97.h
DESTINATION ${SOURCE_PATH}/externals/IF97
)
file(COPY
${CURRENT_INSTALLED_DIR}/include/msgpack.hpp
${CURRENT_INSTALLED_DIR}/include/msgpack
DESTINATION ${SOURCE_PATH}/externals/msgpack-c/include
)
file(COPY
${CURRENT_INSTALLED_DIR}/include/fmt
DESTINATION ${SOURCE_PATH}/externals/cppformat
)
file(COPY
${CURRENT_INSTALLED_DIR}/include/REFPROP_lib.h
DESTINATION ${SOURCE_PATH}/externals/REFPROP-headers/
)
# Use a nasty hack to include the correct header
file(APPEND
${SOURCE_PATH}/externals/msgpack-c/include/fmt/format.h
"#include \"fmt/printf.h\""
)
file(REMOVE_RECURSE "${SOURCE_PATH}/externals")
file(COPY "${CURRENT_INSTALLED_DIR}/include/IF97.h" DESTINATION "${SOURCE_PATH}/externals/IF97")
file(COPY "${CURRENT_INSTALLED_DIR}/include/REFPROP_lib.h" DESTINATION "${SOURCE_PATH}/externals/REFPROP-headers/")
file(COPY "${CURRENT_INSTALLED_DIR}/include/rapidjson" DESTINATION "${SOURCE_PATH}/externals/rapidjson/include")
# Fix GCC warning when thread_local is substitude as __thread
vcpkg_replace_string("${SOURCE_PATH}/externals/rapidjson/include/rapidjson/document.h" "thread_local static " "static thread_local ")
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" COOLPROP_SHARED_LIBRARY)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" COOLPROP_STATIC_LIBRARY)
@ -71,17 +26,22 @@ string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" COOLPROP_STATIC_LIBRARY
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" COOLPROP_MSVC_DYNAMIC)
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" COOLPROP_MSVC_STATIC)
vcpkg_find_acquire_program(PYTHON3)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
DISABLE_PARALLEL_CONFIGURE
OPTIONS
"-DCMAKE_PROJECT_INCLUDE=${CMAKE_CURRENT_LIST_DIR}/cmake-project-include.cmake"
-DCOOLPROP_SHARED_LIBRARY=${COOLPROP_SHARED_LIBRARY}
-DCOOLPROP_STATIC_LIBRARY=${COOLPROP_STATIC_LIBRARY}
-DCOOLPROP_MSVC_DYNAMIC=${COOLPROP_MSVC_DYNAMIC}
-DCOOLPROP_MSVC_STATIC=${COOLPROP_MSVC_STATIC}
"-DPYTHON_EXECUTABLE=${PYTHON3}"
OPTIONS_RELEASE
-DCOOLPROP_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}
"-DCOOLPROP_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}"
OPTIONS_DEBUG
-DCOOLPROP_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug
"-DCOOLPROP_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug"
)
vcpkg_cmake_install()

View File

@ -1,17 +1,15 @@
{
"name": "coolprop",
"version-semver": "6.4.3",
"port-version": 2,
"port-version": 3,
"description": "Thermophysical properties for the masses",
"homepage": "https://github.com/CoolProp/CoolProp",
"license": "MIT",
"dependencies": [
"catch",
"eigen3",
"fmt",
"if97",
"msgpack",
"pybind11",
"rapidjson",
"refprop-headers",
{

View File

@ -4,9 +4,10 @@ vcpkg_from_github(
REF v2.1.3
SHA512 b29a74f134d69b72ba4bb825b25f0631f2fb335500da5d9016c4e6e417d8c93a5b309e95770eb6a7b723948dd82a7b46d873a1fe4e3f3047a881603442d73eff
HEAD_REF master
PATCHES
relax-encoding.diff
)
file(INSTALL "${SOURCE_PATH}/IF97.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include")
# Handle copyright
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

View File

@ -0,0 +1,48 @@
diff --git a/IF97.h b/IF97.h
index 864f3a0..4e6cab5 100644
--- a/IF97.h
+++ b/IF97.h
@@ -52,7 +52,7 @@ namespace IF97
// IF97 Constants
const double Tcrit = 647.096; // K
const double Pcrit = 22.064*p_fact; // MPa*
- const double Rhocrit = 322.0; // kg/m³
+ const double Rhocrit = 322.0; // kg/m^3
const double Scrit = 4.41202148223476*R_fact; // kJ*/kg-K (needed for backward eqn. in Region 3(a)(b)
const double Ttrip = 273.16; // K
const double Ptrip = 0.000611656*p_fact; // MPa*
@@ -2394,7 +2394,7 @@ namespace IF97
// The equation is rearranged to solve for rho and turned
// into functions f(T,P,rho0) and f'(T,P,rho0) for the
// Newton-Raphson technique. Functions for
- // dphi/ddelta and d²phi/ddelta² were also required. These
+ // dphi/ddelta and d^2phi/ddelta^2 were also required. These
// additional Taylor functions are defined above.
//
double f(double T, double p, double rho0) const{
@@ -4172,7 +4172,7 @@ namespace IF97
return RegionOutput( IF97_HMASS,RegionOutputBackward(Pmax,s,IF97_SMASS),Pmax, NONE);
else {
// Determining H(s) along Tmax is difficult because there is no direct p(T,s) formulation.
- // This linear combination fit h(s)=a*ln(s)+b/s+c/s²+d is not perfect, but it's close
+ // This linear combination fit h(s)=a*ln(s)+b/s+c/s^2+d is not perfect, but it's close
// and can serve as a limit along that Tmax boundary. Coefficients in HTmaxdata above.
// There is a better way to do this using Newton-Raphson on Tmax = T(p,s), but it is iterative and slow.
double ETA = Hmax_n[0]*log(sigma) + Hmax_n[1]/sigma + Hmax_n[2]/pow(sigma,2) +Hmax_n[3];
@@ -4323,14 +4323,14 @@ namespace IF97
inline double cvmass_Tp(double T, double p){ return RegionOutput( IF97_CVMASS, T, p, NONE); };
/// Get the speed of sound [m/s] as a function of T [K] and p [Pa]
inline double speed_sound_Tp(double T, double p){ return RegionOutput( IF97_W, T, p, NONE); };
- /// Get the [d(rho)/d(p)]T [kg/m³/Pa] as a function of T [K] and p [Pa]
+ /// Get the [d(rho)/d(p)]T [kg/m^3/Pa] as a function of T [K] and p [Pa]
inline double drhodp_Tp(double T, double p){ return RegionOutput( IF97_DRHODP, T, p, NONE); };
// ******************************************************************************** //
// Transport Properties //
// ******************************************************************************** //
- /// Get the viscosity [Pa-s] as a function of T [K] and Rho [kg/m³]
+ /// Get the viscosity [Pa-s] as a function of T [K] and Rho [kg/m^3]
inline double visc_TRho(double T, double rho) {
// Since we have density, we don't need to determine the region for viscosity.
static Region1 R1; // All regions use base region equations for visc(T,rho).

View File

@ -1,6 +1,7 @@
{
"name": "if97",
"version": "2.1.3",
"port-version": 1,
"description": "This repository implements the IF97 formulation for the properties of pure water substance.",
"homepage": "https://github.com/CoolProp/IF97",
"license": "MIT"

View File

@ -1,13 +1,18 @@
{
"name": "msgpack",
"version": "6.0.0",
"port-version": 1,
"description": "MessagePack is an efficient binary serialization format, which lets you exchange data among multiple languages like JSON, except that it's faster and smaller.",
"homepage": "https://github.com/msgpack/msgpack-c",
"license": "BSL-1.0",
"dependencies": [
"boost-assert",
"boost-fusion",
"boost-numeric-conversion",
"boost-optional",
"boost-predef",
"boost-preprocessor",
"boost-utility",
"boost-variant",
{
"name": "vcpkg-cmake",

View File

@ -1,16 +1,13 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO CoolProp/REFPROP-headers
REF 8df35c7cb557d385bb66431e92e836104a63a33c
SHA512 4424d036c3cd6c9028fffbeda0919d38f4b0a290fb141c6d1ff26c70cd416d9a0d2e1584c51b6ad2e989e84a8a71660f62dadaa88bb22428972165ba01131cb2
REF b4faab1b73911c32c4b69c526c7e92f74edb67de
SHA512 601fcc70e7e12419e03e71b140c2fcec80eafb19f24f9871355679662802815f98cce2d167638658ba04ba7da0e811b2cf5393ced4dbe40cb2930dee75acced5
HEAD_REF master
PATCHES
unicode-build.diff # https://github.com/CoolProp/REFPROP-headers/issues/21
)
file(INSTALL ${SOURCE_PATH}/REFPROP_lib.h DESTINATION ${CURRENT_PACKAGES_DIR}/include)
file(INSTALL "${SOURCE_PATH}/REFPROP_lib.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include")
# Handle copyright
file(
INSTALL ${SOURCE_PATH}/LICENSE
DESTINATION ${CURRENT_PACKAGES_DIR}/share/refprop-headers
RENAME copyright
)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

View File

@ -0,0 +1,13 @@
diff --git a/REFPROP_lib.h b/REFPROP_lib.h
index 60fb64a..df10d2c 100644
--- a/REFPROP_lib.h
+++ b/REFPROP_lib.h
@@ -762,7 +762,7 @@ extern "C" {
#ifndef UNICODE
msg = dllPath;
#else
- std::wstring wStr = t;
+ std::wstring wStr = dllPath;
msg = std::string(wStr.begin(), wStr.end());
#endif
RPPath_loaded = msg;

View File

@ -1,7 +1,7 @@
{
"name": "refprop-headers",
"version-date": "2019-04-14",
"port-version": 2,
"description": "The REFPROP Headers",
"homepage": "https://github.com/CoolProp/REFPROP-headers"
"version-date": "2022-12-07",
"description": "Header files for the REFPROP fluid property library",
"homepage": "https://github.com/CoolProp/REFPROP-headers",
"license": "MIT"
}

View File

@ -257,8 +257,6 @@ constexpr-contracts:arm-neon-android=fail
constexpr-contracts:arm64-android=fail
constexpr-contracts:x64-android=fail
constexpr-contracts:x64-linux=fail
coolprop:arm-uwp=fail
coolprop:x64-uwp=fail
coroutine:arm-neon-android=fail
coroutine:arm-uwp=fail
coroutine:arm64-android=fail

View File

@ -1722,7 +1722,7 @@
},
"coolprop": {
"baseline": "6.4.3",
"port-version": 2
"port-version": 3
},
"coroutine": {
"baseline": "1.5.0",
@ -3206,7 +3206,7 @@
},
"if97": {
"baseline": "2.1.3",
"port-version": 0
"port-version": 1
},
"igloo": {
"baseline": "1.1.1",
@ -5438,7 +5438,7 @@
},
"msgpack": {
"baseline": "6.0.0",
"port-version": 0
"port-version": 1
},
"msgpack-c": {
"baseline": "6.0.0",
@ -7065,8 +7065,8 @@
"port-version": 1
},
"refprop-headers": {
"baseline": "2019-04-14",
"port-version": 2
"baseline": "2022-12-07",
"port-version": 0
},
"rendergraph": {
"baseline": "1.3.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "941407fb13d6b17cf04b6186a80db2e59d145a3f",
"version-semver": "6.4.3",
"port-version": 3
},
{
"git-tree": "5f114941efb93eadb6df38f9493de8bdab0b496a",
"version-semver": "6.4.3",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "2177f39e3ea1add06da2e665c0e34d2f620ec9a5",
"version": "2.1.3",
"port-version": 1
},
{
"git-tree": "71c163c4d2b1ef30310ba2c87ce66fa6f616034c",
"version": "2.1.3",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "f9f798edc049a449e0fe3dffb9401659339b371a",
"version": "6.0.0",
"port-version": 1
},
{
"git-tree": "fc124bda56c5eca176379c3e17f9c2f2d63bbdd9",
"version": "6.0.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "cd807170148b9b1e7ae93fe6073004fe5438193f",
"version-date": "2022-12-07",
"port-version": 0
},
{
"git-tree": "d7ea98d3dfab53c440e5b2da61a3c347b4d00beb",
"version-date": "2019-04-14",