[Wrf-users] Compiling WRF with NETCDF, PNETCDF and PHDF5

Gianluca Meneghello gianmail at gmail.com
Mon Nov 30 15:30:01 MST 2015


Hi Tabish,

thanks for your quick reply.

I have a working installation using the tutorial configuration, with mpi
but serial output only (io_form_history 2).

I am interested in building WRF with parallel IO (using parallel NETCDF4 is
possible, or using parallel netcdf and PHDF5 otherwise, i.e.
io_form_history 4 or 11). I understand from the manual that PHDF5 and
PNETCDF are supported, I am not clear about parallel NETCDF4.

I had a look at the NETCDF4 test performed by configure script. The line

make nc4_test > tools/nc4_test.log 2>&1

corresponding to

gcc -o nc4_test.exe nc4_test.c
-I/home/gianlu/software/netcdf-4.3.3.1/netcdf/include
-L/home/gianlu/software/netcdf-4.3.3.1/netcdf/lib -lnetcdf

fails. But if I replace the gcc command including mpi, pnetcdf and hdf5

mpicc -o nc4_test.exe nc4_test.c
-L/home/gianlu/software/netcdf-4.3.3.1/netcdf/lib
-L/home/gianlu/software/parallel-netcdf-1.6.1/pnetcdf/lib
-L/home/gianlu/software/hdf5-1.8.16/phdf5/lib -lnetcdf -lpnetcdf -lhdf5_hl
-lhdf5 -ldl -lm -lz

the test compiles correctly.

Is there any specific instruction for compiling with PHDF5 support and
NETCDF4?

I attach the output of the unmodified ./configure

Thanks for your help

Gianluca


checking for perl5... no
checking for perl... found /usr/bin/perl (perl)
Will use NETCDF in dir: /home/gianlu/software/netcdf-4.3.3.1/netcdf
Will use PNETCDF in dir: /home/gianlu/software/parallel-netcdf-1.6.1/pnetcdf
Will use PHDF5 in dir: /home/gianlu/software/hdf5-1.8.16/phdf5
Will use 'time' to report timing information
$JASPERLIB or $JASPERINC not found in environment, configuring to build
without grib2 I/O...
------------------------------------------------------------------------
Please select from among the following Linux x86_64 options:

  1. (serial)   2. (smpar)   3. (dmpar)   4. (dm+sm)   PGI (pgf90/gcc)
  5. (serial)   6. (smpar)   7. (dmpar)   8. (dm+sm)   PGI (pgf90/pgcc):
SGI MPT
  9. (serial)  10. (smpar)  11. (dmpar)  12. (dm+sm)   PGI (pgf90/gcc): PGI
accelerator
 13. (serial)  14. (smpar)  15. (dmpar)  16. (dm+sm)   INTEL (ifort/icc)
                                         17. (dm+sm)   INTEL (ifort/icc):
Xeon Phi (MIC architecture)
 18. (serial)  19. (smpar)  20. (dmpar)  21. (dm+sm)   INTEL (ifort/icc):
Xeon (SNB with AVX mods)
 22. (serial)  23. (smpar)  24. (dmpar)  25. (dm+sm)   INTEL (ifort/icc):
SGI MPT
 26. (serial)  27. (smpar)  28. (dmpar)  29. (dm+sm)   INTEL (ifort/icc):
IBM POE
 30. (serial)               31. (dmpar)                PATHSCALE
(pathf90/pathcc)
 32. (serial)  33. (smpar)  34. (dmpar)  35. (dm+sm)   GNU (gfortran/gcc)
 36. (serial)  37. (smpar)  38. (dmpar)  39. (dm+sm)   IBM (xlf90_r/cc_r)
 40. (serial)  41. (smpar)  42. (dmpar)  43. (dm+sm)   PGI (ftn/gcc): Cray
XC CLE
 44. (serial)  45. (smpar)  46. (dmpar)  47. (dm+sm)   CRAY CCE (ftn/gcc):
Cray XE and XC
 48. (serial)  49. (smpar)  50. (dmpar)  51. (dm+sm)   INTEL (ftn/icc):
Cray XC
 52. (serial)  53. (smpar)  54. (dmpar)  55. (dm+sm)   PGI (pgf90/pgcc)
 56. (serial)  57. (smpar)  58. (dmpar)  59. (dm+sm)   PGI (pgf90/gcc):
-f90=pgf90
 60. (serial)  61. (smpar)  62. (dmpar)  63. (dm+sm)   PGI (pgf90/pgcc):
-f90=pgf90

Enter selection [1-63] : 34
------------------------------------------------------------------------
Compile for nesting? (1=basic, 2=preset moves, 3=vortex following) [default
1]: 3

Configuration successful!
------------------------------------------------------------------------
testing for MPI_Comm_f2c and MPI_Comm_c2f
   MPI_Comm_f2c and MPI_Comm_c2f are supported
testing for fseeko and fseeko64
fseeko64 is supported
------------------------------------------------------------------------

# Settings for    Linux x86_64 ppc64le, gfortran compiler with gcc   (dmpar)
#
DESCRIPTION     =       GNU ($SFC/$SCC)
DMPARALLEL      =        1
OMPCPP          =       # -D_OPENMP
OMP             =       # -fopenmp
OMPCC           =       # -fopenmp
SFC             =       gfortran
SCC             =       gcc
CCOMP           =       gcc
DM_FC           =       mpif90 -f90=$(SFC)
DM_CC           =       mpicc -cc=$(SCC) -DMPI2_SUPPORT
FC              =       time $(DM_FC)
CC              =       $(DM_CC) -DFSEEKO64_OK
LD              =       $(FC)
RWORDSIZE       =       $(NATIVE_RWORDSIZE)
PROMOTION       =       #-fdefault-real-8
ARCH_LOCAL      =       -DNONSTANDARD_SYSTEM_SUBR -DWRF_USE_CLM
$(NETCDF4_IO_OPTS)
CFLAGS_LOCAL    =       -w -O3 -c
LDFLAGS_LOCAL   =
CPLUSPLUSLIB    =
ESMF_LDFLAG     =       $(CPLUSPLUSLIB)
FCOPTIM         =       -O2 -ftree-vectorize -funroll-loops
FCREDUCEDOPT =       $(FCOPTIM)
FCNOOPT =       -O0
FCDEBUG         =       # -g $(FCNOOPT) # -ggdb -fbacktrace -fbounds-check
-ffpe-trap=invalid,zero,overflow
FORMAT_FIXED    =       -ffixed-form
FORMAT_FREE     =       -ffree-form -ffree-line-length-none
FCSUFFIX        =
BYTESWAPIO      =       -fconvert=big-endian -frecord-marker=4
FCBASEOPTS_NO_G =       -w $(FORMAT_FREE) $(BYTESWAPIO)
FCBASEOPTS      =       $(FCBASEOPTS_NO_G) $(FCDEBUG)
MODULE_SRCH_FLAG =
TRADFLAG        =      -traditional $(NETCDF4_IO_OPTS)
CPP             =      /lib/cpp -P
AR              =      ar
ARFLAGS         =      ru
M4              =      m4 -G
RANLIB          =      ranlib
CC_TOOLS        =      $(SCC)

###########################################################
######################
# POSTAMBLE

FGREP = fgrep -iq

ARCHFLAGS       =    $(COREDEFS) -DIWORDSIZE=$(IWORDSIZE)
-DDWORDSIZE=$(DWORDSIZE) -DRWORDSIZE=$(RWORDSIZE) -DLWORDSIZE=$(LWORDSIZE) \
                     $(ARCH_LOCAL) \
                     $(DA_ARCHFLAGS) \
                      -DDM_PARALLEL \
                       \
                      -DNETCDF \
                      -DPNETCDF \
                       \
                       \
                       \
                       \
                       \
                       \
                       \
                      -DMOVE_NESTS -DVORTEX_CENTER \
                      -DUSE_ALLOCATABLES \
                      -DGRIB1 \
                      -DINTIO \
                      -DLIMIT_ARGS \
                      -DCONFIG_BUF_LEN=$(CONFIG_BUF_LEN) \
                      -DMAX_DOMAINS_F=$(MAX_DOMAINS) \
                      -DMAX_HISTORY=$(MAX_HISTORY) \
     -DNMM_NEST=$(WRF_NMM_NEST)
CFLAGS          =    $(CFLAGS_LOCAL) -DDM_PARALLEL  \
                      -DMAX_HISTORY=$(MAX_HISTORY)
-DNMM_CORE=$(WRF_NMM_CORE)
FCFLAGS         =    $(FCOPTIM) $(FCBASEOPTS)
ESMF_LIB_FLAGS  =
# ESMF 5 -- these are defined in esmf.mk, included above
 ESMF_IO_LIB     =    -L$(WRF_SRC_ROOT_DIR)/external/esmf_time_f90
-lesmf_time
ESMF_IO_LIB_EXT =    -L$(WRF_SRC_ROOT_DIR)/external/esmf_time_f90
-lesmf_time
INCLUDE_MODULES =    $(MODULE_SRCH_FLAG) \
                     $(ESMF_MOD_INC) $(ESMF_LIB_FLAGS) \
                      -I$(WRF_SRC_ROOT_DIR)/main \
                      -I$(WRF_SRC_ROOT_DIR)/external/io_netcdf \
                      -I$(WRF_SRC_ROOT_DIR)/external/io_int \
                      -I$(WRF_SRC_ROOT_DIR)/frame \
                      -I$(WRF_SRC_ROOT_DIR)/share \
                      -I$(WRF_SRC_ROOT_DIR)/phys \
                      -I$(WRF_SRC_ROOT_DIR)/chem -I$(WRF_SRC_ROOT_DIR)/inc \
                      -I$(NETCDFPATH)/include \

REGISTRY        =    Registry
CC_TOOLS_CFLAGS = -DNMM_CORE=$(WRF_NMM_CORE)

 LIB_BUNDLED     = \

$(WRF_SRC_ROOT_DIR)/external/fftpack/fftpack5/libfftpack.a \
                      $(WRF_SRC_ROOT_DIR)/external/io_grib1/libio_grib1.a \

$(WRF_SRC_ROOT_DIR)/external/io_grib_share/libio_grib_share.a \
                      $(WRF_SRC_ROOT_DIR)/external/io_int/libwrfio_int.a \
                      $(ESMF_IO_LIB) \
                      $(WRF_SRC_ROOT_DIR)/external/RSL_LITE/librsl_lite.a \

$(WRF_SRC_ROOT_DIR)/frame/module_internal_header_util.o \
                      $(WRF_SRC_ROOT_DIR)/frame/pack_utils.o

 LIB_EXTERNAL    = \
                      -L$(WRF_SRC_ROOT_DIR)/external/io_netcdf -lwrfio_nf
-L/home/gianlu/software/netcdf-4.3.3.1/netcdf/lib -lnetcdff -lnetcdf
 -L$(WRF_SRC_ROOT_DIR)/external/io_pnetcdf -lwrfio_pnf
-L/home/gianlu/software/parallel-netcdf-1.6.1/pnetcdf/lib -lpnetcdf

LIB             =    $(LIB_BUNDLED) $(LIB_EXTERNAL) $(LIB_LOCAL)
$(LIB_WRF_HYDRO) $(NETCDF4_DEP_LIB)
LDFLAGS         =    $(OMP) $(FCFLAGS) $(LDFLAGS_LOCAL)
ENVCOMPDEFS     =
WRF_CHEM = 0
CPPFLAGS        =    $(ARCHFLAGS) $(ENVCOMPDEFS) -I$(LIBINCLUDE) $(TRADFLAG)
NETCDFPATH      =    /home/gianlu/software/netcdf-4.3.3.1/netcdf
PNETCDFPATH     =    /home/gianlu/software/parallel-netcdf-1.6.1/pnetcdf

bundled:  io_only
external: io_only $(WRF_SRC_ROOT_DIR)/external/RSL_LITE/librsl_lite.a
gen_comms_rsllite module_dm_rsllite $(ESMF_TARGET)
io_only:  esmf_time wrfio_nf wrfio_pnf  \
 wrf_ioapi_includes wrfio_grib_share wrfio_grib1 wrfio_int fftpack


######################
------------------------------------------------------------------------
Settings listed above are written to configure.wrf.
If you wish to change settings, please edit that file.
If you wish to change the default options, edit the file:
     arch/configure_new.defaults


Testing for NetCDF, C and Fortran compiler

This installation of NetCDF is 64-bit
                 C compiler is 64-bit
           Fortran compiler is 64-bit
              It will build in 64-bit



************************** W A R N I N G
************************************

There are some Fortran 2003 features in WRF that your compiler does not
recognize
The IEEE signaling call has been removed.  That may not be enough.

*****************************************************************************
/home/gianlu/software/netcdf-4.3.3.1/netcdf
************************** W A R N I N G
************************************
NETCDF4 IO features are enabled, but this installation of NetCDF
  /home/gianlu/software/netcdf-4.3.3.1/netcdf
sounds like DO NOT support these IO features.

Please make sure NETCDF version is 4.1.3 or later and was built with
--enable-netcdf4

OR unset NETCDF4 variable
   bash/ksh : unset    NETCDF4
        csh : unsetenv NETCDF4

Then re-run this configure script

!!! configure.wrf WAS REMOVED !!!

*****************************************************************************



On Mon, Nov 30, 2015 at 12:00 PM, Tabish Ansari <tabishumaransari at gmail.com>
wrote:

> Hi
>
> Could you do EXACTLY as mentioned in the tutorial below and then see if
> you have more success:
> http://www2.mmm.ucar.edu/wrf/OnLineTutorial/compilation_tutorial.php#STEP1
>
> bests,
>
> Tabish
>
> Tabish U Ansari
> PhD student, Lancaster Environment Center
> Lancaster Univeristy
> Bailrigg, Lancaster,
> LA1 4YW, United Kingdom
>
> On 30 November 2015 at 17:32, Gianluca Meneghello <gianmail at gmail.com>
> wrote:
>
>> Hi,
>>
>> I am having some difficulties in compiling WRF using NETCDF, PNETCDF as
>> well as PHDF5 (and using PHDF5 for NETCDF). I am using MVAPICH2 as the MPI
>> implementation.
>>
>> I copy in the following the configures commands for all libraries, as
>> well as the configure for WRF. The WRF configure fails by saying that the
>> NETCDF installation does not support NETCDF4 features, despite the fact
>> that I am using the --enable-netcdf-4 flag when compiling netcdf. All
>> libraries are working correctly according to their make check command
>>
>> Please do not hesitate to ask if you need more information. Thanks in
>> advance for any suggestion,
>>
>> Gianluca
>>
>> -------
>>
>> The configure step for the libraries are (executed in order, each one
>> followed by make, make check, make install)
>>
>> -- HDF5
>> CC=mpicc FC=mpif90 ./configure --enable-parallel --prefix=${H5DIR}
>>
>> -- PNETCDF
>> MPICC=mpicc MPICXX=mpic++ MPIF77=mpif77 MPIF90=mpif90 ./configure
>> --prefix=${PNDIR}
>>
>> -- NETCDF-C
>> CC=mpicc CPPFLAGS="-I${H5DIR}/include -I${PNDIR}/include"
>> LDFLAGS="-L${H5DIR}/lib -L${PNDIR}/lib" ./configure --disable-shared
>> --enable-pnetcdf --enable-parallel-tests --prefix=${NCDIR}
>> *--enable-netcdf-4*
>>
>> -- NETCDF-FORTRAN
>> CC=mpicc FC=mpif90 CPPFLAGS="-I${NCDIR}/include -I${H5DIR}/include"
>> LD_LIBRARY_PATH=${H5DIR}/lib:${NCDIR}/lib:${LD_LIBRARY_PATH}
>> LDFLAGS="-L${H5DIR}/lib -L${NCDIR}/lib -lnetcdf" ./configure
>> --disable-shared --prefix=$NFDIR
>>
>> The configure step for WRF is
>> export NETCDF4=1
>> export NETCDF=${NCDIR}
>> export PNETCDF=${PNDIR}
>> export PHDF5=${H5DIR}
>> export WRFIO_NCD_LARGE_FILE_SUPPORT=1
>> ./configure
>>
>> but the configure step fails saying that the NETCDF installation does not
>> support netcdf4, despite the *--enable--netcdf-4* flag in the
>> compilation of NETCDF-C
>> ************************** W A R N I N G ****************************
>> NETCDF4 IO features are enabled, but this installation of NetCDF
>>   /home/gianlu/software/netcdf-4.3.3.1/netcdf
>> sounds like DO NOT support these IO features.
>>
>> Please make sure NETCDF version is 4.1.3 or later and was built with
>> --enable-netcdf4
>>
>> OR unset NETCDF4 variable
>>    bash/ksh : unset    NETCDF4
>>         csh : unsetenv NETCDF4
>>
>> Then re-run this configure script
>>
>> !!! configure.wrf WAS REMOVED !!!
>>
>> *********************************************************************
>>
>>
>>
>> _______________________________________________
>> Wrf-users mailing list
>> Wrf-users at ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/wrf-users
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/wrf-users/attachments/20151130/f5895085/attachment-0001.html 


More information about the Wrf-users mailing list