[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FFLAGS in compiling Netcdf3.6.1



Hi Zhou Wei,

> I am compiling netcdf -3.6.1 for MCIP v2.2.(MCIP is a component of MODELS-3)
> 
> Here I set
> setenv FC pgf90
> setenv CC gcc
> setenv FFLAGS "O2"
> setenv CPPFLAGS "-DNDEBUG -DpgiFortran"
> in ~/.cshrc, then I can compile netcdf successfully.
> 
> The problem is that
> in Makefile of MCIP v2.2,
> FFLAGS = -O2   -tp p6 -pc 32 -Mvect=prefetch -Mnoframe -Mfree -byteswapio
> 
> However,
> if I set FFLAGS = -O2   -tp p6 -pc 32 -Mvect=prefetch -Mnoframe -Mfree
> -byteswapio
> I can not succeed in compiling netcdf-3.6.1.
> If I changed FFLAGS in Makefile of MCIP v2.2, there are errors in
> compiling MCIP.
> 
> Is there anyone having experience to handle such a problem?

We don't have any experience with this problem, but I have a
suggestion that might work.  I think the "-Mfree" is the only part of
FFLAGS that is causing problems with building netCDF 3.6.1.  "-Mfree"
indicates the Fortran-90 is free format, but the f90 compiler must
actually process a fixed-format file produced by the m4 macroprocessor
to test the netCDF interface (it's nf_test/test_get.F), so the -Mfree
option will cause all kinds of errors.  Maybe just removing the -Mfree
option will allow you to build netCDF otherwise with the same options
as MCIP.  (I'm not sure whether it works with "-tp p6", but I don't
think that should cause any trouble.)

--Russ