Unverified Commit 1b965d4d authored by Steve Plimpton's avatar Steve Plimpton Committed by GitHub
Browse files

Merge pull request #863 from ellio167/kim-update

KIM API interface update
parents 8e3ba36a dee945c0
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -290,7 +290,21 @@ if(ENABLE_USER-VTK)
endif()

if(ENABLE_KIM)
  find_package(KIM REQUIRED)
  find_package(KIM QUIET)
  if(NOT KIM_FOUND)
    message(STATUS "KIM not found - we will build our own")
    include(ExternalProject)
    ExternalProject_Add(kim_build
      URL https://github.com/openkim/kim-api/archive/v1.9.4.tar.gz
      URL_MD5 f4d35a1705eed46d64c7c0ab448ff3e0
      BUILD_IN_SOURCE 1
      CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR>
      )
    ExternalProject_get_property(kim_build INSTALL_DIR)
    set(KIM_INCLUDE_DIRS ${INSTALL_DIR}/include/kim-api-v1)
    set(KIM_LIBRARIES ${INSTALL_DIR}/lib/libkim-api-v1.so)
    list(APPEND LAMMPS_DEPS kim_build)
  endif()
  list(APPEND LAMMPS_LINK_LIBS ${KIM_LIBRARIES})
  include_directories(${KIM_INCLUDE_DIRS})
endif()
+8 −9
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ Syntax from lib dir: python Install.py -b -v version -a kim-name
specify one or more options, order does not matter

  -v = version of KIM API library to use
       default = kim-api-v1.9.2 (current as of Oct 2017)
       default = kim-api-v1.9.4 (current as of Apr 2018)
  -b = download and build base KIM API library with example Models
       this will delete any previous installation in the current folder
  -n = do NOT download and build base KIM API library.
@@ -109,7 +109,7 @@ nargs = len(args)
if nargs == 0: error()

thisdir = os.environ['PWD']
version = "kim-api-v1.9.2"
version = "kim-api-v1.9.4"

buildflag = False
everythingflag = False
@@ -166,9 +166,6 @@ if pathflag:
    mkfile.write("print_dir:\n")
    mkfile.write("	@printf $(KIM_INSTALL_DIR)\n")

  with open("%s/Makefile.KIM_Config" % thisdir, 'w') as cfgfile:
    cfgfile.write("include %s/lib/kim-api/Makefile.KIM_Config" % kimdir)

  print("Created %s/Makefile.KIM_DIR\n  using %s" % (thisdir,kimdir))
else:
  kimdir = os.path.join(os.path.abspath(thisdir), "installed-" + version)
@@ -191,9 +188,6 @@ if buildflag:
    mkfile.write("print_dir:\n")
    mkfile.write("	@printf $(KIM_INSTALL_DIR)\n")

  with open("%s/Makefile.KIM_Config" % thisdir, 'w') as cfgfile:
    cfgfile.write("include %s/lib/kim-api/Makefile.KIM_Config" % kimdir)

  print("Created %s/Makefile.KIM_DIR\n  using %s" % (thisdir,kimdir))

  # download entire kim-api tarball
@@ -247,11 +241,16 @@ if buildflag:
# add single OpenKIM model
if addflag:

  makefile_path = os.path.join(thisdir, "Makefile.KIM_DIR")
  if os.path.isfile(makefile_path):
    cmd = 'make --no-print-directory -f %s print_dir' % makefile_path
    kimdir = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)

  if not os.path.isdir(kimdir):
    print("\nkim-api is not installed")
    error()

  # download single model
  cmd = '%s/bin/kim-api-v1-collections-management install system %s' % (kimdir, addmodelname)
  cmd = '%s/bin/kim-api-v1-collections-management install system %s' % (kimdir.decode("UTF-8"), addmodelname)
  txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
  if verboseflag: print (txt.decode("UTF-8"))
+12 −24
Original line number Diff line number Diff line
@@ -20,47 +20,35 @@ Instructions:

1. Configure lammps for use with the kim-api library installed in this directory

$ printf "KIM_INSTALL_DIR=${PWD}\n" > ./Makefile.KIM_DIR
$ printf "include ${PWD}/lib/kim-api/Makefile.KIM_Config\n" > ./Makefile.KIM_Config
# replace X.Y.Z as appropriate here and below
$ printf "KIM_INSTALL_DIR=${PWD}/installed-kim-api-vX.Y.Z\n" > ./Makefile.KIM_DIR

2. Download and unpack the kim-api

# replace X.Y.Z as appropriate here and below
$ wget http://s3.openkim.org/kim-api/kim-api-vX.Y.Z.tgz
$ tar zxvf kim-api-vX.Y.Z.tgz
$ wget http://s3.openkim.org/kim-api/kim-api-vX.Y.Z.txz
$ tar zxvf kim-api-vX.Y.Z.txz

# configure the kim-api
$ cd kim-api-vX.Y.Z
$ ./configure --prefix=${PWD}/../

# setup the desired kim item
$ make add-Pair_Johnson_Fe__MO_857282754307_002
$ ./configure --prefix=${PWD}/../installed-kim-api-vX.Y.Z

3. Build and install the kim-api and model

$ make
$ make install

# replace X with the KIM API major version number
$ make install-set-default-to-vX
$ cd ../
$ cd ..

4. Remove source and build files

$ rm -rf kim-api-vX.Y.Z
$ rm -rf kim-api-vX.Y.Z.tgz
$ rm -rf kim-api-vX.Y.Z.txz

5. To add additional items do the following (replace the kim item name with your
5. To add items do the following (replace the kim item name with your
   desired value)

$ wget https://openkim.org/download/EAM_Johnson_NearestNeighbor_Cu__MO_887933271505_001.tgz
$ tar zxvf EAM_Johnson_NearestNeighbor_Cu__MO_887933271505_001.tgz
$ cd EAM_Johnson_NearestNeighbor_Cu__MO_887933271505_001
$ make
$ make install
$ cd ..
$ rm -rf EAM_Johnson_NearestNeighbor_Cu__MO_887933271505_001
$ rm -rf EAM_Johnson_NearestNeighbor_Cu__MO_887933271505_001.tgz
$ source ${PWD}/kim-api-vX.Y.Z/bin/kim-api-v1-activate
$ kim-api-v1-collections-management install system Pair_Johnson_Fe__MO_857282754307_002


-----------------

@@ -73,4 +61,4 @@ $ make g++ (or whatever target you wish)

Note that the Makefile.lammps and Makefile.KIM_DIR files in this directory
are required to allow the LAMMPS build to find the necessary KIM files.
You should not normally need to edit this file.
You should not normally need to edit these files.

lib/kim/pair-kim.release.info

deleted100644 → 0
+0 −6
Original line number Diff line number Diff line
This package (pair-kim-v1.7.2+1) created from commit

ced1275c5fd5b382cb9bd39e44ed1324c7c85e99

of the pair-kim git repository
By Ryan S. Elliott (relliott@umn.edu) on Mon Feb 22 14:59:53 CST 2016.
+0 −13
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@

// includes from LAMMPS
#include "pair_kim.h"
#include "pair_kim_version.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
@@ -1094,18 +1093,6 @@ void PairKIM::write_descriptor(char** test_descriptor_string)
      "#\n"
      "# This file is automatically generated from LAMMPS pair_style "
          "kim command\n");
   char tmp_version[100];
   sprintf(tmp_version,"# This is pair-kim-v%i.%i.%i",
           PAIR_KIM_VERSION_MAJOR, PAIR_KIM_VERSION_MINOR,
           PAIR_KIM_VERSION_PATCH);
   strcat(*test_descriptor_string, tmp_version);
#ifdef PAIR_KIM_VERSION_PRERELEASE
   sprintf(tmp_version,"-%s", PAIR_KIM_VERSION_PRERELEASE);
   strcat(*test_descriptor_string, tmp_version);
#endif
#ifdef PAIR_KIM_VERSION_BUILD_METADATA
   sprintf(tmp_version,"+%s", PAIR_KIM_VERSION_BUILD_METADATA);
#endif
   strcat(*test_descriptor_string,
      "\n"
      "# The call number is (pair_style).(init_style): ");
Loading