Most compilers have a load of flags that perform similar operations to each other, like the optimization flags -O1, -O2 etc.
Does anyone know of a resource (like a huge table) where you can look for a compiler flag for one compiler and it shows you similar flags from the other languages? I spotted the nice optimization flags table in this fpm compiler flags issue, but not a lot else. Is having a standard interface to compiler flags something that fpm is exploring?
Apart from the optimization flags I did a table of flags needed for preprocessing, and how to specify the source form (apologies for the inconsistent formatting and any potential mistakes):
Compiler
Fixed-form
Free-form
Invoke (C) preprocessor
gfortran
-ffixed-form
-ffree-form
-cpp
ifort
-fixed
-free
-fpp
ifort (Windows)
/fixed
/free
/fpp
nvfortran
-Mfixed
-Mfree
-Mpreprocess
nagfor
-fixed
-free
-fpp
Cray
-f fixed
-f free
-eP, -eZ
IBM
-qfixed
-qfree, -k
-qpreprocess
g95
-ffixed-form
-ffree-form
-cpp
flang
-Mfixed
-Mfreeform
-Mpreprocess
oracle f95
-fixed
-free
-fpp or -xpp=fpp (cpp)
I also collected the file format extensions recognized that compilers recognize by default:
I think it would be very useful to have those tables in the fpm documentation, right now they are partly embedded in source comments and some issues/discussion threads, which makes them hard to discover. The fpm docs might be just the right pace to provide a central reference, which we can improve as community.
The numbers after -Werror turn certain warnings into errors. I forget what they correspond to, but if they are triggered, the g95 error messages make that clear.