From b86c76287b379586bd3f54dede891eda6a7d4e01 Mon Sep 17 00:00:00 2001 From: Wei-keng Liao Date: Fri, 25 Sep 2026 14:13:48 -0700 Subject: [PATCH 1/2] Remove Fortran visibility flag * This commit adopts the fix suggested by issue #242 * Fortran API visibility does not work in general --- configure.ac | 14 -------------- src/binding/f77/Makefile.am | 1 - src/binding/f90/Makefile.am | 2 +- src/libs/Makefile.am | 2 -- 4 files changed, 1 insertion(+), 18 deletions(-) diff --git a/configure.ac b/configure.ac index 9cb0daebf6..abcc46c84f 100644 --- a/configure.ac +++ b/configure.ac @@ -889,20 +889,6 @@ AC_SUBST(has_fortran)dnl for src/utils/pnetcdf-config.in AM_CONDITIONAL(HAS_FORTRAN, [test x$has_fortran = xyes]) AM_CONDITIONAL(HAVE_MPI_MOD, [test x$mpi_mod = xyes]) -if test "x${has_fortran}" = xyes ; then - # Declare visibility of all functions are by default hidden if the compiler - # supports it. Check if the C compiler supports -fvisibility=hidden - AC_LANG_PUSH([Fortran]) - F77_VISIBILITY_FLAGS= - F90_VISIBILITY_FLAGS= - AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], - [F77_VISIBILITY_FLAGS="-fvisibility=hidden" - F90_VISIBILITY_FLAGS="-fvisibility=hidden"]) - AC_SUBST(F77_VISIBILITY_FLAGS) - AC_SUBST(F90_VISIBILITY_FLAGS) - AC_LANG_POP([Fortran]) -fi - if test "x${has_fortran}" = xyes ; then if test "x${enable_strict}" = xyes && test "x${GFC}" = xyes; then dnl not all Fortran compilers recognize -Wall diff --git a/src/binding/f77/Makefile.am b/src/binding/f77/Makefile.am index 132ba1fba1..e8ce024afd 100644 --- a/src/binding/f77/Makefile.am +++ b/src/binding/f77/Makefile.am @@ -12,7 +12,6 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/include AM_CPPFLAGS += -I$(top_builddir)/src/include AM_CFLAGS = @C_VISIBILITY_FLAGS@ -AM_FFLAGS = @F77_VISIBILITY_FLAGS@ nodist_include_HEADERS = pnetcdf.inc diff --git a/src/binding/f90/Makefile.am b/src/binding/f90/Makefile.am index 628fdce655..6c5a29b87d 100644 --- a/src/binding/f90/Makefile.am +++ b/src/binding/f90/Makefile.am @@ -10,7 +10,7 @@ SUFFIXES = .a .o .mod .f90 .m4 .fh AM_DEFAULT_SOURCE_EXT = .f90 -AM_FCFLAGS = -I. -I$(srcdir) @F90_VISIBILITY_FLAGS@ +AM_FCFLAGS = -I. -I$(srcdir) if UPPER_CASE_MOD PNETCDF_MOD = PNETCDF.$(FC_MODEXT) diff --git a/src/libs/Makefile.am b/src/libs/Makefile.am index ca3ff5edc5..9af0c31184 100644 --- a/src/libs/Makefile.am +++ b/src/libs/Makefile.am @@ -8,8 +8,6 @@ AM_CFLAGS = @C_VISIBILITY_FLAGS@ AM_CXXFLAGS = @CXX_VISIBILITY_FLAGS@ -AM_FCFLAGS = @F90_VISIBILITY_FLAGS@ -AM_FFLAGS = @F77_VISIBILITY_FLAGS@ lib_LTLIBRARIES = libpnetcdf.la From fda3fe8d77470a9250cced849c8b3a76b0a0b443 Mon Sep 17 00:00:00 2001 From: Wei-keng Liao Date: Fri, 25 Sep 2026 15:44:18 -0700 Subject: [PATCH 2/2] README.CRAY.md - Fortran API visibility issue when using Intel oneAPI has been resolved --- doc/README.CRAY.md | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/doc/README.CRAY.md b/doc/README.CRAY.md index b7b00a0c6e..2b39448e0e 100644 --- a/doc/README.CRAY.md +++ b/doc/README.CRAY.md @@ -10,35 +10,19 @@ MPICC=cc MPICXX=CC MPIF77=ftn MPIF90=ftn ``` - + The Intel oneAPI compilers may not work properly when used to build the - PnetCDF library. Note on Permutter, the GNU compiler module is loaded by - default. If this is not your case, commands below can be used to switch to - the GNU/NVIDIA module. + + PnetCDF can also be built using the Intel oneAPI compilers or NVIDIA + compilers. Note on Perlmutter, the GNU compiler module is loaded by + default. To switch to use the Intel compilers, run command below to swap + the two modules. ```console - module swap PrgEnv-intel PrgEnv-gnu + module swap PrgEnv-gnu PrgEnv-intel ``` - or + To switch to use the NVIDIA compilers, run command below to swap the two + modules. ```console - module swap PrgEnv-intel PrgEnv-nvidia + module swap PrgEnv-gnu PrgEnv-nvidia ``` - + When using Intel oneAPI compilers to building PnetCDF with Fortran feature - enabled, the building process, i.e. running "make", may fail with the - following error messages. - ``` - Making all in FLASH-IO - /usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: flash_benchmark_io.o: in function `report_io_performance_': - $SCRATCH/pnetcdf-1.15.0/benchmarks/FLASH-IO/flash_benchmark_io.F90:336:(.text+0x2e4a): undefined reference to `nfmpi_inq_malloc_max_size_' - ``` - NERSC Consulting and Support suggested a workaround which adds the - following line to the configure command. - ``` - --disable-shared LDFLAGS="-L${CRAY_MPICH_DIR}/lib -Wl,-rpath-link,${CRAY_MPICH_DIR}/lib" - ``` - However, note that this solution will not build the shared libraries. - Because of this, we recommend to use the GNU based compilers to build - PnetCDF on Perlmutter. - * [Cori @ NERSC](http://www.nersc.gov/systems/cori/) ```console ./configure --prefix=/path/to/install \