Fixes for extended and quad precision checking. Add CI cheks with fpm
After looking at #819 I realized that there were several issues:
- in the
_specialfunctions_gammafiles, there were this kind of fypp macros:
#:set WITH_QP = False
#:set WITH_XDP = False
#:include "common.fypp"
Which implied that the different kind definitions were being redefined. In parallel, this means that some files were correctly preprocessed and others not, depending on when the problematic files were being preprocessed.
2. many tests are not using fypp "properly" so I refactored those that I catched after the modifications
3. Seems like there is no CI checking xdp, so I propose to use the fpm CI to check xdp and qp with gfortran.
4. I don't know if test-drive is not built with xdp and qp, but the call check( ... ) using the tolerance argument thr had to be modified to avoid passing xdp or qp arguments.
I think this is ready for consideration @perazz @jvdp1 @nsh-envs
I agree with @jvdp1: great work @jalvesz, thank you for finding this out! I don't want to have you rewrite your PR but here is some thought.
Elsewhere because LAPACK also does not support xdp, I've used this approach:
https://github.com/fortran-lang/stdlib/blob/42182b080d232fb0704ae1578a9235fe3cf57ef7/src/stdlib_linalg_determinant.fypp#L17-L18
So here, it could be something like this?
#:if rk not in ["xdp","qp"]
Also: the special functions just want to be for the "core" types (32- and 64-bit).
So I'm not suggesting to do it in this PR, but would there be a way we could unify this once and forall? For example, by having some CORE_REAL_KINDS defined in common.fypp as opposed to all REAL_KINDS?
https://github.com/fortran-lang/stdlib/blob/42182b080d232fb0704ae1578a9235fe3cf57ef7/include/common.fypp#L21-L28
For test-drive to accept extended double and quadruple precision the C preprocessor macros WITH_XDP=1 and WITH_QP=1 need to be set when compiling test-drive.
@jalvesz It sounds it is ready to be merged. We will wait a few more days, and then merge it. Thank you.
Thank you @jalvesz . I will merge it now.