使用mpicxx时由于_noalias而导致OpenMPI构建失败

问题描述 投票:0回答:1

我试图用更新版本的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。但是,我得到以下错误告诉我,automake没有像这样安装:

 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,我想知道我是否可以完成大型粘合力场模型的运行。

c++ linux automake openmpi lammps
1个回答
1
投票

实际上,这是一个相当着名的issue,并且有三种解决方案。

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

如果你真的想尝试,你也可以尝试从两个有问题的文件中使用sed或awk删除_noalias关键字:pair_list.hpair_list.cpp,或者只是将_noalias定义为空关键字,如评论中的jww所示。

© www.soinside.com 2019 - 2024. All rights reserved.