From 4a5c92481ff477f50a06d7e45352f28cb5ee0801 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Thu, 28 Sep 2023 16:06:13 +0300 Subject: [PATCH 01/90] CXX: Add initial version of the static library compilation. --- native/CMakeLists.txt | 29 ++ native/NativeImpl.c | 2 + native/NativeImpl.h | 11 +- .../LIBRARY/CMakeLists.txt | 270 ++---------------- 4 files changed, 63 insertions(+), 249 deletions(-) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 5b0502f4..30d12fbf 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -62,3 +62,32 @@ target_compile_definitions(dfpmath PRIVATE API_PREFIX=ddfpmath${VERSION_SUFFIX}_ target_link_libraries (dfpmath LINK_PUBLIC bid) set_target_properties(dfpmath PROPERTIES OUTPUT_NAME "ddfpmath${VERSION_SUFFIX}") install(TARGETS dfpmath DESTINATION ./binmath/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX}) + +file(GLOB BID_SRCS_STATIC + ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/*.c + ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_bid.c + ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_bessel.c + ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_cbrt.c + ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_erf.c + ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_exp.c + ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_int.c + ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_inv_hyper.c + ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_inv_trig.c + ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_lgamma.c + ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_log.c + ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_mod.c + ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_powi.c + ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_pow.c + ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_sqrt.c + ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_trig.c + ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_ops.c + ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_ops_64.c + ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_four_over_pi.c + ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exception.c + ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/sqrt_tab_t.c) + +add_library(dfpStatic STATIC NativeImpl.c ${BID_SRCS_STATIC}) +include_directories(../thirdparty/IntelRDFPMathLib20U2/LIBRARY/src) +target_compile_definitions(dfpStatic PRIVATE API_PREFIX=ddfp${VERSION_SUFFIX}_ NOJAVA) +set_target_properties(dfpStatic PROPERTIES OUTPUT_NAME "ddfpStatic${VERSION_SUFFIX}") +install(TARGETS dfpStatic DESTINATION ./bin/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX}) diff --git a/native/NativeImpl.c b/native/NativeImpl.c index 0400fd9f..602a6036 100644 --- a/native/NativeImpl.c +++ b/native/NativeImpl.c @@ -38,6 +38,7 @@ DDFP_API(int32) PPCAT(API_PREFIX, compare) ( BID_UINT64 a, BID_UINT64 b) { return 0; return bid64_isNaN(b) - bid64_isNaN(a); } +JAVA_API_IMPL( JNI_API(int32) PPCAT(PPCAT(Java_, JAVA_PREFIX), compare) (void *jEnv, void *jClass, BID_UINT64 a, BID_UINT64 b) { if (bid64_quiet_less(a, b)) return -1; @@ -56,6 +57,7 @@ JNI_API(int32) PPCAT(PPCAT(JavaCritical_, JAVA_PREFIX), compare) ( BID_UINT64 a, return 0; return bid64_isNaN(a) - bid64_isNaN(b); } +) OPN_BOOL(isEqual, bid64_quiet_equal(a, b), BID_UINT64 a, BID_UINT64 b) OPN_BOOL(isNotEqual, bid64_quiet_not_equal(a, b), BID_UINT64 a, BID_UINT64 b) diff --git a/native/NativeImpl.h b/native/NativeImpl.h index 3ec50841..7f5b84ce 100644 --- a/native/NativeImpl.h +++ b/native/NativeImpl.h @@ -57,16 +57,25 @@ STATIC_ASSERT(sizeof(uint32) == 4) STATIC_ASSERT(sizeof(int64) == 8) STATIC_ASSERT(sizeof(uint64) == 8) +#ifndef NOJAVA +#define JAVA_API_IMPL(X) X +#else +#define JAVA_API_IMPL(X) +#endif + + #define OPNRR(mcr__name, mcr__type, mcr__body, ...) \ DDFP_API(mcr__type) PPCAT(API_PREFIX, mcr__name) (__VA_ARGS__) { \ mcr__body \ } \ +JAVA_API_IMPL( \ JNI_API(mcr__type) PPCAT(PPCAT(Java_, JAVA_PREFIX), mcr__name) (void *jEnv, void *jClass, __VA_ARGS__) { \ mcr__body \ } \ JNI_API(mcr__type) PPCAT(PPCAT(JavaCritical_, JAVA_PREFIX), mcr__name) (__VA_ARGS__) { \ mcr__body \ -} +} \ +) #define OPNR(mcr__name, mcr__type, mcr__body, ...) OPNRR(mcr__name, mcr__type, return (mcr__body);, __VA_ARGS__) diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt b/thirdparty/IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt index 671e510e..8d17baa4 100644 --- a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt +++ b/thirdparty/IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt @@ -1,253 +1,27 @@ set(NAME bid) -set(${NAME}_SRCS - src/bid64_acos.c - src/bid64_acosh.c - src/bid64_asin.c - src/bid64_asinh.c - src/bid64_atan.c - src/bid64_atan2.c - src/bid64_atanh.c - src/bid64_cbrt.c - src/bid64_cos.c - src/bid64_cosh.c - src/bid64_erf.c - src/bid64_erfc.c - src/bid64_exp.c - src/bid64_exp10.c - src/bid64_exp2.c - src/bid64_expm1.c - src/bid64_hypot.c - src/bid64_lgamma.c - src/bid64_log.c - src/bid64_log10.c - src/bid64_log1p.c - src/bid64_log2.c - src/bid64_pow.c - src/bid64_sin.c - src/bid64_sinh.c - src/bid64_tan.c - src/bid64_tanh.c - src/bid64_tgamma.c - src/bid128_acos.c - src/bid128_acosh.c - src/bid128_asin.c - src/bid128_asinh.c - src/bid128_atan.c - src/bid128_atan2.c - src/bid128_atanh.c - src/bid128_cbrt.c - src/bid128_cos.c - src/bid128_cosh.c - src/bid128_erf.c - src/bid128_erfc.c - src/bid128_exp.c - src/bid128_exp10.c - src/bid128_exp2.c - src/bid128_expm1.c - src/bid128_hypot.c - src/bid128_lgamma.c - src/bid128_log.c - src/bid128_log10.c - src/bid128_log1p.c - src/bid128_log2.c - src/bid128_pow.c - src/bid128_sin.c - src/bid128_sinh.c - src/bid128_tan.c - src/bid128_tanh.c - src/bid128_tgamma.c - src/bid32_add.c - src/bid32_compare.c - src/bid32_div.c - src/bid32_fdimd.c - src/bid32_fma.c - src/bid32_fmod.c - src/bid32_frexp.c - src/bid32_ldexp.c - src/bid32_llrintd.c - src/bid32_logb.c - src/bid32_logbd.c - src/bid32_lrintd.c - src/bid32_lround.c - src/bid32_minmax.c - src/bid32_modf.c - src/bid32_mul.c - src/bid32_nearbyintd.c - src/bid32_next.c - src/bid32_nexttowardd.c - src/bid32_noncomp.c - src/bid32_quantexpd.c - src/bid32_quantize.c - src/bid32_rem.c - src/bid32_round_integral.c - src/bid32_scalb.c - src/bid32_scalbl.c - src/bid32_sqrt.c - src/bid32_string.c - src/bid32_to_int16.c - src/bid32_to_int32.c - src/bid32_to_int64.c - src/bid32_to_int8.c - src/bid32_to_uint16.c - src/bid32_to_uint32.c - src/bid32_to_uint64.c - src/bid32_to_uint8.c - src/bid32_llround.c - src/bid32_llquantexpd.c - src/bid32_quantumd.c - src/bid64_add.c - src/bid64_compare.c - src/bid64_div.c - src/bid64_fdimd.c - src/bid64_fma.c - src/bid64_fmod.c - src/bid64_frexp.c - src/bid64_ldexp.c - src/bid64_llrintd.c - src/bid64_logb.c - src/bid64_logbd.c - src/bid64_lrintd.c - src/bid64_lround.c - src/bid64_minmax.c - src/bid64_modf.c - src/bid64_mul.c - src/bid64_nearbyintd.c - src/bid64_next.c - src/bid64_nexttowardd.c - src/bid64_noncomp.c - src/bid64_quantexpd.c - src/bid64_quantize.c - src/bid64_rem.c - src/bid64_round_integral.c - src/bid64_scalb.c - src/bid64_scalbl.c - src/bid64_sqrt.c - src/bid64_string.c - src/bid64_to_int16.c - src/bid64_to_int32.c - src/bid64_to_int64.c - src/bid64_to_int8.c - src/bid64_to_uint16.c - src/bid64_to_uint32.c - src/bid64_to_uint64.c - src/bid64_to_uint8.c - src/bid64_llround.c - src/bid64_llquantexpd.c - src/bid64_quantumd.c - src/bid128_add.c - src/bid128_compare.c - src/bid128_div.c - src/bid128_fdimd.c - src/bid128_fma.c - src/bid128_fmod.c - src/bid128_frexp.c - src/bid128_ldexp.c - src/bid128_llrintd.c - src/bid128_logb.c - src/bid128_logbd.c - src/bid128_lrintd.c - src/bid128_lround.c - src/bid128_minmax.c - src/bid128_modf.c - src/bid128_mul.c - src/bid128_nearbyintd.c - src/bid128_next.c - src/bid128_nexttowardd.c - src/bid128_noncomp.c - src/bid128_quantexpd.c - src/bid128_quantize.c - src/bid128_rem.c - src/bid128_round_integral.c - src/bid128_scalb.c - src/bid128_scalbl.c - src/bid128_sqrt.c - src/bid128_string.c - src/bid128_to_int16.c - src/bid128_to_int32.c - src/bid128_to_int64.c - src/bid128_to_int8.c - src/bid128_to_uint16.c - src/bid128_to_uint32.c - src/bid128_to_uint64.c - src/bid128_to_uint8.c - src/bid128_llround.c - src/bid128_llquantexpd.c - src/bid128_quantumd.c - src/strtod32.c - src/strtod64.c - src/strtod128.c - src/wcstod32.c - src/wcstod64.c - src/wcstod128.c - src/bid32_acos.c - src/bid32_acosh.c - src/bid32_asin.c - src/bid32_asinh.c - src/bid32_atan.c - src/bid32_atan2.c - src/bid32_atanh.c - src/bid32_cbrt.c - src/bid32_cos.c - src/bid32_cosh.c - src/bid32_erf.c - src/bid32_erfc.c - src/bid32_exp.c - src/bid32_exp10.c - src/bid32_exp2.c - src/bid32_expm1.c - src/bid32_hypot.c - src/bid32_lgamma.c - src/bid32_log.c - src/bid32_log10.c - src/bid32_log1p.c - src/bid32_log2.c - src/bid32_pow.c - src/bid32_sin.c - src/bid32_sinh.c - src/bid32_tan.c - src/bid32_tanh.c - src/bid32_tgamma.c - src/bid32_sub.c - src/bid32_to_bid128.c - src/bid32_to_bid64.c - src/bid64_to_bid128.c - src/bid128_2_str_tables.c - src/bid_binarydecimal.c - src/bid_convert_data.c - src/bid_decimal_data.c - src/bid_decimal_globals.c - src/bid_dpd.c - src/bid_feclearexcept.c - src/bid_fegetexceptflag.c - src/bid_feraiseexcept.c - src/bid_fesetexceptflag.c - src/bid_fetestexcept.c - src/bid_flag_operations.c - src/bid_from_int.c - src/bid_round.c - src/bid128.c - float128/dpml_ux_bid.c - float128/dpml_ux_bessel.c - float128/dpml_ux_cbrt.c - float128/dpml_ux_erf.c - float128/dpml_ux_exp.c - float128/dpml_ux_int.c - float128/dpml_ux_inv_hyper.c - float128/dpml_ux_inv_trig.c - float128/dpml_ux_lgamma.c - float128/dpml_ux_log.c - float128/dpml_ux_mod.c - float128/dpml_ux_powi.c - float128/dpml_ux_pow.c - float128/dpml_ux_sqrt.c - float128/dpml_ux_trig.c - float128/dpml_ux_ops.c - float128/dpml_ux_ops_64.c - float128/dpml_four_over_pi.c - float128/dpml_exception.c - float128/sqrt_tab_t.c - ) +file(GLOB ${NAME}_SRCS + src/*.c + float128/dpml_ux_bid.c + float128/dpml_ux_bessel.c + float128/dpml_ux_cbrt.c + float128/dpml_ux_erf.c + float128/dpml_ux_exp.c + float128/dpml_ux_int.c + float128/dpml_ux_inv_hyper.c + float128/dpml_ux_inv_trig.c + float128/dpml_ux_lgamma.c + float128/dpml_ux_log.c + float128/dpml_ux_mod.c + float128/dpml_ux_powi.c + float128/dpml_ux_pow.c + float128/dpml_ux_sqrt.c + float128/dpml_ux_trig.c + float128/dpml_ux_ops.c + float128/dpml_ux_ops_64.c + float128/dpml_four_over_pi.c + float128/dpml_exception.c + float128/sqrt_tab_t.c) add_library(${NAME} STATIC ${${NAME}_SRCS}) From 42d386f1398582b3ad60b5e46ab8521cdf8e630d Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Fri, 6 Oct 2023 19:31:21 +0300 Subject: [PATCH 02/90] API: Initial version of the new API wrappers generator with C/C++ support. --- java/nativeWrappers/build.gradle | 12 +- .../java/com/epam/deltix/dfp/ApiEntry.java | 52 ++ .../java/com/epam/deltix/dfp/CsWrappers.java | 168 ++++++ .../java/com/epam/deltix/dfp/CxxWrappers.java | 556 ++++++++++++++++++ .../com/epam/deltix/dfp/JavaWrappers.java | 115 ++++ .../com/epam/deltix/dfp/NativeWrappers.java | 315 +--------- .../java/com/epam/deltix/dfp/SoftMatcher.java | 59 ++ 7 files changed, 972 insertions(+), 305 deletions(-) create mode 100644 java/nativeWrappers/src/main/java/com/epam/deltix/dfp/ApiEntry.java create mode 100644 java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CsWrappers.java create mode 100644 java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java create mode 100644 java/nativeWrappers/src/main/java/com/epam/deltix/dfp/JavaWrappers.java create mode 100644 java/nativeWrappers/src/main/java/com/epam/deltix/dfp/SoftMatcher.java diff --git a/java/nativeWrappers/build.gradle b/java/nativeWrappers/build.gradle index cc08709b..1cfc9567 100644 --- a/java/nativeWrappers/build.gradle +++ b/java/nativeWrappers/build.gradle @@ -18,10 +18,14 @@ task makeNativeWrappersDfp(dependsOn: compileJava, type: JavaExec) { "com_epam_deltix_dfp_NativeImpl_", "$rootDir/native/NativeImpl.c", "$rootDir/java/dfp/build/generated/sources/nativeWrappers/com/epam/deltix/dfp/NativeImpl.java", - "$rootDir/csharp/EPAM.Deltix.DFP/NativeImpl.cs" + "$rootDir/csharp/EPAM.Deltix.DFP/NativeImpl.cs", + "$rootDir/native/DecimalNative.h", + "$rootDir/native/DecimalNative.hpp" ] onlyIf { - !file("$rootDir/java/dfp/build/generated/sources/nativeWrappers/com/epam/deltix/dfp/NativeImpl.java").exists() || + !file("$rootDir/native/DecimalNative.h").exists() || + !file("$rootDir/native/DecimalNative.hpp").exists() || + !file("$rootDir/java/dfp/build/generated/sources/nativeWrappers/com/epam/deltix/dfp/NativeImpl.java").exists() || !file("$rootDir/csharp/EPAM.Deltix.DFP/NativeImpl.cs").exists() } } @@ -36,7 +40,9 @@ task makeNativeWrappersDfpMath(dependsOn: compileJava, type: JavaExec) { "com_epam_deltix_dfpmath_NativeMathImpl_", "$rootDir/native/NativeMathImpl.c", "$rootDir/java/dfp-math/build/generated/sources/nativeWrappers/com/epam/deltix/dfpmath/NativeMathImpl.java", - "$rootDir/csharp/EPAM.Deltix.DFPMath/NativeMathImpl.cs" + "$rootDir/csharp/EPAM.Deltix.DFPMath/NativeMathImpl.cs", + "", + "" ] onlyIf { !file("$rootDir/java/dfp-math/build/generated/sources/nativeWrappers/com/epam/deltix/dfpmath/NativeMathImpl.java").exists() || diff --git a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/ApiEntry.java b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/ApiEntry.java new file mode 100644 index 00000000..c3c3c013 --- /dev/null +++ b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/ApiEntry.java @@ -0,0 +1,52 @@ +package com.epam.deltix.dfp; + +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class ApiEntry { + public final String returnType; + public final String name; + public final String arguments; + + public ApiEntry(final String returnType, final String name, final String arguments) { + this.returnType = returnType; + this.name = name; + this.arguments = arguments; + } + + public static List collectApi(String body, final String apiPrefix) { + body = body + .replaceAll("\\b__declspec\\s*\\(\\s*dllexport\\s*\\)", "") + .replaceAll("\\b__cdecl\\b", "") + .replaceAll("\\b__stdcall\\b", ""); + + final Matcher matcher = Pattern.compile("(?<=^|[;}])\\s*([^;}]*?)\\s+(" + apiPrefix + "\\w+)\\s*\\((.*?)\\)\\s*" + // https://stackoverflow.com/questions/47162098/is-it-possible-to-match-nested-brackets-with-a-regex-without-using-recursion-or/47162099#47162099 + // + "(?=\\{)(?:(?=.*?\\{(?!.*?\\1)(.*\\}(?!.*\\2).*))(?=.*?\\}(?!.*?\\2)(.*)).)+?.*?(?=\\1)[^{]*(?=\\2$)" + // https://stackoverflow.com/questions/17759004/how-to-match-string-within-parentheses-nested-in-java + + "\\{([^{}]*|\\{([^{}]*|\\{[^{}]*\\})*\\})*\\}" + ).matcher(body); + + final List api = new ArrayList<>(); + while (matcher.find()) + api.add(new ApiEntry(matcher.group(1).trim(), matcher.group(2).trim(), matcher.group(3).trim())); + + return api; + } + + public static final Pattern cppArgRegEx = Pattern.compile("^(.*?)(\\w+)$"); + + static final String gccAttributePattern = "\\b__attribute__\\s*" + + // https://stackoverflow.com/questions/17759004/how-to-match-string-within-parentheses-nested-in-java + "\\(([^()]*|\\(([^()]*|\\([^()]*\\))*\\))*\\)"; + + public static String getCppType(String type) { + type = type.replaceAll(gccAttributePattern, "") + .replaceAll("\\bconst\\b", "") + .replace("\\bextern\\b", ""); + + return type.trim(); + } +} diff --git a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CsWrappers.java b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CsWrappers.java new file mode 100644 index 00000000..7c9026b7 --- /dev/null +++ b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CsWrappers.java @@ -0,0 +1,168 @@ +package com.epam.deltix.dfp; + +import java.io.BufferedWriter; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static com.epam.deltix.dfp.ApiEntry.cppArgRegEx; +import static com.epam.deltix.dfp.ApiEntry.getCppType; + +public class CsWrappers { + public static void make(final String outputFile, final List api, final String apiPrefix) throws IOException { + final int apiPrefixLength = apiPrefix.length(); + + final Path outputPath = Paths.get(outputFile); + + String outputClass = outputPath.getFileName().toString(); + if (!outputClass.endsWith(".cs")) + throw new RuntimeException("Can't determine C# the output class name for the outputFile(=" + outputFile + ")."); + else + outputClass = outputClass.substring(0, outputClass.length() - 3); + + final String outputNamespace = outputPath.getParent().getFileName().toString(); + + try (final BufferedWriter writer = Files.newBufferedWriter(outputPath, StandardCharsets.UTF_8)) { + writer.write("using System;\n" + + "using System.Runtime.InteropServices;\n" + + "\n" + + "namespace " + outputNamespace + "\n" + + "{\n" + + "\t//Just entries\n" + + "\tinternal static class " + outputClass + "Import\n" + + "\t{\n" + + "\t\tinternal const string libName = \"" + apiPrefix.substring(0, apiPrefixLength - 1) + "\";\n" + + "\t\tinternal const CallingConvention callType = CallingConvention.Cdecl;\n" + //+ "\t\tinternal const CharSet stringCharset = CharSet.Ansi;\n" + ); + + final StringBuilder objClassBody = new StringBuilder(); + objClassBody.append("\t\tstatic " + outputClass + "Obj()\n" + + "\t\t{\n" + + "\t\t\t" + outputClass + "Loader.Load();\n" + + "\t\t}\n"); + + final StringBuilder nativeClassBody = new StringBuilder(); + nativeClassBody.append("\t\tinternal static readonly " + outputClass + "Obj impl = new " + outputClass + "Obj();\n"); + + for (final ApiEntry entry : api) { + writer.write("\n\t\t[DllImport(libName, CallingConvention = callType)]\n"); + + final String csRetType = cppTypeToCs(entry.returnType); + writer.write("\t\tinternal static extern " + csRetType + " " + entry.name + "("); + + objClassBody.append("\n\t\tinternal ").append(csRetType).append(" ").append(entry.name).append("("); + + nativeClassBody.append("\n\t\tinternal static ").append(csRetType).append(" ").append(entry.name.replace(apiPrefix, "")).append("("); + + final String[] args = entry.arguments.split(","); + final StringBuilder csArgs = new StringBuilder(); + final StringBuilder csCall = new StringBuilder(); + for (int ai = 0; ai < args.length; ++ai) { + if (ai > 0) { + csArgs.append(", "); + csCall.append(", "); + } + final String cppArg = args[ai].trim(); + final Matcher cppArgMatcher = cppArgRegEx.matcher(cppArg); + if (!cppArgMatcher.matches()) + throw new RuntimeException("Can't parse c++ argument(=" + cppArg + ")."); + csArgs.append("[In] ").append(cppTypeToCs(cppArgMatcher.group(1))).append(" ").append(cppArgMatcher.group(2).trim()); + csCall.append(cppArgMatcher.group(2).trim()); + } + final String csArgsStr = csArgs.toString(); + final String csCallStr = csCall.toString(); + + writer.write(csArgsStr); + writer.write(");\n"); + + objClassBody.append(csArgsStr).append(") =>\n\t\t\t" + outputClass + "Import.") + .append(entry.name).append("(").append(csCallStr).append(");\n"); + + nativeClassBody.append(csArgsStr).append(") =>\n\t\t\timpl.") + .append(entry.name).append("(").append(csCallStr).append(");\n"); + } + + writer.write("\t}\n\n"); + + writer.write("\t//Mono problem workaround\n"); + writer.write("\tinternal class " + outputClass + "Obj\n" + + "\t{\n"); + writer.write(objClassBody.toString()); + writer.write("\t}\n\n"); + + writer.write("\t//Actual API class\n"); + writer.write("\tinternal static class " + outputClass + "\n" + + "\t{\n"); + writer.write(nativeClassBody.toString()); + writer.write("\t}\n"); + + writer.write("}\n"); + } + } + + private static String cppTypeToCs(String type) { + type = getCppType(type); + switch (type) { + case "_Decimal64": + case "decimal64": + case "D64Bits": + case "BID_UINT64": + return "UInt64"; + case "int8": + case "Int8": + return "SByte"; + case "uint8": + case "UInt8": + return "Byte"; + case "int16": + case "Int16": + return "Int16"; + case "uint16": + case "UInt16": + return "UInt16"; + case "int32": + case "Int32": + return "Int32"; + case "uint32": + case "UInt32": + return "UInt32"; + case "int64": + case "Int64": + return "Int64"; + case "uint64": + case "UInt64": + return "UInt64"; + case "float": + case "Float32": + return "float"; + case "double": + case "Float64": + return "double"; + case "intBool": + return "bool"; + default: + throw new RuntimeException("Can't convert C++ type (='" + type + "') to Cs type."); + } + } + + public static void makeVersion(final String outputFile, final String versionThreeDigits, final String versionSuffix, final String versionSha) throws IOException { + try (final BufferedWriter writer = + Files.newBufferedWriter(Paths.get(outputFile).getParent().resolve("Version.targets"), + StandardCharsets.UTF_8)) { + writer.write("\n" + + "\n" + + "\t\n" + + "\t\t" + versionThreeDigits + ".0\n" + + "\t\t" + versionSuffix + "\n" + + "\t\t" + versionSha + "\n" + + "\t\n" + + "\n"); + } + } +} diff --git a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java new file mode 100644 index 00000000..6737cfb3 --- /dev/null +++ b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java @@ -0,0 +1,556 @@ +package com.epam.deltix.dfp; + +import java.io.BufferedWriter; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.List; +import java.util.regex.Pattern; + +import static com.epam.deltix.dfp.ApiEntry.getCppType; + +public class CxxWrappers { + public static void make(final String outputC, final String outputCpp, final List api, final String decimalNativePrefix) throws IOException { + final String dfpType = "decimal_native_t"; + final String dfpClassType = "Decimal64_t"; + + try (final BufferedWriter outFileH = Files.newBufferedWriter(Paths.get(outputC), StandardCharsets.UTF_8); + final BufferedWriter outFileHpp = Files.newBufferedWriter(Paths.get(outputCpp), StandardCharsets.UTF_8)) { + outFileH.write( + "#ifndef DECIMALNATIVE_H\n" + + "#define DECIMALNATIVE_H\n" + + "\n" + + "#ifdef __cplusplus\n" + + "#include \n" + + "#else\n" + + "#include \n" + + "#endif\n" + + "\n" + + "#ifdef __cplusplus\n" + + "#define DECIMALNATIVE_MANGLING \"C\"\n" + + "#else\n" + + "#define DECIMALNATIVE_MANGLING\n" + + "#endif\n" + + "\n" + + "#ifdef DECIMALNATIVE_EXPORTS\n" + + "#if defined(_WIN64)\n" + + "#define DECIMALNATIVE_API(x) extern DECIMALNATIVE_MANGLING __declspec(dllexport) x __fastcall\n" + + "#elif defined(_WIN32)\n" + + "#define DECIMALNATIVE_API(x) extern DECIMALNATIVE_MANGLING __declspec(dllexport) x __stdcall\n" + + "#else\n" + + "#define DECIMALNATIVE_API(x) extern DECIMALNATIVE_MANGLING x __attribute__ ((visibility(\"default\")))\n" + + "#endif\n" + + "#else\n" + + "#if defined(_WIN64)\n" + + "#define DECIMALNATIVE_API(x) extern DECIMALNATIVE_MANGLING __declspec(dllimport) x __fastcall\n" + + "#elif defined(_WIN32)\n" + + "#define DECIMALNATIVE_API(x) extern DECIMALNATIVE_MANGLING __declspec(dllimport) x __stdcall\n" + + "#else\n" + + "#define DECIMALNATIVE_API(x) extern DECIMALNATIVE_MANGLING x __attribute__ ((visibility(\"default\")))\n" + + "#endif\n" + + "#endif\n" + + "\n" + + "typedef struct {\n" + + " uint64_t val;\n" + + "} " + dfpType + ";\n" + + "\n" + + "inline static uint64_t decimal_native_toUnderlying(decimal_native_t _value) {\n" + + " return _value.val;\n" + + "}\n" + + "inline static decimal_native_t decimal_native_fromUnderlying(uint64_t value) {\n" + + " decimal_native_t dn;\n" + + " dn.val = value;\n" + + " return dn;\n" + + "}\n" + + "\n" + + "static const uint64_t DECIMAL_NATIVE_UNDERLYING_POSITIVE_INFINITY = 0x7800000000000000ULL;\n" + + "static const uint64_t DECIMAL_NATIVE_UNDERLYING_NEGATIVE_INFINITY = 0xF800000000000000ULL;\n" + + "static const uint64_t DECIMAL_NATIVE_UNDERLYING_NAN = 0x7C00000000000000ULL;\n" + + "static const uint64_t DECIMAL_NATIVE_UNDERLYING_NULL = 0xFFFFFFFFFFFFFF80ULL;\t// = -0x80\n" + + "\n" + + "static const uint64_t DECIMAL_NATIVE_UNDERLYING_MIN_VALUE = 0xF7FB86F26FC0FFFFULL;\n" + + "static const uint64_t DECIMAL_NATIVE_UNDERLYING_MAX_VALUE = 0x77FB86F26FC0FFFFULL;\n" + + "\n" + + "static const uint64_t DECIMAL_NATIVE_UNDERLYING_MIN_POSITIVE_VALUE = 0x0000000000000001ULL;\n" + + "static const uint64_t DECIMAL_NATIVE_UNDERLYING_MAX_NEGATIVE_VALUE = 0x8000000000000001ULL;\n" + + "\n" + + "static const uint64_t DECIMAL_NATIVE_UNDERLYING_ZERO = 0x31C0000000000000ULL; // e=0, m=0, sign=0\n" + + "static const uint64_t DECIMAL_NATIVE_UNDERLYING_ONE = 0x31C0000000000001ULL;\n" + + "static const uint64_t DECIMAL_NATIVE_UNDERLYING_TWO = 0x31C0000000000002ULL;\n" + + "static const uint64_t DECIMAL_NATIVE_UNDERLYING_TEN = 0x31C000000000000AULL;\n" + + "static const uint64_t DECIMAL_NATIVE_UNDERLYING_HUNDRED = 0x31C0000000000064ULL;\n" + + "static const uint64_t DECIMAL_NATIVE_UNDERLYING_THOUSAND = 0x31C00000000003E8ULL;\n" + + "static const uint64_t DECIMAL_NATIVE_UNDERLYING_MILLION = 0x31C00000000F4240ULL;\n" + + "\n" + + "static const uint64_t DECIMAL_NATIVE_UNDERLYING_ONETENTH = 0x31A0000000000000ULL + 1;\n" + + "static const uint64_t DECIMAL_NATIVE_UNDERLYING_ONEHUNDREDTH = 0x3180000000000000ULL + 1;\n" + + "\n"); + + outFileHpp.write( + "#pragma once\n" + + "#ifndef DECIMALNATIVE_HPP\n" + + "#define DECIMALNATIVE_HPP\n" + + "\n" + + "#include \"DecimalNative.h\"\n" + + "#include \n" + + "#include \n" + + "#include \n" + + "#include \n" + + "\n" + + "#define DN_STRINGIFY(x) #x\n" + + "#define DN_TOSTRING(x) DN_STRINGIFY(x)\n" + + "#if defined(_MSC_VER)\n" + + "#define DN_FUNC (std::string(\"At \") + __FILE__ + \"[\" + DN_TOSTRING(__LINE__) + \"] \" + __FUNCSIG__)\n" + + "#elif defined(__GNUC__)\n" + + "#define DN_FUNC (std::string(\"At \") + __FILE__ + \"[\" + DN_TOSTRING(__LINE__) + \"] \" + __PRETTY_FUNCTION__)\n" + + "#else\n" + + "#define DN_FUNC (std::string(\"At \") + __FILE__ + \"[\" + DN_TOSTRING(__LINE__) + \"] \" + __func__)\n" + + "#endif\n" + + "#define DN_NAMEOF(a) #a\n" + + "\n" + + "inline std::ostream& operator <<(std::ostream& output, " + dfpType + " const& a) {\n" + + " if (a.val == DECIMAL_NATIVE_UNDERLYING_NULL) {\n" + + " output << \"null\";\n" + + " }\n" + + " else {\n" + + " char str[32];\n" + + " " + decimalNativePrefix + "toString(a, str);\n" + + " output << str;\n" + + " }\n" + + " return output;\n" + + "}\n" + + "inline std::istream& operator >>(std::istream& input, " + dfpType + "& a) {\n" + + " std::string word;\n" + + " input >> word;\n" + + " a = word == \"null\"\n" + + " ? " + decimalNativePrefix + "fromUnderlying(DECIMAL_NATIVE_UNDERLYING_NULL)\n" + + " : " + decimalNativePrefix + "fromString(word.c_str());\n" + + " return input;\n" + + "}\n" + + "\n" + + "namespace deltix {\n" + + " namespace dfp {\n" + + "\n" + + " template \n" + + " class " + dfpClassType + " {\n" + + " protected:\n" + + " " + dfpType + " _value;\n" + + "\n" + + " public:\n" + + " uint64_t toUnderlying() const {\n" + + " return _value.val;\n" + + " }\n" + + " static " + dfpClassType + " fromUnderlying(uint64_t value) {\n" + + " decimal_native_t dn;\n" + + " dn.val = value;\n" + + " return " + dfpClassType + "(dn);\n" + + " }\n" + + " " + dfpClassType + "() {\n" + + " }\n" + + " " + dfpClassType + "(" + dfpClassType + " const &b) {\n" + + " _value = b._value;\n" + + " }\n" + + " " + dfpClassType + "& operator =(" + dfpClassType + " const &b) {\n" + + " _value = b._value;\n" + + " return *this;\n" + + " }\n" + + " " + dfpClassType + "(" + dfpType + " const &b) {\n" + + " _value = b;\n" + + " }\n" + + " " + dfpClassType + "& operator =(" + dfpType + " const &b) {\n" + + " _value = b;\n" + + " return *this;\n" + + " }\n" + + " explicit operator " + dfpType + "() const {\n" + + " return _value;\n" + + " }\n" + + " " + dfpClassType + " operator +(" + dfpClassType + " const& b) const {\n" + + " return add(*this, b);\n" + + " }\n" + + " " + dfpClassType + "& operator +=(" + dfpClassType + " const& b) {\n" + + " *this = add(*this, b);\n" + + " return *this;\n" + + " }\n" + + " " + dfpClassType + "& operator++() {\n" + + " *this += fromUnderlying(DECIMAL_NATIVE_UNDERLYING_ONE);\n" + + " return *this;\n" + + " }\n" + + " " + dfpClassType + " operator++(int) {\n" + + " " + dfpClassType + " ret = *this;\n" + + " ++*this;\n" + + " return ret;\n" + + " }\n" + + " " + dfpClassType + " operator -(" + dfpClassType + " const& b) const {\n" + + " return subtract(*this, b);\n" + + " }\n" + + " " + dfpClassType + "& operator -=(" + dfpClassType + " const& b) {\n" + + " *this = subtract(*this, b);\n" + + " return *this;\n" + + " }\n" + + " " + dfpClassType + "& operator--() {\n" + + " *this -= fromUnderlying(DECIMAL_NATIVE_UNDERLYING_ONE);\n" + + " return *this;\n" + + " }\n" + + " " + dfpClassType + " operator--(int) {\n" + + " " + dfpClassType + " ret = *this;\n" + + " --*this;\n" + + " return ret;\n" + + " }\n" + + " " + dfpClassType + " operator *(" + dfpClassType + " const& b) const {\n" + + " return multiply(*this, b);\n" + + " }\n" + + " " + dfpClassType + "& operator *=(" + dfpClassType + " const& b) {\n" + + " *this = multiply(*this, b);\n" + + " return *this;\n" + + " }\n" + + " " + dfpClassType + " operator /(" + dfpClassType + " const& b) const {\n" + + " return divide(*this, b);\n" + + " }\n" + + " " + dfpClassType + "& operator /=(" + dfpClassType + " const& b) {\n" + + " *this = divide(*this, b);\n" + + " return *this;\n" + + " }\n" + + " explicit operator std::string() const {\n" + + " char str[32];\n" + + " toString(str);\n" + + " return std::string(str);\n" + + " }\n" + + " friend std::ostream& operator <<(std::ostream& output, " + dfpClassType + " const& a) {\n" + + " output << a._value;\n" + + " return output;\n" + + " }\n" + + " friend std::istream& operator >>(std::istream& input, " + dfpClassType + "& a) {\n" + + " decimal_native_t val;\n" + + " input >> val;\n" + + " a = " + dfpClassType + "(val);\n" + + " return input;\n" + + " }\n" + + " bool isNull() const {\n" + + " return toUnderlying() == DECIMAL_NATIVE_UNDERLYING_NULL;\n" + + " }\n" + + "\n"); + + for (final ApiEntry entry : api) { + final String fnRet = cppTypeToC(entry.returnType); + final String fnNameC = entry.name; + final String fnNameApi = entry.name.substring(decimalNativePrefix.length()); + String fnArg = entry.arguments; + + int fnArgCount = 0; + for (int i = 0; i < fnArg.length(); ++i) { + if (fnArg.charAt(i) == ',') + fnArgCount++; + } + + final StringBuilder fnCallBuilder = new StringBuilder(); + final StringBuilder fnArgBuilder = new StringBuilder(); + boolean allArgDfp = true; + boolean anyArgDfp = false; + for (final String oneArg : fnArg.split(",")) { + final SoftMatcher oneArgFinder = new SoftMatcher(Pattern.compile("^\\s*(.+?)(\\w+)\\s*$").matcher(oneArg)); + if (oneArgFinder.matches()) { + if (fnCallBuilder.length() != 0) { + fnCallBuilder.append(", "); + fnArgBuilder.append(", "); + } + final String argType = cppTypeToC(oneArgFinder.group(1)); + final String argName = oneArgFinder.group(2); + fnCallBuilder.append(argName); + if (argType.equals(dfpType)) { + anyArgDfp = true; + fnCallBuilder.append("._value"); + } else { + allArgDfp = false; + } + fnArgBuilder.append(argType).append(" ").append(argName); + } + } + final String fnCall = fnCallBuilder.toString(); + fnArg = fnArgBuilder.toString(); + + outFileH.write("DECIMALNATIVE_API(" + fnRet + ") " + fnNameC + "(" + fnArg + ");\n"); + + String preOutHpp = ""; + String outHpp = ""; + if (outHpp.isEmpty() && fnArgCount == 0 && fnNameApi.startsWith("from")) { + outHpp = " explicit " + dfpClassType + "(" + fnArg + ") {\n"; + if (fnNameApi.equals("fromString")) + outHpp += " if (str == nullptr)\n" + + " throw std::invalid_argument(DN_FUNC + \": Argument '\" + DN_NAMEOF(str) + \"' is nullptr.\");\n" + + " decimal_native_t _value;\n" + + " if (!strncmp(str, \"null\", 4) && (str[4] == '\\0' || strchr(\" \\f\\n\\r\\t\\v\", str[4])))\n" + + " _value = decimal_native_fromUnderlying(DECIMAL_NATIVE_UNDERLYING_NULL);\n" + + " else\n" + + " _value = decimal_native_fromString(str);\n"; + else + outHpp += " _value = " + fnNameC + "(" + fnCall + ");\n"; + outHpp += " }\n"; + } + + if (outHpp.isEmpty() && fnArgCount == 0 && fnArg.startsWith(dfpType) && fnNameApi.startsWith("to")) { + preOutHpp = " explicit operator " + fnRet + "() const {\n" + + " return " + fnNameApi + "(_value);\n" + + " }\n"; + outHpp = " " + fnRet + " " + fnNameApi + "() const {\n" + + " return " + fnNameC + "(_value);\n" + + " }\n"; + } + + if (outHpp.isEmpty() && fnArgCount == 0 && fnArg.startsWith(dfpType) && (fnNameApi.startsWith("is") || fnNameApi.equals("signBit"))) + outHpp = " bool " + fnNameApi + "() const {\n" + + " return " + fnNameC + "(_value) != 0;\n" + + " }\n"; + + if (outHpp.isEmpty() && fnRet.equals(dfpType) && fnArg.startsWith(dfpType) && + (fnArgCount == 0 || fnNameApi.equals("scaleByPowerOfTen"))) { + final SoftMatcher fnArg2Finder = new SoftMatcher(Pattern.compile(dfpType + "\\s+\\w+\\s*,?\\s*(.*)").matcher(fnArg)); + final int fnCall2Index = fnCall.indexOf(","); + final String fnCall2 = fnCall2Index > 0 ? fnCall.substring(fnCall2Index).trim() : ""; + + outHpp = " " + dfpClassType + "& " + fnNameApi + "(" + fnArg2Finder.group(1).replace(dfpType, dfpClassType + " const&") + ") {\n" + + " _value = " + fnNameC + "(_value" + fnCall2 + ");\n" + + "\n" + + " return *this;\n" + + " }\n"; + } + + if (outHpp.isEmpty() && fnNameApi.equals("multiplyAndAdd")) + outHpp = " " + dfpClassType + "& " + fnNameApi + "(" + dfpClassType + " const& a, " + dfpClassType + " const& b) {\n" + + " _value = " + fnNameC + "(a._value, b._value, _value);\n" + + "\n" + + " return *this;\n" + + " }\n"; + + if (outHpp.isEmpty() && fnArgCount == 1 && allArgDfp && fnNameApi.startsWith("is")) { + String opName = ""; + switch (fnNameApi) { + case "isEqual": + opName = "=="; + break; + case "isNotEqual": + opName = "!="; + break; + case "isLess": + opName = "<"; + break; + case "isLessOrEqual": + opName = "<="; + break; + case "isGreater": + opName = ">"; + break; + case "isGreaterOrEqual": + opName = ">="; + break; + } + if (!opName.isEmpty()) { + if (opName.equals("==") || opName.equals("!=")) { + preOutHpp = " bool operator " + opName + "(" + dfpClassType + " const &b) const {\n" + + " if (toUnderlying() == DECIMAL_NATIVE_UNDERLYING_NULL &&\n" + + " b.toUnderlying() == DECIMAL_NATIVE_UNDERLYING_NULL)\n" + + " return " + (opName.equals("==") ? "true" : "false") + ";\n" + + "\n" + + " return " + fnNameC + "(_value, b._value) != 0;\n" + + " }\n"; + + } else { + preOutHpp = " bool operator " + opName + "(" + dfpClassType + " const &b) const {\n" + + " return " + fnNameApi + "(b);\n" + + " }\n"; + + outHpp = " bool " + fnNameApi + "(" + dfpClassType + " const &b) const {\n" + + " return " + fnNameC + "(_value, b._value) != 0;\n" + + " }\n"; + } + } + } + + if (outHpp.isEmpty() && fnNameApi.equals("toString")) { + outHpp = " " + fnRet + " " + fnNameApi + "(char* dst) const {\n" + + " if (dst == nullptr)\n" + + " throw std::invalid_argument(DN_FUNC + \": Argument '\" + DN_NAMEOF(dst) + \"' is nullptr.\");\n" + + " if (isNull())\n" + + " memcpy(dst, \"null\", 5 * sizeof(char));\n" + + " else\n" + + " " + fnNameC + "(_value, dst);\n" + + " }\n"; + } + + if (outHpp.isEmpty() && fnNameApi.startsWith("fromFixedPoint")) { + outHpp = " static " + dfpClassType + " fromFixedPoint(" + fnArg + ") {\n" + + " return " + dfpClassType + "(" + fnNameC + "(" + fnCall + "));\n" + + " }\n"; + } + + if (outHpp.isEmpty() && Pattern.compile("^(max|min|add|multiply|mean)\\d+|subtract|divide").matcher(fnNameApi).matches()) { + final SoftMatcher multipleArgFinder = new SoftMatcher(Pattern.compile("(.+?)\\d*$").matcher(fnNameApi)); + outHpp = " static " + fnRet.replace(dfpType, dfpClassType) + " " + multipleArgFinder.group(1) + "(" + fnArg.replace(dfpType, dfpClassType + " const&") + ") {\n" + + " return " + dfpClassType + "(" + fnNameC + "(" + fnCall + "));\n" + + " }\n"; + } + + if (outHpp.isEmpty()) { + final SoftMatcher mulDivFinder = new SoftMatcher(Pattern.compile("^(multiply|divide)ByInt(32|64)$").matcher(fnNameApi)); + if (mulDivFinder.matches()) { + preOutHpp = " " + dfpClassType + " operator " + (mulDivFinder.group(1).equals("multiply") ? "*" : "/") + "(int" + mulDivFinder.group(2) + "_t b) const {\n" + + " return " + fnNameApi + "(_value, b);\n" + + " }\n" + + "\n" + + " " + dfpClassType + "& operator " + (mulDivFinder.group(1).equals("multiply") ? "*" : "/") + "=(int" + mulDivFinder.group(2) + "_t b) {\n" + + " _value = " + fnNameApi + "(_value, b);\n" + + "\n" + + " return *this;\n" + + " }\n"; + + outHpp = " " + dfpClassType + " " + fnNameApi + "(int" + mulDivFinder.group(2) + "_t b) const {\n" + + " return " + dfpClassType + "(" + fnNameC + "(_value, b));\n" + + " }\n"; + } + } + + if (outHpp.isEmpty() && fnArg.startsWith(dfpType) && Pattern.compile("toFixedPoint|compare").matcher(fnNameApi).matches()) { + final SoftMatcher fnArg2Finder = new SoftMatcher(Pattern.compile(dfpType + "\\s+\\w+\\s*,?\\s*(.*)").matcher(fnArg)); + final int fnCall2Index = fnCall.indexOf(","); + final String fnCall2 = fnCall2Index > 0 ? fnCall.substring(fnCall2Index).trim() : ""; + + outHpp = " " + fnRet.replace(dfpType, dfpClassType) + " " + fnNameApi + "(" + fnArg2Finder.group(1).replace(dfpType, dfpClassType + " const&") + ") const {\n" + + " return " + fnNameC + "(_value" + fnCall2 + ");\n" + + " }\n"; + } + + if (preOutHpp.isEmpty() && outHpp.isEmpty()) + outHpp = " static " + fnRet.replace(dfpType, dfpClassType) + " " + fnNameApi + "(" + fnArg.replace(dfpType, dfpClassType + " const&") + ") {\n" + + " return " + fnNameC + "(" + fnCall + ");\n" + + " }\n"; + + // double toFloat64() const { // return ddfp1x0x2xSNAPSHOT_toFloat64(_value); + // } + + if (anyArgDfp && !outHpp.isEmpty()) { + final SoftMatcher outHppFinder = new SoftMatcher(Pattern.compile("(?s)(.*?)\\s+(\\S+)\\s*\\((.*?)\\)(.*?)\\{").matcher(outHpp)); + + if (!outHppFinder.group(2).contains("toString")) { + + String outHppCall = ""; + for (final String oneArg : outHppFinder.group(3).split(",")) { + final SoftMatcher oneArgFinder = new SoftMatcher(Pattern.compile("^\\s*(.+?)(\\w+)\\s*$").matcher(oneArg)); + if (oneArgFinder.matches()) { + if (!outHppCall.isEmpty()) + outHppCall += ", "; + outHppCall += oneArgFinder.group(2); + } + } + + final SoftMatcher outHppCCallFinder = new SoftMatcher(Pattern.compile(fnNameC + "\\s*\\((.*?)\\)").matcher(outHpp)); + String nullCheck = ""; + for (String oneArg : outHppCCallFinder.group(1).split(",")) { + oneArg = oneArg.trim(); + if (oneArg.endsWith("_value")) { + if (oneArg.equals("_value")) + nullCheck += " if (isNull())\n" + + " throw std::invalid_argument(DN_FUNC + \": This object is null.\");\n"; + else + nullCheck += " if (" + oneArg.substring(0, oneArg.length() - 7) + ".isNull())\n" + + " throw std::invalid_argument(DN_FUNC + \": Argument '\" + DN_NAMEOF(" + oneArg.substring(0, oneArg.length() - 7) + ") + \"' is null.\");\n"; + } + } + + outHpp = outHppFinder.group(1) + " " + outHppFinder.group(2) + "(" + outHppFinder.group(3) + ")" + outHppFinder.group(4) + "{\n" + + " return nullCheck\n" + + " ? " + outHppFinder.group(2) + "Checked(" + outHppCall + ")\n" + + " : " + outHppFinder.group(2) + "Unchecked(" + outHppCall + ");\n" + + " }\n\n" + + outHppFinder.group(1) + " " + outHppFinder.group(2) + "Checked(" + outHppFinder.group(3) + ")" + outHppFinder.group(4) + "{\n" + + nullCheck + "\n" + + " return " + outHppFinder.group(2) + "Unchecked(" + outHppCall + ");\n" + + " }\n\n" + + outHppFinder.group(1) + " " + outHppFinder.group(2) + "Unchecked(" + outHppFinder.group(3) + ")" + outHppFinder.group(4) + + outHpp.substring(outHpp.indexOf("{")); + } + } + + outFileHpp.append(preOutHpp.isEmpty() ? "" : "\n").append(preOutHpp).append("\n").append(outHpp).append("\n") + .append("//--------------------------------------------------------------------------------------------------------").append("\n"); + } + + outFileH.write("\n#endif\n"); + + outFileHpp.write( + " };\n" + + "\n" + + " typedef " + dfpClassType + "<> Decimal64;\n" + + "\n" + + " static const Decimal64 D64_POSITIVE_INFINITY = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_POSITIVE_INFINITY);\n" + + " static const Decimal64 D64_NEGATIVE_INFINITY = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_NEGATIVE_INFINITY);\n" + + " static const Decimal64 D64_NAN = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_NAN);\n" + + " static const Decimal64 D64_NULL = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_NULL); // = -0x80\n" + + "\n" + + " static const Decimal64 D64_MIN_VALUE = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_MIN_VALUE);\n" + + " static const Decimal64 D64_MAX_VALUE = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_MAX_VALUE);\n" + + "\n" + + " static const Decimal64 D64_MIN_POSITIVE_VALUE = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_MIN_POSITIVE_VALUE);\n" + + " static const Decimal64 D64_MAX_NEGATIVE_VALUE = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_MAX_NEGATIVE_VALUE);\n" + + "\n" + + " static const Decimal64 D64_ZERO = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_ZERO); // e=0, m=0, sign=0\n" + + " static const Decimal64 D64_ONE = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_ONE);\n" + + " static const Decimal64 D64_TWO = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_TWO);\n" + + " static const Decimal64 D64_TEN = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_TEN);\n" + + " static const Decimal64 D64_HUNDRED = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_HUNDRED);\n" + + " static const Decimal64 D64_THOUSAND = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_THOUSAND);\n" + + " static const Decimal64 D64_MILLION = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_MILLION);\n" + + "\n" + + " static const Decimal64 D64_ONETENTH = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_ONETENTH);\n" + + " static const Decimal64 D64_ONEHUNDREDTH = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_ONEHUNDREDTH);\n" + + " }\n" + + "}\n" + + "\n" + + "#endif\n"); + } + } + + private static String cppTypeToC(String type) { + type = getCppType(type); + switch (type) { + case "_Decimal64": + case "decimal64": + case "D64Bits": + case "BID_UINT64": + return "decimal_native_t"; + case "int8": + case "Int8": + return "int8_t"; + case "uint8": + case "UInt8": + return "uint8_t"; + case "int16": + case "Int16": + return "int16_t"; + case "uint16": + case "UInt16": + return "uint16_t"; + case "int32": + case "Int32": + return "int32_t"; + case "uint32": + case "UInt32": + return "uint32_t"; + case "int64": + case "Int64": + return "int64_t"; + case "uint64": + case "UInt64": + return "uint64_t"; + case "float": + case "Float32": + return "float"; + case "double": + case "Float64": + return "double"; + case "intBool": + return "int"; + default: + throw new RuntimeException("Can't convert C++ type (='" + type + "') to C type."); + } + } +} diff --git a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/JavaWrappers.java b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/JavaWrappers.java new file mode 100644 index 00000000..0dcfd266 --- /dev/null +++ b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/JavaWrappers.java @@ -0,0 +1,115 @@ +package com.epam.deltix.dfp; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; +import java.util.regex.Matcher; + +import static com.epam.deltix.dfp.ApiEntry.cppArgRegEx; +import static com.epam.deltix.dfp.ApiEntry.getCppType; + +public class JavaWrappers { + public static void make(final String outputFile, final String versionThreeDigits, final List javaApi, final String javaPrefix) throws IOException { + final int prefixLength = javaPrefix.length(); + + final Path outputPath = Paths.get(outputFile); + Files.createDirectories(outputPath.getParent()); + + String outputClass = outputPath.getFileName().toString(); + if (!outputClass.endsWith(".java")) + throw new RuntimeException("Can't determine Java the output class name for the outputFile(=" + outputFile + ")."); + else + outputClass = outputClass.substring(0, outputClass.length() - 5); + + String outputNamespace = outputPath.getParent().toString().replace(File.separatorChar,'.'); + String generatorPackage = NativeWrappers.class.getPackage().getName(); + while(true) { + final int namespaceIndex = outputNamespace.lastIndexOf(generatorPackage); + if (namespaceIndex >= 0) { + outputNamespace = outputNamespace.substring(namespaceIndex); + break; + } + final int cutPoint = generatorPackage.lastIndexOf('.'); + if (cutPoint <= 0) + throw new RuntimeException("Can't guess the output namespace for the outputFile(=" + outputFile + ")."); + generatorPackage = generatorPackage.substring(0, cutPoint); + if (generatorPackage.lastIndexOf('.') < 0) + throw new RuntimeException("Can't guess the output namespace for the outputFile(=" + outputFile + "): the guess namespace in too short."); + } + + try (final BufferedWriter writer = Files.newBufferedWriter(outputPath, StandardCharsets.UTF_8)) { + writer.write("package " + outputNamespace + ";\n" + + "\n" + + "final class " + outputClass + " {\n" + + " static {\n" + + " " + outputClass + "Loader.load();\n" + + " }\n" + + "\n" + + " public static final String version = \"" + versionThreeDigits + "\";\n" + ); + + for (final ApiEntry entry : javaApi) { + writer.write("\n public static native " + cppTypeToJava(entry.returnType) + " " + entry.name.substring(prefixLength) + "("); + + final String[] args = entry.arguments.split(","); + for (int ai = 2; ai < args.length; ++ai) { // Skip "void *javaEnv, void *jClass" arguments + if (ai > 2) + writer.write(", "); + final String cppArg = args[ai].trim(); + final Matcher cppArgMatcher = cppArgRegEx.matcher(cppArg); + if (!cppArgMatcher.matches()) + throw new RuntimeException("Can't parse c++ argument(=" + cppArg + ")."); + writer.write(cppTypeToJava(cppArgMatcher.group(1)) + " " + cppArgMatcher.group(2).trim()); + } + writer.write(");\n"); + } + writer.write("}\n"); + } + } + + private static String cppTypeToJava(String type) { + type = getCppType(type); + switch (type) { + case "_Decimal64": + case "decimal64": + case "D64Bits": + case "BID_UINT64": + return "long"; + case "int8": + case "uint8": + case "Int8": + case "UInt8": + return "byte"; + case "int16": + case "uint16": + case "Int16": + case "UInt16": + return "short"; + case "int32": + case "uint32": + case "Int32": + case "UInt32": + return "int"; + case "int64": + case "uint64": + case "Int64": + case "UInt64": + return "long"; + case "float": + case "Float32": + return "float"; + case "double": + case "Float64": + return "double"; + case "intBool": + return "boolean"; + default: + throw new RuntimeException("Can't convert C++ type (='" + type + "') to Java type."); + } + } +} diff --git a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/NativeWrappers.java b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/NativeWrappers.java index a92f679b..7a85aa15 100644 --- a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/NativeWrappers.java +++ b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/NativeWrappers.java @@ -10,10 +10,12 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; +import static com.epam.deltix.dfp.ApiEntry.collectApi; + public class NativeWrappers { public static void main(final String[] args) throws IOException, InterruptedException { - if (args.length != 8) { - System.err.println("Usage: NativeWrappers "); + if (args.length != 10) { + System.err.println("Usage: NativeWrappers "); System.exit(-1); } final String versionThreeDigits = args[0]; @@ -24,17 +26,23 @@ public static void main(final String[] args) throws IOException, InterruptedExce final String inputFile = args[5]; final String outputJava = args[6]; final String outputCs = args[7]; + final String outputC = args[8]; + final String outputCpp = args[9]; final String preprocess = callPreprocess(inputFile, apiPrefix, javaPrefix); final List api = collectApi(preprocess, apiPrefix); - makeCsWrappers(outputCs, api, apiPrefix); - makeCsVersion(outputCs, versionThreeDigits, versionSuffix, versionSha); + if (!outputC.isEmpty() && !outputCpp.isEmpty()) { + CxxWrappers.make(outputC, outputCpp, api, apiPrefix); + } + + CsWrappers.make(outputCs, api, apiPrefix); + CsWrappers.makeVersion(outputCs, versionThreeDigits, versionSuffix, versionSha); final String javaPrefixJni = "Java_" + javaPrefix; final List javaApi = collectApi(preprocess, javaPrefixJni); - makeJavaWrappers(outputJava, versionThreeDigits, javaApi, javaPrefixJni); + JavaWrappers.make(outputJava, versionThreeDigits, javaApi, javaPrefixJni); } private static class StreamCollector implements Runnable { @@ -90,301 +98,4 @@ private static String callPreprocess(final String inputFilename, final String ap return stdOutCollector.getMessage(); } - - private static class ApiEntry { - public final String returnType; - public final String name; - public final String arguments; - - public ApiEntry(final String returnType, final String name, final String arguments) { - this.returnType = returnType; - this.name = name; - this.arguments = arguments; - } - } - - private static List collectApi(String body, final String apiPrefix) { - body = body - .replaceAll("\\b__declspec\\s*\\(\\s*dllexport\\s*\\)", "") - .replaceAll("\\b__cdecl\\b", "") - .replaceAll("\\b__stdcall\\b", ""); - - final Matcher matcher = Pattern.compile("(?<=^|[;}])\\s*([^;}]*?)\\s+(" + apiPrefix + "\\w+)\\s*\\((.*?)\\)\\s*" - // https://stackoverflow.com/questions/47162098/is-it-possible-to-match-nested-brackets-with-a-regex-without-using-recursion-or/47162099#47162099 - // + "(?=\\{)(?:(?=.*?\\{(?!.*?\\1)(.*\\}(?!.*\\2).*))(?=.*?\\}(?!.*?\\2)(.*)).)+?.*?(?=\\1)[^{]*(?=\\2$)" - // https://stackoverflow.com/questions/17759004/how-to-match-string-within-parentheses-nested-in-java - + "\\{([^{}]*|\\{([^{}]*|\\{[^{}]*\\})*\\})*\\}" - ).matcher(body); - - final List api = new ArrayList<>(); - while (matcher.find()) - api.add(new ApiEntry(matcher.group(1).trim(), matcher.group(2).trim(), matcher.group(3).trim())); - - return api; - } - - private static final Pattern cppArgRegEx = Pattern.compile("^(.*?)(\\w+)$"); - - private static void makeCsWrappers(final String outputFile, final List api, final String apiPrefix) throws IOException { - final int apiPrefixLength = apiPrefix.length(); - - final Path outputPath = Paths.get(outputFile); - - String outputClass = outputPath.getFileName().toString(); - if (!outputClass.endsWith(".cs")) - throw new RuntimeException("Can't determine C# the output class name for the outputFile(=" + outputFile + ")."); - else - outputClass = outputClass.substring(0, outputClass.length() - 3); - - final String outputNamespace = outputPath.getParent().getFileName().toString(); - - try (final BufferedWriter writer = Files.newBufferedWriter(outputPath, StandardCharsets.UTF_8)) { - writer.write("using System;\n" + - "using System.Runtime.InteropServices;\n" + - "\n" + - "namespace " + outputNamespace + "\n" + - "{\n" + - "\t//Just entries\n" + - "\tinternal static class " + outputClass + "Import\n" + - "\t{\n" + - "\t\tinternal const string libName = \"" + apiPrefix.substring(0, apiPrefixLength - 1) + "\";\n" + - "\t\tinternal const CallingConvention callType = CallingConvention.Cdecl;\n" - //+ "\t\tinternal const CharSet stringCharset = CharSet.Ansi;\n" - ); - - final StringBuilder objClassBody = new StringBuilder(); - objClassBody.append("\t\tstatic " + outputClass + "Obj()\n" + - "\t\t{\n" + - "\t\t\t" + outputClass + "Loader.Load();\n" + - "\t\t}\n"); - - final StringBuilder nativeClassBody = new StringBuilder(); - nativeClassBody.append("\t\tinternal static readonly " + outputClass + "Obj impl = new " + outputClass + "Obj();\n"); - - for (final ApiEntry entry : api) { - writer.write("\n\t\t[DllImport(libName, CallingConvention = callType)]\n"); - - final String csRetType = cppTypeToCs(entry.returnType); - writer.write("\t\tinternal static extern " + csRetType + " " + entry.name + "("); - - objClassBody.append("\n\t\tinternal ").append(csRetType).append(" ").append(entry.name).append("("); - - nativeClassBody.append("\n\t\tinternal static ").append(csRetType).append(" ").append(entry.name.replace(apiPrefix, "")).append("("); - - final String[] args = entry.arguments.split(","); - final StringBuilder csArgs = new StringBuilder(); - final StringBuilder csCall = new StringBuilder(); - for (int ai = 0; ai < args.length; ++ai) { - if (ai > 0) { - csArgs.append(", "); - csCall.append(", "); - } - final String cppArg = args[ai].trim(); - final Matcher cppArgMatcher = cppArgRegEx.matcher(cppArg); - if (!cppArgMatcher.matches()) - throw new RuntimeException("Can't parse c++ argument(=" + cppArg + ")."); - csArgs.append("[In] ").append(cppTypeToCs(cppArgMatcher.group(1))).append(" ").append(cppArgMatcher.group(2).trim()); - csCall.append(cppArgMatcher.group(2).trim()); - } - final String csArgsStr = csArgs.toString(); - final String csCallStr = csCall.toString(); - - writer.write(csArgsStr); - writer.write(");\n"); - - objClassBody.append(csArgsStr).append(") =>\n\t\t\t" + outputClass + "Import.") - .append(entry.name).append("(").append(csCallStr).append(");\n"); - - nativeClassBody.append(csArgsStr).append(") =>\n\t\t\timpl.") - .append(entry.name).append("(").append(csCallStr).append(");\n"); - } - - writer.write("\t}\n\n"); - - writer.write("\t//Mono problem workaround\n"); - writer.write("\tinternal class " + outputClass + "Obj\n" + - "\t{\n"); - writer.write(objClassBody.toString()); - writer.write("\t}\n\n"); - - writer.write("\t//Actual API class\n"); - writer.write("\tinternal static class " + outputClass + "\n" + - "\t{\n"); - writer.write(nativeClassBody.toString()); - writer.write("\t}\n"); - - writer.write("}\n"); - } - } - - private static String cppTypeToCs(String type) { - type = getCppType(type); - switch (type) { - case "_Decimal64": - case "decimal64": - case "D64Bits": - case "BID_UINT64": - return "UInt64"; - case "int8": - case "Int8": - return "SByte"; - case "uint8": - case "UInt8": - return "Byte"; - case "int16": - case "Int16": - return "Int16"; - case "uint16": - case "UInt16": - return "UInt16"; - case "int32": - case "Int32": - return "Int32"; - case "uint32": - case "UInt32": - return "UInt32"; - case "int64": - case "Int64": - return "Int64"; - case "uint64": - case "UInt64": - return "UInt64"; - case "float": - case "Float32": - return "float"; - case "double": - case "Float64": - return "double"; - case "intBool": - return "bool"; - default: - throw new RuntimeException("Can't convert C++ type (='" + type + "') to Cs type."); - } - } - - private static void makeCsVersion(final String outputFile, final String versionThreeDigits, final String versionSuffix, final String versionSha) throws IOException { - try (final BufferedWriter writer = - Files.newBufferedWriter(Paths.get(outputFile).getParent().resolve("Version.targets"), - StandardCharsets.UTF_8)) { - writer.write("\n" + - "\n" + - "\t\n" + - "\t\t" + versionThreeDigits + ".0\n" + - "\t\t" + versionSuffix + "\n" + - "\t\t" + versionSha + "\n" + - "\t\n" + - "\n"); - } - } - - private static void makeJavaWrappers(final String outputFile, final String versionThreeDigits, final List javaApi, final String javaPrefix) throws IOException { - final int prefixLength = javaPrefix.length(); - - final Path outputPath = Paths.get(outputFile); - Files.createDirectories(outputPath.getParent()); - - String outputClass = outputPath.getFileName().toString(); - if (!outputClass.endsWith(".java")) - throw new RuntimeException("Can't determine Java the output class name for the outputFile(=" + outputFile + ")."); - else - outputClass = outputClass.substring(0, outputClass.length() - 5); - - String outputNamespace = outputPath.getParent().toString().replace(File.separatorChar,'.'); - String generatorPackage = NativeWrappers.class.getPackage().getName(); - while(true) { - final int namespaceIndex = outputNamespace.lastIndexOf(generatorPackage); - if (namespaceIndex >= 0) { - outputNamespace = outputNamespace.substring(namespaceIndex); - break; - } - final int cutPoint = generatorPackage.lastIndexOf('.'); - if (cutPoint <= 0) - throw new RuntimeException("Can't guess the output namespace for the outputFile(=" + outputFile + ")."); - generatorPackage = generatorPackage.substring(0, cutPoint); - if (generatorPackage.lastIndexOf('.') < 0) - throw new RuntimeException("Can't guess the output namespace for the outputFile(=" + outputFile + "): the guess namespace in too short."); - } - - try (final BufferedWriter writer = Files.newBufferedWriter(outputPath, StandardCharsets.UTF_8)) { - writer.write("package " + outputNamespace + ";\n" + - "\n" + - "final class " + outputClass + " {\n" + - " static {\n" + - " " + outputClass + "Loader.load();\n" + - " }\n" + - "\n" + - " public static final String version = \"" + versionThreeDigits + "\";\n" - ); - - for (final ApiEntry entry : javaApi) { - writer.write("\n public static native " + cppTypeToJava(entry.returnType) + " " + entry.name.substring(prefixLength) + "("); - - final String[] args = entry.arguments.split(","); - for (int ai = 2; ai < args.length; ++ai) { // Skip "void *javaEnv, void *jClass" arguments - if (ai > 2) - writer.write(", "); - final String cppArg = args[ai].trim(); - final Matcher cppArgMatcher = cppArgRegEx.matcher(cppArg); - if (!cppArgMatcher.matches()) - throw new RuntimeException("Can't parse c++ argument(=" + cppArg + ")."); - writer.write(cppTypeToJava(cppArgMatcher.group(1)) + " " + cppArgMatcher.group(2).trim()); - } - writer.write(");\n"); - } - writer.write("}\n"); - } - } - - static final String gccAttributePattern = "\\b__attribute__\\s*" + - // https://stackoverflow.com/questions/17759004/how-to-match-string-within-parentheses-nested-in-java - "\\(([^()]*|\\(([^()]*|\\([^()]*\\))*\\))*\\)"; - - private static String getCppType(String type) { - type = type.replaceAll(gccAttributePattern, "") - .replaceAll("\\bconst\\b", "") - .replace("\\bextern\\b", ""); - - return type.trim(); - } - - private static String cppTypeToJava(String type) { - type = getCppType(type); - switch (type) { - case "_Decimal64": - case "decimal64": - case "D64Bits": - case "BID_UINT64": - return "long"; - case "int8": - case "uint8": - case "Int8": - case "UInt8": - return "byte"; - case "int16": - case "uint16": - case "Int16": - case "UInt16": - return "short"; - case "int32": - case "uint32": - case "Int32": - case "UInt32": - return "int"; - case "int64": - case "uint64": - case "Int64": - case "UInt64": - return "long"; - case "float": - case "Float32": - return "float"; - case "double": - case "Float64": - return "double"; - case "intBool": - return "boolean"; - default: - throw new RuntimeException("Can't convert C++ type (='" + type + "') to Java type."); - } - } } diff --git a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/SoftMatcher.java b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/SoftMatcher.java new file mode 100644 index 00000000..90cc50b3 --- /dev/null +++ b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/SoftMatcher.java @@ -0,0 +1,59 @@ +package com.epam.deltix.dfp; + +import java.util.regex.MatchResult; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class SoftMatcher implements MatchResult { + final Matcher matcher; + final int groupCount; + + public SoftMatcher(final Pattern pattern, final CharSequence input) { + this(pattern.matcher(input)); + } + + public SoftMatcher(final Matcher matcher) { + this.matcher = matcher; + this.groupCount = matcher.groupCount(); + matcher.find(); + } + + @Override + public int start() { + return matcher.start(); + } + + @Override + public int start(int group) { + return matcher.start(group); + } + + @Override + public int end() { + return matcher.end(); + } + + @Override + public int end(int group) { + return matcher.end(group); + } + + @Override + public String group() { + return matcher.group(); + } + + public String group(final int group) { + final String ret = matcher.group(group); + return ret != null ? ret : ""; + } + + @Override + public int groupCount() { + return matcher.groupCount(); + } + + public boolean matches() { + return matcher.matches(); + } +} From 215930d80f30230db0c5e2ac1425975530493481 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Fri, 6 Oct 2023 19:47:45 +0300 Subject: [PATCH 03/90] API: Enhance C and C++ wrappers generation. --- .../java/com/epam/deltix/dfp/CxxWrappers.java | 39 ++++++++++++------- .../com/epam/deltix/dfp/NativeWrappers.java | 2 +- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java index 6737cfb3..78c42ac1 100644 --- a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java +++ b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java @@ -6,20 +6,27 @@ import java.nio.file.Files; import java.nio.file.Paths; import java.util.List; +import java.util.Locale; import java.util.regex.Pattern; import static com.epam.deltix.dfp.ApiEntry.getCppType; public class CxxWrappers { - public static void make(final String outputC, final String outputCpp, final List api, final String decimalNativePrefix) throws IOException { + public static void make(final String outputC, final String outputCpp, final List api, final String decimalNativePrefix, final String versionThreeDigits) throws IOException { final String dfpType = "decimal_native_t"; final String dfpClassType = "Decimal64_t"; try (final BufferedWriter outFileH = Files.newBufferedWriter(Paths.get(outputC), StandardCharsets.UTF_8); final BufferedWriter outFileHpp = Files.newBufferedWriter(Paths.get(outputCpp), StandardCharsets.UTF_8)) { + + final String outputCDefine = Paths.get(outputC).getFileName().toString() + .replace('.', '_').replace('-', '_').toUpperCase(Locale.ROOT); + final String outputCppDefine = Paths.get(outputCpp).getFileName().toString() + .replace('.', '_').replace('-', '_').toUpperCase(Locale.ROOT); + outFileH.write( - "#ifndef DECIMALNATIVE_H\n" + - "#define DECIMALNATIVE_H\n" + + "#ifndef " + outputCDefine + "\n" + + "#define " + outputCDefine + "\n" + "\n" + "#ifdef __cplusplus\n" + "#include \n" + @@ -27,27 +34,29 @@ public static void make(final String outputC, final String outputCpp, final List "#include \n" + "#endif\n" + "\n" + + "#define " + outputCDefine + "_VERSION \"" + versionThreeDigits + "\"\n" + + "\n" + "#ifdef __cplusplus\n" + - "#define DECIMALNATIVE_MANGLING \"C\"\n" + + "#define " + outputCDefine + "_MANGLING \"C\"\n" + "#else\n" + - "#define DECIMALNATIVE_MANGLING\n" + + "#define " + outputCDefine + "_MANGLING\n" + "#endif\n" + "\n" + - "#ifdef DECIMALNATIVE_EXPORTS\n" + + "#ifdef " + outputCDefine + "_EXPORTS\n" + "#if defined(_WIN64)\n" + - "#define DECIMALNATIVE_API(x) extern DECIMALNATIVE_MANGLING __declspec(dllexport) x __fastcall\n" + + "#define " + outputCDefine + "_API(x) extern " + outputCDefine + "_MANGLING __declspec(dllexport) x __fastcall\n" + "#elif defined(_WIN32)\n" + - "#define DECIMALNATIVE_API(x) extern DECIMALNATIVE_MANGLING __declspec(dllexport) x __stdcall\n" + + "#define " + outputCDefine + "_API(x) extern " + outputCDefine + "_MANGLING __declspec(dllexport) x __stdcall\n" + "#else\n" + - "#define DECIMALNATIVE_API(x) extern DECIMALNATIVE_MANGLING x __attribute__ ((visibility(\"default\")))\n" + + "#define " + outputCDefine + "_API(x) extern " + outputCDefine + "_MANGLING x __attribute__ ((visibility(\"default\")))\n" + "#endif\n" + "#else\n" + "#if defined(_WIN64)\n" + - "#define DECIMALNATIVE_API(x) extern DECIMALNATIVE_MANGLING __declspec(dllimport) x __fastcall\n" + + "#define " + outputCDefine + "_API(x) extern " + outputCDefine + "_MANGLING __declspec(dllimport) x __fastcall\n" + "#elif defined(_WIN32)\n" + - "#define DECIMALNATIVE_API(x) extern DECIMALNATIVE_MANGLING __declspec(dllimport) x __stdcall\n" + + "#define " + outputCDefine + "_API(x) extern " + outputCDefine + "_MANGLING __declspec(dllimport) x __stdcall\n" + "#else\n" + - "#define DECIMALNATIVE_API(x) extern DECIMALNATIVE_MANGLING x __attribute__ ((visibility(\"default\")))\n" + + "#define " + outputCDefine + "_API(x) extern " + outputCDefine + "_MANGLING x __attribute__ ((visibility(\"default\")))\n" + "#endif\n" + "#endif\n" + "\n" + @@ -89,8 +98,8 @@ public static void make(final String outputC, final String outputCpp, final List outFileHpp.write( "#pragma once\n" + - "#ifndef DECIMALNATIVE_HPP\n" + - "#define DECIMALNATIVE_HPP\n" + + "#ifndef " + outputCppDefine + "\n" + + "#define " + outputCppDefine + "\n" + "\n" + "#include \"DecimalNative.h\"\n" + "#include \n" + @@ -269,7 +278,7 @@ public static void make(final String outputC, final String outputCpp, final List final String fnCall = fnCallBuilder.toString(); fnArg = fnArgBuilder.toString(); - outFileH.write("DECIMALNATIVE_API(" + fnRet + ") " + fnNameC + "(" + fnArg + ");\n"); + outFileH.write(outputCDefine + "_API(" + fnRet + ") " + fnNameC + "(" + fnArg + ");\n"); String preOutHpp = ""; String outHpp = ""; diff --git a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/NativeWrappers.java b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/NativeWrappers.java index 7a85aa15..f1dea991 100644 --- a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/NativeWrappers.java +++ b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/NativeWrappers.java @@ -34,7 +34,7 @@ public static void main(final String[] args) throws IOException, InterruptedExce final List api = collectApi(preprocess, apiPrefix); if (!outputC.isEmpty() && !outputCpp.isEmpty()) { - CxxWrappers.make(outputC, outputCpp, api, apiPrefix); + CxxWrappers.make(outputC, outputCpp, api, apiPrefix, versionThreeDigits); } CsWrappers.make(outputCs, api, apiPrefix); From 2b589da394a36e1bca18f41d0e6f153d406bc56c Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Wed, 11 Oct 2023 23:08:40 +0300 Subject: [PATCH 04/90] Cpp: Updated version of the Cpp generation. --- .../java/com/epam/deltix/dfp/JavaImpl.java | 6 +- java/nativeWrappers/build.gradle | 4 +- .../java/com/epam/deltix/dfp/ApiEntry.java | 18 +- .../java/com/epam/deltix/dfp/CsWrappers.java | 26 +- .../java/com/epam/deltix/dfp/CxxWrappers.java | 483 +++++++++--------- .../com/epam/deltix/dfp/JavaWrappers.java | 6 + .../com/epam/deltix/dfp/NativeWrappers.java | 11 +- native/CMakeLists.txt | 15 +- native/NativeImpl.c | 126 ----- native/NativeImpl.cpp | 162 ++++++ native/NativeImpl.h | 11 +- native/NativeImplToString.cpp | 300 +++++++++++ native/NativeImplToString.h | 11 + native/demo.cpp | 42 ++ .../EXAMPLES/CMakeLists.txt | 3 - .../IntelRDFPMathLib20U2/EXAMPLES/demo.c | 50 -- .../LIBRARY/CMakeLists.txt | 3 +- 17 files changed, 834 insertions(+), 443 deletions(-) delete mode 100644 native/NativeImpl.c create mode 100644 native/NativeImpl.cpp create mode 100644 native/NativeImplToString.cpp create mode 100644 native/NativeImplToString.h create mode 100644 native/demo.cpp delete mode 100644 thirdparty/IntelRDFPMathLib20U2/EXAMPLES/CMakeLists.txt delete mode 100644 thirdparty/IntelRDFPMathLib20U2/EXAMPLES/demo.c diff --git a/java/dfp/src/main/java/com/epam/deltix/dfp/JavaImpl.java b/java/dfp/src/main/java/com/epam/deltix/dfp/JavaImpl.java index 635dbcde..5cfddd0b 100644 --- a/java/dfp/src/main/java/com/epam/deltix/dfp/JavaImpl.java +++ b/java/dfp/src/main/java/com/epam/deltix/dfp/JavaImpl.java @@ -699,7 +699,7 @@ public static String fastToScientificString(final long value, final char decimal } if (partsCoefficient == 0) - return "0.000000000000000e+000"; + return "0" + decimalMark + "000000000000000e+000"; int exponent = partsExponent - EXPONENT_BIAS; @@ -942,7 +942,7 @@ public static StringBuilder fastScientificAppendToStringBuilder(final long value } if (partsCoefficient == 0) - return stringBuilder.append("0.000000000000000e+000"); + return stringBuilder.append("0").append(decimalMark).append("000000000000000e+000"); int exponent = partsExponent - EXPONENT_BIAS; @@ -1242,7 +1242,7 @@ public static Appendable fastScientificAppendToAppendable(final long value, fina } if (partsCoefficient == 0) - return appendable.append("0.000000000000000e+000"); + return appendable.append("0").append(decimalMark).append("000000000000000e+000"); int exponent = partsExponent - EXPONENT_BIAS; diff --git a/java/nativeWrappers/build.gradle b/java/nativeWrappers/build.gradle index 1cfc9567..c0eda4ca 100644 --- a/java/nativeWrappers/build.gradle +++ b/java/nativeWrappers/build.gradle @@ -19,8 +19,7 @@ task makeNativeWrappersDfp(dependsOn: compileJava, type: JavaExec) { "$rootDir/native/NativeImpl.c", "$rootDir/java/dfp/build/generated/sources/nativeWrappers/com/epam/deltix/dfp/NativeImpl.java", "$rootDir/csharp/EPAM.Deltix.DFP/NativeImpl.cs", - "$rootDir/native/DecimalNative.h", - "$rootDir/native/DecimalNative.hpp" + "$rootDir/native" ] onlyIf { !file("$rootDir/native/DecimalNative.h").exists() || @@ -41,7 +40,6 @@ task makeNativeWrappersDfpMath(dependsOn: compileJava, type: JavaExec) { "$rootDir/native/NativeMathImpl.c", "$rootDir/java/dfp-math/build/generated/sources/nativeWrappers/com/epam/deltix/dfpmath/NativeMathImpl.java", "$rootDir/csharp/EPAM.Deltix.DFPMath/NativeMathImpl.cs", - "", "" ] onlyIf { diff --git a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/ApiEntry.java b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/ApiEntry.java index c3c3c013..efefc46d 100644 --- a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/ApiEntry.java +++ b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/ApiEntry.java @@ -16,6 +16,11 @@ public ApiEntry(final String returnType, final String name, final String argumen this.arguments = arguments; } + @Override + public String toString() { + return returnType + ' ' + name + '(' + arguments + ')'; + } + public static List collectApi(String body, final String apiPrefix) { body = body .replaceAll("\\b__declspec\\s*\\(\\s*dllexport\\s*\\)", "") @@ -42,10 +47,15 @@ public static List collectApi(String body, final String apiPrefix) { // https://stackoverflow.com/questions/17759004/how-to-match-string-within-parentheses-nested-in-java "\\(([^()]*|\\(([^()]*|\\([^()]*\\))*\\))*\\)"; - public static String getCppType(String type) { - type = type.replaceAll(gccAttributePattern, "") - .replaceAll("\\bconst\\b", "") - .replace("\\bextern\\b", ""); + public static String getCppType(final String type) { + return getCppType(type, true); + } + + public static String getCppType(String type, boolean replaceConst) { + type = type.replaceAll(gccAttributePattern, ""); + if (replaceConst) + type = type.replaceAll("\\bconst\\b", ""); + type = type.replace("\\bextern\\b", ""); return type.trim(); } diff --git a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CsWrappers.java b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CsWrappers.java index 7c9026b7..c7f34f2a 100644 --- a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CsWrappers.java +++ b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CsWrappers.java @@ -51,7 +51,11 @@ public static void make(final String outputFile, final List api, final nativeClassBody.append("\t\tinternal static readonly " + outputClass + "Obj impl = new " + outputClass + "Obj();\n"); for (final ApiEntry entry : api) { - writer.write("\n\t\t[DllImport(libName, CallingConvention = callType)]\n"); + if (entry.name.startsWith(apiPrefix + "to_string_3") || + entry.name.startsWith(apiPrefix + "to_scientific_string_3")) + continue; + + writer.write("\n\t\t[DllImport(libName, CallingConvention = callType, CharSet = CharSet.Ansi)]\n"); final String csRetType = cppTypeToCs(entry.returnType); writer.write("\t\tinternal static extern " + csRetType + " " + entry.name + "("); @@ -72,8 +76,16 @@ public static void make(final String outputFile, final List api, final final Matcher cppArgMatcher = cppArgRegEx.matcher(cppArg); if (!cppArgMatcher.matches()) throw new RuntimeException("Can't parse c++ argument(=" + cppArg + ")."); - csArgs.append("[In] ").append(cppTypeToCs(cppArgMatcher.group(1))).append(" ").append(cppArgMatcher.group(2).trim()); - csCall.append(cppArgMatcher.group(2).trim()); + + final String csType = cppTypeToCs(cppArgMatcher.group(1)); + final boolean isOutType = csType.startsWith("out "); + + csArgs.append(isOutType ? "[Out] " : "[In] ") + .append(cppTypeToCs(cppArgMatcher.group(1))) + .append(" ") + .append(cppArgMatcher.group(2).trim()); + csCall.append(isOutType ? "out " : "") + .append(cppArgMatcher.group(2).trim()); } final String csArgsStr = csArgs.toString(); final String csCallStr = csCall.toString(); @@ -146,6 +158,14 @@ private static String cppTypeToCs(String type) { return "double"; case "intBool": return "bool"; + case "char *": + case "char*": + return "string"; + case "char": + return "char"; + case "uint32 *": + case "uint32*": + return "out uint"; default: throw new RuntimeException("Can't convert C++ type (='" + type + "') to Cs type."); } diff --git a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java index 78c42ac1..f2150b7d 100644 --- a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java +++ b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java @@ -12,20 +12,19 @@ import static com.epam.deltix.dfp.ApiEntry.getCppType; public class CxxWrappers { - public static void make(final String outputC, final String outputCpp, final List api, final String decimalNativePrefix, final String versionThreeDigits) throws IOException { + public static void make(final String outputRoot, final List api, final String decimalNativePrefix, final String versionThreeDigits) throws IOException { final String dfpType = "decimal_native_t"; final String dfpClassType = "Decimal64_t"; - try (final BufferedWriter outFileH = Files.newBufferedWriter(Paths.get(outputC), StandardCharsets.UTF_8); - final BufferedWriter outFileHpp = Files.newBufferedWriter(Paths.get(outputCpp), StandardCharsets.UTF_8)) { + try (final BufferedWriter outFileH = Files.newBufferedWriter(Paths.get(outputRoot, "DecimalNative.h"), StandardCharsets.UTF_8); + final BufferedWriter outFileHpp = Files.newBufferedWriter(Paths.get(outputRoot, "DecimalNative.hpp"), StandardCharsets.UTF_8)) { - final String outputCDefine = Paths.get(outputC).getFileName().toString() - .replace('.', '_').replace('-', '_').toUpperCase(Locale.ROOT); - final String outputCppDefine = Paths.get(outputCpp).getFileName().toString() - .replace('.', '_').replace('-', '_').toUpperCase(Locale.ROOT); + final String outputCDefine = "DECIMALNATIVE"; + final String outputCppDefine = "DECIMALNATIVEHPP"; outFileH.write( - "#ifndef " + outputCDefine + "\n" + + "#pragma once\n" + + "#ifndef " + outputCDefine + "\n" + "#define " + outputCDefine + "\n" + "\n" + "#ifdef __cplusplus\n" + @@ -37,37 +36,42 @@ public static void make(final String outputC, final String outputCpp, final List "#define " + outputCDefine + "_VERSION \"" + versionThreeDigits + "\"\n" + "\n" + "#ifdef __cplusplus\n" + - "#define " + outputCDefine + "_MANGLING \"C\"\n" + + "# define " + outputCDefine + "_MANGLING extern \"C\"\n" + "#else\n" + - "#define " + outputCDefine + "_MANGLING\n" + + "# define " + outputCDefine + "_MANGLING\n" + "#endif\n" + "\n" + - "#ifdef " + outputCDefine + "_EXPORTS\n" + - "#if defined(_WIN64)\n" + - "#define " + outputCDefine + "_API(x) extern " + outputCDefine + "_MANGLING __declspec(dllexport) x __fastcall\n" + - "#elif defined(_WIN32)\n" + - "#define " + outputCDefine + "_API(x) extern " + outputCDefine + "_MANGLING __declspec(dllexport) x __stdcall\n" + + "#if defined(_WIN32)\n" + + "# define " + outputCDefine + "_CALLING __stdcall\n" + "#else\n" + - "#define " + outputCDefine + "_API(x) extern " + outputCDefine + "_MANGLING x __attribute__ ((visibility(\"default\")))\n" + + "# define " + outputCDefine + "_CALLING\n" + "#endif\n" + + "\n" + + "#ifdef " + outputCDefine + "_SHARED_LIBRARY\n" + + "# ifdef _MSC_VER\n" + + "# ifdef " + outputCDefine + "_EXPORTS\n" + + "# define " + outputCDefine + "_EXPORT __declspec(dllexport)\n" + + "# else\n" + + "# define " + outputCDefine + "_EXPORT __declspec(dllimport)\n" + + "# endif\n" + + "# else\n" + + "# define " + outputCDefine + "_EXPORT __attribute__ ((visibility(\"default\")))\n" + + "# endif\n" + "#else\n" + - "#if defined(_WIN64)\n" + - "#define " + outputCDefine + "_API(x) extern " + outputCDefine + "_MANGLING __declspec(dllimport) x __fastcall\n" + - "#elif defined(_WIN32)\n" + - "#define " + outputCDefine + "_API(x) extern " + outputCDefine + "_MANGLING __declspec(dllimport) x __stdcall\n" + - "#else\n" + - "#define " + outputCDefine + "_API(x) extern " + outputCDefine + "_MANGLING x __attribute__ ((visibility(\"default\")))\n" + - "#endif\n" + + "# define " + outputCDefine + "_EXPORT\n" + "#endif\n" + "\n" + + "#define " + outputCDefine + "_API(x) " + outputCDefine + "_MANGLING " + outputCDefine + "_EXPORT x " + outputCDefine + "_CALLING\n" + + "\n" + "typedef struct {\n" + " uint64_t val;\n" + "} " + dfpType + ";\n" + "\n" + - "inline static uint64_t decimal_native_toUnderlying(decimal_native_t _value) {\n" + + "inline static uint64_t " + decimalNativePrefix + "toUnderlying(decimal_native_t _value) {\n" + " return _value.val;\n" + "}\n" + - "inline static decimal_native_t decimal_native_fromUnderlying(uint64_t value) {\n" + + "\n" + + "inline static decimal_native_t " + decimalNativePrefix + "fromUnderlying(uint64_t value) {\n" + " decimal_native_t dn;\n" + " dn.val = value;\n" + " return dn;\n" + @@ -119,125 +123,120 @@ public static void make(final String outputC, final String outputCpp, final List "#define DN_NAMEOF(a) #a\n" + "\n" + "inline std::ostream& operator <<(std::ostream& output, " + dfpType + " const& a) {\n" + - " if (a.val == DECIMAL_NATIVE_UNDERLYING_NULL) {\n" + - " output << \"null\";\n" + - " }\n" + - " else {\n" + - " char str[32];\n" + - " " + decimalNativePrefix + "toString(a, str);\n" + - " output << str;\n" + - " }\n" + + " char str[512];\n" + + " output << " + decimalNativePrefix + "to_string_3(a, '.', str);\n" + " return output;\n" + "}\n" + + "\n" + "inline std::istream& operator >>(std::istream& input, " + dfpType + "& a) {\n" + " std::string word;\n" + " input >> word;\n" + - " a = word == \"null\"\n" + - " ? " + decimalNativePrefix + "fromUnderlying(DECIMAL_NATIVE_UNDERLYING_NULL)\n" + - " : " + decimalNativePrefix + "fromString(word.c_str());\n" + + " a = " + decimalNativePrefix + "parse(word.c_str());\n" + " return input;\n" + "}\n" + "\n" + - "namespace deltix {\n" + - " namespace dfp {\n" + + "namespace epam {\n" + + " namespace deltix {\n" + + " namespace dfp {\n" + "\n" + - " template \n" + - " class " + dfpClassType + " {\n" + - " protected:\n" + - " " + dfpType + " _value;\n" + + " template \n" + + " class " + dfpClassType + " {\n" + + " protected:\n" + + " " + dfpType + " _value;\n" + "\n" + - " public:\n" + - " uint64_t toUnderlying() const {\n" + - " return _value.val;\n" + - " }\n" + - " static " + dfpClassType + " fromUnderlying(uint64_t value) {\n" + - " decimal_native_t dn;\n" + - " dn.val = value;\n" + - " return " + dfpClassType + "(dn);\n" + - " }\n" + - " " + dfpClassType + "() {\n" + - " }\n" + - " " + dfpClassType + "(" + dfpClassType + " const &b) {\n" + - " _value = b._value;\n" + - " }\n" + - " " + dfpClassType + "& operator =(" + dfpClassType + " const &b) {\n" + - " _value = b._value;\n" + - " return *this;\n" + - " }\n" + - " " + dfpClassType + "(" + dfpType + " const &b) {\n" + - " _value = b;\n" + - " }\n" + - " " + dfpClassType + "& operator =(" + dfpType + " const &b) {\n" + - " _value = b;\n" + - " return *this;\n" + - " }\n" + - " explicit operator " + dfpType + "() const {\n" + - " return _value;\n" + - " }\n" + - " " + dfpClassType + " operator +(" + dfpClassType + " const& b) const {\n" + - " return add(*this, b);\n" + - " }\n" + - " " + dfpClassType + "& operator +=(" + dfpClassType + " const& b) {\n" + - " *this = add(*this, b);\n" + - " return *this;\n" + - " }\n" + - " " + dfpClassType + "& operator++() {\n" + - " *this += fromUnderlying(DECIMAL_NATIVE_UNDERLYING_ONE);\n" + - " return *this;\n" + - " }\n" + - " " + dfpClassType + " operator++(int) {\n" + - " " + dfpClassType + " ret = *this;\n" + - " ++*this;\n" + - " return ret;\n" + - " }\n" + - " " + dfpClassType + " operator -(" + dfpClassType + " const& b) const {\n" + - " return subtract(*this, b);\n" + - " }\n" + - " " + dfpClassType + "& operator -=(" + dfpClassType + " const& b) {\n" + - " *this = subtract(*this, b);\n" + - " return *this;\n" + - " }\n" + - " " + dfpClassType + "& operator--() {\n" + - " *this -= fromUnderlying(DECIMAL_NATIVE_UNDERLYING_ONE);\n" + - " return *this;\n" + - " }\n" + - " " + dfpClassType + " operator--(int) {\n" + - " " + dfpClassType + " ret = *this;\n" + - " --*this;\n" + - " return ret;\n" + - " }\n" + - " " + dfpClassType + " operator *(" + dfpClassType + " const& b) const {\n" + - " return multiply(*this, b);\n" + - " }\n" + - " " + dfpClassType + "& operator *=(" + dfpClassType + " const& b) {\n" + - " *this = multiply(*this, b);\n" + - " return *this;\n" + - " }\n" + - " " + dfpClassType + " operator /(" + dfpClassType + " const& b) const {\n" + - " return divide(*this, b);\n" + - " }\n" + - " " + dfpClassType + "& operator /=(" + dfpClassType + " const& b) {\n" + - " *this = divide(*this, b);\n" + - " return *this;\n" + - " }\n" + - " explicit operator std::string() const {\n" + - " char str[32];\n" + - " toString(str);\n" + - " return std::string(str);\n" + - " }\n" + - " friend std::ostream& operator <<(std::ostream& output, " + dfpClassType + " const& a) {\n" + - " output << a._value;\n" + - " return output;\n" + - " }\n" + - " friend std::istream& operator >>(std::istream& input, " + dfpClassType + "& a) {\n" + - " decimal_native_t val;\n" + - " input >> val;\n" + - " a = " + dfpClassType + "(val);\n" + - " return input;\n" + - " }\n" + - " bool isNull() const {\n" + - " return toUnderlying() == DECIMAL_NATIVE_UNDERLYING_NULL;\n" + - " }\n" + + " public:\n" + + " uint64_t toUnderlying() const {\n" + + " return _value.val;\n" + + " }\n" + + " static " + dfpClassType + " fromUnderlying(uint64_t value) {\n" + + " decimal_native_t dn;\n" + + " dn.val = value;\n" + + " return " + dfpClassType + "(dn);\n" + + " }\n" + + " " + dfpClassType + "() {\n" + + " _value.val = DECIMAL_NATIVE_UNDERLYING_ZERO;\n" + + " }\n" + + " " + dfpClassType + "(" + dfpClassType + " const &b) {\n" + + " _value = b._value;\n" + + " }\n" + + " " + dfpClassType + "& operator =(" + dfpClassType + " const &b) {\n" + + " _value = b._value;\n" + + " return *this;\n" + + " }\n" + + " " + dfpClassType + "(" + dfpType + " const &b) {\n" + + " _value = b;\n" + + " }\n" + + " " + dfpClassType + "& operator =(" + dfpType + " const &b) {\n" + + " _value = b;\n" + + " return *this;\n" + + " }\n" + + " explicit operator " + dfpType + "() const {\n" + + " return _value;\n" + + " }\n" + + " " + dfpClassType + " operator +(" + dfpClassType + " const& b) const {\n" + + " return add(*this, b);\n" + + " }\n" + + " " + dfpClassType + "& operator +=(" + dfpClassType + " const& b) {\n" + + " *this = add(*this, b);\n" + + " return *this;\n" + + " }\n" + + " " + dfpClassType + "& operator++() {\n" + + " *this += fromUnderlying(DECIMAL_NATIVE_UNDERLYING_ONE);\n" + + " return *this;\n" + + " }\n" + + " " + dfpClassType + " operator++(int) {\n" + + " " + dfpClassType + " ret = *this;\n" + + " ++*this;\n" + + " return ret;\n" + + " }\n" + + " " + dfpClassType + " operator -(" + dfpClassType + " const& b) const {\n" + + " return subtract(*this, b);\n" + + " }\n" + + " " + dfpClassType + "& operator -=(" + dfpClassType + " const& b) {\n" + + " *this = subtract(*this, b);\n" + + " return *this;\n" + + " }\n" + + " " + dfpClassType + "& operator--() {\n" + + " *this -= fromUnderlying(DECIMAL_NATIVE_UNDERLYING_ONE);\n" + + " return *this;\n" + + " }\n" + + " " + dfpClassType + " operator--(int) {\n" + + " " + dfpClassType + " ret = *this;\n" + + " --*this;\n" + + " return ret;\n" + + " }\n" + + " " + dfpClassType + " operator *(" + dfpClassType + " const& b) const {\n" + + " return multiply(*this, b);\n" + + " }\n" + + " " + dfpClassType + "& operator *=(" + dfpClassType + " const& b) {\n" + + " *this = multiply(*this, b);\n" + + " return *this;\n" + + " }\n" + + " " + dfpClassType + " operator /(" + dfpClassType + " const& b) const {\n" + + " return divide(*this, b);\n" + + " }\n" + + " " + dfpClassType + "& operator /=(" + dfpClassType + " const& b) {\n" + + " *this = divide(*this, b);\n" + + " return *this;\n" + + " }\n" + + " explicit operator std::string() const {\n" + + " char str[32];\n" + + " toString(str);\n" + + " return std::string(str);\n" + + " }\n" + + " friend std::ostream& operator <<(std::ostream& output, " + dfpClassType + " const& a) {\n" + + " output << a._value;\n" + + " return output;\n" + + " }\n" + + " friend std::istream& operator >>(std::istream& input, " + dfpClassType + "& a) {\n" + + " decimal_native_t val;\n" + + " input >> val;\n" + + " a = " + dfpClassType + "(val);\n" + + " return input;\n" + + " }\n" + + " bool isNull() const {\n" + + " return toUnderlying() == DECIMAL_NATIVE_UNDERLYING_NULL;\n" + + " }\n" + "\n"); for (final ApiEntry entry : api) { @@ -283,33 +282,33 @@ public static void make(final String outputC, final String outputCpp, final List String preOutHpp = ""; String outHpp = ""; if (outHpp.isEmpty() && fnArgCount == 0 && fnNameApi.startsWith("from")) { - outHpp = " explicit " + dfpClassType + "(" + fnArg + ") {\n"; - if (fnNameApi.equals("fromString")) - outHpp += " if (str == nullptr)\n" + - " throw std::invalid_argument(DN_FUNC + \": Argument '\" + DN_NAMEOF(str) + \"' is nullptr.\");\n" + - " decimal_native_t _value;\n" + - " if (!strncmp(str, \"null\", 4) && (str[4] == '\\0' || strchr(\" \\f\\n\\r\\t\\v\", str[4])))\n" + - " _value = decimal_native_fromUnderlying(DECIMAL_NATIVE_UNDERLYING_NULL);\n" + - " else\n" + - " _value = decimal_native_fromString(str);\n"; - else - outHpp += " _value = " + fnNameC + "(" + fnCall + ");\n"; - outHpp += " }\n"; + outHpp += " explicit " + dfpClassType + "(" + fnArg + ") {\n" + + " _value = " + fnNameC + "(" + fnCall + ");\n" + + " }\n"; + } + + if (outHpp.isEmpty() && fnArgCount == 0 && fnNameApi.equals("parse")) { + outHpp += " explicit " + dfpClassType + "(" + fnArg + ") {\n" + + " _value = " + fnNameC + "(" + fnCall + ");\n" + + " }\n" + + "\n" + + " explicit " + dfpClassType + "(const std::string &str) : this(str.c_str()) {\n" + + " }\n"; } - if (outHpp.isEmpty() && fnArgCount == 0 && fnArg.startsWith(dfpType) && fnNameApi.startsWith("to")) { - preOutHpp = " explicit operator " + fnRet + "() const {\n" + - " return " + fnNameApi + "(_value);\n" + - " }\n"; - outHpp = " " + fnRet + " " + fnNameApi + "() const {\n" + - " return " + fnNameC + "(_value);\n" + - " }\n"; + if (outHpp.isEmpty() && fnArgCount == 0 && fnArg.startsWith(dfpType) && fnNameApi.startsWith("to") && !fnNameApi.startsWith("to_scientific_string")) { + preOutHpp = " explicit operator " + fnRet + "() const {\n" + + " return " + fnNameApi + "(_value);\n" + + " }\n"; + outHpp = " " + fnRet + " " + fnNameApi + "() const {\n" + + " return " + fnNameC + "(_value);\n" + + " }\n"; } if (outHpp.isEmpty() && fnArgCount == 0 && fnArg.startsWith(dfpType) && (fnNameApi.startsWith("is") || fnNameApi.equals("signBit"))) - outHpp = " bool " + fnNameApi + "() const {\n" + - " return " + fnNameC + "(_value) != 0;\n" + - " }\n"; + outHpp = " bool " + fnNameApi + "() const {\n" + + " return " + fnNameC + "(_value) != 0;\n" + + " }\n"; if (outHpp.isEmpty() && fnRet.equals(dfpType) && fnArg.startsWith(dfpType) && (fnArgCount == 0 || fnNameApi.equals("scaleByPowerOfTen"))) { @@ -317,19 +316,19 @@ public static void make(final String outputC, final String outputCpp, final List final int fnCall2Index = fnCall.indexOf(","); final String fnCall2 = fnCall2Index > 0 ? fnCall.substring(fnCall2Index).trim() : ""; - outHpp = " " + dfpClassType + "& " + fnNameApi + "(" + fnArg2Finder.group(1).replace(dfpType, dfpClassType + " const&") + ") {\n" + - " _value = " + fnNameC + "(_value" + fnCall2 + ");\n" + + outHpp = " " + dfpClassType + "& " + fnNameApi + "(" + fnArg2Finder.group(1).replace(dfpType, dfpClassType + " const&") + ") {\n" + + " _value = " + fnNameC + "(_value" + fnCall2 + ");\n" + "\n" + - " return *this;\n" + - " }\n"; + " return *this;\n" + + " }\n"; } if (outHpp.isEmpty() && fnNameApi.equals("multiplyAndAdd")) - outHpp = " " + dfpClassType + "& " + fnNameApi + "(" + dfpClassType + " const& a, " + dfpClassType + " const& b) {\n" + - " _value = " + fnNameC + "(a._value, b._value, _value);\n" + + outHpp = " " + dfpClassType + "& " + fnNameApi + "(" + dfpClassType + " const& a, " + dfpClassType + " const& b) {\n" + + " _value = " + fnNameC + "(a._value, b._value, _value);\n" + "\n" + - " return *this;\n" + - " }\n"; + " return *this;\n" + + " }\n"; if (outHpp.isEmpty() && fnArgCount == 1 && allArgDfp && fnNameApi.startsWith("is")) { String opName = ""; @@ -355,66 +354,66 @@ public static void make(final String outputC, final String outputCpp, final List } if (!opName.isEmpty()) { if (opName.equals("==") || opName.equals("!=")) { - preOutHpp = " bool operator " + opName + "(" + dfpClassType + " const &b) const {\n" + - " if (toUnderlying() == DECIMAL_NATIVE_UNDERLYING_NULL &&\n" + - " b.toUnderlying() == DECIMAL_NATIVE_UNDERLYING_NULL)\n" + - " return " + (opName.equals("==") ? "true" : "false") + ";\n" + + preOutHpp = " bool operator " + opName + "(" + dfpClassType + " const &b) const {\n" + + " if (toUnderlying() == DECIMAL_NATIVE_UNDERLYING_NULL &&\n" + + " b.toUnderlying() == DECIMAL_NATIVE_UNDERLYING_NULL)\n" + + " return " + (opName.equals("==") ? "true" : "false") + ";\n" + "\n" + - " return " + fnNameC + "(_value, b._value) != 0;\n" + - " }\n"; + " return " + fnNameC + "(_value, b._value) != 0;\n" + + " }\n"; } else { - preOutHpp = " bool operator " + opName + "(" + dfpClassType + " const &b) const {\n" + - " return " + fnNameApi + "(b);\n" + - " }\n"; + preOutHpp = " bool operator " + opName + "(" + dfpClassType + " const &b) const {\n" + + " return " + fnNameApi + "(b);\n" + + " }\n"; - outHpp = " bool " + fnNameApi + "(" + dfpClassType + " const &b) const {\n" + - " return " + fnNameC + "(_value, b._value) != 0;\n" + - " }\n"; + outHpp = " bool " + fnNameApi + "(" + dfpClassType + " const &b) const {\n" + + " return " + fnNameC + "(_value, b._value) != 0;\n" + + " }\n"; } } } if (outHpp.isEmpty() && fnNameApi.equals("toString")) { - outHpp = " " + fnRet + " " + fnNameApi + "(char* dst) const {\n" + - " if (dst == nullptr)\n" + - " throw std::invalid_argument(DN_FUNC + \": Argument '\" + DN_NAMEOF(dst) + \"' is nullptr.\");\n" + - " if (isNull())\n" + - " memcpy(dst, \"null\", 5 * sizeof(char));\n" + - " else\n" + - " " + fnNameC + "(_value, dst);\n" + - " }\n"; + outHpp = " " + fnRet + " " + fnNameApi + "(char* dst) const {\n" + + " if (dst == nullptr)\n" + + " throw std::invalid_argument(DN_FUNC + \": Argument '\" + DN_NAMEOF(dst) + \"' is nullptr.\");\n" + + " if (isNull())\n" + + " memcpy(dst, \"null\", 5 * sizeof(char));\n" + + " else\n" + + " " + fnNameC + "(_value, dst);\n" + + " }\n"; } if (outHpp.isEmpty() && fnNameApi.startsWith("fromFixedPoint")) { - outHpp = " static " + dfpClassType + " fromFixedPoint(" + fnArg + ") {\n" + - " return " + dfpClassType + "(" + fnNameC + "(" + fnCall + "));\n" + - " }\n"; + outHpp = " static " + dfpClassType + " fromFixedPoint(" + fnArg + ") {\n" + + " return " + dfpClassType + "(" + fnNameC + "(" + fnCall + "));\n" + + " }\n"; } if (outHpp.isEmpty() && Pattern.compile("^(max|min|add|multiply|mean)\\d+|subtract|divide").matcher(fnNameApi).matches()) { final SoftMatcher multipleArgFinder = new SoftMatcher(Pattern.compile("(.+?)\\d*$").matcher(fnNameApi)); - outHpp = " static " + fnRet.replace(dfpType, dfpClassType) + " " + multipleArgFinder.group(1) + "(" + fnArg.replace(dfpType, dfpClassType + " const&") + ") {\n" + - " return " + dfpClassType + "(" + fnNameC + "(" + fnCall + "));\n" + - " }\n"; + outHpp = " static " + fnRet.replace(dfpType, dfpClassType) + " " + multipleArgFinder.group(1) + "(" + fnArg.replace(dfpType, dfpClassType + " const&") + ") {\n" + + " return " + dfpClassType + "(" + fnNameC + "(" + fnCall + "));\n" + + " }\n"; } if (outHpp.isEmpty()) { final SoftMatcher mulDivFinder = new SoftMatcher(Pattern.compile("^(multiply|divide)ByInt(32|64)$").matcher(fnNameApi)); if (mulDivFinder.matches()) { - preOutHpp = " " + dfpClassType + " operator " + (mulDivFinder.group(1).equals("multiply") ? "*" : "/") + "(int" + mulDivFinder.group(2) + "_t b) const {\n" + - " return " + fnNameApi + "(_value, b);\n" + - " }\n" + + preOutHpp = " " + dfpClassType + " operator " + (mulDivFinder.group(1).equals("multiply") ? "*" : "/") + "(int" + mulDivFinder.group(2) + "_t b) const {\n" + + " return " + fnNameApi + "(_value, b);\n" + + " }\n" + "\n" + - " " + dfpClassType + "& operator " + (mulDivFinder.group(1).equals("multiply") ? "*" : "/") + "=(int" + mulDivFinder.group(2) + "_t b) {\n" + - " _value = " + fnNameApi + "(_value, b);\n" + + " " + dfpClassType + "& operator " + (mulDivFinder.group(1).equals("multiply") ? "*" : "/") + "=(int" + mulDivFinder.group(2) + "_t b) {\n" + + " _value = " + fnNameApi + "(_value, b);\n" + "\n" + - " return *this;\n" + - " }\n"; + " return *this;\n" + + " }\n"; - outHpp = " " + dfpClassType + " " + fnNameApi + "(int" + mulDivFinder.group(2) + "_t b) const {\n" + - " return " + dfpClassType + "(" + fnNameC + "(_value, b));\n" + - " }\n"; + outHpp = " " + dfpClassType + " " + fnNameApi + "(int" + mulDivFinder.group(2) + "_t b) const {\n" + + " return " + dfpClassType + "(" + fnNameC + "(_value, b));\n" + + " }\n"; } } @@ -423,15 +422,15 @@ public static void make(final String outputC, final String outputCpp, final List final int fnCall2Index = fnCall.indexOf(","); final String fnCall2 = fnCall2Index > 0 ? fnCall.substring(fnCall2Index).trim() : ""; - outHpp = " " + fnRet.replace(dfpType, dfpClassType) + " " + fnNameApi + "(" + fnArg2Finder.group(1).replace(dfpType, dfpClassType + " const&") + ") const {\n" + - " return " + fnNameC + "(_value" + fnCall2 + ");\n" + - " }\n"; + outHpp = " " + fnRet.replace(dfpType, dfpClassType) + " " + fnNameApi + "(" + fnArg2Finder.group(1).replace(dfpType, dfpClassType + " const&") + ") const {\n" + + " return " + fnNameC + "(_value" + fnCall2 + ");\n" + + " }\n"; } if (preOutHpp.isEmpty() && outHpp.isEmpty()) - outHpp = " static " + fnRet.replace(dfpType, dfpClassType) + " " + fnNameApi + "(" + fnArg.replace(dfpType, dfpClassType + " const&") + ") {\n" + - " return " + fnNameC + "(" + fnCall + ");\n" + - " }\n"; + outHpp = " static " + fnRet.replace(dfpType, dfpClassType) + " " + fnNameApi + "(" + fnArg.replace(dfpType, dfpClassType + " const&") + ") {\n" + + " return " + fnNameC + "(" + fnCall + ");\n" + + " }\n"; // double toFloat64() const { // return ddfp1x0x2xSNAPSHOT_toFloat64(_value); // } @@ -457,23 +456,23 @@ public static void make(final String outputC, final String outputCpp, final List oneArg = oneArg.trim(); if (oneArg.endsWith("_value")) { if (oneArg.equals("_value")) - nullCheck += " if (isNull())\n" + - " throw std::invalid_argument(DN_FUNC + \": This object is null.\");\n"; + nullCheck += " if (isNull())\n" + + " throw std::invalid_argument(DN_FUNC + \": This object is null.\");\n"; else - nullCheck += " if (" + oneArg.substring(0, oneArg.length() - 7) + ".isNull())\n" + - " throw std::invalid_argument(DN_FUNC + \": Argument '\" + DN_NAMEOF(" + oneArg.substring(0, oneArg.length() - 7) + ") + \"' is null.\");\n"; + nullCheck += " if (" + oneArg.substring(0, oneArg.length() - 7) + ".isNull())\n" + + " throw std::invalid_argument(DN_FUNC + \": Argument '\" + DN_NAMEOF(" + oneArg.substring(0, oneArg.length() - 7) + ") + \"' is null.\");\n"; } } outHpp = outHppFinder.group(1) + " " + outHppFinder.group(2) + "(" + outHppFinder.group(3) + ")" + outHppFinder.group(4) + "{\n" + - " return nullCheck\n" + - " ? " + outHppFinder.group(2) + "Checked(" + outHppCall + ")\n" + - " : " + outHppFinder.group(2) + "Unchecked(" + outHppCall + ");\n" + - " }\n\n" + + " return nullCheck\n" + + " ? " + outHppFinder.group(2) + "Checked(" + outHppCall + ")\n" + + " : " + outHppFinder.group(2) + "Unchecked(" + outHppCall + ");\n" + + " }\n\n" + outHppFinder.group(1) + " " + outHppFinder.group(2) + "Checked(" + outHppFinder.group(3) + ")" + outHppFinder.group(4) + "{\n" + nullCheck + "\n" + - " return " + outHppFinder.group(2) + "Unchecked(" + outHppCall + ");\n" + - " }\n\n" + + " return " + outHppFinder.group(2) + "Unchecked(" + outHppCall + ");\n" + + " }\n\n" + outHppFinder.group(1) + " " + outHppFinder.group(2) + "Unchecked(" + outHppFinder.group(3) + ")" + outHppFinder.group(4) + outHpp.substring(outHpp.indexOf("{")); } @@ -486,31 +485,32 @@ public static void make(final String outputC, final String outputCpp, final List outFileH.write("\n#endif\n"); outFileHpp.write( - " };\n" + + " };\n" + "\n" + - " typedef " + dfpClassType + "<> Decimal64;\n" + + " typedef " + dfpClassType + "<> Decimal64;\n" + "\n" + - " static const Decimal64 D64_POSITIVE_INFINITY = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_POSITIVE_INFINITY);\n" + - " static const Decimal64 D64_NEGATIVE_INFINITY = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_NEGATIVE_INFINITY);\n" + - " static const Decimal64 D64_NAN = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_NAN);\n" + - " static const Decimal64 D64_NULL = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_NULL); // = -0x80\n" + + " static const Decimal64 D64_POSITIVE_INFINITY = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_POSITIVE_INFINITY);\n" + + " static const Decimal64 D64_NEGATIVE_INFINITY = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_NEGATIVE_INFINITY);\n" + + " static const Decimal64 D64_NAN = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_NAN);\n" + + " static const Decimal64 D64_NULL = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_NULL); // = -0x80\n" + "\n" + - " static const Decimal64 D64_MIN_VALUE = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_MIN_VALUE);\n" + - " static const Decimal64 D64_MAX_VALUE = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_MAX_VALUE);\n" + + " static const Decimal64 D64_MIN_VALUE = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_MIN_VALUE);\n" + + " static const Decimal64 D64_MAX_VALUE = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_MAX_VALUE);\n" + "\n" + - " static const Decimal64 D64_MIN_POSITIVE_VALUE = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_MIN_POSITIVE_VALUE);\n" + - " static const Decimal64 D64_MAX_NEGATIVE_VALUE = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_MAX_NEGATIVE_VALUE);\n" + + " static const Decimal64 D64_MIN_POSITIVE_VALUE = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_MIN_POSITIVE_VALUE);\n" + + " static const Decimal64 D64_MAX_NEGATIVE_VALUE = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_MAX_NEGATIVE_VALUE);\n" + "\n" + - " static const Decimal64 D64_ZERO = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_ZERO); // e=0, m=0, sign=0\n" + - " static const Decimal64 D64_ONE = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_ONE);\n" + - " static const Decimal64 D64_TWO = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_TWO);\n" + - " static const Decimal64 D64_TEN = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_TEN);\n" + - " static const Decimal64 D64_HUNDRED = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_HUNDRED);\n" + - " static const Decimal64 D64_THOUSAND = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_THOUSAND);\n" + - " static const Decimal64 D64_MILLION = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_MILLION);\n" + + " static const Decimal64 D64_ZERO = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_ZERO); // e=0, m=0, sign=0\n" + + " static const Decimal64 D64_ONE = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_ONE);\n" + + " static const Decimal64 D64_TWO = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_TWO);\n" + + " static const Decimal64 D64_TEN = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_TEN);\n" + + " static const Decimal64 D64_HUNDRED = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_HUNDRED);\n" + + " static const Decimal64 D64_THOUSAND = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_THOUSAND);\n" + + " static const Decimal64 D64_MILLION = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_MILLION);\n" + "\n" + - " static const Decimal64 D64_ONETENTH = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_ONETENTH);\n" + - " static const Decimal64 D64_ONEHUNDREDTH = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_ONEHUNDREDTH);\n" + + " static const Decimal64 D64_ONETENTH = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_ONETENTH);\n" + + " static const Decimal64 D64_ONEHUNDREDTH = Decimal64::fromUnderlying(DECIMAL_NATIVE_UNDERLYING_ONEHUNDREDTH);\n" + + " }\n" + " }\n" + "}\n" + "\n" + @@ -519,7 +519,7 @@ public static void make(final String outputC, final String outputCpp, final List } private static String cppTypeToC(String type) { - type = getCppType(type); + type = getCppType(type, false); switch (type) { case "_Decimal64": case "decimal64": @@ -558,6 +558,17 @@ private static String cppTypeToC(String type) { return "double"; case "intBool": return "int"; + case "char": + return "char"; + case "const char *": + case "const char*": + return "const char *"; + case "char *": + case "char*": + return "char *"; + case "uint32 *": + case "uint32*": + return "uint32_t *"; default: throw new RuntimeException("Can't convert C++ type (='" + type + "') to C type."); } diff --git a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/JavaWrappers.java b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/JavaWrappers.java index 0dcfd266..1e4491f9 100644 --- a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/JavaWrappers.java +++ b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/JavaWrappers.java @@ -54,6 +54,12 @@ public static void make(final String outputFile, final String versionThreeDigits ); for (final ApiEntry entry : javaApi) { + if (entry.name.startsWith(javaPrefix + "tryParse") || + entry.name.startsWith(javaPrefix + "parse") || + entry.name.startsWith(javaPrefix + "to_string") || + entry.name.startsWith(javaPrefix + "to_scientific_string")) + continue; + writer.write("\n public static native " + cppTypeToJava(entry.returnType) + " " + entry.name.substring(prefixLength) + "("); final String[] args = entry.arguments.split(","); diff --git a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/NativeWrappers.java b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/NativeWrappers.java index f1dea991..a2bad6a2 100644 --- a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/NativeWrappers.java +++ b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/NativeWrappers.java @@ -14,8 +14,8 @@ public class NativeWrappers { public static void main(final String[] args) throws IOException, InterruptedException { - if (args.length != 10) { - System.err.println("Usage: NativeWrappers "); + if (args.length != 9) { + System.err.println("Usage: NativeWrappers "); System.exit(-1); } final String versionThreeDigits = args[0]; @@ -26,15 +26,14 @@ public static void main(final String[] args) throws IOException, InterruptedExce final String inputFile = args[5]; final String outputJava = args[6]; final String outputCs = args[7]; - final String outputC = args[8]; - final String outputCpp = args[9]; + final String outputCRoot = args[8]; final String preprocess = callPreprocess(inputFile, apiPrefix, javaPrefix); final List api = collectApi(preprocess, apiPrefix); - if (!outputC.isEmpty() && !outputCpp.isEmpty()) { - CxxWrappers.make(outputC, outputCpp, api, apiPrefix, versionThreeDigits); + if (!outputCRoot.isEmpty()) { + CxxWrappers.make(outputCRoot, api, apiPrefix, versionThreeDigits); } CsWrappers.make(outputCs, api, apiPrefix); diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 30d12fbf..f67d7001 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -49,10 +49,9 @@ add_definitions(-DDECIMAL_GLOBAL_EXCEPTION_FLAGS=${GLOBAL_FLAGS}) set(CMAKE_POSITION_INDEPENDENT_CODE ON) add_subdirectory (../thirdparty/IntelRDFPMathLib20U2/LIBRARY LIBRARY) -add_subdirectory (../thirdparty/IntelRDFPMathLib20U2/EXAMPLES EXAMPLES) -add_library(dfp SHARED NativeImpl.c) -target_compile_definitions(dfp PRIVATE API_PREFIX=ddfp${VERSION_SUFFIX}_ JAVA_PREFIX=com_epam_deltix_dfp_NativeImpl_) +add_library(dfp SHARED NativeImpl.cpp) +target_compile_definitions(dfp PRIVATE API_PREFIX=ddfp${VERSION_SUFFIX}_ JAVA_PREFIX=com_epam_deltix_dfp_NativeImpl_ DECIMALNATIVE_SHARED_LIBRARY DECIMALNATIVE_EXPORTS) target_link_libraries (dfp LINK_PUBLIC bid) set_target_properties(dfp PROPERTIES OUTPUT_NAME "ddfp${VERSION_SUFFIX}") install(TARGETS dfp DESTINATION ./bin/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX}) @@ -84,10 +83,16 @@ file(GLOB BID_SRCS_STATIC ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_ops_64.c ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_four_over_pi.c ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exception.c - ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/sqrt_tab_t.c) + ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/sqrt_tab_t.c + NativeImplToString.cpp) -add_library(dfpStatic STATIC NativeImpl.c ${BID_SRCS_STATIC}) +add_library(dfpStatic STATIC NativeImpl.cpp ${BID_SRCS_STATIC}) include_directories(../thirdparty/IntelRDFPMathLib20U2/LIBRARY/src) target_compile_definitions(dfpStatic PRIVATE API_PREFIX=ddfp${VERSION_SUFFIX}_ NOJAVA) set_target_properties(dfpStatic PROPERTIES OUTPUT_NAME "ddfpStatic${VERSION_SUFFIX}") install(TARGETS dfpStatic DESTINATION ./bin/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX}) + +add_executable(demo demo.cpp) +#target_compile_definitions(demo PRIVATE DECIMALNATIVE_SHARED_LIBRARY) +#target_link_libraries (demo LINK_PUBLIC dfp) +target_link_libraries (demo LINK_PUBLIC dfpStatic) diff --git a/native/NativeImpl.c b/native/NativeImpl.c deleted file mode 100644 index 602a6036..00000000 --- a/native/NativeImpl.c +++ /dev/null @@ -1,126 +0,0 @@ -#include "NativeImpl.h" - -//region Conversion - -OPN(fromFloat64, binary64_to_bid64(x), double x) -OPN(fromFloat32, binary32_to_bid64(x), float x) -OPN(fromInt64, bid64_from_int64(x), int64 x) -OPN(fromUInt64, bid64_from_uint64(x), uint64 x) -OPNR(toFloat64, double, bid64_to_binary64(x), BID_UINT64 x) -OPNR(toFloat32, float, bid64_to_binary32(x), BID_UINT64 x) -OPNR(toInt64, int64, bid64_to_int64_xint(x), BID_UINT64 x) -OPNR(toUInt64, uint64, bid64_to_uint64_xint(x), BID_UINT64 x) -OPN(fromFixedPoint64, bid64_scalbn(bid64_from_int64(mantissa), -tenPowerFactor), int64 mantissa, int32 tenPowerFactor) -OPNR(toFixedPoint, int64, bid64_to_int64_xint(bid64_scalbn(value, numberOfDigits)), BID_UINT64 value, int32 numberOfDigits) - -//endregion - -//region Classification - -OPN_BOOL(isNaN, bid64_isNaN(x), BID_UINT64 x) -OPN_BOOL(isInfinity, bid64_isInf(x), BID_UINT64 x) -OPN_BOOL(isPositiveInfinity, (intBool)(bid64_isInf(x) && !bid64_isSigned(x)), BID_UINT64 x) -OPN_BOOL(isNegativeInfinity, (intBool)(bid64_isInf(x) && bid64_isSigned(x)), BID_UINT64 x) -OPN_BOOL(isFinite, bid64_isFinite(x), BID_UINT64 x) -OPN_BOOL(isNormal, bid64_isNormal(x), BID_UINT64 x) -OPN_BOOL(signBit, bid64_isSigned(x), BID_UINT64 x) - -//endregion - -//region Comparison - -DDFP_API(int32) PPCAT(API_PREFIX, compare) ( BID_UINT64 a, BID_UINT64 b) { - if (bid64_quiet_less(a, b)) - return -1; - if (bid64_quiet_greater(a, b)) - return 1; - if (bid64_quiet_equal(a, b)) - return 0; - return bid64_isNaN(b) - bid64_isNaN(a); -} -JAVA_API_IMPL( -JNI_API(int32) PPCAT(PPCAT(Java_, JAVA_PREFIX), compare) (void *jEnv, void *jClass, BID_UINT64 a, BID_UINT64 b) { - if (bid64_quiet_less(a, b)) - return -1; - if (bid64_quiet_greater(a, b)) - return 1; - if (bid64_quiet_equal(a, b)) - return 0; - return bid64_isNaN(a) - bid64_isNaN(b); -} -JNI_API(int32) PPCAT(PPCAT(JavaCritical_, JAVA_PREFIX), compare) ( BID_UINT64 a, BID_UINT64 b) { - if (bid64_quiet_less(a, b)) - return -1; - if (bid64_quiet_greater(a, b)) - return 1; - if (bid64_quiet_equal(a, b)) - return 0; - return bid64_isNaN(a) - bid64_isNaN(b); -} -) - -OPN_BOOL(isEqual, bid64_quiet_equal(a, b), BID_UINT64 a, BID_UINT64 b) -OPN_BOOL(isNotEqual, bid64_quiet_not_equal(a, b), BID_UINT64 a, BID_UINT64 b) -OPN_BOOL(isLess, bid64_quiet_less(a, b), BID_UINT64 a, BID_UINT64 b) -OPN_BOOL(isLessOrEqual, bid64_quiet_less_equal(a, b), BID_UINT64 a, BID_UINT64 b) -OPN_BOOL(isGreater, bid64_quiet_greater(a, b), BID_UINT64 a, BID_UINT64 b) -OPN_BOOL(isGreaterOrEqual, bid64_quiet_greater_equal(a, b), BID_UINT64 a, BID_UINT64 b) -OPN_BOOL(isZero, bid64_isZero(a), BID_UINT64 a) -OPN_BOOL(isNonZero, bid64_quiet_not_equal(a, zeroConst), BID_UINT64 a) -OPN_BOOL(isPositive, bid64_quiet_greater(a, zeroConst), BID_UINT64 a) -OPN_BOOL(isNegative, bid64_quiet_less(a, zeroConst), BID_UINT64 a) -OPN_BOOL(isNonPositive, bid64_quiet_less_equal(a, zeroConst), BID_UINT64 a) -OPN_BOOL(isNonNegative, bid64_quiet_greater_equal(a, zeroConst), BID_UINT64 a) - -//endregion - -//region Rounding - -OPN(roundTowardsPositiveInfinity, bid64_round_integral_positive(x), BID_UINT64 x) -OPN(roundTowardsNegativeInfinity, bid64_round_integral_negative(x), BID_UINT64 x) -OPN(roundTowardsZero, bid64_round_integral_zero(x), BID_UINT64 x) -OPN(roundToNearestTiesAwayFromZero, bid64_round_integral_nearest_away(x), BID_UINT64 x) -OPN(roundToNearestTiesToEven, bid64_round_integral_nearest_even(x), BID_UINT64 x) - -//endregion - -//region Minimum & Maximum - -OPN(max2, bid64_isNaN(a) || bid64_isNaN(b) ? nanConst : bid64_maxnum(a, b), BID_UINT64 a, BID_UINT64 b) -OPN(max3, bid64_isNaN(a) || bid64_isNaN(b) || bid64_isNaN(c) ? nanConst : bid64_maxnum(bid64_maxnum(a, b), c), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c) -OPN(max4, bid64_isNaN(a) || bid64_isNaN(b) || bid64_isNaN(c) || bid64_isNaN(d) ? nanConst : bid64_maxnum(bid64_maxnum(a, b), bid64_maxnum(c, d)), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c, BID_UINT64 d) -OPN(min2, bid64_isNaN(a) || bid64_isNaN(b) ? nanConst : bid64_minnum(a, b), BID_UINT64 a, BID_UINT64 b) -OPN(min3, bid64_isNaN(a) || bid64_isNaN(b) || bid64_isNaN(c) ? nanConst : bid64_minnum(bid64_minnum(a, b), c), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c) -OPN(min4, bid64_isNaN(a) || bid64_isNaN(b) || bid64_isNaN(c) || bid64_isNaN(d) ? nanConst : bid64_minnum(bid64_minnum(a, b), bid64_minnum(c, d)), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c, BID_UINT64 d) - -//endregion - -//region Arithmetic - -OPN(negate, bid64_negate(x), BID_UINT64 x) -OPN(abs, bid64_abs(x), BID_UINT64 x) -OPN(add2, bid64_add(a, b), BID_UINT64 a, BID_UINT64 b) -OPN(add3, bid64_add(bid64_add(a, b), c), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c) -OPN(add4, bid64_add(bid64_add(a, b), bid64_add(c, d)), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c, BID_UINT64 d) -OPN(subtract, bid64_sub(a, b), BID_UINT64 a, BID_UINT64 b) -OPN(multiply2, bid64_mul(a, b), BID_UINT64 a, BID_UINT64 b) -OPN(multiply3, bid64_mul(bid64_mul(a, b), c), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c) -OPN(multiply4, bid64_mul(bid64_mul(a, b), bid64_mul(c, d)), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c, BID_UINT64 d) -OPN(multiplyByInt32, bid64_mul(a, bid64_from_int32(integer)), BID_UINT64 a, int32 integer) -OPN(multiplyByInt64, bid64_mul(a, bid64_from_int64(integer)), BID_UINT64 a, int64 integer) -OPN(divide, bid64_div(a, b), BID_UINT64 a, BID_UINT64 b) -OPN(divideByInt32, bid64_div(x, bid64_from_int32(integer)), BID_UINT64 x, int32 integer) -OPN(divideByInt64, bid64_div(x, bid64_from_int64(integer)), BID_UINT64 x, int64 integer) -OPN(multiplyAndAdd, bid64_fma(a, b, c), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c) -OPN(scaleByPowerOfTen, bid64_scalbn(a, n) , BID_UINT64 a, int32 n) -OPN(mean2, bid64_div(bid64_add(a, b), twoConst), BID_UINT64 a, BID_UINT64 b) - -//endregion - -//region Special - -OPN(nextUp, bid64_nextup(x), BID_UINT64 x) -OPN(nextDown, bid64_nextdown(x), BID_UINT64 x) - -//endregion - diff --git a/native/NativeImpl.cpp b/native/NativeImpl.cpp new file mode 100644 index 00000000..3eac23f0 --- /dev/null +++ b/native/NativeImpl.cpp @@ -0,0 +1,162 @@ +#include +#include +#include "NativeImpl.h" +#include "NativeImplToString.h" + +#ifdef __cplusplus +extern "C" { +#endif + + //region Conversion + static const uint64_t DECIMAL_NATIVE_UNDERLYING_NULL = 0xFFFFFFFFFFFFFF80ULL; // = -0x80 + + BID_UINT64 dfp64_try_parse(const char* str, _IDEC_flags* exception) { + if (!stricmp(str, "null")) + return DECIMAL_NATIVE_UNDERLYING_NULL; + auto ret = bid64_from_string((char*)str); + if (exception) + *exception = _IDEC_glbflags; + return ret; + } + + BID_UINT64 dfp64_parse(const char* str) { + return dfp64_try_parse(str, nullptr); + } + + OPN(fromFloat64, binary64_to_bid64(x), double x) + OPN(fromFloat32, binary32_to_bid64(x), float x) + OPN(fromInt64, bid64_from_int64(x), int64 x) + OPN(fromUInt64, bid64_from_uint64(x), uint64 x) + OPNR(toFloat64, double, bid64_to_binary64(x), BID_UINT64 x) + OPNR(toFloat32, float, bid64_to_binary32(x), BID_UINT64 x) + OPNR(toInt64, int64, bid64_to_int64_xint(x), BID_UINT64 x) + OPNR(toUInt64, uint64, bid64_to_uint64_xint(x), BID_UINT64 x) + OPN(fromFixedPoint64, bid64_scalbn(bid64_from_int64(mantissa), -tenPowerFactor), int64 mantissa, int32 tenPowerFactor) + OPNR(toFixedPoint, int64, bid64_to_int64_xint(bid64_scalbn(value, numberOfDigits)), BID_UINT64 value, int32 numberOfDigits) + + OPN(parse, dfp64_parse(str), const char* str) + OPN(tryParse, dfp64_try_parse(str, exception), const char* str, uint32* exception) + + OPNR(to_string, const char*, dfp64_to_string(x), BID_UINT64 x) + OPNR(to_string_2, const char*, dfp64_to_string_2(x, decimalMark), BID_UINT64 x, char decimalMark) + OPNR(to_string_3, const char*, dfp64_to_string_3(x, decimalMark, buffer512), BID_UINT64 x, char decimalMark, char* buffer512) + + OPNR(to_scientific_string, const char*, dfp64_to_scientific_string(x), BID_UINT64 x) + OPNR(to_scientific_string_2, const char*, dfp64_to_scientific_string_2(x, decimalMark), BID_UINT64 x, char decimalMark) + OPNR(to_scientific_string_3, const char*, dfp64_to_scientific_string_3(x, decimalMark, buffer512), BID_UINT64 x, char decimalMark, char* buffer512) + + + //endregion + + //region Classification + + OPN_BOOL(isNaN, bid64_isNaN(x), BID_UINT64 x) + OPN_BOOL(isInfinity, bid64_isInf(x), BID_UINT64 x) + OPN_BOOL(isPositiveInfinity, (intBool)(bid64_isInf(x) && !bid64_isSigned(x)), BID_UINT64 x) + OPN_BOOL(isNegativeInfinity, (intBool)(bid64_isInf(x) && bid64_isSigned(x)), BID_UINT64 x) + OPN_BOOL(isFinite, bid64_isFinite(x), BID_UINT64 x) + OPN_BOOL(isNormal, bid64_isNormal(x), BID_UINT64 x) + OPN_BOOL(signBit, bid64_isSigned(x), BID_UINT64 x) + + //endregion + + //region Comparison + + DDFP_API(int32) PPCAT(API_PREFIX, compare) (BID_UINT64 a, BID_UINT64 b) { + if (bid64_quiet_less(a, b)) + return -1; + if (bid64_quiet_greater(a, b)) + return 1; + if (bid64_quiet_equal(a, b)) + return 0; + return bid64_isNaN(b) - bid64_isNaN(a); + } + JAVA_API_IMPL( + JNI_API(int32) PPCAT(PPCAT(Java_, JAVA_PREFIX), compare) (void* jEnv, void* jClass, BID_UINT64 a, BID_UINT64 b) { + if (bid64_quiet_less(a, b)) + return -1; + if (bid64_quiet_greater(a, b)) + return 1; + if (bid64_quiet_equal(a, b)) + return 0; + return bid64_isNaN(a) - bid64_isNaN(b); + } + JNI_API(int32) PPCAT(PPCAT(JavaCritical_, JAVA_PREFIX), compare) (BID_UINT64 a, BID_UINT64 b) { + if (bid64_quiet_less(a, b)) + return -1; + if (bid64_quiet_greater(a, b)) + return 1; + if (bid64_quiet_equal(a, b)) + return 0; + return bid64_isNaN(a) - bid64_isNaN(b); + } + ) + + OPN_BOOL(isEqual, bid64_quiet_equal(a, b), BID_UINT64 a, BID_UINT64 b) + OPN_BOOL(isNotEqual, bid64_quiet_not_equal(a, b), BID_UINT64 a, BID_UINT64 b) + OPN_BOOL(isLess, bid64_quiet_less(a, b), BID_UINT64 a, BID_UINT64 b) + OPN_BOOL(isLessOrEqual, bid64_quiet_less_equal(a, b), BID_UINT64 a, BID_UINT64 b) + OPN_BOOL(isGreater, bid64_quiet_greater(a, b), BID_UINT64 a, BID_UINT64 b) + OPN_BOOL(isGreaterOrEqual, bid64_quiet_greater_equal(a, b), BID_UINT64 a, BID_UINT64 b) + OPN_BOOL(isZero, bid64_isZero(a), BID_UINT64 a) + OPN_BOOL(isNonZero, bid64_quiet_not_equal(a, zeroConst), BID_UINT64 a) + OPN_BOOL(isPositive, bid64_quiet_greater(a, zeroConst), BID_UINT64 a) + OPN_BOOL(isNegative, bid64_quiet_less(a, zeroConst), BID_UINT64 a) + OPN_BOOL(isNonPositive, bid64_quiet_less_equal(a, zeroConst), BID_UINT64 a) + OPN_BOOL(isNonNegative, bid64_quiet_greater_equal(a, zeroConst), BID_UINT64 a) + + //endregion + + //region Rounding + + OPN(roundTowardsPositiveInfinity, bid64_round_integral_positive(x), BID_UINT64 x) + OPN(roundTowardsNegativeInfinity, bid64_round_integral_negative(x), BID_UINT64 x) + OPN(roundTowardsZero, bid64_round_integral_zero(x), BID_UINT64 x) + OPN(roundToNearestTiesAwayFromZero, bid64_round_integral_nearest_away(x), BID_UINT64 x) + OPN(roundToNearestTiesToEven, bid64_round_integral_nearest_even(x), BID_UINT64 x) + + //endregion + + //region Minimum & Maximum + + OPN(max2, bid64_isNaN(a) || bid64_isNaN(b) ? nanConst : bid64_maxnum(a, b), BID_UINT64 a, BID_UINT64 b) + OPN(max3, bid64_isNaN(a) || bid64_isNaN(b) || bid64_isNaN(c) ? nanConst : bid64_maxnum(bid64_maxnum(a, b), c), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c) + OPN(max4, bid64_isNaN(a) || bid64_isNaN(b) || bid64_isNaN(c) || bid64_isNaN(d) ? nanConst : bid64_maxnum(bid64_maxnum(a, b), bid64_maxnum(c, d)), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c, BID_UINT64 d) + OPN(min2, bid64_isNaN(a) || bid64_isNaN(b) ? nanConst : bid64_minnum(a, b), BID_UINT64 a, BID_UINT64 b) + OPN(min3, bid64_isNaN(a) || bid64_isNaN(b) || bid64_isNaN(c) ? nanConst : bid64_minnum(bid64_minnum(a, b), c), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c) + OPN(min4, bid64_isNaN(a) || bid64_isNaN(b) || bid64_isNaN(c) || bid64_isNaN(d) ? nanConst : bid64_minnum(bid64_minnum(a, b), bid64_minnum(c, d)), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c, BID_UINT64 d) + + //endregion + + //region Arithmetic + + OPN(negate, bid64_negate(x), BID_UINT64 x) + OPN(abs, bid64_abs(x), BID_UINT64 x) + OPN(add2, bid64_add(a, b), BID_UINT64 a, BID_UINT64 b) + OPN(add3, bid64_add(bid64_add(a, b), c), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c) + OPN(add4, bid64_add(bid64_add(a, b), bid64_add(c, d)), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c, BID_UINT64 d) + OPN(subtract, bid64_sub(a, b), BID_UINT64 a, BID_UINT64 b) + OPN(multiply2, bid64_mul(a, b), BID_UINT64 a, BID_UINT64 b) + OPN(multiply3, bid64_mul(bid64_mul(a, b), c), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c) + OPN(multiply4, bid64_mul(bid64_mul(a, b), bid64_mul(c, d)), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c, BID_UINT64 d) + OPN(multiplyByInt32, bid64_mul(a, bid64_from_int32(integer)), BID_UINT64 a, int32 integer) + OPN(multiplyByInt64, bid64_mul(a, bid64_from_int64(integer)), BID_UINT64 a, int64 integer) + OPN(divide, bid64_div(a, b), BID_UINT64 a, BID_UINT64 b) + OPN(divideByInt32, bid64_div(x, bid64_from_int32(integer)), BID_UINT64 x, int32 integer) + OPN(divideByInt64, bid64_div(x, bid64_from_int64(integer)), BID_UINT64 x, int64 integer) + OPN(multiplyAndAdd, bid64_fma(a, b, c), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c) + OPN(scaleByPowerOfTen, bid64_scalbn(a, n), BID_UINT64 a, int32 n) + OPN(mean2, bid64_div(bid64_add(a, b), twoConst), BID_UINT64 a, BID_UINT64 b) + + //endregion + + //region Special + + OPN(nextUp, bid64_nextup(x), BID_UINT64 x) + OPN(nextDown, bid64_nextdown(x), BID_UINT64 x) + + //endregion + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/native/NativeImpl.h b/native/NativeImpl.h index 7f5b84ce..95ef5b70 100644 --- a/native/NativeImpl.h +++ b/native/NativeImpl.h @@ -11,6 +11,12 @@ #define JAVA_PREFIX com_epam_deltix_dfp_NativeImpl_ #endif +#ifdef __cplusplus +#define DDFP_MANGLING extern "C" +#else +#define DDFP_MANGLING +#endif + #if defined(_WIN32) #define JNI_API(x) __declspec(dllexport) x __stdcall #else @@ -18,12 +24,11 @@ #endif #if defined(_WIN32) -#define DDFP_API(x) __declspec(dllexport) x __cdecl +#define DDFP_API(x) DDFP_MANGLING __declspec(dllexport) x __cdecl #else -#define DDFP_API(x) x __attribute__ ((externally_visible,visibility("default"))) +#define DDFP_API(x) DDFP_MANGLING x __attribute__ ((externally_visible,visibility("default"))) #endif - /* * Concatenate preprocessor tokens A and B without expanding macro definitions * (however, if invoked from a macro, macro arguments are expanded). diff --git a/native/NativeImplToString.cpp b/native/NativeImplToString.cpp new file mode 100644 index 00000000..c4a875e2 --- /dev/null +++ b/native/NativeImplToString.cpp @@ -0,0 +1,300 @@ +#include "NativeImpl.h" +#include +#include +#include +#include +#include "NativeImplToString.h" + +static const BID_UINT64 DFP_NAN_NULL = 0xFFFFFFFFFFFFFF80ull; // = -0x80L; +static const BID_UINT64 MASK_INFINITY_AND_NAN = 0x7800000000000000ull; +static const BID_UINT64 MASK_INFINITY_NAN = 0x7C00000000000000L; + +static const int EXPONENT_BIAS = 398; + + +static bool isNull(BID_UINT64 value) { + return DFP_NAN_NULL == value; +} + +static bool isNonFinite(BID_UINT64 value) { + return (value & MASK_INFINITY_AND_NAN) == MASK_INFINITY_AND_NAN; +} + +static bool isNaN(BID_UINT64 value) { + return (value & MASK_INFINITY_NAN) == MASK_INFINITY_NAN; +} + +static const int BCD_TABLE_DIGITS = 3; +static const int BCD_DIVIDER = 1000000000; +static const int BCD_DIVIDER_GROUPS = 3; // log10(BCD_DIVIDER) / BCD_TABLE_DIGITS must be natural value + +std::vector makeBcdTable(int tenPowerMaxIndex) { + int n = 1; + for (int i = 0; i < tenPowerMaxIndex; ++i) + n *= 10; + + std::vector table(n * tenPowerMaxIndex); + + std::vector value(tenPowerMaxIndex); + + std::fill(value.begin(), value.end(), '0'); + + for (int i = 0, ib = 0; i < n; ++i) { + for (int j = 0; j < tenPowerMaxIndex; ++j) + table[ib++] = value[j]; + value[0] += 1; + for (int j = 0; j < tenPowerMaxIndex - 1; ++j) { + if (value[j] <= '9') + break; + else { + value[j] -= 10; + value[j + 1] += 1; + } + } + } + + return table; +} + +static const std::vector BCD_TABLE = makeBcdTable(BCD_TABLE_DIGITS); + +int formatUIntFromBcdTable(int value, char* buffer, int bi) { + for (int blockIndex = 0; blockIndex < BCD_DIVIDER_GROUPS; ++blockIndex) { + int newValue = (int)((unsigned long long)(2199023256ull * value) >> 41); + int remainder = value - newValue * 1000; + //final int remainder = value - ((newValue << 10) - (newValue << 4) - (newValue << 3)); + value = newValue; + + for (int j = 0, ti = remainder * BCD_TABLE_DIGITS /* (remainder << 1) + remainder */; j < BCD_TABLE_DIGITS; ++j, ++ti) + buffer[--bi] = BCD_TABLE[ti]; + } + + return bi; +} + +static const BID_UINT64 POWERS_OF_TEN[] = { + /* 0 */ 1L, + /* 1 */ 10L, + /* 2 */ 100L, + /* 3 */ 1000L, + /* 4 */ 10000L, + /* 5 */ 100000L, + /* 6 */ 1000000L, + /* 7 */ 10000000L, + /* 8 */ 100000000L, + /* 9 */ 1000000000L, + /* 10 */ 10000000000L, + /* 11 */ 100000000000L, + /* 12 */ 1000000000000L, + /* 13 */ 10000000000000L, + /* 14 */ 100000000000000L, + /* 15 */ 1000000000000000L, + /* 16 */ 10000000000000000L, + /* 17 */ 100000000000000000L, + /* 18 */ 1000000000000000000L +}; + +int numberOfDigits(BID_UINT64 value) { + for (int i = 1; i < sizeof(POWERS_OF_TEN) / sizeof(POWERS_OF_TEN[0]); i += 1) + if (value < POWERS_OF_TEN[i]) + return i; + return 19; +} + + +static const int bufferMinLength = 511; +static thread_local char tls_to_string_buffer[bufferMinLength + 1]; + +BID_EXTERN_C const char* dfp64_to_string(BID_UINT64 value) { + return dfp64_to_string_2(value, '.'); +} + +BID_EXTERN_C const char* dfp64_to_string_2(BID_UINT64 value, char decimalMark) { + return dfp64_to_string_3(value, decimalMark, tls_to_string_buffer); +} + +BID_EXTERN_C const char* dfp64_to_string_3(BID_UINT64 value, char decimalMark, char* buffer512) { + if (isNull(value)) + return "null"; + + if (isNonFinite(value)) { + // Value is either Inf or NaN + // TODO: Do we need SNaN? + return isNaN(value) ? "NaN" : value < 0 ? "-Infinity" : "Infinity"; + } + + BID_UINT64 partsSignMask, partsCoefficient; + int partsExponent; + unpack_BID64(&partsSignMask, &partsExponent, &partsCoefficient, value); + + if (partsCoefficient == 0) { // return "0" + decimalMark + "0"; + buffer512[0] = '0'; + buffer512[1] = decimalMark; + buffer512[2] = '0'; + buffer512[3] = '\0'; + return buffer512; + } + + int exponent = partsExponent - EXPONENT_BIAS; + + buffer512[bufferMinLength] = '\0'; + + if (exponent >= 0) { + int bi = bufferMinLength; + buffer512[--bi] = '0'; + buffer512[--bi] = decimalMark; + for (int i = 0; i < exponent; ++i) + buffer512[--bi] = '0'; + + while (partsCoefficient > 0) { + bi = formatUIntFromBcdTable((int)(partsCoefficient % BCD_DIVIDER), buffer512, bi); + partsCoefficient /= BCD_DIVIDER; + } + + while (buffer512[bi] == '0') + ++bi; + + if (value < 0) + buffer512[--bi] = '-'; + + return buffer512 + bi; + + } + else { // exponent < 0 + int bi = bufferMinLength; + + int digits = numberOfDigits(partsCoefficient); + + if (digits + exponent > 0) { + long integralPart = partsCoefficient / POWERS_OF_TEN[-exponent]; + long fractionalPart = partsCoefficient % POWERS_OF_TEN[-exponent]; + + while (fractionalPart > 0) { + bi = formatUIntFromBcdTable((int)(fractionalPart % BCD_DIVIDER), buffer512, bi); + fractionalPart /= BCD_DIVIDER; + } + + int written = bufferMinLength - bi /* already written */; + //if (written < -exponent /* must be written */) + for (int ei = 0, ee = -exponent - written; ei < ee; ++ei) + buffer512[--bi] = '0'; + + bi = bufferMinLength + exponent; /* buffer512.length - (-exponent) */ + + buffer512[--bi] = decimalMark; + + while (integralPart > 0) { + bi = formatUIntFromBcdTable((int)(integralPart % BCD_DIVIDER), buffer512, bi); + integralPart /= BCD_DIVIDER; + } + + while (buffer512[bi] == '0') + ++bi; + + if (value < 0) + buffer512[--bi] = '-'; + + int be = bufferMinLength; + while (buffer512[be - 1] == '0') + --be; + + if (buffer512[be - 1] == decimalMark && be < bufferMinLength) + buffer512[be++] = '0'; + + buffer512[be] = '\0'; + return buffer512 + bi; + + } + else { + while (partsCoefficient > 0) { + bi = formatUIntFromBcdTable((int)(partsCoefficient % BCD_DIVIDER), buffer512, bi); + partsCoefficient /= BCD_DIVIDER; + } + + int written = bufferMinLength - bi /* already written */; + //if (written < -exponent /* must be written */) + for (int ei = 0, ee = -exponent - written; ei < ee; ++ei) + buffer512[--bi] = '0'; + + bi = bufferMinLength + exponent; /* buffer512.length - (-exponent) */ + + buffer512[--bi] = decimalMark; + buffer512[--bi] = '0'; + + if (value < 0) + buffer512[--bi] = '-'; + + int be = bufferMinLength; + while (buffer512[be - 1] == '0') + --be; + + buffer512[be] = '\0'; + return buffer512 + bi; + } + } +} + +const char SCIENTIFIC_ZERO[] = "0.000000000000000e+000"; + +BID_EXTERN_C const char* dfp64_to_scientific_string(BID_UINT64 value) { + return dfp64_to_scientific_string_2(value, '.'); +} + +BID_EXTERN_C const char* dfp64_to_scientific_string_2(BID_UINT64 value, char decimalMark) { + return dfp64_to_scientific_string_3(value, decimalMark, tls_to_string_buffer); +} + +BID_EXTERN_C const char* dfp64_to_scientific_string_3(BID_UINT64 value, char decimalMark, char* buffer512) { + if (isNull(value)) + return "null"; + + if (isNonFinite(value)) { + // Value is either Inf or NaN + // TODO: Do we need SNaN? + return isNaN(value) ? "NaN" : value < 0 ? "-Infinity" : "Infinity"; + } + + BID_UINT64 partsSignMask, partsCoefficient; + int partsExponent; + unpack_BID64(&partsSignMask, &partsExponent, &partsCoefficient, value); + + if (partsCoefficient == 0) { + std::copy(SCIENTIFIC_ZERO, SCIENTIFIC_ZERO + sizeof(SCIENTIFIC_ZERO) / sizeof(SCIENTIFIC_ZERO[0]) + 1, buffer512); + buffer512[1] = decimalMark; + return buffer512; + } + + int exponent = partsExponent - EXPONENT_BIAS; + + int bi = MAX_FORMAT_DIGITS * 2 + 2, be = bi; + while (partsCoefficient > 0) { + bi = formatUIntFromBcdTable((int)(partsCoefficient % BCD_DIVIDER), buffer512, bi); + partsCoefficient /= BCD_DIVIDER; + } + + while (buffer512[bi] == '0') + ++bi; + + exponent += be - bi - 1; + + for (int bee = MAX_FORMAT_DIGITS + bi; be < bee; ++be) + buffer512[be] = '0'; + + bi--; + buffer512[bi] = buffer512[bi + 1]; + buffer512[bi + 1] = decimalMark; + + if (value < 0) + buffer512[--bi] = '-'; + + buffer512[be++] = 'e'; + buffer512[be++] = exponent >= 0 ? '+' : '-'; + { + be += BCD_TABLE_DIGITS; + for (int j = 0, ti = std::abs(exponent) * BCD_TABLE_DIGITS /* (remainder << 1) + remainder */; j < BCD_TABLE_DIGITS; ++j, ++ti) + buffer512[be - 1 - j] = BCD_TABLE[ti]; + } + + buffer512[be] = '\0'; + return buffer512 + bi; +} diff --git a/native/NativeImplToString.h b/native/NativeImplToString.h new file mode 100644 index 00000000..719c2873 --- /dev/null +++ b/native/NativeImplToString.h @@ -0,0 +1,11 @@ +#pragma once + +#include + +BID_EXTERN_C const char * dfp64_to_string(BID_UINT64 value); +BID_EXTERN_C const char * dfp64_to_string_2(BID_UINT64 value, char decimalMark); +BID_EXTERN_C const char * dfp64_to_string_3(BID_UINT64 value, char decimalMark, char* buffer512); + +BID_EXTERN_C const char * dfp64_to_scientific_string(BID_UINT64 value); +BID_EXTERN_C const char * dfp64_to_scientific_string_2(BID_UINT64 value, char decimalMark); +BID_EXTERN_C const char * dfp64_to_scientific_string_3(BID_UINT64 value, char decimalMark, char *buffer512); diff --git a/native/demo.cpp b/native/demo.cpp new file mode 100644 index 00000000..b1fb13b3 --- /dev/null +++ b/native/demo.cpp @@ -0,0 +1,42 @@ +#include +#include +#include "DecimalNative.hpp" + +using namespace epam::deltix::dfp; + +int main(int argc, char *argv[]) { + if(argc!=4) { + std::cerr << "Usage: " << std::endl; + return -1; + } + + const Decimal64 x(argv[1]); // Parsing call example - can throw std::invalid_argument + + const char* op = argv[2]; + + std::stringstream arg3(argv[3]); // Input from stream + Decimal64 y; + arg3 >> y; + + Decimal64 z; + switch (*op) { + case '+': + z = x + y; + break; + case '-': + z = x - y; + break; + case '*': + z = x * y; + break; + case '/': + z = x / y; + break; + default: + std::cerr << "Unsupported operation '" << op << "'" << std::endl; + return 1; + } + + std::cout << x << "(=" << x.toUnderlying() << ") " << op << " " << y << "(=" << y.toUnderlying() << ") = " << z << "(=" << z.toUnderlying() << ")" << std::endl; + return 0; +} diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/CMakeLists.txt b/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/CMakeLists.txt deleted file mode 100644 index 4db0609e..00000000 --- a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_executable (demo demo.c) -target_link_libraries (demo LINK_PUBLIC bid) -install(TARGETS demo DESTINATION ./binDemo/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX}) diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/demo.c b/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/demo.c deleted file mode 100644 index 510465bd..00000000 --- a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/demo.c +++ /dev/null @@ -1,50 +0,0 @@ -#include -#include -#include -#include -#include - -int main(int argc, char *argv[]) { - BID_UINT64 x; - BID_UINT64 y; - BID_UINT64 z; - char *op; - char buff[4096]; - - if(argc!=4) { - fprintf(stderr, "Usage: \n"); - return -1; - } - - x = bid64_from_string(argv[1]); - op = argv[2]; - y = bid64_from_string(argv[3]); - - if (!strcmp(op, "+")) - z = bid64_add(x, y); - else if (!strcmp(op, "-")) - z = bid64_sub(x, y); - else if (!strcmp(op, "*")) - z = bid64_mul(x, y); - else if (!strcmp(op, "/")) - z = bid64_div(x, y); - else { - fprintf(stderr, "Unsupported operation '%s'\n", op); - return -1; - } - - bid64_to_string(buff, x); - printf("%s(=%llu)", buff, x); - - printf(" %s ", op); - - bid64_to_string(buff, y); - printf("%s(=%llu)", buff, y); - - printf(" = "); - - bid64_to_string(buff, z); - printf("%s(=%llu)\n", buff, z); - - return 0; -} diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt b/thirdparty/IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt index 8d17baa4..1c016633 100644 --- a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt +++ b/thirdparty/IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt @@ -21,7 +21,8 @@ file(GLOB ${NAME}_SRCS float128/dpml_ux_ops_64.c float128/dpml_four_over_pi.c float128/dpml_exception.c - float128/sqrt_tab_t.c) + float128/sqrt_tab_t.c + ../../../native/NativeImplToString.cpp) add_library(${NAME} STATIC ${${NAME}_SRCS}) From 34f3f9c05c3d029199a3b5541e8750d94b92d69e Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Thu, 12 Oct 2023 19:14:59 +0300 Subject: [PATCH 05/90] Cpp: Fix Linux compilation [skip ci] --- native/NativeImpl.cpp | 13 ++++++++++--- native/NativeImpl.h | 10 ++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/native/NativeImpl.cpp b/native/NativeImpl.cpp index 3eac23f0..b8dffaf9 100644 --- a/native/NativeImpl.cpp +++ b/native/NativeImpl.cpp @@ -1,17 +1,24 @@ #include #include -#include "NativeImpl.h" -#include "NativeImplToString.h" #ifdef __cplusplus extern "C" { +#endif + +#include "NativeImpl.h" +#include "NativeImplToString.h" + +#ifdef _MSC_VER +#define strcmpIgnoreCase stricmp +#else +#define strcmpIgnoreCase strcasecmp #endif //region Conversion static const uint64_t DECIMAL_NATIVE_UNDERLYING_NULL = 0xFFFFFFFFFFFFFF80ULL; // = -0x80 BID_UINT64 dfp64_try_parse(const char* str, _IDEC_flags* exception) { - if (!stricmp(str, "null")) + if (!strcmpIgnoreCase(str, "null")) return DECIMAL_NATIVE_UNDERLYING_NULL; auto ret = bid64_from_string((char*)str); if (exception) diff --git a/native/NativeImpl.h b/native/NativeImpl.h index 95ef5b70..b16aebf3 100644 --- a/native/NativeImpl.h +++ b/native/NativeImpl.h @@ -11,12 +11,6 @@ #define JAVA_PREFIX com_epam_deltix_dfp_NativeImpl_ #endif -#ifdef __cplusplus -#define DDFP_MANGLING extern "C" -#else -#define DDFP_MANGLING -#endif - #if defined(_WIN32) #define JNI_API(x) __declspec(dllexport) x __stdcall #else @@ -24,9 +18,9 @@ #endif #if defined(_WIN32) -#define DDFP_API(x) DDFP_MANGLING __declspec(dllexport) x __cdecl +#define DDFP_API(x) __declspec(dllexport) x __cdecl #else -#define DDFP_API(x) DDFP_MANGLING x __attribute__ ((externally_visible,visibility("default"))) +#define DDFP_API(x) x __attribute__ ((externally_visible,visibility("default"))) #endif /* From 97b40d11d4cd1b90175c5898a37a456d66998be7 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Thu, 12 Oct 2023 19:17:49 +0300 Subject: [PATCH 06/90] Java: Fix wrappers generation. [skip ci] --- java/nativeWrappers/build.gradle | 2 +- .../src/main/java/com/epam/deltix/dfp/NativeWrappers.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/java/nativeWrappers/build.gradle b/java/nativeWrappers/build.gradle index c0eda4ca..8a73f493 100644 --- a/java/nativeWrappers/build.gradle +++ b/java/nativeWrappers/build.gradle @@ -16,7 +16,7 @@ task makeNativeWrappersDfp(dependsOn: compileJava, type: JavaExec) { args = [ver["three"], ver["suffix"], ver["sha"], "ddfp" + ver["suffix"] + "_", "com_epam_deltix_dfp_NativeImpl_", - "$rootDir/native/NativeImpl.c", + "$rootDir/native/NativeImpl.cpp", "$rootDir/java/dfp/build/generated/sources/nativeWrappers/com/epam/deltix/dfp/NativeImpl.java", "$rootDir/csharp/EPAM.Deltix.DFP/NativeImpl.cs", "$rootDir/native" diff --git a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/NativeWrappers.java b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/NativeWrappers.java index a2bad6a2..92d17069 100644 --- a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/NativeWrappers.java +++ b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/NativeWrappers.java @@ -31,6 +31,9 @@ public static void main(final String[] args) throws IOException, InterruptedExce final String preprocess = callPreprocess(inputFile, apiPrefix, javaPrefix); final List api = collectApi(preprocess, apiPrefix); + if (api.isEmpty()) { + throw new RuntimeException("Can't collect API."); + } if (!outputCRoot.isEmpty()) { CxxWrappers.make(outputCRoot, api, apiPrefix, versionThreeDigits); From 5303b1249c3505b2952d1763a753b6a28a228343 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Thu, 12 Oct 2023 22:26:47 +0300 Subject: [PATCH 07/90] Cpp: Stash changes --- .../src/main/java/com/epam/deltix/dfp/CxxWrappers.java | 2 +- native/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java index f2150b7d..de10151d 100644 --- a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java +++ b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java @@ -292,7 +292,7 @@ public static void make(final String outputRoot, final List api, final " _value = " + fnNameC + "(" + fnCall + ");\n" + " }\n" + "\n" + - " explicit " + dfpClassType + "(const std::string &str) : this(str.c_str()) {\n" + + " explicit " + dfpClassType + "(const std::string &str) : " + dfpClassType + "(str.c_str()) {\n" + " }\n"; } diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index f67d7001..5654acfe 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -5,13 +5,13 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_IN}") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_IN}") if (TARGET) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --target=${TARGET} ${TARGET_EX} --sysroot=${SYSROOT} -I${SYSROOT}/include/c++/v1 -I/usr/${TARGET}/include") endif() -set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS}") message(STATUS "CMAKE_SYSTEM_PROCESSOR: " ${CMAKE_SYSTEM_PROCESSOR}) message(STATUS "CMAKE_C_COMPILER_TARGET: " ${CMAKE_C_COMPILER_TARGET}) From 549de7358684b8ee07eda0bea154740439d445ca Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Thu, 12 Oct 2023 23:28:21 +0300 Subject: [PATCH 08/90] Cpp: Fix wrapper generation. --- .../main/java/com/epam/deltix/dfp/CxxWrappers.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java index de10151d..89181368 100644 --- a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java +++ b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java @@ -38,24 +38,20 @@ public static void make(final String outputRoot, final List api, final "#ifdef __cplusplus\n" + "# define " + outputCDefine + "_MANGLING extern \"C\"\n" + "#else\n" + - "# define " + outputCDefine + "_MANGLING\n" + + "# define " + outputCDefine + "_MANGLING extern\n" + "#endif\n" + "\n" + "#if defined(_WIN32)\n" + - "# define " + outputCDefine + "_CALLING __stdcall\n" + + "# define " + outputCDefine + "_CALLING __cdecl\n" + "#else\n" + "# define " + outputCDefine + "_CALLING\n" + "#endif\n" + "\n" + "#ifdef " + outputCDefine + "_SHARED_LIBRARY\n" + "# ifdef _MSC_VER\n" + - "# ifdef " + outputCDefine + "_EXPORTS\n" + - "# define " + outputCDefine + "_EXPORT __declspec(dllexport)\n" + - "# else\n" + - "# define " + outputCDefine + "_EXPORT __declspec(dllimport)\n" + - "# endif\n" + + "# define " + outputCDefine + "_EXPORT __declspec(dllimport)\n" + "# else\n" + - "# define " + outputCDefine + "_EXPORT __attribute__ ((visibility(\"default\")))\n" + + "# define " + outputCDefine + "_EXPORT __attribute__ ((visibility(\"default\")))\n" + "# endif\n" + "#else\n" + "# define " + outputCDefine + "_EXPORT\n" + From 277264e716de29669d3d8c831f1aba246441c794 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Thu, 12 Oct 2023 23:42:23 +0300 Subject: [PATCH 09/90] Cpp: Fix Windows compilation [skip ci] --- native/buildWindows.bat | 52 ++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/native/buildWindows.bat b/native/buildWindows.bat index cec03a63..658b4a1b 100644 --- a/native/buildWindows.bat +++ b/native/buildWindows.bat @@ -1,24 +1,32 @@ -mkdir buildi386 -cd buildi386 -cmake -G "Visual Studio 16 2019" -A Win32 -DVERSION_SUFFIX=%1 ../ -MSBuild /p:PlatformToolset=ClangCL /p:Platform=Win32 /p:Configuration=Release /t:Rebuild ./native.sln -mkdir ..\binmath\Release\windows\i386 -move /y Release\*math*.dll ..\binmath\Release\windows\i386 -mkdir ..\bin\Release\windows\i386 -move /y Release\*.dll ..\bin\Release\windows\i386 -mkdir ..\binDemo\Release\windows\i386 -move /y EXAMPLES\Release\*.exe ..\binDemo\Release\windows\i386 +mkdir buildi386 || goto :error +cd buildi386 || goto :error +cmake -A Win32 -T ClangCL -DVERSION_SUFFIX=%1 ../ || goto :error +cmake --build . --config Release || goto :error +cmake --install . --config Release --prefix ./installation || goto :error +mkdir ..\binmath\Release\windows\i386 || goto :error +move /y Release\*math*.dll ..\binmath\Release\windows\i386 || goto :error +mkdir ..\bin\Release\windows\i386 || goto :error +move /y Release\*.dll ..\bin\Release\windows\i386 || goto :error +mkdir ..\binDemo\Release\windows\i386 || goto :error +move /y Release\*.exe ..\binDemo\Release\windows\i386 || goto :error -cd .. +cd .. || goto :error -mkdir buildamd64 -cd buildamd64 -cmake -G "Visual Studio 16 2019" -A x64 -DVERSION_SUFFIX=%1 ../ -MSBuild /p:PlatformToolset=ClangCL /p:Platform=x64 /p:Configuration=Release /t:Rebuild ./native.sln -mkdir ..\binmath\Release\windows\amd64 -move /y Release\*math*.dll ..\binmath\Release\windows\amd64 -mkdir ..\bin\Release\windows\amd64 -move /y Release\*.dll ..\bin\Release\windows\amd64 -mkdir ..\binDemo\Release\windows\amd64 -move /y EXAMPLES\Release\*.exe ..\binDemo\Release\windows\amd64 -cd .. +mkdir buildamd64 || goto :error +cd buildamd64 || goto :error +cmake -A x64 -T ClangCL -DVERSION_SUFFIX=%1 ../ || goto :error +cmake --build . --config Release || goto :error +cmake --install . --config Release --prefix ./installation || goto :error +mkdir ..\binmath\Release\windows\amd64 || goto :error +move /y Release\*math*.dll ..\binmath\Release\windows\amd64 || goto :error +mkdir ..\bin\Release\windows\amd64 || goto :error +move /y Release\*.dll ..\bin\Release\windows\amd64 || goto :error +mkdir ..\binDemo\Release\windows\amd64 || goto :error +move /y Release\*.exe ..\binDemo\Release\windows\amd64 || goto :error +cd .. || goto :error + +goto :EOF + +:error +echo Failed with error #%errorlevel%. +exit /b %errorlevel% From 1791549e6956a7d9ff8f6f3a07862c5614f5f4aa Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Fri, 13 Oct 2023 01:14:22 +0300 Subject: [PATCH 10/90] Cpp: Fix toString case generation. --- .../src/main/java/com/epam/deltix/dfp/CxxWrappers.java | 5 ++--- native/demo.cpp | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java index 89181368..268aa75f 100644 --- a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java +++ b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java @@ -216,9 +216,8 @@ public static void make(final String outputRoot, final List api, final " return *this;\n" + " }\n" + " explicit operator std::string() const {\n" + - " char str[32];\n" + - " toString(str);\n" + - " return std::string(str);\n" + + " char str[512];\n" + + " return std::string(" + decimalNativePrefix + "to_string_3(_value, '.', str));\n" + " }\n" + " friend std::ostream& operator <<(std::ostream& output, " + dfpClassType + " const& a) {\n" + " output << a._value;\n" + diff --git a/native/demo.cpp b/native/demo.cpp index b1fb13b3..9d84eea3 100644 --- a/native/demo.cpp +++ b/native/demo.cpp @@ -37,6 +37,6 @@ int main(int argc, char *argv[]) { return 1; } - std::cout << x << "(=" << x.toUnderlying() << ") " << op << " " << y << "(=" << y.toUnderlying() << ") = " << z << "(=" << z.toUnderlying() << ")" << std::endl; + std::cout << x << "(=" << x.toUnderlying() << ") " << op << " " << (std::string)y << "(=" << y.toUnderlying() << ") = " << z << "(=" << z.toUnderlying() << ")" << std::endl; return 0; } From 72af7cedcb0be1692a463573b2b8837c0ad96abd Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Mon, 16 Oct 2023 15:45:58 +0300 Subject: [PATCH 11/90] Cxx: Alpine compilation fixes --- native/CMakeLists.txt | 11 +++++------ .../IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt | 2 +- .../IntelRDFPMathLib20U2/LIBRARY/src/bid_functions.h | 3 ++- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 5654acfe..71ad8f2d 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -52,18 +52,18 @@ add_subdirectory (../thirdparty/IntelRDFPMathLib20U2/LIBRARY LIBRARY) add_library(dfp SHARED NativeImpl.cpp) target_compile_definitions(dfp PRIVATE API_PREFIX=ddfp${VERSION_SUFFIX}_ JAVA_PREFIX=com_epam_deltix_dfp_NativeImpl_ DECIMALNATIVE_SHARED_LIBRARY DECIMALNATIVE_EXPORTS) -target_link_libraries (dfp LINK_PUBLIC bid) +target_link_libraries(dfp LINK_PUBLIC bid) set_target_properties(dfp PROPERTIES OUTPUT_NAME "ddfp${VERSION_SUFFIX}") install(TARGETS dfp DESTINATION ./bin/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX}) add_library(dfpmath SHARED NativeMathImpl.c) target_compile_definitions(dfpmath PRIVATE API_PREFIX=ddfpmath${VERSION_SUFFIX}_ JAVA_PREFIX=com_epam_deltix_dfpmath_NativeMathImpl_) -target_link_libraries (dfpmath LINK_PUBLIC bid) +target_link_libraries(dfpmath LINK_PUBLIC bid) set_target_properties(dfpmath PROPERTIES OUTPUT_NAME "ddfpmath${VERSION_SUFFIX}") install(TARGETS dfpmath DESTINATION ./binmath/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX}) file(GLOB BID_SRCS_STATIC - ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/*.c + ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/*.c ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_bid.c ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_bessel.c ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_cbrt.c @@ -93,6 +93,5 @@ set_target_properties(dfpStatic PROPERTIES OUTPUT_NAME "ddfpStatic${VERSION_SUFF install(TARGETS dfpStatic DESTINATION ./bin/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX}) add_executable(demo demo.cpp) -#target_compile_definitions(demo PRIVATE DECIMALNATIVE_SHARED_LIBRARY) -#target_link_libraries (demo LINK_PUBLIC dfp) -target_link_libraries (demo LINK_PUBLIC dfpStatic) +#target_link_libraries(demo LINK_PUBLIC dfp stdc++) +target_link_libraries(demo LINK_PUBLIC dfpStatic stdc++) diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt b/thirdparty/IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt index 1c016633..aad8f71a 100644 --- a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt +++ b/thirdparty/IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt @@ -1,7 +1,7 @@ set(NAME bid) file(GLOB ${NAME}_SRCS - src/*.c + src/*.c float128/dpml_ux_bid.c float128/dpml_ux_bessel.c float128/dpml_ux_cbrt.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_functions.h b/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_functions.h index a2d0cd7d..5c86f72e 100644 --- a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_functions.h +++ b/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_functions.h @@ -40,9 +40,10 @@ #include #endif #include +#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 From d8271978711ce56a35723a17ac4b9a8a6b097730 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Mon, 16 Oct 2023 16:18:12 +0300 Subject: [PATCH 12/90] Cxx: Fix compilation --- native/CMakeLists.txt | 4 ++-- native/buildLinux.sh | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 71ad8f2d..19f01724 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -93,5 +93,5 @@ set_target_properties(dfpStatic PROPERTIES OUTPUT_NAME "ddfpStatic${VERSION_SUFF install(TARGETS dfpStatic DESTINATION ./bin/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX}) add_executable(demo demo.cpp) -#target_link_libraries(demo LINK_PUBLIC dfp stdc++) -target_link_libraries(demo LINK_PUBLIC dfpStatic stdc++) +#target_link_libraries(demo LINK_PRIVATE dfp stdc++) +target_link_libraries(demo LINK_PRIVATE dfpStatic stdc++) diff --git a/native/buildLinux.sh b/native/buildLinux.sh index 5bcd7bf6..3b0731a8 100755 --- a/native/buildLinux.sh +++ b/native/buildLinux.sh @@ -24,7 +24,11 @@ cmake -G "Unix Makefiles" -DVERSION_SUFFIX=$1 -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE make install rm -rf ./* -cmake -G "Unix Makefiles" -DVERSION_SUFFIX=$1 -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE -DCMAKE_C_COMPILER=musl-gcc -DCMAKE_CXX_COMPILER=musl-gcc -DCMAKE_C_FLAGS_IN=-static -DCMAKE_INSTALL_PREFIX=../ -DINSTALL_SUFFIX=linux/amd64 ../ +cmake -G "Unix Makefiles" -DVERSION_SUFFIX=$1 -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE -DCMAKE_C_COMPILER=$CCOMPILER -DCMAKE_CXX_COMPILER=$CXXCOMPILER -DCMAKE_INSTALL_PREFIX=../ -DINSTALL_SUFFIX=linux/amd64 ../ +make install + +rm -rf ./* +cmake -G "Unix Makefiles" -DVERSION_SUFFIX=$1 -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE -DCMAKE_C_COMPILER=musl-gcc -DCMAKE_CXX_COMPILER=musl-gcc -DCMAKE_C_FLAGS_IN=-static -DCMAKE_INSTALL_PREFIX=../ -DINSTALL_SUFFIX=linux/amd64/musl-gcc ../ make install cd .. From 3882288224f3dc6b58a0ea801047dc649d20c895 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Mon, 16 Oct 2023 18:59:31 +0300 Subject: [PATCH 13/90] Cxx: Initial version of the sources form C++ to C migration. --- java/nativeWrappers/build.gradle | 2 +- native/CMakeLists.txt | 8 +- native/NativeImpl.c | 161 +++++++++++++++++ native/NativeImpl.cpp | 169 ------------------ ...eImplToString.cpp => NativeImplToString.c} | 30 ++-- .../LIBRARY/CMakeLists.txt | 2 +- 6 files changed, 185 insertions(+), 187 deletions(-) create mode 100644 native/NativeImpl.c delete mode 100644 native/NativeImpl.cpp rename native/{NativeImplToString.cpp => NativeImplToString.c} (91%) diff --git a/java/nativeWrappers/build.gradle b/java/nativeWrappers/build.gradle index 8a73f493..c0eda4ca 100644 --- a/java/nativeWrappers/build.gradle +++ b/java/nativeWrappers/build.gradle @@ -16,7 +16,7 @@ task makeNativeWrappersDfp(dependsOn: compileJava, type: JavaExec) { args = [ver["three"], ver["suffix"], ver["sha"], "ddfp" + ver["suffix"] + "_", "com_epam_deltix_dfp_NativeImpl_", - "$rootDir/native/NativeImpl.cpp", + "$rootDir/native/NativeImpl.c", "$rootDir/java/dfp/build/generated/sources/nativeWrappers/com/epam/deltix/dfp/NativeImpl.java", "$rootDir/csharp/EPAM.Deltix.DFP/NativeImpl.cs", "$rootDir/native" diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 19f01724..6576b6e2 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -50,7 +50,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) add_subdirectory (../thirdparty/IntelRDFPMathLib20U2/LIBRARY LIBRARY) -add_library(dfp SHARED NativeImpl.cpp) +add_library(dfp SHARED NativeImpl.c) target_compile_definitions(dfp PRIVATE API_PREFIX=ddfp${VERSION_SUFFIX}_ JAVA_PREFIX=com_epam_deltix_dfp_NativeImpl_ DECIMALNATIVE_SHARED_LIBRARY DECIMALNATIVE_EXPORTS) target_link_libraries(dfp LINK_PUBLIC bid) set_target_properties(dfp PROPERTIES OUTPUT_NAME "ddfp${VERSION_SUFFIX}") @@ -84,9 +84,9 @@ file(GLOB BID_SRCS_STATIC ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_four_over_pi.c ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exception.c ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/sqrt_tab_t.c - NativeImplToString.cpp) + NativeImplToString.c) -add_library(dfpStatic STATIC NativeImpl.cpp ${BID_SRCS_STATIC}) +add_library(dfpStatic STATIC NativeImpl.c ${BID_SRCS_STATIC}) include_directories(../thirdparty/IntelRDFPMathLib20U2/LIBRARY/src) target_compile_definitions(dfpStatic PRIVATE API_PREFIX=ddfp${VERSION_SUFFIX}_ NOJAVA) set_target_properties(dfpStatic PROPERTIES OUTPUT_NAME "ddfpStatic${VERSION_SUFFIX}") @@ -94,4 +94,4 @@ install(TARGETS dfpStatic DESTINATION ./bin/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX add_executable(demo demo.cpp) #target_link_libraries(demo LINK_PRIVATE dfp stdc++) -target_link_libraries(demo LINK_PRIVATE dfpStatic stdc++) +target_link_libraries(demo LINK_PRIVATE dfpStatic) # stdc++) diff --git a/native/NativeImpl.c b/native/NativeImpl.c new file mode 100644 index 00000000..b10d51c5 --- /dev/null +++ b/native/NativeImpl.c @@ -0,0 +1,161 @@ +#include +#include + +#include "NativeImpl.h" +#include "NativeImplToString.h" + +#ifdef _MSC_VER +#define strcmpIgnoreCase stricmp +#else +#define strcmpIgnoreCase strcasecmp +#endif + +//region Conversion +static const uint64_t DECIMAL_NATIVE_UNDERLYING_NULL = 0xFFFFFFFFFFFFFF80ULL; // = -0x80 + +BID_UINT64 dfp64_try_parse(const char* str, _IDEC_flags* exception) { + if (!strcmpIgnoreCase(str, "null")) + return DECIMAL_NATIVE_UNDERLYING_NULL; + auto ret = bid64_from_string((char*)str); + if (exception) + *exception = _IDEC_glbflags; + return ret; +} + +BID_UINT64 dfp64_parse(const char* str) { + return dfp64_try_parse(str, 0 /*nullptr*/); +} + +OPN(fromFloat64, binary64_to_bid64(x), double x) +OPN(fromFloat32, binary32_to_bid64(x), float x) +OPN(fromInt64, bid64_from_int64(x), int64 x) +OPN(fromUInt64, bid64_from_uint64(x), uint64 x) +OPNR(toFloat64, double, bid64_to_binary64(x), BID_UINT64 x) +OPNR(toFloat32, float, bid64_to_binary32(x), BID_UINT64 x) +OPNR(toInt64, int64, bid64_to_int64_xint(x), BID_UINT64 x) +OPNR(toUInt64, uint64, bid64_to_uint64_xint(x), BID_UINT64 x) +OPN(fromFixedPoint64, bid64_scalbn(bid64_from_int64(mantissa), -tenPowerFactor), int64 mantissa, int32 tenPowerFactor) +OPNR(toFixedPoint, int64, bid64_to_int64_xint(bid64_scalbn(value, numberOfDigits)), BID_UINT64 value, int32 numberOfDigits) + +OPN(parse, dfp64_parse(str), const char* str) +OPN(tryParse, dfp64_try_parse(str, exception), const char* str, uint32* exception) + +OPNR(to_string, const char*, dfp64_to_string(x), BID_UINT64 x) +OPNR(to_string_2, const char*, dfp64_to_string_2(x, decimalMark), BID_UINT64 x, char decimalMark) +OPNR(to_string_3, const char*, dfp64_to_string_3(x, decimalMark, buffer512), BID_UINT64 x, char decimalMark, char* buffer512) + +OPNR(to_scientific_string, const char*, dfp64_to_scientific_string(x), BID_UINT64 x) +OPNR(to_scientific_string_2, const char*, dfp64_to_scientific_string_2(x, decimalMark), BID_UINT64 x, char decimalMark) +OPNR(to_scientific_string_3, const char*, dfp64_to_scientific_string_3(x, decimalMark, buffer512), BID_UINT64 x, char decimalMark, char* buffer512) + + +//endregion + +//region Classification + +OPN_BOOL(isNaN, bid64_isNaN(x), BID_UINT64 x) +OPN_BOOL(isInfinity, bid64_isInf(x), BID_UINT64 x) +OPN_BOOL(isPositiveInfinity, (intBool)(bid64_isInf(x) && !bid64_isSigned(x)), BID_UINT64 x) +OPN_BOOL(isNegativeInfinity, (intBool)(bid64_isInf(x) && bid64_isSigned(x)), BID_UINT64 x) +OPN_BOOL(isFinite, bid64_isFinite(x), BID_UINT64 x) +OPN_BOOL(isNormal, bid64_isNormal(x), BID_UINT64 x) +OPN_BOOL(signBit, bid64_isSigned(x), BID_UINT64 x) + +//endregion + +//region Comparison + +DDFP_API(int32) PPCAT(API_PREFIX, compare) (BID_UINT64 a, BID_UINT64 b) { + if (bid64_quiet_less(a, b)) + return -1; + if (bid64_quiet_greater(a, b)) + return 1; + if (bid64_quiet_equal(a, b)) + return 0; + return bid64_isNaN(b) - bid64_isNaN(a); +} +JAVA_API_IMPL( + JNI_API(int32) PPCAT(PPCAT(Java_, JAVA_PREFIX), compare) (void* jEnv, void* jClass, BID_UINT64 a, BID_UINT64 b) { + if (bid64_quiet_less(a, b)) + return -1; + if (bid64_quiet_greater(a, b)) + return 1; + if (bid64_quiet_equal(a, b)) + return 0; + return bid64_isNaN(a) - bid64_isNaN(b); + } + JNI_API(int32) PPCAT(PPCAT(JavaCritical_, JAVA_PREFIX), compare) (BID_UINT64 a, BID_UINT64 b) { + if (bid64_quiet_less(a, b)) + return -1; + if (bid64_quiet_greater(a, b)) + return 1; + if (bid64_quiet_equal(a, b)) + return 0; + return bid64_isNaN(a) - bid64_isNaN(b); + } +) + +OPN_BOOL(isEqual, bid64_quiet_equal(a, b), BID_UINT64 a, BID_UINT64 b) +OPN_BOOL(isNotEqual, bid64_quiet_not_equal(a, b), BID_UINT64 a, BID_UINT64 b) +OPN_BOOL(isLess, bid64_quiet_less(a, b), BID_UINT64 a, BID_UINT64 b) +OPN_BOOL(isLessOrEqual, bid64_quiet_less_equal(a, b), BID_UINT64 a, BID_UINT64 b) +OPN_BOOL(isGreater, bid64_quiet_greater(a, b), BID_UINT64 a, BID_UINT64 b) +OPN_BOOL(isGreaterOrEqual, bid64_quiet_greater_equal(a, b), BID_UINT64 a, BID_UINT64 b) +OPN_BOOL(isZero, bid64_isZero(a), BID_UINT64 a) +OPN_BOOL(isNonZero, bid64_quiet_not_equal(a, zeroConst), BID_UINT64 a) +OPN_BOOL(isPositive, bid64_quiet_greater(a, zeroConst), BID_UINT64 a) +OPN_BOOL(isNegative, bid64_quiet_less(a, zeroConst), BID_UINT64 a) +OPN_BOOL(isNonPositive, bid64_quiet_less_equal(a, zeroConst), BID_UINT64 a) +OPN_BOOL(isNonNegative, bid64_quiet_greater_equal(a, zeroConst), BID_UINT64 a) + +//endregion + +//region Rounding + +OPN(roundTowardsPositiveInfinity, bid64_round_integral_positive(x), BID_UINT64 x) +OPN(roundTowardsNegativeInfinity, bid64_round_integral_negative(x), BID_UINT64 x) +OPN(roundTowardsZero, bid64_round_integral_zero(x), BID_UINT64 x) +OPN(roundToNearestTiesAwayFromZero, bid64_round_integral_nearest_away(x), BID_UINT64 x) +OPN(roundToNearestTiesToEven, bid64_round_integral_nearest_even(x), BID_UINT64 x) + +//endregion + +//region Minimum & Maximum + +OPN(max2, bid64_isNaN(a) || bid64_isNaN(b) ? nanConst : bid64_maxnum(a, b), BID_UINT64 a, BID_UINT64 b) +OPN(max3, bid64_isNaN(a) || bid64_isNaN(b) || bid64_isNaN(c) ? nanConst : bid64_maxnum(bid64_maxnum(a, b), c), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c) +OPN(max4, bid64_isNaN(a) || bid64_isNaN(b) || bid64_isNaN(c) || bid64_isNaN(d) ? nanConst : bid64_maxnum(bid64_maxnum(a, b), bid64_maxnum(c, d)), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c, BID_UINT64 d) +OPN(min2, bid64_isNaN(a) || bid64_isNaN(b) ? nanConst : bid64_minnum(a, b), BID_UINT64 a, BID_UINT64 b) +OPN(min3, bid64_isNaN(a) || bid64_isNaN(b) || bid64_isNaN(c) ? nanConst : bid64_minnum(bid64_minnum(a, b), c), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c) +OPN(min4, bid64_isNaN(a) || bid64_isNaN(b) || bid64_isNaN(c) || bid64_isNaN(d) ? nanConst : bid64_minnum(bid64_minnum(a, b), bid64_minnum(c, d)), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c, BID_UINT64 d) + +//endregion + +//region Arithmetic + +OPN(negate, bid64_negate(x), BID_UINT64 x) +OPN(abs, bid64_abs(x), BID_UINT64 x) +OPN(add2, bid64_add(a, b), BID_UINT64 a, BID_UINT64 b) +OPN(add3, bid64_add(bid64_add(a, b), c), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c) +OPN(add4, bid64_add(bid64_add(a, b), bid64_add(c, d)), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c, BID_UINT64 d) +OPN(subtract, bid64_sub(a, b), BID_UINT64 a, BID_UINT64 b) +OPN(multiply2, bid64_mul(a, b), BID_UINT64 a, BID_UINT64 b) +OPN(multiply3, bid64_mul(bid64_mul(a, b), c), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c) +OPN(multiply4, bid64_mul(bid64_mul(a, b), bid64_mul(c, d)), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c, BID_UINT64 d) +OPN(multiplyByInt32, bid64_mul(a, bid64_from_int32(integer)), BID_UINT64 a, int32 integer) +OPN(multiplyByInt64, bid64_mul(a, bid64_from_int64(integer)), BID_UINT64 a, int64 integer) +OPN(divide, bid64_div(a, b), BID_UINT64 a, BID_UINT64 b) +OPN(divideByInt32, bid64_div(x, bid64_from_int32(integer)), BID_UINT64 x, int32 integer) +OPN(divideByInt64, bid64_div(x, bid64_from_int64(integer)), BID_UINT64 x, int64 integer) +OPN(multiplyAndAdd, bid64_fma(a, b, c), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c) +OPN(scaleByPowerOfTen, bid64_scalbn(a, n), BID_UINT64 a, int32 n) +OPN(mean2, bid64_div(bid64_add(a, b), twoConst), BID_UINT64 a, BID_UINT64 b) + +//endregion + +//region Special + +OPN(nextUp, bid64_nextup(x), BID_UINT64 x) +OPN(nextDown, bid64_nextdown(x), BID_UINT64 x) + +//endregion diff --git a/native/NativeImpl.cpp b/native/NativeImpl.cpp deleted file mode 100644 index b8dffaf9..00000000 --- a/native/NativeImpl.cpp +++ /dev/null @@ -1,169 +0,0 @@ -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#include "NativeImpl.h" -#include "NativeImplToString.h" - -#ifdef _MSC_VER -#define strcmpIgnoreCase stricmp -#else -#define strcmpIgnoreCase strcasecmp -#endif - - //region Conversion - static const uint64_t DECIMAL_NATIVE_UNDERLYING_NULL = 0xFFFFFFFFFFFFFF80ULL; // = -0x80 - - BID_UINT64 dfp64_try_parse(const char* str, _IDEC_flags* exception) { - if (!strcmpIgnoreCase(str, "null")) - return DECIMAL_NATIVE_UNDERLYING_NULL; - auto ret = bid64_from_string((char*)str); - if (exception) - *exception = _IDEC_glbflags; - return ret; - } - - BID_UINT64 dfp64_parse(const char* str) { - return dfp64_try_parse(str, nullptr); - } - - OPN(fromFloat64, binary64_to_bid64(x), double x) - OPN(fromFloat32, binary32_to_bid64(x), float x) - OPN(fromInt64, bid64_from_int64(x), int64 x) - OPN(fromUInt64, bid64_from_uint64(x), uint64 x) - OPNR(toFloat64, double, bid64_to_binary64(x), BID_UINT64 x) - OPNR(toFloat32, float, bid64_to_binary32(x), BID_UINT64 x) - OPNR(toInt64, int64, bid64_to_int64_xint(x), BID_UINT64 x) - OPNR(toUInt64, uint64, bid64_to_uint64_xint(x), BID_UINT64 x) - OPN(fromFixedPoint64, bid64_scalbn(bid64_from_int64(mantissa), -tenPowerFactor), int64 mantissa, int32 tenPowerFactor) - OPNR(toFixedPoint, int64, bid64_to_int64_xint(bid64_scalbn(value, numberOfDigits)), BID_UINT64 value, int32 numberOfDigits) - - OPN(parse, dfp64_parse(str), const char* str) - OPN(tryParse, dfp64_try_parse(str, exception), const char* str, uint32* exception) - - OPNR(to_string, const char*, dfp64_to_string(x), BID_UINT64 x) - OPNR(to_string_2, const char*, dfp64_to_string_2(x, decimalMark), BID_UINT64 x, char decimalMark) - OPNR(to_string_3, const char*, dfp64_to_string_3(x, decimalMark, buffer512), BID_UINT64 x, char decimalMark, char* buffer512) - - OPNR(to_scientific_string, const char*, dfp64_to_scientific_string(x), BID_UINT64 x) - OPNR(to_scientific_string_2, const char*, dfp64_to_scientific_string_2(x, decimalMark), BID_UINT64 x, char decimalMark) - OPNR(to_scientific_string_3, const char*, dfp64_to_scientific_string_3(x, decimalMark, buffer512), BID_UINT64 x, char decimalMark, char* buffer512) - - - //endregion - - //region Classification - - OPN_BOOL(isNaN, bid64_isNaN(x), BID_UINT64 x) - OPN_BOOL(isInfinity, bid64_isInf(x), BID_UINT64 x) - OPN_BOOL(isPositiveInfinity, (intBool)(bid64_isInf(x) && !bid64_isSigned(x)), BID_UINT64 x) - OPN_BOOL(isNegativeInfinity, (intBool)(bid64_isInf(x) && bid64_isSigned(x)), BID_UINT64 x) - OPN_BOOL(isFinite, bid64_isFinite(x), BID_UINT64 x) - OPN_BOOL(isNormal, bid64_isNormal(x), BID_UINT64 x) - OPN_BOOL(signBit, bid64_isSigned(x), BID_UINT64 x) - - //endregion - - //region Comparison - - DDFP_API(int32) PPCAT(API_PREFIX, compare) (BID_UINT64 a, BID_UINT64 b) { - if (bid64_quiet_less(a, b)) - return -1; - if (bid64_quiet_greater(a, b)) - return 1; - if (bid64_quiet_equal(a, b)) - return 0; - return bid64_isNaN(b) - bid64_isNaN(a); - } - JAVA_API_IMPL( - JNI_API(int32) PPCAT(PPCAT(Java_, JAVA_PREFIX), compare) (void* jEnv, void* jClass, BID_UINT64 a, BID_UINT64 b) { - if (bid64_quiet_less(a, b)) - return -1; - if (bid64_quiet_greater(a, b)) - return 1; - if (bid64_quiet_equal(a, b)) - return 0; - return bid64_isNaN(a) - bid64_isNaN(b); - } - JNI_API(int32) PPCAT(PPCAT(JavaCritical_, JAVA_PREFIX), compare) (BID_UINT64 a, BID_UINT64 b) { - if (bid64_quiet_less(a, b)) - return -1; - if (bid64_quiet_greater(a, b)) - return 1; - if (bid64_quiet_equal(a, b)) - return 0; - return bid64_isNaN(a) - bid64_isNaN(b); - } - ) - - OPN_BOOL(isEqual, bid64_quiet_equal(a, b), BID_UINT64 a, BID_UINT64 b) - OPN_BOOL(isNotEqual, bid64_quiet_not_equal(a, b), BID_UINT64 a, BID_UINT64 b) - OPN_BOOL(isLess, bid64_quiet_less(a, b), BID_UINT64 a, BID_UINT64 b) - OPN_BOOL(isLessOrEqual, bid64_quiet_less_equal(a, b), BID_UINT64 a, BID_UINT64 b) - OPN_BOOL(isGreater, bid64_quiet_greater(a, b), BID_UINT64 a, BID_UINT64 b) - OPN_BOOL(isGreaterOrEqual, bid64_quiet_greater_equal(a, b), BID_UINT64 a, BID_UINT64 b) - OPN_BOOL(isZero, bid64_isZero(a), BID_UINT64 a) - OPN_BOOL(isNonZero, bid64_quiet_not_equal(a, zeroConst), BID_UINT64 a) - OPN_BOOL(isPositive, bid64_quiet_greater(a, zeroConst), BID_UINT64 a) - OPN_BOOL(isNegative, bid64_quiet_less(a, zeroConst), BID_UINT64 a) - OPN_BOOL(isNonPositive, bid64_quiet_less_equal(a, zeroConst), BID_UINT64 a) - OPN_BOOL(isNonNegative, bid64_quiet_greater_equal(a, zeroConst), BID_UINT64 a) - - //endregion - - //region Rounding - - OPN(roundTowardsPositiveInfinity, bid64_round_integral_positive(x), BID_UINT64 x) - OPN(roundTowardsNegativeInfinity, bid64_round_integral_negative(x), BID_UINT64 x) - OPN(roundTowardsZero, bid64_round_integral_zero(x), BID_UINT64 x) - OPN(roundToNearestTiesAwayFromZero, bid64_round_integral_nearest_away(x), BID_UINT64 x) - OPN(roundToNearestTiesToEven, bid64_round_integral_nearest_even(x), BID_UINT64 x) - - //endregion - - //region Minimum & Maximum - - OPN(max2, bid64_isNaN(a) || bid64_isNaN(b) ? nanConst : bid64_maxnum(a, b), BID_UINT64 a, BID_UINT64 b) - OPN(max3, bid64_isNaN(a) || bid64_isNaN(b) || bid64_isNaN(c) ? nanConst : bid64_maxnum(bid64_maxnum(a, b), c), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c) - OPN(max4, bid64_isNaN(a) || bid64_isNaN(b) || bid64_isNaN(c) || bid64_isNaN(d) ? nanConst : bid64_maxnum(bid64_maxnum(a, b), bid64_maxnum(c, d)), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c, BID_UINT64 d) - OPN(min2, bid64_isNaN(a) || bid64_isNaN(b) ? nanConst : bid64_minnum(a, b), BID_UINT64 a, BID_UINT64 b) - OPN(min3, bid64_isNaN(a) || bid64_isNaN(b) || bid64_isNaN(c) ? nanConst : bid64_minnum(bid64_minnum(a, b), c), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c) - OPN(min4, bid64_isNaN(a) || bid64_isNaN(b) || bid64_isNaN(c) || bid64_isNaN(d) ? nanConst : bid64_minnum(bid64_minnum(a, b), bid64_minnum(c, d)), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c, BID_UINT64 d) - - //endregion - - //region Arithmetic - - OPN(negate, bid64_negate(x), BID_UINT64 x) - OPN(abs, bid64_abs(x), BID_UINT64 x) - OPN(add2, bid64_add(a, b), BID_UINT64 a, BID_UINT64 b) - OPN(add3, bid64_add(bid64_add(a, b), c), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c) - OPN(add4, bid64_add(bid64_add(a, b), bid64_add(c, d)), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c, BID_UINT64 d) - OPN(subtract, bid64_sub(a, b), BID_UINT64 a, BID_UINT64 b) - OPN(multiply2, bid64_mul(a, b), BID_UINT64 a, BID_UINT64 b) - OPN(multiply3, bid64_mul(bid64_mul(a, b), c), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c) - OPN(multiply4, bid64_mul(bid64_mul(a, b), bid64_mul(c, d)), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c, BID_UINT64 d) - OPN(multiplyByInt32, bid64_mul(a, bid64_from_int32(integer)), BID_UINT64 a, int32 integer) - OPN(multiplyByInt64, bid64_mul(a, bid64_from_int64(integer)), BID_UINT64 a, int64 integer) - OPN(divide, bid64_div(a, b), BID_UINT64 a, BID_UINT64 b) - OPN(divideByInt32, bid64_div(x, bid64_from_int32(integer)), BID_UINT64 x, int32 integer) - OPN(divideByInt64, bid64_div(x, bid64_from_int64(integer)), BID_UINT64 x, int64 integer) - OPN(multiplyAndAdd, bid64_fma(a, b, c), BID_UINT64 a, BID_UINT64 b, BID_UINT64 c) - OPN(scaleByPowerOfTen, bid64_scalbn(a, n), BID_UINT64 a, int32 n) - OPN(mean2, bid64_div(bid64_add(a, b), twoConst), BID_UINT64 a, BID_UINT64 b) - - //endregion - - //region Special - - OPN(nextUp, bid64_nextup(x), BID_UINT64 x) - OPN(nextDown, bid64_nextdown(x), BID_UINT64 x) - - //endregion - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/native/NativeImplToString.cpp b/native/NativeImplToString.c similarity index 91% rename from native/NativeImplToString.cpp rename to native/NativeImplToString.c index c4a875e2..d4b6d556 100644 --- a/native/NativeImplToString.cpp +++ b/native/NativeImplToString.c @@ -1,8 +1,7 @@ #include "NativeImpl.h" #include -#include -#include -#include +#include +#include #include "NativeImplToString.h" static const BID_UINT64 DFP_NAN_NULL = 0xFFFFFFFFFFFFFF80ull; // = -0x80L; @@ -28,16 +27,18 @@ static const int BCD_TABLE_DIGITS = 3; static const int BCD_DIVIDER = 1000000000; static const int BCD_DIVIDER_GROUPS = 3; // log10(BCD_DIVIDER) / BCD_TABLE_DIGITS must be natural value -std::vector makeBcdTable(int tenPowerMaxIndex) { +char* makeBcdTable(int tenPowerMaxIndex) { int n = 1; for (int i = 0; i < tenPowerMaxIndex; ++i) n *= 10; - std::vector table(n * tenPowerMaxIndex); + char *table = (char *)malloc(n * tenPowerMaxIndex * sizeof(char)); + if (!table) + return 0; - std::vector value(tenPowerMaxIndex); + char value[tenPowerMaxIndex]; - std::fill(value.begin(), value.end(), '0'); + memset(value, '0', tenPowerMaxIndex * sizeof(char)); for (int i = 0, ib = 0; i < n; ++i) { for (int j = 0; j < tenPowerMaxIndex; ++j) @@ -56,9 +57,12 @@ std::vector makeBcdTable(int tenPowerMaxIndex) { return table; } -static const std::vector BCD_TABLE = makeBcdTable(BCD_TABLE_DIGITS); +static const char* BCD_TABLE; // makeBcdTable(BCD_TABLE_DIGITS); int formatUIntFromBcdTable(int value, char* buffer, int bi) { + if (!BCD_TABLE) + BCD_TABLE = makeBcdTable(BCD_TABLE_DIGITS); + for (int blockIndex = 0; blockIndex < BCD_DIVIDER_GROUPS; ++blockIndex) { int newValue = (int)((unsigned long long)(2199023256ull * value) >> 41); int remainder = value - newValue * 1000; @@ -101,9 +105,8 @@ int numberOfDigits(BID_UINT64 value) { return 19; } - static const int bufferMinLength = 511; -static thread_local char tls_to_string_buffer[bufferMinLength + 1]; +_Thread_local char tls_to_string_buffer[bufferMinLength + 1]; BID_EXTERN_C const char* dfp64_to_string(BID_UINT64 value) { return dfp64_to_string_2(value, '.'); @@ -259,7 +262,7 @@ BID_EXTERN_C const char* dfp64_to_scientific_string_3(BID_UINT64 value, char dec unpack_BID64(&partsSignMask, &partsExponent, &partsCoefficient, value); if (partsCoefficient == 0) { - std::copy(SCIENTIFIC_ZERO, SCIENTIFIC_ZERO + sizeof(SCIENTIFIC_ZERO) / sizeof(SCIENTIFIC_ZERO[0]) + 1, buffer512); + memcpy(buffer512, SCIENTIFIC_ZERO, sizeof(SCIENTIFIC_ZERO) / sizeof(SCIENTIFIC_ZERO[0]) + 1); buffer512[1] = decimalMark; return buffer512; } @@ -290,8 +293,11 @@ BID_EXTERN_C const char* dfp64_to_scientific_string_3(BID_UINT64 value, char dec buffer512[be++] = 'e'; buffer512[be++] = exponent >= 0 ? '+' : '-'; { + if (!BCD_TABLE) + BCD_TABLE = makeBcdTable(BCD_TABLE_DIGITS); + be += BCD_TABLE_DIGITS; - for (int j = 0, ti = std::abs(exponent) * BCD_TABLE_DIGITS /* (remainder << 1) + remainder */; j < BCD_TABLE_DIGITS; ++j, ++ti) + for (int j = 0, ti = abs(exponent) * BCD_TABLE_DIGITS /* (remainder << 1) + remainder */; j < BCD_TABLE_DIGITS; ++j, ++ti) buffer512[be - 1 - j] = BCD_TABLE[ti]; } diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt b/thirdparty/IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt index aad8f71a..5be17ab3 100644 --- a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt +++ b/thirdparty/IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt @@ -22,7 +22,7 @@ file(GLOB ${NAME}_SRCS float128/dpml_four_over_pi.c float128/dpml_exception.c float128/sqrt_tab_t.c - ../../../native/NativeImplToString.cpp) + ../../../native/NativeImplToString.c) add_library(${NAME} STATIC ${${NAME}_SRCS}) From 716d8c88293c9c547ab224c63295a05cc0a2816f Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Mon, 16 Oct 2023 19:53:22 +0300 Subject: [PATCH 14/90] Cxx: Fix compilation --- native/CMakeLists.txt | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 6576b6e2..4f89c306 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -2,17 +2,18 @@ cmake_minimum_required (VERSION 2.8.12) project (native) if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE Release) + set(CMAKE_BUILD_TYPE Release) endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_IN}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_IN}") if (TARGET) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --target=${TARGET} ${TARGET_EX} --sysroot=${SYSROOT} -I${SYSROOT}/include/c++/v1 -I/usr/${TARGET}/include") + set(TARGET_FLAGS "--target=${TARGET} ${TARGET_EX} --sysroot=${SYSROOT} -I${SYSROOT}/include/c++/v1 -I/usr/${TARGET}/include") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TARGET_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TARGET_FLAGS}") endif() -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS}") - message(STATUS "CMAKE_SYSTEM_PROCESSOR: " ${CMAKE_SYSTEM_PROCESSOR}) message(STATUS "CMAKE_C_COMPILER_TARGET: " ${CMAKE_C_COMPILER_TARGET}) message(STATUS "CMAKE_CXX_COMPILER_TARGET: " ${CMAKE_CXX_COMPILER_TARGET}) @@ -48,6 +49,13 @@ add_definitions(-DDECIMAL_GLOBAL_EXCEPTION_FLAGS=${GLOBAL_FLAGS}) #set(CMAKE_VISIBILITY_INLINES_HIDDEN 0) set(CMAKE_POSITION_INDEPENDENT_CODE ON) +if (MSVC) + add_definitions(-D_CRT_SECURE_NO_DEPRECATE) + add_definitions(-D_SCL_SECURE_NO_DEPRECATE) + add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) + add_definitions(-DNOMINMAX) +endif() + add_subdirectory (../thirdparty/IntelRDFPMathLib20U2/LIBRARY LIBRARY) add_library(dfp SHARED NativeImpl.c) @@ -94,4 +102,8 @@ install(TARGETS dfpStatic DESTINATION ./bin/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX add_executable(demo demo.cpp) #target_link_libraries(demo LINK_PRIVATE dfp stdc++) -target_link_libraries(demo LINK_PRIVATE dfpStatic) # stdc++) +if (MSVC) + target_link_libraries(demo LINK_PRIVATE dfpStatic) +else() + target_link_libraries(demo LINK_PRIVATE dfpStatic stdc++) +endif() From a15cb02d068aafa3fdb203f05957f6bc4f55fe89 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Mon, 16 Oct 2023 20:31:18 +0300 Subject: [PATCH 15/90] Cxx: Fix compilation --- native/CMakeLists.txt | 14 ++++++++------ native/NativeImplToString.c | 7 +++++-- native/buildLinux.sh | 12 +++++++----- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 4f89c306..108631b5 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -100,10 +100,12 @@ target_compile_definitions(dfpStatic PRIVATE API_PREFIX=ddfp${VERSION_SUFFIX}_ N set_target_properties(dfpStatic PROPERTIES OUTPUT_NAME "ddfpStatic${VERSION_SUFFIX}") install(TARGETS dfpStatic DESTINATION ./bin/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX}) -add_executable(demo demo.cpp) -#target_link_libraries(demo LINK_PRIVATE dfp stdc++) -if (MSVC) - target_link_libraries(demo LINK_PRIVATE dfpStatic) -else() - target_link_libraries(demo LINK_PRIVATE dfpStatic stdc++) +if (NOT CMAKE_C_COMPILER_ID STREQUAL "GNU") + add_executable(demo demo.cpp) + #target_link_libraries(demo LINK_PRIVATE dfp stdc++) + if (MSVC) + target_link_libraries(demo LINK_PRIVATE dfpStatic) + else() + target_link_libraries(demo LINK_PRIVATE dfpStatic stdc++) + endif() endif() diff --git a/native/NativeImplToString.c b/native/NativeImplToString.c index d4b6d556..e46e19c4 100644 --- a/native/NativeImplToString.c +++ b/native/NativeImplToString.c @@ -2,6 +2,8 @@ #include #include #include +#include +#include #include "NativeImplToString.h" static const BID_UINT64 DFP_NAN_NULL = 0xFFFFFFFFFFFFFF80ull; // = -0x80L; @@ -105,8 +107,9 @@ int numberOfDigits(BID_UINT64 value) { return 19; } -static const int bufferMinLength = 511; -_Thread_local char tls_to_string_buffer[bufferMinLength + 1]; +#define bufferMinLength 511 +#define bufferMinLengthWithZero 512 +static _Thread_local char tls_to_string_buffer[bufferMinLengthWithZero]; BID_EXTERN_C const char* dfp64_to_string(BID_UINT64 value) { return dfp64_to_string_2(value, '.'); diff --git a/native/buildLinux.sh b/native/buildLinux.sh index 3b0731a8..17a562f4 100755 --- a/native/buildLinux.sh +++ b/native/buildLinux.sh @@ -3,8 +3,8 @@ set -Eeuo pipefail set -x CCOMPILER=${2:-clang} -CXXCOMPILER=${2:-clang} -VERBOSE=${3:-ON} +CXXCOMPILER=${3:-clang} +VERBOSE=${4:-ON} rm -rf ./build mkdir build @@ -25,11 +25,13 @@ make install rm -rf ./* cmake -G "Unix Makefiles" -DVERSION_SUFFIX=$1 -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE -DCMAKE_C_COMPILER=$CCOMPILER -DCMAKE_CXX_COMPILER=$CXXCOMPILER -DCMAKE_INSTALL_PREFIX=../ -DINSTALL_SUFFIX=linux/amd64 ../ -make install +cmake --build . --config Release +cmake --install . --config Release rm -rf ./* -cmake -G "Unix Makefiles" -DVERSION_SUFFIX=$1 -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE -DCMAKE_C_COMPILER=musl-gcc -DCMAKE_CXX_COMPILER=musl-gcc -DCMAKE_C_FLAGS_IN=-static -DCMAKE_INSTALL_PREFIX=../ -DINSTALL_SUFFIX=linux/amd64/musl-gcc ../ -make install +cmake -G "Unix Makefiles" -DVERSION_SUFFIX=$1 -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE -DCMAKE_C_COMPILER=musl-gcc -DCMAKE_CXX_COMPILER=musl-gcc -DCMAKE_C_FLAGS_IN=-static -DCMAKE_CXX_FLAGS_IN=-static -DCMAKE_INSTALL_PREFIX=../ -DINSTALL_SUFFIX=linux/amd64/musl-gcc ../ +cmake --build . --config Release +cmake --install . --config Release cd .. rm -rf ./build From 4001b274cd8bbeedc884f5817e4eda9e38d449bf Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Mon, 16 Oct 2023 21:37:46 +0300 Subject: [PATCH 16/90] Cxx: fix compilation --- native/NativeImpl.c | 2 +- native/NativeImpl.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/native/NativeImpl.c b/native/NativeImpl.c index b10d51c5..3181e73a 100644 --- a/native/NativeImpl.c +++ b/native/NativeImpl.c @@ -16,7 +16,7 @@ static const uint64_t DECIMAL_NATIVE_UNDERLYING_NULL = 0xFFFFFFFFFFFFFF80ULL; // BID_UINT64 dfp64_try_parse(const char* str, _IDEC_flags* exception) { if (!strcmpIgnoreCase(str, "null")) return DECIMAL_NATIVE_UNDERLYING_NULL; - auto ret = bid64_from_string((char*)str); + BID_UINT64 ret = bid64_from_string((char*)str); if (exception) *exception = _IDEC_glbflags; return ret; diff --git a/native/NativeImpl.h b/native/NativeImpl.h index b16aebf3..116c1fdd 100644 --- a/native/NativeImpl.h +++ b/native/NativeImpl.h @@ -14,13 +14,13 @@ #if defined(_WIN32) #define JNI_API(x) __declspec(dllexport) x __stdcall #else -#define JNI_API(x) x __attribute__ ((externally_visible,visibility("default"))) +#define JNI_API(x) x __attribute__ ((visibility("default"))) #endif #if defined(_WIN32) #define DDFP_API(x) __declspec(dllexport) x __cdecl #else -#define DDFP_API(x) x __attribute__ ((externally_visible,visibility("default"))) +#define DDFP_API(x) x __attribute__ ((visibility("default"))) #endif /* From 1a8393790d94be175a63131e2d56d26f5215c902 Mon Sep 17 00:00:00 2001 From: agdavydov81 Date: Tue, 17 Oct 2023 11:25:12 +0300 Subject: [PATCH 17/90] Setup wrappers generation prior build --- .github/workflows/Build.yml | 46 ++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index c5f881ed..3b3f1b9e 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -14,12 +14,40 @@ env: jobs: + build-wrappers: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: 'recursive' + - name: build + run: | + ./gradlew makeNativeWrappers + - uses: actions/upload-artifact@v3 + with: + name: build-wrappers + path: | + ./*java/dfp/build/generated/sources/nativeWrappers/com/epam/deltix/dfp* + ./*java/dfp-math/build/generated/sources/nativeWrappers/com/epam/deltix/dfpmath* + ./csharp/EPAM.Deltix.DFP/NativeImpl.cs + ./csharp/EPAM.Deltix.DFP/Version.targets + ./csharp/EPAM.Deltix.DFPMath/NativeMathImpl.cs + ./csharp/EPAM.Deltix.DFPMath/Version.targets + ./native/DecimalNative.h + ./native/DecimalNative.hpp + retention-days: 7 + build-native-linux: runs-on: ubuntu-20.04 + needs: [build-wrappers] steps: - uses: actions/checkout@v3 with: submodules: 'recursive' + - name: Download build-wrappers artifacts + uses: actions/download-artifact@v3 + with: + name: build-wrappers - name: build run: | sudo apt update @@ -56,10 +84,15 @@ jobs: build-native-windows: runs-on: windows-2019 + needs: [build-wrappers] steps: - uses: actions/checkout@v3 with: submodules: 'recursive' + - name: Download build-wrappers artifacts + uses: actions/download-artifact@v3 + with: + name: build-wrappers - name: Use MSBuild uses: microsoft/setup-msbuild@v1.1 - name: build @@ -74,10 +107,15 @@ jobs: build-native-macos: runs-on: ubuntu-20.04 + needs: [build-wrappers] steps: - uses: actions/checkout@v3 with: submodules: 'recursive' + - name: Download build-wrappers artifacts + uses: actions/download-artifact@v3 + with: + name: build-wrappers - name: build run: | sudo apt update @@ -97,9 +135,13 @@ jobs: compress-native: runs-on: ubuntu-latest - needs: [build-native-linux, build-native-windows, build-native-macos] + needs: [build-wrappers, build-native-linux, build-native-windows, build-native-macos] steps: - uses: actions/checkout@v3 + - name: Download build-wrappers artifacts + uses: actions/download-artifact@v3 + with: + name: build-wrappers - name: Download native-linux artifacts uses: actions/download-artifact@v3 with: @@ -129,6 +171,8 @@ jobs: ./csharp/EPAM.Deltix.DFP/Version.targets ./csharp/EPAM.Deltix.DFPMath/NativeMathImpl.cs ./csharp/EPAM.Deltix.DFPMath/Version.targets + ./native/DecimalNative.h + ./native/DecimalNative.hpp retention-days: 7 build-java: From b646d833145b2942b3c861ee48199ec3e8882d8f Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Thu, 19 Oct 2023 14:17:17 +0300 Subject: [PATCH 18/90] Cxx: Fix Linux compilation. --- native/CMakeLists.txt | 20 +++-- native/build.gradle | 203 +++++++++++++++++++++++++++++++++++++++++- native/buildLinux.sh | 37 -------- 3 files changed, 211 insertions(+), 49 deletions(-) delete mode 100755 native/buildLinux.sh diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 108631b5..7763e981 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -9,7 +9,11 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_IN}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_IN}") if (TARGET) - set(TARGET_FLAGS "--target=${TARGET} ${TARGET_EX} --sysroot=${SYSROOT} -I${SYSROOT}/include/c++/v1 -I/usr/${TARGET}/include") + set(TARGET_FLAGS "--target=${TARGET} ${TARGET_EX}") + if (SYSROOT) + set(TARGET_FLAGS "${TARGET_FLAGS} --sysroot=${SYSROOT} -I${SYSROOT}/include/c++/v1") + endif() + set(TARGET_FLAGS "${TARGET_FLAGS} -I/usr/${TARGET}/include") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TARGET_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TARGET_FLAGS}") endif() @@ -100,12 +104,10 @@ target_compile_definitions(dfpStatic PRIVATE API_PREFIX=ddfp${VERSION_SUFFIX}_ N set_target_properties(dfpStatic PROPERTIES OUTPUT_NAME "ddfpStatic${VERSION_SUFFIX}") install(TARGETS dfpStatic DESTINATION ./bin/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX}) -if (NOT CMAKE_C_COMPILER_ID STREQUAL "GNU") - add_executable(demo demo.cpp) - #target_link_libraries(demo LINK_PRIVATE dfp stdc++) - if (MSVC) - target_link_libraries(demo LINK_PRIVATE dfpStatic) - else() - target_link_libraries(demo LINK_PRIVATE dfpStatic stdc++) - endif() +if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # Mean musl-gcc + add_executable(demoStatic demo.cpp) + target_link_libraries(demoStatic LINK_PRIVATE dfpStatic) + + add_executable(demo demo.cpp) + target_link_libraries(demo LINK_PRIVATE dfp) endif() diff --git a/native/build.gradle b/native/build.gradle index 4e9132b9..58f4a82e 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -1,14 +1,211 @@ +def llvmRoot = "$rootDir/llvm" +def versionSuffix = versioning()["suffix"] +def CCOMPILER = "clang" +def CXXCOMPILER = "clang++" +def VERBOSE = "ON" + task makeNativeWindows(type: Exec) { commandLine "$rootDir/native/buildWindows.bat", versioning()["suffix"] workingDir("$rootDir/native") } -task makeNativeLinux(type: Exec) { - commandLine "$rootDir/native/buildLinux.sh", versioning()["suffix"] - workingDir("$rootDir/native") +task makeNativeLinuxArm7(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { + def llvmToolset = 'clang+llvm-14.0.6-armv7a-linux-gnueabihf' + def installSuffix = 'linux/arm' + def buildRoot = "$rootDir/native/buildArm7" + + doLast { + if (project.hasProperty('sudoPassword')) { + exec { // ./gradlew makeNativeLinuxArm7 -PsudoPassword= + commandLine 'sh', '-c', "echo $sudoPassword | sudo -S apt install -y curl tar g++-arm-linux-gnueabihf" + } + } + + if (!file("$llvmRoot/$llvmToolset").exists()) { + project.mkdir llvmRoot + exec { + workingDir llvmRoot + commandLine 'curl', '-OL', "https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/${llvmToolset}.tar.xz" + } + exec { + workingDir llvmRoot + commandLine 'tar', '-xf', "${llvmToolset}.tar.xz" + } + } + + project.mkdir buildRoot + exec { + workingDir buildRoot + commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=$CCOMPILER", "-DCMAKE_CXX_COMPILER=$CXXCOMPILER", "-DTARGET=arm-linux-gnueabihf", "-DTARGET_EX=-march=armv7a -mfloat-abi=hard", "-DSYSROOT=$llvmRoot/$llvmToolset", "-DCMAKE_INSTALL_PREFIX=../", "-DINSTALL_SUFFIX=$installSuffix", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libc++", "../" + } + exec { + workingDir buildRoot + commandLine 'cmake', '--build', '.', '--config', 'Release' + } + exec { + workingDir buildRoot + commandLine 'cmake', '--install', '.', '--config', 'Release' + } + project.delete(files(buildRoot)) + } + + onlyIf { + !file("$rootDir/native/bin/Release/$installSuffix/libddfp${versionSuffix}.so").exists() || + !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || + !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.so").exists() + } +} + +task makeNativeLinuxAArch64(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { + def target = 'aarch64-linux-gnu' + def llvmToolset = "clang+llvm-14.0.6-$target" + def installSuffix = 'linux/aarch64' + def buildRoot = "$rootDir/native/buildAArch64" + + doLast { + if (project.hasProperty('sudoPassword')) { + exec { // ./gradlew makeNativeLinuxAArch64 -PsudoPassword= + commandLine 'sh', '-c', "echo $sudoPassword | sudo -S apt install -y curl tar g++-$target" + } + } + + if (!file("$llvmRoot/$llvmToolset").exists()) { + project.mkdir llvmRoot + exec { + workingDir llvmRoot + commandLine 'curl', '-OL', "https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/${llvmToolset}.tar.xz" + } + exec { + workingDir llvmRoot + commandLine 'tar', '-xf', "${llvmToolset}.tar.xz" + } + } + + project.mkdir buildRoot + exec { + workingDir buildRoot + commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=$CCOMPILER", "-DCMAKE_CXX_COMPILER=$CXXCOMPILER", "-DTARGET=$target", "-DSYSROOT=$llvmRoot/$llvmToolset", "-DCMAKE_INSTALL_PREFIX=../", "-DINSTALL_SUFFIX=$installSuffix", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libc++", "../" + } + exec { + workingDir buildRoot + commandLine 'cmake', '--build', '.', '--config', 'Release' + } + exec { + workingDir buildRoot + commandLine 'cmake', '--install', '.', '--config', 'Release' + } + project.delete(files(buildRoot)) + } + + onlyIf { + !file("$rootDir/native/bin/Release/$installSuffix/libddfp${versionSuffix}.so").exists() || + !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || + !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.so").exists() + } +} + +task makeNativeLinuxI386(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { + def target = 'i686-linux-gnu' + def installSuffix = 'linux/i386' + def buildRoot = "$rootDir/native/buildI386" + + doLast { + if (project.hasProperty('sudoPassword')) { + exec { // ./gradlew makeNativeLinuxI386 -PsudoPassword= + commandLine 'sh', '-c', "echo $sudoPassword | sudo -S apt install -y g++-$target" + } + } + + project.mkdir buildRoot + exec { + workingDir buildRoot + commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=$CCOMPILER", "-DCMAKE_CXX_COMPILER=$CXXCOMPILER", "-DTARGET=$target", "-DTARGET_EX=-m32", "-DCMAKE_INSTALL_PREFIX=../", "-DINSTALL_SUFFIX=$installSuffix", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libstdc++", "../" + } + exec { + workingDir buildRoot + commandLine 'cmake', '--build', '.', '--config', 'Release' + } + exec { + workingDir buildRoot + commandLine 'cmake', '--install', '.', '--config', 'Release' + } + project.delete(files(buildRoot)) + } + + onlyIf { + !file("$rootDir/native/bin/Release/$installSuffix/libddfp${versionSuffix}.so").exists() || + !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || + !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.so").exists() + } +} + +task makeNativeLinuxAmd64(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { + def installSuffix = 'linux/amd64' + def buildRoot = "$rootDir/native/buildAmd64" + + doLast { + project.mkdir buildRoot + exec { + workingDir buildRoot + commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=$CCOMPILER", "-DCMAKE_CXX_COMPILER=$CXXCOMPILER", "-DCMAKE_INSTALL_PREFIX=../", "-DINSTALL_SUFFIX=$installSuffix", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libstdc++", "../" + } + exec { + workingDir buildRoot + commandLine 'cmake', '--build', '.', '--config', 'Release' + } + exec { + workingDir buildRoot + commandLine 'cmake', '--install', '.', '--config', 'Release' + } + project.delete(files(buildRoot)) + } + + onlyIf { + !file("$rootDir/native/bin/Release/$installSuffix/libddfp${versionSuffix}.so").exists() || + !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || + !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.so").exists() + } +} + +task makeNativeLinuxMusl(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { + def installSuffix = 'linux/musl' + def buildRoot = "$rootDir/native/buildMusl" + + doLast { + if (project.hasProperty('sudoPassword')) { + exec { // ./gradlew makeNativeLinuxI386 -PsudoPassword= + commandLine 'sh', '-c', "echo $sudoPassword | sudo -S apt install -y musl-tools" + } + } + + project.mkdir buildRoot + exec { + workingDir buildRoot + commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=musl-gcc", "-DCMAKE_CXX_COMPILER=musl-gcc", "-DCMAKE_INSTALL_PREFIX=../", "-DINSTALL_SUFFIX=$installSuffix", "-DCMAKE_C_FLAGS_IN=-static", "-DCMAKE_CXX_FLAGS_IN=-static", "../" + } + exec { + workingDir buildRoot + commandLine 'cmake', '--build', '.', '--config', 'Release' + } + exec { + workingDir buildRoot + commandLine 'cmake', '--install', '.', '--config', 'Release' + } + project.delete(files(buildRoot)) + } + + onlyIf { + !file("$rootDir/native/bin/Release/$installSuffix/libddfp${versionSuffix}.so").exists() || + !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || + !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.so").exists() + } +} + +task makeNativeLinux(dependsOn: [makeNativeLinuxArm7, makeNativeLinuxAArch64, makeNativeLinuxI386, makeNativeLinuxAmd64, makeNativeLinuxMusl]) { } task makeNativeDarwin(type: Exec) { commandLine "$rootDir/native/buildDarwin.sh", versioning()["suffix"], "apple-darwin20.4", "$rootDir/osxcross/target" workingDir("$rootDir/native") } + diff --git a/native/buildLinux.sh b/native/buildLinux.sh deleted file mode 100755 index 17a562f4..00000000 --- a/native/buildLinux.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash -set -Eeuo pipefail -set -x - -CCOMPILER=${2:-clang} -CXXCOMPILER=${3:-clang} -VERBOSE=${4:-ON} - -rm -rf ./build -mkdir build -cd build - -$CCOMPILER --version - -cmake -G "Unix Makefiles" -DVERSION_SUFFIX=$1 -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE -DCMAKE_C_COMPILER=$CCOMPILER -DCMAKE_CXX_COMPILER=$CXXCOMPILER -DTARGET=arm-linux-gnueabihf -DTARGET_EX='-march=armv7a -mfloat-abi=hard' -DSYSROOT=../../../llvm/clang+llvm-12.0.0-armv7a-linux-gnueabihf -DCMAKE_INSTALL_PREFIX=../ -DINSTALL_SUFFIX=linux/arm ../ -make install - -rm -rf ./* -cmake -G "Unix Makefiles" -DVERSION_SUFFIX=$1 -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE -DCMAKE_C_COMPILER=$CCOMPILER -DCMAKE_CXX_COMPILER=$CXXCOMPILER -DTARGET=aarch64-linux-gnu -DSYSROOT=../../../llvm/clang+llvm-12.0.0-aarch64-linux-gnu -DCMAKE_INSTALL_PREFIX=../ -DINSTALL_SUFFIX=linux/aarch64 ../ -make install - -rm -rf ./* -cmake -G "Unix Makefiles" -DVERSION_SUFFIX=$1 -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE -DCMAKE_C_COMPILER=$CCOMPILER -DCMAKE_CXX_COMPILER=$CXXCOMPILER -DTARGET=i686-linux-gnu -DSYSROOT=../../../llvm/clang+llvm-12.0.0-i386-unknown-freebsd12 -DCMAKE_INSTALL_PREFIX=../ -DINSTALL_SUFFIX=linux/i386 ../ -make install - -rm -rf ./* -cmake -G "Unix Makefiles" -DVERSION_SUFFIX=$1 -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE -DCMAKE_C_COMPILER=$CCOMPILER -DCMAKE_CXX_COMPILER=$CXXCOMPILER -DCMAKE_INSTALL_PREFIX=../ -DINSTALL_SUFFIX=linux/amd64 ../ -cmake --build . --config Release -cmake --install . --config Release - -rm -rf ./* -cmake -G "Unix Makefiles" -DVERSION_SUFFIX=$1 -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE -DCMAKE_C_COMPILER=musl-gcc -DCMAKE_CXX_COMPILER=musl-gcc -DCMAKE_C_FLAGS_IN=-static -DCMAKE_CXX_FLAGS_IN=-static -DCMAKE_INSTALL_PREFIX=../ -DINSTALL_SUFFIX=linux/amd64/musl-gcc ../ -cmake --build . --config Release -cmake --install . --config Release - -cd .. -rm -rf ./build From 7ebbd06781e75816bb0fb3f311c01ee41d1c8011 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Thu, 19 Oct 2023 19:16:55 +0300 Subject: [PATCH 19/90] Cxx: Refactor makeNativeWindows with gradle. --- native/build.gradle | 113 +++++++++++++++++++++++++++++++++------- native/buildWindows.bat | 32 ------------ 2 files changed, 94 insertions(+), 51 deletions(-) delete mode 100644 native/buildWindows.bat diff --git a/native/build.gradle b/native/build.gradle index 58f4a82e..aa058d22 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -3,10 +3,71 @@ def versionSuffix = versioning()["suffix"] def CCOMPILER = "clang" def CXXCOMPILER = "clang++" def VERBOSE = "ON" +def deleteBuildDir = true -task makeNativeWindows(type: Exec) { - commandLine "$rootDir/native/buildWindows.bat", versioning()["suffix"] - workingDir("$rootDir/native") +task makeNativeWindowsI386(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { + def installSuffix = 'windows/i386' + def buildRoot = "$rootDir/native/buildI386" + + doLast { + project.mkdir buildRoot + exec { + workingDir buildRoot + commandLine 'cmake', '-A', 'Win32', '-T', 'ClangCL', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_INSTALL_PREFIX=../", "-DINSTALL_SUFFIX=$installSuffix", "../" + } + exec { + workingDir buildRoot + commandLine 'cmake', '--build', '.', '--config', 'Release' + } + exec { + workingDir buildRoot + commandLine 'cmake', '--install', '.', '--config', 'Release' + } + + if (deleteBuildDir) { + project.delete(files(buildRoot)) + } + } + + onlyIf { + !file("$rootDir/native/bin/Release/$installSuffix/ddfp${versionSuffix}.dll").exists() || + !file("$rootDir/native/bin/Release/$installSuffix/ddfpStatic${versionSuffix}.lib").exists() || + !file("$rootDir/native/binmath/Release/$installSuffix/ddfpmath${versionSuffix}.dll").exists() + } +} + +task makeNativeWindowsAmd64(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { + def installSuffix = 'windows/amd64' + def buildRoot = "$rootDir/native/buildAmd64" + + doLast { + project.mkdir buildRoot + exec { + workingDir buildRoot + commandLine 'cmake', '-A', 'x64', '-T', 'ClangCL', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_INSTALL_PREFIX=../", "-DINSTALL_SUFFIX=$installSuffix", "../" + } + exec { + workingDir buildRoot + commandLine 'cmake', '--build', '.', '--config', 'Release' + } + exec { + workingDir buildRoot + commandLine 'cmake', '--install', '.', '--config', 'Release' + } + + if (deleteBuildDir) { + project.delete(files(buildRoot)) + } + } + + onlyIf { + !file("$rootDir/native/bin/Release/$installSuffix/ddfp${versionSuffix}.dll").exists() || + !file("$rootDir/native/bin/Release/$installSuffix/ddfpStatic${versionSuffix}.lib").exists() || + !file("$rootDir/native/binmath/Release/$installSuffix/ddfpmath${versionSuffix}.dll").exists() + } +} + +task makeNativeWindows(dependsOn: [makeNativeWindowsI386, makeNativeWindowsAmd64]) { } task makeNativeLinuxArm7(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { @@ -46,13 +107,16 @@ task makeNativeLinuxArm7(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { workingDir buildRoot commandLine 'cmake', '--install', '.', '--config', 'Release' } - project.delete(files(buildRoot)) + + if (deleteBuildDir) { + project.delete(files(buildRoot)) + } } onlyIf { !file("$rootDir/native/bin/Release/$installSuffix/libddfp${versionSuffix}.so").exists() || - !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || - !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.so").exists() + !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || + !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.so").exists() } } @@ -94,13 +158,16 @@ task makeNativeLinuxAArch64(dependsOn: ':java:nativeWrappers:makeNativeWrappers' workingDir buildRoot commandLine 'cmake', '--install', '.', '--config', 'Release' } - project.delete(files(buildRoot)) + + if (deleteBuildDir) { + project.delete(files(buildRoot)) + } } onlyIf { !file("$rootDir/native/bin/Release/$installSuffix/libddfp${versionSuffix}.so").exists() || - !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || - !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.so").exists() + !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || + !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.so").exists() } } @@ -129,13 +196,16 @@ task makeNativeLinuxI386(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { workingDir buildRoot commandLine 'cmake', '--install', '.', '--config', 'Release' } - project.delete(files(buildRoot)) + + if (deleteBuildDir) { + project.delete(files(buildRoot)) + } } onlyIf { !file("$rootDir/native/bin/Release/$installSuffix/libddfp${versionSuffix}.so").exists() || - !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || - !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.so").exists() + !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || + !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.so").exists() } } @@ -157,13 +227,16 @@ task makeNativeLinuxAmd64(dependsOn: ':java:nativeWrappers:makeNativeWrappers') workingDir buildRoot commandLine 'cmake', '--install', '.', '--config', 'Release' } - project.delete(files(buildRoot)) + + if (deleteBuildDir) { + project.delete(files(buildRoot)) + } } onlyIf { !file("$rootDir/native/bin/Release/$installSuffix/libddfp${versionSuffix}.so").exists() || - !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || - !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.so").exists() + !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || + !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.so").exists() } } @@ -191,13 +264,16 @@ task makeNativeLinuxMusl(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { workingDir buildRoot commandLine 'cmake', '--install', '.', '--config', 'Release' } - project.delete(files(buildRoot)) + + if (deleteBuildDir) { + project.delete(files(buildRoot)) + } } onlyIf { !file("$rootDir/native/bin/Release/$installSuffix/libddfp${versionSuffix}.so").exists() || - !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || - !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.so").exists() + !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || + !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.so").exists() } } @@ -208,4 +284,3 @@ task makeNativeDarwin(type: Exec) { commandLine "$rootDir/native/buildDarwin.sh", versioning()["suffix"], "apple-darwin20.4", "$rootDir/osxcross/target" workingDir("$rootDir/native") } - diff --git a/native/buildWindows.bat b/native/buildWindows.bat deleted file mode 100644 index 658b4a1b..00000000 --- a/native/buildWindows.bat +++ /dev/null @@ -1,32 +0,0 @@ -mkdir buildi386 || goto :error -cd buildi386 || goto :error -cmake -A Win32 -T ClangCL -DVERSION_SUFFIX=%1 ../ || goto :error -cmake --build . --config Release || goto :error -cmake --install . --config Release --prefix ./installation || goto :error -mkdir ..\binmath\Release\windows\i386 || goto :error -move /y Release\*math*.dll ..\binmath\Release\windows\i386 || goto :error -mkdir ..\bin\Release\windows\i386 || goto :error -move /y Release\*.dll ..\bin\Release\windows\i386 || goto :error -mkdir ..\binDemo\Release\windows\i386 || goto :error -move /y Release\*.exe ..\binDemo\Release\windows\i386 || goto :error - -cd .. || goto :error - -mkdir buildamd64 || goto :error -cd buildamd64 || goto :error -cmake -A x64 -T ClangCL -DVERSION_SUFFIX=%1 ../ || goto :error -cmake --build . --config Release || goto :error -cmake --install . --config Release --prefix ./installation || goto :error -mkdir ..\binmath\Release\windows\amd64 || goto :error -move /y Release\*math*.dll ..\binmath\Release\windows\amd64 || goto :error -mkdir ..\bin\Release\windows\amd64 || goto :error -move /y Release\*.dll ..\bin\Release\windows\amd64 || goto :error -mkdir ..\binDemo\Release\windows\amd64 || goto :error -move /y Release\*.exe ..\binDemo\Release\windows\amd64 || goto :error -cd .. || goto :error - -goto :EOF - -:error -echo Failed with error #%errorlevel%. -exit /b %errorlevel% From 364581a2cbfa96257b319d155907af31fe1db015 Mon Sep 17 00:00:00 2001 From: agdavydov81 Date: Thu, 19 Oct 2023 22:02:31 +0300 Subject: [PATCH 20/90] Cxx: Fix native Linux compilation CI --- .github/workflows/Build.yml | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 3b3f1b9e..0d2b60d2 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -51,35 +51,16 @@ jobs: - name: build run: | sudo apt update - sudo apt install -yqq g++-9-arm-linux-gnueabihf \ - g++-9-aarch64-linux-gnu \ - g++-9-i686-linux-gnu \ + sudo apt install -yqq g++-arm-linux-gnueabihf \ + g++-aarch64-linux-gnu \ + g++-i686-linux-gnu \ musl-tools - cd .. - mkdir llvm - cd llvm - curl -OL https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0/clang+llvm-12.0.0-armv7a-linux-gnueabihf.tar.xz - curl -OL https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0/clang+llvm-12.0.0-aarch64-linux-gnu.tar.xz - curl -OL https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0/clang+llvm-12.0.0-i386-unknown-freebsd12.tar.xz - tar -xf clang+llvm-12.0.0-armv7a-linux-gnueabihf.tar.xz - tar -xf clang+llvm-12.0.0-aarch64-linux-gnu.tar.xz - tar -xf clang+llvm-12.0.0-i386-unknown-freebsd12.tar.xz - ls -al - cd ../DFP/ - ls -al ./gradlew makeNativeLinux - ./gradlew makeNativeWrappers - uses: actions/upload-artifact@v3 with: name: build-native-linux path: | ./*native/bin* - ./*java/dfp/build/generated/sources/nativeWrappers/com/epam/deltix/dfp* - ./*java/dfp-math/build/generated/sources/nativeWrappers/com/epam/deltix/dfpmath* - ./csharp/EPAM.Deltix.DFP/NativeImpl.cs - ./csharp/EPAM.Deltix.DFP/Version.targets - ./csharp/EPAM.Deltix.DFPMath/NativeMathImpl.cs - ./csharp/EPAM.Deltix.DFPMath/Version.targets retention-days: 7 build-native-windows: From 27ed7e6a2ea63501cc28f8d3a778f5dffbdb546e Mon Sep 17 00:00:00 2001 From: agdavydov81 Date: Fri, 20 Oct 2023 09:43:50 +0300 Subject: [PATCH 21/90] Fix Linux CI compilation --- .github/workflows/Build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 0d2b60d2..6f96f417 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -15,7 +15,7 @@ env: jobs: build-wrappers: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 with: @@ -38,7 +38,7 @@ jobs: retention-days: 7 build-native-linux: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 needs: [build-wrappers] steps: - uses: actions/checkout@v3 @@ -115,7 +115,7 @@ jobs: retention-days: 7 compress-native: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: [build-wrappers, build-native-linux, build-native-windows, build-native-macos] steps: - uses: actions/checkout@v3 @@ -157,7 +157,7 @@ jobs: retention-days: 7 build-java: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: [compress-native] steps: - uses: actions/checkout@v3 @@ -223,7 +223,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ 'ubuntu-latest', 'windows-2019', 'macos-latest'] + os: [ 'ubuntu-22.04', 'windows-2019', 'macos-latest'] java: [ '8', '11', '19'] steps: - uses: actions/checkout@v3 @@ -251,7 +251,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ 'ubuntu-latest', 'windows-2019', 'macos-latest'] + os: [ 'ubuntu-22.04', 'windows-2019', 'macos-latest'] steps: - uses: actions/checkout@v3 with: @@ -270,7 +270,7 @@ jobs: cd csharp ./build --target=Run-Unit-Tests - name: test nix - if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }} + if: ${{ matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-latest' }} run: | cd csharp ./build.sh --target=Run-Unit-Tests From 03509a7d95aaa0c219055802dfe2828168910e51 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Fri, 20 Oct 2023 11:21:52 +0300 Subject: [PATCH 22/90] Cxx: Darwin build: initial version with native platform compilation (w/o cross-compilation). CI configuration required. [skip ci] --- native/build.gradle | 66 +++++++++++++++++++++++++++++++++++++++++-- native/buildDarwin.sh | 38 ------------------------- 2 files changed, 63 insertions(+), 41 deletions(-) delete mode 100755 native/buildDarwin.sh diff --git a/native/build.gradle b/native/build.gradle index aa058d22..1cff6bb3 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -280,7 +280,67 @@ task makeNativeLinuxMusl(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { task makeNativeLinux(dependsOn: [makeNativeLinuxArm7, makeNativeLinuxAArch64, makeNativeLinuxI386, makeNativeLinuxAmd64, makeNativeLinuxMusl]) { } -task makeNativeDarwin(type: Exec) { - commandLine "$rootDir/native/buildDarwin.sh", versioning()["suffix"], "apple-darwin20.4", "$rootDir/osxcross/target" - workingDir("$rootDir/native") +task makeNativeDarwinAmd64(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { + def installSuffix = 'darwin/amd64' + def buildRoot = "$rootDir/native/buildAmd64" + + doLast { + project.mkdir buildRoot + exec { + workingDir buildRoot + commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_INSTALL_PREFIX=../", "-DINSTALL_SUFFIX=$installSuffix", "-DAPPLE=TRUE", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libstdc++", "../" + } + exec { + workingDir buildRoot + commandLine 'cmake', '--build', '.', '--config', 'Release' + } + exec { + workingDir buildRoot + commandLine 'cmake', '--install', '.', '--config', 'Release' + } + + if (deleteBuildDir) { + project.delete(files(buildRoot)) + } + } + + onlyIf { + !file("$rootDir/native/bin/Release/$installSuffix/libddfp${versionSuffix}.dylib").exists() || + !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || + !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.dylib").exists() + } +} + +task makeNativeDarwinAArch64(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { + def installSuffix = 'darwin/aarch64' + def buildRoot = "$rootDir/native/buildAArch64" + + doLast { + project.mkdir buildRoot + exec { + workingDir buildRoot + commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_INSTALL_PREFIX=../", "-DINSTALL_SUFFIX=$installSuffix", "-DAPPLE=TRUE", "-DCMAKE_C_FLAGS_IN=-target arm64-apple-macos11", "-DCMAKE_CXX_FLAGS_IN=-target arm64-apple-macos11 -stdlib=libstdc++", "../" + } + exec { + workingDir buildRoot + commandLine 'cmake', '--build', '.', '--config', 'Release' + } + exec { + workingDir buildRoot + commandLine 'cmake', '--install', '.', '--config', 'Release' + } + + if (deleteBuildDir) { + project.delete(files(buildRoot)) + } + } + + onlyIf { + !file("$rootDir/native/bin/Release/$installSuffix/libddfp${versionSuffix}.dylib").exists() || + !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || + !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.dylib").exists() + } +} + +task makeNativeDarwin(dependsOn: [makeNativeDarwinAmd64, makeNativeDarwinAmd64]) { } diff --git a/native/buildDarwin.sh b/native/buildDarwin.sh deleted file mode 100755 index 9cd5cfbd..00000000 --- a/native/buildDarwin.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash -set -ex - -# https://github.com/tpoechtrager/osxcross -# https://github.com/phracker/MacOSX-SDKs/releases -# https://github.com/ribasco/ucgdisplay/tree/master/native -# https://gist.github.com/jeffheifetz/f9ec3b04312387d6b0720ce41921fddb - - -OSXCROSS_HOST_SUFFIX=${2:-apple-darwin20.4} -OSXCROSS_TARGET_DIR=${3:-../../osxcross/target} -OSXCROSS_SDK=${4:-$OSXCROSS_TARGET_DIR/SDK/MacOSX11.3.sdk} -OSXCROSS_TARGET=${5:-darwin20.4} -VERBOSE=${6:-ON} - -rm -rf ./build -mkdir build -cd build - -CROSS_HOST=x86_64 -OSXCROSS_HOST=$CROSS_HOST-$OSXCROSS_HOST_SUFFIX \ - OSXCROSS_TARGET_DIR=$OSXCROSS_TARGET_DIR \ - OSXCROSS_SDK=$OSXCROSS_SDK \ - OSXCROSS_TARGET=$OSXCROSS_TARGET \ - cmake -G "Unix Makefiles" -DVERSION_SUFFIX=$1 -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE -DCMAKE_TOOLCHAIN_FILE=$OSXCROSS_TARGET_DIR/toolchain.cmake -DCMAKE_INSTALL_PREFIX=../ -DINSTALL_SUFFIX=darwin/amd64 -DAPPLE=TRUE ../ -make install - -rm -rf ./* -CROSS_HOST=aarch64 -OSXCROSS_HOST=$CROSS_HOST-$OSXCROSS_HOST_SUFFIX \ - OSXCROSS_TARGET_DIR=$OSXCROSS_TARGET_DIR \ - OSXCROSS_SDK=$OSXCROSS_SDK \ - OSXCROSS_TARGET=$OSXCROSS_TARGET \ - cmake -G "Unix Makefiles" -DVERSION_SUFFIX=$1 -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE -DCMAKE_TOOLCHAIN_FILE=$OSXCROSS_TARGET_DIR/toolchain.cmake -DCMAKE_INSTALL_PREFIX=../ -DINSTALL_SUFFIX=darwin/aarch64 -DAPPLE=TRUE ../ -make install - -cd .. -rm -rf ./build From 5e1b822c0a5d4c99a1e41fafbef22a5afaa1449d Mon Sep 17 00:00:00 2001 From: agdavydov81 Date: Fri, 20 Oct 2023 11:25:08 +0300 Subject: [PATCH 23/90] CI: Setup macos native platform compilation. --- .github/workflows/Build.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 6f96f417..0cc743ec 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -87,7 +87,7 @@ jobs: retention-days: 7 build-native-macos: - runs-on: ubuntu-20.04 + runs-on: macos-12 needs: [build-wrappers] steps: - uses: actions/checkout@v3 @@ -99,13 +99,6 @@ jobs: name: build-wrappers - name: build run: | - sudo apt update - sudo apt install clang make libssl-dev liblzma-dev libxml2-dev fuse - cd ./osxcross/tarballs/ - wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.3.sdk.tar.xz - cd .. - UNATTENDED=yes OSX_VERSION_MIN=10.7 JOBS=4 ./build.sh - cd .. ./gradlew makeNativeDarwin - uses: actions/upload-artifact@v3 with: From 4ac5c2f38b7cfc0d62982fb4bbd494ceb96bf245 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Fri, 20 Oct 2023 11:39:06 +0300 Subject: [PATCH 24/90] Cxx: Fix macos compilation. --- native/CMakeLists.txt | 2 +- native/build.gradle | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 7763e981..010d921f 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.12) +cmake_minimum_required (VERSION 3.23) project (native) if(NOT CMAKE_BUILD_TYPE) diff --git a/native/build.gradle b/native/build.gradle index 1cff6bb3..7c804c81 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -288,7 +288,7 @@ task makeNativeDarwinAmd64(dependsOn: ':java:nativeWrappers:makeNativeWrappers') project.mkdir buildRoot exec { workingDir buildRoot - commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_INSTALL_PREFIX=../", "-DINSTALL_SUFFIX=$installSuffix", "-DAPPLE=TRUE", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libstdc++", "../" + commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_INSTALL_PREFIX=../", "-DINSTALL_SUFFIX=$installSuffix", "-DAPPLE=TRUE", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libc++", "../" } exec { workingDir buildRoot @@ -319,7 +319,7 @@ task makeNativeDarwinAArch64(dependsOn: ':java:nativeWrappers:makeNativeWrappers project.mkdir buildRoot exec { workingDir buildRoot - commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_INSTALL_PREFIX=../", "-DINSTALL_SUFFIX=$installSuffix", "-DAPPLE=TRUE", "-DCMAKE_C_FLAGS_IN=-target arm64-apple-macos11", "-DCMAKE_CXX_FLAGS_IN=-target arm64-apple-macos11 -stdlib=libstdc++", "../" + commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_INSTALL_PREFIX=../", "-DINSTALL_SUFFIX=$installSuffix", "-DAPPLE=TRUE", "-DCMAKE_C_FLAGS_IN=-target arm64-apple-macos11", "-DCMAKE_CXX_FLAGS_IN=-target arm64-apple-macos11 -stdlib=libc++", "../" } exec { workingDir buildRoot From 1c3ec3409b63a92a9e1e036a1660f4986fcc9574 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Fri, 20 Oct 2023 12:01:56 +0300 Subject: [PATCH 25/90] Cxx: Set c++11 standard --- native/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 010d921f..4e8286f1 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -52,6 +52,7 @@ add_definitions(-DDECIMAL_GLOBAL_EXCEPTION_FLAGS=${GLOBAL_FLAGS}) #set(CMAKE_CXX_VISIBILITY_PRESET default) #set(CMAKE_VISIBILITY_INLINES_HIDDEN 0) set(CMAKE_POSITION_INDEPENDENT_CODE ON) +set(CMAKE_CXX_STANDARD 11) if (MSVC) add_definitions(-D_CRT_SECURE_NO_DEPRECATE) From 1a5644d0dbdea43c21ab7a89a0b1c8aa67eca958 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Fri, 20 Oct 2023 12:06:47 +0300 Subject: [PATCH 26/90] Cxx: Try fix linux compilation --- native/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 4e8286f1..7b35f958 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -9,11 +9,10 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_IN}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_IN}") if (TARGET) - set(TARGET_FLAGS "--target=${TARGET} ${TARGET_EX}") + set(TARGET_FLAGS "--target=${TARGET} ${TARGET_EX} -I/usr/${TARGET}/include") if (SYSROOT) set(TARGET_FLAGS "${TARGET_FLAGS} --sysroot=${SYSROOT} -I${SYSROOT}/include/c++/v1") - endif() - set(TARGET_FLAGS "${TARGET_FLAGS} -I/usr/${TARGET}/include") + endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TARGET_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TARGET_FLAGS}") endif() From f10b8a4347cf7b387c589e373f0d3fb8f385cbe3 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Fri, 20 Oct 2023 12:17:42 +0300 Subject: [PATCH 27/90] Cxx: Enable macos aarch64 compilation --- native/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/build.gradle b/native/build.gradle index 7c804c81..0c9c5ae0 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -342,5 +342,5 @@ task makeNativeDarwinAArch64(dependsOn: ':java:nativeWrappers:makeNativeWrappers } } -task makeNativeDarwin(dependsOn: [makeNativeDarwinAmd64, makeNativeDarwinAmd64]) { +task makeNativeDarwin(dependsOn: [makeNativeDarwinAArch64, makeNativeDarwinAmd64]) { } From 6072895feb94a217a52f3e27769969f7f3e6960a Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Fri, 20 Oct 2023 12:36:58 +0300 Subject: [PATCH 28/90] Cxx: Slightly decrease CMake version [skip ci] --- native/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 7b35f958..43d5a900 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.23) +cmake_minimum_required (VERSION 3.22) project (native) if(NOT CMAKE_BUILD_TYPE) From c5442b8bcb13fa9ec139a8789c72c8b0ee4a8b03 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Fri, 20 Oct 2023 13:12:14 +0300 Subject: [PATCH 29/90] Cxx: Enhance build dir keeping logic. [skip ci] --- native/build.gradle | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/native/build.gradle b/native/build.gradle index 0c9c5ae0..33de6dbd 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -3,7 +3,7 @@ def versionSuffix = versioning()["suffix"] def CCOMPILER = "clang" def CXXCOMPILER = "clang++" def VERBOSE = "ON" -def deleteBuildDir = true +def keepBuildDir = (findProperty('keepBuildDir')?.toBoolean()) ?: false task makeNativeWindowsI386(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { def installSuffix = 'windows/i386' @@ -24,7 +24,7 @@ task makeNativeWindowsI386(dependsOn: ':java:nativeWrappers:makeNativeWrappers') commandLine 'cmake', '--install', '.', '--config', 'Release' } - if (deleteBuildDir) { + if (!keepBuildDir) { project.delete(files(buildRoot)) } } @@ -55,7 +55,7 @@ task makeNativeWindowsAmd64(dependsOn: ':java:nativeWrappers:makeNativeWrappers' commandLine 'cmake', '--install', '.', '--config', 'Release' } - if (deleteBuildDir) { + if (!keepBuildDir) { project.delete(files(buildRoot)) } } @@ -108,7 +108,7 @@ task makeNativeLinuxArm7(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { commandLine 'cmake', '--install', '.', '--config', 'Release' } - if (deleteBuildDir) { + if (!keepBuildDir) { project.delete(files(buildRoot)) } } @@ -159,7 +159,7 @@ task makeNativeLinuxAArch64(dependsOn: ':java:nativeWrappers:makeNativeWrappers' commandLine 'cmake', '--install', '.', '--config', 'Release' } - if (deleteBuildDir) { + if (!keepBuildDir) { project.delete(files(buildRoot)) } } @@ -197,7 +197,7 @@ task makeNativeLinuxI386(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { commandLine 'cmake', '--install', '.', '--config', 'Release' } - if (deleteBuildDir) { + if (!keepBuildDir) { project.delete(files(buildRoot)) } } @@ -228,7 +228,7 @@ task makeNativeLinuxAmd64(dependsOn: ':java:nativeWrappers:makeNativeWrappers') commandLine 'cmake', '--install', '.', '--config', 'Release' } - if (deleteBuildDir) { + if (!keepBuildDir) { project.delete(files(buildRoot)) } } @@ -265,7 +265,7 @@ task makeNativeLinuxMusl(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { commandLine 'cmake', '--install', '.', '--config', 'Release' } - if (deleteBuildDir) { + if (!keepBuildDir) { project.delete(files(buildRoot)) } } @@ -299,7 +299,7 @@ task makeNativeDarwinAmd64(dependsOn: ':java:nativeWrappers:makeNativeWrappers') commandLine 'cmake', '--install', '.', '--config', 'Release' } - if (deleteBuildDir) { + if (!keepBuildDir) { project.delete(files(buildRoot)) } } @@ -330,7 +330,7 @@ task makeNativeDarwinAArch64(dependsOn: ':java:nativeWrappers:makeNativeWrappers commandLine 'cmake', '--install', '.', '--config', 'Release' } - if (deleteBuildDir) { + if (!keepBuildDir) { project.delete(files(buildRoot)) } } From 5decb85d65a7df3226f2a115ca6d5165037de972 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Fri, 20 Oct 2023 14:30:02 +0300 Subject: [PATCH 30/90] Cxx: Try fix linux compilation. --- native/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 43d5a900..c6b14abb 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -9,7 +9,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_IN}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_IN}") if (TARGET) - set(TARGET_FLAGS "--target=${TARGET} ${TARGET_EX} -I/usr/${TARGET}/include") + set(TARGET_FLAGS "--target=${TARGET} ${TARGET_EX}") if (SYSROOT) set(TARGET_FLAGS "${TARGET_FLAGS} --sysroot=${SYSROOT} -I${SYSROOT}/include/c++/v1") endif() From 74ae03c267a2f1e2620b98f9a3fe0831022db80f Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Fri, 20 Oct 2023 16:10:11 +0300 Subject: [PATCH 31/90] Cxx: Build demo only for MSVC --- native/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index c6b14abb..d33620cc 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -104,7 +104,7 @@ target_compile_definitions(dfpStatic PRIVATE API_PREFIX=ddfp${VERSION_SUFFIX}_ N set_target_properties(dfpStatic PROPERTIES OUTPUT_NAME "ddfpStatic${VERSION_SUFFIX}") install(TARGETS dfpStatic DESTINATION ./bin/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX}) -if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # Mean musl-gcc +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") add_executable(demoStatic demo.cpp) target_link_libraries(demoStatic LINK_PRIVATE dfpStatic) From 6eb708a7c2371a1ab611205ffdb7692612b3c521 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Mon, 23 Oct 2023 12:47:47 +0300 Subject: [PATCH 32/90] Java: Copy only dynamic libraries to resources. --- java/dfp-math/build.gradle | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/java/dfp-math/build.gradle b/java/dfp-math/build.gradle index f78c0dbf..a6740f2e 100644 --- a/java/dfp-math/build.gradle +++ b/java/dfp-math/build.gradle @@ -38,12 +38,20 @@ dependencies { compileJava.dependsOn ":java:nativeWrappers:makeNativeWrappersDfpMath" -task copyNativeDfpMathResources(type: Copy) { - from("$rootDir/native/binmath/Release") - destinationDir(file("$rootDir/native/binmathJava/Release/resources_com_epam_deltix_dfpmath")) - onlyIf { - !file("$rootDir/native/binmathJava/Release/resources_com_epam_deltix_dfpmath").exists() - } +task copyNativeDfpMathResourcesMuslToAmd64(type: Copy) { + from "$rootDir/native/binmath/Release/linux/musl" + into "$rootDir/native/binmathJava/Release/resources_com_epam_deltix_dfpmath/linux/amd64" + include '**/*.so.zst' +} + +task copyNativeDfpMathResources(type: Copy, dependsOn: copyNativeDfpMathResourcesMuslToAmd64) { + from "$rootDir/native/binmath/Release" + into "$rootDir/native/binmathJava/Release/resources_com_epam_deltix_dfpmath" + include '**/*.dylib.zst' + include '**/*.so.zst' + include '**/*.dll.zst' + exclude 'linux/amd64/**' + exclude 'linux/musl/**' } compileJava.dependsOn(copyNativeDfpMathResources) From 08c4537fa1106d80abb1809fca96558c6c0f72c4 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Mon, 23 Oct 2023 12:57:36 +0300 Subject: [PATCH 33/90] Java: Fix resources copy. --- java/dfpNativeTests/build.gradle | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/java/dfpNativeTests/build.gradle b/java/dfpNativeTests/build.gradle index c7d3021c..514bc821 100644 --- a/java/dfpNativeTests/build.gradle +++ b/java/dfpNativeTests/build.gradle @@ -31,12 +31,20 @@ dependencies { compileJava.dependsOn ":java:nativeWrappers:makeNativeWrappersDfp" -task copyNativeDfpResources(type: Copy) { - from("$rootDir/native/bin/Release") - destinationDir(file("$rootDir/native/binJava/Release/resources_com_epam_deltix_dfp")) - onlyIf { - !file("$rootDir/native/binJava/Release/resources_com_epam_deltix_dfp").exists() - } +task copyNativeDfpResourcesMuslToAmd64(type: Copy) { + from "$rootDir/native/bin/Release/linux/musl" + into "$rootDir/native/binJava/Release/resources_com_epam_deltix_dfp/linux/amd64" + include '**/*.so.zst' +} + +task copyNativeDfpResources(type: Copy, dependsOn: copyNativeDfpResourcesMuslToAmd64) { + from "$rootDir/native/bin/Release" + into "$rootDir/native/binJava/Release/resources_com_epam_deltix_dfp" + include '**/*.dylib.zst' + include '**/*.so.zst' + include '**/*.dll.zst' + exclude 'linux/amd64/**' + exclude 'linux/musl/**' } compileJava.dependsOn(copyNativeDfpResources) From 62e47a5b3ac61d67368ed5854e4640b1d35c2eb4 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Mon, 23 Oct 2023 15:41:37 +0300 Subject: [PATCH 34/90] .NET: Fix resources preparation. --- csharp/build.cake | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/csharp/build.cake b/csharp/build.cake index 526e4dfc..d977620c 100644 --- a/csharp/build.cake +++ b/csharp/build.cake @@ -13,26 +13,33 @@ var configuration = Argument("configuration", "Release"); // TASKS ////////////////////////////////////////////////////////////////////// -Task("Native-Rename") - .Does(() => +using System.Linq; + +void NativeRename(string srcPath, string dstPath) { - if (!DirectoryExists("../native/binCs")) + foreach(var file in GetFiles("../native/" + srcPath + "/**/*.dylib.zst") + .Union(GetFiles("../native/" + srcPath + "/**/*.so.zst")) + .Union(GetFiles("../native/" + srcPath + "/**/*.dll.zst"))) { - CopyDirectory("../native/bin", "../native/binCs"); - foreach(var file in GetFiles("../native/binCs/Release/**/*.zst")) - { - MoveFile(file, file.ToString().Replace('.', '_')); - } - } + var fileDirectory = file.GetDirectory().ToString(); + if (fileDirectory.EndsWith("/linux/amd64", StringComparison.OrdinalIgnoreCase)) + continue; - if (!DirectoryExists("../native/binmathCs")) - { - CopyDirectory("../native/binmath", "../native/binmathCs"); - foreach(var file in GetFiles("../native/binmathCs/Release/**/*.zst")) - { - MoveFile(file, file.ToString().Replace('.', '_')); - } + var toDirectory = fileDirectory; + if (toDirectory.EndsWith("/linux/musl", StringComparison.OrdinalIgnoreCase)) + toDirectory = toDirectory.Substring(0, toDirectory.Length - 4) + "amd64"; + + toDirectory = toDirectory.Replace("/" + srcPath + "/", "/" + dstPath + "/"); + CreateDirectory(toDirectory); + CopyFile(file, toDirectory + "/" + file.GetFilename().ToString().Replace('.', '_')); } +} + +Task("Native-Rename") + .Does(() => +{ + NativeRename("bin/Release", "binCs/Release"); + NativeRename("binmath/Release", "binmathCs/Release"); }); Task("Clean") From ae43d4ed302544d2b5811abaf5d2074356a53cd8 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Wed, 25 Oct 2023 12:56:31 +0300 Subject: [PATCH 35/90] Cxx: Save compilation variables to text file. --- native/CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index d33620cc..85f6b324 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -24,6 +24,18 @@ message(STATUS "CMAKE_CROSSCOMPILING: " ${CMAKE_CROSSCOMPILING}) message(STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS}) message(STATUS "CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS}) +file(WRITE ./bin/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX}/cmakevariables.txt "\ +CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}\n\ +CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}\n\ +CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}\n\ +CMAKE_C_COMPILER_TARGET: ${CMAKE_C_COMPILER_TARGET}\n\ +CMAKE_CROSSCOMPILING: ${CMAKE_CROSSCOMPILING}\n\ +CMAKE_SIZEOF_VOID_P: ${CMAKE_SIZEOF_VOID_P}\n\ +CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}\n\ +CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}\n\ +CMAKE_C_COMPILER_ID: ${CMAKE_C_COMPILER_ID}\n\ +CMAKE_C_COMPILER_VERSION: ${CMAKE_C_COMPILER_VERSION}\n") + set(CALL_BY_REF "0" CACHE STRING "The numerical arguments and results are passed by reference") set(GLOBAL_RND "1" CACHE STRING "The rounding mode is a global variable _IDEC_glbround") set(GLOBAL_FLAGS "1" CACHE STRING "The exception status flags are represented by a global variable _IDEC_glbflags") From 1d8a21b23fb088452d61401f96f9ef3db2d060b9 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Wed, 25 Oct 2023 14:21:55 +0300 Subject: [PATCH 36/90] Cxx: Format JSON with compilation variables. --- native/CMakeLists.txt | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 85f6b324..1059906e 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -24,17 +24,20 @@ message(STATUS "CMAKE_CROSSCOMPILING: " ${CMAKE_CROSSCOMPILING}) message(STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS}) message(STATUS "CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS}) -file(WRITE ./bin/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX}/cmakevariables.txt "\ -CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}\n\ -CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}\n\ -CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}\n\ -CMAKE_C_COMPILER_TARGET: ${CMAKE_C_COMPILER_TARGET}\n\ -CMAKE_CROSSCOMPILING: ${CMAKE_CROSSCOMPILING}\n\ -CMAKE_SIZEOF_VOID_P: ${CMAKE_SIZEOF_VOID_P}\n\ -CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}\n\ -CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}\n\ -CMAKE_C_COMPILER_ID: ${CMAKE_C_COMPILER_ID}\n\ -CMAKE_C_COMPILER_VERSION: ${CMAKE_C_COMPILER_VERSION}\n") +file(WRITE ./bin/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX}/cmakevariables.json "\ +{\n\ + \"CMAKE_SYSTEM_NAME\": \"${CMAKE_SYSTEM_NAME}\",\n\ + \"CMAKE_TOOLCHAIN_FILE\": \"${CMAKE_TOOLCHAIN_FILE}\",\n\ + \"CMAKE_SYSTEM_PROCESSOR\": \"${CMAKE_SYSTEM_PROCESSOR}\",\n\ + \"CMAKE_C_COMPILER_TARGET\": \"${CMAKE_C_COMPILER_TARGET}\",\n\ + \"CMAKE_CROSSCOMPILING\": \"${CMAKE_CROSSCOMPILING}\",\n\ + \"CMAKE_SIZEOF_VOID_P\": \"${CMAKE_SIZEOF_VOID_P}\",\n\ + \"CMAKE_BUILD_TYPE\": \"${CMAKE_BUILD_TYPE}\",\n\ + \"CMAKE_C_COMPILER\": \"${CMAKE_C_COMPILER}\",\n\ + \"CMAKE_C_COMPILER_ID\": \"${CMAKE_C_COMPILER_ID}\",\n\ + \"CMAKE_C_COMPILER_VERSION\": \"${CMAKE_C_COMPILER_VERSION}\",\n\ + \"CMAKE_C_FLAGS\": \"${CMAKE_C_FLAGS}\",\n\ +}") set(CALL_BY_REF "0" CACHE STRING "The numerical arguments and results are passed by reference") set(GLOBAL_RND "1" CACHE STRING "The rounding mode is a global variable _IDEC_glbround") From 3be49309097275e008ab3d38dc27defdec43f479 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Thu, 26 Oct 2023 17:43:09 +0300 Subject: [PATCH 37/90] Cxx: Add initial version of the Conan publishing script [skip ci] --- native/build.gradle | 108 +++++++++++++++++++++++++++++++++++++++-- native/conan_invoke.py | 6 +++ native/conanfile.py | 63 ++++++++++++++++++++++++ 3 files changed, 174 insertions(+), 3 deletions(-) create mode 100644 native/conan_invoke.py create mode 100644 native/conanfile.py diff --git a/native/build.gradle b/native/build.gradle index 33de6dbd..7fa3ffd3 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -1,3 +1,5 @@ +import groovy.json.JsonSlurper + def llvmRoot = "$rootDir/llvm" def versionSuffix = versioning()["suffix"] def CCOMPILER = "clang" @@ -240,8 +242,8 @@ task makeNativeLinuxAmd64(dependsOn: ':java:nativeWrappers:makeNativeWrappers') } } -task makeNativeLinuxMusl(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { - def installSuffix = 'linux/musl' +task makeNativeLinuxMuslGcc(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { + def installSuffix = 'linux/musl-gcc' def buildRoot = "$rootDir/native/buildMusl" doLast { @@ -277,7 +279,7 @@ task makeNativeLinuxMusl(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { } } -task makeNativeLinux(dependsOn: [makeNativeLinuxArm7, makeNativeLinuxAArch64, makeNativeLinuxI386, makeNativeLinuxAmd64, makeNativeLinuxMusl]) { +task makeNativeLinux(dependsOn: [makeNativeLinuxArm7, makeNativeLinuxAArch64, makeNativeLinuxI386, makeNativeLinuxAmd64, makeNativeLinuxMuslGcc]) { } task makeNativeDarwinAmd64(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { @@ -344,3 +346,103 @@ task makeNativeDarwinAArch64(dependsOn: ':java:nativeWrappers:makeNativeWrappers task makeNativeDarwin(dependsOn: [makeNativeDarwinAArch64, makeNativeDarwinAmd64]) { } + +task nativeBinUnpack { + doLast { + exec { + workingDir "$rootDir/native/bin" + commandLine 'zstd', '-d', '--rm', '-r', '.' + } + exec { + workingDir "$rootDir/native/binmath" + commandLine 'zstd', '-d', '--rm', '-r', '.' + } + } + onlyIf { + !file("$rootDir/native/bin/Release/windows/amd64/ddfp${versionSuffix}.dll").exists() + } +} + +static String osMap(String str) { + switch (str) { + case "windows": return "Windows"; + case "linux": return "Linux"; + case "darwin": return "Macos"; + default: throw new Exception("Can't map OS with name ${str}") + } +} + +static String archMap(String str) { + switch (str) { + case "aarch64": return "armv8" + case "arm": return "armv7hf" + case "amd64": return "x86_64" + case "i386": return "x86" + case "musl-gcc": return "x86_64" + default: throw new Exception("Can't map architecture with name ${str}") + } +} + +static String compilerMap(String str) { + switch (str) { + case "Clang": return "clang" + case "GNU": return "gcc" + case "MSVC": return "msvc" + case "AppleClang": return "apple-clang" + default: throw new Exception("Can't map compiler with name ${str}") + } +} + +task nativeBinPublishConan(dependsOn: nativeBinUnpack) { + doLast { + file("$rootDir/native/bin").eachDir { buildTypeDir -> + def buildType = buildTypeDir.getName() + + buildTypeDir.eachDir { osDir -> + def os = osMap(osDir.getName()) + + osDir.eachDir { archDir -> + def arch = archMap(archDir.getName()) + + def cmakeVariables = new JsonSlurper().parse(new File(archDir, "cmakevariables.json")) + def compiler = compilerMap(cmakeVariables["CMAKE_C_COMPILER_ID"]) + def compilerVersion = (cmakeVariables["CMAKE_C_COMPILER_VERSION"] =~ /\d+/)[0] + + for (isShared in [true, false]) { + def dfpShared = isShared ? "True" : "False" + + def isWindows = osDir.getName() == "windows" + def libMask = (isWindows ? "" : "lib") + "ddfp" + (dfpShared ? "" : "Static") + versionSuffix + ".*" + + def c_runtime = null + def c_runtime_shared = null + if (osDir.getName() == "linux" && archDir.getName() == "musl-gcc") { + c_runtime = "musl" + c_runtime_shared = "False" + } + + def args = ['python3', 'conan_invoke.py', 'export-pkg', '.', '-of', 'conan_output', + '-s', "os=$os", + '-s', "build_type=$buildType", + '-s', "arch=$arch", + '-s', "compiler=$compiler", + '-s', "compiler.version=$compilerVersion", + '-o', "shared=$dfpShared", + '-o', "libPath=$archDir", + '-o', "libMask=$libMask"] + + if (c_runtime) + args = args + ['-o', "c_runtime=$c_runtime"] + if (c_runtime_shared) + args = args + ['-o', "c_runtime_shared=$c_runtime_shared"] + + exec { + workingDir "$rootDir/native" + commandLine args + } + } + } + } + } + } +} diff --git a/native/conan_invoke.py b/native/conan_invoke.py new file mode 100644 index 00000000..d4db8008 --- /dev/null +++ b/native/conan_invoke.py @@ -0,0 +1,6 @@ +from conans.conan import main +import sys + +if __name__ == "__main__": + sys.exit(main(sys.argv[1:])) + diff --git a/native/conanfile.py b/native/conanfile.py new file mode 100644 index 00000000..017df3cb --- /dev/null +++ b/native/conanfile.py @@ -0,0 +1,63 @@ +from conan import ConanFile +from conan.tools.files import copy +#from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps +import os +import re + +from conan.tools.scm import git + + +# https://docs.conan.io/2/reference/conanfile/attributes.html + + +def load_version(properties_filename): + with (open(properties_filename, 'r') as file): + for line in file: + if re.match("^\s*version\s*=", line): + return line[line.index("=") + 1:].strip().removesuffix("-SNAPSHOT") + + raise Exception("Can't determine version") + + +class DfpConan(ConanFile): + name = "dfp" + package_type = "library" + description = "Decimal Floating Point Arithmetic Library" + homepage = "https://github.com/epam/DFP/" + url = "https://github.com/epam/DFP.git" + license = ("Apache-2.0", "Intel") + topics = ("decimal", "dfp", "ieee-754", "deltix") + author = "Andrei Davydov (agdavydov81@gmail.com)" + settings = "os", "compiler", "build_type", "arch" + + options = { + "shared": [True, False], + "c_runtime": [None, "glibc", "musl", "libc"], + "c_runtime_shared": [None, True, False], + "libPath": [None, "ANY"], + "libMask": [None, "ANY"] + } + default_options = { + "shared": True, + "c_runtime": None, + "c_runtime_shared": None, + "libMask": None + } + + def set_version(self): + # Command line ``--version=xxxx`` will be assigned first to self.version and have priority + self.version = self.version or load_version(os.path.join(self.recipe_folder, "..", "gradle.properties")) + + def configure(self): + # it's a C library + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + self.libPath = f"{self.options.get_safe('libPath')}" + self.libMask = f"{self.options.get_safe('libMask')}" + self.options.rm_safe("libPath") + self.options.rm_safe("libMask") + + def package(self): + copy(self, pattern="DecimalNative.h*", src=self.recipe_folder, dst=os.path.join(self.package_folder, "include")) + copy(self, pattern=self.libMask, src=self.libPath, dst=os.path.join(self.package_folder, "lib")) From b87fe1b03dee974cfe2d0b61e786b6918f2d07ec Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Mon, 30 Oct 2023 20:51:57 +0300 Subject: [PATCH 38/90] Cxx: Reorganize native sources for next Conan recipe write. Move sources to src folder --- java/nativeWrappers/build.gradle | 6 +++--- .../src/main/java/com/epam/deltix/dfp/CxxWrappers.java | 3 +++ native/{ => src}/NativeImpl.c | 0 native/{ => src}/NativeImpl.h | 0 native/{ => src}/NativeImplToString.c | 0 native/{ => src}/NativeImplToString.h | 0 native/{ => src}/NativeMathImpl.c | 0 native/{ => src}/demo.cpp | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/CMakeLists.txt | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/README | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/RUNHPUX32 | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/RUNHPUX64 | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/RUNLINUX | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/RUNOSX | 0 .../thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/RUNOSXINTEL64 | 0 .../thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/RUNSOLARIS | 0 .../IntelRDFPMathLib20U2/EXAMPLES/RUNWINDOWS.bat | 0 .../IntelRDFPMathLib20U2/EXAMPLES/RUNWINDOWSINTEL64.bat | 0 .../thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_000 | 0 .../thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_001 | 0 .../thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_010 | 0 .../thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_011 | 0 .../thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_100 | 0 .../thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_101 | 0 .../thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_110 | 0 .../thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_111 | 0 .../thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/hpuxbuild32 | 0 .../thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/hpuxbuild64 | 0 .../thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/linuxbuild | 0 .../thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/main.c_000 | 0 .../thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/main.c_001 | 0 .../thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/main.c_010 | 0 .../thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/main.c_011 | 0 .../thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/main.c_100 | 0 .../thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/main.c_101 | 0 .../thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/main.c_110 | 0 .../thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/main.c_111 | 0 .../thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/solarisbuild | 0 .../IntelRDFPMathLib20U2/EXAMPLES/windowsbuild.bat | 0 .../IntelRDFPMathLib20U2/LIBRARY/.directory_exists | 0 .../thirdparty}/IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/README | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/RUNHPUX32 | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/RUNHPUX64 | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/RUNLINUX | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/RUNOSX | 0 .../thirdparty}/IntelRDFPMathLib20U2/LIBRARY/RUNOSXINTEL64 | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/RUNSOLARIS | 0 .../thirdparty}/IntelRDFPMathLib20U2/LIBRARY/RUNWINDOWS.bat | 0 .../IntelRDFPMathLib20U2/LIBRARY/RUNWINDOWSINTEL64.bat | 0 .../IntelRDFPMathLib20U2/LIBRARY/RUNWINDOWS_nmake.bat | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/architecture.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/assert.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/build.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/compiler.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_acosh_t.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_asinh.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_asinh_t.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_bessel_x.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_bid_x.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_cbrt.c | 0 .../LIBRARY/float128/dpml_cbrt_t_table.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_cbrt_x.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_cons_x.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_erf.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_erf_t.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_erf_x.h | 0 .../LIBRARY/float128/dpml_error_codes.c | 0 .../LIBRARY/float128/dpml_error_codes.h | 0 .../LIBRARY/float128/dpml_error_codes_enum.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exception.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exception.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exp.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exp_x.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_expm1.c | 0 .../LIBRARY/float128/dpml_four_over_pi.c | 0 .../LIBRARY/float128/dpml_function_info.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_globals.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_globals.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_int_x.h | 0 .../LIBRARY/float128/dpml_inv_hyper_x.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_inv_trig_x.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_lgamma.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_lgamma_t.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_lgamma_x.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log2_t.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log_t.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log_x.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_mod_x.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_names.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_pow.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_pow_cons.c | 0 .../LIBRARY/float128/dpml_pow_t_table.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_pow_x.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_powi_x.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_private.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_rdx_x.h | 0 .../LIBRARY/float128/dpml_special_exp.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_sqrt.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_sqrt_x.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_tgamma.c | 0 .../LIBRARY/float128/dpml_trig_reduce.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_trig_x.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_32_64.h | 0 .../LIBRARY/float128/dpml_ux_alpha_macros.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_bessel.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_bid.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_cbrt.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_cons.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_erf.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_exp.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_int.c | 0 .../LIBRARY/float128/dpml_ux_inv_hyper.c | 0 .../LIBRARY/float128/dpml_ux_inv_trig.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_lgamma.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_log.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_mod.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_ops.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_ops_64.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_pow.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_powi.c | 0 .../LIBRARY/float128/dpml_ux_radian_reduce.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_sqrt.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_trig.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/endian.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/f_format.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/i_format.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/ix86_macros.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/mphoc_functions.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/mphoc_macros.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/mtc_macros.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/op_system.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/poly_macros.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/sizeof.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/sqrt_macros.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/float128/sqrt_tab_t.c | 0 .../thirdparty}/IntelRDFPMathLib20U2/LIBRARY/hpuxbuild32 | 0 .../thirdparty}/IntelRDFPMathLib20U2/LIBRARY/hpuxbuild64 | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/linuxbuild | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/makefile | 0 .../IntelRDFPMathLib20U2/LIBRARY/makefile.iml_head | 0 .../IntelRDFPMathLib20U2/LIBRARY/makefile.iml_tail | 0 .../thirdparty}/IntelRDFPMathLib20U2/LIBRARY/makefile.mak | 0 .../thirdparty}/IntelRDFPMathLib20U2/LIBRARY/solarisbuild | 0 .../thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_2_str.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_2_str_macros.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_2_str_tables.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_acos.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_acosh.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_add.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_asin.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_asinh.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_atan.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_atan2.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_atanh.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_cbrt.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_compare.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_cos.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_cosh.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_div.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_erf.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_erfc.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_exp.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_exp10.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_exp2.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_expm1.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_fdimd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_fma.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_fmod.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_frexp.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_hypot.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_ldexp.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_lgamma.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_llquantexpd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_llrintd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_llround.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_log.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_log10.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_log1p.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_log2.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_logb.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_logbd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_lrintd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_lround.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_minmax.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_modf.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_mul.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_nearbyintd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_next.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_nexttowardd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_noncomp.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_pow.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_quantexpd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_quantize.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_quantumd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_rem.c | 0 .../LIBRARY/src/bid128_round_integral.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_scalb.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_scalbl.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_sin.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_sinh.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_sqrt.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_string.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_tan.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_tanh.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_tgamma.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int16.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int32.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int64.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int8.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint16.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint32.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint64.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint8.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_acos.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_acosh.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_add.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_asin.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_asinh.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_atan.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_atan2.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_atanh.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_cbrt.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_compare.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_cos.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_cosh.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_div.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_erf.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_erfc.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_exp.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_exp10.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_exp2.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_expm1.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_fdimd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_fma.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_fmod.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_frexp.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_hypot.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_ldexp.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_lgamma.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_llquantexpd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_llrintd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_llround.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_log.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_log10.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_log1p.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_log2.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_logb.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_logbd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_lrintd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_lround.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_minmax.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_modf.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_mul.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_nearbyintd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_next.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_nexttowardd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_noncomp.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_pow.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_quantexpd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_quantize.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_quantumd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_rem.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_round_integral.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_scalb.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_scalbl.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_sin.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_sinh.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_sqrt.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_string.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_sub.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_tan.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_tanh.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_tgamma.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_bid128.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_bid64.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int16.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int32.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int64.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int8.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint16.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint32.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint64.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint8.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_acos.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_acosh.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_add.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_asin.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_asinh.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_atan.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_atan2.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_atanh.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_cbrt.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_compare.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_cos.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_cosh.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_div.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_erf.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_erfc.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_exp.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_exp10.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_exp2.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_expm1.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_fdimd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_fma.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_fmod.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_frexp.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_hypot.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_ldexp.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_lgamma.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_llquantexpd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_llrintd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_llround.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_log.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_log10.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_log1p.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_log2.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_logb.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_logbd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_lrintd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_lround.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_minmax.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_modf.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_mul.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_nearbyintd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_next.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_nexttowardd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_noncomp.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_pow.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_quantexpd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_quantize.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_quantumd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_rem.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_round_integral.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_scalb.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_scalbl.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_sin.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_sinh.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_sqrt.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_string.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_tan.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_tanh.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_tgamma.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_bid128.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int16.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int32.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int64.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int8.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint16.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint32.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint64.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint8.c | 0 .../thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_b2d.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid_binarydecimal.c | 0 .../thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_conf.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid_convert_data.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid_decimal_data.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid_decimal_globals.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid_div_macros.h | 0 .../thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_dpd.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid_feclearexcept.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid_fegetexceptflag.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid_feraiseexcept.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid_fesetexceptflag.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid_fetestexcept.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid_flag_operations.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid_from_int.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid_functions.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid_gcc_intrinsics.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid_inline_add.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid_internal.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid_round.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid_sqrt_macros.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid_strtod.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid_trans.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/bid_wrap_names.h | 0 .../thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/dfp754.h | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/strtod128.c | 0 .../thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/strtod32.c | 0 .../thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/strtod64.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/src/wcstod128.c | 0 .../thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/wcstod32.c | 0 .../thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/wcstod64.c | 0 .../IntelRDFPMathLib20U2/LIBRARY/windowsbuild.bat | 0 .../IntelRDFPMathLib20U2/LIBRARY/windowsbuild_nmake.bat | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/README | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/TESTS/README | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/TESTS/RUNHPUX32 | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/TESTS/RUNHPUX64 | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/TESTS/RUNLINUX | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/TESTS/RUNOSX | 0 .../thirdparty}/IntelRDFPMathLib20U2/TESTS/RUNOSXINTEL64 | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/TESTS/RUNSOLARIS | 0 .../thirdparty}/IntelRDFPMathLib20U2/TESTS/RUNWINDOWS.bat | 0 .../IntelRDFPMathLib20U2/TESTS/RUNWINDOWSINTEL64.bat | 0 .../IntelRDFPMathLib20U2/TESTS/RUNWINDOWS_nmake.bat | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/TESTS/check | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/TESTS/hpuxbuild32 | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/TESTS/hpuxbuild64 | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/TESTS/linuxbuild | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/TESTS/makefile | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/TESTS/makefile.mak | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/TESTS/readtest.c | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/TESTS/readtest.h | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/TESTS/readtest.in | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/TESTS/solarisbuild | 0 .../thirdparty}/IntelRDFPMathLib20U2/TESTS/test_bid_conf.h | 0 .../IntelRDFPMathLib20U2/TESTS/test_bid_functions.h | 0 .../thirdparty}/IntelRDFPMathLib20U2/TESTS/windowsbuild.bat | 0 .../IntelRDFPMathLib20U2/TESTS/windowsbuild_nmake.bat | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/build.sh | 0 .../src/thirdparty}/IntelRDFPMathLib20U2/eula.txt | 0 {thirdparty => native/src/thirdparty}/README | 0 416 files changed, 6 insertions(+), 3 deletions(-) rename native/{ => src}/NativeImpl.c (100%) rename native/{ => src}/NativeImpl.h (100%) rename native/{ => src}/NativeImplToString.c (100%) rename native/{ => src}/NativeImplToString.h (100%) rename native/{ => src}/NativeMathImpl.c (100%) rename native/{ => src}/demo.cpp (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/CMakeLists.txt (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/README (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/RUNHPUX32 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/RUNHPUX64 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/RUNLINUX (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/RUNOSX (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/RUNOSXINTEL64 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/RUNSOLARIS (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/RUNWINDOWS.bat (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/RUNWINDOWSINTEL64.bat (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_000 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_001 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_010 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_011 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_100 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_101 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_110 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_111 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/hpuxbuild32 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/hpuxbuild64 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/linuxbuild (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/main.c_000 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/main.c_001 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/main.c_010 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/main.c_011 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/main.c_100 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/main.c_101 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/main.c_110 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/main.c_111 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/solarisbuild (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/EXAMPLES/windowsbuild.bat (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/.directory_exists (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/README (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/RUNHPUX32 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/RUNHPUX64 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/RUNLINUX (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/RUNOSX (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/RUNOSXINTEL64 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/RUNSOLARIS (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/RUNWINDOWS.bat (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/RUNWINDOWSINTEL64.bat (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/RUNWINDOWS_nmake.bat (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/architecture.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/assert.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/build.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/compiler.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_acosh_t.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_asinh.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_asinh_t.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_bessel_x.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_bid_x.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_cbrt.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_cbrt_t_table.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_cbrt_x.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_cons_x.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_erf.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_erf_t.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_erf_x.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_error_codes.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_error_codes.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_error_codes_enum.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exception.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exception.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exp.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exp_x.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_expm1.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_four_over_pi.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_function_info.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_globals.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_globals.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_int_x.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_inv_hyper_x.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_inv_trig_x.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_lgamma.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_lgamma_t.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_lgamma_x.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log2_t.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log_t.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log_x.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_mod_x.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_names.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_pow.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_pow_cons.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_pow_t_table.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_pow_x.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_powi_x.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_private.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_rdx_x.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_special_exp.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_sqrt.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_sqrt_x.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_tgamma.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_trig_reduce.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_trig_x.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_32_64.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_alpha_macros.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_bessel.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_bid.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_cbrt.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_cons.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_erf.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_exp.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_int.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_inv_hyper.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_inv_trig.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_lgamma.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_log.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_mod.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_ops.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_ops_64.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_pow.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_powi.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_radian_reduce.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_sqrt.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_trig.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/endian.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/f_format.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/i_format.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/ix86_macros.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/mphoc_functions.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/mphoc_macros.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/mtc_macros.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/op_system.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/poly_macros.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/sizeof.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/sqrt_macros.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/float128/sqrt_tab_t.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/hpuxbuild32 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/hpuxbuild64 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/linuxbuild (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/makefile (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/makefile.iml_head (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/makefile.iml_tail (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/makefile.mak (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/solarisbuild (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_2_str.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_2_str_macros.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_2_str_tables.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_acos.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_acosh.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_add.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_asin.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_asinh.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_atan.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_atan2.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_atanh.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_cbrt.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_compare.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_cos.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_cosh.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_div.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_erf.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_erfc.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_exp.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_exp10.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_exp2.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_expm1.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_fdimd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_fma.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_fmod.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_frexp.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_hypot.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_ldexp.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_lgamma.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_llquantexpd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_llrintd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_llround.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_log.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_log10.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_log1p.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_log2.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_logb.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_logbd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_lrintd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_lround.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_minmax.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_modf.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_mul.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_nearbyintd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_next.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_nexttowardd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_noncomp.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_pow.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_quantexpd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_quantize.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_quantumd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_rem.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_round_integral.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_scalb.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_scalbl.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_sin.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_sinh.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_sqrt.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_string.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_tan.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_tanh.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_tgamma.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int16.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int32.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int64.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int8.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint16.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint32.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint64.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint8.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_acos.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_acosh.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_add.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_asin.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_asinh.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_atan.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_atan2.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_atanh.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_cbrt.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_compare.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_cos.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_cosh.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_div.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_erf.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_erfc.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_exp.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_exp10.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_exp2.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_expm1.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_fdimd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_fma.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_fmod.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_frexp.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_hypot.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_ldexp.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_lgamma.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_llquantexpd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_llrintd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_llround.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_log.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_log10.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_log1p.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_log2.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_logb.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_logbd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_lrintd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_lround.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_minmax.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_modf.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_mul.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_nearbyintd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_next.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_nexttowardd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_noncomp.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_pow.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_quantexpd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_quantize.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_quantumd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_rem.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_round_integral.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_scalb.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_scalbl.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_sin.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_sinh.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_sqrt.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_string.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_sub.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_tan.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_tanh.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_tgamma.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_bid128.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_bid64.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int16.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int32.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int64.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int8.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint16.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint32.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint64.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint8.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_acos.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_acosh.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_add.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_asin.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_asinh.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_atan.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_atan2.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_atanh.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_cbrt.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_compare.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_cos.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_cosh.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_div.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_erf.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_erfc.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_exp.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_exp10.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_exp2.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_expm1.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_fdimd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_fma.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_fmod.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_frexp.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_hypot.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_ldexp.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_lgamma.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_llquantexpd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_llrintd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_llround.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_log.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_log10.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_log1p.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_log2.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_logb.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_logbd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_lrintd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_lround.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_minmax.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_modf.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_mul.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_nearbyintd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_next.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_nexttowardd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_noncomp.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_pow.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_quantexpd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_quantize.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_quantumd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_rem.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_round_integral.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_scalb.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_scalbl.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_sin.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_sinh.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_sqrt.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_string.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_tan.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_tanh.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_tgamma.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_bid128.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int16.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int32.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int64.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int8.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint16.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint32.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint64.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint8.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_b2d.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_binarydecimal.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_conf.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_convert_data.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_decimal_data.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_decimal_globals.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_div_macros.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_dpd.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_feclearexcept.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_fegetexceptflag.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_feraiseexcept.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_fesetexceptflag.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_fetestexcept.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_flag_operations.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_from_int.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_functions.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_gcc_intrinsics.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_inline_add.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_internal.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_round.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_sqrt_macros.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_strtod.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_trans.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/bid_wrap_names.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/dfp754.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/strtod128.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/strtod32.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/strtod64.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/wcstod128.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/wcstod32.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/src/wcstod64.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/windowsbuild.bat (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/LIBRARY/windowsbuild_nmake.bat (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/README (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/README (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/RUNHPUX32 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/RUNHPUX64 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/RUNLINUX (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/RUNOSX (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/RUNOSXINTEL64 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/RUNSOLARIS (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/RUNWINDOWS.bat (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/RUNWINDOWSINTEL64.bat (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/RUNWINDOWS_nmake.bat (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/check (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/hpuxbuild32 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/hpuxbuild64 (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/linuxbuild (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/makefile (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/makefile.mak (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/readtest.c (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/readtest.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/readtest.in (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/solarisbuild (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/test_bid_conf.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/test_bid_functions.h (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/windowsbuild.bat (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/TESTS/windowsbuild_nmake.bat (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/build.sh (100%) rename {thirdparty => native/src/thirdparty}/IntelRDFPMathLib20U2/eula.txt (100%) rename {thirdparty => native/src/thirdparty}/README (100%) diff --git a/java/nativeWrappers/build.gradle b/java/nativeWrappers/build.gradle index c0eda4ca..21ba924c 100644 --- a/java/nativeWrappers/build.gradle +++ b/java/nativeWrappers/build.gradle @@ -19,11 +19,11 @@ task makeNativeWrappersDfp(dependsOn: compileJava, type: JavaExec) { "$rootDir/native/NativeImpl.c", "$rootDir/java/dfp/build/generated/sources/nativeWrappers/com/epam/deltix/dfp/NativeImpl.java", "$rootDir/csharp/EPAM.Deltix.DFP/NativeImpl.cs", - "$rootDir/native" + "$rootDir/native/include" ] onlyIf { - !file("$rootDir/native/DecimalNative.h").exists() || - !file("$rootDir/native/DecimalNative.hpp").exists() || + !file("$rootDir/native/include/DecimalNative.h").exists() || + !file("$rootDir/native/include/DecimalNative.hpp").exists() || !file("$rootDir/java/dfp/build/generated/sources/nativeWrappers/com/epam/deltix/dfp/NativeImpl.java").exists() || !file("$rootDir/csharp/EPAM.Deltix.DFP/NativeImpl.cs").exists() } diff --git a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java index 268aa75f..54d6aed3 100644 --- a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java +++ b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java @@ -1,6 +1,7 @@ package com.epam.deltix.dfp; import java.io.BufferedWriter; +import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; @@ -16,6 +17,8 @@ public static void make(final String outputRoot, final List api, final final String dfpType = "decimal_native_t"; final String dfpClassType = "Decimal64_t"; + new File(outputRoot).mkdirs(); + try (final BufferedWriter outFileH = Files.newBufferedWriter(Paths.get(outputRoot, "DecimalNative.h"), StandardCharsets.UTF_8); final BufferedWriter outFileHpp = Files.newBufferedWriter(Paths.get(outputRoot, "DecimalNative.hpp"), StandardCharsets.UTF_8)) { diff --git a/native/NativeImpl.c b/native/src/NativeImpl.c similarity index 100% rename from native/NativeImpl.c rename to native/src/NativeImpl.c diff --git a/native/NativeImpl.h b/native/src/NativeImpl.h similarity index 100% rename from native/NativeImpl.h rename to native/src/NativeImpl.h diff --git a/native/NativeImplToString.c b/native/src/NativeImplToString.c similarity index 100% rename from native/NativeImplToString.c rename to native/src/NativeImplToString.c diff --git a/native/NativeImplToString.h b/native/src/NativeImplToString.h similarity index 100% rename from native/NativeImplToString.h rename to native/src/NativeImplToString.h diff --git a/native/NativeMathImpl.c b/native/src/NativeMathImpl.c similarity index 100% rename from native/NativeMathImpl.c rename to native/src/NativeMathImpl.c diff --git a/native/demo.cpp b/native/src/demo.cpp similarity index 100% rename from native/demo.cpp rename to native/src/demo.cpp diff --git a/thirdparty/IntelRDFPMathLib20U2/CMakeLists.txt b/native/src/thirdparty/IntelRDFPMathLib20U2/CMakeLists.txt similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/CMakeLists.txt rename to native/src/thirdparty/IntelRDFPMathLib20U2/CMakeLists.txt diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/README b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/README similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/README rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/README diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNHPUX32 b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNHPUX32 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNHPUX32 rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNHPUX32 diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNHPUX64 b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNHPUX64 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNHPUX64 rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNHPUX64 diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNLINUX b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNLINUX similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNLINUX rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNLINUX diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNOSX b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNOSX similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNOSX rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNOSX diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNOSXINTEL64 b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNOSXINTEL64 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNOSXINTEL64 rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNOSXINTEL64 diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNSOLARIS b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNSOLARIS similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNSOLARIS rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNSOLARIS diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNWINDOWS.bat b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNWINDOWS.bat similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNWINDOWS.bat rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNWINDOWS.bat diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNWINDOWSINTEL64.bat b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNWINDOWSINTEL64.bat similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNWINDOWSINTEL64.bat rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/RUNWINDOWSINTEL64.bat diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_000 b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_000 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_000 rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_000 diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_001 b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_001 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_001 rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_001 diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_010 b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_010 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_010 rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_010 diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_011 b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_011 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_011 rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_011 diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_100 b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_100 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_100 rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_100 diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_101 b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_101 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_101 rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_101 diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_110 b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_110 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_110 rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_110 diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_111 b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_111 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_111 rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/decimal.h_111 diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/hpuxbuild32 b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/hpuxbuild32 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/hpuxbuild32 rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/hpuxbuild32 diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/hpuxbuild64 b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/hpuxbuild64 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/hpuxbuild64 rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/hpuxbuild64 diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/linuxbuild b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/linuxbuild similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/linuxbuild rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/linuxbuild diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_000 b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_000 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_000 rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_000 diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_001 b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_001 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_001 rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_001 diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_010 b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_010 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_010 rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_010 diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_011 b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_011 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_011 rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_011 diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_100 b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_100 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_100 rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_100 diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_101 b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_101 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_101 rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_101 diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_110 b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_110 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_110 rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_110 diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_111 b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_111 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_111 rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/main.c_111 diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/solarisbuild b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/solarisbuild similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/solarisbuild rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/solarisbuild diff --git a/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/windowsbuild.bat b/native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/windowsbuild.bat similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/EXAMPLES/windowsbuild.bat rename to native/src/thirdparty/IntelRDFPMathLib20U2/EXAMPLES/windowsbuild.bat diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/.directory_exists b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/.directory_exists similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/.directory_exists rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/.directory_exists diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/CMakeLists.txt diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/README b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/README similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/README rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/README diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNHPUX32 b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNHPUX32 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNHPUX32 rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNHPUX32 diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNHPUX64 b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNHPUX64 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNHPUX64 rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNHPUX64 diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNLINUX b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNLINUX similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNLINUX rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNLINUX diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNOSX b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNOSX similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNOSX rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNOSX diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNOSXINTEL64 b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNOSXINTEL64 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNOSXINTEL64 rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNOSXINTEL64 diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNSOLARIS b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNSOLARIS similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNSOLARIS rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNSOLARIS diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNWINDOWS.bat b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNWINDOWS.bat similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNWINDOWS.bat rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNWINDOWS.bat diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNWINDOWSINTEL64.bat b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNWINDOWSINTEL64.bat similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNWINDOWSINTEL64.bat rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNWINDOWSINTEL64.bat diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNWINDOWS_nmake.bat b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNWINDOWS_nmake.bat similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNWINDOWS_nmake.bat rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/RUNWINDOWS_nmake.bat diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/architecture.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/architecture.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/architecture.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/architecture.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/assert.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/assert.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/assert.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/assert.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/build.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/build.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/build.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/build.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/compiler.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/compiler.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/compiler.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/compiler.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_acosh_t.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_acosh_t.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_acosh_t.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_acosh_t.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_asinh.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_asinh.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_asinh.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_asinh.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_asinh_t.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_asinh_t.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_asinh_t.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_asinh_t.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_bessel_x.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_bessel_x.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_bessel_x.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_bessel_x.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_bid_x.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_bid_x.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_bid_x.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_bid_x.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_cbrt.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_cbrt.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_cbrt.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_cbrt.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_cbrt_t_table.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_cbrt_t_table.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_cbrt_t_table.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_cbrt_t_table.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_cbrt_x.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_cbrt_x.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_cbrt_x.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_cbrt_x.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_cons_x.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_cons_x.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_cons_x.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_cons_x.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_erf.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_erf.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_erf.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_erf.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_erf_t.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_erf_t.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_erf_t.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_erf_t.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_erf_x.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_erf_x.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_erf_x.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_erf_x.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_error_codes.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_error_codes.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_error_codes.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_error_codes.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_error_codes.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_error_codes.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_error_codes.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_error_codes.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_error_codes_enum.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_error_codes_enum.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_error_codes_enum.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_error_codes_enum.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exception.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exception.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exception.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exception.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exception.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exception.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exception.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exception.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exp.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exp.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exp.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exp.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exp_x.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exp_x.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exp_x.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exp_x.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_expm1.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_expm1.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_expm1.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_expm1.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_four_over_pi.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_four_over_pi.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_four_over_pi.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_four_over_pi.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_function_info.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_function_info.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_function_info.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_function_info.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_globals.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_globals.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_globals.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_globals.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_globals.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_globals.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_globals.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_globals.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_int_x.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_int_x.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_int_x.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_int_x.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_inv_hyper_x.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_inv_hyper_x.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_inv_hyper_x.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_inv_hyper_x.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_inv_trig_x.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_inv_trig_x.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_inv_trig_x.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_inv_trig_x.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_lgamma.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_lgamma.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_lgamma.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_lgamma.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_lgamma_t.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_lgamma_t.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_lgamma_t.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_lgamma_t.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_lgamma_x.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_lgamma_x.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_lgamma_x.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_lgamma_x.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log2_t.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log2_t.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log2_t.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log2_t.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log_t.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log_t.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log_t.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log_t.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log_x.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log_x.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log_x.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_log_x.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_mod_x.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_mod_x.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_mod_x.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_mod_x.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_names.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_names.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_names.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_names.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_pow.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_pow.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_pow.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_pow.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_pow_cons.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_pow_cons.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_pow_cons.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_pow_cons.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_pow_t_table.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_pow_t_table.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_pow_t_table.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_pow_t_table.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_pow_x.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_pow_x.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_pow_x.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_pow_x.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_powi_x.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_powi_x.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_powi_x.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_powi_x.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_private.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_private.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_private.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_private.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_rdx_x.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_rdx_x.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_rdx_x.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_rdx_x.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_special_exp.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_special_exp.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_special_exp.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_special_exp.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_sqrt.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_sqrt.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_sqrt.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_sqrt.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_sqrt_x.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_sqrt_x.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_sqrt_x.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_sqrt_x.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_tgamma.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_tgamma.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_tgamma.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_tgamma.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_trig_reduce.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_trig_reduce.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_trig_reduce.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_trig_reduce.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_trig_x.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_trig_x.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_trig_x.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_trig_x.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_32_64.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_32_64.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_32_64.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_32_64.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_alpha_macros.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_alpha_macros.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_alpha_macros.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_alpha_macros.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_bessel.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_bessel.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_bessel.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_bessel.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_bid.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_bid.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_bid.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_bid.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_cbrt.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_cbrt.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_cbrt.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_cbrt.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_cons.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_cons.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_cons.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_cons.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_erf.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_erf.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_erf.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_erf.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_exp.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_exp.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_exp.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_exp.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_int.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_int.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_int.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_int.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_inv_hyper.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_inv_hyper.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_inv_hyper.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_inv_hyper.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_inv_trig.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_inv_trig.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_inv_trig.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_inv_trig.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_lgamma.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_lgamma.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_lgamma.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_lgamma.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_log.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_log.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_log.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_log.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_mod.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_mod.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_mod.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_mod.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_ops.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_ops.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_ops.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_ops.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_ops_64.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_ops_64.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_ops_64.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_ops_64.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_pow.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_pow.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_pow.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_pow.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_powi.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_powi.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_powi.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_powi.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_radian_reduce.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_radian_reduce.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_radian_reduce.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_radian_reduce.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_sqrt.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_sqrt.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_sqrt.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_sqrt.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_trig.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_trig.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_trig.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_trig.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/endian.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/endian.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/endian.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/endian.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/f_format.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/f_format.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/f_format.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/f_format.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/i_format.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/i_format.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/i_format.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/i_format.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/ix86_macros.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/ix86_macros.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/ix86_macros.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/ix86_macros.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/mphoc_functions.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/mphoc_functions.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/mphoc_functions.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/mphoc_functions.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/mphoc_macros.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/mphoc_macros.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/mphoc_macros.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/mphoc_macros.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/mtc_macros.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/mtc_macros.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/mtc_macros.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/mtc_macros.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/op_system.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/op_system.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/op_system.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/op_system.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/poly_macros.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/poly_macros.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/poly_macros.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/poly_macros.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/sizeof.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/sizeof.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/sizeof.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/sizeof.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/sqrt_macros.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/sqrt_macros.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/sqrt_macros.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/sqrt_macros.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/sqrt_tab_t.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/sqrt_tab_t.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/sqrt_tab_t.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/sqrt_tab_t.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/hpuxbuild32 b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/hpuxbuild32 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/hpuxbuild32 rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/hpuxbuild32 diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/hpuxbuild64 b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/hpuxbuild64 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/hpuxbuild64 rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/hpuxbuild64 diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/linuxbuild b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/linuxbuild similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/linuxbuild rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/linuxbuild diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/makefile b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/makefile similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/makefile rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/makefile diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/makefile.iml_head b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/makefile.iml_head similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/makefile.iml_head rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/makefile.iml_head diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/makefile.iml_tail b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/makefile.iml_tail similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/makefile.iml_tail rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/makefile.iml_tail diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/makefile.mak b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/makefile.mak similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/makefile.mak rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/makefile.mak diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/solarisbuild b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/solarisbuild similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/solarisbuild rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/solarisbuild diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_2_str.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_2_str.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_2_str.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_2_str.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_2_str_macros.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_2_str_macros.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_2_str_macros.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_2_str_macros.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_2_str_tables.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_2_str_tables.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_2_str_tables.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_2_str_tables.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_acos.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_acos.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_acos.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_acos.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_acosh.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_acosh.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_acosh.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_acosh.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_add.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_add.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_add.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_add.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_asin.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_asin.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_asin.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_asin.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_asinh.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_asinh.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_asinh.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_asinh.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_atan.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_atan.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_atan.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_atan.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_atan2.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_atan2.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_atan2.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_atan2.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_atanh.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_atanh.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_atanh.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_atanh.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_cbrt.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_cbrt.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_cbrt.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_cbrt.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_compare.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_compare.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_compare.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_compare.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_cos.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_cos.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_cos.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_cos.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_cosh.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_cosh.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_cosh.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_cosh.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_div.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_div.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_div.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_div.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_erf.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_erf.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_erf.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_erf.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_erfc.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_erfc.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_erfc.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_erfc.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_exp.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_exp.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_exp.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_exp.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_exp10.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_exp10.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_exp10.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_exp10.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_exp2.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_exp2.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_exp2.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_exp2.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_expm1.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_expm1.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_expm1.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_expm1.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_fdimd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_fdimd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_fdimd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_fdimd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_fma.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_fma.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_fma.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_fma.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_fmod.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_fmod.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_fmod.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_fmod.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_frexp.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_frexp.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_frexp.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_frexp.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_hypot.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_hypot.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_hypot.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_hypot.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_ldexp.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_ldexp.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_ldexp.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_ldexp.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_lgamma.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_lgamma.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_lgamma.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_lgamma.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_llquantexpd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_llquantexpd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_llquantexpd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_llquantexpd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_llrintd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_llrintd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_llrintd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_llrintd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_llround.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_llround.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_llround.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_llround.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_log.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_log.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_log.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_log.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_log10.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_log10.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_log10.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_log10.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_log1p.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_log1p.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_log1p.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_log1p.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_log2.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_log2.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_log2.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_log2.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_logb.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_logb.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_logb.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_logb.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_logbd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_logbd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_logbd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_logbd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_lrintd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_lrintd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_lrintd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_lrintd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_lround.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_lround.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_lround.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_lround.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_minmax.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_minmax.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_minmax.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_minmax.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_modf.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_modf.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_modf.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_modf.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_mul.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_mul.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_mul.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_mul.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_nearbyintd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_nearbyintd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_nearbyintd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_nearbyintd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_next.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_next.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_next.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_next.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_nexttowardd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_nexttowardd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_nexttowardd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_nexttowardd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_noncomp.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_noncomp.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_noncomp.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_noncomp.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_pow.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_pow.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_pow.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_pow.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_quantexpd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_quantexpd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_quantexpd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_quantexpd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_quantize.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_quantize.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_quantize.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_quantize.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_quantumd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_quantumd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_quantumd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_quantumd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_rem.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_rem.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_rem.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_rem.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_round_integral.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_round_integral.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_round_integral.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_round_integral.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_scalb.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_scalb.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_scalb.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_scalb.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_scalbl.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_scalbl.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_scalbl.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_scalbl.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_sin.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_sin.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_sin.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_sin.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_sinh.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_sinh.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_sinh.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_sinh.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_sqrt.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_sqrt.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_sqrt.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_sqrt.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_string.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_string.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_string.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_string.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_tan.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_tan.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_tan.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_tan.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_tanh.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_tanh.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_tanh.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_tanh.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_tgamma.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_tgamma.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_tgamma.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_tgamma.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int16.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int16.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int16.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int16.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int32.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int32.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int32.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int32.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int64.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int64.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int64.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int64.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int8.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int8.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int8.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int8.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint16.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint16.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint16.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint16.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint32.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint32.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint32.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint32.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint64.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint64.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint64.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint64.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint8.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint8.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint8.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_uint8.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_acos.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_acos.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_acos.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_acos.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_acosh.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_acosh.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_acosh.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_acosh.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_add.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_add.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_add.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_add.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_asin.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_asin.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_asin.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_asin.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_asinh.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_asinh.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_asinh.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_asinh.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_atan.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_atan.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_atan.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_atan.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_atan2.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_atan2.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_atan2.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_atan2.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_atanh.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_atanh.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_atanh.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_atanh.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_cbrt.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_cbrt.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_cbrt.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_cbrt.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_compare.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_compare.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_compare.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_compare.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_cos.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_cos.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_cos.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_cos.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_cosh.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_cosh.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_cosh.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_cosh.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_div.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_div.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_div.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_div.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_erf.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_erf.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_erf.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_erf.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_erfc.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_erfc.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_erfc.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_erfc.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_exp.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_exp.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_exp.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_exp.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_exp10.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_exp10.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_exp10.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_exp10.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_exp2.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_exp2.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_exp2.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_exp2.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_expm1.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_expm1.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_expm1.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_expm1.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_fdimd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_fdimd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_fdimd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_fdimd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_fma.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_fma.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_fma.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_fma.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_fmod.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_fmod.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_fmod.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_fmod.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_frexp.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_frexp.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_frexp.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_frexp.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_hypot.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_hypot.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_hypot.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_hypot.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_ldexp.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_ldexp.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_ldexp.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_ldexp.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_lgamma.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_lgamma.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_lgamma.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_lgamma.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_llquantexpd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_llquantexpd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_llquantexpd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_llquantexpd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_llrintd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_llrintd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_llrintd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_llrintd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_llround.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_llround.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_llround.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_llround.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_log.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_log.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_log.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_log.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_log10.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_log10.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_log10.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_log10.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_log1p.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_log1p.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_log1p.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_log1p.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_log2.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_log2.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_log2.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_log2.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_logb.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_logb.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_logb.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_logb.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_logbd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_logbd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_logbd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_logbd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_lrintd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_lrintd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_lrintd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_lrintd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_lround.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_lround.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_lround.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_lround.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_minmax.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_minmax.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_minmax.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_minmax.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_modf.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_modf.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_modf.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_modf.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_mul.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_mul.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_mul.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_mul.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_nearbyintd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_nearbyintd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_nearbyintd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_nearbyintd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_next.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_next.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_next.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_next.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_nexttowardd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_nexttowardd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_nexttowardd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_nexttowardd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_noncomp.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_noncomp.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_noncomp.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_noncomp.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_pow.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_pow.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_pow.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_pow.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_quantexpd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_quantexpd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_quantexpd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_quantexpd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_quantize.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_quantize.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_quantize.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_quantize.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_quantumd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_quantumd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_quantumd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_quantumd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_rem.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_rem.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_rem.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_rem.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_round_integral.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_round_integral.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_round_integral.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_round_integral.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_scalb.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_scalb.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_scalb.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_scalb.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_scalbl.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_scalbl.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_scalbl.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_scalbl.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_sin.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_sin.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_sin.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_sin.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_sinh.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_sinh.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_sinh.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_sinh.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_sqrt.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_sqrt.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_sqrt.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_sqrt.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_string.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_string.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_string.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_string.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_sub.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_sub.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_sub.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_sub.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_tan.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_tan.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_tan.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_tan.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_tanh.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_tanh.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_tanh.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_tanh.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_tgamma.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_tgamma.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_tgamma.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_tgamma.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_bid128.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_bid128.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_bid128.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_bid128.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_bid64.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_bid64.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_bid64.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_bid64.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int16.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int16.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int16.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int16.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int32.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int32.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int32.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int32.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int64.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int64.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int64.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int64.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int8.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int8.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int8.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_int8.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint16.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint16.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint16.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint16.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint32.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint32.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint32.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint32.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint64.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint64.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint64.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint64.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint8.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint8.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint8.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid32_to_uint8.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_acos.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_acos.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_acos.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_acos.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_acosh.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_acosh.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_acosh.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_acosh.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_add.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_add.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_add.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_add.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_asin.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_asin.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_asin.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_asin.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_asinh.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_asinh.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_asinh.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_asinh.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_atan.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_atan.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_atan.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_atan.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_atan2.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_atan2.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_atan2.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_atan2.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_atanh.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_atanh.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_atanh.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_atanh.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_cbrt.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_cbrt.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_cbrt.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_cbrt.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_compare.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_compare.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_compare.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_compare.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_cos.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_cos.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_cos.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_cos.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_cosh.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_cosh.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_cosh.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_cosh.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_div.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_div.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_div.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_div.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_erf.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_erf.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_erf.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_erf.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_erfc.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_erfc.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_erfc.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_erfc.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_exp.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_exp.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_exp.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_exp.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_exp10.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_exp10.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_exp10.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_exp10.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_exp2.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_exp2.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_exp2.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_exp2.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_expm1.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_expm1.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_expm1.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_expm1.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_fdimd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_fdimd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_fdimd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_fdimd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_fma.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_fma.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_fma.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_fma.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_fmod.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_fmod.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_fmod.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_fmod.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_frexp.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_frexp.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_frexp.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_frexp.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_hypot.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_hypot.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_hypot.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_hypot.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_ldexp.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_ldexp.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_ldexp.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_ldexp.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_lgamma.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_lgamma.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_lgamma.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_lgamma.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_llquantexpd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_llquantexpd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_llquantexpd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_llquantexpd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_llrintd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_llrintd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_llrintd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_llrintd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_llround.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_llround.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_llround.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_llround.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_log.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_log.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_log.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_log.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_log10.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_log10.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_log10.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_log10.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_log1p.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_log1p.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_log1p.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_log1p.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_log2.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_log2.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_log2.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_log2.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_logb.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_logb.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_logb.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_logb.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_logbd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_logbd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_logbd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_logbd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_lrintd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_lrintd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_lrintd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_lrintd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_lround.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_lround.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_lround.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_lround.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_minmax.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_minmax.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_minmax.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_minmax.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_modf.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_modf.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_modf.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_modf.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_mul.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_mul.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_mul.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_mul.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_nearbyintd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_nearbyintd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_nearbyintd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_nearbyintd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_next.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_next.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_next.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_next.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_nexttowardd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_nexttowardd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_nexttowardd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_nexttowardd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_noncomp.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_noncomp.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_noncomp.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_noncomp.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_pow.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_pow.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_pow.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_pow.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_quantexpd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_quantexpd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_quantexpd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_quantexpd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_quantize.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_quantize.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_quantize.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_quantize.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_quantumd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_quantumd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_quantumd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_quantumd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_rem.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_rem.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_rem.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_rem.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_round_integral.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_round_integral.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_round_integral.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_round_integral.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_scalb.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_scalb.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_scalb.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_scalb.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_scalbl.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_scalbl.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_scalbl.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_scalbl.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_sin.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_sin.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_sin.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_sin.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_sinh.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_sinh.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_sinh.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_sinh.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_sqrt.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_sqrt.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_sqrt.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_sqrt.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_string.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_string.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_string.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_string.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_tan.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_tan.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_tan.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_tan.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_tanh.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_tanh.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_tanh.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_tanh.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_tgamma.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_tgamma.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_tgamma.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_tgamma.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_bid128.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_bid128.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_bid128.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_bid128.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int16.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int16.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int16.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int16.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int32.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int32.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int32.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int32.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int64.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int64.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int64.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int64.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int8.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int8.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int8.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_int8.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint16.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint16.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint16.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint16.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint32.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint32.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint32.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint32.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint64.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint64.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint64.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint64.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint8.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint8.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint8.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_uint8.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_b2d.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_b2d.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_b2d.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_b2d.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_binarydecimal.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_binarydecimal.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_binarydecimal.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_binarydecimal.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_conf.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_conf.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_conf.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_conf.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_convert_data.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_convert_data.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_convert_data.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_convert_data.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_decimal_data.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_decimal_data.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_decimal_data.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_decimal_data.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_decimal_globals.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_decimal_globals.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_decimal_globals.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_decimal_globals.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_div_macros.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_div_macros.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_div_macros.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_div_macros.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_dpd.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_dpd.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_dpd.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_dpd.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_feclearexcept.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_feclearexcept.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_feclearexcept.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_feclearexcept.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_fegetexceptflag.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_fegetexceptflag.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_fegetexceptflag.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_fegetexceptflag.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_feraiseexcept.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_feraiseexcept.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_feraiseexcept.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_feraiseexcept.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_fesetexceptflag.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_fesetexceptflag.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_fesetexceptflag.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_fesetexceptflag.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_fetestexcept.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_fetestexcept.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_fetestexcept.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_fetestexcept.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_flag_operations.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_flag_operations.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_flag_operations.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_flag_operations.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_from_int.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_from_int.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_from_int.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_from_int.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_functions.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_functions.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_functions.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_functions.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_gcc_intrinsics.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_gcc_intrinsics.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_gcc_intrinsics.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_gcc_intrinsics.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_inline_add.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_inline_add.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_inline_add.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_inline_add.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_internal.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_internal.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_internal.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_internal.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_round.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_round.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_round.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_round.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_sqrt_macros.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_sqrt_macros.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_sqrt_macros.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_sqrt_macros.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_strtod.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_strtod.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_strtod.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_strtod.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_trans.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_trans.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_trans.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_trans.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_wrap_names.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_wrap_names.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_wrap_names.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_wrap_names.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/dfp754.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/dfp754.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/dfp754.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/dfp754.h diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/strtod128.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/strtod128.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/strtod128.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/strtod128.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/strtod32.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/strtod32.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/strtod32.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/strtod32.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/strtod64.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/strtod64.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/strtod64.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/strtod64.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/wcstod128.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/wcstod128.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/wcstod128.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/wcstod128.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/wcstod32.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/wcstod32.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/wcstod32.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/wcstod32.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/wcstod64.c b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/wcstod64.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/wcstod64.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/wcstod64.c diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/windowsbuild.bat b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/windowsbuild.bat similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/windowsbuild.bat rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/windowsbuild.bat diff --git a/thirdparty/IntelRDFPMathLib20U2/LIBRARY/windowsbuild_nmake.bat b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/windowsbuild_nmake.bat similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/LIBRARY/windowsbuild_nmake.bat rename to native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/windowsbuild_nmake.bat diff --git a/thirdparty/IntelRDFPMathLib20U2/README b/native/src/thirdparty/IntelRDFPMathLib20U2/README similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/README rename to native/src/thirdparty/IntelRDFPMathLib20U2/README diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/README b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/README similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/README rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/README diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNHPUX32 b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNHPUX32 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/RUNHPUX32 rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNHPUX32 diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNHPUX64 b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNHPUX64 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/RUNHPUX64 rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNHPUX64 diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNLINUX b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNLINUX similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/RUNLINUX rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNLINUX diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNOSX b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNOSX similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/RUNOSX rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNOSX diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNOSXINTEL64 b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNOSXINTEL64 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/RUNOSXINTEL64 rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNOSXINTEL64 diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNSOLARIS b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNSOLARIS similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/RUNSOLARIS rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNSOLARIS diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNWINDOWS.bat b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNWINDOWS.bat similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/RUNWINDOWS.bat rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNWINDOWS.bat diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNWINDOWSINTEL64.bat b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNWINDOWSINTEL64.bat similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/RUNWINDOWSINTEL64.bat rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNWINDOWSINTEL64.bat diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNWINDOWS_nmake.bat b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNWINDOWS_nmake.bat similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/RUNWINDOWS_nmake.bat rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/RUNWINDOWS_nmake.bat diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/check b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/check similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/check rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/check diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/hpuxbuild32 b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/hpuxbuild32 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/hpuxbuild32 rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/hpuxbuild32 diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/hpuxbuild64 b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/hpuxbuild64 similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/hpuxbuild64 rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/hpuxbuild64 diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/linuxbuild b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/linuxbuild similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/linuxbuild rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/linuxbuild diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/makefile b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/makefile similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/makefile rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/makefile diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/makefile.mak b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/makefile.mak similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/makefile.mak rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/makefile.mak diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/readtest.c b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/readtest.c similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/readtest.c rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/readtest.c diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/readtest.h b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/readtest.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/readtest.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/readtest.h diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/readtest.in b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/readtest.in similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/readtest.in rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/readtest.in diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/solarisbuild b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/solarisbuild similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/solarisbuild rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/solarisbuild diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/test_bid_conf.h b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/test_bid_conf.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/test_bid_conf.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/test_bid_conf.h diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/test_bid_functions.h b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/test_bid_functions.h similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/test_bid_functions.h rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/test_bid_functions.h diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/windowsbuild.bat b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/windowsbuild.bat similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/windowsbuild.bat rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/windowsbuild.bat diff --git a/thirdparty/IntelRDFPMathLib20U2/TESTS/windowsbuild_nmake.bat b/native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/windowsbuild_nmake.bat similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/TESTS/windowsbuild_nmake.bat rename to native/src/thirdparty/IntelRDFPMathLib20U2/TESTS/windowsbuild_nmake.bat diff --git a/thirdparty/IntelRDFPMathLib20U2/build.sh b/native/src/thirdparty/IntelRDFPMathLib20U2/build.sh similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/build.sh rename to native/src/thirdparty/IntelRDFPMathLib20U2/build.sh diff --git a/thirdparty/IntelRDFPMathLib20U2/eula.txt b/native/src/thirdparty/IntelRDFPMathLib20U2/eula.txt similarity index 100% rename from thirdparty/IntelRDFPMathLib20U2/eula.txt rename to native/src/thirdparty/IntelRDFPMathLib20U2/eula.txt diff --git a/thirdparty/README b/native/src/thirdparty/README similarity index 100% rename from thirdparty/README rename to native/src/thirdparty/README From 4f0e4e12b4600daa4973df0960c3a49a8910c838 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Mon, 30 Oct 2023 21:00:10 +0300 Subject: [PATCH 39/90] CI: Cxx: Switch to the compilation with the OsX runners and remove osxcross submodule. --- .gitmodules | 3 --- osxcross | 1 - 2 files changed, 4 deletions(-) delete mode 160000 osxcross diff --git a/.gitmodules b/.gitmodules index 0dab058e..b1371347 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ [submodule "NativeUtils"] path = NativeUtils url = https://github.com/epam/NativeUtils.git -[submodule "osxcross"] - path = osxcross - url = https://github.com/tpoechtrager/osxcross.git diff --git a/osxcross b/osxcross deleted file mode 160000 index 551d1927..00000000 --- a/osxcross +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 551d192714e075f0ec23e48fead7a60b0caf565e From 35ce4d4176493a432aa23738f3adea38b9f14802 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Tue, 31 Oct 2023 00:56:14 +0300 Subject: [PATCH 40/90] Cxx: Prepare for Conan-compatible compilation [skip ci] --- native/CMakeLists.txt | 104 +++++++++++++------------- native/build.gradle | 83 ++++++++------------ native/src/NativeImpl.h | 2 +- native/test_package/conanfile.py | 20 +++++ native/{src => test_package}/demo.cpp | 0 5 files changed, 105 insertions(+), 104 deletions(-) create mode 100644 native/test_package/conanfile.py rename native/{src => test_package}/demo.cpp (100%) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 1059906e..7d44b179 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -24,7 +24,7 @@ message(STATUS "CMAKE_CROSSCOMPILING: " ${CMAKE_CROSSCOMPILING}) message(STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS}) message(STATUS "CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS}) -file(WRITE ./bin/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX}/cmakevariables.json "\ +file(WRITE ${CMAKE_INSTALL_PREFIX}/cmakevariables.json "\ {\n\ \"CMAKE_SYSTEM_NAME\": \"${CMAKE_SYSTEM_NAME}\",\n\ \"CMAKE_TOOLCHAIN_FILE\": \"${CMAKE_TOOLCHAIN_FILE}\",\n\ @@ -75,54 +75,56 @@ if (MSVC) add_definitions(-DNOMINMAX) endif() -add_subdirectory (../thirdparty/IntelRDFPMathLib20U2/LIBRARY LIBRARY) - -add_library(dfp SHARED NativeImpl.c) -target_compile_definitions(dfp PRIVATE API_PREFIX=ddfp${VERSION_SUFFIX}_ JAVA_PREFIX=com_epam_deltix_dfp_NativeImpl_ DECIMALNATIVE_SHARED_LIBRARY DECIMALNATIVE_EXPORTS) -target_link_libraries(dfp LINK_PUBLIC bid) +file(GLOB BID_SRCS + src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/*.c + src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_bid.c + src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_bessel.c + src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_cbrt.c + src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_erf.c + src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_exp.c + src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_int.c + src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_inv_hyper.c + src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_inv_trig.c + src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_lgamma.c + src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_log.c + src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_mod.c + src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_powi.c + src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_pow.c + src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_sqrt.c + src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_trig.c + src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_ops.c + src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_ops_64.c + src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_four_over_pi.c + src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exception.c + src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/sqrt_tab_t.c + src/NativeImplToString.c) + +file(GLOB PUBLIC_HEADERS "include/*") + +add_library(dfp SHARED ${BID_SRCS} src/NativeImpl.c) +include_directories(src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src) +target_compile_definitions(dfp PRIVATE API_PREFIX=ddfp${VERSION_SUFFIX}_ ${JAVA_PREFIX}) set_target_properties(dfp PROPERTIES OUTPUT_NAME "ddfp${VERSION_SUFFIX}") -install(TARGETS dfp DESTINATION ./bin/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX}) - -add_library(dfpmath SHARED NativeMathImpl.c) -target_compile_definitions(dfpmath PRIVATE API_PREFIX=ddfpmath${VERSION_SUFFIX}_ JAVA_PREFIX=com_epam_deltix_dfpmath_NativeMathImpl_) -target_link_libraries(dfpmath LINK_PUBLIC bid) -set_target_properties(dfpmath PROPERTIES OUTPUT_NAME "ddfpmath${VERSION_SUFFIX}") -install(TARGETS dfpmath DESTINATION ./binmath/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX}) - -file(GLOB BID_SRCS_STATIC - ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/*.c - ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_bid.c - ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_bessel.c - ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_cbrt.c - ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_erf.c - ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_exp.c - ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_int.c - ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_inv_hyper.c - ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_inv_trig.c - ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_lgamma.c - ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_log.c - ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_mod.c - ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_powi.c - ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_pow.c - ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_sqrt.c - ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_trig.c - ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_ops.c - ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_ux_ops_64.c - ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_four_over_pi.c - ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/dpml_exception.c - ../thirdparty/IntelRDFPMathLib20U2/LIBRARY/float128/sqrt_tab_t.c - NativeImplToString.c) - -add_library(dfpStatic STATIC NativeImpl.c ${BID_SRCS_STATIC}) -include_directories(../thirdparty/IntelRDFPMathLib20U2/LIBRARY/src) -target_compile_definitions(dfpStatic PRIVATE API_PREFIX=ddfp${VERSION_SUFFIX}_ NOJAVA) -set_target_properties(dfpStatic PROPERTIES OUTPUT_NAME "ddfpStatic${VERSION_SUFFIX}") -install(TARGETS dfpStatic DESTINATION ./bin/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX}) - -if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - add_executable(demoStatic demo.cpp) - target_link_libraries(demoStatic LINK_PRIVATE dfpStatic) - - add_executable(demo demo.cpp) - target_link_libraries(demo LINK_PRIVATE dfp) -endif() +set_target_properties(dfp PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}") +install(TARGETS dfp) + +#add_library(dfpmath SHARED ${BID_SRCS} src/NativeMathImpl.c) +#include_directories(src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src) +#target_compile_definitions(dfpmath PRIVATE API_PREFIX=ddfpmath${VERSION_SUFFIX}_ JAVA_PREFIX=com_epam_deltix_dfpmath_NativeMathImpl_) +#set_target_properties(dfpmath PROPERTIES OUTPUT_NAME "ddfpmath${VERSION_SUFFIX}") +#install(TARGETS dfpmath) + + +#add_library(dfpStatic STATIC NativeImpl.c ${BID_SRCS}) +#include_directories(../thirdparty/IntelRDFPMathLib20U2/LIBRARY/src) +#target_compile_definitions(dfpStatic PRIVATE API_PREFIX=ddfp${VERSION_SUFFIX}_ NOJAVA) +#set_target_properties(dfpStatic PROPERTIES OUTPUT_NAME "ddfpStatic${VERSION_SUFFIX}") +#install(TARGETS dfpStatic DESTINATION ./bin/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX}) + +#if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") +# add_executable(demoStatic demo.cpp) +# target_link_libraries(demoStatic LINK_PRIVATE dfpStatic) + +# add_executable(demo demo.cpp) +# target_link_libraries(demo LINK_PRIVATE dfp) +#endif() diff --git a/native/build.gradle b/native/build.gradle index 7fa3ffd3..ee40dd6f 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -6,16 +6,17 @@ def CCOMPILER = "clang" def CXXCOMPILER = "clang++" def VERBOSE = "ON" def keepBuildDir = (findProperty('keepBuildDir')?.toBoolean()) ?: false +def javaPrefix = "com_epam_deltix_dfp_NativeImpl_" task makeNativeWindowsI386(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { - def installSuffix = 'windows/i386' + def installPrefix = '../install/windows/i386' def buildRoot = "$rootDir/native/buildI386" doLast { project.mkdir buildRoot exec { workingDir buildRoot - commandLine 'cmake', '-A', 'Win32', '-T', 'ClangCL', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_INSTALL_PREFIX=../", "-DINSTALL_SUFFIX=$installSuffix", "../" + commandLine 'cmake', '-A', 'Win32', '-T', 'ClangCL', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "../" } exec { workingDir buildRoot @@ -32,21 +33,19 @@ task makeNativeWindowsI386(dependsOn: ':java:nativeWrappers:makeNativeWrappers') } onlyIf { - !file("$rootDir/native/bin/Release/$installSuffix/ddfp${versionSuffix}.dll").exists() || - !file("$rootDir/native/bin/Release/$installSuffix/ddfpStatic${versionSuffix}.lib").exists() || - !file("$rootDir/native/binmath/Release/$installSuffix/ddfpmath${versionSuffix}.dll").exists() + !file("$buildRoot/$installPrefix").exists() } } task makeNativeWindowsAmd64(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { - def installSuffix = 'windows/amd64' + def installPrefix = '../install/windows/amd64' def buildRoot = "$rootDir/native/buildAmd64" doLast { project.mkdir buildRoot exec { workingDir buildRoot - commandLine 'cmake', '-A', 'x64', '-T', 'ClangCL', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_INSTALL_PREFIX=../", "-DINSTALL_SUFFIX=$installSuffix", "../" + commandLine 'cmake', '-A', 'x64', '-T', 'ClangCL', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "../" } exec { workingDir buildRoot @@ -63,9 +62,7 @@ task makeNativeWindowsAmd64(dependsOn: ':java:nativeWrappers:makeNativeWrappers' } onlyIf { - !file("$rootDir/native/bin/Release/$installSuffix/ddfp${versionSuffix}.dll").exists() || - !file("$rootDir/native/bin/Release/$installSuffix/ddfpStatic${versionSuffix}.lib").exists() || - !file("$rootDir/native/binmath/Release/$installSuffix/ddfpmath${versionSuffix}.dll").exists() + !file("$buildRoot/$installPrefix").exists() } } @@ -74,7 +71,7 @@ task makeNativeWindows(dependsOn: [makeNativeWindowsI386, makeNativeWindowsAmd64 task makeNativeLinuxArm7(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { def llvmToolset = 'clang+llvm-14.0.6-armv7a-linux-gnueabihf' - def installSuffix = 'linux/arm' + def installPrefix = '../install/linux/arm' def buildRoot = "$rootDir/native/buildArm7" doLast { @@ -99,7 +96,7 @@ task makeNativeLinuxArm7(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { project.mkdir buildRoot exec { workingDir buildRoot - commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=$CCOMPILER", "-DCMAKE_CXX_COMPILER=$CXXCOMPILER", "-DTARGET=arm-linux-gnueabihf", "-DTARGET_EX=-march=armv7a -mfloat-abi=hard", "-DSYSROOT=$llvmRoot/$llvmToolset", "-DCMAKE_INSTALL_PREFIX=../", "-DINSTALL_SUFFIX=$installSuffix", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libc++", "../" + commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=$CCOMPILER", "-DCMAKE_CXX_COMPILER=$CXXCOMPILER", "-DTARGET=arm-linux-gnueabihf", "-DTARGET_EX=-march=armv7a -mfloat-abi=hard", "-DSYSROOT=$llvmRoot/$llvmToolset", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libc++", "../" } exec { workingDir buildRoot @@ -116,16 +113,14 @@ task makeNativeLinuxArm7(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { } onlyIf { - !file("$rootDir/native/bin/Release/$installSuffix/libddfp${versionSuffix}.so").exists() || - !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || - !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.so").exists() + !file("$buildRoot/$installPrefix").exists() } } task makeNativeLinuxAArch64(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { def target = 'aarch64-linux-gnu' def llvmToolset = "clang+llvm-14.0.6-$target" - def installSuffix = 'linux/aarch64' + def installPrefix = '../install/linux/aarch64' def buildRoot = "$rootDir/native/buildAArch64" doLast { @@ -150,7 +145,7 @@ task makeNativeLinuxAArch64(dependsOn: ':java:nativeWrappers:makeNativeWrappers' project.mkdir buildRoot exec { workingDir buildRoot - commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=$CCOMPILER", "-DCMAKE_CXX_COMPILER=$CXXCOMPILER", "-DTARGET=$target", "-DSYSROOT=$llvmRoot/$llvmToolset", "-DCMAKE_INSTALL_PREFIX=../", "-DINSTALL_SUFFIX=$installSuffix", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libc++", "../" + commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=$CCOMPILER", "-DCMAKE_CXX_COMPILER=$CXXCOMPILER", "-DTARGET=$target", "-DSYSROOT=$llvmRoot/$llvmToolset", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libc++", "../" } exec { workingDir buildRoot @@ -167,15 +162,13 @@ task makeNativeLinuxAArch64(dependsOn: ':java:nativeWrappers:makeNativeWrappers' } onlyIf { - !file("$rootDir/native/bin/Release/$installSuffix/libddfp${versionSuffix}.so").exists() || - !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || - !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.so").exists() + !file("$buildRoot/$installPrefix").exists() } } task makeNativeLinuxI386(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { def target = 'i686-linux-gnu' - def installSuffix = 'linux/i386' + def installPrefix = '../install/linux/i386' def buildRoot = "$rootDir/native/buildI386" doLast { @@ -188,7 +181,7 @@ task makeNativeLinuxI386(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { project.mkdir buildRoot exec { workingDir buildRoot - commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=$CCOMPILER", "-DCMAKE_CXX_COMPILER=$CXXCOMPILER", "-DTARGET=$target", "-DTARGET_EX=-m32", "-DCMAKE_INSTALL_PREFIX=../", "-DINSTALL_SUFFIX=$installSuffix", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libstdc++", "../" + commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=$CCOMPILER", "-DCMAKE_CXX_COMPILER=$CXXCOMPILER", "-DTARGET=$target", "-DTARGET_EX=-m32", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libstdc++", "../" } exec { workingDir buildRoot @@ -205,21 +198,19 @@ task makeNativeLinuxI386(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { } onlyIf { - !file("$rootDir/native/bin/Release/$installSuffix/libddfp${versionSuffix}.so").exists() || - !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || - !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.so").exists() + !file("$buildRoot/$installPrefix").exists() } } task makeNativeLinuxAmd64(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { - def installSuffix = 'linux/amd64' + def installPrefix = '../install/linux/amd64' def buildRoot = "$rootDir/native/buildAmd64" doLast { project.mkdir buildRoot exec { workingDir buildRoot - commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=$CCOMPILER", "-DCMAKE_CXX_COMPILER=$CXXCOMPILER", "-DCMAKE_INSTALL_PREFIX=../", "-DINSTALL_SUFFIX=$installSuffix", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libstdc++", "../" + commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=$CCOMPILER", "-DCMAKE_CXX_COMPILER=$CXXCOMPILER", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libstdc++", "../" } exec { workingDir buildRoot @@ -236,14 +227,12 @@ task makeNativeLinuxAmd64(dependsOn: ':java:nativeWrappers:makeNativeWrappers') } onlyIf { - !file("$rootDir/native/bin/Release/$installSuffix/libddfp${versionSuffix}.so").exists() || - !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || - !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.so").exists() + !file("$buildRoot/$installPrefix").exists() } } task makeNativeLinuxMuslGcc(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { - def installSuffix = 'linux/musl-gcc' + def installPrefix = '../install/linux/musl-gcc' def buildRoot = "$rootDir/native/buildMusl" doLast { @@ -256,7 +245,7 @@ task makeNativeLinuxMuslGcc(dependsOn: ':java:nativeWrappers:makeNativeWrappers' project.mkdir buildRoot exec { workingDir buildRoot - commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=musl-gcc", "-DCMAKE_CXX_COMPILER=musl-gcc", "-DCMAKE_INSTALL_PREFIX=../", "-DINSTALL_SUFFIX=$installSuffix", "-DCMAKE_C_FLAGS_IN=-static", "-DCMAKE_CXX_FLAGS_IN=-static", "../" + commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=musl-gcc", "-DCMAKE_CXX_COMPILER=musl-gcc", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "-DCMAKE_C_FLAGS_IN=-static", "-DCMAKE_CXX_FLAGS_IN=-static", "../" } exec { workingDir buildRoot @@ -273,9 +262,7 @@ task makeNativeLinuxMuslGcc(dependsOn: ':java:nativeWrappers:makeNativeWrappers' } onlyIf { - !file("$rootDir/native/bin/Release/$installSuffix/libddfp${versionSuffix}.so").exists() || - !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || - !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.so").exists() + !file("$buildRoot/$installPrefix").exists() } } @@ -283,14 +270,14 @@ task makeNativeLinux(dependsOn: [makeNativeLinuxArm7, makeNativeLinuxAArch64, ma } task makeNativeDarwinAmd64(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { - def installSuffix = 'darwin/amd64' + def installPrefix = '../install/darwin/amd64' def buildRoot = "$rootDir/native/buildAmd64" doLast { project.mkdir buildRoot exec { workingDir buildRoot - commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_INSTALL_PREFIX=../", "-DINSTALL_SUFFIX=$installSuffix", "-DAPPLE=TRUE", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libc++", "../" + commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "-DAPPLE=TRUE", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libc++", "../" } exec { workingDir buildRoot @@ -307,21 +294,19 @@ task makeNativeDarwinAmd64(dependsOn: ':java:nativeWrappers:makeNativeWrappers') } onlyIf { - !file("$rootDir/native/bin/Release/$installSuffix/libddfp${versionSuffix}.dylib").exists() || - !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || - !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.dylib").exists() + !file("$buildRoot/$installPrefix").exists() } } task makeNativeDarwinAArch64(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { - def installSuffix = 'darwin/aarch64' + def installPrefix = '../install/darwin/aarch64' def buildRoot = "$rootDir/native/buildAArch64" doLast { project.mkdir buildRoot exec { workingDir buildRoot - commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_INSTALL_PREFIX=../", "-DINSTALL_SUFFIX=$installSuffix", "-DAPPLE=TRUE", "-DCMAKE_C_FLAGS_IN=-target arm64-apple-macos11", "-DCMAKE_CXX_FLAGS_IN=-target arm64-apple-macos11 -stdlib=libc++", "../" + commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "-DAPPLE=TRUE", "-DCMAKE_C_FLAGS_IN=-target arm64-apple-macos11", "-DCMAKE_CXX_FLAGS_IN=-target arm64-apple-macos11 -stdlib=libc++", "../" } exec { workingDir buildRoot @@ -338,9 +323,7 @@ task makeNativeDarwinAArch64(dependsOn: ':java:nativeWrappers:makeNativeWrappers } onlyIf { - !file("$rootDir/native/bin/Release/$installSuffix/libddfp${versionSuffix}.dylib").exists() || - !file("$rootDir/native/bin/Release/$installSuffix/libddfpStatic${versionSuffix}.a").exists() || - !file("$rootDir/native/binmath/Release/$installSuffix/libddfpmath${versionSuffix}.dylib").exists() + !file("$buildRoot/$installPrefix").exists() } } @@ -350,16 +333,12 @@ task makeNativeDarwin(dependsOn: [makeNativeDarwinAArch64, makeNativeDarwinAmd64 task nativeBinUnpack { doLast { exec { - workingDir "$rootDir/native/bin" - commandLine 'zstd', '-d', '--rm', '-r', '.' - } - exec { - workingDir "$rootDir/native/binmath" + workingDir "$rootDir/native/install" commandLine 'zstd', '-d', '--rm', '-r', '.' } } onlyIf { - !file("$rootDir/native/bin/Release/windows/amd64/ddfp${versionSuffix}.dll").exists() + !file("$rootDir/native/install/windows/amd64/ddfp${versionSuffix}.dll").exists() } } @@ -395,7 +374,7 @@ static String compilerMap(String str) { task nativeBinPublishConan(dependsOn: nativeBinUnpack) { doLast { - file("$rootDir/native/bin").eachDir { buildTypeDir -> + file("$rootDir/native/install").eachDir { buildTypeDir -> def buildType = buildTypeDir.getName() buildTypeDir.eachDir { osDir -> diff --git a/native/src/NativeImpl.h b/native/src/NativeImpl.h index 116c1fdd..77d11ffd 100644 --- a/native/src/NativeImpl.h +++ b/native/src/NativeImpl.h @@ -8,7 +8,7 @@ #endif #ifndef JAVA_PREFIX -#define JAVA_PREFIX com_epam_deltix_dfp_NativeImpl_ +#define NOJAVA #endif #if defined(_WIN32) diff --git a/native/test_package/conanfile.py b/native/test_package/conanfile.py new file mode 100644 index 00000000..9d752806 --- /dev/null +++ b/native/test_package/conanfile.py @@ -0,0 +1,20 @@ +from conan import ConanFile +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps +from conan.tools.build import cross_building + + +class TestExampleConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def build_requirements(self): + self.tool_requires("dfp/[>=1.0.2]") + + def test(self): + if not cross_building(self): + self.run("./test_package_example") diff --git a/native/src/demo.cpp b/native/test_package/demo.cpp similarity index 100% rename from native/src/demo.cpp rename to native/test_package/demo.cpp From 3a29a612eb115840745c98dd120de480dbc01339 Mon Sep 17 00:00:00 2001 From: agdavydov81 Date: Tue, 31 Oct 2023 00:59:33 +0300 Subject: [PATCH 41/90] CI: Reorganize repository --- .github/workflows/Build.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 0cc743ec..b53907e2 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -33,8 +33,7 @@ jobs: ./csharp/EPAM.Deltix.DFP/Version.targets ./csharp/EPAM.Deltix.DFPMath/NativeMathImpl.cs ./csharp/EPAM.Deltix.DFPMath/Version.targets - ./native/DecimalNative.h - ./native/DecimalNative.hpp + ./native/include* retention-days: 7 build-native-linux: @@ -60,7 +59,7 @@ jobs: with: name: build-native-linux path: | - ./*native/bin* + ./*native/install* retention-days: 7 build-native-windows: @@ -83,7 +82,7 @@ jobs: with: name: build-native-windows path: | - ./*native/bin* + ./*native/install* retention-days: 7 build-native-macos: @@ -104,7 +103,7 @@ jobs: with: name: build-native-macos path: | - ./*native/bin* + ./*native/install* retention-days: 7 compress-native: @@ -131,22 +130,20 @@ jobs: - name: compress run: | zstd --version - zstd -19 --rm -r ./native/bin - zstd -19 --rm -r ./native/binmath + zstd -19 --rm -r ./native/install - uses: actions/upload-artifact@v3 with: name: compress-native path: | ./gradle.properties - ./*native/bin* + ./*native/install* ./*java/dfp/build/generated/sources/nativeWrappers/com/epam/deltix/dfp* ./*java/dfp-math/build/generated/sources/nativeWrappers/com/epam/deltix/dfpmath* ./csharp/EPAM.Deltix.DFP/NativeImpl.cs ./csharp/EPAM.Deltix.DFP/Version.targets ./csharp/EPAM.Deltix.DFPMath/NativeMathImpl.cs ./csharp/EPAM.Deltix.DFPMath/Version.targets - ./native/DecimalNative.h - ./native/DecimalNative.hpp + ./native/include* retention-days: 7 build-java: From f569ff47f53a1bb2a65bdafa502e9525846e1738 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Tue, 31 Oct 2023 01:09:25 +0300 Subject: [PATCH 42/90] CI: Fix wrappers generation --- build.gradle | 3 +++ java/nativeWrappers/build.gradle | 8 ++++---- native/build.gradle | 1 - 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index d8605b4f..6bba0aaa 100644 --- a/build.gradle +++ b/build.gradle @@ -28,4 +28,7 @@ allprojects { return ["major": versionMajor, "minor": versionMinor, "build": versionBuild, "commit": versionCommit, "three": version, "four": version4, "suffix": versionSuffix, "sha": versionSha] } + + project.ext.set("javaPrefix", "com_epam_deltix_dfp_NativeImpl_") + project.ext.set("javaMathPrefix", "com_epam_deltix_dfpmath_NativeMathImpl_") } diff --git a/java/nativeWrappers/build.gradle b/java/nativeWrappers/build.gradle index 21ba924c..ea53390c 100644 --- a/java/nativeWrappers/build.gradle +++ b/java/nativeWrappers/build.gradle @@ -15,8 +15,8 @@ task makeNativeWrappersDfp(dependsOn: compileJava, type: JavaExec) { def ver = versioning() args = [ver["three"], ver["suffix"], ver["sha"], "ddfp" + ver["suffix"] + "_", - "com_epam_deltix_dfp_NativeImpl_", - "$rootDir/native/NativeImpl.c", + javaPrefix, + "$rootDir/native/src/NativeImpl.c", "$rootDir/java/dfp/build/generated/sources/nativeWrappers/com/epam/deltix/dfp/NativeImpl.java", "$rootDir/csharp/EPAM.Deltix.DFP/NativeImpl.cs", "$rootDir/native/include" @@ -36,8 +36,8 @@ task makeNativeWrappersDfpMath(dependsOn: compileJava, type: JavaExec) { def ver = versioning() args = [ver["three"], ver["suffix"], ver["sha"], "ddfpmath" + ver["suffix"] + "_", - "com_epam_deltix_dfpmath_NativeMathImpl_", - "$rootDir/native/NativeMathImpl.c", + javaMathPrefix, + "$rootDir/native/src/NativeMathImpl.c", "$rootDir/java/dfp-math/build/generated/sources/nativeWrappers/com/epam/deltix/dfpmath/NativeMathImpl.java", "$rootDir/csharp/EPAM.Deltix.DFPMath/NativeMathImpl.cs", "" diff --git a/native/build.gradle b/native/build.gradle index ee40dd6f..17a118f0 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -6,7 +6,6 @@ def CCOMPILER = "clang" def CXXCOMPILER = "clang++" def VERBOSE = "ON" def keepBuildDir = (findProperty('keepBuildDir')?.toBoolean()) ?: false -def javaPrefix = "com_epam_deltix_dfp_NativeImpl_" task makeNativeWindowsI386(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { def installPrefix = '../install/windows/i386' From e60504a909181f25829eea2c1ac6dfbe8b887292 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Tue, 31 Oct 2023 03:05:38 +0300 Subject: [PATCH 43/90] Java: DFP: Fix native resources preparation. --- java/dfpNativeTests/build.gradle | 43 ++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/java/dfpNativeTests/build.gradle b/java/dfpNativeTests/build.gradle index 514bc821..43b61991 100644 --- a/java/dfpNativeTests/build.gradle +++ b/java/dfpNativeTests/build.gradle @@ -1,3 +1,6 @@ +import java.nio.file.Files +import java.nio.file.Paths + plugins { id "me.champeau.jmh" version "0.7.1" } @@ -18,7 +21,7 @@ sourceSets { "$rootDir/NativeUtils/java/main/src/main/java", "$rootDir/NativeUtils/Zstandard/java/src/main/java"] - test.resources.srcDirs += "$rootDir/native/binJava/Release/" + test.resources.srcDirs += "$rootDir/native/installJava/" } dependencies { @@ -31,20 +34,40 @@ dependencies { compileJava.dependsOn ":java:nativeWrappers:makeNativeWrappersDfp" +def versionSuffix = versioning()["suffix"] + task copyNativeDfpResourcesMuslToAmd64(type: Copy) { - from "$rootDir/native/bin/Release/linux/musl" - into "$rootDir/native/binJava/Release/resources_com_epam_deltix_dfp/linux/amd64" - include '**/*.so.zst' + from "$rootDir/native/install/linux/musl-gcc/lib" + into "$rootDir/native/installJava/resources_com_epam_deltix_dfp/linux/amd64" + include "**/*ddfp${versionSuffix}.so.zst" +} + +static void deleteEmptyFolders(String startingDir) { + Files.walk(Paths.get(startingDir)).each { path -> + if (Files.isDirectory(path) && Files.list(path).count() == 0) { + Files.delete(path) + } + } } task copyNativeDfpResources(type: Copy, dependsOn: copyNativeDfpResourcesMuslToAmd64) { - from "$rootDir/native/bin/Release" - into "$rootDir/native/binJava/Release/resources_com_epam_deltix_dfp" - include '**/*.dylib.zst' - include '**/*.so.zst' - include '**/*.dll.zst' + from "$rootDir/native/install" + into "$rootDir/native/installJava/resources_com_epam_deltix_dfp" + include "**/*ddfp${versionSuffix}.dylib.zst" + include "**/*ddfp${versionSuffix}.so.zst" + include "**/*ddfp${versionSuffix}.dll.zst" exclude 'linux/amd64/**' - exclude 'linux/musl/**' + exclude 'linux/musl-gcc/**' + + eachFile { fileCopyDetails -> + // Copy one level up from the lib or bin directory + def relative = fileCopyDetails.relativePath + fileCopyDetails.relativePath = relative.getParent().append(true, "..", relative.getLastName()) + } + + doLast { + deleteEmptyFolders("$rootDir/native/installJava/resources_com_epam_deltix_dfp") + } } compileJava.dependsOn(copyNativeDfpResources) From 02d6a15bba483de6652bd202b4803f6b77163e90 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Tue, 31 Oct 2023 03:17:33 +0300 Subject: [PATCH 44/90] Cxx: Fix JNI generation --- native/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 7d44b179..02b3d9b6 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -103,7 +103,10 @@ file(GLOB PUBLIC_HEADERS "include/*") add_library(dfp SHARED ${BID_SRCS} src/NativeImpl.c) include_directories(src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src) -target_compile_definitions(dfp PRIVATE API_PREFIX=ddfp${VERSION_SUFFIX}_ ${JAVA_PREFIX}) +target_compile_definitions(dfp PRIVATE API_PREFIX=ddfp${VERSION_SUFFIX}_) +if (JAVA_PREFIX) + target_compile_definitions(dfp PRIVATE JAVA_PREFIX=${JAVA_PREFIX}) +endif() set_target_properties(dfp PROPERTIES OUTPUT_NAME "ddfp${VERSION_SUFFIX}") set_target_properties(dfp PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}") install(TARGETS dfp) From 4d9a282e30f486ddb063c98d32c4f094c46bb25e Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Tue, 31 Oct 2023 03:30:20 +0300 Subject: [PATCH 45/90] Cxx: Enable dfpMath compilation. --- native/CMakeLists.txt | 13 ++++++++----- native/build.gradle | 18 +++++++++--------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 02b3d9b6..adda7926 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -111,11 +111,14 @@ set_target_properties(dfp PROPERTIES OUTPUT_NAME "ddfp${VERSION_SUFFIX}") set_target_properties(dfp PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}") install(TARGETS dfp) -#add_library(dfpmath SHARED ${BID_SRCS} src/NativeMathImpl.c) -#include_directories(src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src) -#target_compile_definitions(dfpmath PRIVATE API_PREFIX=ddfpmath${VERSION_SUFFIX}_ JAVA_PREFIX=com_epam_deltix_dfpmath_NativeMathImpl_) -#set_target_properties(dfpmath PROPERTIES OUTPUT_NAME "ddfpmath${VERSION_SUFFIX}") -#install(TARGETS dfpmath) +add_library(dfpmath SHARED ${BID_SRCS} src/NativeMathImpl.c) +include_directories(src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src) +target_compile_definitions(dfpmath PRIVATE API_PREFIX=ddfpmath${VERSION_SUFFIX}_) +if (JAVA_MATH_PREFIX) + target_compile_definitions(dfpmath PRIVATE JAVA_PREFIX=${JAVA_MATH_PREFIX}) +endif() +set_target_properties(dfpmath PROPERTIES OUTPUT_NAME "ddfpmath${VERSION_SUFFIX}") +install(TARGETS dfpmath) #add_library(dfpStatic STATIC NativeImpl.c ${BID_SRCS}) diff --git a/native/build.gradle b/native/build.gradle index 17a118f0..feb0e95d 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -15,7 +15,7 @@ task makeNativeWindowsI386(dependsOn: ':java:nativeWrappers:makeNativeWrappers') project.mkdir buildRoot exec { workingDir buildRoot - commandLine 'cmake', '-A', 'Win32', '-T', 'ClangCL', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "../" + commandLine 'cmake', '-A', 'Win32', '-T', 'ClangCL', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "-DJAVA_MATH_PREFIX=$javaMathPrefix", "../" } exec { workingDir buildRoot @@ -44,7 +44,7 @@ task makeNativeWindowsAmd64(dependsOn: ':java:nativeWrappers:makeNativeWrappers' project.mkdir buildRoot exec { workingDir buildRoot - commandLine 'cmake', '-A', 'x64', '-T', 'ClangCL', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "../" + commandLine 'cmake', '-A', 'x64', '-T', 'ClangCL', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "-DJAVA_MATH_PREFIX=$javaMathPrefix", "../" } exec { workingDir buildRoot @@ -95,7 +95,7 @@ task makeNativeLinuxArm7(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { project.mkdir buildRoot exec { workingDir buildRoot - commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=$CCOMPILER", "-DCMAKE_CXX_COMPILER=$CXXCOMPILER", "-DTARGET=arm-linux-gnueabihf", "-DTARGET_EX=-march=armv7a -mfloat-abi=hard", "-DSYSROOT=$llvmRoot/$llvmToolset", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libc++", "../" + commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=$CCOMPILER", "-DCMAKE_CXX_COMPILER=$CXXCOMPILER", "-DTARGET=arm-linux-gnueabihf", "-DTARGET_EX=-march=armv7a -mfloat-abi=hard", "-DSYSROOT=$llvmRoot/$llvmToolset", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "-DJAVA_MATH_PREFIX=$javaMathPrefix", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libc++", "../" } exec { workingDir buildRoot @@ -144,7 +144,7 @@ task makeNativeLinuxAArch64(dependsOn: ':java:nativeWrappers:makeNativeWrappers' project.mkdir buildRoot exec { workingDir buildRoot - commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=$CCOMPILER", "-DCMAKE_CXX_COMPILER=$CXXCOMPILER", "-DTARGET=$target", "-DSYSROOT=$llvmRoot/$llvmToolset", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libc++", "../" + commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=$CCOMPILER", "-DCMAKE_CXX_COMPILER=$CXXCOMPILER", "-DTARGET=$target", "-DSYSROOT=$llvmRoot/$llvmToolset", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "-DJAVA_MATH_PREFIX=$javaMathPrefix", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libc++", "../" } exec { workingDir buildRoot @@ -180,7 +180,7 @@ task makeNativeLinuxI386(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { project.mkdir buildRoot exec { workingDir buildRoot - commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=$CCOMPILER", "-DCMAKE_CXX_COMPILER=$CXXCOMPILER", "-DTARGET=$target", "-DTARGET_EX=-m32", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libstdc++", "../" + commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=$CCOMPILER", "-DCMAKE_CXX_COMPILER=$CXXCOMPILER", "-DTARGET=$target", "-DTARGET_EX=-m32", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "-DJAVA_MATH_PREFIX=$javaMathPrefix", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libstdc++", "../" } exec { workingDir buildRoot @@ -209,7 +209,7 @@ task makeNativeLinuxAmd64(dependsOn: ':java:nativeWrappers:makeNativeWrappers') project.mkdir buildRoot exec { workingDir buildRoot - commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=$CCOMPILER", "-DCMAKE_CXX_COMPILER=$CXXCOMPILER", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libstdc++", "../" + commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=$CCOMPILER", "-DCMAKE_CXX_COMPILER=$CXXCOMPILER", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "-DJAVA_MATH_PREFIX=$javaMathPrefix", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libstdc++", "../" } exec { workingDir buildRoot @@ -244,7 +244,7 @@ task makeNativeLinuxMuslGcc(dependsOn: ':java:nativeWrappers:makeNativeWrappers' project.mkdir buildRoot exec { workingDir buildRoot - commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=musl-gcc", "-DCMAKE_CXX_COMPILER=musl-gcc", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "-DCMAKE_C_FLAGS_IN=-static", "-DCMAKE_CXX_FLAGS_IN=-static", "../" + commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_C_COMPILER=musl-gcc", "-DCMAKE_CXX_COMPILER=musl-gcc", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "-DJAVA_MATH_PREFIX=$javaMathPrefix", "-DCMAKE_C_FLAGS_IN=-static", "-DCMAKE_CXX_FLAGS_IN=-static", "../" } exec { workingDir buildRoot @@ -276,7 +276,7 @@ task makeNativeDarwinAmd64(dependsOn: ':java:nativeWrappers:makeNativeWrappers') project.mkdir buildRoot exec { workingDir buildRoot - commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "-DAPPLE=TRUE", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libc++", "../" + commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "-DJAVA_MATH_PREFIX=$javaMathPrefix", "-DAPPLE=TRUE", "-DCMAKE_CXX_FLAGS_IN=-stdlib=libc++", "../" } exec { workingDir buildRoot @@ -305,7 +305,7 @@ task makeNativeDarwinAArch64(dependsOn: ':java:nativeWrappers:makeNativeWrappers project.mkdir buildRoot exec { workingDir buildRoot - commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "-DAPPLE=TRUE", "-DCMAKE_C_FLAGS_IN=-target arm64-apple-macos11", "-DCMAKE_CXX_FLAGS_IN=-target arm64-apple-macos11 -stdlib=libc++", "../" + commandLine 'cmake', '-G', 'Unix Makefiles', "-DVERSION_SUFFIX=$versionSuffix", "-DCMAKE_VERBOSE_MAKEFILE=$VERBOSE", "-DCMAKE_INSTALL_PREFIX=$installPrefix", "-DJAVA_PREFIX=$javaPrefix", "-DJAVA_MATH_PREFIX=$javaMathPrefix", "-DAPPLE=TRUE", "-DCMAKE_C_FLAGS_IN=-target arm64-apple-macos11", "-DCMAKE_CXX_FLAGS_IN=-target arm64-apple-macos11 -stdlib=libc++", "../" } exec { workingDir buildRoot From 0c37f29ef04ba0e95a0b3b9889f2ac710555cb2f Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Tue, 31 Oct 2023 03:53:42 +0300 Subject: [PATCH 46/90] Java: Fix resources preparation. Compression: replace call with gradle task. [skip ci] --- java/dfpNativeTests/build.gradle | 31 +++++-------------------------- native/build.gradle | 30 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 26 deletions(-) diff --git a/java/dfpNativeTests/build.gradle b/java/dfpNativeTests/build.gradle index 43b61991..d7f966dc 100644 --- a/java/dfpNativeTests/build.gradle +++ b/java/dfpNativeTests/build.gradle @@ -1,6 +1,3 @@ -import java.nio.file.Files -import java.nio.file.Paths - plugins { id "me.champeau.jmh" version "0.7.1" } @@ -21,7 +18,7 @@ sourceSets { "$rootDir/NativeUtils/java/main/src/main/java", "$rootDir/NativeUtils/Zstandard/java/src/main/java"] - test.resources.srcDirs += "$rootDir/native/installJava/" + test.resources.srcDirs += "$rootDir/native/binJava/" } dependencies { @@ -37,37 +34,19 @@ compileJava.dependsOn ":java:nativeWrappers:makeNativeWrappersDfp" def versionSuffix = versioning()["suffix"] task copyNativeDfpResourcesMuslToAmd64(type: Copy) { - from "$rootDir/native/install/linux/musl-gcc/lib" - into "$rootDir/native/installJava/resources_com_epam_deltix_dfp/linux/amd64" + from "$rootDir/native/bin/Release/linux/musl" + into "$rootDir/native/binJava/Release/resources_com_epam_deltix_dfp/linux/amd64" include "**/*ddfp${versionSuffix}.so.zst" } -static void deleteEmptyFolders(String startingDir) { - Files.walk(Paths.get(startingDir)).each { path -> - if (Files.isDirectory(path) && Files.list(path).count() == 0) { - Files.delete(path) - } - } -} - task copyNativeDfpResources(type: Copy, dependsOn: copyNativeDfpResourcesMuslToAmd64) { - from "$rootDir/native/install" - into "$rootDir/native/installJava/resources_com_epam_deltix_dfp" + from "$rootDir/native/bin" + into "$rootDir/native/binJava/resources_com_epam_deltix_dfp" include "**/*ddfp${versionSuffix}.dylib.zst" include "**/*ddfp${versionSuffix}.so.zst" include "**/*ddfp${versionSuffix}.dll.zst" exclude 'linux/amd64/**' exclude 'linux/musl-gcc/**' - - eachFile { fileCopyDetails -> - // Copy one level up from the lib or bin directory - def relative = fileCopyDetails.relativePath - fileCopyDetails.relativePath = relative.getParent().append(true, "..", relative.getLastName()) - } - - doLast { - deleteEmptyFolders("$rootDir/native/installJava/resources_com_epam_deltix_dfp") - } } compileJava.dependsOn(copyNativeDfpResources) diff --git a/native/build.gradle b/native/build.gradle index feb0e95d..ce15496f 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -1,5 +1,8 @@ import groovy.json.JsonSlurper +import java.nio.file.Files +import java.nio.file.Paths + def llvmRoot = "$rootDir/llvm" def versionSuffix = versioning()["suffix"] def CCOMPILER = "clang" @@ -329,6 +332,33 @@ task makeNativeDarwinAArch64(dependsOn: ':java:nativeWrappers:makeNativeWrappers task makeNativeDarwin(dependsOn: [makeNativeDarwinAArch64, makeNativeDarwinAmd64]) { } +task nativeInstallToBin(type: Copy) { + from "$rootDir/native/install" + into "$rootDir/native/bin" + include "**/*.dylib" + include "**/*.so" + include "**/*.dll" + + eachFile { fileCopyDetails -> + // Copy one level up from the lib or bin directory + def relative = fileCopyDetails.relativePath + fileCopyDetails.relativePath = relative.getParent().append(true, "..", relative.getLastName()) + } + + doLast { + Files.walk(Paths.get("$rootDir/native/bin")).each { path -> + if (Files.isDirectory(path) && Files.list(path).count() == 0) { + Files.delete(path) + } + } + + exec { + workingDir "$rootDir/native/bin" + commandLine 'zstd', '-19', '--rm', '-r', '.' + } + } +} + task nativeBinUnpack { doLast { exec { From ba70686ca89d621dc1938a5a3f36591e3946da28 Mon Sep 17 00:00:00 2001 From: agdavydov81 Date: Tue, 31 Oct 2023 03:56:22 +0300 Subject: [PATCH 47/90] CI: Replace zstd call with nativeInstallToBin task --- .github/workflows/Build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index b53907e2..2bd19a72 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -130,12 +130,13 @@ jobs: - name: compress run: | zstd --version - zstd -19 --rm -r ./native/install + ./gradlew nativeInstallToBin - uses: actions/upload-artifact@v3 with: name: compress-native path: | ./gradle.properties + ./*native/bin* ./*native/install* ./*java/dfp/build/generated/sources/nativeWrappers/com/epam/deltix/dfp* ./*java/dfp-math/build/generated/sources/nativeWrappers/com/epam/deltix/dfpmath* From 7c0c561d1f084fd566cef53bb744f957fb5c1894 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Tue, 31 Oct 2023 04:04:22 +0300 Subject: [PATCH 48/90] Java: Fix native resources placement. --- java/dfp-math/build.gradle | 20 ++++++++++---------- java/dfpNativeTests/build.gradle | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/java/dfp-math/build.gradle b/java/dfp-math/build.gradle index a6740f2e..bec29dbd 100644 --- a/java/dfp-math/build.gradle +++ b/java/dfp-math/build.gradle @@ -26,7 +26,7 @@ sourceSets { "$rootDir/NativeUtils/java/main/src/main/java", "$rootDir/NativeUtils/Zstandard/java/src/main/java"] - main.resources.srcDirs += "$rootDir/native/binmathJava/Release/" + main.resources.srcDirs += "$rootDir/native/binmathJava/" } dependencies { @@ -39,19 +39,19 @@ dependencies { compileJava.dependsOn ":java:nativeWrappers:makeNativeWrappersDfpMath" task copyNativeDfpMathResourcesMuslToAmd64(type: Copy) { - from "$rootDir/native/binmath/Release/linux/musl" - into "$rootDir/native/binmathJava/Release/resources_com_epam_deltix_dfpmath/linux/amd64" - include '**/*.so.zst' + from "$rootDir/native/bin/linux/musl" + into "$rootDir/native/binmathJava/resources_com_epam_deltix_dfpmath/linux/amd64" + include "**/*ddfpmath${versionSuffix}.so.zst" } task copyNativeDfpMathResources(type: Copy, dependsOn: copyNativeDfpMathResourcesMuslToAmd64) { - from "$rootDir/native/binmath/Release" - into "$rootDir/native/binmathJava/Release/resources_com_epam_deltix_dfpmath" - include '**/*.dylib.zst' - include '**/*.so.zst' - include '**/*.dll.zst' + from "$rootDir/native/bin" + into "$rootDir/native/binmathJava/resources_com_epam_deltix_dfpmath" + include "**/*ddfp${versionSuffix}.dylib.zst" + include "**/*ddfp${versionSuffix}.so.zst" + include "**/*ddfp${versionSuffix}.dll.zst" exclude 'linux/amd64/**' - exclude 'linux/musl/**' + exclude 'linux/musl-gcc/**' } compileJava.dependsOn(copyNativeDfpMathResources) diff --git a/java/dfpNativeTests/build.gradle b/java/dfpNativeTests/build.gradle index d7f966dc..3a3d9987 100644 --- a/java/dfpNativeTests/build.gradle +++ b/java/dfpNativeTests/build.gradle @@ -34,8 +34,8 @@ compileJava.dependsOn ":java:nativeWrappers:makeNativeWrappersDfp" def versionSuffix = versioning()["suffix"] task copyNativeDfpResourcesMuslToAmd64(type: Copy) { - from "$rootDir/native/bin/Release/linux/musl" - into "$rootDir/native/binJava/Release/resources_com_epam_deltix_dfp/linux/amd64" + from "$rootDir/native/bin/linux/musl" + into "$rootDir/native/binJava/resources_com_epam_deltix_dfp/linux/amd64" include "**/*ddfp${versionSuffix}.so.zst" } From ba3e4bbb89f3c8cc049c08434602b3de2e2a6b0b Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Tue, 31 Oct 2023 04:06:43 +0300 Subject: [PATCH 49/90] Java: Fix gradle script --- java/dfp-math/build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/java/dfp-math/build.gradle b/java/dfp-math/build.gradle index bec29dbd..22f25260 100644 --- a/java/dfp-math/build.gradle +++ b/java/dfp-math/build.gradle @@ -38,6 +38,8 @@ dependencies { compileJava.dependsOn ":java:nativeWrappers:makeNativeWrappersDfpMath" +def versionSuffix = versioning()["suffix"] + task copyNativeDfpMathResourcesMuslToAmd64(type: Copy) { from "$rootDir/native/bin/linux/musl" into "$rootDir/native/binmathJava/resources_com_epam_deltix_dfpmath/linux/amd64" From a0fab1374fbd15dc632b14bd1968cb0f24818843 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Tue, 31 Oct 2023 04:36:33 +0300 Subject: [PATCH 50/90] Java: Fix resources preparation --- java/dfp-math/build.gradle | 8 ++++---- java/dfpNativeTests/build.gradle | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/java/dfp-math/build.gradle b/java/dfp-math/build.gradle index 22f25260..18639f8a 100644 --- a/java/dfp-math/build.gradle +++ b/java/dfp-math/build.gradle @@ -41,7 +41,7 @@ compileJava.dependsOn ":java:nativeWrappers:makeNativeWrappersDfpMath" def versionSuffix = versioning()["suffix"] task copyNativeDfpMathResourcesMuslToAmd64(type: Copy) { - from "$rootDir/native/bin/linux/musl" + from "$rootDir/native/bin/linux/musl-gcc" into "$rootDir/native/binmathJava/resources_com_epam_deltix_dfpmath/linux/amd64" include "**/*ddfpmath${versionSuffix}.so.zst" } @@ -49,9 +49,9 @@ task copyNativeDfpMathResourcesMuslToAmd64(type: Copy) { task copyNativeDfpMathResources(type: Copy, dependsOn: copyNativeDfpMathResourcesMuslToAmd64) { from "$rootDir/native/bin" into "$rootDir/native/binmathJava/resources_com_epam_deltix_dfpmath" - include "**/*ddfp${versionSuffix}.dylib.zst" - include "**/*ddfp${versionSuffix}.so.zst" - include "**/*ddfp${versionSuffix}.dll.zst" + include "**/*ddfpmath${versionSuffix}.dylib.zst" + include "**/*ddfpmath${versionSuffix}.so.zst" + include "**/*ddfpmath${versionSuffix}.dll.zst" exclude 'linux/amd64/**' exclude 'linux/musl-gcc/**' } diff --git a/java/dfpNativeTests/build.gradle b/java/dfpNativeTests/build.gradle index 3a3d9987..0e3527e6 100644 --- a/java/dfpNativeTests/build.gradle +++ b/java/dfpNativeTests/build.gradle @@ -34,7 +34,7 @@ compileJava.dependsOn ":java:nativeWrappers:makeNativeWrappersDfp" def versionSuffix = versioning()["suffix"] task copyNativeDfpResourcesMuslToAmd64(type: Copy) { - from "$rootDir/native/bin/linux/musl" + from "$rootDir/native/bin/linux/musl-gcc" into "$rootDir/native/binJava/resources_com_epam_deltix_dfp/linux/amd64" include "**/*ddfp${versionSuffix}.so.zst" } From e1b95af26bdaffb054da89fb5c2d9d93e6e51872 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Tue, 31 Oct 2023 10:32:02 +0300 Subject: [PATCH 51/90] Cxx: Restore original zstd artifacts placement (for .NET scripting simplification) --- native/build.gradle | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/native/build.gradle b/native/build.gradle index ce15496f..7f54bde0 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -334,7 +334,7 @@ task makeNativeDarwin(dependsOn: [makeNativeDarwinAArch64, makeNativeDarwinAmd64 task nativeInstallToBin(type: Copy) { from "$rootDir/native/install" - into "$rootDir/native/bin" + into "$rootDir/native" include "**/*.dylib" include "**/*.so" include "**/*.dll" @@ -342,7 +342,11 @@ task nativeInstallToBin(type: Copy) { eachFile { fileCopyDetails -> // Copy one level up from the lib or bin directory def relative = fileCopyDetails.relativePath - fileCopyDetails.relativePath = relative.getParent().append(true, "..", relative.getLastName()) + if (relative.getLastName().contains("math")) { + fileCopyDetails.relativePath = relative.getParent().prepend('binmath', 'Release').append(true, "..", relative.getLastName()) + } else { + fileCopyDetails.relativePath = relative.getParent().prepend('bin', 'Release').append(true, "..", relative.getLastName()) + } } doLast { @@ -352,10 +356,21 @@ task nativeInstallToBin(type: Copy) { } } + Files.walk(Paths.get("$rootDir/native/binmath")).each { path -> + if (Files.isDirectory(path) && Files.list(path).count() == 0) { + Files.delete(path) + } + } + exec { workingDir "$rootDir/native/bin" commandLine 'zstd', '-19', '--rm', '-r', '.' } + + exec { + workingDir "$rootDir/native/binmath" + commandLine 'zstd', '-19', '--rm', '-r', '.' + } } } From c544028baad3940e2822dbdaca493cde78edcf16 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Tue, 31 Oct 2023 10:38:15 +0300 Subject: [PATCH 52/90] Java: Support original zstd artifacts placement [skip ci] --- java/dfp-math/build.gradle | 20 +++++++++----------- java/dfpNativeTests/build.gradle | 20 +++++++++----------- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/java/dfp-math/build.gradle b/java/dfp-math/build.gradle index 18639f8a..3d873b40 100644 --- a/java/dfp-math/build.gradle +++ b/java/dfp-math/build.gradle @@ -26,7 +26,7 @@ sourceSets { "$rootDir/NativeUtils/java/main/src/main/java", "$rootDir/NativeUtils/Zstandard/java/src/main/java"] - main.resources.srcDirs += "$rootDir/native/binmathJava/" + main.resources.srcDirs += "$rootDir/native/binmathJava/Release/" } dependencies { @@ -38,20 +38,18 @@ dependencies { compileJava.dependsOn ":java:nativeWrappers:makeNativeWrappersDfpMath" -def versionSuffix = versioning()["suffix"] - task copyNativeDfpMathResourcesMuslToAmd64(type: Copy) { - from "$rootDir/native/bin/linux/musl-gcc" - into "$rootDir/native/binmathJava/resources_com_epam_deltix_dfpmath/linux/amd64" - include "**/*ddfpmath${versionSuffix}.so.zst" + from "$rootDir/native/binmath/Release/linux/musl-gcc" + into "$rootDir/native/binmathJava/Release/resources_com_epam_deltix_dfpmath/linux/amd64" + include "**/*.so.zst" } task copyNativeDfpMathResources(type: Copy, dependsOn: copyNativeDfpMathResourcesMuslToAmd64) { - from "$rootDir/native/bin" - into "$rootDir/native/binmathJava/resources_com_epam_deltix_dfpmath" - include "**/*ddfpmath${versionSuffix}.dylib.zst" - include "**/*ddfpmath${versionSuffix}.so.zst" - include "**/*ddfpmath${versionSuffix}.dll.zst" + from "$rootDir/native/binmath/Release" + into "$rootDir/native/binmathJava/Release/resources_com_epam_deltix_dfpmath" + include "**/*.dylib.zst" + include "**/*.so.zst" + include "**/*.dll.zst" exclude 'linux/amd64/**' exclude 'linux/musl-gcc/**' } diff --git a/java/dfpNativeTests/build.gradle b/java/dfpNativeTests/build.gradle index 0e3527e6..58cad1d1 100644 --- a/java/dfpNativeTests/build.gradle +++ b/java/dfpNativeTests/build.gradle @@ -18,7 +18,7 @@ sourceSets { "$rootDir/NativeUtils/java/main/src/main/java", "$rootDir/NativeUtils/Zstandard/java/src/main/java"] - test.resources.srcDirs += "$rootDir/native/binJava/" + test.resources.srcDirs += "$rootDir/native/binJava/Release/" } dependencies { @@ -31,20 +31,18 @@ dependencies { compileJava.dependsOn ":java:nativeWrappers:makeNativeWrappersDfp" -def versionSuffix = versioning()["suffix"] - task copyNativeDfpResourcesMuslToAmd64(type: Copy) { - from "$rootDir/native/bin/linux/musl-gcc" - into "$rootDir/native/binJava/resources_com_epam_deltix_dfp/linux/amd64" - include "**/*ddfp${versionSuffix}.so.zst" + from "$rootDir/native/bin/Release/linux/musl-gcc" + into "$rootDir/native/binJava/Release/resources_com_epam_deltix_dfp/linux/amd64" + include "**/*.so.zst" } task copyNativeDfpResources(type: Copy, dependsOn: copyNativeDfpResourcesMuslToAmd64) { - from "$rootDir/native/bin" - into "$rootDir/native/binJava/resources_com_epam_deltix_dfp" - include "**/*ddfp${versionSuffix}.dylib.zst" - include "**/*ddfp${versionSuffix}.so.zst" - include "**/*ddfp${versionSuffix}.dll.zst" + from "$rootDir/native/bin/Release" + into "$rootDir/native/binJava/Release/resources_com_epam_deltix_dfp" + include "**/*.dylib.zst" + include "**/*.so.zst" + include "**/*.dll.zst" exclude 'linux/amd64/**' exclude 'linux/musl-gcc/**' } From e083e87542983697083cbb3d81b3832932f860b3 Mon Sep 17 00:00:00 2001 From: agdavydov81 Date: Tue, 31 Oct 2023 10:39:49 +0300 Subject: [PATCH 53/90] CI: Support original artifacts placement --- .github/workflows/Build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 2bd19a72..0e8f0857 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -137,7 +137,7 @@ jobs: path: | ./gradle.properties ./*native/bin* - ./*native/install* + ./*native/binmath* ./*java/dfp/build/generated/sources/nativeWrappers/com/epam/deltix/dfp* ./*java/dfp-math/build/generated/sources/nativeWrappers/com/epam/deltix/dfpmath* ./csharp/EPAM.Deltix.DFP/NativeImpl.cs From f284941eb9d13d3970a4616f5969cef8ba55b2a5 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Tue, 31 Oct 2023 22:36:07 +0300 Subject: [PATCH 54/90] .NET: Fix resources placement --- csharp/build.cake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/csharp/build.cake b/csharp/build.cake index d977620c..f7642f07 100644 --- a/csharp/build.cake +++ b/csharp/build.cake @@ -26,8 +26,8 @@ void NativeRename(string srcPath, string dstPath) continue; var toDirectory = fileDirectory; - if (toDirectory.EndsWith("/linux/musl", StringComparison.OrdinalIgnoreCase)) - toDirectory = toDirectory.Substring(0, toDirectory.Length - 4) + "amd64"; + if (toDirectory.EndsWith("/linux/musl-gcc", StringComparison.OrdinalIgnoreCase)) + toDirectory = toDirectory.Substring(0, toDirectory.Length - 8) + "amd64"; toDirectory = toDirectory.Replace("/" + srcPath + "/", "/" + dstPath + "/"); CreateDirectory(toDirectory); From 0524c53d85a6d9e9ed64c971481d9360eeb3ffc7 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Thu, 2 Nov 2023 00:13:26 +0300 Subject: [PATCH 55/90] Cxx: Fix MSVC compilation Wrappers: Generate Cxx headers without ver["suffix"] --- java/nativeWrappers/build.gradle | 27 +++++++++++--- .../java/com/epam/deltix/dfp/CxxWrappers.java | 10 ++---- .../com/epam/deltix/dfp/NativeWrappers.java | 14 +++++--- native/CMakeLists.txt | 36 ++++++++++--------- native/src/NativeImpl.h | 17 ++++++--- native/src/NativeImplToString.c | 32 ++++++++--------- .../LIBRARY/src/bid_conf.h | 6 ++-- .../LIBRARY/src/bid_functions.h | 2 +- .../LIBRARY/src/bid_internal.h | 1 - 9 files changed, 86 insertions(+), 59 deletions(-) diff --git a/java/nativeWrappers/build.gradle b/java/nativeWrappers/build.gradle index ea53390c..2d100371 100644 --- a/java/nativeWrappers/build.gradle +++ b/java/nativeWrappers/build.gradle @@ -19,12 +19,10 @@ task makeNativeWrappersDfp(dependsOn: compileJava, type: JavaExec) { "$rootDir/native/src/NativeImpl.c", "$rootDir/java/dfp/build/generated/sources/nativeWrappers/com/epam/deltix/dfp/NativeImpl.java", "$rootDir/csharp/EPAM.Deltix.DFP/NativeImpl.cs", - "$rootDir/native/include" + "" ] onlyIf { - !file("$rootDir/native/include/DecimalNative.h").exists() || - !file("$rootDir/native/include/DecimalNative.hpp").exists() || - !file("$rootDir/java/dfp/build/generated/sources/nativeWrappers/com/epam/deltix/dfp/NativeImpl.java").exists() || + !file("$rootDir/java/dfp/build/generated/sources/nativeWrappers/com/epam/deltix/dfp/NativeImpl.java").exists() || !file("$rootDir/csharp/EPAM.Deltix.DFP/NativeImpl.cs").exists() } } @@ -48,5 +46,24 @@ task makeNativeWrappersDfpMath(dependsOn: compileJava, type: JavaExec) { } } -task makeNativeWrappers(dependsOn: [makeNativeWrappersDfp, makeNativeWrappersDfpMath]) { +task makeNativeWrappersDfpCxx(dependsOn: compileJava, type: JavaExec) { + mainClass = "com.epam.deltix.dfp.NativeWrappers" + classpath = sourceSets.main.runtimeClasspath + workingDir = "$rootDir" + def ver = versioning() + args = [ver["three"], ver["suffix"], ver["sha"], + "ddfp_", + javaPrefix, + "$rootDir/native/src/NativeImpl.c", + "", + "", + "$rootDir/native/include" + ] + onlyIf { + !file("$rootDir/native/include/DecimalNative.h").exists() || + !file("$rootDir/native/include/DecimalNative.hpp").exists() + } +} + +task makeNativeWrappers(dependsOn: [makeNativeWrappersDfp, makeNativeWrappersDfpMath, makeNativeWrappersDfpCxx]) { } diff --git a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java index 54d6aed3..3c832868 100644 --- a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java +++ b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/CxxWrappers.java @@ -44,13 +44,7 @@ public static void make(final String outputRoot, final List api, final "# define " + outputCDefine + "_MANGLING extern\n" + "#endif\n" + "\n" + - "#if defined(_WIN32)\n" + - "# define " + outputCDefine + "_CALLING __cdecl\n" + - "#else\n" + - "# define " + outputCDefine + "_CALLING\n" + - "#endif\n" + - "\n" + - "#ifdef " + outputCDefine + "_SHARED_LIBRARY\n" + + "#ifdef " + outputCDefine + "_SHARED\n" + "# ifdef _MSC_VER\n" + "# define " + outputCDefine + "_EXPORT __declspec(dllimport)\n" + "# else\n" + @@ -60,7 +54,7 @@ public static void make(final String outputRoot, final List api, final "# define " + outputCDefine + "_EXPORT\n" + "#endif\n" + "\n" + - "#define " + outputCDefine + "_API(x) " + outputCDefine + "_MANGLING " + outputCDefine + "_EXPORT x " + outputCDefine + "_CALLING\n" + + "#define " + outputCDefine + "_API(x) " + outputCDefine + "_MANGLING " + outputCDefine + "_EXPORT x\n" + "\n" + "typedef struct {\n" + " uint64_t val;\n" + diff --git a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/NativeWrappers.java b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/NativeWrappers.java index 92d17069..07014c36 100644 --- a/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/NativeWrappers.java +++ b/java/nativeWrappers/src/main/java/com/epam/deltix/dfp/NativeWrappers.java @@ -39,12 +39,16 @@ public static void main(final String[] args) throws IOException, InterruptedExce CxxWrappers.make(outputCRoot, api, apiPrefix, versionThreeDigits); } - CsWrappers.make(outputCs, api, apiPrefix); - CsWrappers.makeVersion(outputCs, versionThreeDigits, versionSuffix, versionSha); + if (!outputCs.isEmpty()) { + CsWrappers.make(outputCs, api, apiPrefix); + CsWrappers.makeVersion(outputCs, versionThreeDigits, versionSuffix, versionSha); + } - final String javaPrefixJni = "Java_" + javaPrefix; - final List javaApi = collectApi(preprocess, javaPrefixJni); - JavaWrappers.make(outputJava, versionThreeDigits, javaApi, javaPrefixJni); + if (!outputJava.isEmpty()) { + final String javaPrefixJni = "Java_" + javaPrefix; + final List javaApi = collectApi(preprocess, javaPrefixJni); + JavaWrappers.make(outputJava, versionThreeDigits, javaApi, javaPrefixJni); + } } private static class StreamCollector implements Runnable { diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index adda7926..8e842212 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -24,25 +24,29 @@ message(STATUS "CMAKE_CROSSCOMPILING: " ${CMAKE_CROSSCOMPILING}) message(STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS}) message(STATUS "CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS}) -file(WRITE ${CMAKE_INSTALL_PREFIX}/cmakevariables.json "\ -{\n\ - \"CMAKE_SYSTEM_NAME\": \"${CMAKE_SYSTEM_NAME}\",\n\ - \"CMAKE_TOOLCHAIN_FILE\": \"${CMAKE_TOOLCHAIN_FILE}\",\n\ - \"CMAKE_SYSTEM_PROCESSOR\": \"${CMAKE_SYSTEM_PROCESSOR}\",\n\ - \"CMAKE_C_COMPILER_TARGET\": \"${CMAKE_C_COMPILER_TARGET}\",\n\ - \"CMAKE_CROSSCOMPILING\": \"${CMAKE_CROSSCOMPILING}\",\n\ - \"CMAKE_SIZEOF_VOID_P\": \"${CMAKE_SIZEOF_VOID_P}\",\n\ - \"CMAKE_BUILD_TYPE\": \"${CMAKE_BUILD_TYPE}\",\n\ - \"CMAKE_C_COMPILER\": \"${CMAKE_C_COMPILER}\",\n\ - \"CMAKE_C_COMPILER_ID\": \"${CMAKE_C_COMPILER_ID}\",\n\ - \"CMAKE_C_COMPILER_VERSION\": \"${CMAKE_C_COMPILER_VERSION}\",\n\ - \"CMAKE_C_FLAGS\": \"${CMAKE_C_FLAGS}\",\n\ -}") +if (JAVA_PREFIX) + file(WRITE ${CMAKE_INSTALL_PREFIX}/cmakevariables.json "\ + {\n\ + \"CMAKE_SYSTEM_NAME\": \"${CMAKE_SYSTEM_NAME}\",\n\ + \"CMAKE_TOOLCHAIN_FILE\": \"${CMAKE_TOOLCHAIN_FILE}\",\n\ + \"CMAKE_SYSTEM_PROCESSOR\": \"${CMAKE_SYSTEM_PROCESSOR}\",\n\ + \"CMAKE_C_COMPILER_TARGET\": \"${CMAKE_C_COMPILER_TARGET}\",\n\ + \"CMAKE_CROSSCOMPILING\": \"${CMAKE_CROSSCOMPILING}\",\n\ + \"CMAKE_SIZEOF_VOID_P\": \"${CMAKE_SIZEOF_VOID_P}\",\n\ + \"CMAKE_BUILD_TYPE\": \"${CMAKE_BUILD_TYPE}\",\n\ + \"CMAKE_C_COMPILER\": \"${CMAKE_C_COMPILER}\",\n\ + \"CMAKE_C_COMPILER_ID\": \"${CMAKE_C_COMPILER_ID}\",\n\ + \"CMAKE_C_COMPILER_VERSION\": \"${CMAKE_C_COMPILER_VERSION}\",\n\ + \"CMAKE_C_FLAGS\": \"${CMAKE_C_FLAGS}\",\n\ + }") +endif() set(CALL_BY_REF "0" CACHE STRING "The numerical arguments and results are passed by reference") set(GLOBAL_RND "1" CACHE STRING "The rounding mode is a global variable _IDEC_glbround") set(GLOBAL_FLAGS "1" CACHE STRING "The exception status flags are represented by a global variable _IDEC_glbflags") +set(LINKTYPE "STATIC" CACHE STRING "The libraries linking type") + if(APPLE) add_definitions(-DAPPLE) add_definitions(-DMINIMAL_SILENT_MODE_EXCEPTION_HANDLER) @@ -101,7 +105,7 @@ file(GLOB BID_SRCS file(GLOB PUBLIC_HEADERS "include/*") -add_library(dfp SHARED ${BID_SRCS} src/NativeImpl.c) +add_library(dfp ${LINKTYPE} ${BID_SRCS} src/NativeImpl.c) include_directories(src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src) target_compile_definitions(dfp PRIVATE API_PREFIX=ddfp${VERSION_SUFFIX}_) if (JAVA_PREFIX) @@ -111,7 +115,7 @@ set_target_properties(dfp PROPERTIES OUTPUT_NAME "ddfp${VERSION_SUFFIX}") set_target_properties(dfp PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}") install(TARGETS dfp) -add_library(dfpmath SHARED ${BID_SRCS} src/NativeMathImpl.c) +add_library(dfpmath ${LINKTYPE} ${BID_SRCS} src/NativeMathImpl.c) include_directories(src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src) target_compile_definitions(dfpmath PRIVATE API_PREFIX=ddfpmath${VERSION_SUFFIX}_) if (JAVA_MATH_PREFIX) diff --git a/native/src/NativeImpl.h b/native/src/NativeImpl.h index 77d11ffd..3916fbe1 100644 --- a/native/src/NativeImpl.h +++ b/native/src/NativeImpl.h @@ -9,20 +9,29 @@ #ifndef JAVA_PREFIX #define NOJAVA + +#if defined(_MSC_VER) +#define DDFP_API(x) __declspec(dllexport) x +#else +#define DDFP_API(x) __attribute__ ((visibility("default"))) x #endif -#if defined(_WIN32) +#else // ifndef JAVA_PREFIX + +#if defined(_MSC_VER) #define JNI_API(x) __declspec(dllexport) x __stdcall #else -#define JNI_API(x) x __attribute__ ((visibility("default"))) +#define JNI_API(x) __attribute__ ((visibility("default"))) x #endif -#if defined(_WIN32) +#if defined(_MSC_VER) #define DDFP_API(x) __declspec(dllexport) x __cdecl #else -#define DDFP_API(x) x __attribute__ ((visibility("default"))) +#define DDFP_API(x) __attribute__ ((visibility("default"))) x #endif +#endif // ifndef JAVA_PREFIX + /* * Concatenate preprocessor tokens A and B without expanding macro definitions * (however, if invoked from a macro, macro arguments are expanded). diff --git a/native/src/NativeImplToString.c b/native/src/NativeImplToString.c index e46e19c4..c5095df7 100644 --- a/native/src/NativeImplToString.c +++ b/native/src/NativeImplToString.c @@ -25,28 +25,28 @@ static bool isNaN(BID_UINT64 value) { return (value & MASK_INFINITY_NAN) == MASK_INFINITY_NAN; } -static const int BCD_TABLE_DIGITS = 3; +#define BCD_TABLE_DIGITS 3 static const int BCD_DIVIDER = 1000000000; static const int BCD_DIVIDER_GROUPS = 3; // log10(BCD_DIVIDER) / BCD_TABLE_DIGITS must be natural value -char* makeBcdTable(int tenPowerMaxIndex) { +char* makeBcdTable() { int n = 1; - for (int i = 0; i < tenPowerMaxIndex; ++i) + for (int i = 0; i < BCD_TABLE_DIGITS; ++i) n *= 10; - char *table = (char *)malloc(n * tenPowerMaxIndex * sizeof(char)); + char *table = (char *)malloc(n * BCD_TABLE_DIGITS * sizeof(char)); if (!table) return 0; - char value[tenPowerMaxIndex]; + char value[BCD_TABLE_DIGITS]; - memset(value, '0', tenPowerMaxIndex * sizeof(char)); + memset(value, '0', BCD_TABLE_DIGITS * sizeof(char)); for (int i = 0, ib = 0; i < n; ++i) { - for (int j = 0; j < tenPowerMaxIndex; ++j) + for (int j = 0; j < BCD_TABLE_DIGITS; ++j) table[ib++] = value[j]; value[0] += 1; - for (int j = 0; j < tenPowerMaxIndex - 1; ++j) { + for (int j = 0; j < BCD_TABLE_DIGITS - 1; ++j) { if (value[j] <= '9') break; else { @@ -63,7 +63,7 @@ static const char* BCD_TABLE; // makeBcdTable(BCD_TABLE_DIGITS); int formatUIntFromBcdTable(int value, char* buffer, int bi) { if (!BCD_TABLE) - BCD_TABLE = makeBcdTable(BCD_TABLE_DIGITS); + BCD_TABLE = makeBcdTable(); for (int blockIndex = 0; blockIndex < BCD_DIVIDER_GROUPS; ++blockIndex) { int newValue = (int)((unsigned long long)(2199023256ull * value) >> 41); @@ -109,17 +109,17 @@ int numberOfDigits(BID_UINT64 value) { #define bufferMinLength 511 #define bufferMinLengthWithZero 512 -static _Thread_local char tls_to_string_buffer[bufferMinLengthWithZero]; +BID_THREAD char tls_to_string_buffer[bufferMinLengthWithZero]; -BID_EXTERN_C const char* dfp64_to_string(BID_UINT64 value) { +const char* dfp64_to_string(BID_UINT64 value) { return dfp64_to_string_2(value, '.'); } -BID_EXTERN_C const char* dfp64_to_string_2(BID_UINT64 value, char decimalMark) { +const char* dfp64_to_string_2(BID_UINT64 value, char decimalMark) { return dfp64_to_string_3(value, decimalMark, tls_to_string_buffer); } -BID_EXTERN_C const char* dfp64_to_string_3(BID_UINT64 value, char decimalMark, char* buffer512) { +const char* dfp64_to_string_3(BID_UINT64 value, char decimalMark, char* buffer512) { if (isNull(value)) return "null"; @@ -242,15 +242,15 @@ BID_EXTERN_C const char* dfp64_to_string_3(BID_UINT64 value, char decimalMark, c const char SCIENTIFIC_ZERO[] = "0.000000000000000e+000"; -BID_EXTERN_C const char* dfp64_to_scientific_string(BID_UINT64 value) { +const char* dfp64_to_scientific_string(BID_UINT64 value) { return dfp64_to_scientific_string_2(value, '.'); } -BID_EXTERN_C const char* dfp64_to_scientific_string_2(BID_UINT64 value, char decimalMark) { +const char* dfp64_to_scientific_string_2(BID_UINT64 value, char decimalMark) { return dfp64_to_scientific_string_3(value, decimalMark, tls_to_string_buffer); } -BID_EXTERN_C const char* dfp64_to_scientific_string_3(BID_UINT64 value, char decimalMark, char* buffer512) { +const char* dfp64_to_scientific_string_3(BID_UINT64 value, char decimalMark, char* buffer512) { if (isNull(value)) return "null"; diff --git a/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_conf.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_conf.h index e65ba9af..0ea7e443 100644 --- a/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_conf.h +++ b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_conf.h @@ -30,7 +30,7 @@ #if defined(__cplusplus) #define BID_EXTERN_C extern "C" #else -#define BID_EXTERN_C extern +#define BID_EXTERN_C #endif #ifndef _BID_CONF_H @@ -858,9 +858,9 @@ #ifndef BID_THREAD #if defined (_MSC_VER) //Windows -#define BID_THREAD __declspec(thread) +#define BID_THREAD static __declspec(thread) #else -#define BID_THREAD __thread +#define BID_THREAD static __thread #endif //Windows #endif //BID_THREAD diff --git a/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_functions.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_functions.h index 5c86f72e..9fe7a56b 100644 --- a/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_functions.h +++ b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_functions.h @@ -30,7 +30,7 @@ #if defined(__cplusplus) #define BID_EXTERN_C extern "C" #else -#define BID_EXTERN_C extern +#define BID_EXTERN_C #endif #ifndef _BID_FUNCTIONS_H diff --git a/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_internal.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_internal.h index 3049d928..80ec7854 100644 --- a/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_internal.h +++ b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_internal.h @@ -30,7 +30,6 @@ #ifndef __BIDECIMAL_H #define __BIDECIMAL_H -#define _CRT_SECURE_NO_DEPRECATE #if defined(_MSC_VER) && !defined(__INTEL_COMPILER) # pragma warning( disable: 4996 ) #endif From d29dcf567e622cc13820653b5480970eae31c885 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Thu, 2 Nov 2023 03:18:45 +0300 Subject: [PATCH 56/90] Cxx: Fix compilation, prepare for Conan compilation. --- native/CMakeLists.txt | 42 ++++++++----------- native/src/NativeImplToString.c | 5 ++- native/src/NativeImplToString.h | 3 +- .../LIBRARY/src/bid_conf.h | 14 ++++--- .../LIBRARY/src/bid_functions.h | 10 +++-- 5 files changed, 37 insertions(+), 37 deletions(-) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 8e842212..d471bd60 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.22) -project (native) +project (native VERSION ${VERSION}) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) @@ -39,14 +39,17 @@ if (JAVA_PREFIX) \"CMAKE_C_COMPILER_VERSION\": \"${CMAKE_C_COMPILER_VERSION}\",\n\ \"CMAKE_C_FLAGS\": \"${CMAKE_C_FLAGS}\",\n\ }") + set(LINKTYPE SHARED) +endif() + +if (NOT LINKTYPE) + set(LINKTYPE STATIC) endif() set(CALL_BY_REF "0" CACHE STRING "The numerical arguments and results are passed by reference") set(GLOBAL_RND "1" CACHE STRING "The rounding mode is a global variable _IDEC_glbround") set(GLOBAL_FLAGS "1" CACHE STRING "The exception status flags are represented by a global variable _IDEC_glbflags") -set(LINKTYPE "STATIC" CACHE STRING "The libraries linking type") - if(APPLE) add_definitions(-DAPPLE) add_definitions(-DMINIMAL_SILENT_MODE_EXCEPTION_HANDLER) @@ -112,29 +115,20 @@ if (JAVA_PREFIX) target_compile_definitions(dfp PRIVATE JAVA_PREFIX=${JAVA_PREFIX}) endif() set_target_properties(dfp PROPERTIES OUTPUT_NAME "ddfp${VERSION_SUFFIX}") -set_target_properties(dfp PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}") +if (NOT JAVA_PREFIX) + set_target_properties(dfp PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}") +endif() install(TARGETS dfp) -add_library(dfpmath ${LINKTYPE} ${BID_SRCS} src/NativeMathImpl.c) -include_directories(src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src) -target_compile_definitions(dfpmath PRIVATE API_PREFIX=ddfpmath${VERSION_SUFFIX}_) if (JAVA_MATH_PREFIX) - target_compile_definitions(dfpmath PRIVATE JAVA_PREFIX=${JAVA_MATH_PREFIX}) + add_library(dfpmath ${LINKTYPE} ${BID_SRCS} src/NativeMathImpl.c) + include_directories(src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src) + target_compile_definitions(dfpmath PRIVATE API_PREFIX=ddfpmath${VERSION_SUFFIX}_) + if (JAVA_MATH_PREFIX) + target_compile_definitions(dfpmath PRIVATE JAVA_PREFIX=${JAVA_MATH_PREFIX}) + endif() + set_target_properties(dfpmath PROPERTIES OUTPUT_NAME "ddfpmath${VERSION_SUFFIX}") + install(TARGETS dfpmath) endif() -set_target_properties(dfpmath PROPERTIES OUTPUT_NAME "ddfpmath${VERSION_SUFFIX}") -install(TARGETS dfpmath) - - -#add_library(dfpStatic STATIC NativeImpl.c ${BID_SRCS}) -#include_directories(../thirdparty/IntelRDFPMathLib20U2/LIBRARY/src) -#target_compile_definitions(dfpStatic PRIVATE API_PREFIX=ddfp${VERSION_SUFFIX}_ NOJAVA) -#set_target_properties(dfpStatic PROPERTIES OUTPUT_NAME "ddfpStatic${VERSION_SUFFIX}") -#install(TARGETS dfpStatic DESTINATION ./bin/${CMAKE_BUILD_TYPE}/${INSTALL_SUFFIX}) - -#if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") -# add_executable(demoStatic demo.cpp) -# target_link_libraries(demoStatic LINK_PRIVATE dfpStatic) -# add_executable(demo demo.cpp) -# target_link_libraries(demo LINK_PRIVATE dfp) -#endif() +include(CPack) diff --git a/native/src/NativeImplToString.c b/native/src/NativeImplToString.c index c5095df7..50a31595 100644 --- a/native/src/NativeImplToString.c +++ b/native/src/NativeImplToString.c @@ -1,10 +1,11 @@ -#include "NativeImpl.h" -#include #include #include #include #include #include "NativeImplToString.h" +#include +#include +#include static const BID_UINT64 DFP_NAN_NULL = 0xFFFFFFFFFFFFFF80ull; // = -0x80L; static const BID_UINT64 MASK_INFINITY_AND_NAN = 0x7800000000000000ull; diff --git a/native/src/NativeImplToString.h b/native/src/NativeImplToString.h index 719c2873..74822a28 100644 --- a/native/src/NativeImplToString.h +++ b/native/src/NativeImplToString.h @@ -1,6 +1,7 @@ #pragma once -#include +#include +#include BID_EXTERN_C const char * dfp64_to_string(BID_UINT64 value); BID_EXTERN_C const char * dfp64_to_string_2(BID_UINT64 value, char decimalMark); diff --git a/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_conf.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_conf.h index 0ea7e443..26aa6775 100644 --- a/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_conf.h +++ b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_conf.h @@ -27,14 +27,16 @@ THE POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ +#ifndef _BID_CONF_H +#define _BID_CONF_H + +#ifndef BID_EXTERN_C #if defined(__cplusplus) #define BID_EXTERN_C extern "C" #else -#define BID_EXTERN_C +#define BID_EXTERN_C extern #endif - -#ifndef _BID_CONF_H -#define _BID_CONF_H +#endif // Name Changes @@ -995,11 +997,11 @@ typedef unsigned int _IDEC_flags; // could be a struct with diagnostic inf #endif #if DECIMAL_GLOBAL_ROUNDING -BID_EXTERN_C BID_THREAD _IDEC_round _IDEC_glbround; +BID_THREAD _IDEC_round _IDEC_glbround; #endif #if DECIMAL_GLOBAL_EXCEPTION_FLAGS -BID_EXTERN_C BID_THREAD _IDEC_flags _IDEC_glbflags; +BID_THREAD _IDEC_flags _IDEC_glbflags; #endif #if DECIMAL_ALTERNATE_EXCEPTION_HANDLING diff --git a/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_functions.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_functions.h index 9fe7a56b..4faa4e91 100644 --- a/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_functions.h +++ b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_functions.h @@ -27,14 +27,16 @@ THE POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ +#ifndef _BID_FUNCTIONS_H +#define _BID_FUNCTIONS_H + +#ifndef BID_EXTERN_C #if defined(__cplusplus) #define BID_EXTERN_C extern "C" #else -#define BID_EXTERN_C +#define BID_EXTERN_C extern +#endif #endif - -#ifndef _BID_FUNCTIONS_H -#define _BID_FUNCTIONS_H #if !defined (__GNUC__) || defined(__QNX__) #include From ab71ecd7c2ff2b5c5ab4d0a710b86183d85a93ab Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Thu, 2 Nov 2023 11:49:38 +0300 Subject: [PATCH 57/90] Cxx: Fix runtime --- .../IntelRDFPMathLib20U2/LIBRARY/src/bid_conf.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_conf.h b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_conf.h index 26aa6775..680b388b 100644 --- a/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_conf.h +++ b/native/src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src/bid_conf.h @@ -860,9 +860,9 @@ #ifndef BID_THREAD #if defined (_MSC_VER) //Windows -#define BID_THREAD static __declspec(thread) +#define BID_THREAD __declspec(thread) #else -#define BID_THREAD static __thread +#define BID_THREAD __thread #endif //Windows #endif //BID_THREAD @@ -997,11 +997,11 @@ typedef unsigned int _IDEC_flags; // could be a struct with diagnostic inf #endif #if DECIMAL_GLOBAL_ROUNDING -BID_THREAD _IDEC_round _IDEC_glbround; +BID_EXTERN_C BID_THREAD _IDEC_round _IDEC_glbround; #endif #if DECIMAL_GLOBAL_EXCEPTION_FLAGS -BID_THREAD _IDEC_flags _IDEC_glbflags; +BID_EXTERN_C BID_THREAD _IDEC_flags _IDEC_glbflags; #endif #if DECIMAL_ALTERNATE_EXCEPTION_HANDLING From d38393388455fe1e46f1e08100831cde894ac220 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Thu, 2 Nov 2023 22:35:34 +0300 Subject: [PATCH 58/90] Cxx: Initial version of the DFP with the Conan Package Manager support. --- native/CMakeLists.txt | 2 -- native/conanfile.py | 50 +++++++++++++------------- native/test_package/conanfile.py | 20 +++++++---- native/test_package/{ => src}/demo.cpp | 6 ++-- 4 files changed, 42 insertions(+), 36 deletions(-) rename native/test_package/{ => src}/demo.cpp (89%) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index d471bd60..46925697 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -130,5 +130,3 @@ if (JAVA_MATH_PREFIX) set_target_properties(dfpmath PROPERTIES OUTPUT_NAME "ddfpmath${VERSION_SUFFIX}") install(TARGETS dfpmath) endif() - -include(CPack) diff --git a/native/conanfile.py b/native/conanfile.py index 017df3cb..7672fe55 100644 --- a/native/conanfile.py +++ b/native/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.tools.files import copy -#from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps import os import re @@ -22,42 +22,44 @@ def load_version(properties_filename): class DfpConan(ConanFile): name = "dfp" package_type = "library" + + # Optional metadata description = "Decimal Floating Point Arithmetic Library" homepage = "https://github.com/epam/DFP/" url = "https://github.com/epam/DFP.git" license = ("Apache-2.0", "Intel") topics = ("decimal", "dfp", "ieee-754", "deltix") author = "Andrei Davydov (agdavydov81@gmail.com)" + + # Binary configuration settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False]} + default_options = {"shared": False} - options = { - "shared": [True, False], - "c_runtime": [None, "glibc", "musl", "libc"], - "c_runtime_shared": [None, True, False], - "libPath": [None, "ANY"], - "libMask": [None, "ANY"] - } - default_options = { - "shared": True, - "c_runtime": None, - "c_runtime_shared": None, - "libMask": None - } + # Sources are located in the same place as this recipe, copy them to the recipe + exports_sources = "CMakeLists.txt", "src/*", "include/*" def set_version(self): # Command line ``--version=xxxx`` will be assigned first to self.version and have priority self.version = self.version or load_version(os.path.join(self.recipe_folder, "..", "gradle.properties")) - def configure(self): - # it's a C library - self.settings.rm_safe("compiler.libcxx") - self.settings.rm_safe("compiler.cppstd") + def layout(self): + cmake_layout(self) - self.libPath = f"{self.options.get_safe('libPath')}" - self.libMask = f"{self.options.get_safe('libMask')}" - self.options.rm_safe("libPath") - self.options.rm_safe("libMask") + def generate(self): + deps = CMakeDeps(self) + deps.generate() + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): - copy(self, pattern="DecimalNative.h*", src=self.recipe_folder, dst=os.path.join(self.package_folder, "include")) - copy(self, pattern=self.libMask, src=self.libPath, dst=os.path.join(self.package_folder, "lib")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = ["ddfp"] diff --git a/native/test_package/conanfile.py b/native/test_package/conanfile.py index 9d752806..9b90871b 100644 --- a/native/test_package/conanfile.py +++ b/native/test_package/conanfile.py @@ -1,20 +1,26 @@ +import os + from conan import ConanFile -from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps -from conan.tools.build import cross_building +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run class TestExampleConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + generators = "CMakeDeps", "CMakeToolchain" + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) cmake.configure() cmake.build() - def build_requirements(self): - self.tool_requires("dfp/[>=1.0.2]") + def layout(self): + cmake_layout(self) def test(self): - if not cross_building(self): - self.run("./test_package_example") + if can_run(self): + cmd = os.path.join(self.cpp.build.bindir, "demo") + self.run(cmd, env="conanrun") diff --git a/native/test_package/demo.cpp b/native/test_package/src/demo.cpp similarity index 89% rename from native/test_package/demo.cpp rename to native/test_package/src/demo.cpp index 9d84eea3..b26e0922 100644 --- a/native/test_package/demo.cpp +++ b/native/test_package/src/demo.cpp @@ -1,13 +1,13 @@ #include #include -#include "DecimalNative.hpp" +#include using namespace epam::deltix::dfp; int main(int argc, char *argv[]) { if(argc!=4) { - std::cerr << "Usage: " << std::endl; - return -1; + std::cout << "Usage: " << std::endl; + return 0; } const Decimal64 x(argv[1]); // Parsing call example - can throw std::invalid_argument From 9ec2fde2247b4174b57612a395609570acd99121 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Fri, 3 Nov 2023 00:35:17 +0300 Subject: [PATCH 59/90] Cxx: Conan: Support shared libs building --- native/CMakeLists.txt | 10 +++------- native/test_package/conanfile.py | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 46925697..9acc76ea 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -39,11 +39,7 @@ if (JAVA_PREFIX) \"CMAKE_C_COMPILER_VERSION\": \"${CMAKE_C_COMPILER_VERSION}\",\n\ \"CMAKE_C_FLAGS\": \"${CMAKE_C_FLAGS}\",\n\ }") - set(LINKTYPE SHARED) -endif() - -if (NOT LINKTYPE) - set(LINKTYPE STATIC) + set(BUILD_SHARED_LIBS ON) endif() set(CALL_BY_REF "0" CACHE STRING "The numerical arguments and results are passed by reference") @@ -108,7 +104,7 @@ file(GLOB BID_SRCS file(GLOB PUBLIC_HEADERS "include/*") -add_library(dfp ${LINKTYPE} ${BID_SRCS} src/NativeImpl.c) +add_library(dfp ${BID_SRCS} src/NativeImpl.c) include_directories(src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src) target_compile_definitions(dfp PRIVATE API_PREFIX=ddfp${VERSION_SUFFIX}_) if (JAVA_PREFIX) @@ -121,7 +117,7 @@ endif() install(TARGETS dfp) if (JAVA_MATH_PREFIX) - add_library(dfpmath ${LINKTYPE} ${BID_SRCS} src/NativeMathImpl.c) + add_library(dfpmath ${BID_SRCS} src/NativeMathImpl.c) include_directories(src/thirdparty/IntelRDFPMathLib20U2/LIBRARY/src) target_compile_definitions(dfpmath PRIVATE API_PREFIX=ddfpmath${VERSION_SUFFIX}_) if (JAVA_MATH_PREFIX) diff --git a/native/test_package/conanfile.py b/native/test_package/conanfile.py index 9b90871b..4783ea72 100644 --- a/native/test_package/conanfile.py +++ b/native/test_package/conanfile.py @@ -23,4 +23,4 @@ def layout(self): def test(self): if can_run(self): cmd = os.path.join(self.cpp.build.bindir, "demo") - self.run(cmd, env="conanrun") + self.run(f'{cmd} 2 + 5', env="conanrun") From d110b963366d1135323868b8af9d8114d3c591ec Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Fri, 3 Nov 2023 02:02:23 +0300 Subject: [PATCH 60/90] Cxx: Conan: Disable C++ options --- native/conanfile.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/native/conanfile.py b/native/conanfile.py index 7672fe55..9cdf487a 100644 --- a/native/conanfile.py +++ b/native/conanfile.py @@ -43,6 +43,11 @@ def set_version(self): # Command line ``--version=xxxx`` will be assigned first to self.version and have priority self.version = self.version or load_version(os.path.join(self.recipe_folder, "..", "gradle.properties")) + def configure(self): + # it's a C library + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + def layout(self): cmake_layout(self) From 113a59c66791e369b3d7513e6c762f197c2e5819 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Fri, 3 Nov 2023 12:57:16 +0300 Subject: [PATCH 61/90] Cxx: Add missed CMakeLists for test_package. [skip ci] --- native/test_package/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 native/test_package/CMakeLists.txt diff --git a/native/test_package/CMakeLists.txt b/native/test_package/CMakeLists.txt new file mode 100644 index 00000000..aee29e4b --- /dev/null +++ b/native/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(demo) + +find_package(dfp CONFIG REQUIRED) + + +add_executable(demo src/demo.cpp) +target_link_libraries(demo dfp::dfp) From c076eb436737c9f2406447b9652cb446fe5a1cf8 Mon Sep 17 00:00:00 2001 From: agdavydov81 Date: Fri, 3 Nov 2023 18:23:45 +0300 Subject: [PATCH 62/90] CI: Update Relese CI.yml [skip ci] --- .github/workflows/CI.yml | 138 +++++++++++++++++++++------------------ 1 file changed, 76 insertions(+), 62 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 4e93a92a..15d5ad96 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -29,10 +29,9 @@ jobs: ./gradle.properties retention-days: 7 - - build-native-linux: + build-wrappers: + runs-on: ubuntu-22.04 needs: [prepare] - runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 with: @@ -43,55 +42,58 @@ jobs: name: prepare-version - name: build run: | - sudo apt update - sudo apt install -yqq g++-9-arm-linux-gnueabihf \ - g++-9-aarch64-linux-gnu \ - g++-9-i686-linux-gnu \ - musl-tools - - cd .. - mkdir llvm - cd llvm - - curl -OL https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0/clang+llvm-12.0.0-armv7a-linux-gnueabihf.tar.xz - curl -OL https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0/clang+llvm-12.0.0-aarch64-linux-gnu.tar.xz - curl -OL https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0/clang+llvm-12.0.0-i386-unknown-freebsd12.tar.xz - - tar -xf clang+llvm-12.0.0-armv7a-linux-gnueabihf.tar.xz - tar -xf clang+llvm-12.0.0-aarch64-linux-gnu.tar.xz - tar -xf clang+llvm-12.0.0-i386-unknown-freebsd12.tar.xz - - ls -al - cd ../DFP/ - ls -al - ./gradlew makeNativeLinux ./gradlew makeNativeWrappers - - uses: actions/upload-artifact@v3 with: - name: build-native-linux + name: build-wrappers path: | - ./*native/bin* + ./gradle.properties ./*java/dfp/build/generated/sources/nativeWrappers/com/epam/deltix/dfp* ./*java/dfp-math/build/generated/sources/nativeWrappers/com/epam/deltix/dfpmath* ./csharp/EPAM.Deltix.DFP/NativeImpl.cs ./csharp/EPAM.Deltix.DFP/Version.targets ./csharp/EPAM.Deltix.DFPMath/NativeMathImpl.cs ./csharp/EPAM.Deltix.DFPMath/Version.targets + ./native/include* retention-days: 7 + build-native-linux: + runs-on: ubuntu-22.04 + needs: [build-wrappers] + steps: + - uses: actions/checkout@v3 + with: + submodules: 'recursive' + - name: Download build-wrappers artifacts + uses: actions/download-artifact@v3 + with: + name: build-wrappers + - name: build + run: | + sudo apt update + sudo apt install -yqq g++-arm-linux-gnueabihf \ + g++-aarch64-linux-gnu \ + g++-i686-linux-gnu \ + musl-tools + ./gradlew makeNativeLinux + - uses: actions/upload-artifact@v3 + with: + name: build-native-linux + path: | + ./*native/install* + retention-days: 7 build-native-windows: - needs: [prepare] runs-on: windows-2019 + needs: [build-wrappers] steps: - uses: actions/checkout@v3 with: submodules: 'recursive' - - name: Download prepare-version artifacts + - name: Download build-wrappers artifacts uses: actions/download-artifact@v3 with: - name: prepare-version + name: build-wrappers - name: Use MSBuild uses: microsoft/setup-msbuild@v1.1 - name: build @@ -101,48 +103,39 @@ jobs: with: name: build-native-windows path: | - ./*native/bin* + ./*native/install* retention-days: 7 - build-native-macos: - needs: [prepare] - runs-on: ubuntu-20.04 + runs-on: macos-12 + needs: [build-wrappers] steps: - uses: actions/checkout@v3 with: submodules: 'recursive' - - name: Download prepare-version artifacts + - name: Download build-wrappers artifacts uses: actions/download-artifact@v3 with: - name: prepare-version + name: build-wrappers - name: build run: | - sudo apt update - sudo apt install clang make libssl-dev liblzma-dev libxml2-dev fuse - cd ./osxcross/tarballs/ - wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.3.sdk.tar.xz - cd .. - UNATTENDED=yes OSX_VERSION_MIN=10.7 JOBS=4 ./build.sh - cd .. ./gradlew makeNativeDarwin - uses: actions/upload-artifact@v3 with: name: build-native-macos path: | - ./*native/bin* + ./*native/install* retention-days: 7 - compress-native: - runs-on: ubuntu-latest - needs: [build-native-linux, build-native-windows, build-native-macos] + runs-on: ubuntu-22.04 + needs: [build-wrappers, build-native-linux, build-native-windows, build-native-macos] steps: - uses: actions/checkout@v3 - - name: Download prepare-version artifacts + - name: Download build-wrappers artifacts uses: actions/download-artifact@v3 with: - name: prepare-version + name: build-wrappers - name: Download native-linux artifacts uses: actions/download-artifact@v3 with: @@ -158,25 +151,25 @@ jobs: - name: compress run: | zstd --version - zstd -19 --rm -r ./native/bin - zstd -19 --rm -r ./native/binmath + ./gradlew nativeInstallToBin - uses: actions/upload-artifact@v3 with: name: compress-native path: | ./gradle.properties ./*native/bin* + ./*native/binmath* ./*java/dfp/build/generated/sources/nativeWrappers/com/epam/deltix/dfp* ./*java/dfp-math/build/generated/sources/nativeWrappers/com/epam/deltix/dfpmath* ./csharp/EPAM.Deltix.DFP/NativeImpl.cs ./csharp/EPAM.Deltix.DFP/Version.targets ./csharp/EPAM.Deltix.DFPMath/NativeMathImpl.cs ./csharp/EPAM.Deltix.DFPMath/Version.targets + ./native/include* retention-days: 7 - build-java: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: [compress-native] steps: - uses: actions/checkout@v3 @@ -208,7 +201,6 @@ jobs: ./*java/vtaTest/testLibs/* retention-days: 7 - build-dotnet: runs-on: windows-2019 needs: [compress-native] @@ -237,10 +229,14 @@ jobs: ./*csharp/EPAM.Deltix.DFP.Demo/bin/Release/* retention-days: 7 - test-java: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} needs: [build-java] + strategy: + fail-fast: false + matrix: + os: [ 'ubuntu-22.04', 'windows-2019', 'macos-latest'] + java: [ '8', '11', '19'] steps: - uses: actions/checkout@v3 with: @@ -253,7 +249,7 @@ jobs: uses: actions/setup-java@v3 with: distribution: 'adopt' - java-version: '8' + java-version: ${{ matrix.java }} - name: Show environment run: | ./gradlew :java:systemInfo:runSystemInfo @@ -261,10 +257,13 @@ jobs: run: | ./gradlew runTestJars - test-dotnet: - runs-on: windows-2019 + runs-on: ${{ matrix.os }} needs: [compress-native] + strategy: + fail-fast: false + matrix: + os: [ 'ubuntu-22.04', 'windows-2019', 'macos-latest'] steps: - uses: actions/checkout@v3 with: @@ -277,11 +276,26 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: '3.1.x' - - name: test + - name: test windows + if: ${{ matrix.os == 'windows-2019' }} run: | cd csharp ./build --target=Run-Unit-Tests - + - name: test nix + if: ${{ matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-latest' }} + run: | + cd csharp + ./build.sh --target=Run-Unit-Tests + - name: Upload test results on failure + uses: actions/upload-artifact@v3 + if: ${{ failure() }} + with: + path: | + csharp/EPAM.Deltix.DFP/bin/* + csharp/EPAM.Deltix.DFPMath/bin/* + csharp/*.txt + csharp/*.xml + name: Dotnet-3.1-${{ matrix.os }}-TestReports release: if: ${{ startsWith(github.ref, 'refs/heads/release') }} From 83e962182609bef369c3567ada8c95c115d4b5b2 Mon Sep 17 00:00:00 2001 From: agdavydov81 Date: Fri, 3 Nov 2023 18:25:13 +0300 Subject: [PATCH 63/90] CI: Update Build.yml [skip ci] --- .github/workflows/Build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 0e8f0857..ef9ed205 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -27,6 +27,7 @@ jobs: with: name: build-wrappers path: | + ./gradle.properties ./*java/dfp/build/generated/sources/nativeWrappers/com/epam/deltix/dfp* ./*java/dfp-math/build/generated/sources/nativeWrappers/com/epam/deltix/dfpmath* ./csharp/EPAM.Deltix.DFP/NativeImpl.cs From 4508bcd09f8dbbc6e2d9dee55e57c78b9752c9eb Mon Sep 17 00:00:00 2001 From: agdavydov81 Date: Fri, 3 Nov 2023 21:03:28 +0300 Subject: [PATCH 64/90] CI: Add conan pacage creation test --- .github/workflows/Build.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index ef9ed205..fca24daa 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -37,6 +37,28 @@ jobs: ./native/include* retention-days: 7 + build-cxx-conan: + runs-on: ${{ matrix.os }} + needs: [build-wrappers] + strategy: + fail-fast: false + matrix: + os: [ 'ubuntu-22.04', 'windows-2019', 'macos-latest'] + steps: + - uses: actions/checkout@v3 + with: + submodules: 'recursive' + - name: Download build-wrappers artifacts + uses: actions/download-artifact@v3 + with: + name: build-wrappers + - name: create + run: | + cd native + pip install conan + python3 conan_invoke.py profile detect + python3 conan_invoke.py create . + build-native-linux: runs-on: ubuntu-22.04 needs: [build-wrappers] From fde8b8c7e1cf784a6ba7dd93ed25cdfd6054767c Mon Sep 17 00:00:00 2001 From: agdavydov81 Date: Fri, 3 Nov 2023 21:23:35 +0300 Subject: [PATCH 65/90] CI: Pin current runners versions --- .github/workflows/Build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index fca24daa..68664e3c 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -43,7 +43,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ 'ubuntu-22.04', 'windows-2019', 'macos-latest'] + os: [ 'ubuntu-22.04', 'windows-2022', 'macos-12'] steps: - uses: actions/checkout@v3 with: @@ -86,7 +86,7 @@ jobs: retention-days: 7 build-native-windows: - runs-on: windows-2019 + runs-on: windows-2022 needs: [build-wrappers] steps: - uses: actions/checkout@v3 @@ -204,7 +204,7 @@ jobs: retention-days: 7 build-dotnet: - runs-on: windows-2019 + runs-on: windows-2022 needs: [compress-native] steps: - uses: actions/checkout@v3 @@ -237,7 +237,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ 'ubuntu-22.04', 'windows-2019', 'macos-latest'] + os: [ 'ubuntu-22.04', 'windows-2022', 'macos-12'] java: [ '8', '11', '19'] steps: - uses: actions/checkout@v3 @@ -265,7 +265,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ 'ubuntu-22.04', 'windows-2019', 'macos-latest'] + os: [ 'ubuntu-22.04', 'windows-2022', 'macos-12'] steps: - uses: actions/checkout@v3 with: @@ -279,12 +279,12 @@ jobs: with: dotnet-version: '3.1.x' - name: test windows - if: ${{ matrix.os == 'windows-2019' }} + if: ${{ matrix.os == 'windows-2022' }} run: | cd csharp ./build --target=Run-Unit-Tests - name: test nix - if: ${{ matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-latest' }} + if: ${{ matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-12' }} run: | cd csharp ./build.sh --target=Run-Unit-Tests From 4794b0a5812c6e3ef96b8b47d77890841c7e0c55 Mon Sep 17 00:00:00 2001 From: agdavydov81 Date: Fri, 3 Nov 2023 21:36:34 +0300 Subject: [PATCH 66/90] CI: Update release version [skip ci] --- .github/workflows/CI.yml | 42 ++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 15d5ad96..517e9cd5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -11,7 +11,7 @@ env: jobs: prepare: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 @@ -57,6 +57,28 @@ jobs: ./native/include* retention-days: 7 + build-cxx-conan: + runs-on: ${{ matrix.os }} + needs: [build-wrappers] + strategy: + fail-fast: false + matrix: + os: [ 'ubuntu-22.04', 'windows-2022', 'macos-12'] + steps: + - uses: actions/checkout@v3 + with: + submodules: 'recursive' + - name: Download build-wrappers artifacts + uses: actions/download-artifact@v3 + with: + name: build-wrappers + - name: create + run: | + cd native + pip install conan + python3 conan_invoke.py profile detect + python3 conan_invoke.py create . + build-native-linux: runs-on: ubuntu-22.04 needs: [build-wrappers] @@ -84,7 +106,7 @@ jobs: retention-days: 7 build-native-windows: - runs-on: windows-2019 + runs-on: windows-2022 needs: [build-wrappers] steps: - uses: actions/checkout@v3 @@ -202,7 +224,7 @@ jobs: retention-days: 7 build-dotnet: - runs-on: windows-2019 + runs-on: windows-2022 needs: [compress-native] steps: - uses: actions/checkout@v3 @@ -235,7 +257,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ 'ubuntu-22.04', 'windows-2019', 'macos-latest'] + os: [ 'ubuntu-22.04', 'windows-2022', 'macos-12'] java: [ '8', '11', '19'] steps: - uses: actions/checkout@v3 @@ -263,7 +285,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ 'ubuntu-22.04', 'windows-2019', 'macos-latest'] + os: [ 'ubuntu-22.04', 'windows-2022', 'macos-12'] steps: - uses: actions/checkout@v3 with: @@ -277,12 +299,12 @@ jobs: with: dotnet-version: '3.1.x' - name: test windows - if: ${{ matrix.os == 'windows-2019' }} + if: ${{ matrix.os == 'windows-2022' }} run: | cd csharp ./build --target=Run-Unit-Tests - name: test nix - if: ${{ matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-latest' }} + if: ${{ matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-12' }} run: | cd csharp ./build.sh --target=Run-Unit-Tests @@ -300,7 +322,7 @@ jobs: release: if: ${{ startsWith(github.ref, 'refs/heads/release') }} needs: [build-java, test-java, build-dotnet, test-dotnet] - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 @@ -328,7 +350,7 @@ jobs: publish-java: if: ${{ startsWith(github.ref, 'refs/heads/release') }} needs: [release] - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 with: @@ -352,7 +374,7 @@ jobs: publish-dotnet: if: ${{ startsWith(github.ref, 'refs/heads/release') }} needs: [release] - runs-on: windows-2019 + runs-on: windows-2022 steps: - uses: actions/checkout@v3 with: From 2cdebbae5aa519eee27f2fe66acf39ad56d48000 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Sat, 11 Nov 2023 23:48:45 +0300 Subject: [PATCH 67/90] Cxx: Move conan files to the top level. [skip ci] --- native/conan_invoke.py => conan_invoke.py | 0 native/conanfile.py => conanfile.py | 8 +++++--- 2 files changed, 5 insertions(+), 3 deletions(-) rename native/conan_invoke.py => conan_invoke.py (100%) rename native/conanfile.py => conanfile.py (80%) diff --git a/native/conan_invoke.py b/conan_invoke.py similarity index 100% rename from native/conan_invoke.py rename to conan_invoke.py diff --git a/native/conanfile.py b/conanfile.py similarity index 80% rename from native/conanfile.py rename to conanfile.py index 9cdf487a..e060acf1 100644 --- a/native/conanfile.py +++ b/conanfile.py @@ -37,11 +37,11 @@ class DfpConan(ConanFile): default_options = {"shared": False} # Sources are located in the same place as this recipe, copy them to the recipe - exports_sources = "CMakeLists.txt", "src/*", "include/*" + exports_sources = "LICENSE", "intel-eula.txt", "native/CMakeLists.txt", "native/src/*", "native/include/*" def set_version(self): # Command line ``--version=xxxx`` will be assigned first to self.version and have priority - self.version = self.version or load_version(os.path.join(self.recipe_folder, "..", "gradle.properties")) + self.version = self.version or load_version(os.path.join(self.recipe_folder, "gradle.properties")) def configure(self): # it's a C library @@ -49,7 +49,7 @@ def configure(self): self.settings.rm_safe("compiler.cppstd") def layout(self): - cmake_layout(self) + cmake_layout(self, src_folder="native") def generate(self): deps = CMakeDeps(self) @@ -63,6 +63,8 @@ def build(self): cmake.build() def package(self): + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "..")) + copy(self, "intel-eula.txt", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "..")) cmake = CMake(self) cmake.install() From 9b588954504e3a80ef22f788acb99a395e98a08a Mon Sep 17 00:00:00 2001 From: agdavydov81 Date: Sat, 11 Nov 2023 23:50:26 +0300 Subject: [PATCH 68/90] CI: Fix Conan palcement. [skip ci] --- .github/workflows/Build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 68664e3c..819ac026 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -54,7 +54,6 @@ jobs: name: build-wrappers - name: create run: | - cd native pip install conan python3 conan_invoke.py profile detect python3 conan_invoke.py create . From b45608bd6d7eee3bc1534b1ca80149d43e1c6655 Mon Sep 17 00:00:00 2001 From: agdavydov81 Date: Sat, 11 Nov 2023 23:50:54 +0300 Subject: [PATCH 69/90] CI: Fix Conan palcement. --- .github/workflows/CI.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 517e9cd5..d64cb37c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -74,7 +74,6 @@ jobs: name: build-wrappers - name: create run: | - cd native pip install conan python3 conan_invoke.py profile detect python3 conan_invoke.py create . From 122d44c13263ca9de8262e7e261f4b454711671f Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Mon, 13 Nov 2023 13:25:57 +0300 Subject: [PATCH 70/90] Cxx: Fix const string size [skip ci] --- native/src/NativeImplToString.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/src/NativeImplToString.c b/native/src/NativeImplToString.c index 50a31595..2b57d081 100644 --- a/native/src/NativeImplToString.c +++ b/native/src/NativeImplToString.c @@ -266,7 +266,7 @@ const char* dfp64_to_scientific_string_3(BID_UINT64 value, char decimalMark, cha unpack_BID64(&partsSignMask, &partsExponent, &partsCoefficient, value); if (partsCoefficient == 0) { - memcpy(buffer512, SCIENTIFIC_ZERO, sizeof(SCIENTIFIC_ZERO) / sizeof(SCIENTIFIC_ZERO[0]) + 1); + memcpy(buffer512, SCIENTIFIC_ZERO, sizeof(SCIENTIFIC_ZERO) / sizeof(SCIENTIFIC_ZERO[0])); buffer512[1] = decimalMark; return buffer512; } From e7c556a0437732aa840a456e9dddd75841918b19 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Mon, 13 Nov 2023 13:33:01 +0300 Subject: [PATCH 71/90] Cxx: Disable ClangCL compilation warnings. --- native/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 9acc76ea..5df5a78f 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -17,6 +17,11 @@ if (TARGET) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TARGET_FLAGS}") endif() +if (MSVC AND CMAKE_C_COMPILER_ID STREQUAL "Clang") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") +endif() + message(STATUS "CMAKE_SYSTEM_PROCESSOR: " ${CMAKE_SYSTEM_PROCESSOR}) message(STATUS "CMAKE_C_COMPILER_TARGET: " ${CMAKE_C_COMPILER_TARGET}) message(STATUS "CMAKE_CXX_COMPILER_TARGET: " ${CMAKE_CXX_COMPILER_TARGET}) From 8546a2a3ae78464c8055aa25d42383da0622bdf2 Mon Sep 17 00:00:00 2001 From: agdavydov81 Date: Mon, 13 Nov 2023 13:39:28 +0300 Subject: [PATCH 72/90] Cxx: Fix pip version --- .github/workflows/Build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 819ac026..af40fcc8 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -54,7 +54,7 @@ jobs: name: build-wrappers - name: create run: | - pip install conan + pip3 install conan python3 conan_invoke.py profile detect python3 conan_invoke.py create . From 509204253aec22c6adb3d875664a765e06cdf312 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Mon, 13 Nov 2023 13:52:32 +0300 Subject: [PATCH 73/90] Cxx: Disable verbose compilation. --- native/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/build.gradle b/native/build.gradle index 7f54bde0..47622c0b 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -7,7 +7,7 @@ def llvmRoot = "$rootDir/llvm" def versionSuffix = versioning()["suffix"] def CCOMPILER = "clang" def CXXCOMPILER = "clang++" -def VERBOSE = "ON" +def VERBOSE = "FALSE" def keepBuildDir = (findProperty('keepBuildDir')?.toBoolean()) ?: false task makeNativeWindowsI386(dependsOn: ':java:nativeWrappers:makeNativeWrappers') { From 32e869927e5c9cf6e1eaaf25723aacceeb3c6373 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Mon, 13 Nov 2023 13:58:38 +0300 Subject: [PATCH 74/90] Cxx: Fix arguments count. [skip ci] --- native/src/NativeImplToString.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/src/NativeImplToString.c b/native/src/NativeImplToString.c index 2b57d081..bc26cce8 100644 --- a/native/src/NativeImplToString.c +++ b/native/src/NativeImplToString.c @@ -298,7 +298,7 @@ const char* dfp64_to_scientific_string_3(BID_UINT64 value, char decimalMark, cha buffer512[be++] = exponent >= 0 ? '+' : '-'; { if (!BCD_TABLE) - BCD_TABLE = makeBcdTable(BCD_TABLE_DIGITS); + BCD_TABLE = makeBcdTable(); be += BCD_TABLE_DIGITS; for (int j = 0, ti = abs(exponent) * BCD_TABLE_DIGITS /* (remainder << 1) + remainder */; j < BCD_TABLE_DIGITS; ++j, ++ti) From 95054968dba27655b24e9669b790422a34d5f811 Mon Sep 17 00:00:00 2001 From: agdavydov81 Date: Mon, 13 Nov 2023 14:06:38 +0300 Subject: [PATCH 75/90] CI: Cxx: Fix pip version [skip ci] --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d64cb37c..64700c31 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -74,7 +74,7 @@ jobs: name: build-wrappers - name: create run: | - pip install conan + pip3 install conan python3 conan_invoke.py profile detect python3 conan_invoke.py create . From c36b91a33b4fe68a75f933ef244160da27fc07de Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Mon, 13 Nov 2023 19:59:55 +0300 Subject: [PATCH 76/90] Cxx: Remove Conan files (move to the conan-index) [skip ci] --- conan_invoke.py | 6 --- conanfile.py | 72 ------------------------------ native/test_package/CMakeLists.txt | 8 ---- native/test_package/conanfile.py | 26 ----------- native/test_package/src/demo.cpp | 42 ----------------- 5 files changed, 154 deletions(-) delete mode 100644 conan_invoke.py delete mode 100644 conanfile.py delete mode 100644 native/test_package/CMakeLists.txt delete mode 100644 native/test_package/conanfile.py delete mode 100644 native/test_package/src/demo.cpp diff --git a/conan_invoke.py b/conan_invoke.py deleted file mode 100644 index d4db8008..00000000 --- a/conan_invoke.py +++ /dev/null @@ -1,6 +0,0 @@ -from conans.conan import main -import sys - -if __name__ == "__main__": - sys.exit(main(sys.argv[1:])) - diff --git a/conanfile.py b/conanfile.py deleted file mode 100644 index e060acf1..00000000 --- a/conanfile.py +++ /dev/null @@ -1,72 +0,0 @@ -from conan import ConanFile -from conan.tools.files import copy -from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps -import os -import re - -from conan.tools.scm import git - - -# https://docs.conan.io/2/reference/conanfile/attributes.html - - -def load_version(properties_filename): - with (open(properties_filename, 'r') as file): - for line in file: - if re.match("^\s*version\s*=", line): - return line[line.index("=") + 1:].strip().removesuffix("-SNAPSHOT") - - raise Exception("Can't determine version") - - -class DfpConan(ConanFile): - name = "dfp" - package_type = "library" - - # Optional metadata - description = "Decimal Floating Point Arithmetic Library" - homepage = "https://github.com/epam/DFP/" - url = "https://github.com/epam/DFP.git" - license = ("Apache-2.0", "Intel") - topics = ("decimal", "dfp", "ieee-754", "deltix") - author = "Andrei Davydov (agdavydov81@gmail.com)" - - # Binary configuration - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False]} - default_options = {"shared": False} - - # Sources are located in the same place as this recipe, copy them to the recipe - exports_sources = "LICENSE", "intel-eula.txt", "native/CMakeLists.txt", "native/src/*", "native/include/*" - - def set_version(self): - # Command line ``--version=xxxx`` will be assigned first to self.version and have priority - self.version = self.version or load_version(os.path.join(self.recipe_folder, "gradle.properties")) - - def configure(self): - # it's a C library - self.settings.rm_safe("compiler.libcxx") - self.settings.rm_safe("compiler.cppstd") - - def layout(self): - cmake_layout(self, src_folder="native") - - def generate(self): - deps = CMakeDeps(self) - deps.generate() - tc = CMakeToolchain(self) - tc.generate() - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def package(self): - copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "..")) - copy(self, "intel-eula.txt", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder, "..")) - cmake = CMake(self) - cmake.install() - - def package_info(self): - self.cpp_info.libs = ["ddfp"] diff --git a/native/test_package/CMakeLists.txt b/native/test_package/CMakeLists.txt deleted file mode 100644 index aee29e4b..00000000 --- a/native/test_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(demo) - -find_package(dfp CONFIG REQUIRED) - - -add_executable(demo src/demo.cpp) -target_link_libraries(demo dfp::dfp) diff --git a/native/test_package/conanfile.py b/native/test_package/conanfile.py deleted file mode 100644 index 4783ea72..00000000 --- a/native/test_package/conanfile.py +++ /dev/null @@ -1,26 +0,0 @@ -import os - -from conan import ConanFile -from conan.tools.cmake import CMake, cmake_layout -from conan.tools.build import can_run - - -class TestExampleConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "CMakeDeps", "CMakeToolchain" - - def requirements(self): - self.requires(self.tested_reference_str) - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def layout(self): - cmake_layout(self) - - def test(self): - if can_run(self): - cmd = os.path.join(self.cpp.build.bindir, "demo") - self.run(f'{cmd} 2 + 5', env="conanrun") diff --git a/native/test_package/src/demo.cpp b/native/test_package/src/demo.cpp deleted file mode 100644 index b26e0922..00000000 --- a/native/test_package/src/demo.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include -#include -#include - -using namespace epam::deltix::dfp; - -int main(int argc, char *argv[]) { - if(argc!=4) { - std::cout << "Usage: " << std::endl; - return 0; - } - - const Decimal64 x(argv[1]); // Parsing call example - can throw std::invalid_argument - - const char* op = argv[2]; - - std::stringstream arg3(argv[3]); // Input from stream - Decimal64 y; - arg3 >> y; - - Decimal64 z; - switch (*op) { - case '+': - z = x + y; - break; - case '-': - z = x - y; - break; - case '*': - z = x * y; - break; - case '/': - z = x / y; - break; - default: - std::cerr << "Unsupported operation '" << op << "'" << std::endl; - return 1; - } - - std::cout << x << "(=" << x.toUnderlying() << ") " << op << " " << (std::string)y << "(=" << y.toUnderlying() << ") = " << z << "(=" << z.toUnderlying() << ")" << std::endl; - return 0; -} From 42f99293ab212ddc82aac17372b7b510be3e6cd0 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Mon, 13 Nov 2023 20:02:57 +0300 Subject: [PATCH 77/90] CI: Cxx: Temporary delete Conan build [skip ci] --- .github/workflows/Build.yml | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index af40fcc8..7874fa88 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -37,27 +37,6 @@ jobs: ./native/include* retention-days: 7 - build-cxx-conan: - runs-on: ${{ matrix.os }} - needs: [build-wrappers] - strategy: - fail-fast: false - matrix: - os: [ 'ubuntu-22.04', 'windows-2022', 'macos-12'] - steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - name: Download build-wrappers artifacts - uses: actions/download-artifact@v3 - with: - name: build-wrappers - - name: create - run: | - pip3 install conan - python3 conan_invoke.py profile detect - python3 conan_invoke.py create . - build-native-linux: runs-on: ubuntu-22.04 needs: [build-wrappers] From a5d4285bb3b8aabf833bc94abfd8ebbbe7288259 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Mon, 13 Nov 2023 20:03:51 +0300 Subject: [PATCH 78/90] CI: Cxx: Temporary delete Conan package build [skip ci] --- .github/workflows/CI.yml | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 64700c31..1b96791e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -57,27 +57,6 @@ jobs: ./native/include* retention-days: 7 - build-cxx-conan: - runs-on: ${{ matrix.os }} - needs: [build-wrappers] - strategy: - fail-fast: false - matrix: - os: [ 'ubuntu-22.04', 'windows-2022', 'macos-12'] - steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - name: Download build-wrappers artifacts - uses: actions/download-artifact@v3 - with: - name: build-wrappers - - name: create - run: | - pip3 install conan - python3 conan_invoke.py profile detect - python3 conan_invoke.py create . - build-native-linux: runs-on: ubuntu-22.04 needs: [build-wrappers] From 4e243038e2eb324187c97696dd392897c97aaebb Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Tue, 14 Nov 2023 14:29:24 +0300 Subject: [PATCH 79/90] CI: Try save nave sources. --- .github/workflows/Build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 7874fa88..1b256247 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -36,6 +36,12 @@ jobs: ./csharp/EPAM.Deltix.DFPMath/Version.targets ./native/include* retention-days: 7 + - uses: actions/upload-artifact@v3 + with: + name: native-sources + path: | + native/ + retention-days: 7 build-native-linux: runs-on: ubuntu-22.04 From 205cce5075fe66d7518cfacff67c3077474829d2 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Tue, 14 Nov 2023 14:50:02 +0300 Subject: [PATCH 80/90] CI: Save licenses to the native-sources artifacts. --- .github/workflows/Build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 1b256247..9ddbfe20 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -23,6 +23,8 @@ jobs: - name: build run: | ./gradlew makeNativeWrappers + cp LICENSE native/ + cp intel-eula.txt native/ - uses: actions/upload-artifact@v3 with: name: build-wrappers From 014cfe2655d5126f453801d7445108f190f6302b Mon Sep 17 00:00:00 2001 From: "agdavydov81@gmail.com" Date: Fri, 24 Nov 2023 17:42:16 +0300 Subject: [PATCH 81/90] fix: cxx: Add fPIC option compilation. [skip ci] --- native/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 5df5a78f..9adcbf76 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -73,7 +73,7 @@ add_definitions(-DDECIMAL_GLOBAL_EXCEPTION_FLAGS=${GLOBAL_FLAGS}) #set(CMAKE_C_VISIBILITY_PRESET default) #set(CMAKE_CXX_VISIBILITY_PRESET default) #set(CMAKE_VISIBILITY_INLINES_HIDDEN 0) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) +set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "Position-independent code") set(CMAKE_CXX_STANDARD 11) if (MSVC) From bc2ecd0737e6cb42cd1ecad00280a7f2ed8d0718 Mon Sep 17 00:00:00 2001 From: "agdavydov81@gmail.com" Date: Fri, 24 Nov 2023 18:00:34 +0300 Subject: [PATCH 82/90] fix: fPIC option. --- native/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 9adcbf76..880ee639 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -73,7 +73,7 @@ add_definitions(-DDECIMAL_GLOBAL_EXCEPTION_FLAGS=${GLOBAL_FLAGS}) #set(CMAKE_C_VISIBILITY_PRESET default) #set(CMAKE_CXX_VISIBILITY_PRESET default) #set(CMAKE_VISIBILITY_INLINES_HIDDEN 0) -set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "Position-independent code") +set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "Position-independent code flag") set(CMAKE_CXX_STANDARD 11) if (MSVC) From fa7d583842167daeee881f99a93f5d6b634542d2 Mon Sep 17 00:00:00 2001 From: "agdavydov81@gmail.com" Date: Fri, 24 Nov 2023 18:22:24 +0300 Subject: [PATCH 83/90] native: Disable c++11 requirement --- native/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 880ee639..2290eb53 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -74,7 +74,7 @@ add_definitions(-DDECIMAL_GLOBAL_EXCEPTION_FLAGS=${GLOBAL_FLAGS}) #set(CMAKE_CXX_VISIBILITY_PRESET default) #set(CMAKE_VISIBILITY_INLINES_HIDDEN 0) set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "Position-independent code flag") -set(CMAKE_CXX_STANDARD 11) +#set(CMAKE_CXX_STANDARD 11) if (MSVC) add_definitions(-D_CRT_SECURE_NO_DEPRECATE) From 7173cd4d6ca185322b5b5d9c83314fc4c9a72238 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Thu, 30 Nov 2023 14:08:10 +0300 Subject: [PATCH 84/90] Update supported languages. [skip ci] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2012fa98..8ac84070 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Decimal Floating Point Arithmetic for Java/.NET +# Decimal Floating Point Arithmetic for C/C++/Java/.NET "...it is a bad idea to use floating point to try to represent exact quantities like monetary amounts. Using floating point for dollars-and-cents calculations is a recipe for disaster. Floating point numbers are best reserved for values such as measurements, whose values are fundamentally inexact to begin with." -- [Brian Goetz](https://www.ibm.com/developerworks/library/j-jtp0114/index.html) From 3dd20211805330f0b86b8afc3d4c61524d501e7a Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Mon, 25 Mar 2024 23:17:52 +0300 Subject: [PATCH 85/90] Java: Restore original toString() formatting. C: Not restored, so .NET and C works in the ".0" style yet. [wip] --- .../java/com/epam/deltix/dfp/Decimal64.java | 24 +++ .../com/epam/deltix/dfp/Decimal64Utils.java | 156 +++++++++++++++++- .../java/com/epam/deltix/dfp/JavaImpl.java | 88 +++++++--- .../com/epam/deltix/dfp/BigDecimalTest.java | 8 +- .../com/epam/deltix/dfp/Decimal64Test.java | 20 +-- .../epam/deltix/dfp/Decimal64UtilsTest.java | 150 ++++++++--------- .../com/epam/deltix/dfp/FromDoubleTest.java | 4 +- .../com/epam/deltix/dfp/JavaImplTest.java | 32 ++-- .../epam/deltix/dfp/FormattingBenchmark.java | 12 +- 9 files changed, 348 insertions(+), 146 deletions(-) diff --git a/java/dfp/src/main/java/com/epam/deltix/dfp/Decimal64.java b/java/dfp/src/main/java/com/epam/deltix/dfp/Decimal64.java index 96c6c54b..51f878e1 100644 --- a/java/dfp/src/main/java/com/epam/deltix/dfp/Decimal64.java +++ b/java/dfp/src/main/java/com/epam/deltix/dfp/Decimal64.java @@ -875,6 +875,10 @@ public static String toScientificString(final Decimal64 decimal64) { return null == decimal64 ? "null" : Decimal64Utils.toScientificString(decimal64.value); } + public static String toFloatString(final Decimal64 decimal64) { + return null == decimal64 ? "null" : Decimal64Utils.toFloatString(decimal64.value); + } + public Appendable appendTo(final Appendable appendable) throws IOException { return Decimal64Utils.appendTo(value, appendable); } @@ -883,6 +887,10 @@ public Appendable scientificAppendTo(final Appendable appendable) throws IOExcep return Decimal64Utils.scientificAppendTo(value, appendable); } + public Appendable floatAppendTo(final Appendable appendable) throws IOException { + return Decimal64Utils.floatAppendTo(value, appendable); + } + public StringBuilder appendTo(final StringBuilder builder) { return Decimal64Utils.appendTo(value, builder); } @@ -891,6 +899,10 @@ public StringBuilder scientificAppendTo(final StringBuilder builder) { return Decimal64Utils.scientificAppendTo(value, builder); } + public StringBuilder floatAppendTo(final StringBuilder builder) { + return Decimal64Utils.floatAppendTo(value, builder); + } + public static Appendable appendTo(final Decimal64 decimal64, final Appendable appendable) throws IOException { return null == decimal64 ? appendable.append("null") : Decimal64Utils.appendTo(decimal64.value, appendable); } @@ -899,6 +911,10 @@ public static Appendable scientificAppendTo(final Decimal64 decimal64, final App return null == decimal64 ? appendable.append("null") : Decimal64Utils.scientificAppendTo(decimal64.value, appendable); } + public static Appendable floatAppendTo(final Decimal64 decimal64, final Appendable appendable) throws IOException { + return null == decimal64 ? appendable.append("null") : Decimal64Utils.floatAppendTo(decimal64.value, appendable); + } + public static StringBuilder appendTo(final Decimal64 decimal64, final StringBuilder builder) { return null == decimal64 ? builder.append("null") : Decimal64Utils.appendTo(decimal64.value, builder); } @@ -907,6 +923,10 @@ public static StringBuilder scientificAppendTo(final Decimal64 decimal64, final return null == decimal64 ? builder.append("null") : Decimal64Utils.scientificAppendTo(decimal64.value, builder); } + public static StringBuilder floatAppendTo(final Decimal64 decimal64, final StringBuilder builder) { + return null == decimal64 ? builder.append("null") : Decimal64Utils.floatAppendTo(decimal64.value, builder); + } + /** * Try parse a dfp floating-point value from the given textual representation. *

@@ -1137,6 +1157,10 @@ public String toScientificString() { return Decimal64Utils.toScientificString(value); } + public String toFloatString() { + return Decimal64Utils.toFloatString(value); + } + /// endregion /// region Number Interface Implementation diff --git a/java/dfp/src/main/java/com/epam/deltix/dfp/Decimal64Utils.java b/java/dfp/src/main/java/com/epam/deltix/dfp/Decimal64Utils.java index d8f7f178..0c6f6577 100644 --- a/java/dfp/src/main/java/com/epam/deltix/dfp/Decimal64Utils.java +++ b/java/dfp/src/main/java/com/epam/deltix/dfp/Decimal64Utils.java @@ -196,11 +196,11 @@ public static int hashCode(@Decimal final long value) { public static String toString(@Decimal final long value) { - return JavaImpl.fastToString(value, DECIMAL_MARK_DEFAULT); + return JavaImpl.fastToString(value, DECIMAL_MARK_DEFAULT, false); } public static String toString(@Decimal final long value, final char decimalMark) { - return JavaImpl.fastToString(value, decimalMark); + return JavaImpl.fastToString(value, decimalMark, false); } public static String toScientificString(@Decimal final long value) { @@ -211,6 +211,14 @@ public static String toScientificString(@Decimal final long value, final char de return JavaImpl.fastToScientificString(value, decimalMark); } + public static String toFloatString(@Decimal final long value) { + return JavaImpl.fastToString(value, DECIMAL_MARK_DEFAULT, true); + } + + public static String toFloatString(@Decimal final long value, final char decimalMark) { + return JavaImpl.fastToString(value, decimalMark, true); + } + static String toDebugString(@Decimal final long value) { return JavaImpl.toDebugString(value); } @@ -1249,7 +1257,7 @@ public static long canonize(@Decimal final long value) { * @throws IOException from {@link Appendable#append(char)} */ public static Appendable appendTo(@Decimal final long value, final Appendable appendable) throws IOException { - return JavaImpl.fastAppendToAppendable(value, DECIMAL_MARK_DEFAULT, appendable); + return JavaImpl.fastAppendToAppendable(value, DECIMAL_MARK_DEFAULT, false, appendable); } /** @@ -1264,7 +1272,7 @@ public static Appendable appendTo(@Decimal final long value, final Appendable ap * @throws IOException from {@link Appendable#append(char)} */ public static Appendable appendTo(@Decimal final long value, final char decimalMark, final Appendable appendable) throws IOException { - return JavaImpl.fastAppendToAppendable(value, decimalMark, appendable); + return JavaImpl.fastAppendToAppendable(value, decimalMark, false, appendable); } /** @@ -1325,6 +1333,63 @@ public static Appendable scientificAppendToChecked(@Decimal final long value, fi return scientificAppendTo(value, decimalMark, appendable); } + /** + * Append string representation of {@code DFP} {@code value} to {@link Appendable} {@code appendable} + *

+ * Same as {@code appendable.append(value.toFloatString())}, but more efficient. + * + * @param value {@code DFP64} argument + * @param appendable {@link Appendable} instance to which the string representation of the {@code value} will be appended + * @return the 2nd argument ({@link Appendable} {@code appendable}) + * @throws IOException from {@link Appendable#append(char)} + */ + public static Appendable floatAppendTo(@Decimal final long value, final Appendable appendable) throws IOException { + return JavaImpl.fastAppendToAppendable(value, DECIMAL_MARK_DEFAULT, true, appendable); + } + + /** + * Append string representation of {@code DFP} {@code value} to {@link Appendable} {@code appendable} + *

+ * Same as {@code appendable.append(value.toFloatString())}, but more efficient. + * + * @param value {@code DFP64} argument + * @param decimalMark A decimal separator used to separate the integer part from the fractional part. + * @param appendable {@link Appendable} instance to which the string representation of the {@code value} will be appended + * @return the 2nd argument ({@link Appendable} {@code appendable}) + * @throws IOException from {@link Appendable#append(char)} + */ + public static Appendable floatAppendTo(@Decimal final long value, final char decimalMark, final Appendable appendable) throws IOException { + return JavaImpl.fastAppendToAppendable(value, decimalMark, true, appendable); + } + + /** + * Implements {@link Decimal64#floatAppendTo(Appendable)}, adds null check; do not use directly. + * + * @param value DFP argument + * @param appendable an object, implementing Appendable interface + * @return .. + * @throws IOException from {@link Appendable#append(char)} + */ + @Deprecated + public static Appendable floatAppendToChecked(@Decimal final long value, final Appendable appendable) throws IOException { + checkNull(value); + return floatAppendTo(value, appendable); + } + + /** + * Implements {@link Decimal64#floatAppendTo(Appendable)}, adds null check; do not use directly. + * + * @param value DFP argument + * @param decimalMark A decimal separator used to separate the integer part from the fractional part. + * @param appendable an object, implementing Appendable interface + * @return .. + * @throws IOException from {@link Appendable#append(char)} + */ + @Deprecated + public static Appendable floatAppendToChecked(@Decimal final long value, final char decimalMark, final Appendable appendable) throws IOException { + checkNull(value); + return floatAppendTo(value, decimalMark, appendable); + } /** * Append string representation of {@code DFP} value to {@link StringBuilder} {@code sb} @@ -1336,7 +1401,7 @@ public static Appendable scientificAppendToChecked(@Decimal final long value, fi * @return the value of 2nd argument ({@link StringBuilder} {@code sb}) */ public static StringBuilder appendTo(@Decimal final long value, final StringBuilder sb) { - return JavaImpl.fastAppendToStringBuilder(value, DECIMAL_MARK_DEFAULT, sb); + return JavaImpl.fastAppendToStringBuilder(value, DECIMAL_MARK_DEFAULT, false, sb); } /** @@ -1350,7 +1415,7 @@ public static StringBuilder appendTo(@Decimal final long value, final StringBuil * @return the value of 2nd argument ({@link StringBuilder} {@code sb}) */ public static StringBuilder appendTo(@Decimal final long value, final char decimalMark, final StringBuilder sb) { - return JavaImpl.fastAppendToStringBuilder(value, decimalMark, sb); + return JavaImpl.fastAppendToStringBuilder(value, decimalMark, false, sb); } /** @@ -1407,6 +1472,60 @@ public static StringBuilder scientificAppendToChecked(@Decimal final long value, return scientificAppendTo(value, decimalMark, sb); } + /** + * Append string representation of {@code DFP} value to {@link StringBuilder} {@code sb} + *

+ * Same as {@code sb.append(value.toFloatString());}, but more efficient. + * + * @param value {@code DFP64} argument + * @param sb {@link StringBuilder} instance to which the string representation of the {@code value} will be appended + * @return the value of 2nd argument ({@link StringBuilder} {@code sb}) + */ + public static StringBuilder floatAppendTo(@Decimal final long value, final StringBuilder sb) { + return JavaImpl.fastAppendToStringBuilder(value, DECIMAL_MARK_DEFAULT, true, sb); + } + + /** + * Append string representation of {@code DFP} value to {@link StringBuilder} {@code sb} + *

+ * Same as {@code sb.append(value.toFloatString());}, but more efficient. + * + * @param value {@code DFP64} argument + * @param decimalMark A decimal separator used to separate the integer part from the fractional part. + * @param sb {@link StringBuilder} instance to which the string representation of the {@code value} will be appended + * @return the value of 2nd argument ({@link StringBuilder} {@code sb}) + */ + public static StringBuilder floatAppendTo(@Decimal final long value, final char decimalMark, final StringBuilder sb) { + return JavaImpl.fastAppendToStringBuilder(value, decimalMark, true, sb); + } + + /** + * Implements {@link Decimal64#floatAppendTo(StringBuilder)}, adds null check; do not use directly. + * + * @param value DFP argument + * @param sb {@link StringBuilder} instance to which the string representation of the {@code value} will be appended + * @return .. + */ + @Deprecated + public static StringBuilder floatAppendToChecked(@Decimal final long value, final StringBuilder sb) { + checkNull(value); + return floatAppendTo(value, sb); + } + + /** + * Implements {@link Decimal64#floatAppendTo(StringBuilder)}, adds null check; do not use directly. + * + * @param value DFP argument + * @param decimalMark A decimal separator used to separate the integer part from the fractional part. + * @param sb {@link StringBuilder} instance to which the string representation of the {@code value} will be appended + * @return .. + */ + @Deprecated + public static StringBuilder floatAppendToChecked(@Decimal final long value, final char decimalMark, final StringBuilder sb) { + checkNull(value); + return floatAppendTo(value, decimalMark, sb); + } + /** * Try parse a dfp floating-point value from the given textual representation. *

@@ -2676,6 +2795,31 @@ public static String toScientificStringChecked(@Decimal final long value, final return toScientificString(value, decimalMark); } + /** + * Implements {@link Decimal64#toFloatString()}, adds null checks; do not use directly. + * + * @param value DFP argument + * @return .. + */ + @Deprecated + public static String toFloatStringChecked(@Decimal final long value) { + checkNull(value); + return toFloatString(value); + } + + /** + * Implements {@link Decimal64#toFloatString()}, adds null checks; do not use directly. + * + * @param value DFP argument + * @param decimalMark A decimal separator used to separate the integer part from the fractional part. + * @return .. + */ + @Deprecated + public static String toFloatStringChecked(@Decimal final long value, final char decimalMark) { + checkNull(value); + return toFloatString(value, decimalMark); + } + /** * Implements {@link Decimal64#equals(Decimal64)}, adds null checks; do not use directly. * diff --git a/java/dfp/src/main/java/com/epam/deltix/dfp/JavaImpl.java b/java/dfp/src/main/java/com/epam/deltix/dfp/JavaImpl.java index 5cfddd0b..4a1dee48 100644 --- a/java/dfp/src/main/java/com/epam/deltix/dfp/JavaImpl.java +++ b/java/dfp/src/main/java/com/epam/deltix/dfp/JavaImpl.java @@ -367,7 +367,7 @@ public static long fromDecimalDouble(final double x) { // } // }; - public static Appendable appendToRefImpl(final long value, final char decimalMark, final Appendable appendable) throws IOException { + public static Appendable appendToRefImpl(final long value, final char decimalMark, final boolean floatStyle, final Appendable appendable) throws IOException { if (isNull(value)) { return appendable.append("null"); } @@ -419,8 +419,12 @@ public static Appendable appendToRefImpl(final long value, final char decimalMar } } - if (0 == partsCoefficient) - return appendable.append("0" + decimalMark + "0"); + if (0 == partsCoefficient) { + appendable.append('0'); + if (floatStyle) + appendable.append(decimalMark).append('0'); + return appendable; + } if (value < 0) appendable.append('-'); @@ -432,7 +436,8 @@ public static Appendable appendToRefImpl(final long value, final char decimalMar appendLongTo(partsCoefficient, appendable, digits); for (int i = 0; i < exponent; i += 1) appendable.append('0'); - appendable.append(decimalMark).append('0'); + if (floatStyle) + appendable.append(decimalMark).append('0'); } else if (digits + exponent > 0) { final long integralPart = partsCoefficient / POWERS_OF_TEN[-exponent]; final long fractionalPart = partsCoefficient % POWERS_OF_TEN[-exponent]; @@ -443,7 +448,8 @@ public static Appendable appendToRefImpl(final long value, final char decimalMar appendable.append('0'); appendLongTo(dropTrailingZeros(fractionalPart), appendable); } else { - appendable.append(decimalMark).append('0'); + if (floatStyle) + appendable.append(decimalMark).append('0'); } } else { appendable.append('0').append(decimalMark); @@ -496,7 +502,7 @@ private static char[] makeBcdTable(final int tenPowerMaxIndex) { return table; } - public static String fastToString(final long value, final char decimalMark) { + public static String fastToString(final long value, final char decimalMark, final boolean floatStyle) { if (isNull(value)) return "null"; @@ -548,8 +554,9 @@ public static String fastToString(final long value, final char decimalMark) { } } - if (partsCoefficient == 0) - return "0" + decimalMark + "0"; + if (partsCoefficient == 0) { + return !floatStyle ? "0" : ("0" + decimalMark + "0"); + } int exponent = partsExponent - EXPONENT_BIAS; @@ -557,8 +564,10 @@ public static String fastToString(final long value, final char decimalMark) { if (exponent >= 0) { int bi = buffer.length; - buffer[--bi] = '0'; - buffer[--bi] = decimalMark; + if (floatStyle) { + buffer[--bi] = '0'; + buffer[--bi] = decimalMark; + } for (int i = 0; i < exponent; ++i) buffer[--bi] = '0'; @@ -613,8 +622,13 @@ public static String fastToString(final long value, final char decimalMark) { while (buffer[be - 1] == '0') --be; - if (buffer[be - 1] == decimalMark && be < buffer.length) - buffer[be++] = '0'; + if (buffer[be - 1] == decimalMark) { + if (!floatStyle) { + --be; + } else if (be < buffer.length) { + buffer[be++] = '0'; + } + } return new String(buffer, bi, be - bi); @@ -738,7 +752,7 @@ public static String fastToScientificString(final long value, final char decimal } // Copy-paste of the fastToString - public static StringBuilder fastAppendToStringBuilder(final long value, final char decimalMark, final StringBuilder stringBuilder) { + public static StringBuilder fastAppendToStringBuilder(final long value, final char decimalMark, final boolean floatStyle, final StringBuilder stringBuilder) { if (isNull(value)) return stringBuilder.append("null"); @@ -790,8 +804,12 @@ public static StringBuilder fastAppendToStringBuilder(final long value, final ch } } - if (partsCoefficient == 0) - return stringBuilder.append('0').append(decimalMark).append('0'); + if (partsCoefficient == 0) { + stringBuilder.append('0'); + if (floatStyle) + stringBuilder.append(decimalMark).append('0'); + return stringBuilder; + } int exponent = partsExponent - EXPONENT_BIAS; @@ -799,8 +817,10 @@ public static StringBuilder fastAppendToStringBuilder(final long value, final ch if (exponent >= 0) { int bi = buffer.length; - buffer[--bi] = '0'; - buffer[--bi] = decimalMark; + if (floatStyle) { + buffer[--bi] = '0'; + buffer[--bi] = decimalMark; + } for (int i = 0; i < exponent; ++i) buffer[--bi] = '0'; @@ -855,8 +875,13 @@ public static StringBuilder fastAppendToStringBuilder(final long value, final ch while (buffer[be - 1] == '0') --be; - if (buffer[be - 1] == decimalMark && be < buffer.length) - buffer[be++] = '0'; + if (buffer[be - 1] == decimalMark) { + if (!floatStyle) { + --be; + } else if (be < buffer.length) { + buffer[be++] = '0'; + } + } return stringBuilder.append(buffer, bi, be - bi); @@ -1037,7 +1062,7 @@ protected MutableCharBuffer initialValue() { }; // Copy-paste of the fastToString - public static Appendable fastAppendToAppendable(final long value, final char decimalMark, final Appendable appendable) throws IOException { + public static Appendable fastAppendToAppendable(final long value, final char decimalMark, final boolean floatStyle, final Appendable appendable) throws IOException { if (isNull(value)) return appendable.append("null"); @@ -1089,8 +1114,12 @@ public static Appendable fastAppendToAppendable(final long value, final char dec } } - if (partsCoefficient == 0) - return appendable.append('0').append(decimalMark).append('0'); + if (partsCoefficient == 0) { + appendable.append('0'); + if (floatStyle) + appendable.append(decimalMark).append('0'); + return appendable; + } int exponent = partsExponent - EXPONENT_BIAS; @@ -1099,8 +1128,10 @@ public static Appendable fastAppendToAppendable(final long value, final char dec if (exponent >= 0) { int bi = buffer.length; - buffer[--bi] = '0'; - buffer[--bi] = decimalMark; + if (floatStyle) { + buffer[--bi] = '0'; + buffer[--bi] = decimalMark; + } for (int i = 0; i < exponent; ++i) buffer[--bi] = '0'; @@ -1155,8 +1186,13 @@ public static Appendable fastAppendToAppendable(final long value, final char dec while (buffer[be - 1] == '0') --be; - if (buffer[be - 1] == decimalMark && be < buffer.length) - buffer[be++] = '0'; + if (buffer[be - 1] == decimalMark) { + if (!floatStyle) { + --be; + } else if (be < buffer.length) { + buffer[be++] = '0'; + } + } return appendable.append(charBuffer.setRange(bi, be - bi)); diff --git a/java/dfp/src/test/java/com/epam/deltix/dfp/BigDecimalTest.java b/java/dfp/src/test/java/com/epam/deltix/dfp/BigDecimalTest.java index 9b558600..212bb9f1 100644 --- a/java/dfp/src/test/java/com/epam/deltix/dfp/BigDecimalTest.java +++ b/java/dfp/src/test/java/com/epam/deltix/dfp/BigDecimalTest.java @@ -40,9 +40,7 @@ public void conversionToBigDecimalAndBack() { } private static void toBigDecimalAndBack(@Decimal final long aD64) { - String aStr = Decimal64Utils.toString(aD64); - if (aStr.endsWith(".0")) - aStr = aStr.substring(0, aStr.length() - 2); + final String aStr = Decimal64Utils.toString(aD64); final BigDecimal big = Decimal64Utils.toBigDecimal(aD64); @@ -96,10 +94,10 @@ private static void toDecimal64(final BigDecimal a) { final String aStr = a.toPlainString(); String bStr = Decimal64Utils.toString(b); - if (!aStr.contains(".") && (aStr.length() + 2) != bStr.length()) + if (!aStr.contains(".") && aStr.length() != bStr.length()) throw new RuntimeException("BigDecimal(=" + a + ") conversion to Decimal64 order mismatch."); - bStr = trimBackZerosAndDot(bStr.endsWith(".0") ? bStr.substring(0, bStr.length() - 2) : bStr); + bStr = trimBackZerosAndDot(Decimal64Utils.toString(b)); if (!bStr.isEmpty()) bStr = bStr.substring(0, bStr.length() - 1); // Remove rounded symbol diff --git a/java/dfp/src/test/java/com/epam/deltix/dfp/Decimal64Test.java b/java/dfp/src/test/java/com/epam/deltix/dfp/Decimal64Test.java index ae2fb549..1849e803 100644 --- a/java/dfp/src/test/java/com/epam/deltix/dfp/Decimal64Test.java +++ b/java/dfp/src/test/java/com/epam/deltix/dfp/Decimal64Test.java @@ -261,14 +261,14 @@ public void numberConversionTest() { @Test public void toStringTest() { - Assert.assertEquals("0.0", Decimal64.fromLong(0).toString()); - Assert.assertEquals("42.0", Decimal64.fromLong(42).toString()); - Assert.assertEquals(Integer.MAX_VALUE + ".0", Decimal64.fromInt(Integer.MAX_VALUE).toString()); - Assert.assertEquals(Integer.MIN_VALUE + ".0", Decimal64.fromInt(Integer.MIN_VALUE).toString()); - Assert.assertEquals(Integer.MAX_VALUE + ".0", Decimal64.fromLong(Integer.MAX_VALUE).toString()); - Assert.assertEquals(Integer.MIN_VALUE + ".0", Decimal64.fromLong(Integer.MIN_VALUE).toString()); - Assert.assertEquals(Integer.MAX_VALUE + ".0", Decimal64.fromFixedPoint(Integer.MAX_VALUE, 0).toString()); - Assert.assertEquals(Integer.MIN_VALUE + ".0", Decimal64.fromFixedPoint(Integer.MIN_VALUE, 0).toString()); + Assert.assertEquals("0", Decimal64.fromLong(0).toString()); + Assert.assertEquals("42", Decimal64.fromLong(42).toString()); + Assert.assertEquals(String.valueOf(Integer.MAX_VALUE), Decimal64.fromInt(Integer.MAX_VALUE).toString()); + Assert.assertEquals(String.valueOf(Integer.MIN_VALUE), Decimal64.fromInt(Integer.MIN_VALUE).toString()); + Assert.assertEquals(String.valueOf(Integer.MAX_VALUE), Decimal64.fromLong(Integer.MAX_VALUE).toString()); + Assert.assertEquals(String.valueOf(Integer.MIN_VALUE), Decimal64.fromLong(Integer.MIN_VALUE).toString()); + Assert.assertEquals(String.valueOf(Integer.MAX_VALUE), Decimal64.fromFixedPoint(Integer.MAX_VALUE, 0).toString()); + Assert.assertEquals(String.valueOf(Integer.MIN_VALUE), Decimal64.fromFixedPoint(Integer.MIN_VALUE, 0).toString()); Assert.assertEquals("123.456", Decimal64.fromDouble(123.456).toString()); Assert.assertEquals("123.4567", Decimal64.fromFixedPoint(1234567, 4).toString()); @@ -282,8 +282,8 @@ public void toStringTest() { Assert.assertEquals("Infinity", Decimal64.toString(Decimal64.POSITIVE_INFINITY)); Assert.assertEquals("-Infinity", Decimal64.toString(Decimal64.NEGATIVE_INFINITY)); - Assert.assertEquals("0.0", Decimal64.toString(Decimal64.ZERO)); - Assert.assertEquals("1000000.0", Decimal64.toString(Decimal64.MILLION)); + Assert.assertEquals("0", Decimal64.toString(Decimal64.ZERO)); + Assert.assertEquals("1000000", Decimal64.toString(Decimal64.MILLION)); Assert.assertEquals("0.01", Decimal64.toString(Decimal64.ONE_HUNDREDTH)); } } diff --git a/java/dfp/src/test/java/com/epam/deltix/dfp/Decimal64UtilsTest.java b/java/dfp/src/test/java/com/epam/deltix/dfp/Decimal64UtilsTest.java index e141f9f0..1cd8e8a9 100644 --- a/java/dfp/src/test/java/com/epam/deltix/dfp/Decimal64UtilsTest.java +++ b/java/dfp/src/test/java/com/epam/deltix/dfp/Decimal64UtilsTest.java @@ -414,15 +414,15 @@ public Long apply(Long aLong) { }, a, b, message); } }, - "-1.0", "-1.0", - "0.0", "-0.7", - "0.0", "-0.5", - "0.0", "-0.2", - "0.0", "0.0", - "1.0", "0.2", - "1.0", "0.5", - "1.0", "0.7", - "1.0", "1.0" + "-1", "-1.0", + "0", "-0.7", + "0", "-0.5", + "0", "-0.2", + "0", "0.0", + "1", "0.2", + "1", "0.5", + "1", "0.7", + "1", "1.0" ); @Decimal final long multiple = Decimal64Utils.parse("0.1"); @@ -441,17 +441,17 @@ public Long apply(Long x) { } }, "-0.1", "-0.10", - "0.0", "-0.07", - "0.0", "-0.05", - "0.0", "-0.02", - "0.0", "-0.02", - "0.0", "0.0", + "0", "-0.07", + "0", "-0.05", + "0", "-0.02", + "0", "-0.02", + "0", "0.0", "0.1", "0.02", "0.1", "0.05", "0.1", "0.07", "0.1", "0.10", - "1000.0", "999.9001", - "-1000.0", "-1000.0999" + "1000", "999.9001", + "-1000", "-1000.0999" ); } @@ -472,16 +472,16 @@ public Long apply(Long aLong) { }, a, b, message); } }, - "-1.0", "-1.0", - "-1.0", "-1.0", - "-1.0", "-0.7", - "-1.0", "-0.5", - "-1.0", "-0.2", - "0.0", "0.0", - "0.0", "0.2", - "0.0", "0.5", - "0.0", "0.7", - "1.0", "1.0" + "-1", "-1.0", + "-1", "-1.0", + "-1", "-0.7", + "-1", "-0.5", + "-1", "-0.2", + "0", "0.0", + "0", "0.2", + "0", "0.5", + "0", "0.7", + "1", "1.0" ); @Decimal final long multiple = Decimal64Utils.parse("0.1"); @@ -504,13 +504,13 @@ public Long apply(Long x) { "-0.1", "-0.05", "-0.1", "-0.02", "-0.1", "-0.02", - "0.0", "0.0", - "0.0", "0.02", - "0.0", "0.05", - "0.0", "0.07", + "0", "0.0", + "0", "0.02", + "0", "0.05", + "0", "0.07", "0.1", "0.10", - "1000.0", "1000.09", - "-1000.0", "-999.95" + "1000", "1000.09", + "-1000", "-999.95" ); } @@ -523,15 +523,15 @@ public void accept(String s1, String s2) { checkRoundTowardsZero(s1, s2); } }, - "-1.0", "-1.0", - "0.0", "-0.7", - "0.0", "-0.5", - "0.0", "-0.2", - "0.0", "0.0", - "0.0", "0.2", - "0.0", "0.5", - "0.0", "0.7", - "1.0", "1.0" + "-1", "-1.0", + "0", "-0.7", + "0", "-0.5", + "0", "-0.2", + "0", "0.0", + "0", "0.2", + "0", "0.5", + "0", "0.7", + "1", "1.0" ); } @@ -557,17 +557,17 @@ public Long apply(Long aLong) { }, a, b, message); } }, - "-1.0", "-1.0", - "-1.0", "-0.7", - "-1.0", "-0.5", - "0.0", "-0.2", - "0.0", "0.0", - "0.0", "0.2", - "1.0", "0.5", - "1.0", "0.7", - "1.0", "1.0", - "10000.0", "9999.5", - "-10000.0", "-9999.5" + "-1", "-1.0", + "-1", "-0.7", + "-1", "-0.5", + "0", "-0.2", + "0", "0.0", + "0", "0.2", + "1", "0.5", + "1", "0.7", + "1", "1.0", + "10000", "9999.5", + "-10000", "-9999.5" ); @Decimal final long multiple = Decimal64Utils.parse("0.1"); @@ -588,14 +588,14 @@ public Long apply(Long x) { "-0.1", "-0.10", "-0.1", "-0.07", "-0.1", "-0.05", - "0.0", "-0.02", - "0.0", "0.0", - "0.0", "0.02", + "0", "-0.02", + "0", "0.0", + "0", "0.02", "0.1", "0.05", "0.1", "0.07", "0.1", "0.10", - "1000.0", "999.95", - "-1000.0", "-999.95" + "1000", "999.95", + "-1000", "-999.95" ); } @@ -616,17 +616,17 @@ public Long apply(Long aLong) { }, a, b, message); } }, - "-1.0", "-1.0", - "-1.0", "-0.7", - "0.0", "-0.5", - "0.0", "-0.2", - "0.0", "0.0", - "0.0", "0.2", - "0.0", "0.5", - "1.0", "0.7", - "1.0", "1.0", - "10000.0", "9999.5", - "-10000.0", "-9999.5" + "-1", "-1.0", + "-1", "-0.7", + "0", "-0.5", + "0", "-0.2", + "0", "0.0", + "0", "0.2", + "0", "0.5", + "1", "0.7", + "1", "1.0", + "10000", "9999.5", + "-10000", "-9999.5" ); @Decimal final long multiple = Decimal64Utils.parse("0.1"); @@ -646,15 +646,15 @@ public Long apply(Long x) { }, "-0.1", "-0.10", "-0.1", "-0.07", - "0.0", "-0.05", - "0.0", "-0.02", - "0.0", "0.0", - "0.0", "0.02", - "0.0", "0.05", + "0", "-0.05", + "0", "-0.02", + "0", "0.0", + "0", "0.02", + "0", "0.05", "0.1", "0.07", "0.1", "0.10", - "1000.0", "999.95", - "-1000.0", "-999.95" + "1000", "999.95", + "-1000", "-999.95" ); } diff --git a/java/dfp/src/test/java/com/epam/deltix/dfp/FromDoubleTest.java b/java/dfp/src/test/java/com/epam/deltix/dfp/FromDoubleTest.java index 74f852e2..d3465914 100644 --- a/java/dfp/src/test/java/com/epam/deltix/dfp/FromDoubleTest.java +++ b/java/dfp/src/test/java/com/epam/deltix/dfp/FromDoubleTest.java @@ -99,10 +99,10 @@ public void accept(String s) { FromDoubleTest.checkDecimalDoubleConversion(s); } }, - "0.0", "NaN", "Infinity", "-Infinity", + "0", "NaN", "Infinity", "-Infinity", "1E0", "1000000000000000E0", "0.000000009412631", "0.95285752", - "9.2", "25107188000000000000000000000000000000000000000000000000.0", + "9.2", "25107188000000000000000000000000000000000000000000000000", "9.888888888888888", // Exponent limits "-1E-308", "-1000000000000000E-322" diff --git a/java/dfp/src/test/java/com/epam/deltix/dfp/JavaImplTest.java b/java/dfp/src/test/java/com/epam/deltix/dfp/JavaImplTest.java index 86bd64ae..c06260fa 100644 --- a/java/dfp/src/test/java/com/epam/deltix/dfp/JavaImplTest.java +++ b/java/dfp/src/test/java/com/epam/deltix/dfp/JavaImplTest.java @@ -123,25 +123,25 @@ public void appendTo() throws IOException { final StringBuilder string = new StringBuilder(); string.setLength(0); - assertEquals("NaN", appendToRefImpl(Decimal64Utils.NaN, DECIMAL_MARK_DOT, string).toString()); + assertEquals("NaN", appendToRefImpl(Decimal64Utils.NaN, DECIMAL_MARK_DOT, false, string).toString()); string.setLength(0); - assertEquals("Infinity", appendToRefImpl(Decimal64Utils.POSITIVE_INFINITY, DECIMAL_MARK_DOT, string).toString()); + assertEquals("Infinity", appendToRefImpl(Decimal64Utils.POSITIVE_INFINITY, DECIMAL_MARK_DOT, false, string).toString()); string.setLength(0); - assertEquals("-Infinity", appendToRefImpl(Decimal64Utils.NEGATIVE_INFINITY, DECIMAL_MARK_DOT, string).toString()); + assertEquals("-Infinity", appendToRefImpl(Decimal64Utils.NEGATIVE_INFINITY, DECIMAL_MARK_DOT, false, string).toString()); string.setLength(0); - assertEquals("100000010000.0", JavaImpl.appendToRefImpl(Decimal64Utils.fromDouble(10000001E+04), DECIMAL_MARK_DOT, string).toString()); + assertEquals("100000010000", JavaImpl.appendToRefImpl(Decimal64Utils.fromDouble(10000001E+04), DECIMAL_MARK_DOT, false, string).toString()); string.setLength(0); - assertEquals("10000001.0", JavaImpl.appendToRefImpl(Decimal64Utils.fromDouble(10000001), DECIMAL_MARK_DOT, string).toString()); + assertEquals("10000001", JavaImpl.appendToRefImpl(Decimal64Utils.fromDouble(10000001), DECIMAL_MARK_DOT, false, string).toString()); string.setLength(0); - assertEquals("1000.0001", JavaImpl.appendToRefImpl(Decimal64Utils.fromDouble(10000001E-04), DECIMAL_MARK_DOT, string).toString()); + assertEquals("1000.0001", JavaImpl.appendToRefImpl(Decimal64Utils.fromDouble(10000001E-04), DECIMAL_MARK_DOT, false, string).toString()); string.setLength(0); - assertEquals("9.2", appendToRefImpl(Decimal64Utils.fromDecimalDouble(92E-01), DECIMAL_MARK_DOT, string).toString()); + assertEquals("9.2", appendToRefImpl(Decimal64Utils.fromDecimalDouble(92E-01), DECIMAL_MARK_DOT, false, string).toString()); } @Test @@ -217,12 +217,12 @@ public void toStringSpecialCase1() { @Test public void toStringSpecialCase2() { - checkToString(null, "31800000013474D8", "202150.0", "+20215000E-2"); + checkToString(null, "31800000013474D8", "202150", "+20215000E-2"); } @Test public void toStringSpecialCase3() { - checkToString(null, "8020000000000000", "0.0", "-0E-397"); + checkToString(null, "8020000000000000", "0", "-0E-397"); } @Test @@ -528,7 +528,7 @@ public void testToStringRandomly() throws Exception { private static void checkStrEq(final long value) { try { - final String inStr = JavaImpl.appendToRefImpl(value, DECIMAL_MARK_DEFAULT, new StringBuilder()).toString(); + final String inStr = JavaImpl.appendToRefImpl(value, DECIMAL_MARK_DEFAULT, false, new StringBuilder()).toString(); final String testStr = Decimal64Utils.toString(value); if (!inStr.equals(testStr)) throw new RuntimeException("Case toString(" + value + "L) error: ref toString(=" + inStr + ") != test toString(=" + testStr + ")"); @@ -1009,17 +1009,17 @@ public void issue84ToStringAsDouble() throws IOException { for (int shift = 0, f = 1; shift < 6; ++shift, f *= 10) { final long d64up = shift == 0 ? d64u : JavaImplMul.get_BID64(dParts.signMask, dParts.exponent - shift, dParts.coefficient * f); - assertEquals(str, Decimal64Utils.toString(d64up)); + assertEquals(str, Decimal64Utils.toFloatString(d64up)); { final CharArrayWriter writer = new CharArrayWriter(1024); - Decimal64Utils.appendTo(d64up, writer); + Decimal64Utils.floatAppendTo(d64up, writer); assertEquals(str, writer.toString()); } { final StringBuilder sb = new StringBuilder(); - Decimal64Utils.appendTo(d64up, sb); + Decimal64Utils.floatAppendTo(d64up, sb); assertEquals(str, sb.toString()); } @@ -1037,17 +1037,17 @@ public void issue84ToStringAsDoublePart2() throws IOException { final long d64Up = JavaImplMul.get_BID64(dParts.signMask, dParts.exponent - 6 - 6, dParts.coefficient * 1000_000); final String strUp = "0.001234"; - assertEquals(strUp, Decimal64Utils.toString(d64Up)); + assertEquals(strUp, Decimal64Utils.toFloatString(d64Up)); { final CharArrayWriter writer = new CharArrayWriter(1024); - Decimal64Utils.appendTo(d64Up, writer); + Decimal64Utils.floatAppendTo(d64Up, writer); assertEquals(strUp, writer.toString()); } { final StringBuilder sb = new StringBuilder(); - Decimal64Utils.appendTo(d64Up, sb); + Decimal64Utils.floatAppendTo(d64Up, sb); assertEquals(strUp, sb.toString()); } } diff --git a/java/dfpNativeTests/src/jmh/java/com/epam/deltix/dfp/FormattingBenchmark.java b/java/dfpNativeTests/src/jmh/java/com/epam/deltix/dfp/FormattingBenchmark.java index 025a8553..711b694a 100644 --- a/java/dfpNativeTests/src/jmh/java/com/epam/deltix/dfp/FormattingBenchmark.java +++ b/java/dfpNativeTests/src/jmh/java/com/epam/deltix/dfp/FormattingBenchmark.java @@ -39,26 +39,26 @@ public void setUp() { @Benchmark public Appendable appendToRefImplRet() throws IOException { stringBuilder.setLength(0); - JavaImpl.appendToRefImpl(decimalValue, DECIMAL_MARK_DEFAULT, stringBuilder); + JavaImpl.appendToRefImpl(decimalValue, DECIMAL_MARK_DEFAULT, false, stringBuilder); return stringBuilder; } @Benchmark public void appendToRefImplBlackHole(Blackhole bh) throws IOException { stringBuilder.setLength(0); - bh.consume(JavaImpl.appendToRefImpl(decimalValue, DECIMAL_MARK_DEFAULT, stringBuilder)); + bh.consume(JavaImpl.appendToRefImpl(decimalValue, DECIMAL_MARK_DEFAULT, false, stringBuilder)); } @Benchmark public void fastAppendToAppendable(Blackhole bh) throws IOException { stringBuilder.setLength(0); - bh.consume(JavaImpl.fastAppendToAppendable(decimalValue, DECIMAL_MARK_DEFAULT, stringBuilder)); + bh.consume(JavaImpl.fastAppendToAppendable(decimalValue, DECIMAL_MARK_DEFAULT, false, stringBuilder)); } @Benchmark public void fastAppendToStringBuilder(Blackhole bh) { stringBuilder.setLength(0); - bh.consume(JavaImpl.fastAppendToStringBuilder(decimalValue, DECIMAL_MARK_DEFAULT, stringBuilder)); + bh.consume(JavaImpl.fastAppendToStringBuilder(decimalValue, DECIMAL_MARK_DEFAULT, false, stringBuilder)); } @Benchmark @@ -83,7 +83,7 @@ public void appendJustDouble(Blackhole bh) { public void toStringJavaImpl(Blackhole bh) { for (int i = 0; i < decimalValues.length; ++i) { try { - bh.consume(JavaImpl.appendToRefImpl(decimalValues[i], DECIMAL_MARK_DEFAULT, new StringBuilder()).toString()); + bh.consume(JavaImpl.appendToRefImpl(decimalValues[i], DECIMAL_MARK_DEFAULT, false, new StringBuilder()).toString()); } catch (final Exception e) { throw new RuntimeException(e); } @@ -93,7 +93,7 @@ public void toStringJavaImpl(Blackhole bh) { @Benchmark public void toStringJavaFastImpl(Blackhole bh) { for (int i = 0; i < decimalValues.length; ++i) - bh.consume(JavaImpl.fastToString(decimalValues[i], DECIMAL_MARK_DEFAULT)); + bh.consume(JavaImpl.fastToString(decimalValues[i], DECIMAL_MARK_DEFAULT, false)); } @Benchmark From 394013dae6765fb4ddd6ad8271389d4496195ad5 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Fri, 5 Apr 2024 15:11:38 +0300 Subject: [PATCH 86/90] .NET: Support same ToString as in Java --- csharp/EPAM.Deltix.DFP.Test/Decimal64Test.cs | 42 ++ csharp/EPAM.Deltix.DFP/Decimal64.cs | 29 +- csharp/EPAM.Deltix.DFP/DotNetImpl.cs | 448 ++++++++++++------ .../com/epam/deltix/dfp/JavaImplTest.java | 48 ++ 4 files changed, 409 insertions(+), 158 deletions(-) diff --git a/csharp/EPAM.Deltix.DFP.Test/Decimal64Test.cs b/csharp/EPAM.Deltix.DFP.Test/Decimal64Test.cs index 94067e98..32bad61e 100644 --- a/csharp/EPAM.Deltix.DFP.Test/Decimal64Test.cs +++ b/csharp/EPAM.Deltix.DFP.Test/Decimal64Test.cs @@ -1227,6 +1227,48 @@ private static void TestToDecimalAndBackCase(long mantissa, int exp) throw new Exception($"TestToDecimalAndBackCase({mantissa}L, {exp}); // d1(={d0}) != d2(={d2})"); } + private class ToStringData + { + public Decimal64 TestValue; + public string NormalOut; + public string FloatOut; + + public ToStringData(Decimal64 testValue, string normalOut, string floatOut) + { + this.TestValue = testValue; + this.NormalOut = normalOut; + this.FloatOut = floatOut; + } + } + + [Test] + public void Issue91ToFloatString() + { + var testCases = new ToStringData[] + { + new ToStringData(Decimal64.FromFixedPoint(14L, 0), "14", "14.0"), + new ToStringData(Decimal64.FromFixedPoint(140000000000L, 10), "14", "14.0"), + new ToStringData(Decimal64.Zero, "0", "0.0") + }; + + foreach(var testCase in testCases) + { + var testValue = testCase.TestValue; + Assert.Equals(testCase.NormalOut, testValue.ToString()); + Assert.Equals(testCase.FloatOut, testValue.ToFloatString()); + + { + var sb = new StringBuilder(); + Assert.Equals(testCase.NormalOut, testValue.AppendTo(sb).ToString()); + } + + { + var sb = new StringBuilder(); + Assert.Equals(testCase.FloatOut, testValue.FloatAppendTo(sb).ToString()); + } + } + } + readonly int N = 5000000; static void Main() diff --git a/csharp/EPAM.Deltix.DFP/Decimal64.cs b/csharp/EPAM.Deltix.DFP/Decimal64.cs index d3b22829..ceaef1ec 100644 --- a/csharp/EPAM.Deltix.DFP/Decimal64.cs +++ b/csharp/EPAM.Deltix.DFP/Decimal64.cs @@ -58,12 +58,12 @@ internal Decimal64(UInt64 value) public override String ToString() { - return DotNetImpl.ToString(Bits, DecimalMarkDefault); + return DotNetImpl.ToString(Bits, DecimalMarkDefault, false); } public String ToString(char decimalMark) { - return DotNetImpl.ToString(Bits, decimalMark); + return DotNetImpl.ToString(Bits, decimalMark, false); //return ((Double)this).ToString(CultureInfo.InvariantCulture); } @@ -1036,14 +1036,24 @@ public String ToScientificString(char decimalMark) return DotNetImpl.ToScientificString(Bits, decimalMark); } + public String ToFloatString() + { + return DotNetImpl.ToString(Bits, DecimalMarkDefault, true); + } + + public String ToFloatString(char decimalMark) + { + return DotNetImpl.ToString(Bits, decimalMark, true); + } + public StringBuilder AppendTo(StringBuilder text) { - return DotNetImpl.AppendTo(Bits, DecimalMarkDefault, text); + return DotNetImpl.AppendTo(Bits, DecimalMarkDefault, false, text); } public StringBuilder AppendTo(char decimalMark, StringBuilder text) { - return DotNetImpl.AppendTo(Bits, decimalMark, text); + return DotNetImpl.AppendTo(Bits, decimalMark, false, text); } public StringBuilder ScientificAppendTo(StringBuilder text) @@ -1056,6 +1066,17 @@ public StringBuilder ScientificAppendTo(char decimalMark, StringBuilder text) return DotNetImpl.ScientificAppendTo(Bits, decimalMark, text); } + public StringBuilder FloatAppendTo(StringBuilder text) + { + return DotNetImpl.AppendTo(Bits, DecimalMarkDefault, true, text); + } + + public StringBuilder FloatAppendTo(char decimalMark, StringBuilder text) + { + return DotNetImpl.AppendTo(Bits, decimalMark, true, text); + } + + #endregion #region IComparable<> Interface implementation diff --git a/csharp/EPAM.Deltix.DFP/DotNetImpl.cs b/csharp/EPAM.Deltix.DFP/DotNetImpl.cs index 33bc5b35..2c01f623 100644 --- a/csharp/EPAM.Deltix.DFP/DotNetImpl.cs +++ b/csharp/EPAM.Deltix.DFP/DotNetImpl.cs @@ -13,8 +13,6 @@ namespace EPAM.Deltix.DFP { internal static class DotNetImpl { - private const bool ToStringRemoveTrailingZeroes = true; // Controls if ToString removes trailing zeroes or not - #region Constants public const UInt64 PositiveInfinity = 0x7800000000000000UL; public const UInt64 NegativeInfinity = 0xF800000000000000UL; @@ -1158,112 +1156,206 @@ static bool IsRoundedToReciprocalImpl(int addExponent, Pair96 coefficientMulR, F #endregion #region Formatting & Parsing - public static String ToString(UInt64 value, char decimalMark) + private const int BcdTableDigits = 3; + private const int BcdDivider = 1000000000; + private const int BcdDividerGroups = 3; // log10(BCD_DIVIDER) / BCD_TABLE_DIGITS must be natural value + + private static char[] BCD_TABLE = MakeBcdTable(BcdTableDigits); + + private static char[] MakeBcdTable(int tenPowerMaxIndex) + { + int n = 1; + for (int i = 0; i < tenPowerMaxIndex; ++i) + n *= 10; + + char[] table = new char[n * tenPowerMaxIndex]; + + char[] value = new char[tenPowerMaxIndex]; + for (int i = 0; i < value.Length; ++i) // Array.Fill is not available in .NET Standard 2.0, but 2.1 + value[i] = '0'; + + for (int i = 0, ib = 0; i < n; ++i) + { + for (int j = 0; j < tenPowerMaxIndex; ++j) + table[ib++] = value[j]; + value[0] = (char)(value[0] + 1); + for (int j = 0; j < tenPowerMaxIndex - 1; ++j) + { + if (value[j] <= '9') + break; + else + { + value[j] = (char)(value[j] - 10); + value[j + 1] = (char)(value[j + 1] + 1); + } + } + } + + return table; + } + + private static unsafe int FormatUIntFromBcdTable(int value, char* buffer, int bi) + { + for (int blockIndex = 0; blockIndex < BcdDividerGroups; ++blockIndex) + { + int newValue = (int)((ulong)(2199023256L * value) >> 41); + int remainder = value - newValue * 1000; + //final int remainder = value - ((newValue << 10) - (newValue << 4) - (newValue << 3)); + value = newValue; + + for (int j = 0, ti = remainder * BcdTableDigits /* (remainder << 1) + remainder */; j < BcdTableDigits; ++j, ++ti) + buffer[--bi] = BCD_TABLE[ti]; + } + + return bi; + } + + public static String ToString(UInt64 value, char decimalMark, bool floatStyle) { if (!IsFinite(value)) { - return - IsInfinity(value) ? - (SignBit(value) ? "-Infinity" : "Infinity") - : IsNaN(value) ? - (SignBit(value) ? "SNaN" : "NaN") - : "?"; + // Value is either Inf or NaN + // TODO: Do we need SNaN? + return IsNaN(value) ? "NaN" : SignBit(value) ? "-Infinity" : "Infinity"; } - Int32 exponent; - Boolean isNegative = (Int64)value < 0; - Int64 coefficient; // Unsigned div by constant in not optimized by .NET + Int32 partsExponent; + BID_UINT64 partsCoefficient; if ((~value & SpecialEncodingMask) == 0) //if ((x & SpecialEncodingMask) == SpecialEncodingMask) { - Int32 exp2; - coefficient = (Int64)UnpackSpecial(value, out exp2); - exponent = exp2; - + partsCoefficient = UnpackSpecial(value, out partsExponent); } else { // Extract the exponent. - exponent = (int)(value >> ExponentShiftSmall) & (int)ShiftedExponentMask; + partsExponent = (int)(value >> ExponentShiftSmall) & (int)ShiftedExponentMask; // Extract the coefficient. - coefficient = (Int64)(value & SmallCoefficientMask); + partsCoefficient = value & SmallCoefficientMask; } + if (partsCoefficient == 0) + { + return !floatStyle ? "0" : ("0" + decimalMark + "0"); + } + + int exponent = partsExponent - ExponentBias; + unsafe { - // TODO: Special case possible for mantissa = 0, otherwise will be printed according to common rules, w/o normalization -#pragma warning disable CS0162 // Unreachable code detected - if (ToStringRemoveTrailingZeroes) - if (0 == coefficient) - return "0"; + var bufferLength = 512; + var buffer = stackalloc char[bufferLength]; - if (exponent >= BaseExponent) + if (exponent >= 0) { - if (!ToStringRemoveTrailingZeroes) - if (0 == coefficient) - return "0"; + int bi = bufferLength; + if (floatStyle) + { + buffer[--bi] = '0'; + buffer[--bi] = decimalMark; + } + for (int i = 0; i < exponent; ++i) + buffer[--bi] = '0'; - int nZeros = exponent - BaseExponent; - int nAlloc = exponent + (20 - BaseExponent); - char* s = stackalloc char[nAlloc]; - char* e = s + nAlloc - 2, p = e - nZeros; + while (partsCoefficient > 0) + { + bi = FormatUIntFromBcdTable((int)(partsCoefficient % BcdDivider), buffer, bi); + partsCoefficient /= BcdDivider; + } - for (int i = nZeros; i != 0; --i) - p[i] = '0'; + while (buffer[bi] == '0') + ++bi; - do - { - // This is to make the code generator generate 1 DIV instead of 2 - Int64 old = coefficient + '0'; - coefficient /= 10; - *p-- = (char)(old - coefficient * 10); // = [old - new * 10] - } while (coefficient != 0); + if (SignBit(value)) + buffer[--bi] = '-'; - if ((Int64)value < 0) - *p-- = '-'; + return new string(buffer, bi, bufferLength - bi); - return new string(p + 1, 0, (int)(e - p)); } else - { - int dotPos = BaseExponent - exponent; - int nAlloc = (20 + BaseExponent) - exponent; - char* s = stackalloc char[nAlloc]; - char* p = s + nAlloc - 2, e = p; + { // exponent < 0 + int bi = bufferLength; - do - { - Int64 old = coefficient + '0'; - coefficient /= 10; - *p = decimalMark; - p += 0 == dotPos-- ? -1 : 0; // Hopefully branch-free method to insert decimal dot - *p-- = (char)(old - coefficient * 10); // = [old - new * 10] - } while (coefficient != 0); - // Haven't placed the dot yet? - if (dotPos >= 0) + int digits = NumberOfDigits(partsCoefficient); + + if (digits + exponent > 0) { - for (; dotPos > 0; --dotPos) - *p-- = '0'; - p[0] = decimalMark; - p[-1] = '0'; - p -= 2; - } + ulong integralPart = partsCoefficient / PowersOfTen[-exponent]; + ulong fractionalPart = partsCoefficient % PowersOfTen[-exponent]; - if ((Int64)value < 0) - *p-- = '-'; + while (fractionalPart > 0) + { + bi = FormatUIntFromBcdTable((int)(fractionalPart % BcdDivider), buffer, bi); + fractionalPart /= BcdDivider; + } - if (ToStringRemoveTrailingZeroes) - { - if ('0' == *e) + int written = bufferLength - bi /* already written */; + //if (written < -exponent /* must be written */) + for (int ei = 0, ee = -exponent - written; ei < ee; ++ei) + buffer[--bi] = '0'; + + bi = bufferLength + exponent; /* buffer.length - (-exponent) */ + + buffer[--bi] = decimalMark; + + while (integralPart > 0) { - while ('0' == *--e) { } - if (decimalMark == *e) - --e; + bi = FormatUIntFromBcdTable((int)(integralPart % BcdDivider), buffer, bi); + integralPart /= BcdDivider; } + + while (buffer[bi] == '0') + ++bi; + + if (SignBit(value)) + buffer[--bi] = '-'; + + int be = bufferLength; + while (buffer[be - 1] == '0') + --be; + + if (buffer[be - 1] == decimalMark) + { + if (!floatStyle) + { + --be; + } + else if (be < bufferLength) + { + buffer[be++] = '0'; + } + } + + return new string(buffer, bi, be - bi); + } + else + { + while (partsCoefficient > 0) + { + bi = FormatUIntFromBcdTable((int)(partsCoefficient % BcdDivider), buffer, bi); + partsCoefficient /= BcdDivider; + } + + int written = bufferLength - bi /* already written */; + //if (written < -exponent /* must be written */) + for (int ei = 0, ee = -exponent - written; ei < ee; ++ei) + buffer[--bi] = '0'; + + bi = bufferLength + exponent; /* buffer.length - (-exponent) */ + + buffer[--bi] = decimalMark; + buffer[--bi] = '0'; - return new string(p + 1, 0, (int)(e - p)); + if (SignBit(value)) + buffer[--bi] = '-'; + + int be = bufferLength; + while (buffer[be - 1] == '0') + --be; + + return new string(buffer, bi, be - bi); + } } -#pragma warning restore CS0162 } } @@ -1329,125 +1421,172 @@ public static string ToScientificString(UInt64 value, char decimalMark) } } - public static StringBuilder AppendTo(UInt64 value, char decimalMark, StringBuilder text) + public static StringBuilder AppendTo(UInt64 value, char decimalMark, bool floatStyle, StringBuilder stringBuilder) { if (!IsFinite(value)) { - return text.Append( - IsInfinity(value) ? - (SignBit(value) ? "-Infinity" : "Infinity") - : IsNaN(value) ? - (SignBit(value) ? "SNaN" : "NaN") - : "?"); + // Value is either Inf or NaN + // TODO: Do we need SNaN? + return stringBuilder.Append(IsNaN(value) ? "NaN" : SignBit(value) ? "-Infinity" : "Infinity"); } - Int32 exponent; - Boolean isNegative = (Int64)value < 0; - Int64 coefficient; // Unsigned div by constant in not optimized by .NET + Int32 partsExponent; + BID_UINT64 partsCoefficient; if ((~value & SpecialEncodingMask) == 0) //if ((x & SpecialEncodingMask) == SpecialEncodingMask) { - Int32 exp2; - coefficient = (Int64)UnpackSpecial(value, out exp2); - exponent = exp2; - + partsCoefficient = UnpackSpecial(value, out partsExponent); } else { // Extract the exponent. - exponent = (int)(value >> ExponentShiftSmall) & (int)ShiftedExponentMask; + partsExponent = (int)(value >> ExponentShiftSmall) & (int)ShiftedExponentMask; // Extract the coefficient. - coefficient = (Int64)(value & SmallCoefficientMask); + partsCoefficient = value & SmallCoefficientMask; } - unsafe + if (partsCoefficient == 0) { - // TODO: Special case possible for mantissa = 0, otherwise will be printed according to common rules, w/o normalization -#pragma warning disable CS0162 // Unreachable code detected - if (ToStringRemoveTrailingZeroes) - if (0 == coefficient) - return text.Append("0"); + return stringBuilder.Append(!floatStyle ? "0" : ("0" + decimalMark + "0")); + } - if (exponent >= BaseExponent) - { - if (!ToStringRemoveTrailingZeroes) - if (0 == coefficient) - return text.Append("0"); + int exponent = partsExponent - ExponentBias; - int nZeros = exponent - BaseExponent; - int nAlloc = exponent + (20 - BaseExponent); - char* s = stackalloc char[nAlloc]; - char* e = s + nAlloc - 2, p = e - nZeros; + unsafe + { + var bufferLength = 512; + var buffer = stackalloc char[bufferLength]; - for (int i = nZeros; i != 0; --i) - p[i] = '0'; + if (exponent >= 0) + { + int bi = bufferLength; + if (floatStyle) + { + buffer[--bi] = '0'; + buffer[--bi] = decimalMark; + } + for (int i = 0; i < exponent; ++i) + buffer[--bi] = '0'; - do + while (partsCoefficient > 0) { - // This is to make the code generator generate 1 DIV instead of 2 - Int64 old = coefficient + '0'; - coefficient /= 10; - *p-- = (char)(old - coefficient * 10); // = [old - new * 10] - } while (coefficient != 0); + bi = FormatUIntFromBcdTable((int)(partsCoefficient % BcdDivider), buffer, bi); + partsCoefficient /= BcdDivider; + } - if ((Int64)value < 0) - *p-- = '-'; + while (buffer[bi] == '0') + ++bi; + + if (SignBit(value)) + buffer[--bi] = '-'; #if NET40 - char[] heapBuffer = new char[(int)(e - p)]; - Marshal.Copy((IntPtr)(p + 1), heapBuffer, 0, heapBuffer.Length); - return text.Append(heapBuffer); + char[] heapBuffer = new char[bufferLength - bi]; + Marshal.Copy((IntPtr)(buffer + bi), heapBuffer, 0, heapBuffer.Length); + return stringBuilder.Append(heapBuffer); #else - return text.Append(p + 1, (int)(e - p)); + return stringBuilder.Append(buffer + bi, bufferLength - bi); #endif + } else - { - int dotPos = BaseExponent - exponent; - int nAlloc = (20 + BaseExponent) - exponent; - char* s = stackalloc char[nAlloc]; - char* p = s + nAlloc - 2, e = p; + { // exponent < 0 + int bi = bufferLength; - do - { - Int64 old = coefficient + '0'; - coefficient /= 10; - *p = decimalMark; - p += 0 == dotPos-- ? -1 : 0; // Hopefully branch-free method to insert decimal dot - *p-- = (char)(old - coefficient * 10); // = [old - new * 10] - } while (coefficient != 0); - // Haven't placed the dot yet? - if (dotPos >= 0) + int digits = NumberOfDigits(partsCoefficient); + + if (digits + exponent > 0) { - for (; dotPos > 0; --dotPos) - *p-- = '0'; - p[0] = decimalMark; - p[-1] = '0'; - p -= 2; - } + ulong integralPart = partsCoefficient / PowersOfTen[-exponent]; + ulong fractionalPart = partsCoefficient % PowersOfTen[-exponent]; - if ((Int64)value < 0) - *p-- = '-'; + while (fractionalPart > 0) + { + bi = FormatUIntFromBcdTable((int)(fractionalPart % BcdDivider), buffer, bi); + fractionalPart /= BcdDivider; + } - if (ToStringRemoveTrailingZeroes) - { - if ('0' == *e) + int written = bufferLength - bi /* already written */; + //if (written < -exponent /* must be written */) + for (int ei = 0, ee = -exponent - written; ei < ee; ++ei) + buffer[--bi] = '0'; + + bi = bufferLength + exponent; /* buffer.length - (-exponent) */ + + buffer[--bi] = decimalMark; + + while (integralPart > 0) { - while ('0' == *--e) { } - if (decimalMark == *e) - --e; + bi = FormatUIntFromBcdTable((int)(integralPart % BcdDivider), buffer, bi); + integralPart /= BcdDivider; } + + while (buffer[bi] == '0') + ++bi; + + if (SignBit(value)) + buffer[--bi] = '-'; + + int be = bufferLength; + while (buffer[be - 1] == '0') + --be; + + if (buffer[be - 1] == decimalMark) + { + if (!floatStyle) + { + --be; + } + else if (be < bufferLength) + { + buffer[be++] = '0'; + } + } + +#if NET40 + char[] heapBuffer = new char[be - bi]; + Marshal.Copy((IntPtr)(buffer + bi), heapBuffer, 0, heapBuffer.Length); + return stringBuilder.Append(heapBuffer); +#else + return stringBuilder.Append(buffer + bi, be - bi); +#endif + } + else + { + while (partsCoefficient > 0) + { + bi = FormatUIntFromBcdTable((int)(partsCoefficient % BcdDivider), buffer, bi); + partsCoefficient /= BcdDivider; + } + + int written = bufferLength - bi /* already written */; + //if (written < -exponent /* must be written */) + for (int ei = 0, ee = -exponent - written; ei < ee; ++ei) + buffer[--bi] = '0'; + + bi = bufferLength + exponent; /* buffer.length - (-exponent) */ + + buffer[--bi] = decimalMark; + buffer[--bi] = '0'; + + if (SignBit(value)) + buffer[--bi] = '-'; + + int be = bufferLength; + while (buffer[be - 1] == '0') + --be; #if NET40 - char[] heapBuffer = new char[(int)(e - p)]; - Marshal.Copy((IntPtr)(p + 1), heapBuffer, 0, heapBuffer.Length); - return text.Append(heapBuffer); + char[] heapBuffer = new char[be - bi]; + Marshal.Copy((IntPtr)(buffer + bi), heapBuffer, 0, heapBuffer.Length); + return stringBuilder.Append(heapBuffer); #else - return text.Append(p + 1, (int)(e - p)); + return stringBuilder.Append(buffer + bi, be - bi); #endif + } } -#pragma warning restore CS0162 } +#pragma warning restore CS0162 } public static StringBuilder ScientificAppendTo(UInt64 value, char decimalMark, StringBuilder text) @@ -1568,7 +1707,8 @@ internal static String ToDebugString(UInt64 value) public const Int32 MinExponent = -383; public const Int32 MaxExponent = 384; public const Int32 BiasedExponentMaxValue = 767; - public const Int32 BaseExponent = 0x18E; + public const Int32 ExponentBias = 398; + public const Int32 BaseExponent = ExponentBias; public const Int32 MaxFormatDigits = 16; public const Int32 BidRoundingToNearest = 0x00000; diff --git a/java/dfp/src/test/java/com/epam/deltix/dfp/JavaImplTest.java b/java/dfp/src/test/java/com/epam/deltix/dfp/JavaImplTest.java index c06260fa..3807fa79 100644 --- a/java/dfp/src/test/java/com/epam/deltix/dfp/JavaImplTest.java +++ b/java/dfp/src/test/java/com/epam/deltix/dfp/JavaImplTest.java @@ -1051,4 +1051,52 @@ public void issue84ToStringAsDoublePart2() throws IOException { assertEquals(strUp, sb.toString()); } } + + private static class ToStringData { + public final Decimal64 testValue; + public final String normalOut; + public final String floatOut; + + public ToStringData(final Decimal64 testValue, final String normalOut, final String floatOut) { + this.testValue = testValue; + this.normalOut = normalOut; + this.floatOut = floatOut; + } + } + + @Test + public void issue91ToFloatString() throws IOException { + final ToStringData[] testCases = new ToStringData[] + { + new ToStringData(Decimal64.fromFixedPoint(14L, 0), "14", "14.0"), + new ToStringData(Decimal64.fromFixedPoint(140000000000L, 10), "14", "14.0"), + new ToStringData(Decimal64.ZERO, "0", "0.0") + }; + + for (ToStringData testCase : testCases) { + final Decimal64 testValue = testCase.testValue; + assertEquals(testCase.normalOut, testValue.toString()); + assertEquals(testCase.floatOut, testValue.toFloatString()); + + { + final StringBuilder sb = new StringBuilder(); + assertEquals(testCase.normalOut, testValue.appendTo(sb).toString()); + } + + { + final StringBuilder sb = new StringBuilder(); + assertEquals(testCase.floatOut, testValue.floatAppendTo(sb).toString()); + } + + { + final StringBuilder sb = new StringBuilder(); + assertEquals(testCase.normalOut, testValue.appendTo((Appendable) sb).toString()); + } + + { + final StringBuilder sb = new StringBuilder(); + assertEquals(testCase.floatOut, testValue.floatAppendTo((Appendable) sb).toString()); + } + } + } } From 4dc12a4cb72dd0ed6474413c11e6bfb6dec35092 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Fri, 5 Apr 2024 16:34:46 +0300 Subject: [PATCH 87/90] Cxx: Add to_string_4 with floatStyle argument --- native/src/NativeImpl.c | 1 + native/src/NativeImplToString.c | 38 +++++++++++++++++++++++---------- native/src/NativeImplToString.h | 1 + 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/native/src/NativeImpl.c b/native/src/NativeImpl.c index 3181e73a..df3d01cb 100644 --- a/native/src/NativeImpl.c +++ b/native/src/NativeImpl.c @@ -43,6 +43,7 @@ OPN(tryParse, dfp64_try_parse(str, exception), const char* str, uint32* exceptio OPNR(to_string, const char*, dfp64_to_string(x), BID_UINT64 x) OPNR(to_string_2, const char*, dfp64_to_string_2(x, decimalMark), BID_UINT64 x, char decimalMark) OPNR(to_string_3, const char*, dfp64_to_string_3(x, decimalMark, buffer512), BID_UINT64 x, char decimalMark, char* buffer512) +OPNR(to_string_4, const char*, dfp64_to_string_4(x, decimalMark, buffer512, floatStyle), BID_UINT64 x, char decimalMark, char* buffer512, bool floatStyle) OPNR(to_scientific_string, const char*, dfp64_to_scientific_string(x), BID_UINT64 x) OPNR(to_scientific_string_2, const char*, dfp64_to_scientific_string_2(x, decimalMark), BID_UINT64 x, char decimalMark) diff --git a/native/src/NativeImplToString.c b/native/src/NativeImplToString.c index bc26cce8..06c43ac7 100644 --- a/native/src/NativeImplToString.c +++ b/native/src/NativeImplToString.c @@ -121,6 +121,10 @@ const char* dfp64_to_string_2(BID_UINT64 value, char decimalMark) { } const char* dfp64_to_string_3(BID_UINT64 value, char decimalMark, char* buffer512) { + return dfp64_to_string_4(value, decimalMark, buffer512, false); +} + +const char* dfp64_to_string_4(BID_UINT64 value, char decimalMark, char* buffer512, bool floatStyle) { if (isNull(value)) return "null"; @@ -136,9 +140,13 @@ const char* dfp64_to_string_3(BID_UINT64 value, char decimalMark, char* buffer51 if (partsCoefficient == 0) { // return "0" + decimalMark + "0"; buffer512[0] = '0'; - buffer512[1] = decimalMark; - buffer512[2] = '0'; - buffer512[3] = '\0'; + if (!floatStyle) { + buffer512[1] = '\0'; + } else { + buffer512[1] = decimalMark; + buffer512[2] = '0'; + buffer512[3] = '\0'; + } return buffer512; } @@ -148,8 +156,10 @@ const char* dfp64_to_string_3(BID_UINT64 value, char decimalMark, char* buffer51 if (exponent >= 0) { int bi = bufferMinLength; - buffer512[--bi] = '0'; - buffer512[--bi] = decimalMark; + if (floatStyle) { + buffer512[--bi] = '0'; + buffer512[--bi] = decimalMark; + } for (int i = 0; i < exponent; ++i) buffer512[--bi] = '0'; @@ -161,7 +171,7 @@ const char* dfp64_to_string_3(BID_UINT64 value, char decimalMark, char* buffer51 while (buffer512[bi] == '0') ++bi; - if (value < 0) + if (partsSignMask) buffer512[--bi] = '-'; return buffer512 + bi; @@ -198,15 +208,21 @@ const char* dfp64_to_string_3(BID_UINT64 value, char decimalMark, char* buffer51 while (buffer512[bi] == '0') ++bi; - if (value < 0) + if (partsSignMask) buffer512[--bi] = '-'; int be = bufferMinLength; while (buffer512[be - 1] == '0') --be; - if (buffer512[be - 1] == decimalMark && be < bufferMinLength) - buffer512[be++] = '0'; + if (buffer512[be - 1] == decimalMark) { + if (!floatStyle) { + --be; + } + else if (be < bufferMinLength) { + buffer512[be++] = '0'; + } + } buffer512[be] = '\0'; return buffer512 + bi; @@ -228,7 +244,7 @@ const char* dfp64_to_string_3(BID_UINT64 value, char decimalMark, char* buffer51 buffer512[--bi] = decimalMark; buffer512[--bi] = '0'; - if (value < 0) + if (partsSignMask) buffer512[--bi] = '-'; int be = bufferMinLength; @@ -291,7 +307,7 @@ const char* dfp64_to_scientific_string_3(BID_UINT64 value, char decimalMark, cha buffer512[bi] = buffer512[bi + 1]; buffer512[bi + 1] = decimalMark; - if (value < 0) + if (partsSignMask) buffer512[--bi] = '-'; buffer512[be++] = 'e'; diff --git a/native/src/NativeImplToString.h b/native/src/NativeImplToString.h index 74822a28..e8d6f1b7 100644 --- a/native/src/NativeImplToString.h +++ b/native/src/NativeImplToString.h @@ -6,6 +6,7 @@ BID_EXTERN_C const char * dfp64_to_string(BID_UINT64 value); BID_EXTERN_C const char * dfp64_to_string_2(BID_UINT64 value, char decimalMark); BID_EXTERN_C const char * dfp64_to_string_3(BID_UINT64 value, char decimalMark, char* buffer512); +BID_EXTERN_C const char * dfp64_to_string_4(BID_UINT64 value, char decimalMark, char* buffer512, bool floatStyle); BID_EXTERN_C const char * dfp64_to_scientific_string(BID_UINT64 value); BID_EXTERN_C const char * dfp64_to_scientific_string_2(BID_UINT64 value, char decimalMark); From 6e8863a41b850c890f325a05354d16b46fa9c3f0 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Fri, 5 Apr 2024 16:49:03 +0300 Subject: [PATCH 88/90] Cxx: Fix .NET API --- native/src/NativeImpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/src/NativeImpl.c b/native/src/NativeImpl.c index df3d01cb..4394e550 100644 --- a/native/src/NativeImpl.c +++ b/native/src/NativeImpl.c @@ -43,7 +43,7 @@ OPN(tryParse, dfp64_try_parse(str, exception), const char* str, uint32* exceptio OPNR(to_string, const char*, dfp64_to_string(x), BID_UINT64 x) OPNR(to_string_2, const char*, dfp64_to_string_2(x, decimalMark), BID_UINT64 x, char decimalMark) OPNR(to_string_3, const char*, dfp64_to_string_3(x, decimalMark, buffer512), BID_UINT64 x, char decimalMark, char* buffer512) -OPNR(to_string_4, const char*, dfp64_to_string_4(x, decimalMark, buffer512, floatStyle), BID_UINT64 x, char decimalMark, char* buffer512, bool floatStyle) +OPNR(to_string_4, const char*, dfp64_to_string_4(x, decimalMark, buffer512, floatStyle), BID_UINT64 x, char decimalMark, char* buffer512, int32 floatStyle) OPNR(to_scientific_string, const char*, dfp64_to_scientific_string(x), BID_UINT64 x) OPNR(to_scientific_string_2, const char*, dfp64_to_scientific_string_2(x, decimalMark), BID_UINT64 x, char decimalMark) From 5d638022f56023586e4d20feae45f0c4ceeb92b9 Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Fri, 5 Apr 2024 20:05:06 +0300 Subject: [PATCH 89/90] Cxx: Fix native API --- native/src/NativeImplToString.c | 2 +- native/src/NativeImplToString.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/native/src/NativeImplToString.c b/native/src/NativeImplToString.c index 06c43ac7..4ac217b3 100644 --- a/native/src/NativeImplToString.c +++ b/native/src/NativeImplToString.c @@ -124,7 +124,7 @@ const char* dfp64_to_string_3(BID_UINT64 value, char decimalMark, char* buffer51 return dfp64_to_string_4(value, decimalMark, buffer512, false); } -const char* dfp64_to_string_4(BID_UINT64 value, char decimalMark, char* buffer512, bool floatStyle) { +const char* dfp64_to_string_4(BID_UINT64 value, char decimalMark, char* buffer512, int floatStyle) { if (isNull(value)) return "null"; diff --git a/native/src/NativeImplToString.h b/native/src/NativeImplToString.h index e8d6f1b7..459e13c2 100644 --- a/native/src/NativeImplToString.h +++ b/native/src/NativeImplToString.h @@ -6,7 +6,7 @@ BID_EXTERN_C const char * dfp64_to_string(BID_UINT64 value); BID_EXTERN_C const char * dfp64_to_string_2(BID_UINT64 value, char decimalMark); BID_EXTERN_C const char * dfp64_to_string_3(BID_UINT64 value, char decimalMark, char* buffer512); -BID_EXTERN_C const char * dfp64_to_string_4(BID_UINT64 value, char decimalMark, char* buffer512, bool floatStyle); +BID_EXTERN_C const char * dfp64_to_string_4(BID_UINT64 value, char decimalMark, char* buffer512, int floatStyle); BID_EXTERN_C const char * dfp64_to_scientific_string(BID_UINT64 value); BID_EXTERN_C const char * dfp64_to_scientific_string_2(BID_UINT64 value, char decimalMark); From 38839f1123383761bf94c194bff244147f00a78d Mon Sep 17 00:00:00 2001 From: Andrei Davydov Date: Fri, 5 Apr 2024 20:26:24 +0300 Subject: [PATCH 90/90] .NET: Fix tests --- csharp/EPAM.Deltix.DFP.Test/Decimal64Test.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/csharp/EPAM.Deltix.DFP.Test/Decimal64Test.cs b/csharp/EPAM.Deltix.DFP.Test/Decimal64Test.cs index 32bad61e..4b3b5322 100644 --- a/csharp/EPAM.Deltix.DFP.Test/Decimal64Test.cs +++ b/csharp/EPAM.Deltix.DFP.Test/Decimal64Test.cs @@ -1254,17 +1254,17 @@ public void Issue91ToFloatString() foreach(var testCase in testCases) { var testValue = testCase.TestValue; - Assert.Equals(testCase.NormalOut, testValue.ToString()); - Assert.Equals(testCase.FloatOut, testValue.ToFloatString()); + Assert.AreEqual(testCase.NormalOut, testValue.ToString()); + Assert.AreEqual(testCase.FloatOut, testValue.ToFloatString()); { var sb = new StringBuilder(); - Assert.Equals(testCase.NormalOut, testValue.AppendTo(sb).ToString()); + Assert.AreEqual(testCase.NormalOut, testValue.AppendTo(sb).ToString()); } { var sb = new StringBuilder(); - Assert.Equals(testCase.FloatOut, testValue.FloatAppendTo(sb).ToString()); + Assert.AreEqual(testCase.FloatOut, testValue.FloatAppendTo(sb).ToString()); } } }