我要评分
获取效率
正确性
完整性
易理解

Creating an Environment Variable File

Procedure

  1. Use PuTTY to log in to the server as the root user.
  2. Run the following command to create the env.sh environment variable file:
    1. Create env.sh.
      vi /root/env.sh
    2. Press i to enter the insert mode and edit the env.sh file.
      #!/bin/bash
      export GNU_HOME=/path/to/GNU
      export MPI_HOME=/path/to/OPENMPI 
      export HDF5=/path/to/HDF5
      export PNETCDF=/path/to/PNETCDF
      export NETCDF=/path/to/NETCDF 
      export PHDF5=$HDF5
      export CPPFLAGS=" -I$HDF5/include -I$PNETCDF/include -I$NETCDF/include -I$MPI_HOME/include "
      export CFLAGS=" -I$HDF5/include -I$PNETCDF/include -I$NETCDF/include -I$MPI_HOME/include "
      export CXXFLAGS=" -I$HDF5/include -I$PNETCDF/include -I$NETCDF/include -I$MPI_HOME/include "
      export FCFLAGS=" -I$HDF5/include -I$PNETCDF/include"
      export FFLAGS=" -I$HDF5/include -I$PNETCDF/include"
      export LDFLAGS=" -L$HDF5/lib -L$PNETCDF/lib -L$NETCDF/lib"
      export LD_LIBRARY_PATH=$HDF5/lib:$PNETCDF/lib:$NETCDF/lib:$MPI_HOME/lib: $GNU_HOME/lib64:$LD_LIBRARY_PATH
      export PATH=$NETCDF/bin:$PNETCDF/bin:$MPI_HOME/bin:$GNU_HOME/bin:$PATH
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  3. Run the following command to make the configuration file take effect:
    source /root/env.sh