Skip to content

Commit

Permalink
230916.234908.HKT remove -Wno-attributes and -diag-disable:, as t…
Browse files Browse the repository at this point in the history
…he non-standard directives have been removed
  • Loading branch information
zaikunzhang committed Sep 16, 2023
1 parent b412f44 commit af58422
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 24 deletions.
3 changes: 2 additions & 1 deletion fortran/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ endif ()
# Unlike C there are no standard keywords to do this in Fortran but only compiler-specific pragmas:
# !GCC$ attributes dllexport :: bobyqa_c
# !DEC$ attributes dllexport :: bobyqa_c
# the downside is unwanted -Wattribute warnings.
# the downside is that gfortran will raise -Wattributes warnings, and Intel compilers will complain
# that the directives are not standard conforming. See https://github.com/libprima/prima/issues/70.
# Another option is to use .def files referencing exported symbols:
# https://learn.microsoft.com/en-us/cpp/build/exporting-from-a-dll-using-def-files?view=msvc-170
# Mangling is different between GNU and Intel/LLVM compiler families so we use a dedicated file for each.
Expand Down
6 changes: 3 additions & 3 deletions fortran/examples/bobyqa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ ftest: FC := flang -Wall -Wextra -std=f$(FSTD) -Mstandard

# GNU gfortran: due to `error stop` and `backtrace`, we must either compile wit no `-std` or
# use `-std=f20xy -fall-intrinsics` with xy >= 18.
gtest: FC := gfortran -Wall -Wextra -Wno-attributes -Wno-function-elimination -std=f$(FSTD) -fall-intrinsics
gtest: FC := gfortran -Wall -Wextra -Wno-function-elimination -std=f$(FSTD) -fall-intrinsics

# Intel ifort
itest: FC := ifort -warn all -diag-disable:7025,7841 -stand f$(FS)
itest: FC := ifort -warn all -stand f$(FS)

# NAG nagfor
ntest: FC := nagfor -C -f$(FSTD)
Expand All @@ -72,7 +72,7 @@ RFORT := $(shell find -L /opt/arm -type f -executable -name armflang -print 2> /
rtest: FC := $(RFORT) -Wall -Wextra -std=f$(FSTD) -Mstandard

# Intel ifx
xtest: FC := ifx -warn all -diag-disable:7025,7841 -stand f$(FS)
xtest: FC := ifx -warn all -stand f$(FS)

####################################################################################################
# Compile the binary needed for a compiler-specific test
Expand Down
4 changes: 1 addition & 3 deletions fortran/examples/cobyla/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@ ftest: FC := flang -Wall -Wextra -std=f$(FSTD) -Mstandard

# GNU gfortran: due to `error stop` and `backtrace`, we must either compile wit no `-std` or
# use `-std=f20xy -fall-intrinsics` with xy >= 18.
gtest: FC := gfortran -Wall -Wextra -Wno-attributes -Wno-function-elimination -std=f$(FSTD) -fall-intrinsics
gtest: FC := gfortran -Wall -Wextra -Wno-function-elimination -std=f$(FSTD) -fall-intrinsics

# Intel ifort
#itest: FC := ifort -warn all -diag-disable:7025,7841 -stand f$(FS)
itest: FC := ifort -warn all -stand f$(FS)

# NAG nagfor
Expand All @@ -73,7 +72,6 @@ RFORT := $(shell find -L /opt/arm -type f -executable -name armflang -print 2> /
rtest: FC := $(RFORT) -Wall -Wextra -std=f$(FSTD) -Mstandard

# Intel ifx
#xtest: FC := ifx -warn all -diag-disable:7025,7841 -stand f$(FS)
xtest: FC := ifx -warn all -stand f$(FS)

####################################################################################################
Expand Down
6 changes: 3 additions & 3 deletions fortran/examples/lincoa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ ftest: FC := flang -Wall -Wextra -std=f$(FSTD) -Mstandard

# GNU gfortran: due to `error stop` and `backtrace`, we must either compile wit no `-std` or
# use `-std=f20xy -fall-intrinsics` with xy >= 18.
gtest: FC := gfortran -Wall -Wextra -Wno-attributes -Wno-function-elimination -std=f$(FSTD) -fall-intrinsics
gtest: FC := gfortran -Wall -Wextra -Wno-function-elimination -std=f$(FSTD) -fall-intrinsics

# Intel ifort
itest: FC := ifort -warn all -diag-disable:7025,7841 -stand f$(FS)
itest: FC := ifort -warn all -stand f$(FS)

# NAG nagfor
ntest: FC := nagfor -C -f$(FSTD)
Expand All @@ -73,7 +73,7 @@ RFORT := $(shell find -L /opt/arm -type f -executable -name armflang -print 2> /
rtest: FC := $(RFORT) -Wall -Wextra -std=f$(FSTD) -Mstandard

# Intel ifx
xtest: FC := ifx -warn all -diag-disable:7025,7841 -stand f$(FS)
xtest: FC := ifx -warn all -stand f$(FS)

####################################################################################################
# Compile the binary needed for a compiler-specific test
Expand Down
6 changes: 3 additions & 3 deletions fortran/examples/newuoa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ ftest: FC := flang -Wall -Wextra -std=f$(FSTD) -Mstandard

# GNU gfortran: due to `error stop` and `backtrace`, we must either compile wit no `-std` or
# use `-std=f20xy -fall-intrinsics` with xy >= 18.
gtest: FC := gfortran -Wall -Wextra -Wno-attributes -Wno-function-elimination -std=f$(FSTD) -fall-intrinsics
gtest: FC := gfortran -Wall -Wextra -Wno-function-elimination -std=f$(FSTD) -fall-intrinsics

# Intel ifort
itest: FC := ifort -warn all -diag-disable:7025,7841 -stand f$(FS)
itest: FC := ifort -warn all -stand f$(FS)

# NAG nagfor
ntest: FC := nagfor -C -f$(FSTD)
Expand All @@ -72,7 +72,7 @@ RFORT := $(shell find -L /opt/arm -type f -executable -name armflang -print 2> /
rtest: FC := $(RFORT) -Wall -Wextra -std=f$(FSTD) -Mstandard

# Intel ifx
xtest: FC := ifx -warn all -diag-disable:7025,7841 -stand f$(FS)
xtest: FC := ifx -warn all -stand f$(FS)

####################################################################################################
# Compile the binary needed for a compiler-specific test
Expand Down
6 changes: 3 additions & 3 deletions fortran/examples/uobyqa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ ftest: FC := flang -Wall -Wextra -std=f$(FSTD) -Mstandard

# GNU gfortran: due to `error stop` and `backtrace`, we must either compile wit no `-std` or
# use `-std=f20xy -fall-intrinsics` with xy >= 18.
gtest: FC := gfortran -Wall -Wextra -Wno-attributes -Wno-function-elimination -std=f$(FSTD) -fall-intrinsics
gtest: FC := gfortran -Wall -Wextra -Wno-function-elimination -std=f$(FSTD) -fall-intrinsics

# Intel ifort
itest: FC := ifort -warn all -diag-disable:7025,7841 -stand f$(FS)
itest: FC := ifort -warn all -stand f$(FS)

# NAG nagfor
ntest: FC := nagfor -C -f$(FSTD)
Expand All @@ -72,7 +72,7 @@ RFORT := $(shell find -L /opt/arm -type f -executable -name armflang -print 2> /
rtest: FC := $(RFORT) -Wall -Wextra -std=f$(FSTD) -Mstandard

# Intel ifx
xtest: FC := ifx -warn all -diag-disable:7025,7841 -stand f$(FS)
xtest: FC := ifx -warn all -stand f$(FS)

####################################################################################################
# Compile the binary needed for a compiler-specific test
Expand Down
4 changes: 1 addition & 3 deletions fortran/tests/makefiles/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ GFSTD := $(shell [[ $$(($(GFORT) -dumpversion 2>/dev/null || echo 0) | sed 's|\
# allocatable characters. See
# https://fortran-lang.discourse.group/t/warning-str-may-be-used-uninitialized
WE := $(shell if [[ $$(($(GFORT) -dumpversion 2>/dev/null || echo 0) | sed 's|\..*||') -gt 11 || $$(($(GFORT) -dumpversion 2>/dev/null || echo 0) | sed 's|\..*||') -gt 8 && -z '$(FFLAGSG)' ]] ; then echo "-Werror"; else echo ""; fi)
GFORT := $(GFORT) $(WE) -pedantic-errors -fmax-errors=1 -Wno-attributes # -Wno-attributes is to avoid complaints about `attributes dllexport`
GFORT := $(GFORT) $(WE) -pedantic-errors -fmax-errors=1
# `-fautomatic` (the default) tells `gfortran` to use the stack for local variables smaller than the
# value given by -fmax-stack-var-size. `-fstack-arrays` forces all automatic arrays to be on the stack.
# We enable them for small problems to verify that we will not have stack overflows.
Expand Down Expand Up @@ -479,7 +479,6 @@ gtest_i2_r16_d1_tst_c gtest_i4_r16_d1_tst_c gtest_i8_r16_d1_tst_c gtest_i2_r16_d
# protect_parens, realloc_lhs1, recursion, std_intent_in, std_minus0_rounding1, std_mod_proc_name,
# and std_value1.
IFORT := ifort #-stand f$(FS)
IFORT := $(IFORT) -diag-disable:5180,7025,7841 # avoid complaints about `attributes dllexport`
IFORT := $(IFORT) -warn all -debug extended -warn errors -traceback -debug-parameters all #-diag-error-limit 1
# `-auto` causes all local, non-SAVEd variables to be allocated to the run-time stack.
# `-no-heap-arrays`, which is the default for `ifort`, causes the compiler puts automatic arrays
Expand Down Expand Up @@ -645,7 +644,6 @@ stest_i2_r16_d1_tst_c stest_i4_r16_d1_tst_c stest_i8_r16_d1_tst_c stest_i2_r16_d

# Intel ifx
XFORT := ifx #-stand f$(FS)
XFORT := $(XFORT) -diag-disable:5180,7025,7841 # avoid complaints about `attributes dllexport`
XFORT := $(XFORT) -warn all -debug extended -warn errors -traceback -debug-parameters all #-diag-error-limit 1
# `-auto` causes all local, non-SAVEd variables to be allocated to the run-time stack.
# `-no-heap-arrays`, which is the default for `ifort`, causes the compiler puts automatic arrays
Expand Down
6 changes: 2 additions & 4 deletions matlab/mex_gateways/tests/makefiles/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ ftest_i2_r16_d1_tst ftest_i4_r16_d1_tst ftest_i8_r16_d1_tst ftest_i2_r16_d0_tst
# makes the code not standard-conforming. So -std=f$(FSTD) is excluded for the following options.
# As of 2022, -Wextra implies -Wcompare-reals, -Wunused-parameter, and -Wdo-subscript.
GFORT := gfortran
GFORT := $(GFORT) -Wno-attributes # avoid complaints about `attributes dllexport`
GFORT := $(GFORT) -Wall -Wextra -pedantic -fmax-errors=1 -Wampersand -Wconversion -Wuninitialized \
-Wmaybe-uninitialized -Wsurprising -Waliasing -Wimplicit-interface -Wimplicit-procedure \
-Wintrinsics-std -Wunderflow -Wuse-without-only -Wunused-parameter \
Expand Down Expand Up @@ -311,8 +310,7 @@ gtest_i2_r16_d1_tst gtest_i4_r16_d1_tst gtest_i8_r16_d1_tst gtest_i2_r16_d0_tst
# will cause a warning; due to -warn errors, the compilation will abort. See
# https://www.intel.com/content/www/us/en/develop/documentation/fortran-compiler-oneapi-dev-guide-and-reference/top/language-reference/a-to-z-reference/q-to-r/recursive-and-non-recursive.html
IFORT := ifort
IFORT := $(IFORT) -diag-disable:5180,7025,7841 # avoid complaints about `attributes dllexport`
#IFORT := $(IFORT) -diag-error-limit 1
#IFORT := $(IFORT) -diag-error-limit 1
IFORT := $(IFORT) -stand f95 -standard-semantics -assume norecursion -warn all -debug extended -fimplicit-none \
-traceback -debug-parameters all

Expand Down Expand Up @@ -406,7 +404,7 @@ stest_i2_r16_d1_tst stest_i4_r16_d1_tst stest_i8_r16_d1_tst stest_i2_r16_d0_tst

# Intel ifx
XFORT := ifx
XFORT := $(XFORT) -diag-disable:5180,7025,7841 # avoid complaints about `attributes dllexport`
#XFORT := $(XFORT) -diag-error-limit 1
XFORT := $(XFORT) -stand f$(FS) -warn all -debug extended -fimplicit-none \
-traceback -debug-parameters all

Expand Down
2 changes: 1 addition & 1 deletion matlab/tests/stress.m
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function stress(solver, options)
while redo
exception = [];
try
solver(problem);
[a, b, c, d] = solver(problem)
catch exception
end
if isempty(exception) || ~tough_test || ~strcmp(solver_name, 'cobyla')
Expand Down

0 comments on commit af58422

Please sign in to comment.