Skip to content

Commit

Permalink
230630.071301.CST correct fortran makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
zaikunzhang committed Jun 29, 2023
1 parent 3af088e commit fa3ffd2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fortran/tests/makefiles/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,12 @@ ftest_i2_r16_d1_tst_c ftest_i4_r16_d1_tst_c ftest_i8_r16_d1_tst_c ftest_i2_r16_d
# 1. In the debug mode, our code includes the BACKTRACE function if the compiler is gfortran. This
# makes the code not standard-conforming. So -std=f$(FSTD) cannot be imposed without -fall-intrinsics.
# 2. As of 2022, -Wextra implies -Wcompare-reals, -Wunused-parameter, and -Wdo-subscript.
# 3. For `$$((10#$(FS)))`, see https://stackoverflow.com/questions/24777597/value-too-great-for-base-error-token-is-08
# 3. Do not write [[ $(FS) -lt 18 ]], which will not work if FS is 08. This is because constants
# with a leading 0 are interpreted as octal (base-8) numbers within double brackets.
# see https://stackoverflow.com/questions/24777597/value-too-great-for-base-error-token-is-08
#GFORT := gfortran -pg # Compile for profiling with the gprof profiler. Does not work with macOS on GitHub Actions due to missing gcrt1.o
GFORT := gfortran
GFSTD := $(shell [[ $$(($(GFORT) -dumpversion 2>/dev/null || echo 0) | sed 's|\..*||') -gt 8 ]] && ([[ $$((10#$(FS))) -lt 18 ]] && echo -std=f2018 || echo -std=f20$(FS)) || echo "")
GFSTD := $(shell [[ $$(($(GFORT) -dumpversion 2>/dev/null || echo 0) | sed 's|\..*||') -gt 8 ]] && ([ $(FS) -lt 18 ] && echo -std=f2018 || echo -std=f20$(FS)) || echo "")
# 1. gfortran 7 raises a false positive warning regarding "maybe-uninitialized" of allocatable arrays.
# See https://stackoverflow.com/questions/56261880/fortran-re-allocation-on-assignment-and-gfortran-warnings
# 2. As of gfortran 11, gfortran raises a false positive warning regarding "maybe-uninitialized" of
Expand Down

0 comments on commit fa3ffd2

Please sign in to comment.