From 8c38a236ba964312de0f9c7a3d524a22db51fd8e Mon Sep 17 00:00:00 2001 From: wkliao Date: Thu, 8 Feb 2024 16:25:05 -0600 Subject: [PATCH] suppress warning messages when using NAG Fortran compiler -w=uep to suppresses warning messages about unused external procedures -w=x77 to suppresses extension warnings for Fortr 77 -w=unreffed to suppresses warning messages about variables set but never referenced; -w=uparam to suppresses warning messages about unused PARAMETERs; --- benchmarks/FLASH-IO/Makefile.am | 12 ++++++++++++ configure.ac | 1 + examples/F77/Makefile.am | 17 +++++++++++++++++ examples/F90/Makefile.am | 12 ++++++++++++ examples/tutorial/Makefile.am | 16 ++++++++++++++++ test/F90/Makefile.am | 12 ++++++++++++ test/fandc/Makefile.am | 20 ++++++++++++++++++++ test/nf90_test/Makefile.am | 12 ++++++++++++ test/nf_test/Makefile.am | 17 +++++++++++++++++ test/nonblocking/Makefile.am | 20 ++++++++++++++++++++ test/testcases/Makefile.am | 20 ++++++++++++++++++++ 11 files changed, 159 insertions(+) diff --git a/benchmarks/FLASH-IO/Makefile.am b/benchmarks/FLASH-IO/Makefile.am index b40f2f4d9..986b24a11 100644 --- a/benchmarks/FLASH-IO/Makefile.am +++ b/benchmarks/FLASH-IO/Makefile.am @@ -29,6 +29,18 @@ AM_FCFLAGS += $(FC_DEFINE)N_DIM=3 AM_FCFLAGS += $(FC_DEFINE)MAXBLOCKS=100 AM_FCFLAGS += $(FC_DEFINE)IONMAX=13 +# suppress warning messages when using NAG Fortran compiler +if NAGFORT + # suppresses warning messages about unused external procedures + AM_FCFLAGS += -w=uep + + # suppresses warning messages about variables set but never referenced; + AM_FCFLAGS += -w=unreffed + + # suppresses warning messages about unused PARAMETERs; + AM_FCFLAGS += -w=uparam +endif + check_PROGRAMS = flash_benchmark_io noinst_PROGRAMS = $(check_PROGRAMS) diff --git a/configure.ac b/configure.ac index 303aace29..9f1c0eebb 100644 --- a/configure.ac +++ b/configure.ac @@ -1023,6 +1023,7 @@ if test "x${has_fortran}" = xyes && test "x${ax_cv_fc_compiler_vendor}" = xnag ; ACX_F77_MISMATCH([AS_VAR_APPEND([FFLAGS], [" $acx_cv_f77_mismatch_flag"])]) ACX_FC_MISMATCH([AS_VAR_APPEND([FCFLAGS], [" $acx_cv_fc_mismatch_flag"])]) fi +AM_CONDITIONAL(NAGFORT, [test x$ax_cv_fc_compiler_vendor = xnag]) if test "x$enable_shared" = xyes ; then dnl Call LT_OUTPUT to produce file ./libtool which is used later in diff --git a/examples/F77/Makefile.am b/examples/F77/Makefile.am index 47da1d05f..2fc9a9f6c 100644 --- a/examples/F77/Makefile.am +++ b/examples/F77/Makefile.am @@ -13,6 +13,23 @@ AM_FFLAGS = -I$(top_builddir)/src/binding/f77 $(FFIXEDFORMFLAG) LDADD = ${top_builddir}/src/libs/libpnetcdf.la utils.o LDADD += @NETCDF4_LDFLAGS@ @ADIOS_LDFLAGS@ @NETCDF4_LIBS@ @ADIOS_LIBS@ +# suppress warning messages when using NAG Fortran compiler +if NAGFORT + # suppresses warning messages about unused external procedures + AM_FFLAGS += -w=uep + + # suppresses extension warnings for obsolete but common extensions to Fortran + # 77 - these are TAB format, byte-length specifiers, Hollerith constants + # and D lines; + AM_FFLAGS += -w=x77 + + # suppresses warning messages about variables set but never referenced; + AM_FFLAGS += -w=unreffed + + # suppresses warning messages about unused PARAMETERs; + AM_FFLAGS += -w=uparam +endif + if SIZEOF_MPI_AINT_IS_4 AM_FFLAGS += $(FC_DEFINE)SIZEOF_MPI_AINT_IS_4 endif diff --git a/examples/F90/Makefile.am b/examples/F90/Makefile.am index 1c5b65a8f..cfdc3a4d3 100644 --- a/examples/F90/Makefile.am +++ b/examples/F90/Makefile.am @@ -14,6 +14,18 @@ AM_FCFLAGS = ${FC_MODINC}$(top_builddir)/src/binding/f90 $(FFREEFORMFLAG) LDADD = ${top_builddir}/src/libs/libpnetcdf.la utils.o LDADD += @NETCDF4_LDFLAGS@ @ADIOS_LDFLAGS@ @NETCDF4_LIBS@ @ADIOS_LIBS@ +# suppress warning messages when using NAG Fortran compiler +if NAGFORT + # suppresses warning messages about unused external procedures + AM_FCFLAGS += -w=uep + + # suppresses warning messages about variables set but never referenced; + AM_FCFLAGS += -w=unreffed + + # suppresses warning messages about unused PARAMETERs; + AM_FCFLAGS += -w=uparam +endif + check_PROGRAMS = nonblocking_write \ column_wise \ block_cyclic \ diff --git a/examples/tutorial/Makefile.am b/examples/tutorial/Makefile.am index cd6dc13b7..20859a3ff 100644 --- a/examples/tutorial/Makefile.am +++ b/examples/tutorial/Makefile.am @@ -16,6 +16,22 @@ AM_FCFLAGS = $(FC_MODINC)$(top_builddir)/src/binding/f90 $(FFREEFORMFLAG) LDADD = ${top_builddir}/src/libs/libpnetcdf.la LDADD += @NETCDF4_LDFLAGS@ @ADIOS_LDFLAGS@ @NETCDF4_LIBS@ @ADIOS_LIBS@ +# suppress warning messages when using NAG Fortran compiler +if NAGFORT + # suppresses warning messages about unused external procedures + AM_FFLAGS += -w=uep + AM_FCFLAGS += -w=uep + + # suppresses extension warnings for obsolete but common extensions to Fortran + # 77 - these are TAB format, byte-length specifiers, Hollerith constants + # and D lines; + AM_FFLAGS += -w=x77 + + # suppresses warning messages about variables set but never referenced; + AM_FFLAGS += -w=unreffed + AM_FCFLAGS += -w=unreffed +endif + check_PROGRAMS = pnetcdf-write-from-master \ pnetcdf-read-from-master \ pnetcdf-write-nfiles \ diff --git a/test/F90/Makefile.am b/test/F90/Makefile.am index dccbe8250..4d4812767 100644 --- a/test/F90/Makefile.am +++ b/test/F90/Makefile.am @@ -16,6 +16,18 @@ AM_FCFLAGS = $(FC_MODINC)$(top_builddir)/src/binding/f90 \ LDADD = $(top_builddir)/src/libs/libpnetcdf.la ../common/libtestutils.la LDADD += @NETCDF4_LDFLAGS@ @ADIOS_LDFLAGS@ @NETCDF4_LIBS@ @ADIOS_LIBS@ +# suppress warning messages when using NAG Fortran compiler +if NAGFORT + # suppresses warning messages about unused external procedures + AM_FCFLAGS += -w=uep + + # suppresses warning messages about variables set but never referenced; + AM_FCFLAGS += -w=unreffed + + # suppresses warning messages about unused PARAMETERs; + AM_FCFLAGS += -w=uparam +endif + TESTPROGRAMS = tst_f90 \ f90tst_vars \ tst_types2 \ diff --git a/test/fandc/Makefile.am b/test/fandc/Makefile.am index cdae56e8d..dc3f81432 100644 --- a/test/fandc/Makefile.am +++ b/test/fandc/Makefile.am @@ -19,6 +19,26 @@ AM_FCFLAGS = $(FC_MODINC)$(top_builddir)/src/binding/f90 \ LDADD = $(top_builddir)/src/libs/libpnetcdf.la ../common/libtestutils.la LDADD += @NETCDF4_LDFLAGS@ @ADIOS_LDFLAGS@ @NETCDF4_LIBS@ @ADIOS_LIBS@ -lm +# suppress warning messages when using NAG Fortran compiler +if NAGFORT + # suppresses warning messages about unused external procedures + AM_FFLAGS += -w=uep + AM_FCFLAGS += -w=uep + + # suppresses extension warnings for obsolete but common extensions to Fortran + # 77 - these are TAB format, byte-length specifiers, Hollerith constants + # and D lines; + AM_FFLAGS += -w=x77 + + # suppresses warning messages about variables set but never referenced; + AM_FFLAGS += -w=unreffed + AM_FCFLAGS += -w=unreffed + + # suppresses warning messages about unused PARAMETERs; + AM_FFLAGS += -w=uparam + AM_FCFLAGS += -w=uparam +endif + if DECL_MPI_OFFSET # Do not add to AM_CPPFLAGS, as it will also be used by Fortran programs # AM_CPPFLAGS += -DHAVE_DECL_MPI_OFFSET diff --git a/test/nf90_test/Makefile.am b/test/nf90_test/Makefile.am index 709ba8907..4c405947f 100644 --- a/test/nf90_test/Makefile.am +++ b/test/nf90_test/Makefile.am @@ -22,6 +22,18 @@ AM_CFLAGS = LDADD = $(top_builddir)/src/libs/libpnetcdf.la ../common/libtestutils.la LDADD += @NETCDF4_LDFLAGS@ @ADIOS_LDFLAGS@ @NETCDF4_LIBS@ @ADIOS_LIBS@ +# suppress warning messages when using NAG Fortran compiler +if NAGFORT + # suppresses warning messages about unused external procedures + AM_FCFLAGS += -w=uep + + # suppresses warning messages about variables set but never referenced; + AM_FCFLAGS += -w=unreffed + + # suppresses warning messages about unused PARAMETERs; + AM_FCFLAGS += -w=uparam +endif + if RELAX_COORD_BOUND AM_CFLAGS += -DRELAX_COORD_BOUND AM_FCFLAGS += $(FC_DEFINE)RELAX_COORD_BOUND diff --git a/test/nf_test/Makefile.am b/test/nf_test/Makefile.am index 892f46093..9532b0718 100644 --- a/test/nf_test/Makefile.am +++ b/test/nf_test/Makefile.am @@ -20,6 +20,23 @@ AM_FFLAGS = $(FFIXEDFORMFLAG) LDADD = $(top_builddir)/src/libs/libpnetcdf.la ../common/libtestutils.la LDADD += @NETCDF4_LDFLAGS@ @ADIOS_LDFLAGS@ @NETCDF4_LIBS@ @ADIOS_LIBS@ +# suppress warning messages when using NAG Fortran compiler +if NAGFORT + # suppresses warning messages about unused external procedures + AM_FFLAGS += -w=uep + + # suppresses extension warnings for obsolete but common extensions to Fortran + # 77 - these are TAB format, byte-length specifiers, Hollerith constants + # and D lines; + AM_FFLAGS += -w=x77 + + # suppresses warning messages about variables set but never referenced; + AM_FFLAGS += -w=unreffed + + # suppresses warning messages about unused PARAMETERs; + AM_FFLAGS += -w=uparam +endif + M4FLAGS += -I${top_srcdir}/m4 if HAVE_F77_GNU_INT diff --git a/test/nonblocking/Makefile.am b/test/nonblocking/Makefile.am index d6a7c7052..568154932 100644 --- a/test/nonblocking/Makefile.am +++ b/test/nonblocking/Makefile.am @@ -22,6 +22,26 @@ AM_FFLAGS = -I$(top_builddir)/src/binding/f77 $(FFIXEDFORMFLAG) LDADD = ${top_builddir}/src/libs/libpnetcdf.la ../common/libtestutils.la LDADD += @NETCDF4_LDFLAGS@ @ADIOS_LDFLAGS@ @NETCDF4_LIBS@ @ADIOS_LIBS@ -lm +# suppress warning messages when using NAG Fortran compiler +if NAGFORT + # suppresses warning messages about unused external procedures + AM_FFLAGS += -w=uep + AM_FCFLAGS += -w=uep + + # suppresses extension warnings for obsolete but common extensions to Fortran + # 77 - these are TAB format, byte-length specifiers, Hollerith constants + # and D lines; + AM_FFLAGS += -w=x77 + + # suppresses warning messages about variables set but never referenced; + AM_FFLAGS += -w=unreffed + AM_FCFLAGS += -w=unreffed + + # suppresses warning messages about unused PARAMETERs; + AM_FFLAGS += -w=uparam + AM_FCFLAGS += -w=uparam +endif + if DECL_MPI_OFFSET # Do not add to AM_CPPFLAGS, as it will also be used by Fortran programs # AM_CPPFLAGS += -DHAVE_DECL_MPI_OFFSET diff --git a/test/testcases/Makefile.am b/test/testcases/Makefile.am index 04796595e..5a078efdc 100644 --- a/test/testcases/Makefile.am +++ b/test/testcases/Makefile.am @@ -34,6 +34,26 @@ if DECL_MPI_OFFSET AM_FCFLAGS += $(FC_DEFINE)HAVE_DECL_MPI_OFFSET endif +# suppress warning messages when using NAG Fortran compiler +if NAGFORT + # suppresses warning messages about unused external procedures + AM_FFLAGS += -w=uep + AM_FCFLAGS += -w=uep + + # suppresses extension warnings for obsolete but common extensions to Fortran + # 77 - these are TAB format, byte-length specifiers, Hollerith constants + # and D lines; + AM_FFLAGS += -w=x77 + + # suppresses warning messages about variables set but never referenced; + AM_FFLAGS += -w=unreffed + AM_FCFLAGS += -w=unreffed + + # suppresses warning messages about unused PARAMETERs; + AM_FFLAGS += -w=uparam + AM_FCFLAGS += -w=uparam +endif + TESTPROGRAMS = ncmpi_vars_null_stride \ vectors \ collective_error \