[lammps-users] lammps installation

Hey guys,

Sorry for the mundana lammps installation question but I've been
struggling this for a couple of days now so I'm running out of
options. I'm trying to compile lammps with the reax package.
Everything went fine with compiling reax, but when I try to build
lammps with:

make yes-reax g++

I get these errors:

Makefile:93: timer.d: No such file or directory
Makefile:93: universe.d: No such file or directory
Makefile:93: update.d: No such file or directory
Makefile:93: variable.d: No such file or directory
Makefile:93: velocity.d: No such file or directory
Makefile:93: verlet.d: No such file or directory
g++ -g -O -DLAMMPS_GZIP -I../../lib/reax
-L/opt/mvapich2-1.4.1/include/ -DFFT_FFTW -M verlet.cpp > verlet.d
In file included from integrate.h:17,
                 from verlet.h:23,
                 from verlet.cpp:15:
pointers.h:24:17: error: mpi.h: No such file or directory
make[1]: *** [verlet.d] Error 1
make[1]: Leaving directory `/opt/lammps-30Mar10/src/Obj_g++'
make: *** [g++] Error 2

With similar *.d file errors continuing above that. I have a couple of
questions here. Why am I getting the dependency file errors when I am
using the default g++ compiler make file? The compiler/linker portion
of my make file looks like this:

# ---------------------------------------------------------------------
# compiler/linker settings
# specify flags and libraries needed for your compiler

CC = g++
CCFLAGS = -g -O
DEPFLAGS = -M
LINK = g++
LINKFLAGS = -g -O
LIB =
ARCHIVE = ar
ARFLAGS = -rc
SIZE = size

Also it looks as though its having a hard time finding the mpi.h file.
I want to use mvapich2 so this file is located at
/opt/mvapich2-1.4.1/include but that doesn't seem to be working. Have
I specified the location incorrectly (ie. format of make file)? The
mpi part of my make file looks like this:

# MPI library, can be src/STUBS dummy lib
# INC = path for mpi.h, MPI compiler settings
# PATH = path for MPI library
# LIB = name of MPI library

MPI_INC = -L/opt/mvapich2-1.4.1/include/
MPI_PATH = -L/opt/mvapich2-1.4.1/lib/
MPI_LIB = -libmpich

Any suggestions?

Hi, Jacob:

A few things:

(1) You need a -I instead of a -L on the MPI_INC line (to tell the compiler it’s an include rather than a library).

(2) The “.d” errors will happen whenever the “.d” file doesn’t exist, which means it might be the first time you’re compiling for a given installation. It’s not a fatal error, though.

–AEI

Ahmed, thanks for pointing that out. That was indeed a dumb error. I'm
now running into problems with the mpi part of the compilation I
believe. I want to use mvapich to run over our infiniband which was
compiled with the g++ compiler. The mpi part of my make file now looks
like this:

# MPI library, can be src/STUBS dummy lib
# INC = path for mpi.h, MPI compiler settings
# PATH = path for MPI library
# LIB = name of MPI library

MPI_INC = -I/opt/mvapich2-1.4.1/include/
MPI_PATH = -L/opt/mvapich2-1.4.1/lib/
MPI_LIB = -lmpich

But now I am getting errors like this:

/opt/mvapich2-1.4.1/lib//libmpich.a(info_getvallen.o): In function
`PMPI_Info_get_valuelen':
/opt/src/mvapich2-1.4.1/src/util/info/info_getvallen.c:129: undefined
reference to `pthread_getspecific'
/opt/src/mvapich2-1.4.1/src/util/info/info_getvallen.c:63: undefined
reference to `pthread_getspecific'
/opt/src/mvapich2-1.4.1/src/util/info/info_getvallen.c:129: undefined
reference to `pthread_setspecific'
/opt/src/mvapich2-1.4.1/src/util/info/info_getvallen.c:63: undefined
reference to `pthread_setspecific'
collect2: ld returned 1 exit status
make[1]: *** [../lmp_g++] Error 1
make[1]: Leaving directory `/opt/lammps-30Mar10/src/Obj_g++'
make: *** [g++] Error 2

I'm really not sure what's going on here so I was hoping someone could chime in.

Jacob

I'm especially confused about the lines that say:

/opt/src/mvapich2-1.4.1/src/util/info/info_getvallen.c:129: undefined
reference to `pthread_getspecific'

because /opt/src/mvapich2-1.4.1/* doesn't even exist so what is
causing lammps to go and look there?

Jacob

I'm especially confused about the lines that say:

/opt/src/mvapich2-1.4.1/src/util/info/info_getvallen.c:129: undefined
reference to `pthread_getspecific'

because /opt/src/mvapich2-1.4.1/* doesn't even exist so what is
causing lammps to go and look there?

this has nothing to do with lammps.
your mvapich installation was compiled with threads support,
so you have to link with -lpthreads

cheers,
    axel.