PnetCDF and NetCDF installation

Wei-keng Liao wkliao at eecs.northwestern.edu
Fri Nov 22 13:12:54 CST 2019


Hi, Majun

Questions related to PnetCDF can be asked by sending emails to
  parallel-netcdf at mcs.anl.gov
However, a subscription to the mailing list is required. Please
subscribe from URL below
  https://lists.mcs.anl.gov/mailman/listinfo/parallel-netcdf

As for the problem you are encountering, I have a few suggestions below.

I recommend to use the latest version of PnetCDF 1.12.0,
NetCDF-C 4.7.2, NetCDF-Fortran 4.5.2, and HDF5 1.10.5.
The official releases of these software can be downloaded from:
https://parallel-netcdf.github.io/wiki/Download.html
https://www.unidata.ucar.edu/downloads/netcdf/index.jsp
https://www.hdfgroup.org/downloads/hdf5/

Below are the suggested configure commands.

For PnetCDF 1.12.0
./configure --prefix=$PNETCDF_DIR \
            MPICC=mpicc MPICXX=mpicxx MPIF77=mpifort MPIF90=mpifort


For HDF5 1.10.5
./configure --prefix=$HDF5_DIR \
            --disable-fortran \
            --disable-cxx \
            --disable-shared \
            --enable-parallel=yes \
            CC=mpicc

For NetCDF-C 4.7.2
./configure —prefix=$NETCDF_C_DIR \
            --enable-pnetcdf \
            --disable-shared \
            CC=mpicc \
            CPPFLAGS="-I$HDF5_DIR/include -I$PNETCDF_DIR/include" \
            LDFLAGS="-L$HDF5_DIR/lib -L$PNETCDF_DIR/lib" \
            LIBS="-lhdf5_hl -lhdf5 -ldl -lm -lz"

For NetCDF-Fortran 4.5.2
./configure --prefix=$NETCDF_F_DIR \
            --disable-shared \
            CC=mpicc FC=mpifort \
            CPPFLAGS="-I$NETCDF_C_DIR/include -I$HDF5_DIR/include -I$PNETCDF_DIR/include" \
            LDFLAGS="-L$NETCDF_C_DIR/lib -L$HDF5_DIR/lib -L$PNETCDF_DIR/lib" \
            LIBS="-lnetcdf -lhdf5_hl -lhdf5 -lpnetcdf -ldl -lm -lz"

You can set the same or separate locations for all the environment variables:
PNETCDF_DIR, HDF5_DIR, NETCDF_C_DIR, NETCDF_F_DIR
 
Wei-keng

> On Nov 22, 2019, at 8:17 AM, Alok Choudhary <alokchoudhary01 at gmail.com> wrote:
> 
> Regards
> 
> Alok N. Choudhary
> Founder and chairman, 4C insights
> Dever  Professor, EECS
> M 312-515-2562
> Northwestern University
> -------------------Sent from my mobile - pardon typooos
> 
> Begin forwarded message:
> 
>> From: 马俊 <majun123 at whu.edu.cn>
>> Date: November 22, 2019 at 9:13:38 AM EST
>> To: choudhar at eecs.northwestern.edu
>> Subject: Ask about pnetcdf-1.8.1 installation
>> 
>> Dear Professer Choudhary,
>>  I'm  a user of Pnetcdf and netcdf to be used of CESM2/clm5.0. It seems not to work after the installation of pnetcdf:
>> First, I change the bashrc file as follows:
>> export CC=mpicc
>> export CXX=mpicxx
>> export FC=mpif90
>> export F77=mpif90 
>> Then:
>> ./configure --prefix=/home/shenhf/majun/pnetcdf-1.8.1 
>> make &make install
>> Finally, add it to the environmental variables:
>> export PATH=/home/shenhf/majun/setup/pnetcdf-1.8.1/bin:/home/shenhf/majun/setup/pnetcdf-1.8.1/include:$PATH
>> export LD_LIBRARY_PATH=/home/shenhf/majun/setup/pnetcdf-1.8.1/lib:$LD_LIBRARY_PATH
>> export MANPATH=$MANPATH:/home/shenhf/majun/setup/pnetcdf-1.8.1/share/man
>> 
>> Next, I installed netcdf-c-4.6.2(CPPFLAGS="-I/usr/local/zlib/include -I/home/shenhf/majun/setup/hdf5-1.8.20/include" LDFLAGS="-L/usr/local/zlib/lib -L/home/shenhf/majun/setup/hdf5-1.8.20/lib" ./configure --prefix=/home/shenhf/majun/setup/netcdf --disable-dap --disable-netcdf-4 --enable-pnetcdf). "make check" shows it all pass the test, "make install” shows netcdf-c has been successfully installed, however,it shows:
>>  --has-pnetcdf   -> no
>> Finally, I installed netcdf-fortran-4.4.4(export LD_LIBRARY_PATH=/home/shenhf/majun/setup/netcdf/lib:$LD_LIBRARY_PATH, CPPFLAGS="-I/usr/local/zlib/include -I/home/shenhf/majun/setup/hdf5-1.8.20/include -I/home/shenhf/majun/setup/netcdf/include" LDFLAGS="-L/usr/local/zlib/lib -L/home/shenhf/majun/setup/hdf5-1.8.20/lib -L/home/shenhf/majun/setup/netcdf/lib" ./configure --prefix=/home/shenhf/majun/setup/netcdf)
>> 
>> My software versions are:
>> centos6
>> gcc-8.3.0
>> HDF5-1-8-20
>> mpich-3.3.1
>> netcdf-c-4.6.2
>> fortran-4.4.4
>> I wonder where was wrong and want to ask what's the right way to install pnetcdf and netcdf. I saw one sentence called "Pnetcdf is enabled by setting the $PNETCDF_PATH Makefile variable in the Macros.make file." 
>> But I don't know how to modify it. Any help or suggestions is highly appreciated.
>> 
>> 
>> ------------------------------
>> --
>> Thanks for your attention...
>> -- 
>> Best Regards,
>> 
>> 马俊
>> SENDIMAGE,武汉大学资源与环境科学学院
>> 湖北省武汉市珞喻路129号, 430079
>> Email: majun123 at whu.edu.cn/majuntiancai at yahoo.com
>> Jun Ma, PHD Candidate
>> School of Resource and Environmental Sciences,
>> Wuhan University, Wuhan 430079, China



More information about the parallel-netcdf mailing list