0

I tried to install lammps on my department machine with a newer version of 11Aug17. However, mpicxx gives error to the following lines:

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

My colleagues told me that it is the problem of openmpi. So I tried to install a new openmpi for me. However, I get the following error told me that automake is not installed like this:

 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

I do not have any sudo privilege to do anything on this weird department machine.

Even I tried to finish installing lammps on the departmental machine, I am wondering if I could finish the run of a large bonded force field model.

Zulu
  • 8,765
  • 9
  • 49
  • 56
  • If I had to guess, it sounds like it isn't recognizing the `_noalias`, which is a known issue with mpicxx using an Intel compiler. Try changing to compiler to GCC if you can. You can do local installs of various compilers, to avoid needing sudo privileges. http://lammps.sandia.gov/threads/msg58203.html – Alex Huszagh Dec 25 '17 at 01:37
  • Maybe you can add `CPPFLAGS=-D_noalias`, `CFLAGS=-D_noalias` or `CXXFLAGS=-D_noalias` or similar to remove the symbol with the preprocessor. – jww Dec 25 '17 at 01:42
  • you do not need `autotools` when building Open MPI from a tarball. you likely messed up with timestamps on some critical files, and `make` believes `autotools` should be invoked again. the easiest way is to wipe out your source directory, untar the sources and then `configure && make` again. – Gilles Gouaillardet Dec 25 '17 at 01:54

1 Answers1

1

Actually, this a fairly well-known issue, and there are three solutions.

  1. Use GCC rather than an Intel compiler (possibly not desirable).
  2. Use the -restrict flag while compiling (I'm assuming by appending it when running make, like make CXX_FLAGS=-restrict
  3. Just remove those two files from the build.

If you really want to try, you could also try to remove the _noalias keyword using sed or awk from the two offending files: pair_list.h and pair_list.cpp, or just define _noalias to be an empty keyword, as suggested by jww in the comments.

Alex Huszagh
  • 13,272
  • 3
  • 39
  • 67