Commit 38c6c190 authored by Stan Moore's avatar Stan Moore
Browse files

Merge branch 'master' into team

parents a72f3cfb 394fd751
Loading
Loading
Loading
Loading
+20 −14
Changes for cmake/CMakeLists.txt: 20 added lines, 14 removed lines.
Original line number Diff line number Diff line
@@ -453,7 +453,7 @@ if(PKG_VORONOI)
    set(VORO_BUILD_OPTIONS CXX=${CMAKE_CXX_COMPILER} CFLAGS=${VORO_BUILD_CFLAGS})

    ExternalProject_Add(voro_build
      URL http://math.lbl.gov/voro++/download/dir/voro++-0.4.6.tar.gz
      URL https://download.lammps.org/thirdparty/voro++-0.4.6.tar.gz
      URL_MD5 2338b824c3b7b25590e18e8df5d68af9
      CONFIGURE_COMMAND "" BUILD_COMMAND make ${VORO_BUILD_OPTIONS} BUILD_IN_SOURCE 1 INSTALL_COMMAND ""
      )
@@ -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
Changes for cmake/Modules/FindKIM-API-V2.cmake: 50 added lines, 0 removed lines.
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
Changes for cmake/Modules/FindKIM.cmake: 0 added lines, 22 removed lines.
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 )
+2 −0
Changes for cmake/Modules/StyleHeaderUtils.cmake: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ function(CreateStyleHeader path filename)
        list(REMOVE_AT ARGV 0 1)
        set(header_list)
        foreach(FNAME ${ARGV})
            set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${FNAME}")
            get_filename_component(FNAME ${FNAME} NAME)
            list(APPEND header_list ${FNAME})
        endforeach()
@@ -61,6 +62,7 @@ function(CreateStyleHeader path filename)
    message(STATUS "Generating ${filename}...")
    file(WRITE "${path}/${filename}.tmp" "${temp}" )
    execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${path}/${filename}.tmp" "${path}/${filename}")
    set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${path}/${filename}")
endfunction(CreateStyleHeader)

function(GenerateStyleHeader path property style)
+1 −0
Changes for doc/.gitignore: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
/old
/html
/latex
/spelling
Loading