NetCDF on Windows: Install problem or compilation problem?

I just installed PGI-CE 17.4 64 bit on my Windows machine. I’m using the PGI CE Command Shell that emulates bash.

$ pgfortran -V

pgfortran 17.4-0 64-bit target on x86-64 Windows -tp haswell
PGI Compilers and Tools
Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.

I’m trying to compile netCDF-4.1.1. The first step after extracting the tar.gz is to run:

CC=pgcc
CFLAGS=‘-O2 -Msignextend -V’
CXX=
CPPFLAGS=‘-DNDEBUG -DpgiFortran’
FC=pgf90
F77=pgf90
FCFLAGS=‘-fast’
FFLAGS=‘-O2 -w -V’
F90=pgf90
./configure --prefix=$PWD --enable-f77 --enable-f90 --disable-dap --disable-cxx --disable-cxx-4 --disable-netcdf-4 >& netcdf.configure.out 2>&1

That fails when testing if pgf90 can compile code. Here’s the error:

$ tail -3 netcdf.configure.out
configure: setting up Fortran 90
checking for Fortran flag to compile .f90 files… unknown
configure: error: Fortran could not compile .f90 files

Here’s the test program:

$ cat test_prog.f90
! This is part of Unidata's netCDF package. Copyright 2009.
! This is a test program for the nc-config utility. 

program test_prog
  use typeSizes
  use netcdf
  implicit none

  print *, 'NetCDF version: ', nf90_inq_libvers()
  print *, '*** SUCCESS!'        
end program test_prog

It’s failing on the line “use typeSizes”. There exists in the netCDF distro a file f90/typeSizes.f90 so this might be netCDF-specific.

I have confirmed I can compile simple programs with the Windows install.

Does anyone have any hints for me for compiling netCDF on Windows using PGI-CE?

See NetCDF: FAQ
for Unidata telling you that NetCDF is very difficult to build on Windows,
and they point to other sources.

We have attempted to build NetCDF in the past on Windows, and there were many
problems creating instructions anyone can follow. We do not support
it.

In short, it takes a lot of work to move code written on Linux using Linux
system utils and headers, over to Windows.

dave