[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
-I/home/users/junjiz3k/zhjj/work/lammps/fftw/include
-I…/…/lib/reax
-DFFT_FFTW -DLAMMPS_GZIP -DMPICH_IGNORE_CXX_SEEK
DEPFLAGS = -M
LINK = g++
LINKFLAGS = -g -O -L/home/users/junjiz3k/zhjj/work/lammps/mpich/lib
-L/home/users/junjiz3k/zhjj/work/lammps/fftw/lib
-L…/…/lib/reax
USRLIB = -lfftw -lmpich -lreax
SYSLIB = -lpthread
ARCHIVE = ar
ARFLAGS = -rc
SIZE = size

Link target

(EXE): (OBJ)
(LINK) (LINKFLAGS) (OBJ) (USRLIB) (SYSLIB) -o (EXE)
(SIZE) (EXE)

Library target

lib: (OBJ) (ARCHIVE) (ARFLAGS) (EXE) $(OBJ)

Compilation rules

.o:.cpp
(CC) (CCFLAGS) -c $<

.d:.cpp
(CC) (CCFLAGS) (DEPFLAGS) < > [email protected]

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,
Damien
2009-04-27