Remove specification of fortran compiler standard from CMakeLists.txt #189
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Potential to close #188
Removes the specification of
-std=f2008
as a Fortran compiler flag in CMakeLists.This is a gcc specific flag that raises warnings for other compilers e.g. intel.
Whilst we could implement if-else blocks for different compilers this may still cause unforeseen issues and I do not believe it is necessary - see discussions at https://gitlab.kitware.com/cmake/cmake/-/issues/25006 and https://gitlab.kitware.com/cmake/cmake/-/issues/22235
Most compilers enable the latest Fortran standards that they support by default (different to C++ and C).
We still enforce this flag during the test suite as a check that code is compliant, but it is more of a guard against the introduction of features from a new spec rather than to enable features that may otherwise be unavailable.
I think specifying that we need a Fortran compiler that supports the 2008 standard as part of the documentation is sufficient for this.
Therefore I propose removing these lines (which would be overwritten by any
CMAKE_Fortran_FLAGS
a user might specify anyway!!).Also note (see above discussions) that there is no Fortran equivalent to
CMAKE_CXX_STANDARD=17
.