[lammps-users] Making Reax with patch file

Hi, guys,

I built the Reax under /lib and remade LAMMPS with Reax patch file, and get the lmp_g++_reax, and give it a go with the example input script'in.reax.rdx',

then got an Error:'Invalid pair style'

Here is my modified make file, is there something I missed here or elsewhere? Thanks

# g++_reax = RedHat Linux box, g++, MPICH2, FFTW, REAX lib

SHELL = /bin/sh

# System-specific settings

CC = g++
CCFLAGS = -g -O -I../../lib/reax -I../../lib/poems\
        -DFFT_FFTW -DLAMMPS_GZIP -DMPICH_IGNORE_CXX_SEEK -I/opt/mathlib/fftw215/include -I/opt/mpich/include
DEPFLAGS = -M
LINK = g++ -L/opt/mathlib/fftw215/lib -L/opt/mpich/lib
LINKFLAGS = -g -O -L../../lib/reax -L/opt/mathlib/fftw215/lib -L/opt/mpich/lib -L../../lib/poems -L../../lib/meam
USRLIB = -lfftw -lmpich -lreax -lpoems -lmeam
SYSLIB = -lpthread
ARCHIVE = ar
ARFLAGS = -rc
SIZE = size

Hi, guys,

I built the Reax under /lib and remade LAMMPS with Reax patch file, and
get the lmp_g++_reax, and give it a go with the example input
script'in.reax.rdx',

then got an Error:'Invalid pair style'

Here is my modified make file, is there something I missed here or
elsewhere? Thanks

yes. you probably forgot to do "make yes-reax"

axel.

Hi, Alex, thank you for you advice, I already 'make yes-all', and reax is been installed. There are some new errors like
'reax_poten.F:(.text+0x1bda): undefined reference to '_gfortran_st_write', etc. What is the prolem again? Thank you in advance.

Hi, Alex, thank you for you advice, I already 'make yes-all', and reax is
been installed. There are some new errors like
'reax_poten.F:(.text+0x1bda): undefined reference to '_gfortran_st_write',
etc. What is the prolem again? Thank you in advance.

libreax.a is written in fortran, so you have to link the fortran
runtime library. if you link your executable with the fortran
compiler, this is done automatically. but lammps is written in c++
and thus linked with the c++ compiler (and c++ runtime), so you have
to add the fortran runtime library to the USRLIB, in your case
add -lgfortran after -lreax

cheers,
   axel.

Axel Kohlmeyer wrote:

Please read the pair_style reax doc page - it explains how to
add new ReaxFF potentials.

Steve