Open amstokely opened 4 days ago
Hi @amstokely, these are great additions! I wonder if we should update the instructions about how to build the code using these changes. Thanks!
Hi @amstokely, these are great additions! I wonder if we should update the instructions about how to build the code using these changes. Thanks! I can update the README with instructions on how to compile in Debug/Release mode.
@amstokely If I recall correctly the Fortran 2003 standard specifies a maximum of 132 columns for free-format source. Is there a specific reason for adding the -ffree-line-length-none
flag to not enforce the standard limit?
Also, is pre-processing currently required for any Fortran source, and if not, is there a specific reason for adding -cpp
/ -fpp
? An alternative would be to rename source files to use the .F90
suffix, which almost universally causes Fortran compilers to automatically pre-process the source. This might be preferable, as it wouldn't require adding compiler-specific flags for every Fortran compiler that we aim to support.
@amstokely If I recall correctly the Fortran 2003 standard specifies a maximum of 132 columns for free-format source. Is there a specific reason for adding the
-ffree-line-length-none
flag to not enforce the standard limit?Also, is pre-processing currently required for any Fortran source, and if not, is there a specific reason for adding
-cpp
/-fpp
? An alternative would be to rename source files to use the.F90
suffix, which almost universally causes Fortran compilers to automatically pre-process the source. This might be preferable, as it wouldn't require adding compiler-specific flags for every Fortran compiler that we aim to support.
@mgduda -ffree-line-length-none was included in the original Makefile, which is why I included it here. I can remove this flag and see if it causes it any problems. That is good to know about using .F90 vs .f90 for enabling the preprocessor. I'll remove these flags for now and if I need to use the preprocessor in the future I'll try changing the file ext to .F90.
This PR introduces standardized Fortran compiler flags tailored for the GNU and Intel compilers, enhancing both build consistency and debugging capability across all build types. The updates are as follows:
GNU Compiler Flags:
-ffree-line-length-none
(removes line length limits), and-mcmodel=medium
(supports larger memory models for larger datasets).-fbacktrace
(provides error backtrace),-ffpe-trap=invalid,zero,overflow
(traps floating-point exceptions), and-fcheck=all
(enables all runtime checks).Intel Compiler Flags:
-mcmodel=medium
(supports larger memory models for larger datasets.)-check uninit
(checks uninitialized variables),-ftrapuv
(traps uninitialized variable usage),-g
(produces debug information),-traceback
(provides symbolic traceback on errors), and-fpe0
(halts on floating-point exceptions).These flags standardize the compilation environment, making it easier for developers to catch issues, particularly in Debug builds where aggressive error-trapping is employed.