!!! be careful with the batches provided, they wipe directories ‘build’ and ‘lib’ below their homedir and evtl. the dir called from !!!
I am a newbie, pls. be indulgent reg. evtl nonsense in my question.I’m writing in hope someone can help me with too many and too complicated compiling options.
pls. answer to my email address as i’m not yet subscribed to the list. n e w b i e - 0 2 ( at ) g m x ( dot ) d e omitt spaces.
question in short: how to achieve clean (fully IEEE 75 compatible) powers of ten for 80-bit ‘long doubles’,
- either with gcc or - which i found working -
- with exp10l( x ) and compiling with ‘clang++ | -cc1 | -x c++’, !!! but i would need it ‘wrapped’ in a ‘pure C compatible’ shared library to be able to call it from ‘C’ files / gcc.
I’d like to solve a ‘C’, ‘C++’, FP-math, compiling problem, one option would be producing ‘clean powers of 10’ with gcc, another to combine different compilers.
I found one compiler and options to achieve them,
( powers for ‘double’ values are covered with ‘gcc -O2’ and individual handling of two fails at ‘pow( 10, 23 )’ and ‘pow( 10, 210 )’ ),
for 80-bit ‘long doubles’ gcc and g++ produce huge amounts of fails, but Intels ‘icpx’ or ‘dpcpp’ compilers using clang++ with special options do the job with ‘exp10l( x )’,
see batch ‘c2_icpx_ok.sh’ in attached archive. ( to run / use it you need either the Intel oneAPI stuff installed in it’s default location, or good knowledge about clang(++) to adapt the scripts ) ),
The project in which I want to use it is ‘gnumeric’, and AFAIK that is ‘pure C’ and compiling it with gcc is deeply buried in the build process.
( I’m neither a ‘coder’ nor an experienced one, just learning in small steps acc. scripts and cookbooks, could build and install the long double version of gnumeric and get it up and running, could patch together the attached ‘problem description suite’, but then my capa ends. I cant even tell if clang was on my system by default or came with the intel ‘oneAPI’ stuff and thus don’t know which version i’m on. )
At the moment I see two options:
A) to tune gcc and the used libraries / options in a way that they would calculate correct results with exp10l() or by any other means,
B) to produce a precompiled library with icpx / clang++ and call it from ‘gnumeric’ or ‘goffice’ ( a library used by gnumeric ).
I tried both options,
A): could not get gcc to produce better results, not even with -O0,
B): could! get together a C++ program running and calling a C++ library, even call it from a ‘C’ program, but not! combined with the otions which produce the good power of 10 results (mainly ‘-cc1’ and ‘-x c++’). see batch ‘l09_clang++_dynamic_lib_calling_from_gcc.sh’ in attached archive,
for further info see file README in the archive.
since I would like to concentrate on my actual work, to tune floating point calculations as far as possible decimally correctly, I now ask experts if someone can take this task off my hands. Basically it seems to me solvable and with my preliminary work sufficiently narrowed down that the technical possibility is proven, but a reasonable functioning implementation requires skills that I do not have.
Can you help me out? Either tune gcc (otions) or adapt the options in ‘l09_clang++_dynamic_lib_calling_from_gcc.sh’ and the called ‘build-lib_09.sh’ and ‘build_09.sh’ scripts to produce a library with good results? Or do you know someone who can?
As shipped some of the batches calculate only from 10^-10 to 10^10 and have fails at -3 and -2, to get the full test change the scope for ‘i’ in powers10l.cpp to -4951 … 4933.
oh, you might need: my HW: intel xeon about 4 years old, my OS Linux Kali / Debian, kernel about two years old, system from mid 2021.
P.S. there are some other batches in the archieve about tries, see comments in the files, in README and in ‘long_explanation’.
lib_test.tar (230 KB)