Unverified Commit 01f97f19 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

Merge branch 'master' into restrain_lbound

parents 0796a703 80311891
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -9,6 +9,7 @@
*.d
*.d
*.x
*.x
*.exe
*.exe
*.sif
*.dll
*.dll
*.pyc
*.pyc
__pycache__
__pycache__
+240 −259

File changed.

Preview size limit exceeded, changes collapsed.

cmake/FindLAMMPS.cmake.in

deleted100644 → 0
+0 −48
Original line number Original line Diff line number Diff line
# - Find liblammps
# Find the native liblammps headers and libraries.
#
# The following variables will set:
#  LAMMPS_INCLUDE_DIRS - where to find lammps/library.h, etc.
#  LAMMPS_LIBRARIES    - List of libraries when using lammps.
#  LAMMPS_API_DEFINES  - lammps library api defines
#  LAMMPS_VERSION      - lammps library version 
#  LAMMPS_FOUND        - True if liblammps found.
#
# In addition a LAMMPS::LAMMPS imported target is getting created.
#
#  LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
#  http://lammps.sandia.gov, Sandia National Laboratories
#  Steve Plimpton, sjplimp@sandia.gov
#
#  Copyright (2003) Sandia Corporation.  Under the terms of Contract
#  DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
#  certain rights in this software.  This software is distributed under
#  the GNU General Public License.
#
#  See the README file in the top-level LAMMPS directory.
#

find_package(PkgConfig)

pkg_check_modules(PC_LAMMPS liblammps@LAMMPS_LIB_SUFFIX@)
find_path(LAMMPS_INCLUDE_DIR lammps/library.h HINTS ${PC_LAMMPS_INCLUDE_DIRS} @CMAKE_INSTALL_FULL_INCLUDEDIR@)

set(LAMMPS_VERSION @LAMMPS_VERSION@)
set(LAMMPS_API_DEFINES @LAMMPS_API_DEFINES@)

find_library(LAMMPS_LIBRARY NAMES lammps@LAMMPS_LIB_SUFFIX@ HINTS ${PC_LAMMPS_LIBRARY_DIRS} @CMAKE_INSTALL_FULL_LIBDIR@)

set(LAMMPS_INCLUDE_DIRS "${LAMMPS_INCLUDE_DIR}")
set(LAMMPS_LIBRARIES "${LAMMPS_LIBRARY}")

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LAMMPS_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(LAMMPS REQUIRED_VARS LAMMPS_LIBRARY LAMMPS_INCLUDE_DIR VERSION_VAR LAMMPS_VERSION)

mark_as_advanced(LAMMPS_INCLUDE_DIR LAMMPS_LIBRARY)

if(LAMMPS_FOUND AND NOT TARGET LAMMPS::LAMMPS)
  add_library(LAMMPS::LAMMPS UNKNOWN IMPORTED)
  set_target_properties(LAMMPS::LAMMPS PROPERTIES IMPORTED_LOCATION "${LAMMPS_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES "${LAMMPS_INCLUDE_DIR}" INTERFACE_COMPILE_DEFINITIONS "${LAMMPS_API_DEFINES}")
endif()
+87 −0
Original line number Original line Diff line number Diff line
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
include(CMakeFindDependencyMacro)
if(@BUILD_MPI@)
  find_dependency(MPI REQUIRED CXX)
endif()
if(@PKG_KSPACE@)
  if(@FFT@ STREQUAL "FFTW3")
    find_dependency(@FFTW@ REQUIRED MODULE)
  endif()
endif()
if(NOT @BUILD_SHARED_LIBS@)
  if(@BUILD_OMP@)
    find_dependency(OpenMP REQUIRED)
  endif()
  if(@WITH_JPEG@)
    find_dependency(JPEG REQUIRED)
  endif()
  if(@WITH_PNG@)
    find_dependency(PNG REQUIRED)
    find_dependency(ZLIB REQUIRED)
  endif()
  if(@PKG_KIM@)
    find_dependency(PkgConfig REQUIRED)
    pkg_check_modules(KIM-API REQUIRED IMPORTED_TARGET libkim-api>=@KIM-API_MIN_VERSION@)
    if(@CURL_FOUND@)
      find_dependency(CURL REQUIRED)
    endif()
  endif()
  if(@PKG_USER-SMD@)
    find_dependency(Eigen3 NO_MODULE REQUIRED)
  endif()
  if(@PKG_USER-SCAFACOS@)
    find_dependency(PkgConfig REQUIRED)
    find_ependency(GSL REQUIRED)
    find_dependency(MPI REQUIRED C Fortran)
    pkg_check_modules(SCAFACOS REQUIRED IMPORTED_TARGET scafacos)
  endif()
  if(@PKG_PYTHON@ AND NOT CMAKE_VERSION VERSION_LESS 3.12)
    find_package(Python REQUIRED COMPONENTS Development)
  endif()
  if(@PKG_COMPRESS@)
    find_dependency(ZLIB REQUIRED)
  endif()
  if(@PKG_KOKKOS@)
    if(@EXTERNAL_KOKKOS@)
      find_dependency(Kokkos 3 REQUIRED)
    endif()
  endif()
  if(@PKG_VORONOI@)
    find_dependency(VORO REQUIRED)
  endif()
  if(@PKG_USER-INTEL@)
    if(@INTEL_LRT_MODE@ STREQUAL "THREADS")
      find_dependency(Threads REQUIRED)
    endif()
    if(@TBB_MALLOC_FOUND@)
      find_ependency(TBB_MALLOC REQUIRED)
    endif()
  endif()
  if(@PKG_USER-ADIOS@)
    find_ependency(ADIOS2 REQUIRED)
  endif()
  if(@PKG_LATTE@)
    find_ependency(LATTE REQUIRED)
  endif()
  if(@PKG_MESSAGE@)
    if(@MESSAGE_ZMQ@)
      find_ependency(ZMQ REQUIRED)
    endif()
  endif()
  if(@PKG_MSCG@)
    find_ependency(GSL REQUIRED)
    find_ependency(MSCG REQUIRED)
  endif()
  if(@USER-NETCDF@)
    if(@NETCDF_FOUND@)
      find_ependency(NetCDF REQUIRED)
    endif()
    if(@PNETCDF_FOUND@)
      find_ependency(PNetCDF REQUIRED)
    endif()
  endif()
  if(@PKG_QUIP@)
    find_ependency(QUIP REQUIRED)
  endif()
endif()
include("${CMAKE_CURRENT_LIST_DIR}/LAMMPS_Targets.cmake")
+37 −5
Original line number Original line Diff line number Diff line
###############################################################################
###############################################################################
# Build documentation
# Build documentation
###############################################################################
###############################################################################
option(BUILD_DOC "Build LAMMPS documentation" OFF)
option(BUILD_DOC "Build LAMMPS HTML documentation" OFF)
if(BUILD_DOC)
if(BUILD_DOC)
  include(ProcessorCount)
  ProcessorCount(NPROCS)
  find_package(PythonInterp 3 REQUIRED)
  find_package(PythonInterp 3 REQUIRED)


  set(VIRTUALENV ${PYTHON_EXECUTABLE} -m virtualenv)
  set(VIRTUALENV ${PYTHON_EXECUTABLE} -m virtualenv)
@@ -26,15 +24,49 @@ if(BUILD_DOC)
    COMMAND ${DOCENV_BINARY_DIR}/pip install --upgrade ${LAMMPS_DOC_DIR}/utils/converters
    COMMAND ${DOCENV_BINARY_DIR}/pip install --upgrade ${LAMMPS_DOC_DIR}/utils/converters
  )
  )


  # download mathjax distribution and unpack to folder "mathjax"
  file(DOWNLOAD "https://github.com/mathjax/MathJax/archive/3.0.5.tar.gz"
    "${CMAKE_CURRENT_BINARY_DIR}/mathjax.tar.gz"
    EXPECTED_MD5 5d9d3799cce77a1a95eee6be04eb68e7)

  if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/mathjax)
    execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf mathjax.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
    file(GLOB MATHJAX_VERSION_DIR ${CMAKE_CURRENT_BINARY_DIR}/MathJax-*)
    execute_process(COMMAND ${CMAKE_COMMAND} -E rename ${MATHJAX_VERSION_DIR} ${CMAKE_CURRENT_BINARY_DIR}/mathjax)
  endif()
  file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/_static/mathjax)
  file(COPY ${CMAKE_CURRENT_BINARY_DIR}/mathjax/es5 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/html/_static/mathjax/)

  # note, this may run in parallel with other tasks, so we must not use multiple processes here
  add_custom_command(
  add_custom_command(
    OUTPUT html
    OUTPUT html
    DEPENDS ${DOC_SOURCES} docenv requirements.txt
    DEPENDS ${DOC_SOURCES} docenv requirements.txt
    COMMAND ${DOCENV_BINARY_DIR}/sphinx-build -j ${NPROCS} -b html -c ${LAMMPS_DOC_DIR}/utils/sphinx-config -d ${CMAKE_BINARY_DIR}/doctrees ${LAMMPS_DOC_DIR}/src html
    COMMAND ${DOCENV_BINARY_DIR}/sphinx-build -b html -c ${LAMMPS_DOC_DIR}/utils/sphinx-config -d ${CMAKE_BINARY_DIR}/doctrees ${LAMMPS_DOC_DIR}/src html
  )

  # copy selected image files to html output tree
  file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/html/JPG)
  set(HTML_EXTRA_IMAGES balance_nonuniform.jpg balance_rcb.jpg
    balance_uniform.jpg bow_tutorial_01.png bow_tutorial_02.png
    bow_tutorial_03.png bow_tutorial_04.png bow_tutorial_05.png
    dump1.jpg dump2.jpg examples_mdpd.gif gran_funnel.png gran_mixer.png
    hop1.jpg hop2.jpg saed_ewald_intersect.jpg saed_mesh.jpg
    screenshot_atomeye.jpg screenshot_gl.jpg screenshot_pymol.jpg
    screenshot_vmd.jpg sinusoid.jpg xrd_mesh.jpg)
  set(HTML_IMAGE_TARGETS "")
  foreach(_IMG ${HTML_EXTRA_IMAGES})
    string(PREPEND _IMG JPG/)
    list(APPEND HTML_IMAGE_TARGETS "html/${_IMG}")
    add_custom_command(
      OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/html/${_IMG}
      DEPENDS ${LAMMPS_DOC_DIR}/src/${_IMG} html/JPG
      COMMAND ${CMAKE_COMMAND} -E copy ${LAMMPS_DOC_DIR}/src/${_IMG} ${CMAKE_BINARY_DIR}/html/${_IMG}
    )
    )
  endforeach()


  add_custom_target(
  add_custom_target(
    doc ALL
    doc ALL
    DEPENDS html
    DEPENDS html html/_static/mathjax/es5 ${HTML_IMAGE_TARGETS}
    SOURCES ${LAMMPS_DOC_DIR}/utils/requirements.txt ${DOC_SOURCES}
    SOURCES ${LAMMPS_DOC_DIR}/utils/requirements.txt ${DOC_SOURCES}
  )
  )


Loading