NetCDF setup

From GPUMD
Jump to navigation Jump to search

NetCDF Setup Instructions

To use NetCDF with GPUMD, a few extra steps must be taken before building GPUMD. First, you must download and install the correct version of NetCDF. Currently, GPUMD was coded to work with netCDF-C 4.6.3 and it is recommended that this version is used (not newer versions). The setup instructions are below:

  1. Download netCDF-C 4.6.3
  2. Configure and build NetCDF. It is best to follow the instructions included with the software but, for the configuration, please use the following flags seen in our example line:
    ./configure --prefix=/home/alex/netcdf --disable-netcdf-4 --disable-dap
    Here the --prefix determines the output directory of the build.
  3. Enable the NetCDF functionality. To do this, one must enable the USE_NETCDF flag. In the makefile, this will look like:
    CFLAGS = -std=c++11 -O3 -arch=sm_75 -DUSE_NETCDF
    In addition to that line the makefile must also be updated to the following:
    INC = -I/home/alex/netcdf/include
    LDFLAGS = -L/home/alex/netcdf/lib
    LIBS = -l:libnetcdf.a
    where the /home/alex/ should be replaced with the installation path for NetCDF (defined in --prefix for ./configure command).
  4. Follow the remaining GPUMD installation instructions

Following these steps will enable the dump_netcdf keyword.