[lammps-users] errors when compiling lammps with reax package

Dear All,

I tried to compile LAMMPS with reax package, but encountered such errors. First I built reax library in the /lib/reax/ folder using command: make -f Makefile.gfortran. It completed successfully with a libreax.a file. Then I modified Makefile.g++ file in /src/MAKE/ folder. After that, I tried to make lammps in src folder by “make yes-reax”, and following “make g++”. Unfortunately, some errors happened as follows:

reax_reac.F:(.text+0x563): undefined reference to _gfortran_st_write' reax_reac.F:(.text+0x57b): undefined reference to _gfortran_transfer_integer’
reax_reac.F:(.text+0x583): undefined reference to _gfortran_st_write_done' reax_reac.F:(.text+0x5b3): undefined reference to _gfortran_st_write’
reax_reac.F:(.text+0x5cb): undefined reference to _gfortran_transfer_real' reax_reac.F:(.text+0x5e3): undefined reference to _gfortran_transfer_real’
reax_reac.F:(.text+0x5fb): undefined reference to _gfortran_transfer_real' reax_reac.F:(.text+0x613): undefined reference to _gfortran_transfer_real’
reax_reac.F:(.text+0x62b): undefined reference to _gfortran_transfer_real' ../../lib/reax/libreax.a(reax_reac.o):reax_reac.F:(.text+0x643): more undefined references to _gfortran_transfer_real’ follow
…/…/lib/reax/libreax.a(reax_reac.o): In function encalc_': reax_reac.F:(.text+0x723): undefined reference to _gfortran_st_write_done’
reax_reac.F:(.text+0x737): undefined reference to _gfortran_stop_string' collect2: ld returned 1 exit status make[1]: *** [../lmp_zhjj] Error 1 make[1]: Leaving directory /home/users/junjiz3k/zhjj/work/lammps/sio2/zhjj_lammps-27Mar09/lammps-27Mar09/src/Obj_zhjj’
make: *** [zhjj] Error 2

For your reference, the modified Makefile.g++ is also attached.

g++ = RedHat Linux box, g++, MPICH2, FFTW

SHELL = /bin/sh

System-specific settings

CC = g++
CCFLAGS = -g -O -I/home/users/junjiz3k/zhjj/work/lammps/mpich/include
LINK = g++
LINKFLAGS = -g -O -L/home/users/junjiz3k/zhjj/work/lammps/mpich/lib
USRLIB = -lfftw -lmpich -lreax
SYSLIB = -lpthread
SIZE = size

Link target

(EXE): (OBJ)

Library target


Compilation rules

(CC) (CCFLAGS) -c $<


Individual dependencies

DEPENDS = (OBJ:.o=.d) include (DEPENDS)

Would you kindly figure out what’s wrong with my compiling process? Thanks in advance.

Best regards,