forked from lijiext/lammps
cmake: tweaks for EXAALT superbuild, add latte_fix
This commit is contained in:
parent
2f6be88c4a
commit
fce633aa5f
|
@ -6,8 +6,8 @@ cmake_minimum_required(VERSION 3.1)
|
|||
|
||||
project(lammps)
|
||||
set(SOVERSION 0)
|
||||
set(LAMMPS_SOURCE_DIR ${CMAKE_SOURCE_DIR}/../src)
|
||||
set(LAMMPS_LIB_SOURCE_DIR ${CMAKE_SOURCE_DIR}/../lib)
|
||||
set(LAMMPS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../src)
|
||||
set(LAMMPS_LIB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../lib)
|
||||
set(LAMMPS_LIB_BINARY_DIR ${CMAKE_BINARY_DIR}/lib)
|
||||
|
||||
#To not conflict with old Makefile build system, we build everything here
|
||||
|
@ -16,7 +16,7 @@ file(GLOB LMP_SOURCES ${LAMMPS_SOURCE_DIR}/main.cpp)
|
|||
list(REMOVE_ITEM LIB_SOURCES ${LMP_SOURCES})
|
||||
|
||||
# Cmake modules/macros are in a subdirectory to keep this file cleaner
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/Modules)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Modules)
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS)
|
||||
#release comes with -O3 by default
|
||||
|
@ -85,7 +85,7 @@ option(ENABLE_ALL "Build all default packages" OFF)
|
|||
set(DEFAULT_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GRANULAR
|
||||
KSPACE MANYBODY MC MEAM MISC MOLECULE PERI QEQ
|
||||
REAX REPLICA RIGID SHOCK SNAP SRD)
|
||||
set(OTHER_PACKAGES KIM PYTHON MSCG MPIIO VORONOI POEMS
|
||||
set(OTHER_PACKAGES KIM PYTHON MSCG MPIIO VORONOI POEMS LATTE
|
||||
USER-ATC USER-AWPMD USER-CGDNA
|
||||
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
|
||||
|
@ -182,7 +182,7 @@ if(ENABLE_PYTHON)
|
|||
-c "import distutils.sysconfig as cg; print(cg.get_python_lib(1,0,prefix='${CMAKE_INSTALL_PREFIX}'))"
|
||||
OUTPUT_VARIABLE PYTHON_INSTDIR OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif()
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/../python/lammps.py DESTINATION ${PYTHON_INSTDIR})
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../python/lammps.py DESTINATION ${PYTHON_INSTDIR})
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
message(FATAL_ERROR "Python package need lammps to be build shared, use -DBUILD_SHARED_LIBS=ON")
|
||||
endif()
|
||||
|
@ -221,6 +221,11 @@ if(ENABLE_VORONOI)
|
|||
list(APPEND LAMMPS_LINK_LIBS ${VORO_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(ENABLE_LATTE)
|
||||
find_package(LATTE REQUIRED)
|
||||
list(APPEND LAMMPS_LINK_LIBS ${LATTE_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(ENABLE_USER-MOLFILE)
|
||||
list(APPEND LAMMPS_LINK_LIBS ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
|
@ -477,7 +482,7 @@ if(ENABLE_GPU)
|
|||
get_property(GPU_SOURCES GLOBAL PROPERTY GPU_SOURCES)
|
||||
|
||||
file(GLOB GPU_LIB_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/gpu/*.cpp)
|
||||
file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/*.cu ${CMAKE_SOURCE_DIR}/gpu/*.cu)
|
||||
file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/*.cu ${CMAKE_CURRENT_SOURCE_DIR}/gpu/*.cu)
|
||||
file(GLOB_RECURSE GPU_NOT_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_pppm.cu)
|
||||
list(REMOVE_ITEM GPU_LIB_CU ${GPU_NOT_LIB_CU})
|
||||
include_directories(${GPU_SOURCES_DIR} ${LAMMPS_LIB_SOURCE_DIR}/gpu ${LAMMPS_LIB_BINARY_DIR}/gpu)
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
# - Find latte
|
||||
# Find the native LATTE libraries.
|
||||
#
|
||||
# LATTE_LIBRARIES - List of libraries when using fftw3.
|
||||
# LATTE_FOUND - True if fftw3 found.
|
||||
#
|
||||
|
||||
find_library(LATTE_LIBRARY NAMES latte)
|
||||
|
||||
set(LATTE_LIBRARIES ${LATTE_LIBRARY})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
# handle the QUIETLY and REQUIRED arguments and set LATTE_FOUND to TRUE
|
||||
# if all listed variables are TRUE
|
||||
|
||||
find_package_handle_standard_args(LATTE DEFAULT_MSG LATTE_LIBRARY)
|
||||
|
||||
mark_as_advanced(LATTE_LIBRARY)
|
Loading…
Reference in New Issue