From e04c8cc8c73b667c68fef12cd5e55c3b986229e8 Mon Sep 17 00:00:00 2001 From: Andrew Tribick Date: Mon, 23 Feb 2026 16:41:46 +0100 Subject: [PATCH] [intelrdfpmathlib] Install CMake config files, more headers, test port (#50083) Co-authored-by: Kai Pastor --- ports/intelrdfpmathlib/CMakeLists.txt | 25 ++++++++--- ports/intelrdfpmathlib/fix-types.patch | 44 +++++++++++++++++++ ports/intelrdfpmathlib/portfile.cmake | 8 +++- ports/intelrdfpmathlib/vcpkg.json | 6 ++- .../vcpkg-ci-intelrdfpmathlib/portfile.cmake | 6 +++ .../project/CMakeLists.txt | 6 +++ .../project/main.cpp | 12 +++++ .../vcpkg-ci-intelrdfpmathlib/vcpkg.json | 12 +++++ versions/baseline.json | 2 +- versions/i-/intelrdfpmathlib.json | 5 +++ 10 files changed, 118 insertions(+), 8 deletions(-) create mode 100644 ports/intelrdfpmathlib/fix-types.patch create mode 100644 scripts/test_ports/vcpkg-ci-intelrdfpmathlib/portfile.cmake create mode 100644 scripts/test_ports/vcpkg-ci-intelrdfpmathlib/project/CMakeLists.txt create mode 100644 scripts/test_ports/vcpkg-ci-intelrdfpmathlib/project/main.cpp create mode 100644 scripts/test_ports/vcpkg-ci-intelrdfpmathlib/vcpkg.json diff --git a/ports/intelrdfpmathlib/CMakeLists.txt b/ports/intelrdfpmathlib/CMakeLists.txt index 809cd34773..b5ec085e40 100644 --- a/ports/intelrdfpmathlib/CMakeLists.txt +++ b/ports/intelrdfpmathlib/CMakeLists.txt @@ -258,11 +258,19 @@ else() add_compile_options(-Defi2=1 -DEFI2=1) endif() - -include_directories(. src float128) - add_library(intel_decimal128 ${intelrdfpmathlib_SOURCES}) +set_target_properties(intel_decimal128 PROPERTIES EXPORT_NAME decimal128) + +target_include_directories( + intel_decimal128 + PUBLIC + $ + $ + $ + $ +) + target_compile_definitions( intel_decimal128 PRIVATE -DDECIMAL_CALL_BY_REFERENCE=0 -DDECIMAL_GLOBAL_ROUNDING=0 -DDECIMAL_GLOBAL_EXCEPTION_FLAGS=0 ) @@ -278,12 +286,19 @@ else() endif() install( - TARGETS intel_decimal128 + TARGETS intel_decimal128 + EXPORT unofficial-intelrdfpmathlib-config RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib ) +install( + EXPORT unofficial-intelrdfpmathlib-config + NAMESPACE unofficial::intelrdfpmathlib:: + DESTINATION share/unofficial-intelrdfpmathlib +) + if(NOT DISABLE_INSTALL_HEADERS) - install(FILES src/dfp754.h DESTINATION include) + install(FILES src/dfp754.h src/bid_conf.h src/bid_functions.h DESTINATION include) endif() diff --git a/ports/intelrdfpmathlib/fix-types.patch b/ports/intelrdfpmathlib/fix-types.patch new file mode 100644 index 0000000000..737eb9d60e --- /dev/null +++ b/ports/intelrdfpmathlib/fix-types.patch @@ -0,0 +1,44 @@ +diff --git a/LIBRARY/src/bid_functions.h b/LIBRARY/src/bid_functions.h +index a2d0cd7..a92481d 100644 +--- a/LIBRARY/src/bid_functions.h ++++ b/LIBRARY/src/bid_functions.h +@@ -36,13 +36,12 @@ + #ifndef _BID_FUNCTIONS_H + #define _BID_FUNCTIONS_H + +-#if !defined (__GNUC__) || defined(__QNX__) ++#include + #include +-#endif + #include + + // Fix system header issue on Sun solaris and define required type by ourselves +-#if !defined(_WCHAR_T) && !defined(_WCHAR_T_DEFINED) && !defined(__QNX__) ++#if !defined(__cplusplus) && !defined(_WCHAR_T) && !defined(_WCHAR_T_DEFINED) && !defined(__QNX__) + typedef int wchar_t; + #endif + +@@ -150,23 +149,6 @@ typedef BID_UINT128 _Quad; + /////////////////////////////////////////////////////// + // This section may move to fenv_support.h + +-#if !defined(__FENV_H_INCLUDED) && !defined (_FENV_H) && !defined(_FENV_INCLUDED) /* Otherwise we already defined fexcept_t type */ +-#if defined(__ECL) || defined(__ECC) /* Intel(R) Itanium(R) architecture */ +-/* Default 64-bit Floating Point Status Register */ +-#if defined(__linux__) +-typedef unsigned long fexcept_t; +-#else +-typedef unsigned bid__int64 fexcept_t; +-#endif +-#else +-#ifdef __QNX__ +-#include +-#else +-typedef unsigned short int fexcept_t; +-#endif +-#endif +-#endif +- + #define DEC_FE_INVALID 0x01 + #define DEC_FE_UNNORMAL 0x02 + #define DEC_FE_DIVBYZERO 0x04 diff --git a/ports/intelrdfpmathlib/portfile.cmake b/ports/intelrdfpmathlib/portfile.cmake index 8f05012d54..fd2eb7e2fd 100644 --- a/ports/intelrdfpmathlib/portfile.cmake +++ b/ports/intelrdfpmathlib/portfile.cmake @@ -9,7 +9,9 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive( SOURCE_PATH ARCHIVE ${ARCHIVE} - PATCHES missing-includes.patch + PATCHES + missing-includes.patch + fix-types.patch ) set(LIB_SOURCE_PATH "${SOURCE_PATH}/LIBRARY") @@ -24,5 +26,9 @@ vcpkg_cmake_configure( vcpkg_cmake_install() +vcpkg_cmake_config_fixup( + PACKAGE_NAME unofficial-intelrdfpmathlib +) + # Handle copyright file(INSTALL "${SOURCE_PATH}/eula.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/intelrdfpmathlib/vcpkg.json b/ports/intelrdfpmathlib/vcpkg.json index f16c7e5a2c..34b98c502e 100644 --- a/ports/intelrdfpmathlib/vcpkg.json +++ b/ports/intelrdfpmathlib/vcpkg.json @@ -1,13 +1,17 @@ { "name": "intelrdfpmathlib", "version-string": "20U2", - "port-version": 6, + "port-version": 7, "description": "Intel(R) Decimal Floating-Point Math Library", "supports": "!(arm & windows)", "dependencies": [ { "name": "vcpkg-cmake", "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true } ] } diff --git a/scripts/test_ports/vcpkg-ci-intelrdfpmathlib/portfile.cmake b/scripts/test_ports/vcpkg-ci-intelrdfpmathlib/portfile.cmake new file mode 100644 index 0000000000..8c5cd4f01d --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-intelrdfpmathlib/portfile.cmake @@ -0,0 +1,6 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +vcpkg_cmake_configure( + SOURCE_PATH "${CURRENT_PORT_DIR}/project" +) +vcpkg_cmake_build() diff --git a/scripts/test_ports/vcpkg-ci-intelrdfpmathlib/project/CMakeLists.txt b/scripts/test_ports/vcpkg-ci-intelrdfpmathlib/project/CMakeLists.txt new file mode 100644 index 0000000000..ab94cdac05 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-intelrdfpmathlib/project/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.10) +project(decimal128test) + +find_package(unofficial-intelrdfpmathlib CONFIG REQUIRED) +add_executable(main main.cpp) +target_link_libraries(main PRIVATE unofficial::intelrdfpmathlib::decimal128) diff --git a/scripts/test_ports/vcpkg-ci-intelrdfpmathlib/project/main.cpp b/scripts/test_ports/vcpkg-ci-intelrdfpmathlib/project/main.cpp new file mode 100644 index 0000000000..207e474804 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-intelrdfpmathlib/project/main.cpp @@ -0,0 +1,12 @@ +#include +#include + +int main() +{ + unsigned int flags = 0; + _IDEC_round round_mode = 0; + BID_UINT128 x, y; + bid128_from_string(const_cast("1.25673"), round_mode, &flags); + bid128_from_int32(5); + auto result = bid128_add(x, y, round_mode, &flags); +} diff --git a/scripts/test_ports/vcpkg-ci-intelrdfpmathlib/vcpkg.json b/scripts/test_ports/vcpkg-ci-intelrdfpmathlib/vcpkg.json new file mode 100644 index 0000000000..907b0173ba --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-intelrdfpmathlib/vcpkg.json @@ -0,0 +1,12 @@ +{ + "name": "vcpkg-ci-intelrdfpmathlib", + "version-string": "ci", + "description": "Validation port", + "dependencies": [ + "intelrdfpmathlib", + { + "name": "vcpkg-cmake", + "host": true + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index a4d1cc6842..d2fb2b6330 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3990,7 +3990,7 @@ }, "intelrdfpmathlib": { "baseline": "20U2", - "port-version": 6 + "port-version": 7 }, "intrusive-shared-ptr": { "baseline": "1.9", diff --git a/versions/i-/intelrdfpmathlib.json b/versions/i-/intelrdfpmathlib.json index b8d448fc2b..ff1209029e 100644 --- a/versions/i-/intelrdfpmathlib.json +++ b/versions/i-/intelrdfpmathlib.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "a0dbc7cfe4c0b1edb3881f23bf0545b8d979e060", + "version-string": "20U2", + "port-version": 7 + }, { "git-tree": "7cf5496b9f4fbf09ed05be9b87e063a0094ac331", "version-string": "20U2",