Trouble compiling with float128 data type
Hi,
I'm having trouble compiling code that contains float128 data type.
I'm using MacOS Big Sur 11.4.
Compiler: gcc version 11.1.0 (Homebrew GCC 11.1.0_1)
I have no other problems with Boost, the only problem is when I use float128.
Please note that I have no problem compiling using libquadmath without using Boost using the __float128 data type.
I use Visual Studio Code:
"tasks": [
{
"label": "Build with g++ 11",
"type": "shell",
"command": "g++-11",
"args": [
"-g",
"-I/usr/local/Cellar/boost/1.76.0/include/",
"-I/usr/local/include/",
"-L/usr/local/Cellar/boost/1.76.0/lib/",
"-L/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/",
"-L/usr/local/Cellar/gmp/6.2.1/lib/",
"-L/usr/local/Cellar/mpfr/4.1.0/lib/",
"-lmpfr",
"-lgmp",
"-lquadmath",
"-lboost_system",
"-lboost_filesystem",
"-std=c++20",
"'-fext-numeric-literals'",
"float128_example.cpp",
"-o",
"main"
],
"group": {
"kind": "build",
"isDefault": true
}
},
There are other libraries (gmp, mpfr, ...) because I have compiled several examples taken from the Boost site (such as, for example, automatic_differentation.cpp, GMP_example.cpp, MPFR_example.cpp etc.) and they all compile and run correctly.
I tried to compile the following example:
#include
Executing task: g++-11 -g -I/usr/local/Cellar/boost/1.76.0/include/ -I/usr/local/include/ -L/usr/local/Cellar/boost/1.76.0/lib/ -L/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/ -L/usr/local/Cellar/gmp/6.2.1/lib/ -L/usr/local/Cellar/mpfr/4.1.0/lib/ -lmpfr -lgmp -lquadmath -lboost_system -lboost_filesystem -std=c++20 '-fext-numeric-literals' float128_example.cpp -o main <
float128_example.cpp: In function 'int main()':
float128_example.cpp:143:56: error: conversion from 'boost::math::constants::detail::constant_return<__float128, boost::math::policies::policy
On 20/07/2021 18:44, Stefano Gragnani via Boost-users wrote:
Hi,
I'm having trouble compiling code that contains float128 data type. I'm using MacOS Big Sur 11.4. Compiler: gcc version 11.1.0 (Homebrew GCC 11.1.0_1)
I have no other problems with Boost, the only problem is when I use float128.
Please note that I have no problem compiling using libquadmath without using Boost using the __float128 data type.
I use Visual Studio Code:
You can manually fix this by defining BOOST_HAS_FLOAT128 on the command line. However, you may still hit other errors as __float128 and quadmath.h aren't really fully supported in ISO C++ mode. The correct fix is to use -std=gnu++20, and then GNU extensions including __float128 are turned on. HTH, John. -- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
ok things are better but i still get errors:
Executing task: g++-11 -g -I/usr/local/Cellar/boost/1.76.0/include/ -I/usr/local/include/ -L/usr/local/Cellar/boost/1.76.0/lib/ -L/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/ -L/usr/local/Cellar/gmp/6.2.1/lib/ -L/usr/local/Cellar/mpfr/4.1.0/lib/ -std=gnu++20 -lmpfr -lgmp -lquadmath -lboost_system -lboost_filesystem '-fext-numeric-literals' float128_example.cpp -o main <
float128_example.cpp: In function 'int main()':
float128_example.cpp:186:20: error: call of overloaded 'exp(__float128)' is ambiguous
186 | float128 e1 = exp(1.Q); // Note argument to exp is type float128.
| ~~~^~~~~
In file included from /usr/local/Cellar/gcc/11.1.0_1/include/c++/11.1.0/cmath:45,
from /usr/local/Cellar/boost/1.76.0/include/boost/config/no_tr1/cmath.hpp:21,
from /usr/local/Cellar/boost/1.76.0/include/boost/math/tools/config.hpp:19,
from /usr/local/Cellar/boost/1.76.0/include/boost/math/cstdfloat/cstdfloat_types.hpp:18,
from /usr/local/Cellar/boost/1.76.0/include/boost/cstdfloat.hpp:18,
from float128_example.cpp:19:
/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/gcc/x86_64-apple-darwin20/11.1.0/include-fixed/math.h:376:15: note: candidate: 'double exp(double)'
376 | extern double exp(double);
| ^~~
In file included from /usr/local/Cellar/boost/1.76.0/include/boost/config/no_tr1/cmath.hpp:21,
from /usr/local/Cellar/boost/1.76.0/include/boost/math/tools/config.hpp:19,
from /usr/local/Cellar/boost/1.76.0/include/boost/math/cstdfloat/cstdfloat_types.hpp:18,
from /usr/local/Cellar/boost/1.76.0/include/boost/cstdfloat.hpp:18,
from float128_example.cpp:19:
/usr/local/Cellar/gcc/11.1.0_1/include/c++/11.1.0/cmath:226:3: note: candidate: 'constexpr long double std::exp(long double)'
226 | exp(long double __x)
| ^~~
/usr/local/Cellar/gcc/11.1.0_1/include/c++/11.1.0/cmath:222:3: note: candidate: 'constexpr float std::exp(float)'
222 | exp(float __x)
| ^~~
The terminal process "zsh '-c', 'g++-11 -g -I/usr/local/Cellar/boost/1.76.0/include/ -I/usr/local/include/ -L/usr/local/Cellar/boost/1.76.0/lib/ -L/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/ -L/usr/local/Cellar/gmp/6.2.1/lib/ -L/usr/local/Cellar/mpfr/4.1.0/lib/ -std=gnu++20 -lmpfr -lgmp -lquadmath -lboost_system -lboost_filesystem '-fext-numeric-literals' float128_example.cpp -o main'" terminated with exit code: 1.
Compiling the following example:
#include <iomanip>
#include <iostream>
#include
Executing task: g++-11 -g -I/usr/local/Cellar/boost/1.76.0/include/ -I/usr/local/include/ -L/usr/local/Cellar/boost/1.76.0/lib/ -L/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/ -L/usr/local/Cellar/gmp/6.2.1/lib/ -L/usr/local/Cellar/mpfr/4.1.0/lib/ -std=gnu++20 -lmpfr -lgmp -lquadmath -lboost_system -lboost_filesystem '-fext-numeric-literals' fs_main.cpp -o main <
Undefined symbols for architecture x86_64:
"__Z17quadmath_snprintfPcmPKcz", referenced from:
__ZNK5boost14multiprecision8backends16float128_backend3strB5cxx11ElSt13_Ios_Fmtflags in ccGxvsSR.o
"__Z4logqg", referenced from:
__ZN5boost14multiprecision8backends8eval_logERNS1_16float128_backendERKS2_ in ccGxvsSR.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
The terminal process "zsh '-c', 'g++-11 -g -I/usr/local/Cellar/boost/1.76.0/include/ -I/usr/local/include/ -L/usr/local/Cellar/boost/1.76.0/lib/ -L/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/ -L/usr/local/Cellar/gmp/6.2.1/lib/ -L/usr/local/Cellar/mpfr/4.1.0/lib/ -std=gnu++20 -lmpfr -lgmp -lquadmath -lboost_system -lboost_filesystem '-fext-numeric-literals' fs_main.cpp -o main'" terminated with exit code: 1.
Note that if I compile the following example without using Boost I have no linking errors with quadmath:
#include
Il giorno 21 lug 2021, alle ore 13:08, John Maddock via Boost-users
ha scritto: On 20/07/2021 18:44, Stefano Gragnani via Boost-users wrote:
Hi,
I'm having trouble compiling code that contains float128 data type. I'm using MacOS Big Sur 11.4. Compiler: gcc version 11.1.0 (Homebrew GCC 11.1.0_1)
I have no other problems with Boost, the only problem is when I use float128.
Please note that I have no problem compiling using libquadmath without using Boost using the __float128 data type.
I use Visual Studio Code:
You can manually fix this by defining BOOST_HAS_FLOAT128 on the command line. However, you may still hit other errors as __float128 and quadmath.h aren't really fully supported in ISO C++ mode. The correct fix is to use -std=gnu++20, and then GNU extensions including __float128 are turned on.
HTH, John.
-- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
On 21/07/2021 16:56, Stefano Gragnani via Boost-users wrote:
ok things are better but i still get errors:
Executing task: g++-11 -g -I/usr/local/Cellar/boost/1.76.0/include/ -I/usr/local/include/ -L/usr/local/Cellar/boost/1.76.0/lib/ -L/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/ -L/usr/local/Cellar/gmp/6.2.1/lib/ -L/usr/local/Cellar/mpfr/4.1.0/lib/ -std=gnu++20 -lmpfr -lgmp -lquadmath -lboost_system -lboost_filesystem '-fext-numeric-literals' float128_example.cpp -o main <
float128_example.cpp: In function 'int main()': float128_example.cpp:186:20: error: call of overloaded 'exp(__float128)' is ambiguous 186 | float128 e1 = exp(1.Q); // Note argument to exp is type float128. | ~~~^~~~~
The compiler is quite correct: there are no std lib functions for the built in type __float128, there are however for boost::multiprecision::float128 which is the type you should be using throughout. -- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
If I comment: // float128 e1 = exp(1.Q); // Note argument to exp is type float128. // std::cout << e1 << std::endl; // 2.71828182845904523536028747135266231 the example compiles correctly. Floating-point type boost::float128_t is available. std::numeric_limitsboost::float128_t::digits10 == 33 std::numeric_limitsboost::float128_t::max_digits10 == 36 Platform: Mac OS Compiler: GNU C++ version 11.1.0 STL : GNU libstdc++ version 20210427 Boost : 1.76.0 GCC 11.1.0 1.77245385090551602729816748334114514 1.77245385090551602729816748334114514 1.77245385090551602729816748334114514 1.77245385090551602729816748334114514 1.77245385090551599275151910313924857 3.14159265358979323846264338327950280 1.77245385090551602729816748334114514 2.71828182845904523536028747135266231 2.71828182845904509079559829842764884 2.71828182845904509079559829842764884 2.71828174591064453125000000000000000 2.71828182845904523536028747135266231 2.71828182845904523536028747135266231 2.71828182845904523536028747135266231 N5boost14multiprecision6numberINS0_8backends16float128_backendELNS0_26expression_template_optionE0EEE N5boost14multiprecision6numberINS0_8backends16float128_backendELNS0_26expression_template_optionE0EEE N5boost14multiprecision6numberINS0_8backends16float128_backendELNS0_26expression_template_optionE0EEE
Il giorno 21 lug 2021, alle ore 18:48, John Maddock via Boost-users
ha scritto: The compiler is quite correct: there are no std lib functions for the built in type __float128, there are however for boost::multiprecision::float128 which is the type you should be using throughout.
further clarification if possible:
why the 2 lines that don't compile:
// float128 e1 = exp(1.Q); // Note argument to exp is type float128.
// std::cout << e1 << std::endl; // 2.71828182845904523536028747135266231
if i put them in the following code compile regularly?
#include <iomanip>
#include <iostream>
#include
Executing task: ./main <
113 33 0.693147180559945309417232121458176575 1 4.02387260077093773543702433923004111e+2564 2.71828182845904523536028747135266231 pi = 3.1415926535897932384626433832795028 e1 = 2.71828182845904523536028747135266231 Thanks
Il giorno 21 lug 2021, alle ore 19:14, Stefano Gragnani
ha scritto: // float128 e1 = exp(1.Q); // Note argument to exp is type float128. // std::cout << e1 << std::endl; // 2.71828182845904523536028747135266231
On 21/07/2021 19:07, Stefano Gragnani via Boost-users wrote:
further clarification if possible:
why the 2 lines that don't compile:
// float128 e1 = exp(1.Q); // Note argument to exp is type float128. // std::cout << e1 << std::endl; // 2.71828182845904523536028747135266231
if i put them in the following code compile regularly?
You're mixing up 2 different things: * If you want to use __float128 "as if" it were no different to float/double etc, then include boost/math/cstdfloat.hpp * If you want a 128-bit floating point type which hides the underlying implementation then use boost/multiprecision/float128.hpp. Note that these are completely different approaches to the same problem, and are completely different types. Also note that strictly speaking, boost/math/cstdfloat.hpp is NOT C++ conformant, as it adds function overloads directly to namespace std. -- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
thanks now everything begins to be more understandable Inviato da iPad
Il giorno 21 lug 2021, alle ore 23:40, John Maddock via Boost-users
ha scritto: On 21/07/2021 19:07, Stefano Gragnani via Boost-users wrote:
further clarification if possible:
why the 2 lines that don't compile:
// float128 e1 = exp(1.Q); // Note argument to exp is type float128. // std::cout << e1 << std::endl; // 2.71828182845904523536028747135266231
if i put them in the following code compile regularly?
You're mixing up 2 different things:
* If you want to use __float128 "as if" it were no different to float/double etc, then include boost/math/cstdfloat.hpp
* If you want a 128-bit floating point type which hides the underlying implementation then use boost/multiprecision/float128.hpp.
Note that these are completely different approaches to the same problem, and are completely different types.
Also note that strictly speaking, boost/math/cstdfloat.hpp is NOT C++ conformant, as it adds function overloads directly to namespace std.
-- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
I solved for the other example, I must add:
#include
Il giorno 21 lug 2021, alle ore 18:48, John Maddock via Boost-users
ha scritto: On 21/07/2021 16:56, Stefano Gragnani via Boost-users wrote:
ok things are better but i still get errors:
Executing task: g++-11 -g -I/usr/local/Cellar/boost/1.76.0/include/ -I/usr/local/include/ -L/usr/local/Cellar/boost/1.76.0/lib/ -L/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/ -L/usr/local/Cellar/gmp/6.2.1/lib/ -L/usr/local/Cellar/mpfr/4.1.0/lib/ -std=gnu++20 -lmpfr -lgmp -lquadmath -lboost_system -lboost_filesystem '-fext-numeric-literals' float128_example.cpp -o main <
float128_example.cpp: In function 'int main()': float128_example.cpp:186:20: error: call of overloaded 'exp(__float128)' is ambiguous 186 | float128 e1 = exp(1.Q); // Note argument to exp is type float128. | ~~~^~~~~
The compiler is quite correct: there are no std lib functions for the built in type __float128, there are however for boost::multiprecision::float128 which is the type you should be using throughout.
-- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
so how should I complie your example? and for the following code:
#include <iomanip> #include <iostream> #include
#include #include #include #include #include int main() { using boost::multiprecision::float128;
float128 b = 2; std::cout << std::numeric_limits<float128>::digits << std::endl; std::cout << std::numeric_limits<float128>::digits10 << std::endl; std::cout << std::setprecision(std::numeric_limits<float128>::max_digits10) << log(b) << std::endl; constexpr float128 pi = 3.1415926535897932384626433832795028841971693993751058Q; return 0; }
I get:
Executing task: g++-11 -g -I/usr/local/Cellar/boost/1.76.0/include/ -I/usr/local/include/ -L/usr/local/Cellar/boost/1.76.0/lib/ -L/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/ -L/usr/local/Cellar/gmp/6.2.1/lib/ -L/usr/local/Cellar/mpfr/4.1.0/lib/ -std=gnu++20 -lmpfr -lgmp -lquadmath -lboost_system -lboost_filesystem '-fext-numeric-literals' fs_main.cpp -o main <
Undefined symbols for architecture x86_64: "__Z17quadmath_snprintfPcmPKcz", referenced from: __ZNK5boost14multiprecision8backends16float128_backend3strB5cxx11ElSt13_Ios_Fmtflags in ccGxvsSR.o "__Z4logqg", referenced from: __ZN5boost14multiprecision8backends8eval_logERNS1_16float128_backendERKS2_ in ccGxvsSR.o ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status The terminal process "zsh '-c', 'g++-11 -g -I/usr/local/Cellar/boost/1.76.0/include/ -I/usr/local/include/ -L/usr/local/Cellar/boost/1.76.0/lib/ -L/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/ -L/usr/local/Cellar/gmp/6.2.1/lib/ -L/usr/local/Cellar/mpfr/4.1.0/lib/ -std=gnu++20 -lmpfr -lgmp -lquadmath -lboost_system -lboost_filesystem '-fext-numeric-literals' fs_main.cpp -o main'" terminated with exit code: 1.
Thanks Stefano Gragnani
Il giorno 21 lug 2021, alle ore 17:56, Stefano Gragnani
ha scritto: ok things are better but i still get errors:
Executing task: g++-11 -g -I/usr/local/Cellar/boost/1.76.0/include/ -I/usr/local/include/ -L/usr/local/Cellar/boost/1.76.0/lib/ -L/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/ -L/usr/local/Cellar/gmp/6.2.1/lib/ -L/usr/local/Cellar/mpfr/4.1.0/lib/ -std=gnu++20 -lmpfr -lgmp -lquadmath -lboost_system -lboost_filesystem '-fext-numeric-literals' float128_example.cpp -o main <
float128_example.cpp: In function 'int main()': float128_example.cpp:186:20: error: call of overloaded 'exp(__float128)' is ambiguous 186 | float128 e1 = exp(1.Q); // Note argument to exp is type float128. | ~~~^~~~~ In file included from /usr/local/Cellar/gcc/11.1.0_1/include/c++/11.1.0/cmath:45, from /usr/local/Cellar/boost/1.76.0/include/boost/config/no_tr1/cmath.hpp:21, from /usr/local/Cellar/boost/1.76.0/include/boost/math/tools/config.hpp:19, from /usr/local/Cellar/boost/1.76.0/include/boost/math/cstdfloat/cstdfloat_types.hpp:18, from /usr/local/Cellar/boost/1.76.0/include/boost/cstdfloat.hpp:18, from float128_example.cpp:19: /usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/gcc/x86_64-apple-darwin20/11.1.0/include-fixed/math.h:376:15: note: candidate: 'double exp(double)' 376 | extern double exp(double); | ^~~ In file included from /usr/local/Cellar/boost/1.76.0/include/boost/config/no_tr1/cmath.hpp:21, from /usr/local/Cellar/boost/1.76.0/include/boost/math/tools/config.hpp:19, from /usr/local/Cellar/boost/1.76.0/include/boost/math/cstdfloat/cstdfloat_types.hpp:18, from /usr/local/Cellar/boost/1.76.0/include/boost/cstdfloat.hpp:18, from float128_example.cpp:19: /usr/local/Cellar/gcc/11.1.0_1/include/c++/11.1.0/cmath:226:3: note: candidate: 'constexpr long double std::exp(long double)' 226 | exp(long double __x) | ^~~ /usr/local/Cellar/gcc/11.1.0_1/include/c++/11.1.0/cmath:222:3: note: candidate: 'constexpr float std::exp(float)' 222 | exp(float __x) | ^~~ The terminal process "zsh '-c', 'g++-11 -g -I/usr/local/Cellar/boost/1.76.0/include/ -I/usr/local/include/ -L/usr/local/Cellar/boost/1.76.0/lib/ -L/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/ -L/usr/local/Cellar/gmp/6.2.1/lib/ -L/usr/local/Cellar/mpfr/4.1.0/lib/ -std=gnu++20 -lmpfr -lgmp -lquadmath -lboost_system -lboost_filesystem '-fext-numeric-literals' float128_example.cpp -o main'" terminated with exit code: 1.
Compiling the following example:
#include <iomanip> #include <iostream> #include
#include #include #include #include #include int main() { using boost::multiprecision::float128;
float128 b = 2; std::cout << std::numeric_limits<float128>::digits << std::endl; std::cout << std::numeric_limits<float128>::digits10 << std::endl; std::cout << std::setprecision(std::numeric_limits<float128>::max_digits10) << log(b) << std::endl; constexpr float128 pi = 3.1415926535897932384626433832795028841971693993751058Q; return 0; }
I get:
Executing task: g++-11 -g -I/usr/local/Cellar/boost/1.76.0/include/ -I/usr/local/include/ -L/usr/local/Cellar/boost/1.76.0/lib/ -L/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/ -L/usr/local/Cellar/gmp/6.2.1/lib/ -L/usr/local/Cellar/mpfr/4.1.0/lib/ -std=gnu++20 -lmpfr -lgmp -lquadmath -lboost_system -lboost_filesystem '-fext-numeric-literals' fs_main.cpp -o main <
Undefined symbols for architecture x86_64: "__Z17quadmath_snprintfPcmPKcz", referenced from: __ZNK5boost14multiprecision8backends16float128_backend3strB5cxx11ElSt13_Ios_Fmtflags in ccGxvsSR.o "__Z4logqg", referenced from: __ZN5boost14multiprecision8backends8eval_logERNS1_16float128_backendERKS2_ in ccGxvsSR.o ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status The terminal process "zsh '-c', 'g++-11 -g -I/usr/local/Cellar/boost/1.76.0/include/ -I/usr/local/include/ -L/usr/local/Cellar/boost/1.76.0/lib/ -L/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/ -L/usr/local/Cellar/gmp/6.2.1/lib/ -L/usr/local/Cellar/mpfr/4.1.0/lib/ -std=gnu++20 -lmpfr -lgmp -lquadmath -lboost_system -lboost_filesystem '-fext-numeric-literals' fs_main.cpp -o main'" terminated with exit code: 1.
Note that if I compile the following example without using Boost I have no linking errors with quadmath:
#include
#include <iostream> #include #include int print(const char *label, __float128 r) { int prec = 20; int width = 46; char buf[128];
int n = quadmath_snprintf(buf, sizeof buf, "%+-#*.36Qe", width, r); printf ("%s: %s\n", label, buf); return 0; }
int main () { __float128 x = 3.14159265358979323846264338327950288q; print("value", x); print("log", logq(x)); print("log10", log10q(x)); print("cos", cosq(x)); print("sin", sinq(x)); print("sqrt", sqrtq(x)); }
Executing task: ./es1.out <
value: +3.141592653589793238462643383279502797e+00 log: +1.144729885849400174143427351353058656e+00 log10: +4.971498726941338543512682882908988723e-01 cos: -1.000000000000000000000000000000000000e+00 sin: +8.671810130123781024797044026043352254e-35 sqrt: +1.772453850905516027298167483341145140e+00
The settings are:
"tasks": [ { "label": "Build with g++ 11", "type": "shell", "command": "g++-11", "args": [ "-g", "-std=gnu++20”, "es1.cpp", "-L/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/", "-lquadmath", "-o", "es1.out" ], "group": { "kind": "build", "isDefault": true }, "problemMatcher": [] },
Il giorno 21 lug 2021, alle ore 13:08, John Maddock via Boost-users
mailto:boost-users@lists.boost.org> ha scritto: On 20/07/2021 18:44, Stefano Gragnani via Boost-users wrote:
Hi,
I'm having trouble compiling code that contains float128 data type. I'm using MacOS Big Sur 11.4. Compiler: gcc version 11.1.0 (Homebrew GCC 11.1.0_1)
I have no other problems with Boost, the only problem is when I use float128.
Please note that I have no problem compiling using libquadmath without using Boost using the __float128 data type.
I use Visual Studio Code:
You can manually fix this by defining BOOST_HAS_FLOAT128 on the command line. However, you may still hit other errors as __float128 and quadmath.h aren't really fully supported in ISO C++ mode. The correct fix is to use -std=gnu++20, and then GNU extensions including __float128 are turned on.
HTH, John.
-- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus https://www.avast.com/antivirus
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
John Maddock
-
Stefano Gragnani