Intel ifx does not preprocess .F90 files by default
Description
The default on Intel ifx is /nofpp with no exceptions for .F90 files.
https://www.intel.com/content/www/us/en/docs/fortran-compiler/developer-guide-reference/2025-3/fpp.html
Expected Behaviour
.F90 files do no compile unless the /fpp flag is added.
Version of stdlib
master
Platform and Architecture
MSVS 2022, ifx 2025, Windows 11 x64
Additional Information
No response
I tried to build stdlib with IFX. Total failure not only of the above bug, but also not one of the *.mod files was created. Because stdlib_kinds was missing, tons and tons of errors were produced.
@SteamPower101, @jvdp1,
I looked into this issue. On Windows, Intel compilers (ifx and ifort) default to /nofpp, which causes .F90 files with C-preprocessor directives to fail compilation. In config/DefaultFlags.cmake, CMAKE_Fortran_FLAGS_INIT for Intel is currently uninitialized.
To address this cleanly across all supported CMake versions
- In
config/DefaultFlags.cmake: initializeCMAKE_Fortran_FLAGS_INITto/fppon Windows (WIN32) and-fppon POSIX whenCMAKE_Fortran_COMPILER_ID MATCHES "^Intel". - In
cmake/stdlib.cmake,test/CMakeLists.txt, andexample/CMakeLists.txt: ensureconfigure_stdlib_target,ADDTESTPP, andADD_EXAMPLEPPpass/fpp/-fppso targets compiling.F90sources always preprocess properly.
I have tested this fix end-to-end locally with CMake 3.14 (all 433 tests passing). If this approach looks good to the maintainers, I would be happy to open a PR.