Updates for kim-api-2.0.2 release

This commit is contained in:
Ryan S. Elliott
2019-03-28 15:35:22 -05:00
parent 93f531441a
commit 9d0e518cc5
6 changed files with 42 additions and 42 deletions

View File

@ -207,7 +207,7 @@ include_directories(${LAMMPS_SOURCE_DIR})
if(PKG_USER-ADIOS) if(PKG_USER-ADIOS)
# The search for ADIOS2 must come before MPI because # The search for ADIOS2 must come before MPI because
# it includes its own MPI search with the latest FindMPI.cmake # it includes its own MPI search with the latest FindMPI.cmake
# script that defines the MPI::MPI_C target # script that defines the MPI::MPI_C target
enable_language(C) enable_language(C)
find_package(ADIOS2 REQUIRED) find_package(ADIOS2 REQUIRED)
list(APPEND LAMMPS_LINK_LIBS adios2::adios2) list(APPEND LAMMPS_LINK_LIBS adios2::adios2)
@ -663,19 +663,19 @@ endif()
if(PKG_KIM) if(PKG_KIM)
find_package(CURL) find_package(CURL)
if(CURL_FOUND) if(CURL_FOUND)
include_directories(${CURL_INCLUDE_DIRS}) include_directories(${CURL_INCLUDE_DIRS})
list(APPEND LAMMPS_LINK_LIBS ${CURL_LIBRARIES}) list(APPEND LAMMPS_LINK_LIBS ${CURL_LIBRARIES})
add_definitions(-DLMP_KIM_CURL) add_definitions(-DLMP_KIM_CURL)
endif() endif()
option(DOWNLOAD_KIM "Download KIM-API v2 from OpenKIM instead of using an already installed one" OFF) option(DOWNLOAD_KIM "Download KIM-API from OpenKIM instead of using an already installed one" OFF)
if(DOWNLOAD_KIM) if(DOWNLOAD_KIM)
message(STATUS "KIM-API v2 download requested - we will build our own") message(STATUS "KIM-API download requested - we will build our own")
enable_language(C) enable_language(C)
enable_language(Fortran) enable_language(Fortran)
include(ExternalProject) include(ExternalProject)
ExternalProject_Add(kim_build ExternalProject_Add(kim_build
URL https://s3.openkim.org/kim-api/kim-api-v2-2.0.1.txz URL https://s3.openkim.org/kim-api/kim-api-2.0.2.txz
URL_MD5 289c57f0c3bc2a549662283cac1c4ef1 URL_MD5 537d9c0abd30f85b875ebb584f9143fa
BINARY_DIR build BINARY_DIR build
CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
@ -684,17 +684,17 @@ if(PKG_KIM)
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
) )
ExternalProject_get_property(kim_build INSTALL_DIR) ExternalProject_get_property(kim_build INSTALL_DIR)
set(KIM-API-V2_INCLUDE_DIRS ${INSTALL_DIR}/include/kim-api-v2) set(KIM-API_INCLUDE_DIRS ${INSTALL_DIR}/include/kim-api)
set(KIM-API-V2_LDFLAGS ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libkim-api-v2${CMAKE_SHARED_LIBRARY_SUFFIX}) set(KIM-API_LDFLAGS ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libkim-api${CMAKE_SHARED_LIBRARY_SUFFIX})
list(APPEND LAMMPS_DEPS kim_build) list(APPEND LAMMPS_DEPS kim_build)
else() else()
find_package(KIM-API-V2) find_package(KIM-API)
if(NOT KIM-API-V2_FOUND) if(NOT KIM-API_FOUND)
message(FATAL_ERROR "KIM-API v2 not found, help CMake to find it by setting PKG_CONFIG_PATH, or set DOWNLOAD_KIM=ON to download it") message(FATAL_ERROR "KIM-API not found, help CMake to find it by setting PKG_CONFIG_PATH, or set DOWNLOAD_KIM=ON to download it")
endif() endif()
endif() endif()
list(APPEND LAMMPS_LINK_LIBS "${KIM-API-V2_LDFLAGS}") list(APPEND LAMMPS_LINK_LIBS "${KIM-API_LDFLAGS}")
include_directories(${KIM-API-V2_INCLUDE_DIRS}) include_directories(${KIM-API_INCLUDE_DIRS})
endif() endif()
if(PKG_MESSAGE) if(PKG_MESSAGE)

View File

@ -19,7 +19,7 @@
# #
# #
# Copyright (c) 2013--2018, Regents of the University of Minnesota. # Copyright (c) 2013--2019, Regents of the University of Minnesota.
# All rights reserved. # All rights reserved.
# #
# Contributors: # Contributors:
@ -28,23 +28,23 @@
# Ryan S. Elliott # Ryan S. Elliott
# #
# - Find KIM-API-V2 # - Find KIM-API
# #
# sets standard pkg_check_modules variables plus: # sets standard pkg_check_modules variables plus:
# #
# KIM-API-V2-CMAKE_C_COMPILER # KIM-API-CMAKE_C_COMPILER
# KIM-API-V2-CMAKE_CXX_COMPILER # KIM-API-CMAKE_CXX_COMPILER
# KIM-API-V2-CMAKE_Fortran_COMPILER # KIM-API-CMAKE_Fortran_COMPILER
# #
find_package(PkgConfig REQUIRED) find_package(PkgConfig REQUIRED)
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
pkg_check_modules(KIM-API-V2 REQUIRED libkim-api-v2>=2.0) pkg_check_modules(KIM-API REQUIRED libkim-api>=2.0)
pkg_get_variable(KIM-API-V2-CMAKE_C_COMPILER libkim-api-v2 CMAKE_C_COMPILER) pkg_get_variable(KIM-API-V2-CMAKE_C_COMPILER libkim-api CMAKE_C_COMPILER)
pkg_get_variable(KIM-API-V2-CMAKE_CXX_COMPILER libkim-api-v2 CMAKE_CXX_COMPILER) pkg_get_variable(KIM-API-V2-CMAKE_CXX_COMPILER libkim-api CMAKE_CXX_COMPILER)
pkg_get_variable(KIM-API-V2_CMAKE_Fortran_COMPILER libkim-api-v2 CMAKE_Fortran_COMPILER) pkg_get_variable(KIM-API-V2_CMAKE_Fortran_COMPILER libkim-api CMAKE_Fortran_COMPILER)
# handle the QUIETLY and REQUIRED arguments and set KIM-API-V2_FOUND to TRUE # handle the QUIETLY and REQUIRED arguments and set KIM-API_FOUND to TRUE
# if all listed variables are TRUE # if all listed variables are TRUE
find_package_handle_standard_args(KIM-API-V2 REQUIRED_VARS KIM-API-V2_LIBRARIES) find_package_handle_standard_args(KIM-API REQUIRED_VARS KIM-API_LIBRARIES)

View File

@ -195,7 +195,7 @@ https://openkim.org/browse/models/by-model-drivers
If DOWNLOAD_KIM is set, the KIM library will be downloaded and built If DOWNLOAD_KIM is set, the KIM library will be downloaded and built
inside the CMake build directory. If the KIM library is already on inside the CMake build directory. If the KIM library is already on
your system (in a location CMake cannot find it), set the PKG_CONFIG_PATH your system (in a location CMake cannot find it), set the PKG_CONFIG_PATH
environment variable so that libkim-api-v2 can be found. environment variable so that libkim-api can be found.
[Traditional make]: [Traditional make]:

View File

@ -18,7 +18,7 @@ parser = ArgumentParser(prog='Install.py',
# settings # settings
thisdir = fullpath('.') thisdir = fullpath('.')
version = "kim-api-v2-2.0.1" version = "kim-api-2.0.2"
# help message # help message
@ -154,7 +154,7 @@ if buildflag:
# add all OpenKIM models, if desired # add all OpenKIM models, if desired
if everythingflag: if everythingflag:
print("Adding all OpenKIM models, this will take a while ...") print("Adding all OpenKIM models, this will take a while ...")
cmd = '%s/bin/kim-api-v2-collections-management install system OpenKIM' % (kimdir) cmd = '%s/bin/kim-api-collections-management install system OpenKIM' % (kimdir)
txt = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) txt = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
if verboseflag: if verboseflag:
print(txt.decode("UTF-8")) print(txt.decode("UTF-8"))
@ -171,7 +171,7 @@ if addflag:
sys.exit("\nkim-api is not installed") sys.exit("\nkim-api is not installed")
# download single model # download single model
cmd = '%s/bin/kim-api-v2-collections-management install system %s' % (kimdir.decode("UTF-8"), addmodelname) cmd = '%s/bin/kim-api-collections-management install system %s' % (kimdir.decode("UTF-8"), addmodelname)
txt = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) txt = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
if verboseflag: if verboseflag:
print(txt.decode("UTF-8")) print(txt.decode("UTF-8"))

View File

@ -23,11 +23,11 @@ kim_PREFIX := $(if $(shell printf -- "$${PKG_CONFIG_PATH}"),$(kim_PREFIX):$(she
# there is no usable libcurl installation # there is no usable libcurl installation
ifeq ($(shell curl-config --version 2> /dev/null),) ifeq ($(shell curl-config --version 2> /dev/null),)
kim_SYSINC := $(shell export PKG_CONFIG_PATH="$(kim_PREFIX)"; pkg-config --cflags libkim-api-v2 2> /dev/null) kim_SYSINC := $(shell export PKG_CONFIG_PATH="$(kim_PREFIX)"; pkg-config --cflags libkim-api 2> /dev/null)
kim_SYSLIB := $(shell export PKG_CONFIG_PATH="$(kim_PREFIX)"; pkg-config --libs libkim-api-v2 2> /dev/null) kim_SYSLIB := $(shell export PKG_CONFIG_PATH="$(kim_PREFIX)"; pkg-config --libs libkim-api 2> /dev/null)
else else
kim_SYSINC := $(shell export PKG_CONFIG_PATH="$(kim_PREFIX)"; pkg-config --cflags libkim-api-v2 2> /dev/null) $(shell curl-config --cflags) -DLMP_KIM_CURL kim_SYSINC := $(shell export PKG_CONFIG_PATH="$(kim_PREFIX)"; pkg-config --cflags libkim-api 2> /dev/null) $(shell curl-config --cflags) -DLMP_KIM_CURL
kim_SYSLIB := $(shell export PKG_CONFIG_PATH="$(kim_PREFIX)"; pkg-config --libs libkim-api-v2 2> /dev/null) $(shell curl-config --libs) kim_SYSLIB := $(shell export PKG_CONFIG_PATH="$(kim_PREFIX)"; pkg-config --libs libkim-api 2> /dev/null) $(shell curl-config --libs)
endif endif
ifeq ($(strip $(kim_SYSINC)),) ifeq ($(strip $(kim_SYSINC)),)

View File

@ -17,7 +17,7 @@ As of KIM API version 2, the KIM package also provides a LAMMPS command
to perform queries through the OpenKIM web API. This feature requires to perform queries through the OpenKIM web API. This feature requires
that the CURL library (libcurl) development package and its configuration that the CURL library (libcurl) development package and its configuration
query tool, curl-config, are installed. The provided Makefile.lammps query tool, curl-config, are installed. The provided Makefile.lammps
is set up to automatically detect this. is set up to automatically detect this.
----------------- -----------------
@ -26,17 +26,17 @@ Instructions:
1. Configure lammps for use with the kim-api library installed in this directory 1. Configure lammps for use with the kim-api library installed in this directory
# replace X.Y.Z as appropriate here and below # replace X.Y.Z as appropriate here and below
$ printf "${PWD}/installed-kim-api-vX-X.Y.Z" > ./kim-prefix.txt $ printf "${PWD}/installed-kim-api-X-X.Y.Z" > ./kim-prefix.txt
2. Download and unpack the kim-api 2. Download and unpack the kim-api
$ wget http://s3.openkim.org/kim-api/kim-api-vX-X.Y.Z.txz $ wget http://s3.openkim.org/kim-api/kim-api-X.Y.Z.txz
$ tar zxvf kim-api-vX-X.Y.Z.txz $ tar zxvf kim-api-X.Y.Z.txz
# configure the kim-api # configure the kim-api
$ cd kim-api-vX-X.Y.Z $ cd kim-api-X.Y.Z
$ mkdir build && cd build $ mkdir build && cd build
$ cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}/../../installed-kim-api-vX-X.Y.Z $ cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}/../../installed-kim-api-X.Y.Z
3. Build and install the kim-api and model 3. Build and install the kim-api and model
@ -46,14 +46,14 @@ $ make install
4. Remove source and build files 4. Remove source and build files
$ cd ../../ $ cd ../../
$ rm -rf kim-api-vX-X.Y.Z $ rm -rf kim-api-X.Y.Z
$ rm -rf kim-api-vX-X.Y.Z.txz $ rm -rf kim-api-X.Y.Z.txz
5. To add 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) desired value)
$ source ${PWD}/kim-api-vX-X.Y.Z/bin/kim-api-vX-activate $ source ${PWD}/kim-api-X.Y.Z/bin/kim-api-activate
$ kim-api-vX-collections-management install system Pair_Johnson_Fe__MO_857282754307_002 $ kim-api-collections-management install system Pair_Johnson_Fe__MO_857282754307_002
----------------- -----------------