Open wyphan opened 2 years ago
I usually default all my projects to RelWithDebInfo
(CMake) / debugoptimized
(meson), having this in fpm as well seems reasonable. We should try to come up with a better name than RelWithDebInfo
because that usually seems to confuse users.
FWIW, debugoptimized
reads clearly to me, and bonus points for consistency with meson.
Can we just add the -g
flag to our existing release profile instead of creating a new one? There shouldn't be any performance overhead for adding the -g
flag, only an increase in file size. If people really want release without debug symbols they can always using strip
.
debugoptimized
sounds more like the -Og
option in gcc (not sure if Intel has an equivalent). Maybe -Og
should be our default for the debug profile.
From gcc optimization options:
-Og should be the optimization level of choice for the standard edit-compile-debug cycle
@LKedward This is all I can find on Intel docs website: https://www.intel.com/content/www/us/en/develop/documentation/fortran-compiler-oneapi-dev-guide-and-reference/top/compilation/debugging/debugging-and-optimizations.html
Was this fixed and the issue was not closed? or is this not what was supposed to be done(did I understand something wrong)?
Description
Currently fpm only recognizes two compilation profiles:
release
anddebug
.It would be nice if a third compilation profile equivalent to CMake's
RelWithDebInfo
(release with debugging information) can be added to fpm. This compilation profile would be useful for profiling the code and performance analysis at the source level (e.g. analyzing loops).Possible Solution
Basically, enabling
-g
compiler flag while keeping the-O3
optimization level activated (for GFortran). Some compilers likenvfortran
also have a dedicated-gopt
flag for this purpose.Additional Information
I would be happy to contribute a pull request, just lemme know which part of the code I should look into.