使用MPICXX时,由于_noalias引起的OpenMPI失败

Build failure of OpenMPI due to _noalias when using mpicxx

本文关键字:OpenMPI 失败 noalias MPICXX 由于 使用      更新时间:2023-10-16

我试图用较新版本的11aug17在我的百台计算机上安装lammps。但是,MPICXX给出以下几行错误:

mpicxx -g -O3   -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1   -I/home/shixx597/codes/kim-api-v1.7.3/lib/kim-api-v1/include  -c ../pair_list.cpp
../pair_list.cpp(88): error: expected a ";"
    const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0];
                            ^
../pair_list.cpp(89): error: "restrict" has already been declared in the current scope
    dbl3_t * _noalias const f = (dbl3_t *) atom->f[0];
             ^
../pair_list.cpp(89): error: expected a ";"
    dbl3_t * _noalias const f = (dbl3_t *) atom->f[0];
                      ^
../pair_list.cpp(114): error: identifier "x" is undefined
      const double dx = x[i].x - x[j].x;
                        ^
../pair_list.cpp(160): error: identifier "f" is undefined
          f[i].x += dx*fpair;
          ^
../pair_list.cpp(166): error: identifier "f" is undefined
          f[j].x -= dx*fpair;
          ^
compilation aborted for ../pair_list.cpp (code 2)
make[1]: *** [pair_list.o] Error 2
make[1]: Leaving directory `/home/shixx597/codes/lammps-11Aug17/src/Obj_mpi'
make: *** [mpi] Error 2

我的同事告诉我,这是OpenMPI的问题。因此,我试图为我安装新的OpenMPI。但是,我收到以下错误告诉我,自动制品不是这样安装的:

 cd . && /bin/sh /home/shixx597/codes/openmpi-3.0.0/config/missing automake-1.15 --foreign
/home/shixx597/codes/openmpi-3.0.0/config/missing: line 81: automake-1.15: command not found
WARNING: 'automake-1.15' is missing on your system.
         You should only need it if you modified 'Makefile.am' or
         'configure.ac' or m4 files included by 'configure.ac'.
         The 'automake' program is part of the GNU Automake package:
         <http://www.gnu.org/software/automake>
         It also requires GNU Autoconf, GNU m4 and Perl in order to run:
         <http://www.gnu.org/software/autoconf>
         <http://www.gnu.org/software/m4/>
         <http://www.perl.org/>
make: *** [Makefile.in] Error 1
When I tried to install automake-1.15, I get the following error:
CDPATH="${ZSH_VERSION+.}:" && cd . && "/home/shixx597/codes/automake-1.15/t/wrap/aclocal-1.15" 
Can't locate /home/shixx597/codes/automake-1.15/bin/aclocal in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /home/shixx597/codes/automake-1.15/t/wrap/aclocal-1.15 line 29.
make: *** [aclocal.m4] Error 2

我没有任何Sudo特权在这台怪异的部门机器上做任何事情。

即使我试图完成部门机器上安装lammps,我想知道我是否可以完成大型粘合力场模型的运行。

实际上,这是一个相当众所周知的问题,有三个解决方案。

  1. 使用GCC而不是英特尔编译器(可能不是理想的)。
  2. 在编译时使用-restrict标志(我假设运行时通过附加添加它,例如make CXX_FLAGS=-restrict
  3. 只需从构建中删除这两个文件即可。

如果您真的想尝试,也可以尝试使用两个有问题的文件中的SED或尴尬删除_noalias关键字:pair_list.hpair_list.cpp,或者只是将_noalias定义为空的关键字,如jww在注释中所建议的那样。