Error: Too many elements extracted from the MEAM Library on LAMMPS

If you encounter an errors similar

ERROR: Too many elements extracted from MEAM library (current limit:5 ). Increase 'maxelt' in meam.h and recompile. 
Last command: pair_coeff     * * library.alloy2.meam .............................

Move to /usr/local/lammps-29Oct20/src/USER-MEAMC/meam.h and /usr/local/lammps-29Oct20/src/meam.h. Edit line 22. The default value is #define maxelt 5

#definte maxelt 6

Recompile the lammps. Go to /usr/local/lammps-29Oct20/src

% make clean-all
% make g++_openmpi -j 16

References

  1. Compiling LAMMPS-15Jun20 with GNU 6 and OpenMPI 3

No MEAM parameter file in pair coefficients Errors in LAMMPS

If you are encountering errors like, you may want to check

ERROR: No MEAM parameter file in pair coefficients (../pair_meamc.cpp:243)

When a pair_coeff command using a potential file is specified, LAMMPS looks for the potential file in 2 places. First it looks in the location specified. E.g. if the file is specified as “niu3.eam”, it is looked for in the current working directory. If it is specified as “../potentials/niu3.eam”, then it is looked for in the potentials directory, assuming it is a sister directory of the current working directory. If the file is not found, it is then looked for in one of the directories specified by the LAMMPS_POTENTIALS environment variable. Thus if this is set to the potentials directory in the LAMMPS distribution, then you can use those files from anywhere on your system, without copying them into your working directory. Environment variables are set in different ways for different shells. Here are example settings for

 export LAMMPS_POTENTIALS=/path/to/lammps/potentials

For more information, do read LAMMPS Documentation https://docs.lammps.org/stable/pair_coeff.html

KIM_SimulatorHeaders.h: No such file or directory during compilation of lammps

If you encounter an error such as the one below during compilation for lammps such as written in Compiling LAMMPS-15Jun20 with GNU 6 and OpenMPI 3

After running the command,

% make g++_openmpi -j 16

you may encounter

In file included from ../style_pair.h:112:0,
                 from ../force.cpp:20:
../pair_kim.h:70:34: fatal error: KIM_SimulatorHeaders.h: No such file or directory
 #include "KIM_SimulatorHeaders.h"

This is due to one of the a header file not found at /usr/local/lammps-29Oct20/src/pair_kim.h. At line 70, modify the actual location of KIM_SimulatorHeaders.h

/* #include "KIM_SimulatorHeaders.h" */
#include "/usr/local/lammps-29Oct20/lib/kim/kim-api-2.1.3/build/installed-kim-api-2.1.3/include/kim-api/KIM_SimulatorHeaders.h"

Again, after running the command,

% make g++_openmpi -j 16

you may encounter

mpicxx -g -O3  -DLAMMPS_GZIP -I../../lib/colvars -DLMP_USER_OMP -I../../lib/voronoi/includelink -DLMP_PYTHON -I../../lib/poems -DLMP_MPIIO -I../../lib/message/cslib/src -I../../lib/latte/includelink -DLMP_KOKKOS  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1     -I/usr/include/python2.7 -I/usr/include/python2.7   -I./ -I../../lib/kokkos/core/src -I../../lib/kokkos/containers/src -I../../lib/kokkos/algorithms/src --std=c++11 -fopenmp -I./ -I../../lib/kokkos/core/src -I../../lib/kokkos/containers/src -I../../lib/kokkos/algorithms/src   -DLMP_KIM_CURL   -c ../kim_param.cpp
../kim_param.cpp:73:34: fatal error: KIM_SimulatorHeaders.h: No such file or directory
 #include "KIM_SimulatorHeaders.h"

This is due to one of the a header file not found at /usr/local/lammps-29Oct20/src/kim_param.cpp. At line 73, modify the actual location of KIM_SimulatorHeaders.h

/* #include "KIM_SimulatorHeaders.h" */
#include "/usr/local/lammps-29Oct20/lib/kim/kim-api-2.1.3/build/installed-kim-api-2.1.3/include/kim-api/KIM_SimulatorHeaders.h"

There might be the same issue for kim_init.cpp, fix_store_kim.cpp, pair.kim.h etc

voro++.hh: No such file or directory during compilation of lammps with voronoi

If you encounter an error such as the one below during compilation for lammps such as written in Compiling LAMMPS-15Jun20 with GNU 6 and OpenMPI 3

../compute_voronoi_atom.h:24:21: fatal error: voro++.hh: No such file or directory

This is due to one of the a header file not found at /usr/local/lammps-29Oct20/src/compute_voronoi_atom.cpp. To resolve the issue, do take a look at Line 23 or 24 and edit to the path where you place voro++.hh

/* #include <voro++.hh> */
#include "/usr/local/lammps-29Oct20/lib/voronoi/voro++-0.4.6/src/voro++.hh"

References:

  1. https://sourceforge.net/p/lammps/mailman/message/31832584/

Compiling LAMMPS-15Jun20 with GNU 6 and OpenMPI 3

Prerequisites

openmpi-3.1.4
gnu-6.5
m4-1.4.18
gmp-6.1.0
mpfr-3.1.4
mpc-1.0.3
isl-0.18
gsl-2.1
lammps-15Jun20

Download the latest tar.gz from https://lammps.sandia.gov/

Step 1: Untar LAMMPS

% tar -zxvf lammps-stable.tar.gz

Step 2: Go to $LAMMPS_HOME/src. Make Standard Packages

% cd src
% make yes-standard
% make no-gpu
% make no-mscg

Step 3: Compile message libraries

% cd lammps-15Jun20/lib/message/cslib/src
% make lib_parallel zmq=no

Copy and rename the produced cslib/src/libcsmpi.a or libscnompi.a file to cslib/src/libmessage.a

% cp cslib/src/libcsmpi.a cslib/src/libmessage.a

Copy either lammps-15Jun20/lib/message/Makefile.lammps.zmq or Makefile.lammps.nozmq to lib/message/Makefile.lammps

% cp Makefile.lammps.nozmq Makefile.lammps

Step 4: Compile poems

% cd lammps-15Jun20/lib/poems
% make -f Makefile.g++

Step 5: Compile latte
Download LATTE code and unpack the tarball either in this /lib/latte directory

% git clone https://github.com/lanl/LATTE

Inside lammps-15Jun20/lib/latte/LATTE
Modify the makefile.CHOICES according to your system architecture and compilers

% cd lammps-15Jun20/lib/latte/LATTE
% cp makefile.CHOICES makefile.CHOICES.gfort
% make
% cd lammps-15Jun20/lib/latte
% ln -s ./LATTE/src includelink
% ln -s ./LATTE liblink
% ln -s ./LATTE/src/latte_c_bind.o filelink.o
% cp Makefile.lammps.gfortran Makefile.lammps

Step 6. Compile Voronoi

Download voro++-0.4.6.tar.gz from http://math.lbl.gov/voro++/download/
Untar the voro++-0.4.6.tar.gz inside lammps-15Jun20/lib/voronoi/

% tar -zxvf voro++-0.4.6.tar.gz
% cd lammps-15Jun20/lib/voronoi/voro++-0.4.6
% make

Step 7: Compile kim

Download kim from https://openkim.org/doc/usage/obtaining-models . The current version is  kim-api-2.1.3.txz

Download at /lammps-15Jun20/lib/kim

% cd lammps-15Jun20/lib/kim
% tar Jxvf kim-api-2.1.3.txz
% cd kim-api-2.1.3
% mkdir build
% cd build
% cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}/../../installed-kim-api-2.1.3
% make -j2
% make install
% cd /lammps-15Jun20/lib/kim/installed-kim-api-2.1.3/
% source ${PWD}/kim-api-X2.1.3/bin/kim-api-activate
% kim-api-collections-management install system EAM_ErcolessiAdams_1994_Al__MO_324507536345_002

Step 8: Compile USER-COLVARS

% cd lammps-15Jun/lib/colvars
% make -f Makefile.g++

Step 9: Check Packages Status

% make package-status
[root@hpc-gekko1 src]# make package-status
Installed YES: package ASPHERE
Installed YES: package BODY
Installed YES: package CLASS2
Installed YES: package COLLOID
Installed YES: package COMPRESS
Installed YES: package CORESHELL
Installed YES: package DIPOLE
Installed  NO: package GPU
Installed YES: package GRANULAR
Installed YES: package KIM
.....
.....

Step 9a: To Activate Standard Package

% make yes-standard

Step 9b: To activate USER-COLVARS, USER-OMP

% make yes-user-colvars
% make yes-user-omp

Step 9c: To deactivate GPGPU

% make no-gpu

Step 10: Finally Compile LAMMPS

% cd lammps-15Jun20/src
% make g++_openmpi -j 16

You should have binary called lmp_g++_openmpi
Do a softlink

ln -s lmp_g++_openmpi lammps