Skip to content

Commit

Permalink
Fixed includes for lammps-nnp, fixed dev-interface
Browse files Browse the repository at this point in the history
  • Loading branch information
philippmisof committed May 4, 2023
1 parent 6fbd9d0 commit 6eabbba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/doc/sphinx/source/interfaces/if_lammps.rst
Expand Up @@ -22,6 +22,7 @@ Automatic build
The automatic compilation will only work on Unix-like systems as it relies on
tools such as ``sed`` and ``tar``.


For convenience the main makefile provides the compilation target ``lammps-nnp``
which will automatically download LAMMPS (version ``stable_3Mar2020`` from the
`GitHub releases page <https://github.com/lammps/lammps/releases>`__) into the
Expand All @@ -34,7 +35,8 @@ LAMMPS with NNP support is as easy as typing
make lammps-nnp
in the n2p2 ``src`` directory. Uninstall with ``make clean-lammps-nnp``.
in the n2p2 ``src`` directory. Uninstall with ``make clean-lammps-nnp``. The
automatic build requires ``wget`` to be installed.

.. note::

Expand Down
7 changes: 6 additions & 1 deletion src/interface/LAMMPS/src/USER-NNP/pair_nnp_develop.cpp
Expand Up @@ -39,7 +39,12 @@ void PairNNPDevelop::compute(int eflag, int vflag)
else evflag = vflag_fdotr = eflag_global = eflag_atom = 0;

// Set number of local atoms and add index and element.
interface.setLocalAtoms(atom->nlocal,atom->tag,atom->type);
interface.setLocalAtoms(atom->nlocal, atom->type);
// Transfer tags separately. Interface::setLocalTags is overloaded internally
// to work with both -DLAMMPS_SMALLBIG (tagint = int) and -DLAMMPS_BIGBIG
// (tagint = int64_t)
interface.setLocalTags(atom->tag);


// Also set absolute atom positions.
interface.setLocalAtomPositions(atom->x);
Expand Down
2 changes: 2 additions & 0 deletions src/interface/makefile
Expand Up @@ -53,6 +53,8 @@ lammps-nnp:
@sed -i.bak "s/^CCFLAGS .*$$/CCFLAGS = $(PROJECT_CFLAGS) $(PROJECT_CFLAGS_MPI)/" lammps-nnp/src/MAKE/Makefile.mpi
@sed -i.bak "s/^LINK .*$$/LINK = $(PROJECT_MPICC)/" lammps-nnp/src/MAKE/Makefile.mpi
@sed -i.bak "s/^LINKFLAGS .*$$/LINKFLAGS = $(PROJECT_CFLAGS) $(PROJECT_CFLAGS_MPI) $(PROJECT_LDFLAGS_BLAS)/" lammps-nnp/src/MAKE/Makefile.mpi
@sed -i.bak "/^SHLIBFLAGS/a \HDNNP_INC = -I$(PROJECT_EIGEN)" lammps-nnp/src/MAKE/Makefile.mpi
@sed -i.bak '/^EXTRA_INC/ s/$$/ $$(HDNNP_INC)/' lammps-nnp/src/MAKE/Makefile.mpi
if [ "$(MODE)" = "test" ]; then \
sed -i.bak "/^CCFLAGS =/ s/$$/ $(LAMMPS_DEBUG) $(PROJECT_TEST)/" lammps-nnp/src/MAKE/Makefile.mpi; \
sed -i.bak "/^LINKFLAGS =/ s/$$/ $(LAMMPS_DEBUG) $(PROJECT_TEST)/" lammps-nnp/src/MAKE/Makefile.mpi; \
Expand Down

0 comments on commit 6eabbba

Please sign in to comment.