Update pair_kim for v1.9.4 and versatile linking

Use dlopen instead of directly linking to kim-api
library.  This will allow for easier distribution
of LAMMPS with support for KIM Models.
This commit is contained in:
Ryan S. Elliott
2018-03-05 17:34:11 -06:00
parent 0bfb6f0c2a
commit 25d2f4b1f6
6 changed files with 348 additions and 215 deletions

View File

@ -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 Mar 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

View File

@ -18,15 +18,6 @@
include ../../lib/kim/Makefile.KIM_DIR
ifeq ($(wildcard $(KIM_INSTALL_DIR)/bin/kim-api-v1-build-config),)
KIM_CONFIG_HELPER = kim-api-v1-build-config
else
KIM_CONFIG_HELPER = $(KIM_INSTALL_DIR)/bin/kim-api-v1-build-config
endif
ifeq ($(shell $(KIM_CONFIG_HELPER) --version 2> /dev/null),)
$(error $(KIM_CONFIG_HELPER) utility is not available. Something is wrong with your KIM API package setup)
endif
kim_SYSINC = $(shell $(KIM_CONFIG_HELPER) --includes)
kim_SYSLIB = $(shell $(KIM_CONFIG_HELPER) --ldlibs)
kim_SYSPATH = $(shell $(KIM_CONFIG_HELPER) --ldflags)
kim_SYSINC = -DKIM_INSTALL_DIR=\"${KIM_INSTALL_DIR}\"
kim_SYSLIB =
kim_SYSPATH =

View File

@ -21,46 +21,33 @@ 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
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 ../
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
-----------------