Using setvars.sh
HPCKit supports loading environment variables using setvars.sh or modules. setvars.sh loads all environment variables for your chosen compiler at once. You are advised to use this method to load all required environment variables.
Procedure
- Use PuTTY to log in to the node where HPCKit is installed.
- Run the following command to go to the HPCKit installation directory:
cd /opt/HPCKit/latest
/opt: default installation directory of HPCKit. Replace it with the actual directory.
- Run the following command to configure environment variables:
source setvars.sh Option
By default, this command configures the environment variables for components using BiSheng Compiler.
Option is optional. For details, see Table 1.
Table 1 Options Option
Value
Description
--use-gcc
N/A
This option can be added to specify the environment variables for components using GCC.
--kml_kblas
locking
Adds the path of the KML kblas single-threaded locked dynamic library to environment variable LD_LIBRARY_PATH.
nolocking
Adds the path of the KML kblas single-threaded unlocked dynamic library to environment variable LD_LIBRARY_PATH.
multi (default)
Adds the path of the KML kblas multi-threaded dynamic library to environment variable LD_LIBRARY_PATH.
--kml_kspblas
multi (default)
Adds the path of the KML kspblas multi-threaded dynamic library to environment variable LD_LIBRARY_PATH.
single
Adds the path of the KML kspblas single-threaded dynamic library to environment variable LD_LIBRARY_PATH.
--kml_kvml
multi
Adds the path of the KML kvml multi-threaded dynamic library to environment variable LD_LIBRARY_PATH.
single (default)
Adds the path of the KML kvml single-threaded dynamic library to environment variable LD_LIBRARY_PATH.
--hmpi_mode
release (default)
Adds the installation directory, header file, library, and dynamic library paths of the HMPI release version to environment variables OPAL_PREFIX, INCLUDE, LIBRARY_PATH, and LD_LIBRARY_PATH.
debug
Adds the installation directory, header file, library, and dynamic library paths of the HMPI debug version to environment variables OPAL_PREFIX, INCLUDE, LIBRARY_PATH, and LD_LIBRARY_PATH.
--kupl_mode
release (default)
Adds the C library, library, and dynamic library paths of the KUPL release version to environment variables CPATH, LIBRARY_PATH, and LD_LIBRARY_PATH.
prof
Adds the C library, library, and dynamic library paths of the KUPL profile version to environment variables CPATH, LIBRARY_PATH, and LD_LIBRARY_PATH.
--reset
N/A
Cancels the environment variables added by running the setvars.sh script.
--help
N/A
View the help information of the source setvars.sh Option command.
Each time the source setvars.sh command is executed, the values for kml_kblas, kml_kspblas, and kml_kvml are reset to their default settings (see Table 1). To retain non-default settings, change the values accordingly. Examples:
- When switching from BiSheng Compiler to GCC, if you want to retain the non-default value of kml_kblas (for example, locking), run the following command:
source setvars.sh --use-gcc --kml_kblas=locking
- To modify a single option among kml_kblas, kml_kspblas, and kml_kvml while retaining the non-default values of the others, run the following command:
source setvars.sh --kml_kvml=multi --kml_kspblas=single
- If an option is assigned multiple values in the source setvars.sh command, the last value takes effect. For example, in the following command, kml_kblas will ultimately be set to nolocking.
source setvars.sh --use-gcc --kml_kblas=multi --kml_kblas=nolocking
- When switching from BiSheng Compiler to GCC, if you want to retain the non-default value of kml_kblas (for example, locking), run the following command:
- Query environment variables.
- When using BiSheng Compiler to compile components:
echo $LD_LIBRARY_PATH; echo $PATH; echo $CPATH; echo $INCLUDE; echo $OPAL_PREFIX; echo $CC; echo $CXX; echo $FC; echo $F77; echo $F90;echo $HIO_HOME
The environment variables are described as follows:
- LD_LIBRARY_PATH: search path for dynamic link libraries.
- PATH: search path for executable programs.
- CPATH: path to the header files of the KML, KuTACC, KuRTM, KuQCD, KUPL, KuLitho, and KuDNN components.
- INCLUDE: header file paths for KuTACC, KuRTM, KuQCD, KUPL, KuLitho, KuDNN, the hmpi, hucx, and xucg components within HMPI, as well as the KML component.
- OPAL_PREFIX: installation directory of the hmpi component in HMPI.
- CC: name of the compiler for compiling C programs. The value is clang.
- CXX: name of the compiler for compiling C++ programs. The value is clang++.
- FC: name of the compiler for compiling Fortran programs. The value is flang.
- F77: name of the compiler for compiling Fortran77 programs. The value is flang.
- F90: name of the compiler for compiling Fortran90 programs. The value is flang.
- HIO_HOME: installation path of HIO.
Example command output:
1 2 3 4 5 6 7 8 9 10 11
/opt/HPCKit/26.1.RC1/kutacc/bisheng/lib:/opt/HPCKit/26.1.RC1/kurtm/bisheng/lib:/opt/HPCKit/26.1.RC1/kupl/bisheng/release/lib:/opt/HPCKit/26.1.RC1/kudnn/bisheng/lib:/opt/HPCKit/26.1.RC1/kuqcd/bisheng/lib:/opt/HPCKit/26.1.RC1/kml/bisheng/lib/neon:/opt/HPCKit/26.1.RC1/kml/bisheng/lib/noarch:/opt/HPCKit/26.1.RC1/kml/bisheng/lib/noarch/kvml/single:/opt/HPCKit/26.1.RC1/kml/bisheng/lib/neon/kspblas/multi:/opt/HPCKit/26.1.RC1/kml/bisheng/lib/neon/kblas/multi:/opt/HPCKit/26.1.RC1/kml/bisheng/lib:/opt/HPCKit/26.1.RC1/hmpi/bisheng/release/hmpi/lib:/opt/HPCKit/26.1.RC1/hmpi/bisheng/release/hucx/lib:/opt/HPCKit/26.1.RC1/hmpi/bisheng/release/xucg/lib:/opt/HPCKit/26.1.RC1/compiler/bisheng/lib: /opt/HPCKit/26.1.RC1/hmpi/bisheng/release/hmpi/bin:/opt/HPCKit/26.1.RC1/hmpi/bisheng/release/hucx/bin:/opt/HPCKit/26.1.RC1/hmpi/bisheng/release/xucg/bin:/opt/HPCKit/26.1.RC1/compiler/bisheng/bin:/usr/share/Modules/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin /opt/HPCKit/26.1.RC1/kutacc/bisheng/include:/opt/HPCKit/26.1.RC1/kurtm/bisheng/include:/opt/HPCKit/26.1.RC1/kupl/bisheng/release/include:/opt/HPCKit/26.1.RC1/kudnn/bisheng/include:/opt/HPCKit/26.1.RC1/kuqcd/bisheng/include:/opt/HPCKit/26.1.RC1/kml/bisheng/include: /opt/HPCKit/26.1.RC1/kutacc/bisheng/include:/opt/HPCKit/26.1.RC1/kurtm/bisheng/include:/opt/HPCKit/26.1.RC1/kupl/bisheng/release/include:/opt/HPCKit/26.1.RC1/kudnn/bisheng/include:/opt/HPCKit/26.1.RC1/kuqcd/bisheng/include:/opt/HPCKit/26.1.RC1/kml/bisheng/include:/opt/HPCKit/26.1.RC1/hmpi/bisheng/release/hmpi/include:/opt/HPCKit/26.1.RC1/hmpi/bisheng/release/hucx/include:/opt/HPCKit/26.1.RC1/hmpi/bisheng/release/xucg/include: /opt/HPCKit/26.1.RC1/hmpi/bisheng/release/hmpi clang clang++ flang flang flang /opt/HPCKit/26.1.RC1/hio
- When using GCC to compile components:
echo $LD_LIBRARY_PATH; echo $PATH; echo $CPATH; echo $INCLUDE; echo $OPAL_PREFIX; echo $CC; echo $CXX; echo $FC; echo $F77; echo $F90; echo $HIO_HOME
The environment variables are described as follows:
- LD_LIBRARY_PATH: search path for dynamic link libraries.
- PATH: search path for executable programs.
- CPATH: path to the header files of the KML, KuRTM, KuQCD, KUPL, KuLitho, and KuDNN components.
- INCLUDE: header file paths for KuRTM, KuQCD, KUPL, KuLitho, KuDNN, the hmpi, hucx, and xucg components within HMPI, as well as the KML component.
- OPAL_PREFIX: installation directory of the hmpi component in HMPI.
- CC: name of the compiler for compiling C programs. The value is gcc.
- CXX: name of the compiler for compiling C++ programs. The value is g++.
- FC: name of the compiler for compiling Fortran programs. The value is gfortran.
- F77: name of the compiler for compiling Fortran77 programs. The value is gfortran.
- F90: name of the compiler for compiling Fortran90 programs. The value is gfortran.
- HIO_HOME: installation path of HIO.
Example command output:
1 2 3 4 5 6 7 8 9 10 11
/opt/HPCKit/26.1.RC1/kurtm/gcc/lib:/opt/HPCKit/26.1.RC1/kupl/gcc/release/lib:/opt/HPCKit/26.1.RC1/kudnn/gcc/lib:/opt/HPCKit/26.1.RC1/kuqcd/gcc/lib:/opt/HPCKit/26.1.RC1/kuqcd/gcc/lib:/opt/HPCKit/26.1.RC1/kml/gcc/lib/neon:/opt/HPCKit/26.1.RC1/kml/gcc/lib/noarch:/opt/HPCKit/26.1.RC1/kml/gcc/lib/noarch/kvml/single:/opt/HPCKit/26.1.RC1/kml/gcc/lib/neon/kspblas/multi:/opt/HPCKit/26.1.RC1/kml/gcc/lib/neon/kblas/multi:/opt/HPCKit/26.1.RC1/kml/gcc/lib:/opt/HPCKit/26.1.RC1/hmpi/gcc/release/hmpi/lib:/opt/HPCKit/26.1.RC1/hmpi/gcc/release/hucx/lib:/opt/HPCKit/26.1.RC1/hmpi/gcc/release/xucg/lib:/opt/HPCKit/26.1.RC1/compiler/gcc/lib64:/opt/HPCKit/26.1.RC1/compiler/gcc/lib64_public: /opt/HPCKit/26.1.RC1/hmpi/gcc/release/hmpi/bin:/opt/HPCKit/26.1.RC1/hmpi/gcc/release/hucx/bin:/opt/HPCKit/26.1.RC1/hmpi/gcc/release/xucg/bin:/opt/HPCKit/26.1.RC1/compiler/gcc/bin:/usr/share/Modules/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin /opt/HPCKit/26.1.RC1/kurtm/gcc/include:/opt/HPCKit/26.1.RC1/kupl/gcc/release/include:/opt/HPCKit/26.1.RC1/kudnn/gcc/include:/opt/HPCKit/26.1.RC1/kuqcd/gcc/include:/opt/HPCKit/26.1.RC1/kml/gcc/include: /opt/HPCKit/26.1.RC1/kurtm/gcc/include:/opt/HPCKit/26.1.RC1/kupl/gcc/release/include:/opt/HPCKit/26.1.RC1/kudnn/gcc/include:/opt/HPCKit/26.1.RC1/kuqcd/gcc/include:/opt/HPCKit/26.1.RC1/kml/gcc/include:/opt/HPCKit/26.1.RC1/hmpi/gcc/release/hmpi/include:/opt/HPCKit/26.1.RC1/hmpi/gcc/release/hucx/include:/opt/HPCKit/26.1.RC1/hmpi/gcc/release/xucg/include: /opt/HPCKit/26.1.RC1/hmpi/gcc/release/hmpi gcc g++ gfortran gfortran gfortran /opt/HPCKit/26.1.RC1/hio
- When using BiSheng Compiler to compile components: