Here are directions for building netcdf with all fortran 90 features on Macintosh OS X 10.2 using the NAG f95 compiler. make test runs successfully through all tests.
setenv FC /usr/local/bin/f95 setenv FFLAGS "-O -dusty -w" setenv F90 /usr/local/bin/f95 setenv FPP "/usr/local/bin/f95 -fpp" setenv F90FLAGS "-O -w=unused -mismatch_all" setenv CPPFLAGS "-DNAGf90Fortran"
Run
configure <--prefix=installation_directory>
OS X is case insensitive, which causes problems with .F files. To work around, modify the .F.o rule in the rules.make file. It should read like this:
# Not all FORTRAN compilers support C-preprocessing of *.F files; ergo, a # relatively complicated rule ensues. .F.o: @case "$(COMPILE.F)" in \ '') \ set -x; \ cp $*.F $*.ff; \ $(FPP) $(FPPFLAGS) -c -O -dusty -w $*.ff ; \ ;; \ *) \ set -x; \ $(COMPILE.F) $<; \ ;; \ esac
USE F90_UNIX_ENV, ONLY : IARGC,GETARG(this will define iargc and getenv) comment out this line:
integer iarg
(conflicts with f90_unix_env)
makeand
make test
make install