Closed perazz closed 1 week ago
Will merge soon as there are no comments. Thanks.
Hi @perazz I wanted to ask something before and got busy in between, sorry.
We should decide on a suitable logic: automated setting of preprocessor flags such as WITH_QP and WITH_XDP every time? or just if required in the fortran table?
Here, should it be understood that setting the option in the fortran table would be equivalent to adding a macro option under preprocessor.cpp ['-DWITH_QP'] for instance? in the sense that one should not need to added by hand? If that is the case LGTM. I did not fully understood the alternative.
Thanks @jalvesz, the current PR does not address that yet as it just builds the internal capability to check that the current compiler supports qp
and xdp
by compiling and running a small program.
That is exactly the aim I would like to address further in a separate PR. I think the options are:
Always generate standardized macros when those features are supported -> I'm very much in favor at least for these ones, WITH_QP
, WITH_XDP
, WITH_MPI
, etc. so that conditional programming is always enabled, and that also consolidates standardized macros from fpm
Add these as mandatory features in the fortran
table. In other words, if one package may require a specific precision to be supported
[fortran]
quadruple-precision=true
and fpm can check whether that is supported by the current compiler, and stop if it is not the case.
Cristal clear! thanks!
This PR enables fpm to perform checks on supported Fortran features at project build time, with the aim to improve/enable [Fortran features]() support.
check_fortran_source_runs
compiler property to run Fortran sources on-the-fly, similar to CMake's CheckFortranSourceRunswith_qp
fortran feature that checks for quad-precision real kind supportwith_xdp
fortran feature that checks for 80-bit extended-precision real kind supportLater, I plan to add conditional fortran features
quad-precision
andextended-precision
to thefortran
table. We should decide on a suitable logic: automated setting of preprocessor flags such asWITH_QP
andWITH_XDP
every time? or just if required in thefortran
table? etc.Context:
864
https://github.com/fortran-lang/stdlib/pull/821 cc: @jvdp1 @jalvesz @awvwgk @fortran-lang/fpm @fortran-lang/stdlib