Skip to content

Commit

Permalink
240119.210305.HKT revise fortran linting makefile and flint
Browse files Browse the repository at this point in the history
  • Loading branch information
zaikunzhang committed Jan 19, 2024
1 parent de88213 commit b38c3cd
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion fortran/examples/bobyqa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ gtest: FC := gfortran -Wall -Wextra -Wno-function-elimination -std=f$(FSTD) -fal
itest: FC := ifort -warn all -stand f$(FS)

# NAG nagfor
ntest: FC := nagfor -C -f$(FSTD)
ntest: FC := nagfor -C -f$(FSTD) -fpp # As of nagfor 7.1, -fpp is needed on macOS and Windows, but not on Linux.

# NVIDIA nvfortran (aka, pgfortran)
VFORT := $(shell find -L /opt/nvidia -type f -executable -name nvfortran -print 2> /dev/null | sort | tail -n 1)
Expand Down
2 changes: 1 addition & 1 deletion fortran/examples/cobyla/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ gtest: FC := gfortran -Wall -Wextra -Wno-function-elimination -std=f$(FSTD) -fal
itest: FC := ifort -warn all -stand f$(FS)

# NAG nagfor
ntest: FC := nagfor -C -f$(FSTD)
ntest: FC := nagfor -C -f$(FSTD) -fpp # As of nagfor 7.1, -fpp is needed on macOS and Windows, but not on Linux.

# NVIDIA nvfortran (aka, pgfortran)
VFORT := $(shell find -L /opt/nvidia -type f -executable -name nvfortran -print 2> /dev/null | sort | tail -n 1)
Expand Down
2 changes: 1 addition & 1 deletion fortran/examples/lincoa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ gtest: FC := gfortran -Wall -Wextra -Wno-function-elimination -std=f$(FSTD) -fal
itest: FC := ifort -warn all -stand f$(FS)

# NAG nagfor
ntest: FC := nagfor -C -f$(FSTD)
ntest: FC := nagfor -C -f$(FSTD) -fpp # As of nagfor 7.1, -fpp is needed on macOS and Windows, but not on Linux.

# NVIDIA nvfortran (aka, pgfortran)
VFORT := $(shell find -L /opt/nvidia -type f -executable -name nvfortran -print 2> /dev/null | sort | tail -n 1)
Expand Down
2 changes: 1 addition & 1 deletion fortran/examples/newuoa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ gtest: FC := gfortran -Wall -Wextra -Wno-function-elimination -std=f$(FSTD) -fal
itest: FC := ifort -warn all -stand f$(FS)

# NAG nagfor
ntest: FC := nagfor -C -f$(FSTD)
ntest: FC := nagfor -C -f$(FSTD) -fpp # As of nagfor 7.1, -fpp is needed on macOS and Windows, but not on Linux.

# NVIDIA nvfortran (aka, pgfortran)
VFORT := $(shell find -L /opt/nvidia -type f -executable -name nvfortran -print 2> /dev/null | sort | tail -n 1)
Expand Down
2 changes: 1 addition & 1 deletion fortran/examples/uobyqa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ gtest: FC := gfortran -Wall -Wextra -Wno-function-elimination -std=f$(FSTD) -fal
itest: FC := ifort -warn all -stand f$(FS)

# NAG nagfor
ntest: FC := nagfor -C -f$(FSTD)
ntest: FC := nagfor -C -f$(FSTD) -fpp # As of nagfor 7.1, -fpp is needed on macOS and Windows, but not on Linux.

# NVIDIA nvfortran (aka, pgfortran)
VFORT := $(shell find -L /opt/nvidia -type f -executable -name nvfortran -print 2> /dev/null | sort | tail -n 1)
Expand Down
4 changes: 3 additions & 1 deletion fortran/tests/makefiles/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ else
GFORT := $(GFORT) -fno-stack-arrays -fstack-check
endif
# -fsanitize=leak,address does not work with gdb.
FSAN := $(shell if [[ $$(($(GFORT) -dumpversion 2>/dev/null || echo 0) | sed 's|\..*||') -gt 9 ]] ; then echo "-fsanitize=undefined"; else echo ""; fi)
FSAN := $(shell if [[ $$(($(GFORT) -dumpversion 2>/dev/null || echo 0) | sed 's|\..*||') -gt 9 && $(OSTYPE) != 'MAC' ]] ; then echo "-fsanitize=undefined"; else echo ""; fi)
GFORT := $(GFORT) $(GFSTD) -fall-intrinsics -frecursive \
-Wall -Wextra -Wpedantic -pedantic -Wampersand -Wconversion -Wuninitialized -Wmaybe-uninitialized \
-Wsurprising -Waliasing -Wimplicit-interface -Wimplicit-procedure -Wintrinsics-std -Wunderflow \
Expand Down Expand Up @@ -526,6 +526,7 @@ itest_i2_r16_d1_tst_c itest_i4_r16_d1_tst_c itest_i8_r16_d1_tst_c itest_i2_r16_d
# In massive tests, we skip the useful -mtrace option (print memory allocation trace), as its output is enormous.
# It is necessary to use "-I $(TESTSUITE_DIR)"; otherwise, the INCLUDE lines in the test suite will not work.
NFORT := nagfor
NFORT := $(NFORT) -fpp # As of nagfor 7.1, -fpp is needed on macOS and Windows, but not on Linux.
NFORT := $(NFORT) -I $(TESTSUITE_DIR)
NFORT := $(NFORT) -colour=error:red,warn:magenta,info:cyan
NFORT := $(NFORT) -f$(FSTD) -recursive -info -gline -u -C -C=alias -C=dangling -C=intovf -C=undefined -kind=unique \
Expand Down Expand Up @@ -886,6 +887,7 @@ $(TESTS_C) $(TESTS_INT_C):
| grep -v "Absoft ANSI 1610:" \
| grep -v "after the END INTERFACE keywords is only legal in Fortran 95 and beyond" \
| grep -v "Extension.*Stop-code is not constant" \
| grep -v "Option warning: Due to MacOS/Silicon limitations, this may not work reliably" \
| grep -v "NAG Fortran Compiler Release [0-9]*.* Build [0-9]*" \
| grep -v "Questionable: ./lincoa/geometry.f90, line [0-9]*: Variable RSTAT set but never referenced" \
| grep -v "Expression in IF construct is constant" \
Expand Down
3 changes: 2 additions & 1 deletion fortran/tests/tools/flint
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,13 @@ for COMP in $COMP_LIST; do
for FLG in $FLG_LIST ; do
printf "%s\t" "$FLG"
export FFLAGS=$FLG
make clean
INFO="$(make "$COMP"test_"$TEST"_tst_c."$SOLVER" 2>&1 \
| grep -v "binary\ file\ matches\|info,\ callback_fcn" \
| grep -i "starts\|warning\|error\|info\|abort\|invalid\|violation\|fault\|illegal\|fail\|questionable\|remark\|attention\|Could\ not\ resolve\|not\ defined\|not\ public\ entity" \
| grep -vi "[0-9]\s*warning\|[0-9]\s*error\|[0-9]\s*info\|infos.f90\|information\|xhist, info)\|zmat, info)\|--warning\|--error" \
| grep -vi "pedantic-errors\|Werror\|warn\ errors\|diag-error-limit\|colour=error\|rounding\ error\|constraint violation\|default" \
| grep -v "^- \|^| \|^\* \|^+ \|^X \|\# " \
| grep -v "^\s*- \|^\s*| \|^\s*\* \|^\s*+ \|^\s*X \|\# " \
)"
echo "$INFO" | grep -i --color "starts\|warning\|error\|info\|abort\|invalid\|violation\|fault\|illegal\|fail\|questionable\|remark\|attention\|Could\ not\ resolve\|not\ defined\|not\ public\ entity"
if echo "$INFO" | grep -iq "error\|abort\|invalid\|violation\|fault\|illegal\|fail\|Could\ not\ resolve\|not\ defined\|not\ public\ entity" ; then
Expand Down

0 comments on commit b38c3cd

Please sign in to comment.