Compilation error in user-misc

Dear developers,

I have a compilation error using the user-misc package:

[[email protected]]$make yes-manybody
Installing package manybody

[[email protected]]$make yes-misc
Installing package misc

[[email protected]]$make yes-user-misc
Installing package user-misc

[[email protected]]$ make -j6 mpi

mpicxx -g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c ../atom.cpp
[...]
mpicxx -g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c ../fix_restrain.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;
    ^

This seems to be due to a recent change as I already compile on the same environment the version of lammps last year.
This error do not appear with only manybody and misc packages

Compilators: mpi/openmpi/1.8.8

Thanks for all

Antoine Jay

Dear developers,

I have a compilation error using the user-misc package:

[[email protected]]$make yes-manybody
Installing package manybody

[[email protected]]$make yes-misc
Installing package misc

[[email protected]]$make yes-user-misc
Installing package user-misc

[[email protected]]$ make -j6 mpi

mpicxx -g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c ../atom.cpp
[...]
mpicxx -g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c ../fix_restrain.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;
        ^

This seems to be due to a recent change as I already compile on the same environment the version of lammps last year.
This error do not appear with only manybody and misc packages

Compilators: mpi/openmpi/1.8.8

you didn't specify the actual compiler that is called by mpicxx, but
it is obviously the intel compilers.
for intel compilers, the "-restrict" flag is *required*.

axel.

Yes, this error must be an intel error as a compilation with g++ does not create errors.

However, even if adding -restrict in the MAKE/Makefile.mpi
CCFLAGS = -g -O3 -restrict
does not create compilation errors,
a simple TTM example does not work.

I wonder if I added the -restrict in the good place, or if some other flags are missing or incompatible???

Thanks for all

Antoine Jay

example_Si_TTM.tar.gz (20.8 KB)

Yes, this error must be an intel error as a compilation with g++ does not create errors.

However, even if adding -restrict in the MAKE/Makefile.mpi
CCFLAGS = -g -O3 -restrict
does not create compilation errors,
a simple TTM example does not work.

"does not work" how?

did you apply the patch that i sent out earlier removing the excess
fclose() call in fix_ttm_mod.cpp?

BTW: this is not a "simple" example, this *huge* (over a million
atoms), and thus impossible to test/debug.

please also remember, that you are using fix ttm/mod and not ttm. you
need to mention that, as that makes a big difference when looking for
problems.

I wonder if I added the -restrict in the good place, or if some other flags are missing or incompatible???

i cannot answer that without knowing more details (including platform,
exact version of LAMMPS, detailed description of the error message or
how to reproduce the error).
please have a look at the "10 commandments" for posting to the mailing
list. http://lammps.sandia.gov/guidelines.html

axel.