|
感谢您的耐心解答,切gcc-toolset-12确实就解决问题了。Rocky9.3的gcc版本切换真是迷之错误。
后续想问您一下,您后续基于aocc,aocl + openmpi编译VASP是否出现关于以下gfortran相关的问题?
gfortran: error: unrecognized command-line option ‘-fno-fortran-main’
gfortran: error: unrecognized command-line option ‘-Mbackslash’; did you mean ‘-fbackslash’?
make[2]: *** [makefile:167: c2f_interface.o] Error 1
make[2]: Leaving directory '/opt/vasp.6.4.2/build/std'
cp: cannot stat 'vasp': No such file or directory
make[1]: *** [makefile:129: all] Error 1
make[1]: Leaving directory '/opt/vasp.6.4.2/build/std'
make: *** [makefile:17: std] Error 2
我搜索相关信息,本论坛和VASP论坛里有提到类似错误可能是环境变量问题导致mpif90用的不是aocc指向的mpif90。我的环境变量配置完成后,“which mpif90"和”mpif90 -show“的输出都指向了openmpi的安装位置,但是“mpif90 -v”指向了gfortran的安装位置,不知道是不是配置问题?感觉按照各类教程mpif90的环境变量设置应该是生效的。
以下是我各命令输出情况:
- $ which mpif90
- /opt/openmpi-5.0.3/bin/mpif90
- $ mpif90 -show
- gfortran -I/opt/openmpi-5.0.3/include -I/opt/openmpi-5.0.3/lib -L/opt/openmpi-5.0.3/lib -Wl,-rpath -Wl,/opt/openmpi-5.0.3/lib -Wl,--enable-new-dtags -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi
- $ mpif90 -v
- Using built-in specs.
- COLLECT_GCC=/opt/rh/gcc-toolset-12/root/usr/bin/gfortran
- COLLECT_LTO_WRAPPER=/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/lto-wrapper
- OFFLOAD_TARGET_NAMES=nvptx-none
- OFFLOAD_TARGET_DEFAULT=1
- Target: x86_64-redhat-linux
- Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/gcc-toolset-12/root/usr --mandir=/opt/rh/gcc-toolset-12/root/usr/share/man --infodir=/opt/rh/gcc-toolset-12/root/usr/share/info --with-bugurl=https://bugs.rockylinux.org/ --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-libstdcxx-backtrace --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-12.2.1-20221121/obj-x86_64-redhat-linux/isl-install --enable-offload-targets=nvptx-none --without-cuda-driver --enable-offload-defaulted --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_64=x86-64-v2 --with-arch_32=x86-64 --build=x86_64-redhat-linux --with-build-config=bootstrap-lto --enable-link-serialization=1
- Thread model: posix
- Supported LTO compression algorithms: zlib zstd
- gcc version 12.2.1 20221121 (Red Hat 12.2.1-7) (GCC)
复制代码 |
|