emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.35k stars 3.25k forks source link

There are no definitions of functions for working with std::complex and boost::multiprecision::number #22113

Open radiofan opened 1 week ago

radiofan commented 1 week ago

Hello. I have encountered a problem with porting my program. I use std::complex with boost::multiprecision::number. In a simplified version, my program looks like this:

#include <stdlib.h>
#include <iostream>
#include <complex>

#include <boost/multiprecision/cpp_dec_float.hpp>

using Number = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16U, std::int16_t>>;
using ComplexType = std::complex<Number>;

std::string ns(const Number& num){
    return num.convert_to<std::string>();
}

int main(int, char*[]){
    Number a{ "1.2" };
    Number b{ "5.56" };
    Number c{ 1.25 };
    Number d{ -5 };

    printf("a: %s\n", ns(a).c_str());
    printf("b: %s\n", ns(b).c_str());
    printf("c: %s\n", ns(c).c_str());
    printf("d: %s\n", ns(d).c_str());

    printf("c / d = %s\n", ns(c / d).c_str());
    printf("c * b = %s\n", ns(c * b).c_str());
    printf("c - a = %s\n", ns(c - a).c_str());
    printf("d + a = %s\n", ns(d + a).c_str());

    ComplexType c_a{5};
    ComplexType c_b{5, -6};
    ComplexType c_c{-2.5, c};

    std::cout   << "c_a + c_c = " << (c_a + c_c) << std::endl
                << "c_b - c_c = " << (c_b - c_c) << std::endl
                << "c_b * c_c = " << (c_b * c_c) << std::endl
                << "c_c / c_b = " << (c_c / c_b) << std::endl
                << "abs(c_c) = " << std::abs(c_c) << std::endl
                << "exp(c_b) = " << std::exp(c_b) << std::endl;

    return 0;
}

This program is successfully compiled by Clang version 14.0.0 (used default GNU complex) and executed.

Clang link verbose command [1/2] Building CXX object CMakeFiles/multiprecision.dir/main.cpp.o Ubuntu clang version 14.0.0-1ubuntu1.1 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11 Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11 Candidate multilib: .;@m64 Selected multilib: .;@m64 (in-process) "/usr/lib/llvm-14/bin/clang" -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name main.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -mllvm -treat-scalable-fixed-error-as-warning -debug-info-kind=constructor -dwarf-version=5 -debugger-tuning=gdb -v -fcoverage-compilation-dir=/home/user/examples/multiprecision/build/Debug -resource-dir /usr/lib/llvm-14/lib/clang/14.0.0 -dependency-file CMakeFiles/multiprecision.dir/main.cpp.o.d -MT CMakeFiles/multiprecision.dir/main.cpp.o -sys-header-deps -isystem /home/user/.conan2/p/boost0e71b73da677f/p/include -isystem /home/user/.conan2/p/b/sdl1ea2f57577c3b/p/include -isystem /home/user/.conan2/p/b/sdl1ea2f57577c3b/p/include/SDL2 -D BOARD_HOST -I /home/user/examples/multiprecision/build/Debug -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/x86_64-linux-gnu/c++/11 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/backward -internal-isystem /usr/lib/llvm-14/lib/clang/14.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -std=c++2b -fdeprecated-macro -fdebug-compilation-dir=/home/user/examples/multiprecision/build/Debug -ferror-limit 19 -fsanitize=address -fsanitize-system-ignorelist=/usr/lib/llvm-14/lib/clang/14.0.0/share/asan_ignorelist.txt -fsanitize-address-use-after-scope -fno-assume-sane-operator-new -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/multiprecision.dir/main.cpp.o -x c++ /home/user/examples/multiprecision/main.cpp clang -cc1 version 14.0.0 based upon LLVM 14.0.0 default target x86_64-pc-linux-gnu ignoring nonexistent directory "/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../x86_64-linux-gnu/include" ignoring nonexistent directory "/include" #include "..." search starts here: #include <...> search starts here: /home/user/examples/multiprecision/build/Debug /home/user/.conan2/p/boost0e71b73da677f/p/include /home/user/.conan2/p/b/sdl1ea2f57577c3b/p/include /home/user/.conan2/p/b/sdl1ea2f57577c3b/p/include/SDL2 /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11 /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/x86_64-linux-gnu/c++/11 /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/backward /usr/lib/llvm-14/lib/clang/14.0.0/include /usr/local/include /usr/include/x86_64-linux-gnu /usr/include End of search list. [2/2] Linking CXX executable multiprecision Ubuntu clang version 14.0.0-1ubuntu1.1 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11 Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11 Candidate multilib: .;@m64 Selected multilib: .;@m64 "/usr/bin/ld" -pie -z relro --hash-style=gnu --build-id --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o multiprecision /lib/x86_64-linux-gnu/Scrt1.o /lib/x86_64-linux-gnu/crti.o /usr/bin/../lib/gcc/x86_64-linux-gnu/11/crtbeginS.o -L/home/user/.conan2/p/b/sdl1ea2f57577c3b/p/lib -L/usr/bin/../lib/gcc/x86_64-linux-gnu/11 -L/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../lib64 -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib64 -L/usr/lib/llvm-14/bin/../lib -L/lib -L/usr/lib --whole-archive /usr/lib/llvm-14/lib/clang/14.0.0/lib/linux/libclang_rt.asan_static-x86_64.a --no-whole-archive --whole-archive /usr/lib/llvm-14/lib/clang/14.0.0/lib/linux/libclang_rt.asan-x86_64.a --no-whole-archive --dynamic-list=/usr/lib/llvm-14/lib/clang/14.0.0/lib/linux/libclang_rt.asan-x86_64.a.syms --whole-archive /usr/lib/llvm-14/lib/clang/14.0.0/lib/linux/libclang_rt.asan_cxx-x86_64.a --no-whole-archive --dynamic-list=/usr/lib/llvm-14/lib/clang/14.0.0/lib/linux/libclang_rt.asan_cxx-x86_64.a.syms CMakeFiles/multiprecision.dir/main.cpp.o -rpath /home/user/.conan2/p/b/sdl1ea2f57577c3b/p/lib: /home/user/.conan2/p/b/sdl1ea2f57577c3b/p/lib/libSDL2maind.a /home/user/.conan2/p/b/sdl1ea2f57577c3b/p/lib/libSDL2d.a -ldl -lrt -lpthread -lGL -lstdc++ -lm --no-as-needed -lpthread -lrt -lm -ldl -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/bin/../lib/gcc/x86_64-linux-gnu/11/crtendS.o /lib/x86_64-linux-gnu/crtn.o

But the same program is not compiled by emcc with emsdk std::complex. Some standard functions do not have a definition for working with boost::multiprecision::numbers. These functions used in math operator overloading.

Version of emscripten/emsdk:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.60 (42a6ea2052f19f70d7d994e8c324bcad2f1f8939)
clang version 19.0.0git (https:/github.com/llvm/llvm-project bc9823cf60bf91cc8b45248c4205cd2c67b2a3d5)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /home/user/emsdk/upstream/bin

Full link command and output with -v appended:

[1/2] Building CXX object CMakeFiles/multiprecision.dir/main.cpp.obj
FAILED: CMakeFiles/multiprecision.dir/main.cpp.obj 
/home/user/emsdk/upstream/emscripten/em++ -DBOARD_WEB -I/home/user/examples/multiprecision/build/Debug -stdlib=libc++ -g -std=c++23 -v -sUSE_SDL=2 -sUSE_BOOST_HEADERS=1 -fsanitize=address -MD -MT CMakeFiles/multiprecision.dir/main.cpp.obj -MF CMakeFiles/multiprecision.dir/main.cpp.obj.d -o CMakeFiles/multiprecision.dir/main.cpp.obj -c /home/user/examples/multiprecision/main.cpp
 "/home/user/emsdk/upstream/bin/clang++" -target wasm32-unknown-emscripten -fignore-exceptions -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --sysroot=/home/user/emsdk/upstream/emscripten/cache/sysroot -DEMSCRIPTEN -DBOOST_ALL_NO_LIB -isystem /home/user/emsdk/upstream/emscripten/cache/sysroot/include/SDL2 -Xclang -iwithsysroot/include/compat -DBOARD_WEB -I/home/user/examples/multiprecision/build/Debug -stdlib=libc++ -g3 -std=c++23 -v -fsanitize=address -MD -MT CMakeFiles/multiprecision.dir/main.cpp.obj -MF CMakeFiles/multiprecision.dir/main.cpp.obj.d -c /home/user/examples/multiprecision/main.cpp -o CMakeFiles/multiprecision.dir/main.cpp.obj
clang version 19.0.0git (https:/github.com/llvm/llvm-project bc9823cf60bf91cc8b45248c4205cd2c67b2a3d5)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /home/user/emsdk/upstream/bin
 (in-process)
 "/home/user/emsdk/upstream/bin/clang-19" -cc1 -triple wasm32-unknown-emscripten -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name main.cpp -mrelocation-model static -mframe-pointer=none -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu generic -fvisibility=hidden -debug-info-kind=constructor -dwarf-version=4 -debugger-tuning=gdb -fdebug-compilation-dir=/home/user/examples/multiprecision/build/Debug -v -fcoverage-compilation-dir=/home/user/examples/multiprecision/build/Debug -resource-dir /home/user/emsdk/upstream/lib/clang/19 -dependency-file CMakeFiles/multiprecision.dir/main.cpp.obj.d -MT CMakeFiles/multiprecision.dir/main.cpp.obj -sys-header-deps -isystem /home/user/emsdk/upstream/emscripten/cache/sysroot/include/SDL2 -D EMSCRIPTEN -D BOOST_ALL_NO_LIB -D BOARD_WEB -I /home/user/examples/multiprecision/build/Debug -isysroot /home/user/emsdk/upstream/emscripten/cache/sysroot -internal-isystem /home/user/emsdk/upstream/emscripten/cache/sysroot/include/wasm32-emscripten/c++/v1 -internal-isystem /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1 -internal-isystem /home/user/emsdk/upstream/lib/clang/19/include -internal-isystem /home/user/emsdk/upstream/emscripten/cache/sysroot/include/wasm32-emscripten -internal-isystem /home/user/emsdk/upstream/emscripten/cache/sysroot/include -std=c++23 -fdeprecated-macro -ferror-limit 19 -fsanitize=address -fno-sanitize-memory-param-retval -fsanitize-address-use-after-scope -fsanitize-address-globals-dead-stripping -fno-assume-sane-operator-new -fgnuc-version=4.2.1 -fno-implicit-modules -fskip-odr-check-in-gmf -fcxx-exceptions -fignore-exceptions -fexceptions -iwithsysroot/include/compat -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -o CMakeFiles/multiprecision.dir/main.cpp.obj -x c++ /home/user/examples/multiprecision/main.cpp
clang -cc1 version 19.0.0git based upon LLVM 19.0.0git default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/home/user/emsdk/upstream/emscripten/cache/sysroot/include/wasm32-emscripten/c++/v1"
ignoring nonexistent directory "/home/user/emsdk/upstream/emscripten/cache/sysroot/include/wasm32-emscripten"
#include "..." search starts here:
#include <...> search starts here:
 /home/user/examples/multiprecision/build/Debug
 /home/user/emsdk/upstream/emscripten/cache/sysroot/include/SDL2
 /home/user/emsdk/upstream/emscripten/cache/sysroot/include/compat
 /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1
 /home/user/emsdk/upstream/lib/clang/19/include
 /home/user/emsdk/upstream/emscripten/cache/sysroot/include
End of search list.
In file included from /home/user/examples/multiprecision/main.cpp:2:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/iostream:43:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/ios:223:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__locale:16:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__mutex/once_flag.h:21:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/tuple:272:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/compare:145:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__compare/compare_partial_order_fallback.h:13:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__compare/partial_order.h:14:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__compare/weak_order.h:14:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__compare/strong_order.h:20:
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:597:10: error: no matching function for call to 'isinf'
  597 |   return std::isinf(__lcpp_x);
      |          ^~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/complex:636:26: note: in instantiation of function template specialization 'std::__constexpr_isinf<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>, 0>' requested here
  636 |     bool __z_inf  = std::__constexpr_isinf(__a) || std::__constexpr_isinf(__b);
      |                          ^
/home/user/examples/multiprecision/main.cpp:38:31: note: in instantiation of function template specialization 'std::operator*<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>>' requested here
   38 |                                 << "c_b * c_c = " << (c_b * c_c) << std::endl
      |                                                           ^
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__math/traits.h:71:87: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'float' for 1st argument
   71 | _LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(float __x) _NOEXCEPT {
      |                                                                                       ^     ~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__math/traits.h:76:1: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'double' for 1st argument
   76 | isinf(double __x) _NOEXCEPT {
      | ^     ~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__math/traits.h:80:87: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'long double' for 1st argument
   80 | _LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(long double __x) _NOEXCEPT {
      |                                                                                       ^     ~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__math/traits.h:61:80: note: candidate template ignored: requirement 'is_arithmetic<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short, void>, boost::multiprecision::et_on>>::value' was not satisfied [with _A1 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>]
   61 | _LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(_A1 __x) _NOEXCEPT {
      |                                                                                ^
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__math/traits.h:66:80: note: candidate template ignored: requirement 'is_arithmetic<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short, void>, boost::multiprecision::et_on>>::value' was not satisfied [with _A1 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>]
   66 | _LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(_A1) _NOEXCEPT {
      |                                                                                ^
In file included from /home/user/examples/multiprecision/main.cpp:2:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/iostream:43:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/ios:223:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__locale:16:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__mutex/once_flag.h:21:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/tuple:272:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/compare:145:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__compare/compare_partial_order_fallback.h:13:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__compare/partial_order.h:14:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__compare/weak_order.h:14:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__compare/strong_order.h:20:
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:583:10: error: no matching function for call to 'isnan'
  583 |   return std::isnan(__lcpp_x);
      |          ^~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/complex:639:28: note: in instantiation of function template specialization 'std::__constexpr_isnan<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>, 0>' requested here
  639 |         !__z_inf && ((std::__constexpr_isnan(__a) && std::__constexpr_isnan(__b)) ||
      |                            ^
/home/user/examples/multiprecision/main.cpp:38:31: note: in instantiation of function template specialization 'std::operator*<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>>' requested here
   38 |                                 << "c_b * c_c = " << (c_b * c_c) << std::endl
      |                                                           ^
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__math/traits.h:98:87: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'float' for 1st argument
   98 | _LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(float __x) _NOEXCEPT {
      |                                                                                       ^     ~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__math/traits.h:103:1: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'double' for 1st argument
  103 | isnan(double __x) _NOEXCEPT {
      | ^     ~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__math/traits.h:107:87: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'long double' for 1st argument
  107 | _LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(long double __x) _NOEXCEPT {
      |                                                                                       ^     ~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__math/traits.h:88:80: note: candidate template ignored: requirement 'is_floating_point<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short, void>, boost::multiprecision::et_on>>::value' was not satisfied [with _A1 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>]
   88 | _LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(_A1 __x) _NOEXCEPT {
      |                                                                                ^
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__math/traits.h:93:80: note: candidate template ignored: requirement 'is_integral<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short, void>, boost::multiprecision::et_on>>::value' was not satisfied [with _A1 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>]
   93 | _LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(_A1) _NOEXCEPT {
      |                                                                                ^
In file included from /home/user/examples/multiprecision/main.cpp:3:
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/complex:669:13: error: no matching function for call to '__constexpr_copysign'
  669 |       __a = std::__constexpr_copysign(std::__constexpr_isinf(__a) ? _Tp(1) : _Tp(0), __a);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/examples/multiprecision/main.cpp:38:31: note: in instantiation of function template specialization 'std::operator*<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>>' requested here
   38 |                                 << "c_b * c_c = " << (c_b * c_c) << std::endl
      |                                                           ^
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:614:54: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'float' for 1st argument
  614 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
      |                                                      ^                    ~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:618:55: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'double' for 1st argument
  618 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
      |                                                       ^                    ~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:623:1: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'long double' for 1st argument
  623 | __constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
      | ^                    ~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:631:1: note: candidate template ignored: requirement 'std::is_arithmetic<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short, void>, boost::multiprecision::et_on>>::value' was not satisfied [with _A1 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>, _A2 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>]
  631 | __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
      | ^
In file included from /home/user/examples/multiprecision/main.cpp:3:
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/complex:670:13: error: no matching function for call to '__constexpr_copysign'
  670 |       __b = std::__constexpr_copysign(std::__constexpr_isinf(__b) ? _Tp(1) : _Tp(0), __b);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:614:54: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'float' for 1st argument
  614 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
      |                                                      ^                    ~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:618:55: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'double' for 1st argument
  618 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
      |                                                       ^                    ~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:623:1: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'long double' for 1st argument
  623 | __constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
      | ^                    ~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:631:1: note: candidate template ignored: requirement 'std::is_arithmetic<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short, void>, boost::multiprecision::et_on>>::value' was not satisfied [with _A1 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>, _A2 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>]
  631 | __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
      | ^
In file included from /home/user/examples/multiprecision/main.cpp:3:
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/complex:672:15: error: no matching function for call to '__constexpr_copysign'
  672 |         __c = std::__constexpr_copysign(_Tp(0), __c);
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:614:54: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'float' for 1st argument
  614 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
      |                                                      ^                    ~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:618:55: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'double' for 1st argument
  618 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
      |                                                       ^                    ~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:623:1: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'long double' for 1st argument
  623 | __constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
      | ^                    ~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:631:1: note: candidate template ignored: requirement 'std::is_arithmetic<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short, void>, boost::multiprecision::et_on>>::value' was not satisfied [with _A1 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>, _A2 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>]
  631 | __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
      | ^
In file included from /home/user/examples/multiprecision/main.cpp:3:
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/complex:674:15: error: no matching function for call to '__constexpr_copysign'
  674 |         __d = std::__constexpr_copysign(_Tp(0), __d);
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:614:54: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'float' for 1st argument
  614 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
      |                                                      ^                    ~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:618:55: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'double' for 1st argument
  618 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
      |                                                       ^                    ~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:623:1: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'long double' for 1st argument
  623 | __constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
      | ^                    ~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:631:1: note: candidate template ignored: requirement 'std::is_arithmetic<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short, void>, boost::multiprecision::et_on>>::value' was not satisfied [with _A1 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>, _A2 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>]
  631 | __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
      | ^
In file included from /home/user/examples/multiprecision/main.cpp:3:
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/complex:678:13: error: no matching function for call to '__constexpr_copysign'
  678 |       __c = std::__constexpr_copysign(std::__constexpr_isinf(__c) ? _Tp(1) : _Tp(0), __c);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:614:54: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'float' for 1st argument
  614 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
      |                                                      ^                    ~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:618:55: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'double' for 1st argument
  618 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
      |                                                       ^                    ~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:623:1: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'long double' for 1st argument
  623 | __constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
      | ^                    ~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:631:1: note: candidate template ignored: requirement 'std::is_arithmetic<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short, void>, boost::multiprecision::et_on>>::value' was not satisfied [with _A1 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>, _A2 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>]
  631 | __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
      | ^
In file included from /home/user/examples/multiprecision/main.cpp:3:
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/complex:679:13: error: no matching function for call to '__constexpr_copysign'
  679 |       __d = std::__constexpr_copysign(std::__constexpr_isinf(__d) ? _Tp(1) : _Tp(0), __d);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:614:54: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'float' for 1st argument
  614 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
      |                                                      ^                    ~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:618:55: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'double' for 1st argument
  618 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
      |                                                       ^                    ~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:623:1: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'long double' for 1st argument
  623 | __constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
      | ^                    ~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:631:1: note: candidate template ignored: requirement 'std::is_arithmetic<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short, void>, boost::multiprecision::et_on>>::value' was not satisfied [with _A1 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>, _A2 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>]
  631 | __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
      | ^
In file included from /home/user/examples/multiprecision/main.cpp:3:
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/complex:681:15: error: no matching function for call to '__constexpr_copysign'
  681 |         __a = std::__constexpr_copysign(_Tp(0), __a);
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:614:54: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'float' for 1st argument
  614 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
      |                                                      ^                    ~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:618:55: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'double' for 1st argument
  618 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
      |                                                       ^                    ~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:623:1: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'long double' for 1st argument
  623 | __constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
      | ^                    ~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:631:1: note: candidate template ignored: requirement 'std::is_arithmetic<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short, void>, boost::multiprecision::et_on>>::value' was not satisfied [with _A1 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>, _A2 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>]
  631 | __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
      | ^
In file included from /home/user/examples/multiprecision/main.cpp:3:
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/complex:683:15: error: no matching function for call to '__constexpr_copysign'
  683 |         __b = std::__constexpr_copysign(_Tp(0), __b);
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:614:54: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'float' for 1st argument
  614 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
      |                                                      ^                    ~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:618:55: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'double' for 1st argument
  618 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
      |                                                       ^                    ~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:623:1: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'long double' for 1st argument
  623 | __constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
      | ^                    ~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:631:1: note: candidate template ignored: requirement 'std::is_arithmetic<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short, void>, boost::multiprecision::et_on>>::value' was not satisfied [with _A1 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>, _A2 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>]
  631 | __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
      | ^
In file included from /home/user/examples/multiprecision/main.cpp:3:
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/complex:689:15: error: no matching function for call to '__constexpr_copysign'
  689 |         __a = std::__constexpr_copysign(_Tp(0), __a);
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:614:54: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'float' for 1st argument
  614 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
      |                                                      ^                    ~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:618:55: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'double' for 1st argument
  618 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
      |                                                       ^                    ~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:623:1: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'long double' for 1st argument
  623 | __constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
      | ^                    ~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:631:1: note: candidate template ignored: requirement 'std::is_arithmetic<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short, void>, boost::multiprecision::et_on>>::value' was not satisfied [with _A1 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>, _A2 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>]
  631 | __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
      | ^
In file included from /home/user/examples/multiprecision/main.cpp:3:
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/complex:691:15: error: no matching function for call to '__constexpr_copysign'
  691 |         __b = std::__constexpr_copysign(_Tp(0), __b);
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:614:54: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'float' for 1st argument
  614 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
      |                                                      ^                    ~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:618:55: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'double' for 1st argument
  618 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
      |                                                       ^                    ~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:623:1: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'long double' for 1st argument
  623 | __constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
      | ^                    ~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:631:1: note: candidate template ignored: requirement 'std::is_arithmetic<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short, void>, boost::multiprecision::et_on>>::value' was not satisfied [with _A1 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>, _A2 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>]
  631 | __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
      | ^
In file included from /home/user/examples/multiprecision/main.cpp:3:
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/complex:693:15: error: no matching function for call to '__constexpr_copysign'
  693 |         __c = std::__constexpr_copysign(_Tp(0), __c);
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:614:54: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'float' for 1st argument
  614 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
      |                                                      ^                    ~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:618:55: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'double' for 1st argument
  618 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
      |                                                       ^                    ~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:623:1: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'long double' for 1st argument
  623 | __constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
      | ^                    ~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:631:1: note: candidate template ignored: requirement 'std::is_arithmetic<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short, void>, boost::multiprecision::et_on>>::value' was not satisfied [with _A1 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>, _A2 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>]
  631 | __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
      | ^
In file included from /home/user/examples/multiprecision/main.cpp:3:
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/complex:695:15: error: no matching function for call to '__constexpr_copysign'
  695 |         __d = std::__constexpr_copysign(_Tp(0), __d);
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:614:54: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'float' for 1st argument
  614 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
      |                                                      ^                    ~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:618:55: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'double' for 1st argument
  618 | _LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
      |                                                       ^                    ~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:623:1: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'long double' for 1st argument
  623 | __constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
      | ^                    ~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:631:1: note: candidate template ignored: requirement 'std::is_arithmetic<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short, void>, boost::multiprecision::et_on>>::value' was not satisfied [with _A1 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>, _A2 = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>]
  631 | __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
      | ^
In file included from /home/user/examples/multiprecision/main.cpp:3:
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/complex:730:62: error: no matching function for call to '__constexpr_fabs'
  730 |   _Tp __logbw  = std::__constexpr_logb(std::__constexpr_fmax(std::__constexpr_fabs(__c), std::__constexpr_fabs(__d)));
      |                                                              ^~~~~~~~~~~~~~~~~~~~~
/home/user/examples/multiprecision/main.cpp:39:31: note: in instantiation of function template specialization 'std::operator/<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>>' requested here
   39 |                                 << "c_c / c_b = " << (c_c / c_b) << std::endl
      |                                                           ^
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:637:54: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'float' for 1st argument
  637 | inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR float __constexpr_fabs(float __x) _NOEXCEPT {
      |                                                      ^                ~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:641:55: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'double' for 1st argument
  641 | inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR double __constexpr_fabs(double __x) _NOEXCEPT {
      |                                                       ^                ~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:645:60: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'long double' for 1st argument
  645 | inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR long double __constexpr_fabs(long double __x) _NOEXCEPT {
      |                                                            ^                ~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:650:48: note: candidate template ignored: requirement 'is_integral<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short, void>, boost::multiprecision::et_on>>::value' was not satisfied [with _Tp = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>]
  650 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR double __constexpr_fabs(_Tp __x) _NOEXCEPT {
      |                                                ^
In file included from /home/user/examples/multiprecision/main.cpp:3:
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/complex:730:90: error: no matching function for call to '__constexpr_fabs'
  730 |   _Tp __logbw  = std::__constexpr_logb(std::__constexpr_fmax(std::__constexpr_fabs(__c), std::__constexpr_fabs(__d)));
      |                                                                                          ^~~~~~~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:637:54: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'float' for 1st argument
  637 | inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR float __constexpr_fabs(float __x) _NOEXCEPT {
      |                                                      ^                ~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:641:55: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'double' for 1st argument
  641 | inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR double __constexpr_fabs(double __x) _NOEXCEPT {
      |                                                       ^                ~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:645:60: note: candidate function not viable: no known conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'long double' for 1st argument
  645 | inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR long double __constexpr_fabs(long double __x) _NOEXCEPT {
      |                                                            ^                ~~~~~~~~~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:650:48: note: candidate template ignored: requirement 'is_integral<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short, void>, boost::multiprecision::et_on>>::value' was not satisfied [with _Tp = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>]
  650 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR double __constexpr_fabs(_Tp __x) _NOEXCEPT {
      |                                                ^
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:611:29: error: floating point classification requires argument of floating point type (passed in 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>')
  611 |   return __builtin_isfinite(__lcpp_x);
      |                             ^~~~~~~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/complex:731:12: note: in instantiation of function template specialization 'std::__constexpr_isfinite<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>, 0>' requested here
  731 |   if (std::__constexpr_isfinite(__logbw)) {
      |            ^
/home/user/examples/multiprecision/main.cpp:39:31: note: in instantiation of function template specialization 'std::operator/<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>>' requested here
   39 |                                 << "c_c / c_b = " << (c_c / c_b) << std::endl
      |                                                           ^
In file included from /home/user/examples/multiprecision/main.cpp:2:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/iostream:43:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/ios:223:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__locale:16:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__mutex/once_flag.h:21:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/tuple:272:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/compare:145:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__compare/compare_partial_order_fallback.h:13:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__compare/partial_order.h:14:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__compare/weak_order.h:14:
In file included from /home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__compare/strong_order.h:20:
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:766:27: error: no viable conversion from 'boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>' to 'double'
  766 |   return __builtin_scalbn(__x, __exp);
      |                           ^~~
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/complex:733:21: note: in instantiation of function template specialization 'std::__constexpr_scalbn<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>>' requested here
  733 |     __c      = std::__constexpr_scalbn(__c, -__ilogbw);
      |                     ^
/home/user/examples/multiprecision/main.cpp:39:31: note: in instantiation of function template specialization 'std::operator/<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>>' requested here
   39 |                                 << "c_c / c_b = " << (c_c / c_b) << std::endl
      |                                                           ^
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/boost/multiprecision/number.hpp:1074:38: note: explicit conversion function is not a candidate
 1074 |    explicit BOOST_MP_CXX14_CONSTEXPR operator T() const
      |                                      ^
In file included from /home/user/examples/multiprecision/main.cpp:3:
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/complex:734:16: error: no matching function for call to '__constexpr_scalbn'
  734 |     __d      = std::__constexpr_scalbn(__d, -__ilogbw);
      |                ^~~~~~~~~~~~~~~~~~~~~~~
/home/user/examples/multiprecision/main.cpp:39:31: note: in instantiation of function template specialization 'std::operator/<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>>' requested here
   39 |                                 << "c_c / c_b = " << (c_c / c_b) << std::endl
      |                                                           ^
/home/user/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/cmath:729:57: note: candidate template ignored: substitution failure [with _Tp = boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<16, short>>]
  729 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp __constexpr_scalbn(_Tp __x, int __exp) {
      |                                                         ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
ninja: build stopped: subcommand failed.
radiofan commented 1 week ago

I noticed that Emscripten library implementation differs from GNU . https://github.com/emscripten-core/emscripten/blob/77bc7c181c11db09cb3f082448fab37fdb93c0e1/system/lib/libcxx/include/complex#L624-L658 Emscripten implementation has additional checks, which execute math functions.

https://github.com/emscripten-core/emscripten/blob/77bc7c181c11db09cb3f082448fab37fdb93c0e1/system/lib/libcxx/include/cmath#L595-L598

boost::multiprecision has implementations of isnan(), isinf() and etc for boost::multiprecision::number, but these functions not in std namespace. How can I add boost implementations to the global scope of std?