Link failure with FORTRAN netcdf libraries
I got the same errors after change the .soft as you suggested.
After some more tests, I found a strange behavior. Here is my test program. % cat test.f program main include "mpif.h" include "pnetcdf.inc"
integer ierr, ncid
call MPI_Init(ierr)
ierr = nfmpi_create(MPI_COMM_WORLD, "pnf_test.nc", NF_CLOBBER,
+ MPI_INFO_NULL, ncid)
ierr = nfmpi_enddef(ncid)
ierr = nfmpi_close(ncid)
call MPI_Finalize (ierr)
end program
Here is my compile command and it generated no error. % /soft/compilers/wrappers/gcc/mpif77 -I../../src/libf test.f -o test -L../../src/lib -lpnetcdf
However, once I removed the line of ierr = nfmpi_enddef(ncid)
the errors appeared:
/soft/perftools/darshan/darshan-2.2.7/lib/libdarshan-mpi-io.a(darshan-pnetcdf.o):
In function __wrap_ncmpi_close': /soft/perftools/darshan/darshan-2.2.7/build/darshan-2.2.7/darshan-runtime/lib/darshan-pnetcdf.c:152: undefined reference to
ncmpi_close'
/soft/perftools/darshan/darshan-2.2.7/lib/libdarshan-mpi-io.a(darshan-pnetcdf.o):
In function __wrap_ncmpi_open': /soft/perftools/darshan/darshan-2.2.7/build/darshan-2.2.7/darshan-runtime/lib/darshan-pnetcdf.c:108: undefined reference to
ncmpi_open'
/soft/perftools/darshan/darshan-2.2.7/lib/libdarshan-mpi-io.a(darshan-pnetcdf.o):
In function __wrap_ncmpi_create': /soft/perftools/darshan/darshan-2.2.7/build/darshan-2.2.7/darshan-runtime/lib/darshan-pnetcdf.c:62: undefined reference to
ncmpi_create'
collect2: ld returned 1 exit status
I guess the mpi compiler wrapper fails to place the user command-line library (-L../../src/lib -lpnetcdf in this case) after the internal libraries used by Darshan.
(via Ray)