Creating an Environment Variable File
Procedure
- Use PuTTY to log in to the server as the root user.
- Run the following command to create the env.sh environment variable file:
- Create env.sh.
vi /root/env.sh
- 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
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Create env.sh.
- Run the following command to make the configuration file take effect:
source /root/env.sh
Parent topic: Configuring the Compilation Environment