Unverified Commit 5556567e authored by Jacob Gissinger's avatar Jacob Gissinger Committed by GitHub
Browse files

Merge pull request #46 from lammps/master

rebase
parents b7ee3606 c3acb3e4
Loading
Loading
Loading
Loading
+21 −0
Original line number Original line Diff line number Diff line
---
name: Generic Issue
about: For issues that do not fit any of the other categories
title: "_Replace With a Descriptive Title_"
labels: 
assignees: ''

---

**Summary**

_Please provide a clear and concise description of what this issue report is about._

**LAMMPS Version and Platform**

_Please specify precisely which LAMMPS version this issue was detected with (the first line of the output) and what platform (operating system and its version, hardware) you are running on. If possible, test with the most recent LAMMPS patch version_

**Details**

_Please explain the issue in detail here_
+15 −0
Original line number Original line Diff line number Diff line
---
name: Request for Help
about: "Don't post help requests here, email the lammps-users mailing list"
title: ""
labels: invalid
assignees: ''

---

Please **do not** post requests for help (e.g. with installing or using LAMMPS) here.
Instead send an e-mail to the lammps-users mailing list.

This issue tracker is for tracking LAMMPS development related issues only.

Thanks for your cooperation.
+5 −8
Original line number Original line Diff line number Diff line
@@ -4,22 +4,19 @@ _Briefly describe the new feature(s), enhancement(s), or bugfix(es) included in


**Related Issues**
**Related Issues**


__If this addresses an open GitHub Issue, mention the issue number here. Use the phrases `fixes #221` or `closes #135`, when you want those issues to be automatically closed when the pull request is merged_
_If this addresses an open GitHub issue for this project, please mention the issue number here, and describe the relation. Use the phrases `fixes #221` or `closes #135`, when you want an issue to be automatically closed when the pull request is merged_


**Author(s)**
**Author(s)**


_Please state name and affiliation of the author or authors that should be credited with the changes in this pull request. If this pull request adds new files to the distribution, please also provide a suitable "long-lived" e-mail address (e.g. from gmail, yahoo, outlook, etc.) for the *corresponding* author, i.e. the person the LAMMPS developers can contact directly with questions and requests related to maintenance and support of this code. now and in the future_
_Please state name and affiliation of the author or authors that should be credited with the changes in this pull request. If this pull request adds new files to the distribution, please also provide a suitable "long-lived" e-mail address (ideally something that can outlive your institution's e-mail, in case you change jobs) for the *corresponding* author, i.e. the person the LAMMPS developers can contact directly with questions and requests related to maintenance and support of this contributed code._


**Licensing**
**Licensing**


By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under the GNU General Public License version 2.
By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).

_Please complete the following statement by adding "yes" or "no":_
My contribution may be re-licensed as LGPL (for use of LAMMPS as a library linked to proprietary software):


**Backward Compatibility**
**Backward Compatibility**


_Please state whether any changes in the pull request break backward compatibility for inputs, and - if yes - explain what has been changed and why_
_Please state whether any changes in the pull request will break backward compatibility for inputs, and - if yes - explain what has been changed and why_


**Implementation Notes**
**Implementation Notes**


@@ -27,7 +24,7 @@ _Provide any relevant details about how the changes are implemented, how correct


**Post Submission Checklist**
**Post Submission Checklist**


_Please check the fields below as they are completed **after** the pull request has been submitted_
_Please check the fields below as they are completed **after** the pull request has been submitted. Delete lines that don't apply_


- [ ] The feature or features in this pull request is complete
- [ ] The feature or features in this pull request is complete
- [ ] Licensing information is complete
- [ ] Licensing information is complete
+70 −15
Original line number Original line Diff line number Diff line
@@ -11,6 +11,8 @@ get_filename_component(LAMMPS_LIB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../lib
get_filename_component(LAMMPS_LIB_BINARY_DIR ${CMAKE_BINARY_DIR}/lib ABSOLUTE)
get_filename_component(LAMMPS_LIB_BINARY_DIR ${CMAKE_BINARY_DIR}/lib ABSOLUTE)
get_filename_component(LAMMPS_DOC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../doc ABSOLUTE)
get_filename_component(LAMMPS_DOC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../doc ABSOLUTE)


find_package(Git)

# by default, install into $HOME/.local (not /usr/local), so that no root access (and sudo!!) is needed
# by default, install into $HOME/.local (not /usr/local), so that no root access (and sudo!!) is needed
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
  set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local" CACHE PATH "default install path" FORCE )
  set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local" CACHE PATH "default install path" FORCE )
@@ -85,7 +87,7 @@ string(TOUPPER "${CMAKE_BUILD_TYPE}" BTYPE)
# this is fast, so check for it all the time
# this is fast, so check for it all the time
message(STATUS "Running check for auto-generated files from make-based build system")
message(STATUS "Running check for auto-generated files from make-based build system")
file(GLOB SRC_AUTOGEN_FILES ${LAMMPS_SOURCE_DIR}/style_*.h)
file(GLOB SRC_AUTOGEN_FILES ${LAMMPS_SOURCE_DIR}/style_*.h)
list(APPEND SRC_AUTOGEN_FILES ${LAMMPS_SOURCE_DIR}/lmpinstalledpkgs.h)
list(APPEND SRC_AUTOGEN_FILES ${LAMMPS_SOURCE_DIR}/lmpinstalledpkgs.h ${LAMMPS_SOURCE_DIR}/lmpgitversion.h)
foreach(_SRC ${SRC_AUTOGEN_FILES})
foreach(_SRC ${SRC_AUTOGEN_FILES})
  get_filename_component(FILENAME "${_SRC}" NAME)
  get_filename_component(FILENAME "${_SRC}" NAME)
  if(EXISTS ${LAMMPS_SOURCE_DIR}/${FILENAME})
  if(EXISTS ${LAMMPS_SOURCE_DIR}/${FILENAME})
@@ -178,7 +180,7 @@ set(DEFAULT_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS DIPOLE GRANULAR
  USER-MEAMC USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF
  USER-MEAMC USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF
  USER-PHONON USER-PLUMED USER-PTM USER-QTB USER-REAXC USER-SCAFACOS
  USER-PHONON USER-PLUMED USER-PTM USER-QTB USER-REAXC USER-SCAFACOS
  USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF USER-VTK
  USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF USER-VTK
  USER-QUIP USER-QMMM USER-YAFF)
  USER-QUIP USER-QMMM USER-YAFF USER-ADIOS)
set(ACCEL_PACKAGES USER-OMP KOKKOS OPT USER-INTEL GPU)
set(ACCEL_PACKAGES USER-OMP KOKKOS OPT USER-INTEL GPU)
set(OTHER_PACKAGES CORESHELL QEQ)
set(OTHER_PACKAGES CORESHELL QEQ)
foreach(PKG ${DEFAULT_PACKAGES})
foreach(PKG ${DEFAULT_PACKAGES})
@@ -201,6 +203,17 @@ endif()


include_directories(${LAMMPS_SOURCE_DIR})
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 
  enable_language(C)
  find_package(ADIOS2 REQUIRED)
  list(APPEND LAMMPS_LINK_LIBS adios2::adios2)
endif()


# do MPI detection after language activation, if MPI for these language is required
# do MPI detection after language activation, if MPI for these language is required
find_package(MPI QUIET)
find_package(MPI QUIET)
option(BUILD_MPI "Build MPI version" ${MPI_FOUND})
option(BUILD_MPI "Build MPI version" ${MPI_FOUND})
@@ -613,6 +626,7 @@ if(PKG_USER-NETCDF)
  add_definitions(-DLMP_HAS_NETCDF -DNC_64BIT_DATA=0x0020)
  add_definitions(-DLMP_HAS_NETCDF -DNC_64BIT_DATA=0x0020)
endif()
endif()



if(PKG_USER-SMD)
if(PKG_USER-SMD)
  option(DOWNLOAD_EIGEN3 "Download Eigen3 instead of using an already installed one)" OFF)
  option(DOWNLOAD_EIGEN3 "Download Eigen3 instead of using an already installed one)" OFF)
  if(DOWNLOAD_EIGEN3)
  if(DOWNLOAD_EIGEN3)
@@ -656,28 +670,34 @@ if(PKG_USER-VTK)
endif()
endif()


if(PKG_KIM)
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)
  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)
    include(ExternalProject)
    ExternalProject_Add(kim_build
    ExternalProject_Add(kim_build
      URL https://github.com/openkim/kim-api/archive/v1.9.5.tar.gz
      URL https://s3.openkim.org/kim-api/kim-api-v2-2.0.1.txz
      URL_MD5 9f66efc128da33039e30659f36fc6d00
      URL_MD5 289c57f0c3bc2a549662283cac1c4ef1
      BUILD_IN_SOURCE 1
      BINARY_DIR build
      CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR>
      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)
    ExternalProject_get_property(kim_build INSTALL_DIR)
    set(KIM_INCLUDE_DIRS ${INSTALL_DIR}/include/kim-api-v1)
    set(KIM-API-V2_INCLUDE_DIRS ${INSTALL_DIR}/include/kim-api-v2)
    set(KIM_LIBRARIES ${INSTALL_DIR}/lib/libkim-api-v1.so)
    set(KIM-API-V2_LDFLAGS ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libkim-api-v2${CMAKE_SHARED_LIBRARY_SUFFIX})
    list(APPEND LAMMPS_DEPS kim_build)
    list(APPEND LAMMPS_DEPS kim_build)
  else()
  else()
    find_package(KIM)
    find_package(KIM-API-V2)
    if(NOT KIM_FOUND)
    if(NOT KIM-API-V2_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")
      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()
  endif()
  endif()
  list(APPEND LAMMPS_LINK_LIBS ${KIM_LIBRARIES})
  list(APPEND LAMMPS_LINK_LIBS "${KIM-API-V2_LDFLAGS}")
  include_directories(${KIM_INCLUDE_DIRS})
  include_directories(${KIM-API-V2_INCLUDE_DIRS})
endif()
endif()


if(PKG_MESSAGE)
if(PKG_MESSAGE)
@@ -1308,6 +1328,40 @@ message(STATUS "Generating lmpinstalledpkgs.h...")
file(WRITE "${LAMMPS_STYLE_HEADERS_DIR}/lmpinstalledpkgs.h.tmp" "${temp}" )
file(WRITE "${LAMMPS_STYLE_HEADERS_DIR}/lmpinstalledpkgs.h.tmp" "${temp}" )
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${LAMMPS_STYLE_HEADERS_DIR}/lmpinstalledpkgs.h.tmp" "${LAMMPS_STYLE_HEADERS_DIR}/lmpinstalledpkgs.h")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${LAMMPS_STYLE_HEADERS_DIR}/lmpinstalledpkgs.h.tmp" "${LAMMPS_STYLE_HEADERS_DIR}/lmpinstalledpkgs.h")


######################################
# Generate lmpgitversion.h
######################################
set(temp "#ifndef LMP_GIT_VERSION_H\n#define LMP_GIT_VERSION_H\n")
set(temp_git_commit "(unknown)")
set(temp_git_branch "(unknown)")
set(temp_git_describe "(unknown)")
set(temp_git_info "false")
if(GIT_FOUND AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.git)
  set(temp_git_info "true")
  execute_process(COMMAND ${GIT_EXECUTABLE} -C ${CMAKE_CURRENT_SOURCE_DIR}/../.git rev-parse HEAD
    OUTPUT_VARIABLE temp_git_commit
    ERROR_QUIET
    OUTPUT_STRIP_TRAILING_WHITESPACE)
  execute_process(COMMAND ${GIT_EXECUTABLE} -C ${CMAKE_CURRENT_SOURCE_DIR}/../.git rev-parse --abbrev-ref HEAD
    OUTPUT_VARIABLE temp_git_branch
    ERROR_QUIET
    OUTPUT_STRIP_TRAILING_WHITESPACE)
  execute_process(COMMAND ${GIT_EXECUTABLE} -C ${CMAKE_CURRENT_SOURCE_DIR}/../.git describe --dirty=-modified
    OUTPUT_VARIABLE temp_git_describe
    ERROR_QUIET
    OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()

set(temp "${temp}const bool LAMMPS_NS::LAMMPS::has_git_info = ${temp_git_info};\n")
set(temp "${temp}const char LAMMPS_NS::LAMMPS::git_commit[] = \"${temp_git_commit}\";\n")
set(temp "${temp}const char LAMMPS_NS::LAMMPS::git_branch[] = \"${temp_git_branch}\";\n")
set(temp "${temp}const char LAMMPS_NS::LAMMPS::git_descriptor[] = \"${temp_git_describe}\";\n")
set(temp "${temp}#endif\n\n")

message(STATUS "Generating lmpgitversion.h...")
file(WRITE "${LAMMPS_STYLE_HEADERS_DIR}/lmpgitversion.h.tmp" "${temp}" )
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${LAMMPS_STYLE_HEADERS_DIR}/lmpgitversion.h.tmp" "${LAMMPS_STYLE_HEADERS_DIR}/lmpgitversion.h")

###########################################
###########################################
# Actually add executable and lib to build
# Actually add executable and lib to build
############################################
############################################
@@ -1354,6 +1408,7 @@ if(BUILD_EXE)
  endif()
  endif()
endif()
endif()



###############################################################################
###############################################################################
# Build documentation
# Build documentation
###############################################################################
###############################################################################
+50 −0
Original line number Original line 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)
Loading