[lammps-users] Problems on parallel compilation

Dear users

I am a new user of lammps. I met with some problems about compilation of the parallel version(lammps-9Jan09) on the 4-core cpu computer. My OS is FC 10. fftw-3.2 and mpich packages have been installed before lammps compilation.

The relative lines in makefile.g++ in MAKE directory are modified according to the directory where i installed fftw and mpich, but when I type make g++ in src folder, it gives:

g++ -g -O -DLAMMPS_GZIP -DMPICH_IGNORE_CXX_SEEK -I/opt/mpich/include -I…/STUBS -I/home/opt/fftw-3.2/include -c dihedral_multi_harmonic.cpp
g++ -g -O -DLAMMPS_GZIP -DMPICH_IGNORE_CXX_SEEK -I/opt/mpich/include -I…/STUBS -I/home/opt/fftw-3.2/include -c dihedral_opls.cpp
g++ -g -O -DLAMMPS_GZIP -DMPICH_IGNORE_CXX_SEEK -I/opt/mpich/include -I…/STUBS -I/home/opt/fftw-3.2/include -c displace_atoms.cpp
g++ -g -O -DLAMMPS_GZIP -DMPICH_IGNORE_CXX_SEEK -I/opt/mpich/include -I…/STUBS -I/home/opt/fftw-3.2/include -c displace_box.cpp
g++ -g -O -DLAMMPS_GZIP -DMPICH_IGNORE_CXX_SEEK -I/opt/mpich/include -I…/STUBS -I/home/opt/fftw-3.2/include -c domain.cpp
g++ -g -O -DLAMMPS_GZIP -DMPICH_IGNORE_CXX_SEEK -I/opt/mpich/include -I…/STUBS -I/home/opt/fftw-3.2/include -c dump_atom.cpp
g++ -g -O -DLAMMPS_GZIP -DMPICH_IGNORE_CXX_SEEK -I/opt/mpich/include -I…/STUBS -I/home/opt/fftw-3.2/include -c dump_bond.cpp
g++ -g -O -DLAMMPS_GZIP -DMPICH_IGNORE_CXX_SEEK -I/opt/mpich/include -I…/STUBS -I/home/opt/fftw-3.2/include -c dump.cpp
g++ -g -O -DLAMMPS_GZIP -DMPICH_IGNORE_CXX_SEEK -I/opt/mpich/include -I…/STUBS -I/home/opt/fftw-3.2/include -c dump_custom.cpp
g++ -g -O -DLAMMPS_GZIP -DMPICH_IGNORE_CXX_SEEK -I/opt/mpich/include -I…/STUBS -I/home/opt/fftw-3.2/include -c dump_dcd.cpp
g++ -g -O -DLAMMPS_GZIP -DMPICH_IGNORE_CXX_SEEK -I/opt/mpich/include -I…/STUBS -I/home/opt/fftw-3.2/include -c dump_xyz.cpp
g++ -g -O -DLAMMPS_GZIP -DMPICH_IGNORE_CXX_SEEK -I/opt/mpich/include -I…/STUBS -I/home/opt/fftw-3.2/include -c error.cpp
g++ -g -O -DLAMMPS_GZIP -DMPICH_IGNORE_CXX_SEEK -I/opt/mpich/include -I…/STUBS -I/home/opt/fftw-3.2/include -c ewald.cpp
ewald.cpp: In member function ‘virtual void LAMMPS_NS::Ewald::init()’:
ewald.cpp:103: warning: deprecated conversion from string constant to ‘char’
g++ -g -O -DLAMMPS_GZIP -DMPICH_IGNORE_CXX_SEEK -I/opt/mpich/include -I…/STUBS -I/home/opt/fftw-3.2/include -c fft3d.cpp
In file included from fft3d.cpp:23:
fft3d.h:186: error: ISO C++ forbids declaration of ‘FFT_DATA’ with no type
fft3d.h:186: error: expected ‘;’ before ‘
’ token
fft3d.h:187: error: ISO C++ forbids declaration of ‘FFT_DATA’ with no type
fft3d.h:187: error: expected ‘;’ before ‘*’ token
fft3d.h:235: error: variable or field ‘fft_3d’ declared void
fft3d.h:235: error: ‘FFT_DATA’ was not declared in this scope
fft3d.h:235: error: expected primary-expression before ‘,’ token
fft3d.h:235: error: ‘FFT_DATA’ was not declared in this scope
fft3d.h:235: error: expected primary-expression before ‘,’ token
fft3d.h:235: error: expected primary-expression before ‘int’
fft3d.h:235: error: expected primary-expression before ‘struct’
fft3d.h:242: error: variable or field ‘fft_1d_only’ declared void
fft3d.h:242: error: ‘FFT_DATA’ was not declared in this scope
fft3d.h:242: error: expected primary-expression before ‘,’ token
fft3d.h:242: error: expected primary-expression before ‘int’
fft3d.h:242: error: expected primary-expression before ‘int’
fft3d.h:242: error: expected primary-expression before ‘struct’
fft3d.cpp:58: error: variable or field ‘fft_3d’ declared void
fft3d.cpp:58: error: ‘FFT_DATA’ was not declared in this scope
fft3d.cpp:58: error: ‘in’ was not declared in this scope
fft3d.cpp:58: error: ‘FFT_DATA’ was not declared in this scope
fft3d.cpp:58: error: ‘out’ was not declared in this scope
fft3d.cpp:58: error: expected primary-expression before ‘int’
fft3d.cpp:58: error: expected primary-expression before ‘struct’
make[1]: *** [fft3d.o] Error 1
make[1]: Leaving directory `/home/blade/Jamesli/Code/lammps-9Jan09/src/Obj_g++’
make: *** [g++] Error 2

Then the compilation failed. Is there something wrong with fftw? The installation of fftw reports no error. Could anybody help me with it? Thanks.

This is my Makefile.g++

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

SHELL = /bin/bash

System-specific settings

CC = g++
#CCFLAGS = -L/opt/mpich/include -L/opt/mathlib/fft-gnu/include/ -g -O -DFFT_FFTW -DLAMMPS_GZIP -DMPICH_IGNORE_CXX_SEEK
CCFLAGS = -g -O -DLAMMPS_GZIP -DMPICH_IGNORE_CXX_SEEK -I/opt/mpich/include
-I…/STUBS -I/home/opt/fftw-3.2/include
#DMPICH_IGNORE_CXX_SEEK = -l/opt/mathlib/fft-gnu/include -l/opt/mpich/include
DEPFLAGS = -M
LINK = g++
LINKFLAGS = -O -L/opt/mpich/lib
…/STUBS -L/home/opt/fftw-3.2/lib
#LINKFLAGS = -g -O
#USRLIB = -lfftw -lmpich
USRLIB = -lmpich
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) < > @

Individual dependencies

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

Dear users

I am a new user of lammps. I met with some problems about compilation of the
parallel version(lammps-9Jan09) on the 4-core cpu computer. My OS is FC 10.
fftw-3.2 and mpich packages have been installed before lammps compilation.

lammps supports fftw-2.x only.

The relative lines in makefile.g++ in MAKE directory are modified according
to the directory where i installed fftw and mpich, but when I type make g++
in src folder, it gives:

that makefile is not for parallel compilation.

since you are using fedora, i recommend you uninstall mpich, and install
the fedora provided openmpi-devel package instead as well as the
fftw2-devel pacakge
including all dependencies and then use make openmpi and the corresponding
Makefile.openmpi. that has been tested on fedora with gcc-4.x and works well
(for me, that is).

cheers,
   axel.

You commented out the line with -DFFT_FFTW and you are
getting errors b/c you have no -DFFT flag defined.

Steve