1.amber中支持的编译器的类别如下,而amber编译安装文件run_cmake中的-DCOMPILER=GNU(默认),这会导致其指向系统内部安装的gnu,因此要指定我们需要的gnu,则需要在将-DCOMPILER=MANUAL(指向环境变量中的gnu)
Supported Amber compilers:
-----------------------------------------------------------------------
COMPILER value | C executable | C++ executable | Fortran executable | tested versions
--------------------------------------------------------------------------------------
GNU | gcc | g++ | gfortran | 6.0 +
INTEL | icc | icpc | ifort | 19 - 22
PGI | pgcc | pgc++ | pgf90 | 14.9, 15.4, 16.5
CLANG | clang | clang++ | gfortran |
CRAY | cc | CC | ftn | 8.4.6*
--------------------------------------------------------------------------------------
AUTO | <uses the default CMake-chosen compilers>
MANUAL | <uses the CC, CXX, and FC environment variables, or the
CMAKE_<LANGUAGE>_COMPILER CMake variables>
2.设置环境变量
vim ~/.bashrc
export PATH=/path/to/your/gnu/:$PATH