Problems with kokkos using Make.py

Dear Lammps users and developpers,

I am trying to reinstall lammps (latest git version) using Make.py:
./Make.py -v -j 4 -p intel omp -intel cpu -o intel_cpu -cc icc -m mpi -a lib-all file mpi
but I get at the end
AttributeError: Kokkos instance has no attribute ‘build’

Could someone please explain me my mistake?

result of execution is:

./Make.py -v -j 4 -p intel omp -intel cpu -o intel_cpu -cc icc -m mpi -a lib-all file mpi
Command-line parsing:
v:
j: 4
p: intel omp
intel: cpu
o: intel_cpu
m: mpi
Installing packages …
Package status after installation:
Installed YES: package ASPHERE
Installed YES: package BODY
Installed YES: package CLASS2
Installed YES: package COLLOID
Installed YES: package CORESHELL
Installed YES: package DIPOLE
Installed YES: package FLD
Installed NO: package GPU
Installed YES: package GRANULAR
Installed NO: package KIM
Installed YES: package KOKKOS
Installed YES: package KSPACE
Installed YES: package MANYBODY
Installed YES: package MC
Installed YES: package MEAM
Installed YES: package MISC
Installed YES: package MOLECULE
Installed YES: package MPIIO
Installed YES: package OPT
Installed YES: package PERI
Installed YES: package POEMS
Installed YES: package PYTHON
Installed YES: package QEQ
Installed YES: package REAX
Installed YES: package REPLICA
Installed YES: package RIGID
Installed YES: package SHOCK
Installed YES: package SNAP
Installed YES: package SRD
Installed YES: package VORONOI
Installed YES: package XTC

Installed YES: package USER-ATC
Installed YES: package USER-AWPMD
Installed YES: package USER-CG-CMM
Installed YES: package USER-COLVARS
Installed NO: package USER-CUDA
Installed YES: package USER-EFF
Installed YES: package USER-FEP
Installed YES: package USER-INTEL
Installed YES: package USER-LB
Installed YES: package USER-MISC
Installed YES: package USER-MOLFILE
Installed YES: package USER-OMP
Installed YES: package USER-PHONON
Installed YES: package USER-QMMM
Installed NO: package USER-QUIP
Installed YES: package USER-REAXC
Installed YES: package USER-SPH
Action lib-all …
building kokkos library …
Traceback (most recent call last):
File “./Make.py”, line 2052, in
if action.startswith(“lib-”): actions.lib(action[4:])
File “./Make.py”, line 234, in lib
exec(str)
File “”, line 1, in
AttributeError: Kokkos instance has no attribute ‘build’

This happened b/c the kokkos package was added

to the list of packages with libraries in the src/Makefile,

so you could easily exclude it from a build, via

make no-lib

However it doesn’t actually have a build-able lib

like the others, so it is messing up Make.py

Just add this remove line in the right place in Make.py around

line 700:

extract package lists from src/Makefile

remove kokkos from lib since it doesn’t actually have a lib

make = MakeReader("s/Makefile" dir.src)
std = make.getvar(“PACKAGE”)
user = make.getvar(“PACKUSER”)
lib = make.getvar(“PACKLIB”)
lib.remove(“kokkos”)
all = std + user

Steve

Hi Steve,

Thanks a lot for your answer.

I made the proposed fix to Make.py and the did again:
./Make.py -v -j 4 -p intel omp -intel cpu -o intel_cpu -cc icc -m mpi -a lib-all file mpi

At first it seemed to work, since it created libmeam (with gfortran and not ifort though) then libpoems (with g++ and not icpc) and then Make.py stopped after the creation of libpoems:
Created lib/poems library
building python library …
Traceback (most recent call last):
File “./Make.py”, line 2054, in
if action.startswith(“lib-”): actions.lib(action[4:])
File “./Make.py”, line 234, in lib
exec(str)
File “”, line 1, in
NameError: name ‘python’ is not defined

However, if I type python at the prompt I get
$ python
Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

Furthermore, if I look at the …/lib/python directory, I see that no lib should be created here also.
Hence I also added lib.remove(“python”) after lib.remove(“kokkos”) and relaunched the Make.py.
It then proceeded to build reax, seemed to do nothing for voronoi and threw plenty of MPI connected errors while trying to build the ATC library (that I indeed want to test) coming from the fact that it apparently cannot find the mpi.h file.
I suppose I will have to edit MAKE/Makefile.mpi to add the relvant paths to MPI_INC and MPI_PATH, but does a way to do that through an argument to Make.py exists?

PS: Just a remark. I read the README in …/lib/python and it seems to me that
something like “, with the --ldflags flag.” could be added at the end of the following sentence (nearly end of the file):
“To find out the required compiler and linker flags, you can execute
the pythonX.Y-config script which is generated as part of the
installation process (a python-config script may also be available).”

i have two comments, that are technically unrelated:
1) you might find it easier to compile the standard way (using plain
make and not Make.py) and only install the packages you want/need
2) unless you have particular needs to compile for your self. you seem
to be running on a RHEL 6x. compatible machine, you might want to try
out the pre-compiled rpm packages for RHEL 6. they do contain AtC.

axel.

Here is a complete update for Make.py:

extract package lists from src/Makefile

remove names from lib that there are not Make.py lib-classes for

most don’t actually have libs, so nothing to control from Make.py

make = MakeReader("s/Makefile" dir.src)
std = make.getvar(“PACKAGE”)
user = make.getvar(“PACKUSER”)
lib = make.getvar(“PACKLIB”)
lib.remove(“kim”)
lib.remove(“kokkos”)
lib.remove(“molfile”)
lib.remove(“python”)
lib.remove(“quip”)
all = std + user

Those are mostly relatively new packages, that don’t actually

have libs, so there is nothing to control from Make.py.

LAMMPS should still build with those packages installed,
when building from Make.py, assuming the lib/dir/Makefile.lammps

file is correct for your system.

The USER-ATC package build is controllable from Make.py,

type Make.py -h -atc to see help. But as Axel said, to use

it you are better off building manually first to fix your MPI

problems, and insure you have the correct Makefiles in the

lib/atc dir for Make.py to copy into place.

Steve