Error when reproducing examples/COUPLE/simple - 31Mar17 release

Hello all,

When I attempted to compile the example provided in examples/COUPLE/simple/simple.cpp as follows:

mpicxx -I/usr/local/lammps-31Mar17/src -L/usr/local/lammps-31Mar17/src simple.cpp -llammps_mpi -ldl -o simpleCC

I encountered the following error:

simple.cpp:156:49: error: too few arguments to function ‘void lammps_create_atoms(void*, int, int*, int*, double*, double*, int*, int)’
lammps_create_atoms(lmp,natoms,NULL,type,x,v);

In file included from simple.cpp:30:0:
/usr/local/lammps-31Mar17/src/library.h:62:6: note: declared here
void lammps_create_atoms(void *, int, int *, int *,

I would like to note that:

  1. I did not modify any of the source files or simple.cpp in any way, and I re-downloaded this release and attempted the compilation again with no luck.
  2. I used the very same command to successfully compile simple.cpp in a previous release of LAMMPS (30Jul16).

I then decided to take a look at library.h, where I discovered that the lammps_create_atoms command does in fact require many more arguments (eight) than are provided to it in simple.cpp (six):

void lammps_create_atoms(void *, int, int *, int *, double *, double *, int *, int);

Has anyone had a similar issue that they’ve been able to resolve with simple.cpp?

Thank you for your time,
Easun

The lammps_create_atoms() command was added to library.cpp a few

months ago. It wasn’t in the 30Jul16 release or in simple.cpp at that point.

As such, it has gone thru a few upgrades since it was added. It looks

like simple.cpp did not stay current with the new API.

I think you can just add two args: NULL,0 to make this line in simple.cpp

lammps_create_atoms(lmp,natoms,NULL,type,x,v,NULL,0);

and it should work.

Will need to test it and include in the next patch …

Thanks,

Steve

Dear Steve,

Thanks very much for your suggestion - it worked perfectly!

Many thanks,
Easun