Commit 681be091 authored by Stefan Paquay's avatar Stefan Paquay
Browse files

Merge branch 'master' of github.com:Pakketeretet2/lammps

parents 6618ca22 dd9166f8
Loading
Loading
Loading
Loading
+68 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ src/GPU/* @ndtrung81
src/KOKKOS/*          @stanmoore1
src/KIM/*             @ellio167
src/LATTE/*           @cnegre
src/MESSAGE/*         @sjplimp
src/SPIN/*            @julient31
src/USER-CGDNA/*      @ohenrich
src/USER-CGSDK/*      @akohlmey
@@ -29,19 +30,86 @@ src/USER-MOFFF/* @hheenen
src/USER-MOLFILE/*    @akohlmey
src/USER-NETCDF/*     @pastewka
src/USER-PHONON/*     @lingtikong
src/USER-PTM/*        @pmla
src/USER-OMP/*        @akohlmey
src/USER-QMMM/*       @akohlmey
src/USER-REAXC/*      @hasanmetin
src/USER-SCAFACOS/*   @rhalver
src/USER-TALLY/*      @akohlmey
src/USER-UEF/*        @danicholson
src/USER-VTK/*        @rbberger


# individual files in packages
src/GPU/pair_vashishta_gpu.*        @andeplane
src/KOKKOS/pair_vashishta_kokkos.*  @andeplane
src/MANYBODY/pair_vashishta_table.* @andeplane
src/MANYBODY/pair_atm.*             @sergeylishchuk
src/USER-MISC/fix_bond_react.*      @jrgissing
src/USER-MISC/*_grem.*              @dstelter92
src/USER-MISC/compute_stress_mop*.* @RomainVermorel

# core LAMMPS classes
src/lammps.*              @sjplimp
src/pointers.h            @sjplimp
src/atom.*                @sjplimp
src/atom_vec.*            @sjplimp
src/angle.*               @sjplimp
src/bond.*                @sjplimp
src/comm*.*               @sjplimp
src/compute.*             @sjplimp
src/dihedral.*            @sjplimp
src/domain.*              @sjplimp
src/dump*.*               @sjplimp
src/error.*               @sjplimp
src/finish.*              @sjplimp
src/fix.*                 @sjplimp
src/force.*               @sjplimp
src/group.*               @sjplimp
src/improper.*            @sjplimp
src/kspace.*              @sjplimp
src/lmptyp.h              @sjplimp
src/library.*             @sjplimp
src/main.cpp              @sjplimp
src/memory.*              @sjplimp
src/modify.*              @sjplimp
src/molecule.*            @sjplimp
src/my_page.h             @sjplimp
src/my_pool_chunk.h       @sjplimp
src/npair*.*              @sjplimp
src/ntopo*.*              @sjplimp
src/nstencil*.*           @sjplimp
src/neighbor.*            @sjplimp
src/nbin*.*               @sjplimp
src/neigh_*.*             @sjplimp
src/output.*              @sjplimp
src/pair.*                @sjplimp
src/rcb.*                 @sjplimp
src/random_*.*            @sjplimp
src/region*.*             @sjplimp
src/rcb.*                 @sjplimp
src/read*.*               @sjplimp
src/rerun.*               @sjplimp
src/run.*                 @sjplimp
src/respa.*               @sjplimp
src/set.*                 @sjplimp
src/special.*             @sjplimp
src/suffix.h              @sjplimp
src/thermo.*              @sjplimp
src/universe.*            @sjplimp
src/update.*              @sjplimp
src/variable.*            @sjplimp
src/verlet.*              @sjplimp
src/velocity.*            @sjplimp
src/write_data.*          @sjplimp
src/write_restart.*       @sjplimp

# overrides for specific files
src/dump_movie.*          @akohlmey
src/exceptions.h          @rbberger
src/fix_nh.*              @athomps
src/info.*                @akohlmey @rbberger
src/timer.*               @akohlmey

# tools
tools/msi2lmp/*       @akohlmey
+33 −25
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ get_filename_component(LAMMPS_DOC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../doc ABSOLUT


# To avoid conflicts with the conventional Makefile build system, we build everything here
file(GLOB LIB_SOURCES ${LAMMPS_SOURCE_DIR}/*.cpp)
file(GLOB LIB_SOURCES ${LAMMPS_SOURCE_DIR}/[^.]*.cpp)
file(GLOB LMP_SOURCES ${LAMMPS_SOURCE_DIR}/main.cpp)
list(REMOVE_ITEM LIB_SOURCES ${LMP_SOURCES})

@@ -69,6 +69,8 @@ get_lammps_version(${LAMMPS_SOURCE_DIR}/version.h LAMMPS_VERSION)
# Cmake modules/macros are in a subdirectory to keep this file cleaner
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Modules)

include(PreventInSourceBuilds)

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS)
  #release comes with -O3 by default
  set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
@@ -164,12 +166,13 @@ set(LAMMPS_DEPS)
set(LAMMPS_API_DEFINES)

set(DEFAULT_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS DIPOLE GRANULAR
  KSPACE MANYBODY MC MEAM MESSAGE MISC MOLECULE PERI REAX REPLICA RIGID SHOCK SPIN SNAP
  SRD KIM PYTHON MSCG MPIIO VORONOI POEMS LATTE USER-ATC USER-AWPMD USER-BOCS
  USER-CGDNA USER-MESO USER-CGSDK USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE
  USER-EFF USER-FEP USER-H5MD USER-LB USER-MANIFOLD USER-MEAMC USER-MGPT USER-MISC
  USER-MOFFF USER-MOLFILE USER-NETCDF USER-PHONON USER-QTB USER-REAXC USER-SCAFACOS 
  USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF USER-VTK USER-QUIP USER-QMMM)
  KSPACE MANYBODY MC MEAM MESSAGE MISC MOLECULE PERI REAX REPLICA RIGID SHOCK
  SPIN SNAP SRD KIM PYTHON MSCG MPIIO VORONOI POEMS LATTE USER-ATC USER-AWPMD
  USER-BOCS USER-CGDNA USER-MESO USER-CGSDK USER-COLVARS USER-DIFFRACTION
  USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD USER-LB USER-MANIFOLD
  USER-MEAMC USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF
  USER-PHONON USER-PTM USER-QTB USER-REAXC USER-SCAFACOS USER-SMD USER-SMTBQ
  USER-SPH USER-TALLY USER-UEF USER-VTK USER-QUIP USER-QMMM)
set(ACCEL_PACKAGES USER-OMP KOKKOS OPT USER-INTEL GPU)
set(OTHER_PACKAGES CORESHELL QEQ)
foreach(PKG ${DEFAULT_PACKAGES})
@@ -348,7 +351,7 @@ if(PKG_MSCG OR PKG_USER-ATC OR PKG_USER-AWPMD OR PKG_USER-QUIP OR PKG_LATTE)
  find_package(BLAS)
  if(NOT LAPACK_FOUND OR NOT BLAS_FOUND)
    enable_language(Fortran)
    file(GLOB LAPACK_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/linalg/*.[fF])
    file(GLOB LAPACK_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/linalg/[^.]*.[fF])
    add_library(linalg STATIC ${LAPACK_SOURCES})
    set(LAPACK_LIBRARIES linalg)
  else()
@@ -550,8 +553,9 @@ if(PKG_USER-SMD)
    set(EIGEN3_INCLUDE_DIR ${SOURCE_DIR})
    list(APPEND LAMMPS_DEPS Eigen3_build)
  else()
    find_package(Eigen3)
    if(NOT Eigen3_FOUND)
    find_package(Eigen3 NO_MODULE)
    mark_as_advanced(Eigen3_DIR)
    if(NOT EIGEN3_FOUND)
      message(FATAL_ERROR "Eigen3 not found, help CMake to find it by setting EIGEN3_INCLUDE_DIR, or set DOWNLOAD_EIGEN3=ON to download it")
    endif()
  endif()
@@ -603,8 +607,9 @@ endif()

if(PKG_MESSAGE)
  option(MESSAGE_ZMQ "Use ZeroMQ in MESSAGE package" OFF)
  file(GLOB_RECURSE cslib_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/*.F
      ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/*.c ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/*.cpp)
  file(GLOB_RECURSE cslib_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.F
      ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.c
      ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.cpp)

  if(BUILD_SHARED_LIBS)
      add_library(cslib SHARED ${cslib_SOURCES})
@@ -720,8 +725,8 @@ RegisterStyles(${LAMMPS_SOURCE_DIR})
foreach(PKG ${DEFAULT_PACKAGES})
  set(${PKG}_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/${PKG})

  file(GLOB ${PKG}_SOURCES ${${PKG}_SOURCES_DIR}/*.cpp)
  file(GLOB ${PKG}_HEADERS ${${PKG}_SOURCES_DIR}/*.h)
  file(GLOB ${PKG}_SOURCES ${${PKG}_SOURCES_DIR}/[^.]*.cpp)
  file(GLOB ${PKG}_HEADERS ${${PKG}_SOURCES_DIR}/[^.]*.h)

  # check for package files in src directory due to old make system
  DetectBuildSystemConflict(${LAMMPS_SOURCE_DIR} ${${PKG}_SOURCES} ${${PKG}_HEADERS})
@@ -739,8 +744,8 @@ endforeach()
foreach(PKG ${ACCEL_PACKAGES})
  set(${PKG}_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/${PKG})

  file(GLOB ${PKG}_SOURCES ${${PKG}_SOURCES_DIR}/*.cpp)
  file(GLOB ${PKG}_HEADERS ${${PKG}_SOURCES_DIR}/*.h)
  file(GLOB ${PKG}_SOURCES ${${PKG}_SOURCES_DIR}/[^.]*.cpp)
  file(GLOB ${PKG}_HEADERS ${${PKG}_SOURCES_DIR}/[^.]*.h)

  # check for package files in src directory due to old make system
  DetectBuildSystemConflict(${LAMMPS_SOURCE_DIR} ${${PKG}_SOURCES} ${${PKG}_HEADERS})
@@ -754,8 +759,10 @@ foreach(SIMPLE_LIB REAX MEAM POEMS USER-ATC USER-AWPMD USER-COLVARS USER-H5MD
  if(PKG_${SIMPLE_LIB})
    string(REGEX REPLACE "^USER-" "" PKG_LIB "${SIMPLE_LIB}")
    string(TOLOWER "${PKG_LIB}" PKG_LIB)
    file(GLOB_RECURSE ${PKG_LIB}_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/*.F
      ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/*.c ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/*.cpp)
    file(GLOB_RECURSE ${PKG_LIB}_SOURCES
      ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.F
      ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.c
      ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.cpp)
    add_library(${PKG_LIB} STATIC ${${PKG_LIB}_SOURCES})
    list(APPEND LAMMPS_LINK_LIBS ${PKG_LIB})
    if(PKG_LIB STREQUAL awpmd)
@@ -830,6 +837,7 @@ if(PKG_USER-OMP)
    set(USER-OMP_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/USER-OMP)
    set(USER-OMP_SOURCES ${USER-OMP_SOURCES_DIR}/thr_data.cpp
                         ${USER-OMP_SOURCES_DIR}/thr_omp.cpp
                         ${USER-OMP_SOURCES_DIR}/fix_omp.cpp
                         ${USER-OMP_SOURCES_DIR}/fix_nh_omp.cpp
                         ${USER-OMP_SOURCES_DIR}/fix_nh_sphere_omp.cpp
                         ${USER-OMP_SOURCES_DIR}/domain_omp.cpp)
@@ -838,7 +846,7 @@ if(PKG_USER-OMP)

    # detects styles which have USER-OMP version
    RegisterStylesExt(${USER-OMP_SOURCES_DIR} omp OMP_SOURCES)

    RegisterFixStyle("${USER-OMP_SOURCES_DIR}/fix_omp.h")

    get_property(USER-OMP_SOURCES GLOBAL PROPERTY OMP_SOURCES)

@@ -1038,7 +1046,7 @@ if(PKG_GPU)
      set(GPU_PREC_SETTING "SINGLE_SINGLE")
    endif()

    file(GLOB GPU_LIB_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/gpu/*.cpp)
    file(GLOB GPU_LIB_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cpp)
    file(MAKE_DIRECTORY ${LAMMPS_LIB_BINARY_DIR}/gpu)

    if(GPU_API STREQUAL "CUDA")
@@ -1051,15 +1059,15 @@ if(PKG_GPU)

      set(GPU_ARCH "sm_30" CACHE STRING "LAMMPS GPU CUDA SM architecture (e.g. sm_60)")

      file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/*.cu ${CMAKE_CURRENT_SOURCE_DIR}/gpu/*.cu)
      file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu ${CMAKE_CURRENT_SOURCE_DIR}/gpu/[^.]*.cu)
      list(REMOVE_ITEM GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_pppm.cu)

      cuda_include_directories(${LAMMPS_LIB_SOURCE_DIR}/gpu ${LAMMPS_LIB_BINARY_DIR}/gpu)

      if(CUDPP_OPT)
        cuda_include_directories(${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini)
        file(GLOB GPU_LIB_CUDPP_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini/*.cpp)
        file(GLOB GPU_LIB_CUDPP_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini/*.cu)
        file(GLOB GPU_LIB_CUDPP_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini/[^.]*.cpp)
        file(GLOB GPU_LIB_CUDPP_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini/[^.]*.cu)
      endif()

      cuda_compile_cubin(GPU_GEN_OBJS ${GPU_LIB_CU} OPTIONS
@@ -1108,7 +1116,7 @@ if(PKG_GPU)
      include(OpenCLUtils)
      set(OCL_COMMON_HEADERS ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_preprocessor.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_aux_fun1.h)

      file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/*.cu)
      file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu)
      list(REMOVE_ITEM GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_gayberne.cu ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_gayberne_lj.cu)

      foreach(GPU_KERNEL ${GPU_LIB_CU})
@@ -1235,7 +1243,7 @@ if(BUILD_DOC)

  set(VIRTUALENV ${PYTHON_EXECUTABLE} -m virtualenv)

  file(GLOB DOC_SOURCES ${LAMMPS_DOC_DIR}/src/*.txt)
  file(GLOB DOC_SOURCES ${LAMMPS_DOC_DIR}/src/[^.]*.txt)
  file(GLOB PDF_EXTRA_SOURCES ${LAMMPS_DOC_DIR}/src/lammps_commands*.txt ${LAMMPS_DOC_DIR}/src/lammps_support.txt ${LAMMPS_DOC_DIR}/src/lammps_tutorials.txt)
  list(REMOVE_ITEM DOC_SOURCES ${PDF_EXTRA_SOURCES})

+23 −0
Original line number Diff line number Diff line
# - Prevent in-source builds.
# https://stackoverflow.com/questions/1208681/with-cmake-how-would-you-disable-in-source-builds/

function(prevent_in_source_builds)
  # make sure the user doesn't play dirty with symlinks
  get_filename_component(srcdir "${CMAKE_SOURCE_DIR}" REALPATH)
  get_filename_component(srcdir2 "${CMAKE_SOURCE_DIR}/.." REALPATH)
  get_filename_component(srcdir3 "${CMAKE_SOURCE_DIR}/../src" REALPATH)
  get_filename_component(bindir "${CMAKE_BINARY_DIR}" REALPATH)

  # disallow in-source builds
  if("${srcdir}" STREQUAL "${bindir}" OR "${srcdir2}" STREQUAL "${bindir}" OR "${srcdir3}" STREQUAL "${bindir}")
    message(FATAL_ERROR "\

CMake must not to be run in the source directory. \
Rather create a dedicated build directory and run CMake there. \
To clean up after this aborted in-place compilation:
  rm -r CMakeCache.txt CMakeFiles
")
  endif()
endfunction()

prevent_in_source_builds()
+7 −3
Original line number Diff line number Diff line
@@ -85,19 +85,23 @@ function(RegisterNPairStyle path)
    AddStyleHeader(${path} NPAIR)
endfunction(RegisterNPairStyle)

function(RegisterFixStyle path)
    AddStyleHeader(${path} FIX)
endfunction(RegisterFixStyle)

function(RegisterStyles search_path)
    FindStyleHeaders(${search_path} ANGLE_CLASS     angle_     ANGLE     ) # angle     ) # force
    FindStyleHeaders(${search_path} ATOM_CLASS      atom_vec_  ATOM_VEC  ) # atom      ) # atom      atom_vec_hybrid
    FindStyleHeaders(${search_path} BODY_CLASS      body_      BODY      ) # body      ) # atom_vec_body
    FindStyleHeaders(${search_path} BOND_CLASS      bond_      BOND      ) # bond      ) # force
    FindStyleHeaders(${search_path} COMMAND_CLASS   ""         COMMAND   ) # command   ) # input
    FindStyleHeaders(${search_path} COMMAND_CLASS   "[^.]"     COMMAND   ) # command   ) # input
    FindStyleHeaders(${search_path} COMPUTE_CLASS   compute_   COMPUTE   ) # compute   ) # modify
    FindStyleHeaders(${search_path} DIHEDRAL_CLASS  dihedral_  DIHEDRAL  ) # dihedral  ) # force
    FindStyleHeaders(${search_path} DUMP_CLASS      dump_      DUMP      ) # dump      ) # output    write_dump
    FindStyleHeaders(${search_path} FIX_CLASS       fix_       FIX       ) # fix       ) # modify
    FindStyleHeaders(${search_path} IMPROPER_CLASS  improper_  IMPROPER  ) # improper  ) # force
    FindStyleHeaders(${search_path} INTEGRATE_CLASS ""         INTEGRATE ) # integrate ) # update
    FindStyleHeaders(${search_path} KSPACE_CLASS    ""         KSPACE    ) # kspace    ) # force
    FindStyleHeaders(${search_path} INTEGRATE_CLASS "[^.]"     INTEGRATE ) # integrate ) # update
    FindStyleHeaders(${search_path} KSPACE_CLASS    "[^.]"     KSPACE    ) # kspace    ) # force
    FindStyleHeaders(${search_path} MINIMIZE_CLASS  min_       MINIMIZE  ) # minimize  ) # update
    FindStyleHeaders(${search_path} NBIN_CLASS      nbin_      NBIN      ) # nbin      ) # neighbor
    FindStyleHeaders(${search_path} NPAIR_CLASS     npair_     NPAIR     ) # npair     ) # neighbor
+11 −10
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ OBJECTS=$(SOURCES:src/%.txt=$(RSTDIR)/%.rst)
help:
	@echo "Please use \`make <target>' where <target> is one of"
	@echo "  html       create HTML doc pages in html dir"
	@echo "  pdf        create Manual.pdf and Developer.pdf in this dir"
	@echo "  pdf        create Developer.pdf and Manual.pdf in this dir"
	@echo "  old        create old-style HTML doc pages in old dir"
	@echo "  fetch      fetch HTML and PDF files from LAMMPS web site"
	@echo "  epub       create ePUB format manual for e-book readers"
@@ -95,9 +95,10 @@ spelling: $(OBJECTS) utils/sphinx-config/false_positives.txt
	@echo "Spell check finished."

epub: $(OBJECTS)
	@mkdir -p epub
	@mkdir -p epub/JPG
	@rm -f LAMMPS.epub
	@cp src/JPG/lammps-logo.png epub/
	@cp src/JPG/*.* epub/JPG
	@(\
		. $(VENV)/bin/activate ;\
		cp -r src/* $(RSTDIR)/ ;\
@@ -116,17 +117,17 @@ mobi: epub
pdf: utils/txt2html/txt2html.exe
	@(\
		set -e; \
		cd src; \
		../utils/txt2html/txt2html.exe -b *.txt; \
		htmldoc --batch lammps.book;          \
		for s in `echo *.txt | sed -e 's,\.txt,\.html,g'` ; \
			do grep -q $$s lammps.book || \
			echo doc file $$s missing in src/lammps.book; done; \
		rm *.html; \
		cd Developer; \
		cd src/Developer; \
		pdflatex developer; \
		pdflatex developer; \
		mv developer.pdf ../../Developer.pdf; \
		cd ..; \
		../utils/txt2html/txt2html.exe -b *.txt; \
		htmldoc --batch lammps.book;          \
		for s in `echo *.txt | sed -e 's/ \(pairs\|bonds\|angles\|dihedrals\|impropers\|commands_list\|fixes\|computes\).txt/ /g' | sed -e 's,\.txt,\.html,g'` ; \
			do grep -q ^$$s lammps.book || \
			echo WARNING: doc file $$s missing in src/lammps.book; done; \
		rm *.html; \
	)

old: utils/txt2html/txt2html.exe
Loading