Unverified Commit e6df92e6 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #1011 from ellio167/kim-v2-update

KIM v2 update
parents e6a7c8b0 978b716f
Loading
Loading
Loading
Loading
+19 −13
Original line number Diff line number Diff line
@@ -656,28 +656,34 @@ if(PKG_USER-VTK)
endif()

if(PKG_KIM)
  option(DOWNLOAD_KIM "Download KIM-API v1 from OpenKIM instead of using an already installed one)" OFF)
  option(DOWNLOAD_KIM "Download KIM-API v2 from OpenKIM instead of using an already installed one" OFF)
  if(DOWNLOAD_KIM)
    message(STATUS "KIM-API v1 download requested - we will build our own")
    message(STATUS "KIM-API v2 download requested - we will build our own")
    enable_language(C)
    enable_language(Fortran)
    include(ExternalProject)
    ExternalProject_Add(kim_build
      URL https://github.com/openkim/kim-api/archive/v1.9.5.tar.gz
      URL_MD5 9f66efc128da33039e30659f36fc6d00
      BUILD_IN_SOURCE 1
      CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR>
      URL https://s3.openkim.org/kim-api/kim-api-v2-2.0.0.txz
      URL_MD5 1ff8f563ad5991f7a2a25b35a13d7308
      BINARY_DIR build
      CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
                 -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
                 -DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER}
                 -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
                 -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
      )
    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)
    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})
    list(APPEND LAMMPS_DEPS kim_build)
  else()
    find_package(KIM)
    if(NOT KIM_FOUND)
      message(FATAL_ERROR "KIM-API v1 not found, help CMake to find it by setting KIM_LIBRARY and KIM_INCLUDE_DIR, or set DOWNLOAD_KIM=ON to download it")
    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")
    endif()
  endif()
  list(APPEND LAMMPS_LINK_LIBS ${KIM_LIBRARIES})
  include_directories(${KIM_INCLUDE_DIRS})
  list(APPEND LAMMPS_LINK_LIBS "${KIM-API-V2_LDFLAGS}")
  include_directories(${KIM-API-V2_INCLUDE_DIRS})
endif()

if(PKG_MESSAGE)
+50 −0
Original line number Diff line number Diff line
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the Common Development
# and Distribution License Version 1.0 (the "License").
#
# You can obtain a copy of the license at
# http://www.opensource.org/licenses/CDDL-1.0.  See the License for the
# specific language governing permissions and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each file and
# include the License file in a prominent location with the name LICENSE.CDDL.
# If applicable, add the following below this CDDL HEADER, with the fields
# enclosed by brackets "[]" replaced with your own identifying information:
#
# Portions Copyright (c) [yyyy] [name of copyright owner]. All rights reserved.
#
# CDDL HEADER END
#

#
# Copyright (c) 2013--2018, Regents of the University of Minnesota.
# All rights reserved.
#
# Contributors:
#    Richard Berger
#    Christoph Junghans
#    Ryan S. Elliott
#

# - Find KIM-API-V2
#
# 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
#
find_package(PkgConfig REQUIRED)
include(FindPackageHandleStandardArgs)

pkg_check_modules(KIM-API-V2 REQUIRED libkim-api-v2>=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)

# handle the QUIETLY and REQUIRED arguments and set KIM-API-V2_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(KIM-API-V2 REQUIRED_VARS KIM-API-V2_LIBRARIES)

cmake/Modules/FindKIM.cmake

deleted100644 → 0
+0 −22
Original line number Diff line number Diff line
# - Find kim
# Find the native KIM headers and libraries.
#
#  KIM_INCLUDE_DIRS - where to find kim.h, etc.
#  KIM_LIBRARIES    - List of libraries when using kim.
#  KIM_FOUND        - True if kim found.
#

find_path(KIM_INCLUDE_DIR KIM_API.h PATH_SUFFIXES kim-api-v1)

find_library(KIM_LIBRARY NAMES kim-api-v1)

set(KIM_LIBRARIES ${KIM_LIBRARY})
set(KIM_INCLUDE_DIRS ${KIM_INCLUDE_DIR})

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set KIM_FOUND to TRUE
# if all listed variables are TRUE

find_package_handle_standard_args(KIM DEFAULT_MSG KIM_LIBRARY KIM_INCLUDE_DIR)

mark_as_advanced(KIM_INCLUDE_DIR KIM_LIBRARY )
+5 −9
Original line number Diff line number Diff line
@@ -191,16 +191,12 @@ package?" page.

[CMake build]:

-D DOWNLOAD_KIM=value    # download OpenKIM API v1 for build, value = no (default) or yes
-D KIM_LIBRARY=path      # KIM library file (only needed if a custom location)
-D KIM_INCLUDE_DIR=path  # KIM include directory (only needed if a custom location) :pre
-D DOWNLOAD_KIM=value           # download OpenKIM API v2 for build, value = no (default) or yes :pre

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), KIM_LIBRARY is the
filename (plus path) of the KIM library file, not the directory the
library file is in.  KIM_INCLUDE_DIR is the directory the KIM include
file is in.
your system (in a location CMake cannot find it), set the PKG_CONFIG_PATH
environment variable so that libkim-api-v2 can be found.

[Traditional make]:

@@ -214,8 +210,8 @@ make lib-kim args="-b " # (re-)install KIM API lib with only example models
make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_001"  # ditto plus one model
make lib-kim args="-b -a everything"     # install KIM API lib with all models
make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002"       # add one model or model driver
make lib-kim args="-p /usr/local/kim-api" # use an existing KIM API installation at the provided location
make lib-kim args="-p /usr/local/kim-api -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver :pre
make lib-kim args="-p /usr/local" # use an existing KIM API installation at the provided location
make lib-kim args="-p /usr/local -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver :pre

:line

+0 −10
Original line number Diff line number Diff line
@@ -6988,12 +6988,6 @@ The atom style defined does not have this attribute. :dd

The atom style defined does not have these attributes. :dd

{KIM neighbor iterator exceeded range} :dt

This should not happen.  It likely indicates a bug
in the KIM implementation of the interatomic potential
where it is requesting neighbors incorrectly. :dd

{KOKKOS package does not yet support comm_style tiled} :dt

Self-explanatory. :dd
@@ -10185,10 +10179,6 @@ valid. :dd

Self-explanatory. :dd

{Unrecognized virial argument in pair_style command} :dt

Only two options are supported: LAMMPSvirial and KIMvirial :dd

{Unsupported mixing rule in kspace_style ewald/disp} :dt

Only geometric mixing is supported. :dd
Loading