Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for kim-api-2.0.2 release #1392

Merged
merged 1 commit into from Mar 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 13 additions & 13 deletions cmake/CMakeLists.txt
Expand Up @@ -207,7 +207,7 @@ include_directories(${LAMMPS_SOURCE_DIR})
if(PKG_USER-ADIOS)
# The search for ADIOS2 must come before MPI because
# 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)
find_package(ADIOS2 REQUIRED)
list(APPEND LAMMPS_LINK_LIBS adios2::adios2)
Expand Down Expand Up @@ -663,19 +663,19 @@ endif()
if(PKG_KIM)
find_package(CURL)
if(CURL_FOUND)
include_directories(${CURL_INCLUDE_DIRS})
include_directories(${CURL_INCLUDE_DIRS})
list(APPEND LAMMPS_LINK_LIBS ${CURL_LIBRARIES})
add_definitions(-DLMP_KIM_CURL)
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)
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(Fortran)
include(ExternalProject)
ExternalProject_Add(kim_build
URL https://s3.openkim.org/kim-api/kim-api-v2-2.0.1.txz
URL_MD5 289c57f0c3bc2a549662283cac1c4ef1
URL https://s3.openkim.org/kim-api/kim-api-2.0.2.txz
URL_MD5 537d9c0abd30f85b875ebb584f9143fa
BINARY_DIR build
CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
Expand All @@ -684,17 +684,17 @@ if(PKG_KIM)
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
)
ExternalProject_get_property(kim_build INSTALL_DIR)
set(KIM-API-V2_INCLUDE_DIRS ${INSTALL_DIR}/include/kim-api-v2)
set(KIM-API-V2_LDFLAGS ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libkim-api-v2${CMAKE_SHARED_LIBRARY_SUFFIX})
set(KIM-API_INCLUDE_DIRS ${INSTALL_DIR}/include/kim-api)
set(KIM-API_LDFLAGS ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libkim-api${CMAKE_SHARED_LIBRARY_SUFFIX})
list(APPEND LAMMPS_DEPS kim_build)
else()
find_package(KIM-API-V2)
if(NOT KIM-API-V2_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")
find_package(KIM-API)
if(NOT KIM-API_FOUND)
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()
list(APPEND LAMMPS_LINK_LIBS "${KIM-API-V2_LDFLAGS}")
include_directories(${KIM-API-V2_INCLUDE_DIRS})
list(APPEND LAMMPS_LINK_LIBS "${KIM-API_LDFLAGS}")
include_directories(${KIM-API_INCLUDE_DIRS})
endif()

if(PKG_MESSAGE)
Expand Down
Expand Up @@ -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.
#
# Contributors:
Expand All @@ -28,23 +28,23 @@
# Ryan S. Elliott
#

# - Find KIM-API-V2
# - Find KIM-API
#
# sets standard pkg_check_modules variables plus:
#
# KIM-API-V2-CMAKE_C_COMPILER
# KIM-API-V2-CMAKE_CXX_COMPILER
# KIM-API-V2-CMAKE_Fortran_COMPILER
# KIM-API-CMAKE_C_COMPILER
# KIM-API-CMAKE_CXX_COMPILER
# KIM-API-CMAKE_Fortran_COMPILER
#
find_package(PkgConfig REQUIRED)
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_CXX_COMPILER libkim-api-v2 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_C_COMPILER libkim-api CMAKE_C_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 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
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)
2 changes: 1 addition & 1 deletion doc/src/Build_extras.txt
Expand Up @@ -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
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
environment variable so that libkim-api-v2 can be found.
environment variable so that libkim-api can be found.

[Traditional make]:

Expand Down
6 changes: 3 additions & 3 deletions lib/kim/Install.py
Expand Up @@ -18,7 +18,7 @@
# settings

thisdir = fullpath('.')
version = "kim-api-v2-2.0.1"
version = "kim-api-2.0.2"

# help message

Expand Down Expand Up @@ -154,7 +154,7 @@
# add all OpenKIM models, if desired
if everythingflag:
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)
if verboseflag:
print(txt.decode("UTF-8"))
Expand All @@ -171,7 +171,7 @@
sys.exit("\nkim-api is not installed")

# 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)
if verboseflag:
print(txt.decode("UTF-8"))
8 changes: 4 additions & 4 deletions lib/kim/Makefile.lammps
Expand Up @@ -23,11 +23,11 @@ kim_PREFIX := $(if $(shell printf -- "$${PKG_CONFIG_PATH}"),$(kim_PREFIX):$(she

# there is no usable libcurl installation
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_SYSLIB := $(shell export PKG_CONFIG_PATH="$(kim_PREFIX)"; pkg-config --libs 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 2> /dev/null)
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_SYSLIB := $(shell export PKG_CONFIG_PATH="$(kim_PREFIX)"; pkg-config --libs libkim-api-v2 2> /dev/null) $(shell curl-config --libs)
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 2> /dev/null) $(shell curl-config --libs)
endif

ifeq ($(strip $(kim_SYSINC)),)
Expand Down
20 changes: 10 additions & 10 deletions lib/kim/README
Expand Up @@ -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
that the CURL library (libcurl) development package and its configuration
query tool, curl-config, are installed. The provided Makefile.lammps
is set up to automatically detect this.
is set up to automatically detect this.

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

Expand All @@ -26,17 +26,17 @@ Instructions:
1. Configure lammps for use with the kim-api library installed in this directory

# 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

$ wget http://s3.openkim.org/kim-api/kim-api-vX-X.Y.Z.txz
$ tar zxvf kim-api-vX-X.Y.Z.txz
$ wget http://s3.openkim.org/kim-api/kim-api-X.Y.Z.txz
$ tar zxvf kim-api-X.Y.Z.txz

# configure the kim-api
$ cd kim-api-vX-X.Y.Z
$ cd kim-api-X.Y.Z
$ 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

Expand All @@ -46,14 +46,14 @@ $ make install
4. Remove source and build files

$ cd ../../
$ rm -rf kim-api-vX-X.Y.Z
$ rm -rf kim-api-vX-X.Y.Z.txz
$ rm -rf kim-api-X.Y.Z
$ rm -rf kim-api-X.Y.Z.txz

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

$ source ${PWD}/kim-api-vX-X.Y.Z/bin/kim-api-vX-activate
$ kim-api-vX-collections-management install system Pair_Johnson_Fe__MO_857282754307_002
$ source ${PWD}/kim-api-X.Y.Z/bin/kim-api-activate
$ kim-api-collections-management install system Pair_Johnson_Fe__MO_857282754307_002


-----------------
Expand Down