nc-config is a simple script that reports the settings of C and Fortran flags used during the netCDF build, as well as the installed version of the netCDF C-based libraries. It has lots of options, listed by invoking "nc-config --all".
Here's an example of output from:
nc-config --alloutput
Here's an example of how to compile and link a C application and a Fortran application, using nc-config:
cc `nc-config --cflags` myapp.c -o myapp `nc-config --libs`
f95 `nc-config --fflags` yrapp.f -o yrapp `nc-config --flibs`