fortran-lang / fpm

Fortran Package Manager (fpm)
https://fpm.fortran-lang.org
MIT License
844 stars 95 forks source link

Check that Fortran sources run; Robust Fortran features #1051

Closed perazz closed 1 week ago

perazz commented 2 weeks ago

This PR enables fpm to perform checks on supported Fortran features at project build time, with the aim to improve/enable [Fortran features]() support.

Later, I plan to add conditional fortran features quad-precision and extended-precision to the fortran table. 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? etc.

Context:

864

https://github.com/fortran-lang/stdlib/pull/821 cc: @jvdp1 @jalvesz @awvwgk @fortran-lang/fpm @fortran-lang/stdlib

perazz commented 2 weeks ago

Will merge soon as there are no comments. Thanks.

jalvesz commented 2 weeks ago

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.

perazz commented 2 weeks ago

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:

[fortran]
quadruple-precision=true

and fpm can check whether that is supported by the current compiler, and stop if it is not the case.

jalvesz commented 2 weeks ago

Cristal clear! thanks!