diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 6848a1baf4..e28bab6385 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -81,51 +81,29 @@ endif() ######################################################################## # User input options # ######################################################################## -option(BUILD_EXE "Build lmp binary" ON) -if(BUILD_EXE) - set(LAMMPS_MACHINE "" CACHE STRING "Suffix to append to lmp binary (WON'T enable any features automatically") - mark_as_advanced(LAMMPS_MACHINE) - if(LAMMPS_MACHINE) - set(LAMMPS_MACHINE "_${LAMMPS_MACHINE}") - endif() - set(LAMMPS_BINARY lmp${LAMMPS_MACHINE}) +set(LAMMPS_MACHINE "" CACHE STRING "Suffix to append to lmp binary (WON'T enable any features automatically") +mark_as_advanced(LAMMPS_MACHINE) +if(LAMMPS_MACHINE) + set(LAMMPS_MACHINE "_${LAMMPS_MACHINE}") endif() +set(LAMMPS_BINARY lmp${LAMMPS_MACHINE}) -option(BUILD_LIB "Build LAMMPS library" OFF) -if(BUILD_LIB) - option(BUILD_SHARED_LIBS "Build shared library" OFF) - if(BUILD_SHARED_LIBS) # for all pkg libs, mpi_stubs and linalg - set(CMAKE_POSITION_INDEPENDENT_CODE ON) - endif() - set(LAMMPS_LIB_SUFFIX "" CACHE STRING "Suffix to append to liblammps and pkg-config file") - mark_as_advanced(LAMMPS_LIB_SUFFIX) - if(LAMMPS_LIB_SUFFIX) - set(LAMMPS_LIB_SUFFIX "_${LAMMPS_LIB_SUFFIX}") - endif() +option(BUILD_SHARED_LIBS "Build shared library" OFF) +if(BUILD_SHARED_LIBS) # for all pkg libs, mpi_stubs and linalg + set(CMAKE_POSITION_INDEPENDENT_CODE ON) endif() option(BUILD_TOOLS "Build and install LAMMPS tools (msi2lmp, binary2txt, chain)" OFF) include(GNUInstallDirs) file(GLOB ALL_SOURCES ${LAMMPS_SOURCE_DIR}/[^.]*.cpp) -if(BUILD_LIB) - file(GLOB MAIN_SOURCES ${LAMMPS_SOURCE_DIR}/main.cpp) - list(REMOVE_ITEM ALL_SOURCES ${MAIN_SOURCES}) - add_library(lammps ${ALL_SOURCES}) - if(BUILD_EXE) - add_executable(lmp ${MAIN_SOURCES}) - target_link_libraries(lmp PRIVATE lammps) - set_target_properties(lmp PROPERTIES OUTPUT_NAME ${LAMMPS_BINARY}) - install(TARGETS lmp EXPORT LAMMPS_Targets DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif() -else() - if(NOT BUILD_EXE) - message(FATAL_ERROR "You need to at least enable one of two following options: BUILD_LIB or BUILD_EXE") - endif() - add_executable(lammps ${ALL_SOURCES}) - set_target_properties(lammps PROPERTIES OUTPUT_NAME ${LAMMPS_BINARY}) - install(TARGETS lammps DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif() +file(GLOB MAIN_SOURCES ${LAMMPS_SOURCE_DIR}/main.cpp) +list(REMOVE_ITEM ALL_SOURCES ${MAIN_SOURCES}) +add_library(lammps ${ALL_SOURCES}) +add_executable(lmp ${MAIN_SOURCES}) +target_link_libraries(lmp PRIVATE lammps) +set_target_properties(lmp PROPERTIES OUTPUT_NAME ${LAMMPS_BINARY}) +install(TARGETS lmp EXPORT LAMMPS_Targets DESTINATION ${CMAKE_INSTALL_BINDIR}) option(CMAKE_VERBOSE_MAKEFILE "Generate verbose Makefiles" OFF) @@ -185,10 +163,10 @@ else() enable_language(C) file(GLOB MPI_SOURCES ${LAMMPS_SOURCE_DIR}/STUBS/mpi.c) add_library(mpi_stubs STATIC ${MPI_SOURCES}) - if(BUILD_LIB AND NOT BUILD_SHARED_LIBS) + if(NOT BUILD_SHARED_LIBS) install(TARGETS mpi_stubs EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() - set_target_properties(mpi_stubs PROPERTIES OUTPUT_NAME lammps_mpi_stubs${LAMMPS_LIB_SUFFIX}) + set_target_properties(mpi_stubs PROPERTIES OUTPUT_NAME lammps_mpi_stubs${LAMMPS_MACHINE}) target_include_directories(mpi_stubs PUBLIC $ $) install(FILES ${LAMMPS_SOURCE_DIR}/STUBS/mpi.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps/mpi) if(BUILD_SHARED_LIBS) @@ -274,10 +252,10 @@ if(PKG_MSCG OR PKG_USER-ATC OR PKG_USER-AWPMD OR PKG_USER-QUIP OR PKG_LATTE) enable_language(Fortran) file(GLOB LAPACK_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/linalg/[^.]*.[fF]) add_library(linalg STATIC ${LAPACK_SOURCES}) - if(BUILD_LIB AND NOT BUILD_SHARED_LIBS) + if(NOT BUILD_SHARED_LIBS) install(TARGETS linalg EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() - set_target_properties(linalg PROPERTIES OUTPUT_NAME lammps_linalg${LAMMPS_LIB_SUFFIX}) + set_target_properties(linalg PROPERTIES OUTPUT_NAME lammps_linalg${LAMMPS_MACHINE}) set(BLAS_LIBRARIES "$") set(LAPACK_LIBRARIES "$") else() @@ -435,10 +413,10 @@ foreach(SIMPLE_LIB POEMS USER-ATC USER-AWPMD USER-H5MD) ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.c ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.cpp) add_library(${PKG_LIB} STATIC ${${PKG_LIB}_SOURCES}) - if(BUILD_LIB AND NOT BUILD_SHARED_LIBS) + if(NOT BUILD_SHARED_LIBS) install(TARGETS ${PKG_LIB} EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() - set_target_properties(${PKG_LIB} PROPERTIES OUTPUT_NAME lammps_${PKG_LIB}${LAMMPS_LIB_SUFFIX}) + set_target_properties(${PKG_LIB} PROPERTIES OUTPUT_NAME lammps_${PKG_LIB}${LAMMPS_MACHINE}) target_link_libraries(lammps PRIVATE ${PKG_LIB}) if(PKG_LIB STREQUAL awpmd) target_include_directories(awpmd PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/awpmd/systems/interact ${LAMMPS_LIB_SOURCE_DIR}/awpmd/ivutils/include) @@ -535,44 +513,39 @@ list (FIND LANGUAGES "Fortran" _index) if (${_index} GREATER -1) target_link_libraries(lammps PRIVATE ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES}) endif() -if(BUILD_LIB) - set(LAMMPS_CXX_HEADERS angle.h atom.h bond.h citeme.h comm.h compute.h dihedral.h domain.h error.h fix.h force.h group.h improper.h - input.h info.h kspace.h lammps.h lattice.h library.h lmppython.h lmptype.h memory.h modify.h neighbor.h neigh_list.h output.h - pair.h pointers.h region.h timer.h universe.h update.h variable.h) - if(LAMMPS_EXCEPTIONS) - list(APPEND LAMMPS_CXX_HEADERS exceptions.h) - endif() - - set_target_properties(lammps PROPERTIES OUTPUT_NAME lammps${LAMMPS_LIB_SUFFIX}) - set_target_properties(lammps PROPERTIES SOVERSION ${SOVERSION}) - install(TARGETS lammps EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - target_include_directories(lammps PUBLIC $) - file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps) - foreach(_HEADER ${LAMMPS_CXX_HEADERS}) - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LAMMPS_SOURCE_DIR}/${_HEADER} ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER} DEPENDS ${LAMMPS_SOURCE_DIR}/${_HEADER}) - add_custom_target(${_HEADER} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER}) - add_dependencies(lammps ${_HEADER}) - install(FILES ${LAMMPS_SOURCE_DIR}/${_HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps) - endforeach() - target_include_directories(lammps INTERFACE $) - add_library(LAMMPS::lammps ALIAS lammps) - get_target_property(LAMMPS_DEFINES lammps INTERFACE_COMPILE_DEFINITIONS) - set(LAMMPS_API_DEFINES) - foreach(_DEF ${LAMMPS_DEFINES}) - set(LAMMPS_API_DEFINES "${LAMMPS_API_DEFINES} -D${_DEF}") - endforeach() - configure_file(pkgconfig/liblammps.pc.in ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_LIB_SUFFIX}.pc @ONLY) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_LIB_SUFFIX}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) - install(EXPORT LAMMPS_Targets FILE LAMMPS_Targets.cmake NAMESPACE LAMMPS:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS) - include(CMakePackageConfigHelpers) - configure_file(LAMMPSConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfig.cmake @ONLY) - write_basic_package_version_file("LAMMPSConfigVersion.cmake" VERSION ${PROJECT_VERSION} COMPATIBILITY ExactVersion) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfigVersion.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS) +set(LAMMPS_CXX_HEADERS angle.h atom.h bond.h citeme.h comm.h compute.h dihedral.h domain.h error.h fix.h force.h group.h improper.h + input.h info.h kspace.h lammps.h lattice.h library.h lmppython.h lmptype.h memory.h modify.h neighbor.h neigh_list.h output.h + pair.h pointers.h region.h timer.h universe.h update.h variable.h) +if(LAMMPS_EXCEPTIONS) + list(APPEND LAMMPS_CXX_HEADERS exceptions.h) endif() -if(BUILD_EXE) - install(FILES ${LAMMPS_DOC_DIR}/lammps.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 RENAME ${LAMMPS_BINARY}.1) -endif() +set_target_properties(lammps PROPERTIES OUTPUT_NAME lammps${LAMMPS_MACHINE}) +set_target_properties(lammps PROPERTIES SOVERSION ${SOVERSION}) +install(TARGETS lammps EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +target_include_directories(lammps PUBLIC $) +file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps) +foreach(_HEADER ${LAMMPS_CXX_HEADERS}) + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LAMMPS_SOURCE_DIR}/${_HEADER} ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER} DEPENDS ${LAMMPS_SOURCE_DIR}/${_HEADER}) + add_custom_target(${_HEADER} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER}) + add_dependencies(lammps ${_HEADER}) + install(FILES ${LAMMPS_SOURCE_DIR}/${_HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps) +endforeach() +target_include_directories(lammps INTERFACE $) +add_library(LAMMPS::lammps ALIAS lammps) +get_target_property(LAMMPS_DEFINES lammps INTERFACE_COMPILE_DEFINITIONS) +set(LAMMPS_API_DEFINES) +foreach(_DEF ${LAMMPS_DEFINES}) + set(LAMMPS_API_DEFINES "${LAMMPS_API_DEFINES} -D${_DEF}") +endforeach() +configure_file(pkgconfig/liblammps.pc.in ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc @ONLY) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) +install(EXPORT LAMMPS_Targets FILE LAMMPS_Targets.cmake NAMESPACE LAMMPS:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS) +include(CMakePackageConfigHelpers) +configure_file(LAMMPSConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfig.cmake @ONLY) +write_basic_package_version_file("LAMMPSConfigVersion.cmake" VERSION ${PROJECT_VERSION} COMPATIBILITY ExactVersion) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/LAMMPSConfigVersion.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS) +install(FILES ${LAMMPS_DOC_DIR}/lammps.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 RENAME ${LAMMPS_BINARY}.1) if(BUILD_TOOLS) add_executable(binary2txt ${LAMMPS_TOOLS_DIR}/binary2txt.cpp) @@ -623,7 +596,7 @@ install( # conventional build. Only available, if a shared library is built. # This is primarily for people that only want to use the Python wrapper. ############################################################################### -if(BUILD_LIB AND BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) if(CMAKE_VERSION VERSION_LESS 3.12) find_package(PythonInterp) # Deprecated since version 3.12 else() @@ -653,7 +626,7 @@ endif() # LAMMPS for package managers and with different prefix settings. # This requires either a shared library or that the PYTHON package is included. ############################################################################### -if((BUILD_LIB AND BUILD_SHARED_LIBS) OR (PKG_PYTHON)) +if(BUILD_SHARED_LIBS OR PKG_PYTHON) if(CMAKE_VERSION VERSION_LESS 3.12) find_package(PythonInterp) # Deprecated since version 3.12 else() @@ -713,9 +686,7 @@ if (${_index} GREATER -1) C Flags: ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${BTYPE}}") endif() message(STATUS "<<< Linker flags: >>>") -if(BUILD_EXE) - message(STATUS "Executable name: ${LAMMPS_BINARY}") -endif() +message(STATUS "Executable name: ${LAMMPS_BINARY}") if(CMAKE_EXE_LINKER_FLAGS) message(STATUS "Executable linker flags: ${CMAKE_EXE_LINKER_FLAGS}") endif() diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index dcfe06b911..574be941f7 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -38,7 +38,7 @@ if(GPU_API STREQUAL "CUDA") set(GPU_CUDA_MPS_FLAGS "-DCUDA_PROXY") endif() - set(GPU_ARCH "sm_30" CACHE STRING "LAMMPS GPU CUDA SM primary architecture (e.g. sm_60)") + set(GPU_ARCH "sm_50" CACHE STRING "LAMMPS GPU CUDA SM primary architecture (e.g. sm_60)") 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) @@ -96,7 +96,6 @@ if(GPU_API STREQUAL "CUDA") endforeach() set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${LAMMPS_LIB_BINARY_DIR}/gpu/*_cubin.h") - add_library(gpu STATIC ${GPU_LIB_SOURCES} ${GPU_LIB_CUDPP_SOURCES} ${GPU_OBJS}) target_link_libraries(gpu PRIVATE ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY}) target_include_directories(gpu PRIVATE ${LAMMPS_LIB_BINARY_DIR}/gpu ${CUDA_INCLUDE_DIRS}) @@ -113,7 +112,6 @@ if(GPU_API STREQUAL "CUDA") target_link_libraries(nvc_get_devices PRIVATE ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY}) target_include_directories(nvc_get_devices PRIVATE ${CUDA_INCLUDE_DIRS}) - elseif(GPU_API STREQUAL "OPENCL") if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") # download and unpack support binaries for compilation of windows binaries. @@ -213,7 +211,7 @@ elseif(GPU_API STREQUAL "HIP") set(HIP_ARCH "gfx906" CACHE STRING "HIP target architecture") elseif(HIP_PLATFORM STREQUAL "nvcc") find_package(CUDA REQUIRED) - set(HIP_ARCH "sm_30" CACHE STRING "HIP primary CUDA architecture (e.g. sm_60)") + set(HIP_ARCH "sm_50" CACHE STRING "HIP primary CUDA architecture (e.g. sm_60)") # build arch/gencode commands for nvcc based on CUDA toolkit version and use choice # --arch translates directly instead of JIT, so this should be for the preferred or most common architecture @@ -356,10 +354,10 @@ RegisterStylesExt(${GPU_SOURCES_DIR} gpu GPU_SOURCES) get_property(GPU_SOURCES GLOBAL PROPERTY GPU_SOURCES) target_link_libraries(gpu PRIVATE MPI::MPI_CXX) -if(BUILD_LIB AND NOT BUILD_SHARED_LIBS) +if(NOT BUILD_SHARED_LIBS) install(TARGETS gpu EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() target_compile_definitions(gpu PRIVATE -DLAMMPS_${LAMMPS_SIZES}) -set_target_properties(gpu PROPERTIES OUTPUT_NAME lammps_gpu${LAMMPS_LIB_SUFFIX}) +set_target_properties(gpu PROPERTIES OUTPUT_NAME lammps_gpu${LAMMPS_MACHINE}) target_sources(lammps PRIVATE ${GPU_SOURCES}) target_include_directories(lammps PRIVATE ${GPU_SOURCES_DIR}) diff --git a/cmake/Modules/Packages/KIM.cmake b/cmake/Modules/Packages/KIM.cmake index 3734e10982..b4e1fb3502 100644 --- a/cmake/Modules/Packages/KIM.cmake +++ b/cmake/Modules/Packages/KIM.cmake @@ -51,7 +51,7 @@ if(DOWNLOAD_KIM) INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_DIR}/include/kim-api") target_link_libraries(lammps PRIVATE LAMMPS::KIM) add_dependencies(LAMMPS::KIM kim_build) - if(BUILD_LIB AND NOT BUILD_SHARED_LIBS) + if(NOT BUILD_SHARED_LIBS) install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")") endif() else() diff --git a/cmake/Modules/Packages/KOKKOS.cmake b/cmake/Modules/Packages/KOKKOS.cmake index 1b7e8affc5..a9a5c01a72 100644 --- a/cmake/Modules/Packages/KOKKOS.cmake +++ b/cmake/Modules/Packages/KOKKOS.cmake @@ -35,7 +35,7 @@ if(DOWNLOAD_KOKKOS) INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS}) target_link_libraries(lammps PRIVATE LAMMPS::KOKKOS) add_dependencies(LAMMPS::KOKKOS kokkos_build) - if(BUILD_LIB AND NOT BUILD_SHARED_LIBS) + if(NOT BUILD_SHARED_LIBS) install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")") endif() elseif(EXTERNAL_KOKKOS) diff --git a/cmake/Modules/Packages/LATTE.cmake b/cmake/Modules/Packages/LATTE.cmake index 4279b5597f..4ce8888f37 100644 --- a/cmake/Modules/Packages/LATTE.cmake +++ b/cmake/Modules/Packages/LATTE.cmake @@ -27,7 +27,7 @@ if(DOWNLOAD_LATTE) INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}") target_link_libraries(lammps PRIVATE LAMMPS::LATTE) add_dependencies(LAMMPS::LATTE latte_build) - if(BUILD_LIB AND NOT BUILD_SHARED_LIBS) + if(NOT BUILD_SHARED_LIBS) install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")") endif() else() diff --git a/cmake/Modules/Packages/MESSAGE.cmake b/cmake/Modules/Packages/MESSAGE.cmake index 231c5d8aa0..e1dc4c1072 100644 --- a/cmake/Modules/Packages/MESSAGE.cmake +++ b/cmake/Modules/Packages/MESSAGE.cmake @@ -7,11 +7,11 @@ file(GLOB_RECURSE cslib_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.F ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.cpp) add_library(cslib STATIC ${cslib_SOURCES}) -if(BUILD_LIB AND NOT BUILD_SHARED_LIBS) +if(NOT BUILD_SHARED_LIBS) install(TARGETS cslib EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() target_compile_definitions(cslib PRIVATE -DLAMMPS_${LAMMPS_SIZES}) -set_target_properties(cslib PROPERTIES OUTPUT_NAME lammps_cslib${LAMMPS_LIB_SUFFIX}) +set_target_properties(cslib PROPERTIES OUTPUT_NAME lammps_cslib${LAMMPS_MACHINE}) if(BUILD_MPI) target_compile_definitions(cslib PRIVATE -DMPI_YES) set_target_properties(cslib PROPERTIES OUTPUT_NAME "csmpi") diff --git a/cmake/Modules/Packages/MSCG.cmake b/cmake/Modules/Packages/MSCG.cmake index 9254935c20..668d318d68 100644 --- a/cmake/Modules/Packages/MSCG.cmake +++ b/cmake/Modules/Packages/MSCG.cmake @@ -35,7 +35,7 @@ if(DOWNLOAD_MSCG) INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}") target_link_libraries(lammps PRIVATE LAMMPS::MSCG) add_dependencies(LAMMPS::MSCG mscg_build) - if(BUILD_LIB AND NOT BUILD_SHARED_LIBS) + if(NOT BUILD_SHARED_LIBS) install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")") endif() else() diff --git a/cmake/Modules/Packages/USER-COLVARS.cmake b/cmake/Modules/Packages/USER-COLVARS.cmake index 18931ae60b..281b497dea 100644 --- a/cmake/Modules/Packages/USER-COLVARS.cmake +++ b/cmake/Modules/Packages/USER-COLVARS.cmake @@ -9,19 +9,19 @@ if(COLVARS_LEPTON) set(LEPTON_DIR ${LAMMPS_LIB_SOURCE_DIR}/colvars/lepton) file(GLOB LEPTON_SOURCES ${LEPTON_DIR}/src/[^.]*.cpp) add_library(lepton STATIC ${LEPTON_SOURCES}) - if(BUILD_LIB AND NOT BUILD_SHARED_LIBS) + if(NOT BUILD_SHARED_LIBS) install(TARGETS lepton EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() - set_target_properties(lepton PROPERTIES OUTPUT_NAME lammps_lepton${LAMMPS_LIB_SUFFIX}) + set_target_properties(lepton PROPERTIES OUTPUT_NAME lammps_lepton${LAMMPS_MACHINE}) target_include_directories(lepton PRIVATE ${LEPTON_DIR}/include) endif() add_library(colvars STATIC ${COLVARS_SOURCES}) -if(BUILD_LIB AND NOT BUILD_SHARED_LIBS) +if(NOT BUILD_SHARED_LIBS) install(TARGETS colvars EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() target_compile_definitions(colvars PRIVATE -DLAMMPS_${LAMMPS_SIZES}) -set_target_properties(colvars PROPERTIES OUTPUT_NAME lammps_colvars${LAMMPS_LIB_SUFFIX}) +set_target_properties(colvars PROPERTIES OUTPUT_NAME lammps_colvars${LAMMPS_MACHINE}) target_include_directories(colvars PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/colvars) target_link_libraries(lammps PRIVATE colvars) diff --git a/cmake/Modules/Packages/USER-MOLFILE.cmake b/cmake/Modules/Packages/USER-MOLFILE.cmake index 1a2061918f..dd6435e56b 100644 --- a/cmake/Modules/Packages/USER-MOLFILE.cmake +++ b/cmake/Modules/Packages/USER-MOLFILE.cmake @@ -1,6 +1,6 @@ set(MOLFILE_INCLUDE_DIRS "${LAMMPS_LIB_SOURCE_DIR}/molfile" CACHE STRING "Path to VMD molfile plugin headers") add_library(molfile INTERFACE) -if(BUILD_LIB AND NOT BUILD_SHARED_LIBS) +if(NOT BUILD_SHARED_LIBS) install(TARGETS molfile EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() target_include_directories(molfile INTERFACE ${MOLFILE_INCLUDE_DIRS}) diff --git a/cmake/Modules/Packages/USER-PLUMED.cmake b/cmake/Modules/Packages/USER-PLUMED.cmake index 53e424224d..e7605b6bca 100644 --- a/cmake/Modules/Packages/USER-PLUMED.cmake +++ b/cmake/Modules/Packages/USER-PLUMED.cmake @@ -70,7 +70,7 @@ if(DOWNLOAD_PLUMED) ExternalProject_get_property(plumed_build INSTALL_DIR) add_library(LAMMPS::PLUMED UNKNOWN IMPORTED) add_dependencies(LAMMPS::PLUMED plumed_build) - if(BUILD_LIB AND NOT BUILD_SHARED_LIBS) + if(NOT BUILD_SHARED_LIBS) install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")") endif() if(PLUMED_MODE STREQUAL "STATIC") diff --git a/cmake/Modules/Packages/USER-QMMM.cmake b/cmake/Modules/Packages/USER-QMMM.cmake index 60ca488817..76bb76fa5a 100644 --- a/cmake/Modules/Packages/USER-QMMM.cmake +++ b/cmake/Modules/Packages/USER-QMMM.cmake @@ -1,15 +1,12 @@ enable_language(C) -if(NOT BUILD_LIB) - message(FATAL_ERROR "Building a QM/MM executable with USER-QMMM requires BUILD_LIB=yes") -endif() if(NOT BUILD_SHARED_LIBS) message(WARNING "It is recommended to use BUILD_SHARED_LIBS=yes with USER-QMMM") endif() add_library(qmmm STATIC ${LAMMPS_LIB_SOURCE_DIR}/qmmm/libqmmm.c) -if(BUILD_LIB AND NOT BUILD_SHARED_LIBS) +if(NOT BUILD_SHARED_LIBS) install(TARGETS qmmm EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() -set_target_properties(qmmm PROPERTIES OUTPUT_NAME lammps_qmmm${LAMMPS_LIB_SUFFIX}) +set_target_properties(qmmm PROPERTIES OUTPUT_NAME lammps_qmmm${LAMMPS_MACHINE}) target_link_libraries(lammps PRIVATE qmmm) target_include_directories(qmmm PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/qmmm) diff --git a/cmake/Modules/Packages/USER-SCAFACOS.cmake b/cmake/Modules/Packages/USER-SCAFACOS.cmake index d51504bcc8..ee12e754e6 100644 --- a/cmake/Modules/Packages/USER-SCAFACOS.cmake +++ b/cmake/Modules/Packages/USER-SCAFACOS.cmake @@ -52,7 +52,7 @@ if(DOWNLOAD_SCAFACOS) INTERFACE_LINK_LIBRARIES "${INSTALL_DIR}/lib/libfcs.a;${INSTALL_DIR}/lib/libfcs_direct.a;${INSTALL_DIR}/lib/libfcs_ewald.a;${INSTALL_DIR}/lib/libfcs_fmm.a;${INSTALL_DIR}/lib/libfcs_p2nfft.a;${INSTALL_DIR}/lib/libfcs_p3m.a;GSL::gsl;${INSTALL_DIR}/lib/libfcs_near.a;${INSTALL_DIR}/lib/libfcs_gridsort.a;${INSTALL_DIR}/lib/libfcs_resort.a;${INSTALL_DIR}/lib/libfcs_redist.a;${INSTALL_DIR}/lib/libfcs_common.a;${INSTALL_DIR}/lib/libfcs_pnfft.a;${INSTALL_DIR}/lib/libfcs_pfft.a;${INSTALL_DIR}/lib/libfcs_fftw3_mpi.a;${INSTALL_DIR}/lib/libfcs_fftw3.a;MPI::MPI_Fortran;MPI::MPI_C") target_link_libraries(lammps PRIVATE LAMMPS::SCAFACOS) add_dependencies(LAMMPS::SCAFACOS scafacos_build) - if(BUILD_LIB AND NOT BUILD_SHARED_LIBS) + if(NOT BUILD_SHARED_LIBS) install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")") endif() else() diff --git a/cmake/Modules/Packages/USER-SMD.cmake b/cmake/Modules/Packages/USER-SMD.cmake index c2775c5a8e..0a5165471c 100644 --- a/cmake/Modules/Packages/USER-SMD.cmake +++ b/cmake/Modules/Packages/USER-SMD.cmake @@ -18,7 +18,7 @@ if(DOWNLOAD_EIGEN3) set_target_properties(LAMMPS::EIGEN3 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}") target_link_libraries(lammps PRIVATE LAMMPS::EIGEN3) add_dependencies(LAMMPS::EIGEN3 Eigen3_build) - if(BUILD_LIB AND NOT BUILD_SHARED_LIBS) + if(NOT BUILD_SHARED_LIBS) install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")") endif() else() diff --git a/cmake/Modules/Packages/VORONOI.cmake b/cmake/Modules/Packages/VORONOI.cmake index 69c2ab3301..4635466a50 100644 --- a/cmake/Modules/Packages/VORONOI.cmake +++ b/cmake/Modules/Packages/VORONOI.cmake @@ -35,7 +35,7 @@ if(DOWNLOAD_VORO) INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/src") target_link_libraries(lammps PRIVATE LAMMPS::VORO) add_dependencies(LAMMPS::VORO voro_build) - if(BUILD_LIB AND NOT BUILD_SHARED_LIBS) + if(NOT BUILD_SHARED_LIBS) install(CODE "MESSAGE(FATAL_ERROR \"Installing liblammps with downloaded libraries is currently not supported.\")") endif() else() diff --git a/cmake/Modules/Testing.cmake b/cmake/Modules/Testing.cmake index dee47b9040..f0a5f4519d 100644 --- a/cmake/Modules/Testing.cmake +++ b/cmake/Modules/Testing.cmake @@ -2,7 +2,7 @@ # Testing ############################################################################### option(ENABLE_TESTING "Enable testing" OFF) -if(ENABLE_TESTING AND BUILD_EXE) +if(ENABLE_TESTING) enable_testing() option(LAMMPS_TESTING_SOURCE_DIR "Location of lammps-testing source directory" "") option(LAMMPS_TESTING_GIT_TAG "Git tag of lammps-testing" "master") diff --git a/cmake/README.md b/cmake/README.md deleted file mode 100644 index cd90bc7020..0000000000 --- a/cmake/README.md +++ /dev/null @@ -1,2330 +0,0 @@ -# Building LAMMPS using CMake - -LAMMPS recently acquired support for building with CMake thanks to the efforts -of Christoph Junghans (LANL) and Richard Berger (Temple U). One of the key -strengths of CMake is that it can generate the necessary build system files of -your own personal preference. It also enables using common development IDEs such -as Eclipse, Visual Studio, QtCreator, Xcode and many more for LAMMPS -development. - -CMake can both be used as a command-line (CLI) utility `cmake` or through one of -its GUIs. `ccmake` is a text-based ui to configure and build CMake projects. -`cmake-gui` is a graphical frontend for running CMake operations that works on -Linux desktop environments, Windows and MacOS X. - -The following is a tutorial-style introduction in using the CMake system. It -should give you the necessary foundation to understand how to do the most common -tasks, act as a reference and provide examples of typical use cases. - -## Table of Contents - - * [Quick Start for the Impatient](#quick-start-for-the-impatient) - * [Building LAMMPS using cmake](#building-lammps-using-cmake-1) - * [Prerequisites](#prerequisites) - * [Build directory vs. Source Directory](#build-directory-vs-source-directory) - * [Defining and using presets](#defining-and-using-presets) - * [Reference](#reference) - * [Common CMake Configuration Options](#common-cmake-configuration-options) - * [LAMMPS Configuration Options](#lammps-configuration-options) - * [Parallelization and Accelerator Packages](#parallelization-and-accelerator-packages) - * [Default Packages](#default-packages) - * [Other Packages](#other-packages) - * [User Packages](#user-packages) - * [Package-Specific Configuration Options](#package-specific-configuration-options) - * [KSPACE Package](#kspace-package) - * [MKL](#mkl) - * [FFTW3](#fftw3) - * [BLAS](#blas) - * [LAPACK](#lapack) - * [PYTHON Package](#python-package) - * [GPU Package](#gpu-package) - * [MESSAGE Package](#message-package) - * [MSCG Package](#mscg-package) - * [VORONOI Package](#voronoi-package) - * [USER-LATTE Package](#user-latte-package) - * [USER-PLUMED Package](#user-plumed-package) - * [USER-SCAFACOS Package](#user-scafacos-package) - * [USER-SMD Package](#user-smd-package) - * [Optional Features](#optional-features) - * [zlib support](#zlib-support) - * [JPEG support](#jpeg-support) - * [PNG support](#png-support) - * [GZIP support](#gzip-support) - * [FFMPEG support](#ffmpeg-support) - * [Compilers](#compilers) - * [Building with GNU Compilers](#building-with-gnu-compilers) - * [Building with Intel Compilers](#building-with-intel-compilers) - * [Building with LLVM/Clang Compilers](#building-with-llvmclang-compilers) - -## Quick Start for the Impatient -If you want to skip ahead and just run the compilation using `cmake`, please -find a minimal example below. Together with the options reference below, this -should get you started. - -```bash -git clone https://github.com/lammps/lammps.git -mkdir lammps/build -cd lammps/build -cmake [-D OPTION_A=VALUE_A -D OPTION_B=VALUE_B ...] ../cmake -make -``` - -# Building LAMMPS using `cmake` - -## Prerequisites -This tutorial assumes you are running in a command-line environment using a -shell like Bash. - -* Linux: any terminal window will work -* MacOS X: launch the Terminal app -* Windows 10: install and run "Bash on Windows" (aka Ubuntu on Windows) - -Before we start, please download the latest and greatest version of LAMMPS from -GitHub. You can either download it as a tarball or ZIP file, or via git. When -you start with a fresh lammps directory, the contents should look like this: - -```bash -$ ls -bench doc lib potentials README tools -cmake examples LICENSE python src -``` - -## Build directory vs. Source Directory - -By using CMake we separate building LAMMPS into multiple phases: - -1. **Configuration**: define which features we want to enable/disable and how it should be compiled -2. **Compilation**: compile each source file and generate binaries and libraries based on the configuration -3. **Installation** (Optional): finally we can install the generated binaries on our system - -In the GNU Make based build system of LAMMPS, configuration occurs by running -special make targets like `make yes-MOLECULAR`. These targets modify the -**source directory** (`src/`) directory by copying package files and patching -Makefile. In some cases you are force to manually edit Makefiles to add compiler -options and/or correct include directory and library paths. - -These edits and copy operations are no longer necessary when compiling with -CMake. The source directory stays untouched, so you compile LAMMPS in many -different variants using the same source code checkout. It enables true -**out-of-source** builds. - -When using Cmake, you can compile in **any** folder outside of the source -directory. Any working directory you choose becomes a so-called **build -directory**. All configuration files and compilation results are stored in this -folder. We recommend calling it something like `build/`. - -Let's have a look a quick example, where we get the greatest and latest version -of LAMMPS from GitHub via git: -```bash -git clone https://github.com/lammps/lammps.git -``` - -We then create a new `build` folder and make it our current working directory: -``` -mkdir lammps/build -cd lammps/build -``` - -To configure LAMMPS we run `cmake` inside of this folder. However it requires at -least one argument. `cmake` needs to read the LAMMPS `CMakeLists.txt` file to -know what to do. This file is located in the `cmake/` subdirectory of the -lammps checkout. To run `cmake` add the relative or absolute path to the `cmake/` -directory as first argument. - -E.g., if the current working directory is `lammps/build` you can specify the -relative path to `lammps/cmake` as follows: -``` -cmake ../cmake -``` - -You could also specify the absolute path: -``` -cmake /path/to/my/lammps/folder/cmake -``` - -Please note: **This does NOT compile the code!** Running cmake only configures -the next build. It generates the necessary files to compile the code. On -Unix/Linux it defaults to generating Makefiles. You can also choose other output -formats to generate files for Eclipse, Xcode or Visual Studio which are -supported on other platorms. - -To compile LAMMPS once the Makefiles are generated, simply type `make` in the -build directory. - -``` -make -``` -# Defining and using presets - -The CMake build exposes a lot of different options. In the old build system -some of the package selections were possible by using special make target like -`make yes-std` or `make no-lib`. Achieving a similar result with cmake requires -specifying all options manually. This can quickly become a very long command -line that is hard to handle. While these could be stored in a simple script -file, there is another way of defining "presets" to compile LAMMPS in a certain -way. Since the cmake build process - contrary to the conventional build system - -includes the compilation of the bundled libraries into the standard build process, -the grouping of those presets is somewhat different. - -A preset is a regular CMake script file that can use constructs such as -variables, lists and for-loops to manipulate configuration options and create -an [*initial cache*](https://cmake.org/cmake/help/v3.12/manual/cmake.1.html). -Options must be set with the `CACHE` and `FORCE` flag to ensure they are -considered even during a second cmake run. - -Such a file can then be passed to cmake via the `-C` flag. Several examples of -presets can be found in the `cmake/presets` folder. - -```bash -# build LAMMPS with all packages enabled which don't use external libraries and enable GPU package -mkdir build -cd build -cmake -C ../cmake/presets/all_on.cmake -C ../cmake/presets/nolib.cmake -D PKG_GPU=on ../cmake -``` - -# Reference - -## Common CMake Configuration Options - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
CMAKE_INSTALL_PREFIXInstall location where LAMMPS files will be copied to. In the Unix/Linux case with Makefiles this controls what `make install` will do. - Default setting is $HOME/.local. -
CMAKE_BUILD_TYPEControls if debugging symbols are added to the generated binaries -
-
RelWithDebInfo (default)
-
Release
-
Debug
-
MinSizeRel
-
-
CMAKE_VERBOSE_MAKEFILEEnable verbose output from Makefile builds (useful for debugging), the same can be achieved by adding `VERBOSE=1` to the `make` call. -
-
off (default)
-
on
-
-
- - -## LAMMPS Configuration Options - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
LAMMPS_SIZE_LIMITControls the integer sizes used by LAMMPS internally -
-
LAMMPS_SMALLBIG (default)
-
32bit , 64bit
-
LAMMPS_SMALLSMALL
-
32bit , 32bit
-
LAMMPS_BIGBIG
-
64bit , 64bit
-
-
LAMMPS_LONGLONG_TO_LONGWorkaround if your system or MPI version does not recognize long long data types -
-
off (default)
-
on
-
-
LAMMPS_OMP_COMPATWorkaround for backwards-incompatible changes regarding predetermined sharing modes in OpenMP 4.x. A value of 3 or 4 should be used, reflecting the version of the OpenMP spec that is implemented by the compiler. -
-
3 (default except for known OMP 4.0 compilers)
-
4
-
-
LAMMPS_MEMALIGNcontrols the alignment of blocks of memory allocated by LAMMPS -
-
64 (default)
-
-
LAMMPS_EXCEPTIONScontrols whether LAMMPS dies after an error or throws a C++ exception. This is particularly useful when running through the C library interface, since an error - in LAMMPS then doesn't kill the parent process -
-
off (default)
-
on
-
-
LAMMPS_MACHINEallows appending a machine suffix to the generated LAMMPS binary -
-
*none* (default)
-
-
LAMMPS_LIB_SUFFIXallows appending a suffix to the generated LAMMPS library -
-
*none* (default)
-
-
BUILD_LIBcontrol whether to build LAMMPS as a library -
-
off (default)
-
on
-
-
BUILD_EXEcontrol whether to build LAMMPS executable -
-
on (default)
-
off
-
-
BUILD_SHARED_LIBScontrol whether to build LAMMPS as a shared-library -
-
off (default)
-
on
-
-
BUILD_DOCcontrol whether to build LAMMPS documentation -
-
off (default)
-
on
-
-
BUILD_TOOLScontrol whether to build LAMMPS tools -
-
off (default)
-
on
-
-
- -## Parallelization and Accelerator Packages - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
BUILD_MPIcontrol whether to build LAMMPS with MPI support. This will look for - `mpicxx` in your path and use this MPI implementation. -
-
on (default, if found)
-
off
-
-
BUILD_OMPcontrol whether to build LAMMPS with OpenMP support. -
-
on (default, if found)
-
off
-
-
PKG_OPT - A handful of pair styles which are optimized for improved CPU performance on - single or multiple cores. These include EAM, LJ, CHARMM, and Morse potentials. - -
-
off (default)
-
on
-
-
PKG_USER-OMP - Hundreds of pair, fix, compute, bond, angle, dihedral, improper, and kspace - styles which are altered to enable threading on many-core CPUs via OpenMP - directives. - -
-
off (default)
-
on
-
-
PKG_USER-INTEL - Dozens of pair, fix, bond, angle, dihedral, improper, and kspace styles which - are optimized for Intel CPUs and KNLs (Knights Landing). - -
-
off (default)
-
on
-
-
PKG_GPU - Dozens of pair styles and a version of the PPPM long-range Coulombic solver - optimized for GPUs. All such styles have a “gpu” as a suffix in their style - name. The GPU code can be compiled with either CUDA or OpenCL, however the - OpenCL variants are no longer actively maintained and only the CUDA versions - are regularly tested. - -
-
off (default)
-
on
-
-
PKG_KOKKOSDozens of atom, pair, bond, angle, dihedral, improper, fix, compute styles adapted to compile using the Kokkos library which can convert them to OpenMP or CUDA code so that they run efficiently on multicore CPUs, KNLs, or GPUs. -
-
off (default)
-
on
-
-
- -## Default Packages - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
PKG_ASPHEREComputes, time-integration fixes, and pair styles for aspherical particle models including ellipsoids, 2d lines, and 3d triangles. -
-
off (default)
-
on
-
-
PKG_BODYBody-style particles with internal structure. Computes, time-integration fixes, pair styles, as well as the body styles themselves. -
-
off (default)
-
on
-
-
PKG_CLASS2Bond, angle, dihedral, improper, and pair styles for the COMPASS CLASS2 molecular force field. -
-
off (default)
-
on
-
-
PKG_COLLOIDCoarse-grained finite-size colloidal particles. Pair styles and fix wall styles for colloidal interactions. Includes the Fast Lubrication Dynamics (FLD) method for hydrodynamic interactions, which is a simplified approximation to Stokesian dynamics. -
-
off (default)
-
on
-
-
PKG_COMPRESSCompressed output of dump files via the zlib compression library, using dump styles with a “gz” in their style name. -
-
off (default)
-
on
-
-
PKG_CORESHELLCompute and pair styles that implement the adiabatic core/shell model for polarizability. The pair styles augment Born, Buckingham, and Lennard-Jones styles with core/shell capabilities. The compute temp/cs command calculates the temperature of a system with core/shell particles. -
-
off (default)
-
on
-
-
PKG_DIPOLEAn atom style and several pair styles for point dipole models with short-range or long-range interactions. -
-
off (default)
-
on
-
-
PKG_GRANULARPair styles and fixes for finite-size granular particles, which interact with each other and boundaries via frictional and dissipative potentials. -
-
off (default)
-
on
-
-
PKG_KSPACEA variety of long-range Coulombic solvers, as well as pair styles which compute the corresponding short-range pairwise Coulombic interactions. These include Ewald, particle-particle particle-mesh (PPPM), and multilevel summation method (MSM) solvers. -
-
off (default)
-
on
-
-
PKG_MANYBODY - A variety of manybody and bond-order potentials. These include (AI)REBO, BOP, - EAM, EIM, Stillinger-Weber, and Tersoff potentials. - -
-
off (default)
-
on
-
-
PKG_MC - Several fixes and a pair style that have Monte Carlo (MC) or MC-like - attributes. These include fixes for creating, breaking, and swapping bonds, - for performing atomic swaps, and performing grand-canonical MC (GCMC) in - conjunction with dynamics. - -
-
off (default)
-
on
-
-
PKG_MISC - A variety of compute, fix, pair, dump styles with specialized capabilities that - don’t align with other packages. - -
-
off (default)
-
on
-
-
PKG_MOLECULE - A large number of atom, pair, bond, angle, dihedral, improper styles that are - used to model molecular systems with fixed covalent bonds. The pair styles - include the Dreiding (hydrogen-bonding) and CHARMM force fields, and a TIP4P - water model. - -
-
off (default)
-
on
-
-
PKG_PERI - An atom style, several pair styles which implement different Peridynamics - materials models, and several computes which calculate diagnostics. - Peridynamics is a a particle-based meshless continuum model. - -
-
off (default)
-
on
-
-
PKG_QEQ - Several fixes for performing charge equilibration (QEq) via different - algorithms. These can be used with pair styles that perform QEq as part of - their formulation. - -
-
off (default)
-
on
-
-
PKG_REPLICA - A collection of multi-replica methods which can be used when running multiple - LAMMPS simulations (replicas). See Section 6.5 for an overview of how to run - multi-replica simulations in LAMMPS. Methods in the package include nudged - elastic band (NEB), parallel replica dynamics (PRD), temperature accelerated - dynamics (TAD), parallel tempering, and a verlet/split algorithm for - performing long-range Coulombics on one set of processors, and the remainder - of the force field calcalation on another set. - -
-
off (default)
-
on
-
-
PKG_RIGID - Fixes which enforce rigid constraints on collections of atoms or particles. - This includes SHAKE and RATTLE, as well as varous rigid-body integrators for a - few large bodies or many small bodies. Also several computes which calculate - properties of rigid bodies. - -
-
off (default)
-
on
-
-
PKG_SHOCK - Fixes for running impact simulations where a shock-wave passes through a - material. - -
-
off (default)
-
on
-
-
PKG_SPINModel atomic magnetic spins classically, coupled to atoms moving in the usual manner via MD. Various pair, fix, and compute styles. -
-
off (default)
-
on
-
-
PKG_SNAP - A pair style for the spectral neighbor analysis potential (SNAP). SNAP is - methodology for deriving a highly accurate classical potential fit to a large - archive of quantum mechanical (DFT) data. Also several computes which analyze - attributes of the potential. - -
-
off (default)
-
on
-
-
PKG_SRD - A pair of fixes which implement the Stochastic Rotation Dynamics (SRD) method - for coarse-graining of a solvent, typically around large colloidal particles. - -
-
off (default)
-
on
-
-
- -## Other Packages - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
PKG_KIMA pair_style kim command which is a wrapper on the Knowledge Base for Interatomic Models (KIM) repository of interatomic potentials, enabling any of them to be used in LAMMPS simulations. -
-
off (default)
-
on
-
-
PKG_PYTHONEnable support for Python scripting inside of LAMMPS. -
-
off (default)
-
on
-
-
PKG_MESSAGECommands to use LAMMPS as either a client or server and couple it to another application. -
-
off (default)
-
on
-
-
PKG_MSCG - A fix mscg command which can parameterize a Multi-Scale Coarse-Graining (MSCG) - model using the open-source MS-CG library. - -
-
off (default)
-
on
-
-
PKG_MPIIO - Support for parallel output/input of dump and restart files via the MPIIO library. - -
-
off (default)
-
on
-
-
PKG_POEMS - A fix that wraps the Parallelizable Open source Efficient Multibody Software - (POEMS) library, which is able to simulate the dynamics of articulated body - systems. These are systems with multiple rigid bodies (collections of - particles) whose motion is coupled by connections at hinge points. - -
-
off (default)
-
on
-
-
PKG_LATTE - A fix command which wraps the LATTE DFTB code, so that molecular dynamics can - be run with LAMMPS using density-functional tight-binding quantum forces - calculated by LATTE. - -
-
off (default)
-
on
-
-
PKG_VORONOI - A compute command which calculates the Voronoi tesselation of a collection of atoms by wrapping the Voro++ library. This can be used to calculate the local volume or each atoms or its near neighbors. - -
-
off (default)
-
on
-
-
- -## User Packages - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
PKG_USER-ADIOSADIOS is a high-performance I/O library. This package implements the dump “atom/adios” and dump “custom/adios” commands to write data using the ADIOS library. -
-
off (default)
-
on
-
-
PKG_USER-ATC - ATC stands for atoms-to-continuum. This package implements a fix atc command - to either couple molecular dynamics with continuum finite element equations or - perform on-the-fly conversion of atomic information to continuum fields. - -
-
off (default)
-
on
-
-
PKG_USER-AWPMD - AWPMD stands for Antisymmetrized Wave Packet Molecular Dynamics. This package - implements an atom, pair, and fix style which allows electrons to be treated - as explicit particles in a classical molecular dynamics model. - -
-
off (default)
-
on
-
-
PKG_USER-BOCS - This package provides fix bocs, a modified version of fix npt which includes the pressure correction to the barostat as outlined in: N. J. H. Dunn and W. G. Noid, “Bottom-up coarse-grained models that accurately describe the structure, pressure, and compressibility of molecular liquids,” J. Chem. Phys. 143, 243148 (2015). - -
-
off (default)
-
on
-
-
PKG_USER-CGDNA - Several pair styles, a bond style, and integration fixes for coarse-grained - models of single- and double-stranded DNA based on the oxDNA model of Doye, - Louis and Ouldridge at the University of Oxford. This includes Langevin-type - rigid-body integrators with improved stability. - -
-
off (default)
-
on
-
-
PKG_USER-CGSDK - Several pair styles and an angle style which implement the coarse-grained SDK - model of Shinoda, DeVane, and Klein which enables simulation of ionic liquids, - electrolytes, lipids and charged amino acids. - -
-
off (default)
-
on
-
-
PKG_USER-COLVARS - COLVARS stands for collective variables, which can be used to implement - various enhanced sampling methods, including Adaptive Biasing Force, - Metadynamics, Steered MD, Umbrella Sampling and Restraints. A fix colvars - command is implemented which wraps a COLVARS library, which implements these - methods. simulations. - -
-
off (default)
-
on
-
-
PKG_USER-DIFFRACTION - Two computes and a fix for calculating x-ray and electron diffraction - intensities based on kinematic diffraction theory. - -
-
off (default)
-
on
-
-
PKG_USER-DPD - DPD stands for dissipative particle dynamics. This package implements - coarse-grained DPD-based models for energetic, reactive molecular crystalline - materials. It includes many pair styles specific to these systems, including - for reactive DPD, where each particle has internal state for multiple species - and a coupled set of chemical reaction ODEs are integrated each timestep. - Highly accurate time integrators for isothermal, isoenergetic, isobaric and - isenthalpic conditions are included. These enable long timesteps via the - Shardlow splitting algorithm. - -
-
off (default)
-
on
-
-
PKG_USER-DRUDE - Fixes, pair styles, and a compute to simulate thermalized Drude oscillators as - a model of polarization. - -
-
off (default)
-
on
-
-
PKG_USER-EFF - EFF stands for electron force field which allows a classical MD code to model - electrons as particles of variable radius. This package contains atom, pair, - fix and compute styles which implement the eFF as described in A. - Jaramillo-Botero, J. Su, Q. An, and W.A. Goddard III, JCC, 2010. The eFF - potential was first introduced by Su and Goddard, in 2007. - -
-
off (default)
-
on
-
-
PKG_USER-FEP - FEP stands for free energy perturbation. This package provides methods for - performing FEP simulations by using a fix adapt/fep command with soft-core - pair potentials, which have a “soft” in their style name. - -
-
off (default)
-
on
-
-
PKG_USER-H5MD - H5MD stands for HDF5 for MD. HDF5 is a portable, binary, self-describing file - format, used by many scientific simulations. H5MD is a format for molecular - simulations, built on top of HDF5. This package implements a dump h5md command - to output LAMMPS snapshots in this format. - -
-
off (default)
-
on
-
-
PKG_USER-LB - Fixes which implement a background Lattice-Boltzmann (LB) fluid, which can be - used to model MD particles influenced by hydrodynamic forces. - -
-
off (default)
-
on
-
-
PKG_USER-MANIFOLD - Several fixes and a “manifold” class which enable simulations of particles - constrained to a manifold (a 2D surface within the 3D simulation box). This is - done by applying the RATTLE constraint algorithm to formulate single-particle - constraint functions g(xi,yi,zi) = 0 and their derivative (i.e. the normal of - the manifold) n = grad(g). - -
-
off (default)
-
on
-
-
PKG_USER-MEAMC - A pair style for the modified embedded atom (MEAM) potential translated from - the Fortran version in the MEAM package to plain C++. In contrast to the MEAM - package, no library needs to be compiled and the pair style can be - instantiated multiple times. - -
-
off (default)
-
on
-
-
PKG_USER-MESO - Several extensions of the the dissipative particle dynamics (DPD) method. - Specifically, energy-conserving DPD (eDPD) that can model non-isothermal - processes, many-body DPD (mDPD) for simulating vapor-liquid coexistence, and - transport DPD (tDPD) for modeling advection-diffusion-reaction systems. The - equations of motion of these DPD extensions are integrated through a modified - velocity-Verlet (MVV) algorithm. - -
-
off (default)
-
on
-
-
PKG_USER-MGPT - A pair style which provides a fast implementation of the quantum-based MGPT - multi-ion potentials. The MGPT or model GPT method derives from - first-principles DFT-based generalized pseudopotential theory (GPT) through a - series of systematic approximations valid for mid-period transition metals - with nearly half-filled d bands. The MGPT method was originally developed by - John Moriarty at LLNL. The pair style in this package calculates forces and - energies using an optimized matrix-MGPT algorithm due to Tomas Oppelstrup at - LLNL. - -
-
off (default)
-
on
-
-
PKG_USER-MISC - A potpourri of (mostly) unrelated features contributed to LAMMPS by users. - Each feature is a single fix, compute, pair, bond, angle, dihedral, improper, - or command style. - -
-
off (default)
-
on
-
-
PKG_USER-MOFFF - Pair, angle and improper styles needed to employ the MOF-FF force field by - Schmid and coworkers with LAMMPS. MOF-FF is a first principles derived force - field with the primary aim to simulate MOFs and related porous framework - materials, using spherical Gaussian charges. It is described in S. Bureekaew - et al., Phys. Stat. Sol. B 2013, 250, 1128-1141. For the usage of MOF-FF see - the example in the example directory as well as the MOF+ website. - -
-
off (default)
-
on
-
-
PKG_USER-MOLFILE - A dump molfile command which uses molfile plugins that are bundled with the - VMD molecular visualization and analysis program, to enable LAMMPS to dump - snapshots in formats compatible with various molecular simulation tools. - -
-
off (default)
-
on
-
-
PKG_USER-NETCDF - Dump styles for writing NetCDF formatted dump files. NetCDF is a portable, - binary, self-describing file format developed on top of HDF5. The file - contents follow the AMBER NetCDF trajectory conventions - (http://ambermd.org/netcdf/nctraj.xhtml), but include extensions. - -
-
off (default)
-
on
-
-
PKG_USER-PHONON - A fix phonon command that calculates dynamical matrices, which can then be - used to compute phonon dispersion relations, directly from molecular dynamics - simulations. - -
-
off (default)
-
on
-
-
PKG_USER-PLUMED - The fix plumed command allows you to use the PLUMED free energy plugin for molecular dynamics to analyze and bias your LAMMPS trajectory on the fly. The PLUMED library is called from within the LAMMPS input script by using the fix plumed command. - -
-
off (default)
-
on
-
-
PKG_USER-PTM - A compute ptm/atom command that calculates local structure characterization using the Polyhedral Template Matching methodology. - -
-
off (default)
-
on
-
-
PKG_USER-QTB - Two fixes which provide a self-consistent quantum treatment of vibrational modes in a classical molecular dynamics simulation. By coupling the MD simulation to a colored thermostat, it introduces zero point energy into the system, altering the energy power spectrum and the heat capacity to account for their quantum nature. This is useful when modeling systems at temperatures lower than their classical limits or when temperatures ramp across the classical limits in a simulation. - -
-
off (default)
-
on
-
-
PKG_USER-QUIP - A pair_style quip command which wraps the QUIP libAtoms library, which - includes a variety of interatomic potentials, including Gaussian Approximation - Potential (GAP) models developed by the Cambridge University group. - -
-
off (default)
-
on
-
-
PKG_USER-QMMM - A fix qmmm command which allows LAMMPS to be used in a QM/MM simulation, - currently only in combination with the Quantum ESPRESSO package. - -
-
off (default)
-
on
-
-
PKG_USER-REAXC - A pair style which implements the ReaxFF potential in C/C++ (in contrast to - the REAX package and its Fortran library). ReaxFF is universal reactive force - field. See the src/USER-REAXC/README file for more info on differences between - the two packages. Also two fixes for monitoring molecules as bonds are created - and destroyed. - -
-
off (default)
-
on
-
-
PKG_USER-SCAFACOS - A KSpace style which wraps the ScaFaCoS Coulomb solver library to compute long-range Coulombic interactions. - -
-
off (default)
-
on
-
-
PKG_USER-SDPD - A pair style for smoothed dissipative particle dynamics (SDPD), which is an - extension of smoothed particle hydrodynamics (SPH) to mesoscale where thermal - fluctuations are important (see the USER-SPH package). Also two fixes for - moving and rigid body integration of SPH/SDPD particles (particles of - atom_style meso). -
-
off (default)
-
on
-
-
PKG_USER-SMD - An atom style, fixes, computes, and several pair styles which implements - smoothed Mach dynamics (SMD) for solids, which is a model related to smoothed - particle hydrodynamics (SPH) for liquids (see the USER-SPH package). - -
-
off (default)
-
on
-
-
PKG_USER-SMTBQ - A pair style which implements a Second Moment Tight Binding model with QEq - charge equilibration (SMTBQ) potential for the description of ionocovalent - bonds in oxides. - -
-
off (default)
-
on
-
-
PKG_USER-SPH - An atom style, fixes, computes, and several pair styles which implements - smoothed particle hydrodynamics (SPH) for liquids. See the related USER-SMD - package package for smooth Mach dynamics (SMD) for solids. - -
-
off (default)
-
on
-
-
PKG_USER-TALLY - Several compute styles that can be called when pairwise interactions are - calculated to tally information (forces, heat flux, energy, stress, etc) about - individual interactions. - -
-
off (default)
-
on
-
-
PKG_USER-UEF - A fix style for the integration of the equations of motion under extensional - flow with proper boundary conditions, as well as several supporting compute - styles and an output option. - -
-
off (default)
-
on
-
-
PKG_USER-VTK - A dump vtk command which outputs snapshot info in the VTK format, enabling - visualization by Paraview or other visualization packages. - -
-
off (default)
-
on
-
-
PKG_USER-YAFF - Some potentials that are also implemented in the Yet Another Force Field (YAFF) code. - The expressions and their use are discussed in the following papers: - - -
-
off (default)
-
on
-
-
- -## Package-Specific Configuration Options - -### KSPACE Package - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
FFT -

FFT library for KSPACE package

-

If either MKL or FFTW is selected cmake will try to locate - these libraries automatically. To control which one should be used please see - the options below for each FFT library. Otherwise it will default to KISS - FFT.

-
-
-
FFTW3
-
FFTW2
-
MKL
-
KISS (default)
-
-
FFT_SINGLEUse single-precision floating-point in FFT -
-
off (default = double precision)
-
on
-
-
FFT_PACKOptimization for FFT -
-
array (default)
-
pointer
-
memcpy
-
-
- -### FFTW3 - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
FFTW3_INCLUDE_DIRSpath to FFTW3 include files -
FFTW3_LIBRARIESlist of paths to FFTW3 libraries -
- -### MKL - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
MKL_INCLUDE_DIRSpath to MKL include files -
MKL_LIBRARIESlist of paths to MKL libraries -
- -### BLAS - -See [FindBLAS documentation](https://cmake.org/cmake/help/latest/module/FindBLAS.html) - -### LAPACK - -See [FindLAPACK documentation](https://cmake.org/cmake/help/latest/module/FindLAPACK.html) - -### PYTHON Package - -See [FindPYTHON documentation](https://cmake.org/cmake/help/latest/module/FindPython.html) - -### USER-INTEL Package - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
INTEL_ARCHTarget architecture for USER-INTEL package -
-
cpu (default)
-
knl
-
-
INTEL_LRT_MODEHow to support Long-range thread mode in Verlet integration -
-
threads (default, if pthreads available)
-
none (default, if pthreads not available)
-
c++11
-
-
- -### GPU Package -The GPU package builds a support library which can either use OpenCL or CUDA as -target API. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
GPU_APIAPI used by GPU package -
-
opencl (default)
-
cuda
-
-
GPU_PRECPrecision size used by GPU package kernels -
-
mixed (default)
-
single
-
double
-
-
OCL_TUNE (OpenCL only)Tuning target for OpenCL driver code -
-
generic (default)
-
intel (Intel CPU)
-
phi (Intel Xeon Phi)
-
fermi (NVIDIA)
-
kepler (NVIDIA)
-
cypress (AMD)
-
-
GPU_ARCH (CUDA only)CUDA SM architecture targeted by GPU package -
-
sm_20 (Fermi)
-
sm_30 (Kepler) (default)
-
sm_50 (Maxwell)
-
sm_60 (Pascal)
-
sm_70 (Volta)
-
sm_75 (Turing)
-
-
CUDPP_OPT (CUDA only)Enable CUDA Performance Primitives Optimizations -
-
on (default)
-
off
-
-
CUDA_MPS_SUPPORT (CUDA only)Enable tweaks for running with Nvidia CUDA Multi-process services daemon -
-
on
-
off (default)
-
-
BIN2C (CUDA only)Path to bin2c executable, will automatically pick up the first one in your $PATH.(automatic)
- -### KIM Package - -Requires installation of the KIM library with API v2 - -If `DOWNLOAD_KIM` is set, the KIM library will be downloaded and built inside -the CMake build directory. If the KIM library is already on your system (in a -location CMake cannot find it), set the `PKG_CONFIG_PATH` environment variable -so that `libkim-api` can be found. - - - - - - - - - - - - - - - - -
OptionDescriptionValues
DOWNLOAD_KIMDownload KIM API v2 and compile it as part of the build. -
-
off (default)
-
on
-
-
- -### MESSAGE Package - -This package can optionally include support for messaging via sockets, using the open-source [ZeroMQ library](http://zeromq.org/), which must be installed on your system. - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
MESSAGE_ZMQBuild with ZeroMQ support -
-
off (default)
-
on
-
-
ZMQ_LIBRARY - ZMQ library file (only needed if at custom location) - -
ZMG_INCLUDE_DIR - Provide include directory of existing ZMQ installation (only needed if at custom location) - -
- -### MSCG Package - -Requires installation of the MSCG library - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
DOWNLOAD_MSCGDownload MSCG and compile it as part of the build -
-
off (default)
-
on
-
-
MSCG_LIBRARY - MSCG library file (only needed if at custom location) - -
MSCG_INCLUDE_DIR - Provide include directory of existing MSCG installation (only needed if at custom location) - -
- -### VORONOI Package - -Requires installation of the Voro++ library - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
DOWNLOAD_VORODownload Voro++ and compile it as part of the build -
-
off (default)
-
on
-
-
VORO_LIBRARY - Voro++ library file (only needed if at custom location) - -
VORO_INCLUDE_DIR - Provide include directory of existing Voro++ installation (only needed if at custom location) - -
- -### USER-COLVARS Package - -Requires a C++11 compiler to compile with the Lepton library included. - - - - - - - - - - - - - - - -
OptionDescriptionValues
COLVARS_LEPTONEnable the use of the Lepton library inside the Colvars library. - -
-
on (default)
-
off
-
-
- -### USER-LATTE Package - -Requires installation of the LATTE library - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
DOWNLOAD_LATTEDownload LATTE and compile it as part of the build -
-
off (default)
-
on
-
-
LATTE_LIBRARY - LATTE library file (only needed if at custom location) - -
- -### USER-PLUMED Package - -Requires installation of the PLUMED library - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
DOWNLOAD_PLUMEDDownload PLUMED and compile it as part of the build -
-
off (default)
-
on
-
-
PLUMED_MODE - Determines the linkage mode for the PLUMED library. - -
-
static (default)
-
shared
-
runtime
-
-
- -### USER-LATTE Package - -Requires installation of the LATTE library - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
DOWNLOAD_LATTEDownload LATTE and compile it as part of the build -
-
off (default)
-
on
-
-
LATTE_LIBRARY - LATTE library file (only needed if at custom location) - -
- -### USER-SMD Package - -Requires installation of the Eigen3 library - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
DOWNLOAD_EIGEN3Download Eigen3 and compile it as part of the build -
-
off (default)
-
on
-
-
EIGEN3_INCLUDE_DIR - Provide include directory of existing Eigen3 installation (only needed if at custom location) - -
- - -### USER-SCAFACOS Package - -To build with this package, you must download and build the [ScaFaCoS Coulomb solver library](http://www.scafacos.de/) - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
DOWNLOAD_SCAFACOSDownload SCAFACOS and compile it as part of the build -
-
off (default)
-
on
-
-
SCAFACOS_LIBRARY - SCAFACOS library file (only needed if at custom location) - -
SCAFACOS_INCLUDE_DIR - SCAFACOS include directory (only needed if at custom location) - -
- -## Optional Features - -### zlib support - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
ZLIB_INCLUDE_DIR -
ZLIB_LIBRARIES -
- -### JPEG support - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
WITH_JPEGEnables/Disable JPEG support in LAMMPS -
-
yes (default, if found)
-
no
-
-
JPEG_INCLUDE_DIR -
JPEG_LIBRARIES -
- -### PNG support -(requires zlib support) - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
WITH_PNGEnables/Disable PNG support in LAMMPS -
-
yes (default, if found)
-
no
-
-
PNG_INCLUDE_DIR -
PNG_LIBRARIES -
- -### GZIP support - -requires `gzip` to be in your `PATH` - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
WITH_GZIPEnables/Disable GZIP support in LAMMPS -
-
yes (default, if found)
-
no
-
-
GZIP_EXECUTABLEPath to gzip executable, will automatically pick up the first one in your $PATH.(automatic)
- -### FFMPEG support - -requires `ffmpeg` to be in your `PATH` - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
WITH_FFMPEGEnables/Disable FFMPEG support in LAMMPS -
-
yes (default, if found)
-
no
-
-
FFMPEG_EXECUTABLEPath to ffmpeg executable, will automatically pick up the first one in your $PATH.(automatic)
- - -## Compilers - -By default, `cmake` will use your environment C/C++/Fortran compilers for a -build. It uses the `CC`, `CXX` and `FC` environment variables to detect which -compilers should be used. However, these values will be cached after the first -run of `cmake`. Subsequent runs of `cmake` will ignore changes in these -environment variables. To ensure the correct values are used you avoid the -cache by setting the `CMAKE_C_COMPILER`, `CMAKE_CXX_COMPILER`, -`CMAKE_Fortran_COMPILER` options directly. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionDefault
CMAKE_C_COMPILERC Compiler which should be used by CMakevalue of `CC` environment variable at first `cmake` run
CMAKE_CXX_COMPILERC++ compiler which should be used by CMake - value of `CXX` environment variable at first `cmake` run -
CMAKE_Fortran_COMPILERC++ compiler which should be used by CMake - value of `FC` environment variable at first `cmake` run -
CXX_COMPILER_LAUNCHERCMake will run this tool and pass the compiler and its arguments to the tool. Some example tools are distcc and ccache. - (empty) -
- -### Building with GNU Compilers - -```bash -cmake -D CMAKE_C_COMPILER=gcc -D CMAKE_CXX_COMPILER=g++ -D CMAKE_Fortran_COMPILER=gfortran ../cmake -``` - -### Building with Intel Compilers - -```bash -cmake -D CMAKE_C_COMPILER=icc -D CMAKE_CXX_COMPILER=icpc -D CMAKE_Fortran_COMPILER=ifort ../cmake -``` - - -### Building with LLVM/Clang Compilers - -```bash -cmake -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER=clang++ -D CMAKE_Fortran_COMPILER=flang ../cmake -``` - -## LAMMPS Developer Options - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValues
ENABLE_TESTINGControl wheather to add tests via CTest -
-
off (default)
-
on
-
-
LAMMPS_TESTING_SOURCE_DIRCustom location of lammps-testing repository (optional). If not specified it will download it via Git -
LAMMPS_TESTING_GIT_TAGIf lammps-testing repository is cloned, this is the tag/commit that will be checked out -
-
master (default)
-
-
ENABLE_COVERAGEEnables code coverage support via gcov and adds a gcovr build target to generate a coverage report. -
-
off (default)
-
on
-
-
ENABLE_SANITIZE_ADDRESSEnables Address Sanitizer support when compiling using GCC or Clang for detecting memory leaks in binaries while running them. See https://clang.llvm.org/docs/AddressSanitizer.html -
-
off (default)
-
on
-
-
ENABLE_SANITIZE_UNDEFINEDEnables Undefined Behavior Sanitizer support when compiling using GCC or Clang for detecting code that is running into undefined behavior of the language. See https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html -
-
off (default)
-
on
-
-
ENABLE_SANITIZE_THREADEnables Thread Sanitizer support when compiling using GCC or Clang for detecting data races in binaries while running them. See https://clang.llvm.org/docs/ThreadSanitizer.html -
-
off (default)
-
on
-
-
diff --git a/cmake/pkgconfig/liblammps.pc.in b/cmake/pkgconfig/liblammps.pc.in index 96dab89161..ca2c6191b7 100644 --- a/cmake/pkgconfig/liblammps.pc.in +++ b/cmake/pkgconfig/liblammps.pc.in @@ -27,6 +27,6 @@ Description: Large-scale Atomic/Molecular Massively Parallel Simulator Library URL: http://lammps.sandia.gov Version: @PROJECT_VERSION@ Requires: -Libs: -L${libdir} -llammps@LAMMPS_LIB_SUFFIX@ +Libs: -L${libdir} -llammps@LAMMPS_MACHINE@ Libs.private: -lm Cflags: -I${includedir} @LAMMPS_API_DEFINES@ diff --git a/doc/Makefile b/doc/Makefile index 895a4aa90d..c1f299a2f7 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -57,7 +57,7 @@ help: # ------------------------------------------ clean-all: clean - rm -rf $(BUILDDIR)/docenv $(BUILDDIR)/doctrees $(BUILDDIR)/mathjax + rm -rf $(BUILDDIR)/docenv $(BUILDDIR)/doctrees $(BUILDDIR)/mathjax Manual.pdf Developer.pdf clean: clean-spelling rm -rf html epub latex @@ -83,7 +83,7 @@ html: $(ANCHORCHECK) $(MATHJAX) @rm -rf html/JPG @cp -r src/PDF html/PDF @mkdir -p html/JPG - @cp `grep -A2 '\.\. .*image::' src/*.rst | grep ':target:' | sed -e 's,.*:target: JPG/,src/JPG/,' | sort | uniq` html/JPG/ + @cp `grep -A2 '\.\. .*\(image\|figure\)::' src/*.rst | grep ':target:' | sed -e 's,.*:target: JPG/,src/JPG/,' | sort | uniq` html/JPG/ @rm -rf html/PDF/.[sg]* @mkdir -p html/_static/mathjax @cp -r $(MATHJAX)/es5 html/_static/mathjax/ @@ -194,7 +194,7 @@ $(VENV): $(VIRTUALENV) -p $(PYTHON) $(VENV); \ . $(VENV)/bin/activate; \ pip install --upgrade pip; \ - pip install Sphinx==2.4.4; \ + pip install Sphinx; \ pip install sphinxcontrib-spelling ;\ pip install breathe; \ deactivate;\ diff --git a/doc/src/.gitignore b/doc/src/.gitignore index e0b9693457..afe24cc10c 100644 --- a/doc/src/.gitignore +++ b/doc/src/.gitignore @@ -1,3 +1 @@ -/Eqs -/JPG /false_positives.txt diff --git a/doc/src/Build.rst b/doc/src/Build.rst index c96fb0b5b9..441af79009 100644 --- a/doc/src/Build.rst +++ b/doc/src/Build.rst @@ -1,12 +1,14 @@ Build LAMMPS ************ -LAMMPS can be built as an executable or library from source code via -either traditional makefiles (which may require manual editing) -for use with GNU make or gmake, or a build environment generated by CMake -(Unix Makefiles, Xcode, Visual Studio, KDevelop or more). As an -alternative you can download a package with pre-built executables -as described on the :doc:`Install ` doc page. +LAMMPS is built as a library and an executable from source code using +either traditional makefiles for use with GNU make (which may require +manual editing), or using a build environment generated by CMake (Unix +Makefiles, Ninja, Xcode, Visual Studio, KDevelop, CodeBlocks and more). + +As an alternative you can download a package with pre-built executables +or automated build trees as described on the :doc:`Install ` +doc page. .. toctree:: :maxdepth: 1 diff --git a/doc/src/Build_basics.rst b/doc/src/Build_basics.rst index 99f051e6ff..335c1a5189 100644 --- a/doc/src/Build_basics.rst +++ b/doc/src/Build_basics.rst @@ -6,7 +6,8 @@ CMake and make: * :ref:`Serial vs parallel build ` * :ref:`Choice of compiler and compile/link options ` -* :ref:`Build LAMMPS as an executable or a library ` +* :ref:`Build the LAMMPS executable and library ` +* :ref:`Including and removing debug support ` * :ref:`Build the LAMMPS documentation ` * :ref:`Install LAMMPS after a build ` @@ -15,7 +16,7 @@ CMake and make: .. _serial: Serial vs parallel build -------------------------------------- +------------------------ LAMMPS is written to use the ubiquitous `MPI (Message Passing Interface) `_ library API @@ -28,8 +29,8 @@ MPI STUBS library. Independent of the distributed memory MPI parallelization, parts of LAMMPS are also written with support for shared memory parallelization -using the OpenMP threading standard. A more detailed discussion of that -is below. +using the `OpenMP `_ threading +standard. A more detailed discussion of that is below. **CMake build**\ : @@ -41,7 +42,7 @@ is below. # no default value The executable created by CMake (after running make) is named ``lmp`` unless -the LAMMPS_MACHINE option is set. When setting ``LAMMPS_MACHINE=name`` +the ``LAMMPS_MACHINE`` option is set. When setting ``LAMMPS_MACHINE=name`` the executable will be called ``lmp_name``. Using ``BUILD_MPI=no`` will enforce building a serial executable using the MPI STUBS library. @@ -55,18 +56,20 @@ The build with traditional makefiles has to be done inside the source folder ``s make serial # serial build, produces lmp_serial using Makefile/serial make mybox # uses Makefile.mybox to produce lmp_mybox -Any "make machine" command will look up the make settings from a file -Makefile.machine, create a folder Obj_machine with all objects and -generated files and an executable called ``lmp_machine``\ . The standard -parallel build with ``make mpi`` assumes a standard MPI installation with -MPI compiler wrappers where all necessary compiler and linker flags to -get access and link with the suitable MPI headers and libraries are set -by the wrapper programs. For other cases or the serial build, you have -to adjust the make file variables ``MPI_INC``, ``MPI_PATH``, ``MPI_LIB`` -as well as ``CC`` and ``LINK``\ . To enable OpenMP threading usually -a compiler specific flag needs to be added to the compile and link -commands. For the GNU compilers, this is ``-fopenmp``\ , which can be -added to the ``CC`` and ``LINK`` makefile variables. +Any ``make machine`` command will look up the make settings from a file +``Makefile.machine`` in the folder ``src/MAKE`` or one of its +sub-directories ``MINE``, ``MACHINES``, or ``OPTIONS``, create a folder +``Obj_machine`` with all objects and generated files and an executable +called ``lmp_machine``\ . The standard parallel build with ``make mpi`` +assumes a standard MPI installation with MPI compiler wrappers where all +necessary compiler and linker flags to get access and link with the +suitable MPI headers and libraries are set by the wrapper programs. For +other cases or the serial build, you have to adjust the make file +variables ``MPI_INC``, ``MPI_PATH``, ``MPI_LIB`` as well as ``CC`` and +``LINK``\ . To enable OpenMP threading usually a compiler specific flag +needs to be added to the compile and link commands. For the GNU +compilers, this is ``-fopenmp``\ , which can be added to the ``CC`` and +``LINK`` makefile variables. For the serial build the following make variables are set (see src/MAKE/Makefile.serial): @@ -80,18 +83,19 @@ For the serial build the following make variables are set (see src/MAKE/Makefile You also need to build the STUBS library for your platform before making LAMMPS itself. A ``make serial`` build does this for you automatically, -otherwise, type ``make mpi-stubs`` from the src directory, or ``make`` from -the src/STUBS dir. If the build fails, you will need to edit the -STUBS/Makefile for your platform. The stubs library does not provide -MPI/IO functions required by some LAMMPS packages, e.g. MPIIO or USER-LB, -and thus is not compatible with those packages. +otherwise, type ``make mpi-stubs`` from the src directory, or ``make`` +from the ``src/STUBS`` dir. If the build fails, you may need to edit +the ``STUBS/Makefile`` for your platform. The stubs library does not +provide MPI/IO functions required by some LAMMPS packages, +e.g. ``MPIIO`` or ``USER-LB``, and thus is not compatible with those +packages. .. note:: The file ``src/STUBS/mpi.c`` provides a CPU timer function called - MPI_Wtime() that calls gettimeofday() . If your operating system - does not support gettimeofday() , you will need to insert code to - call another timer. Note that the ANSI-standard function clock() + ``MPI_Wtime()`` that calls ``gettimeofday()``. If your operating system + does not support ``gettimeofday()``, you will need to insert code to + call another timer. Note that the ANSI-standard function ``clock()`` rolls over after an hour or so, and is therefore insufficient for timing long LAMMPS simulations. @@ -111,20 +115,22 @@ self-installed MPICH or OpenMPI, so you should study the provided documentation to find out how to build and link with it. The majority of OpenMP (threading) support in LAMMPS is provided by the -USER-OMP package; see the :doc:`Speed omp ` doc page for -details. The USER-INTEL package also includes OpenMP threading (it is -compatible with USER-OMP) and adds vectorization support when compiled -with compatible compilers, in particular the Intel compilers on top of -OpenMP. Also, the KOKKOS package can be compiled to include OpenMP -threading. +``USER-OMP`` package; see the :doc:`Speed omp ` doc page for +details. The ``USER-INTEL`` package also includes OpenMP threading (it +is compatible with ``USER-OMP`` and will usually fall back on styles +from that package, if a ``USER-INTEL`` does not exist) and adds +vectorization support when compiled with compatible compilers, in +particular the Intel compilers on top of OpenMP. Also, the ``KOKKOS`` +package can be compiled to include OpenMP threading. In addition, there are a few commands in LAMMPS that have native OpenMP -support included as well. These are commands in the MPIIO, SNAP, -USER-DIFFRACTION, and USER-DPD packages. In addition some packages -support OpenMP threading indirectly through the libraries they interface -to: e.g. LATTE and USER-COLVARS. See the :doc:`Packages details -` doc page for more info on these packages and the doc -pages for their respective commands for OpenMP threading info. +support included as well. These are commands in the ``MPIIO``, +``SNAP``, ``USER-DIFFRACTION``, and ``USER-DPD`` packages. In addition +some packages support OpenMP threading indirectly through the libraries +they interface to: e.g. ``LATTE``, ``KSPACE``, and ``USER-COLVARS``. +See the :doc:`Packages details ` doc page for more +info on these packages and the doc pages for their respective commands +for OpenMP threading info. For CMake, if you use ``BUILD_OMP=yes``, you can use these packages and turn on their native OpenMP support and turn on their native OpenMP @@ -159,15 +165,18 @@ and Intel compilers. Choice of compiler and compile/link options --------------------------------------------------------- -The choice of compiler and compiler flags can be important for +The choice of compiler and compiler flags can be important for maximum performance. Vendor provided compilers for a specific hardware can produce faster code than open-source compilers like the GNU compilers. -On x86 hardware most popular compilers are quite similar in performance -of C/C++ code at high optimization levels. When using the USER-INTEL -package, there is a distinct advantage in using the `Intel C++ compiler -`_ due to much improved vectorization through SSE and AVX -instructions on compatible hardware as the source code includes changes -and compiler directives to enable high degrees of vectorization. +On the most common x86 hardware most popular C++ compilers are quite +similar in performance of C/C++ code at high optimization levels. When +using the ``USER-INTEL`` package, there is a distinct advantage in using +the `Intel C++ compiler `_ due to much improved vectorization +through SSE and AVX instructions on compatible hardware as the source +code includes changes and Intel compiler specific directives to enable +high degrees of vectorization. This may change over time as equivalent +vectorization directives are included into OpenMP standard revisions and +other compilers adopt them. .. _intel: https://software.intel.com/en-us/intel-compilers @@ -178,17 +187,20 @@ LAMMPS. **CMake build**\ : -By default CMake will use a compiler it finds and it will add -optimization flags appropriate to that compiler and any -:doc:`accelerator packages ` you have included in the -build. +By default CMake will use a compiler it finds according to internal +preferences and it will add optimization flags appropriate to that +compiler and any :doc:`accelerator packages ` you have +included in the build. -You can tell CMake to look for a specific compiler with these variable -settings. Likewise you can specify the corresponding ``CMAKE_*_FLAGS`` -variables if you want to experiment with alternate optimization flags. -You should specify all 3 compilers, so that the small number of LAMMPS -source files written in C or Fortran are built with a compiler consistent -with the one used for all the C++ files: +You can tell CMake to look for a specific compiler with setting CMake +variable during configuration. For a few common choices, there are also +presets in the ``cmake/presets`` folder. For convenience, there is a +``CMAKE_TUNE_FLAGS`` variable that can be set to apply global compiler +options. More on that below, but you can also specify the corresponding +``CMAKE_*_FLAGS`` variables individually if you want to experiment with +alternate optimization flags. You should specify all 3 compilers, so +that the (few) LAMMPS source files written in C or Fortran are built +with a compiler consistent with the one used for the C++ files: .. code-block:: bash @@ -211,16 +223,17 @@ A few example command lines are: # Building with LLVM/Clang Compilers: cmake ../cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_Fortran_COMPILER=flang -For compiling with the Clang/LLVM compilers a special CMake preset is -included that can be loaded with `-C ../cmake/presets/clang.cmake`. +For compiling with the Clang/LLVM compilers a CMake preset is provided that +can be loaded with `-C ../cmake/presets/clang.cmake`. Similarly, +`-C ../cmake/presets/intel.cmake` should switch the -In addition you can set ``CMAKE_TUNE_FLAGS`` to specifically add compiler -flags to tune for optimal performance on given hosts. By default these are -initialized to some compiler specific flags, where known, to optimize the -LAMMPS executable with optimizations and instructions available on the host -where LAMMPS is compiled. For example, for Intel compilers this would be -``-xHost`` and for GNU compilers this would be ``-march=native``. To turn -these flags off, set ``-D CMAKE_TUNE_FLAGS=``. +In addition you can set ``CMAKE_TUNE_FLAGS`` to specifically add +compiler flags to tune for optimal performance on given hosts. By +default these are initialized to some compiler specific flags, to +optimize the LAMMPS executable with optimizations and instructions +available on the host where LAMMPS is compiled. For example, for Intel +compilers this would be ``-xHost`` and for GNU compilers this would be +``-march=native``. To turn these flags off, do ``-D CMAKE_TUNE_FLAGS=``. .. note:: @@ -236,11 +249,11 @@ these flags off, set ``-D CMAKE_TUNE_FLAGS=``. The "compiler/linker settings" section of a Makefile.machine lists compiler and linker settings for your C++ compiler, including optimization flags. For a parallel build it is recommended to use -mpicxx or mpiCC, since these compiler wrappers will include a variety of -settings appropriate for your MPI installation and thus avoiding the -guesswork of finding the right flags. +``mpicxx`` or ``mpiCC``, since these compiler wrappers will include a +variety of settings appropriate for your MPI installation and thus +avoiding the guesswork of finding the right flags. -Parallel build (see src/MAKE/Makefile.mpi): +Parallel build (see ``src/MAKE/Makefile.mpi``): .. code-block:: bash @@ -249,7 +262,7 @@ Parallel build (see src/MAKE/Makefile.mpi): LINK = mpicxx LINKFLAGS = -g -O -Serial build (see src/MAKE/Makefile.serial): +Serial build with GNU gcc (see ``src/MAKE/Makefile.serial``): .. code-block:: make @@ -258,17 +271,35 @@ Serial build (see src/MAKE/Makefile.serial): LINK = g++ LINKFLAGS = -g -O + .. note:: - If you build LAMMPS with any :doc:`accelerator packages ` - included, there may be specific optimization flags that are either - required or recommended to enable required features and to achieve - optimal performance. You need to include these in the CCFLAGS and - LINKFLAGS settings above. For details, see the individual package - doc pages listed on the :doc:`Speed packages ` doc - page. Or examine these files in the src/MAKE/OPTIONS directory. - They correspond to each of the 5 accelerator packages and their - hardware variants: + If compilation stops with a message like the following: + + .. code-block:: + + g++ -g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -I../STUBS -c ../main.cpp + In file included from ../pointers.h:24:0, + from ../input.h:17, + from ../main.cpp:16: + ../lmptype.h:34:2: error: #error LAMMPS requires a C++11 (or later) compliant compiler. Enable C++11 compatibility or upgrade the compiler. + + then you have either an unsupported (old) compiler or you have to + turn on C++11 mode. The latter applies to GCC 4.8.x shipped with + RHEL 7.x and CentOS 7.x. For those compilers, you need to add the + ``-std=c++11`` flag. Otherwise, you would have to install a newer + compiler that supports C++11; either as a binary package or through + compiling from source. + +If you build LAMMPS with any :doc:`accelerator packages +` included, there may be specific optimization flags +that are either required or recommended to enable required features and +to achieve optimal performance. You need to include these in the +CCFLAGS and LINKFLAGS settings above. For details, see the individual +package doc pages listed on the :doc:`Speed packages ` +doc page. Or examine these files in the src/MAKE/OPTIONS directory. +They correspond to each of the 5 accelerator packages and their hardware +variants: .. code-block:: bash @@ -285,69 +316,74 @@ Serial build (see src/MAKE/Makefile.serial): .. _exe: -Build LAMMPS as an executable or a library ----------------------------------------------------- +Build the LAMMPS executable and library +--------------------------------------- -LAMMPS can be built as either an executable or as a static or shared -library. The LAMMPS library can be called from another application or -a scripting language. See the :doc:`Howto couple ` doc +LAMMPS is always built as a library of C++ classes plus an executable. +The executable is a simple ``main()`` function that sets up MPI and then +creates a LAMMPS class instance from the LAMMPS library, which +will then process commands provided via a file or from the console +input. The LAMMPS library can also be called from another application +or a scripting language. See the :doc:`Howto couple ` doc page for more info on coupling LAMMPS to other codes. See the :doc:`Python ` doc page for more info on wrapping and running LAMMPS from Python via its library interface. **CMake build**\ : -For CMake builds, you can select through setting CMake variables which -files the compilation produces during the configuration step. If none -are set, defaults are applied. +For CMake builds, you can select through setting CMake variables between +building a shared or a static LAMMPS library and what kind of suffix is +added to them (in case you want to concurrently install multiple variants +of binaries with different settings). If none are set, defaults are applied. .. code-block:: bash - -D BUILD_EXE=value # yes (default) or no - -D BUILD_LIB=value # yes or no (default) -D BUILD_SHARED_LIBS=value # yes or no (default) - -D LAMMPS_LIB_SUFFIX=name # name = mpi, serial, mybox, titan, laptop, etc + -D LAMMPS_MACHINE=name # name = mpi, serial, mybox, titan, laptop, etc # no default value -Setting ``BUILD_EXE=no`` will not produce an executable. Setting -``BUILD_LIB=yes`` will produce a static library named ``liblammps.a``\ . -Setting both ``BUILD_LIB=yes`` and ``BUILD_SHARED_LIBS=yes`` will produce a -shared library named ``liblammps.so`` instead. If ``LAMMPS_LIB_SUFFIX=name`` -is set in addition, the name of the generated libraries will be changed to -either ``liblammps_name.a`` or ``liblammps_name.so``\ , respectively. +The compilation will always produce a LAMMPS library and an executable +linked to it. By default this will be a static library named +``liblammps.a`` and an executable named ``lmp`` Setting +``BUILD_SHARED_LIBS=yes`` will instead produce a shared library called +``liblammps.so`` (or ``liblammps.dylib`` or ``liblammps.dll`` depending +on the platform) If ``LAMMPS_MACHINE=name`` is set in addition, the name +of the generated libraries will be changed to either +``liblammps_name.a`` or ``liblammps_name.so``\ , respectively and the +executable will be called ``lmp_name``. **Traditional make**\ : With the traditional makefile based build process, the choice of the generated executable or library depends on the "mode" setting. -Several options are available and ``mode=exe`` is the default. +Several options are available and ``mode=static`` is the default. .. code-block:: bash make machine # build LAMMPS executable lmp_machine - make mode=exe machine # same as "make machine" - make mode=lib machine # build LAMMPS static lib liblammps_machine.a - make mode=shlib machine # build LAMMPS shared lib liblammps_machine.so - make mode=shexe machine # same as "mode=exe" but uses objects from "mode=shlib" + make mode=static machine # same as "make machine" + make mode=shared machine # build LAMMPS shared lib liblammps_machine.so instead -The two "exe" builds will generate and executable ``lmp_machine``\ , -while the two library builds will create a file ``liblammps_machine.a`` -or ``liblammps_machine.so``\ . They will also create generic soft links, -named ``liblammps.a`` and ``liblammps.so``\ , which point to the specific +The "static" build will generate a static library called +``liblammps_machine.a`` and an executable named ``lmp_machine``\ , while +the "shared" build will generate a shared library +``liblammps_machine.so`` instead and ``lmp_machine`` will be linked to +it. The build step will also create generic soft links, named +``liblammps.a`` and ``liblammps.so``\ , which point to the specific ``liblammps_machine.a/so`` files. **CMake and make info**\ : -Note that for a shared library to be usable by a calling program, all -the auxiliary libraries it depends on must also exist as shared -libraries. This will be the case for libraries included with LAMMPS, -such as the dummy MPI library in src/STUBS or any package libraries in -the lib/packages directory, since they are always built in a shared -library compatible way using the ``-fPIC`` switch. However, if a library -like MPI or FFTW does not exist as a shared library, the shared library -build may generate an error. This means you will need to install a -shared library version of the auxiliary library. The build instructions -for the library should tell you how to do this. +Note that for creating a shared library, all the libraries it depends on +must be compiled to be compatible with shared libraries. This should be +the case for libraries included with LAMMPS, such as the dummy MPI +library in ``src/STUBS`` or any package libraries in the ``lib`` +directory, since they are always built in a shared library compatible +way using the ``-fPIC`` compiler switch. However, if an auxiliary +library (like MPI or FFTW) does not exist as a compatible format, the +shared library linking step may generate an error. This means you will +need to install a compatible version of the auxiliary library. The +build instructions for that library should tell you how to do this. As an example, here is how to build and install the `MPICH library `_, a popular open-source version of MPI, as a shared library @@ -361,10 +397,12 @@ in the default /usr/local/lib location: make make install -You may need to use ``sudo make install`` in place of the last line if you -do not have write privileges for ``/usr/local/lib``. The end result should -be the file ``/usr/local/lib/libmpich.so``. On many Linux installations the -folder ``${HOME}/.local`` is an alternative to using ``/usr/local`` and does +You may need to use ``sudo make install`` in place of the last line if +you do not have write privileges for ``/usr/local/lib`` or use the +``--prefix`` configuration option to select an installation folder, +where you do have write access. The end result should be the file +``/usr/local/lib/libmpich.so``. On many Linux installations the folder +``${HOME}/.local`` is an alternative to using ``/usr/local`` and does not require superuser or sudo access. In that case the configuration step becomes: @@ -372,12 +410,41 @@ step becomes: ./configure --enable-shared --prefix=${HOME}/.local -Avoiding using "sudo" for custom software installation (i.e. from source +Avoiding to use "sudo" for custom software installation (i.e. from source and not through a package manager tool provided by the OS) is generally recommended to ensure the integrity of the system software installation. ---------- +.. _debug: + +Excluding or removing debug support +----------------------------------- + +By default the compilation settings will include the *-g* flag which +instructs the compiler to include debug information (e.g. which line of +source code a particular instruction correspond to). This can be +extremely useful in case LAMMPS crashes and can help to provide crucial +information in :doc:`tracking down the origin of a crash ` +and help the LAMMPS developers fix bugs in the source code. However, +this increases the storage requirements for object files, libraries, and +the executable 3-5 fold. + +If this is a concern, you can change the compilation settings or remove +the debug information from the LAMMPS executable: + +- **Traditional make**: edit your ``Makefile.`` to remove the + *-g* flag from the ``CCFLAGS`` and ``LINKFLAGS`` definitions +- **CMake**: use ``-D CMAKE_BUILD_TYPE=Release`` or explicitly reset + the applicable compiler flags (best done using the text mode or + graphical user interface). +- **Remove debug info**: If you are only concerned about the executable + being too large, you can use the ``strip`` tool (e.g. ``strip + lmp_serial``) to remove the debug information from the executable file. + Do not strip libraries or object files, as that will render them unusable. + +---------- + .. _doc: Build the LAMMPS documentation @@ -428,7 +495,8 @@ It is also possible to create the HTML version of the manual within the :doc:`CMake build directory `. The reason for this option is to include the installation of the HTML manual pages into the "install" step when installing LAMMPS after the CMake build via -``make install``. +``make install``. The documentation build is included in the default +build target, but can also be requested independently with ``make doc``. .. code-block:: bash diff --git a/doc/src/Build_cmake.rst b/doc/src/Build_cmake.rst index 7a60ffa437..3473d83143 100644 --- a/doc/src/Build_cmake.rst +++ b/doc/src/Build_cmake.rst @@ -1,205 +1,158 @@ Build LAMMPS with CMake ======================= -This page is a short summary of how to use CMake to build LAMMPS. -Details on CMake variables that enable specific LAMMPS build options -are given on the pages linked to from the :doc:`Build ` doc page. +This page describes how to use `CMake `_ in general +to build LAMMPS. Details for specific compile time settings and options +to enable and configure add-on packages are discussed with those +packages. Links to those pages on the :doc:`Build overview ` +page. -Richard Berger (Temple U) has also written a `more comprehensive guide `_ -for how to use CMake to build LAMMPS. If you are new to CMake it is a -good place to start. +The following text assumes some familiarity with CMake and focuses on +using the command line tool ``cmake`` and what settings are supported +for building LAMMPS. A more detailed tutorial on how to use ``cmake`` +itself, the text mode or graphical user interface, change the generated +output files for different build tools and development environments is +on a :doc:`separate page `. ----------- +.. note:: + + LAMMPS currently requires that CMake version 3.10 or later is available; + version 3.12 or later is preferred. + +.. warning:: + + You must not mix the :doc:`traditional make based ` + LAMMPS build procedure with using CMake. Thus no packages may be + installed or a build been previously attempted in the LAMMPS source + directory by using ``make ``. CMake will detect if this is + the case and generate an error. To remove conflicting files from the + ``src`` you can use the command ``make no-all purge`` which will + un-install all packages and delete all auto-generated files. + + +Advantages of using CMake +^^^^^^^^^^^^^^^^^^^^^^^^^ + +CMake is an alternative to compiling LAMMPS in the traditional way +through :doc:`(manually customized) makefiles ` and a recent +addition to LAMMPS thanks to the efforts of Christoph Junghans (LANL) +and Richard Berger (Temple U). Using CMake has multiple advantages that +are specifically helpful for people with limited experience in compiling +software or for people that want to modify or extend LAMMPS. + +- CMake can detect available hardware, tools, features, and libraries + and adapt the LAMMPS default build configuration accordingly. +- CMake can generate files for different build tools and integrated + development environments (IDE). +- CMake supports customization of settings with a text mode or graphical + user interface. No knowledge of file formats or and complex command + line syntax required. +- All enabled components are compiled in a single build operation. +- Automated dependency tracking for all files and configuration options. +- Support for true out-of-source compilation. Multiple configurations + and settings with different choices of LAMMPS packages, settings, or + compilers can be configured and built concurrently from the same + source tree. +- Simplified packaging of LAMMPS for Linux distributions, environment + modules, or automated build tools like `Homebrew `_. +- Integration of automated regression testing (the LAMMPS side for that + is still under development). + +.. _cmake_build: + +Getting started +^^^^^^^^^^^^^^^ Building LAMMPS with CMake is a two-step process. First you use CMake -to create a build environment in a new directory. On Linux systems, -this will be by default based on Unix-style makefiles for use with make. -Then you use the *make* command to build LAMMPS, which uses the created -Makefile(s). Example: +to generate a build environment in a new directory. For that purpose +you can use either the command-line utility ``cmake`` (or ``cmake3``), +the text-mode UI utility ``ccmake`` (or ``ccmake3``) or the graphical +utility ``cmake-gui``, or use them interchangeably. The second step is +then the compilation and linking of all objects, libraries, and +executables. Here is a minimal example using the command line version of +CMake to build LAMMPS with no add-on packages enabled and no +customization: .. code-block:: bash - cd lammps # change to the LAMMPS distribution directory - mkdir build; cd build # create a new directory (folder) for build - cmake [options ...] ../cmake # configuration with (command-line) cmake - cmake --build . # compilation (or type "make") + cd lammps # change to the LAMMPS distribution directory + mkdir build; cd build # create and use a build directory + cmake ../cmake # configuration reading CMake scripts from ../cmake + cmake --build . # compilation (or type "make") -The ``cmake`` command will detect available features, enable selected -packages and options, and will generate the build environment. By default -this build environment will be created for "Unix Makefiles" on most -platforms and particularly on Linux. However, alternate build tools -(e.g. Ninja) and project files for Integrated Development Environments -(IDEs) like Eclipse, CodeBlocks, or Kate can be generated, too. This is -selected via the ``-G`` command line flag. Further details about features -and settings for CMake are in the `CMake online documentation `_ +This will create and change into a folder called ``build``, then run the +configuration step to generate build files for the default build command +and then launch that build command to compile LAMMPS. During the +configuration step CMake will try to detect whether support for MPI, +OpenMP, FFTW, gzip, JPEG, PNG, and ffmpeg are available and enable the +corresponding configuration settings. The progress of this +configuration can be followed on the screen and a summary of selected +options and settings will be printed at the end. The ``cmake --build +.`` command will launch the compilation, which, if successful, will +ultimately produce a library ``liblammps.a`` and the LAMMPS executable +``lmp`` inside the ``build`` folder. -.. _cmake_doc: https://cmake.org/documentation/ +Compilation can take a long time, since LAMMPS is a large project with +many features. If your machine has multiple CPU cores (most do these +days), you can speed this up by compiling sources in parallel with +``make -j N`` (with N being the maximum number of concurrently executed +tasks). Also installation of the `ccache `_ (= +Compiler Cache) software may speed up repeated compilation even more, +e.g. during code development. -For the rest of the documentation -we will assume that the build environment is generated for "Unix Makefiles" -and thus the ``make`` command will be used to compile and link LAMMPS as -indicated above, producing (by default) an executable called ``lmp`` and -a library called ``liblammps.a`` in the ``build`` folder. - -If your machine has multiple CPU cores (most do these days), you can -compile sources in parallel with a command like ``make -j N`` (with N -being the maximum number of concurrently executed tasks). Also -installation of the ``ccache`` (= Compiler Cache) software may speed -up repeated compilation, e.g. during code development, significantly. +After the initial build, whenever you edit LAMMPS source files, enable +or disable packages, change compiler flags or build options, you must +re-compile and relink the LAMMPS executable with ``cmake --build .`` (or +``make``). If the compilation fails for some reason, try running +``cmake .`` and then compile again. The included dependency tracking +should make certain that only the necessary subset of files are +re-compiled. You can also delete compiled objects, libraries and +executables with ``cmake --build . clean`` (or ``make clean``). After compilation, you may optionally install the LAMMPS executable into your system with: .. code-block:: bash - make install # optional, copy LAMMPS executable & library elsewhere + make install # optional, copy compiled files into installation location -This will install the lammps executable and library (if requested), some -tools (if configured) and additional files like library API headers, -manpages, potential and force field files. The location of the installation -tree is set by the CMake variable "CMAKE_INSTALL_PREFIX" which defaults -to ${HOME}/.local +This will install the LAMMPS executable and library, some tools (if +configured) and additional files like LAMMPS API headers, manpages, +potential and force field files. The location of the installation tree +defaults to ``${HOME}/.local``. ----------- +.. _cmake_options: -.. _cmake_build: +Configuration and build options +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -There are 3 variants of the CMake command itself: a command-line version -(``cmake`` or ``cmake3``), a text mode UI version (``ccmake`` or ``ccmake3``), -and a graphical GUI version (``cmake-gui``). You can use any of them -interchangeably to configure and create the LAMMPS build environment. -On Linux all the versions produce a Makefile as their output by default. -See more details on each below. +The CMake commands have one mandatory argument: a folder containing a +file called ``CMakeLists.txt`` (for LAMMPS it is located in the +``cmake`` folder) or a build folder containing a file called +``CMakeCache.txt``, which is generated at the end of the CMake +configuration step. The cache file contains all current CMake settings. -You can specify a variety of options with any of the 3 versions, which -affect how the build is performed and what is included in the LAMMPS -executable. Links to pages explaining all the options are listed on -the :doc:`Build ` doc page. +To modify settings, enable or disable features, you need to set *variables* +with either the *-D* command line flag (``-D VARIABLE1_NAME=value``) or +change them in the text mode of graphical user interface. The *-D* flag +can be used several times in one command. -You must perform the CMake build system generation and compilation in -a new directory you create. It can be anywhere on your local machine. -In these Build pages we assume that you are building in a directory -called ``lammps/build``. You can perform separate builds independently -with different options, so long as you perform each of them in a -separate directory you create. All the auxiliary files created by one -build process (executable, object files, log files, etc) are stored in -this directory or sub-directories within it that CMake creates. +For your convenience we provide :ref:`CMake presets ` +that combine multiple settings to enable optional LAMMPS packages or use +a different compiler tool chain. Those are loaded with the *-C* flag +(``-C ../cmake/presets/minimal.cmake``). This step would only be needed +once, as the settings from the preset files are stored in the +``CMakeCache.txt`` file. It is also possible to customize the build +by adding one or more *-D* flags to the CMake command line. -.. note:: +Generating files for alternate build tools (e.g. Ninja) and project files +for IDEs like Eclipse, CodeBlocks, or Kate can be selected using the *-G* +command line flag. A list of available generator settings for your +specific CMake version is given when running ``cmake --help``. - To perform a CMake build, no packages can be installed or a build - been previously attempted in the LAMMPS src directory by using ``make`` - commands to :doc:`perform a conventional LAMMPS build `. - CMake detects if this is the case and generates an error, telling you - to type ``make no-all purge`` in the src directory to un-install all - packages. The purge removes all the \*.h files auto-generated by - make. -You must have CMake version 3.10 or later on your system to build -LAMMPS. Installation instructions for CMake are below. - -After the initial build, if you edit LAMMPS source files, or add your -own new files to the source directory, you can just re-type make from -your build directory and it will re-compile only the files that have -changed. If you want to change CMake options you can run cmake (or -ccmake or cmake-gui) again from the same build directory and alter -various options; see details below. Or you can remove the entire build -folder, recreate the directory and start over. - ----------- - -**Command-line version of CMake**\ : - -.. code-block:: bash - - cmake [options ...] /path/to/lammps/cmake # build from any dir - cmake [options ...] ../cmake # build from lammps/build - cmake3 [options ...] ../cmake # build from lammps/build - -The cmake command takes one required argument, which is the LAMMPS -cmake directory which contains the CMakeLists.txt file. - -The argument can be prefixed or followed by various CMake -command-line options. Several useful ones are: - -.. code-block:: bash - - -D CMAKE_INSTALL_PREFIX=path # where to install LAMMPS executable/lib if desired - -D CMAKE_BUILD_TYPE=type # type = RelWithDebInfo (default), Release, MinSizeRel, or Debug - -G output # style of output CMake generates (e.g. "Unix Makefiles" or "Ninja") - -D CMAKE_MAKE_PROGRAM=builder # name of the builder executable (e.g. when using "gmake" instead of "make") - -DVARIABLE=value # setting for a LAMMPS feature to enable - -D VARIABLE=value # ditto, but cannot come after CMakeLists.txt dir - -C path/to/preset/file # load some CMake settings before configuring - -All the LAMMPS-specific -D variables that a LAMMPS build supports are -described on the pages linked to from the :doc:`Build ` doc page. -All of these variable names are upper-case and their values are -lower-case, e.g. -D LAMMPS_SIZES=smallbig. For boolean values, any of -these forms can be used: yes/no, on/off, 1/0. - -On Unix/Linux machines, CMake generates a Makefile by default to -perform the LAMMPS build. Alternate forms of build info can be -generated via the -G switch, e.g. Visual Studio on a Windows machine, -Xcode on MacOS, or KDevelop on Linux. Type ``cmake --help`` to see the -"Generator" styles of output your system supports. - -.. note:: - - When CMake runs, it prints configuration info to the screen. - You should review this to verify all the features you requested were - enabled, including packages. You can also see what compilers and - compile options will be used for the build. Any errors in CMake - variable syntax will also be flagged, e.g. mis-typed variable names or - variable values. - -CMake creates a CMakeCache.txt file when it runs. This stores all the -settings, so that when running CMake again you can use the current -folder '.' instead of the path to the LAMMPS cmake folder as the -required argument to the CMake command. Either way the existing -settings will be inherited unless the CMakeCache.txt file is removed. - -If you later want to change a setting you can rerun cmake in the build -directory with different setting. Please note that some automatically -detected variables will not change their value when you rerun cmake. -In these cases it is usually better to first remove all the -files/directories in the build directory, or start with a fresh build -directory. - ----------- - -**Curses version (terminal-style menu) of CMake**\ : - -.. code-block:: bash - - ccmake ../cmake - -You initiate the configuration and build environment generation steps -separately. For the first you have to type **c**\ , for the second you -have to type **g**\ . You may need to type **c** multiple times, and may be -required to edit some of the entries of CMake configuration variables -in between. Please see the `ccmake manual `_ for -more information. - ----------- - -**GUI version of CMake**\ : - -.. code-block:: bash - - cmake-gui ../cmake - -You initiate the configuration and build environment generation steps -separately. For the first you have to click on the **Configure** button, -for the second you have to click on the **Generate** button. You may -need to click on **Configure** multiple times, and may be required to -edit some of the entries of CMake configuration variables in between. -Please see the `cmake-gui manual `_ -for more information. - ----------- - -**Installing CMake** +Installing CMake +^^^^^^^^^^^^^^^^ Check if your machine already has CMake installed: @@ -216,11 +169,12 @@ software packages, do this: module list # is a module for cmake already loaded? module avail # is a module for cmake available? - module load cmake3 # load cmake module with appropriate name + module load cmake # load cmake module with appropriate name -Most Linux distributions offer pre-compiled cmake packages through -their package management system. If you do not have CMake or a new -enough version, you can download the latest version at -`https://cmake.org/download/ `_. -Instructions on how to install it on various platforms can be found -`on this page `_. +Most Linux distributions offer pre-compiled cmake packages through their +package management system. If you do not have CMake or a recent enough +version (Note: for CentOS 7.x you need to enable the EPEL repository), +you can download the latest version from `https://cmake.org/download/ +`_. Instructions on how to install it on +various platforms can be found `on this page +`_. diff --git a/doc/src/Build_development.rst b/doc/src/Build_development.rst index 21e99d69be..474e1fb833 100644 --- a/doc/src/Build_development.rst +++ b/doc/src/Build_development.rst @@ -1,15 +1,15 @@ Development build options (CMake only) ====================================== -The CMake build of LAMMPS has a few extra options which are useful during -development, testing or debugging. +The CMake build procedure of LAMMPS offers a few extra options which are +useful during development, testing or debugging. ---------- .. _compilation: Verify compilation flags ------------------------------------------- +------------------------ Sometimes it is necessary to verify the complete sequence of compilation flags generated by the CMake build. To enable a more verbose output during @@ -30,7 +30,7 @@ Another way of doing this without reconfiguration is calling make with variable .. _sanitizer: Address, Undefined Behavior, and Thread Sanitizer Support -------------------------------------------------------------------------- +--------------------------------------------------------- Compilers such as GCC and Clang support generating instrumented binaries which use different sanitizer libraries to detect problems in code @@ -41,10 +41,11 @@ during run-time. They can detect issues like: - `data races `_ Please note that this kind of instrumentation usually comes with a small -performance hit (much less than using tools like `Valgrind `_). -The to enable these features additional compiler flags need to be added -to the compilation and linking stages. This is most easily done through -setting the ``CMAKE_TUNE_FLAGS`` variable during configuration. Examples: +performance hit (much less than using tools like `Valgrind +`_). The to enable these features additional +compiler flags need to be added to the compilation and linking stages. +This is most easily done through setting the ``CMAKE_TUNE_FLAGS`` +variable during configuration. Examples: .. code-block:: bash @@ -52,8 +53,6 @@ setting the ``CMAKE_TUNE_FLAGS`` variable during configuration. Examples: -D CMAKE_TUNE_FLAGS=-fsanitize=undefined # enable undefined behavior sanitizer -D CMAKE_TUNE_FLAGS=-fsanitize=thread # enable thread sanitizer -.. _valgrind: https://valgrind.org - ---------- .. _testing: @@ -75,24 +74,26 @@ developers can run the tests directly on their workstation. -D LAMMPS_TESTING_SOURCE_DIR=path # path to lammps-testing repository (option if in custom location) -D LAMMPS_TESTING_GIT_TAG=value # version of lammps-testing repository that should be used, value = master (default) or custom git commit or tag -If you enable testing in the CMake build it will create an additional target called "test". You can run them with: +If you enable testing in the CMake build it will create an additional +target called "test". You can run them with: .. code-block:: bash - make test + cmake --build . test The test cases used come from the lammps-testing repository. They are -derivatives of the examples folder with some modifications to make the run -faster. +derivatives of the examples folder with some modifications to make the +run faster. -You can also collect code coverage metrics while running the tests by enabling -coverage support during building. +You can also collect code coverage metrics while running the tests by +enabling coverage support during building. .. code-block:: bash -D ENABLE_COVERAGE=value # enable coverage measurements, value = no (default) or yes -This will also add the following targets to generate coverage reports after running the LAMMPS executable: +This will also add the following targets to generate coverage reports +after running the LAMMPS executable: .. code-block:: bash @@ -100,7 +101,8 @@ This will also add the following targets to generate coverage reports after runn make gen_coverage_html # generate coverage report in HTML format make gen_coverage_xml # generate coverage report in XML format -These reports require GCOVR to be installed. The easiest way to do this to install it via pip: +These reports require GCOVR to be installed. The easiest way to do this +to install it via pip: .. code-block:: bash diff --git a/doc/src/Build_link.rst b/doc/src/Build_link.rst index b18dc49e38..39fc4fe40a 100644 --- a/doc/src/Build_link.rst +++ b/doc/src/Build_link.rst @@ -1,33 +1,35 @@ Link LAMMPS as a library to another code ======================================== -LAMMPS can be used as a library by another application, including -Python scripts. The files src/library.cpp and library.h define the +LAMMPS is designed as a library of C++ objects and can thus be +integrated into other applications including Python scripts. +The files ``src/library.cpp`` and ``src/library.h`` define a C-style API for using LAMMPS as a library. See the :doc:`Howto library ` doc page for a description of the interface and how to extend it for your needs. The :doc:`Build basics ` doc page explains how to build -LAMMPS as either a shared or static library. This results in one of -these 2 files: - -.. code-block:: bash - - liblammps.so # shared library - liblammps.a # static library +LAMMPS as either a shared or static library. This results in a file +in the compilation folder called ``liblammps.a`` or ``liblammps_.a`` +in case of building a static library. In case of a shared library +the name is the same only that the suffix is going to be either ``.so`` +or ``.dylib`` or ``.dll`` instead of ``.a`` depending on the OS. +In some cases the ``.so`` file may be a symbolic link to a file with +the suffix ``.so.0`` (or some other number). .. note:: - Care should be taken to use the same MPI library for the calling - code and the LAMMPS library. The library.h file includes mpi.h and - uses definitions from it so those need to be available and - consistent. When LAMMPS is compiled with the MPI STUBS library, - then its mpi.h file needs to be included. While it is technically - possible to use a full MPI library in the calling code and link to - a serial LAMMPS library compiled with MPI STUBS, it is recommended - to use the *same* MPI library for both, and then use MPI_Comm_split() - in the calling code to pass a suitable communicator with a subset - of MPI ranks to the function creating the LAMMPS instance. + Care should be taken to use the same MPI library for the calling code + and the LAMMPS library. The ``library.h`` file includes ``mpi.h`` + and uses definitions from it so those need to be available and + consistent. When LAMMPS is compiled with the included STUBS MPI + library, then its ``mpi.h`` file needs to be included. While it is + technically possible to use a full MPI library in the calling code + and link to a serial LAMMPS library compiled with MPI STUBS, it is + recommended to use the *same* MPI library for both, and then use + ``MPI_Comm_split()`` in the calling code to pass a suitable + communicator with a subset of MPI ranks to the function creating the + LAMMPS instance. ---------- @@ -42,11 +44,11 @@ executable code from the library is copied into the calling executable. *CMake build*\ : -This assumes that LAMMPS has been configured with "-D BUILD_LIB=yes" -and installed with "make install" and the PKG_CONFIG_PATH environment -variable updated to include the *liblammps.pc* file installed into the -configured destination folder, if needed. The commands to compile and -link the coupled executable are then: +This assumes that LAMMPS has been configured without setting a +``LAMMPS_MACHINE`` name, installed with "make install", and the +``PKG_CONFIG_PATH`` environment variable has been updated to include the +``liblammps.pc`` file installed into the configured destination folder. +The commands to compile and link a coupled executable are then: .. code-block:: bash @@ -56,30 +58,35 @@ link the coupled executable are then: *Traditional make*\ : This assumes that LAMMPS has been compiled in the folder -"${HOME}/lammps/src" with "make mode=lib mpi". The commands to compile -and link the coupled executable are then: +``${HOME}/lammps/src`` with "make mpi". The commands to compile and link +a coupled executable are then: .. code-block:: bash mpicc -c -O -I${HOME}/lammps/src caller.c - mpicxx -o caller caller.o -L${HOME}/lammps/src -llammps + mpicxx -o caller caller.o -L${HOME}/lammps/src -llammps_mpi -The *-I* argument is the path to the location of the *library.h* +The *-I* argument is the path to the location of the ``library.h`` header file containing the interface to the LAMMPS C-style library -interface. The *-L* argument is the path to where the *liblammps.a* -file is located. The *-llammps* argument is shorthand for telling the -compiler to link the file *liblammps.a*\ . +interface. The *-L* argument is the path to where the ``liblammps_mpi.a`` +file is located. The *-llammps_mpi* argument is shorthand for telling the +compiler to link the file ``liblammps_mpi.a``. If LAMMPS has been +built as a shared library, then the linker will use ``liblammps_mpi.so`` +instead. If both files are available, the linker will usually prefer +the shared library. In case of a shared library, you may need to update +the ``LD_LIBRARY_PATH`` environment variable or running the ``caller`` +executable will fail since it cannot find the shared library at runtime. However, it is only as simple as shown above for the case of a plain LAMMPS library without any optional packages that depend on libraries -(bundled or external). Otherwise, you need to include all flags, -libraries, and paths for the coupled executable, that are also -required to link the LAMMPS executable. +(bundled or external) or when using a shared library. Otherwise, you +need to include all flags, libraries, and paths for the coupled +executable, that are also required to link the LAMMPS executable. *CMake build*\ : When using CMake, additional libraries with sources in the lib folder -are built, but not included in liblammps.a and (currently) not +are built, but not included in ``liblammps.a`` and (currently) not installed with "make install" and not included in the *pkgconfig* configuration file. They can be found in the top level build folder, but you have to determine the necessary link flags manually. It is @@ -87,23 +94,26 @@ therefore recommended to either use the traditional make procedure to build and link with a static library or build and link with a shared library instead. +.. TODO: this needs to be updated to reflect that latest CMake changes after they are complete. + *Traditional make*\ : After you have compiled a static LAMMPS library using the conventional -build system for example with "make mode=lib serial". And you also -have installed the POEMS package after building its bundled library in -lib/poems. Then the commands to build and link the coupled executable +build system for example with "make mode=static serial". And you also +have installed the ``POEMS`` package after building its bundled library +in ``lib/poems``. Then the commands to build and link the coupled executable change to: .. code-block:: bash gcc -c -O -I${HOME}/lammps/src/STUBS -I${HOME}/lammps/src -caller.c g++ -o caller caller.o -L${HOME}/lammps/lib/poems \ - -L${HOME}/lammps/src/STUBS -L${HOME}/lammps/src -llammps -lpoems -lmpi_stubs + -L${HOME}/lammps/src/STUBS -L${HOME}/lammps/src -llammps_serial -lpoems -lmpi_stubs -Note, that you need to link with "g++" instead of "gcc", since LAMMPS -is C++ code. You can display the currently applied settings for building -LAMMPS for the "serial" machine target by using the command: +Note, that you need to link with "g++" instead of "gcc", since the +LAMMPS library is C++ code. You can display the currently applied +settings for building LAMMPS for the "serial" machine target by using +the command: .. code-block:: bash @@ -113,16 +123,16 @@ Which should output something like: .. code-block:: bash - # Compiler: + # Compiler: CXX=g++ - # Linker: + # Linker: LD=g++ - # Compilation: - CXXFLAGS=-g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -I${HOME}/lammps/lib/poems -I${HOME}/lammps/src/STUBS - # Linking: + # Compilation: + CXXFLAGS=-g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -I${HOME}/compile/lammps/lib/poems -I${HOME}/compile/lammps/src/STUBS + # Linking: LDFLAGS=-g -O - # Libraries: - LDLIBS=-L${HOME}/lammps/lib/poems -L${HOME}/lammps/src/STUBS -lpoems -lmpi_stubs + # Libraries: + LDLIBS=-L${HOME}/compile/lammps/src -llammps_serial -L${HOME}/compile/lammps/lib/poems -L${HOME}/compile/lammps/src/STUBS -lpoems -lmpi_stubs From this you can gather the necessary paths and flags. With makefiles for other *machine* configurations you need to do the @@ -133,14 +143,13 @@ of the makefile. **Link with LAMMPS as a shared library**\ : -When linking to LAMMPS built as a shared library, the situation -becomes much simpler, as all dependent libraries and objects are -included in the shared library, which is - technically speaking - -effectively a regular LAMMPS executable that is missing the `main()` -function. Thus those libraries need not to be specified when linking -the calling executable. Only the *-I* flags are needed. So the -example case from above of the serial version static LAMMPS library -with the POEMS package installed becomes: +When linking to LAMMPS built as a shared library, the situation becomes +much simpler, as all dependent libraries and objects are either included +in the shared library or registered as a dependent library in the shared +library file. Thus those libraries need not to be specified when +linking the calling executable. Only the *-I* flags are needed. So the +example case from above of the serial version static LAMMPS library with +the POEMS package installed becomes: *CMake build*\ : @@ -155,19 +164,19 @@ build process are the same as for the static library. *Traditional make*\ : The commands with a shared LAMMPS library compiled with the -traditional make build using "make mode=shlib serial" becomes: +traditional make build using "make mode=shared serial" becomes: .. code-block:: bash gcc -c -O -I${HOME}/lammps/src/STUBS -I${HOME}/lammps/src -caller.c - g++ -o caller caller.o -L${HOME}/lammps/src -llammps + g++ -o caller caller.o -L${HOME}/lammps/src -llammps_serial *Locating liblammps.so at runtime*\ : -However, now the `liblammps.so` file is required at runtime and needs +However, now the ``liblammps.so`` file is required at runtime and needs to be in a folder, where the shared linker program of the operating -system can find it. This would be either a folder like "/usr/local/lib64" -or "${HOME}/.local/lib64" or a folder pointed to by the LD_LIBRARY_PATH +system can find it. This would be either a folder like ``/usr/local/lib64`` +or ``${HOME}/.local/lib64`` or a folder pointed to by the ``LD_LIBRARY_PATH`` environment variable. You can type .. code-block:: bash @@ -177,11 +186,11 @@ environment variable. You can type to see what directories are in that list. Or you can add the LAMMPS src directory (or the directory you performed -a CMake style build in) to your LD_LIBRARY_PATH, so that the current +a CMake style build in) to your ``LD_LIBRARY_PATH``, so that the current version of the shared library is always available to programs that use it. For the Bourne or Korn shells (/bin/sh, /bin/ksh, /bin/bash etc.), you -would add something like this to your ~/.profile file: +would add something like this to your ``${HOME}/.profile`` file: .. code-block:: bash @@ -189,14 +198,14 @@ would add something like this to your ~/.profile file: export LD_LIBRARY_PATH For the csh or tcsh shells, you would equivalently add something like this -to your ~/.cshrc file: +to your ``${HOME}/.cshrc`` file: .. code-block:: csh setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${HOME}/lammps/src You can verify whether all required shared libraries are found with the -`ldd` tool. Example: +``ldd`` tool. Example: .. code-block:: bash @@ -229,20 +238,20 @@ If a required library is missing, you would get a 'not found' entry: Either flavor of library (static or shared) allows one or more LAMMPS objects to be instantiated from the calling program. When used from a C++ program, most of the symbols and functions in LAMMPS are wrapped -in a LAMMPS_NS namespace; you can safely use any of its classes and +in a ``LAMMPS_NS`` namespace; you can safely use any of its classes and methods from within the calling code, as needed, and you will not incur conflicts with functions and variables in your code that share the name. This, however, does not extend to all additional libraries bundled with LAMMPS in the lib folder and some of the low-level code of some packages. To be compatible with C, Fortran, Python programs, the library has a simple -C-style interface, provided in src/library.cpp and src/library.h. +C-style interface, provided in ``src/library.cpp`` and ``src/library.h``. See the :doc:`Python library ` doc page for a description of the Python interface to LAMMPS, which wraps the C-style interface from a shared library through the `ctypes python module `_. -See the sample codes in examples/COUPLE/simple for examples of C++ and +See the sample codes in ``examples/COUPLE/simple`` for examples of C++ and C and Fortran codes that invoke LAMMPS through its library interface. Other examples in the COUPLE directory use coupling ideas discussed on the :doc:`Howto couple ` doc page. diff --git a/doc/src/Build_make.rst b/doc/src/Build_make.rst index 0379a8379a..af5e319121 100644 --- a/doc/src/Build_make.rst +++ b/doc/src/Build_make.rst @@ -2,10 +2,14 @@ Build LAMMPS with make ====================== Building LAMMPS with traditional makefiles requires that you have a -Makefile."machine" file appropriate for your system in the src/MAKE, -src/MAKE/MACHINES, src/MAKE/OPTIONS, or src/MAKE/MINE directory (see -below). It can include various options for customizing your LAMMPS -build with a number of global compilation options and features. +``Makefile.`` file appropriate for your system in either the +``src/MAKE``, ``src/MAKE/MACHINES``, ``src/MAKE/OPTIONS``, or +``src/MAKE/MINE`` directory (see below). It can include various options +for customizing your LAMMPS build with a number of global compilation +options and features. + +Requirements +^^^^^^^^^^^^ Those makefiles are written for and tested with GNU make and may not be compatible with other make programs. In most cases, if the "make" @@ -16,44 +20,54 @@ with :doc:`CMake `. The makefiles of the traditional make based build process and the scripts they are calling expect a few additional tools to be available and functioning. - * a Bourne shell compatible "Unix" shell program (often this is bash) - * a few shell utilities: ls, mv, ln, rm, grep, sed, tr, cat, touch, diff, dirname - * python (optional, required for "make lib-XXX" in the src folder) + * a working C/C++ compiler toolchain supporting the C++11 standard; on + Linux these are often the GNU compilers. Some older compilers + require adding flags like ``-std=c++11`` to enable the C++11 mode. + * a Bourne shell compatible "Unix" shell program (often this is ``bash``) + * a few shell utilities: ``ls``, ``mv``, ``ln``, ``rm``, ``grep``, ``sed``, ``tr``, ``cat``, ``touch``, ``diff``, ``dirname`` + * python (optional, required for ``make lib-`` in the src folder). + python scripts are currently tested with python 2.7 and 3.6. The procedure + for :doc:`building the documentation ` requires python 3. -To include LAMMPS packages (i.e. optional commands and styles) you -must enable them first, as discussed on the :doc:`Build package -` doc page. If a packages requires (provided or +Getting started +^^^^^^^^^^^^^^^ + +To include LAMMPS packages (i.e. optional commands and styles) you must +enable (or "install") them first, as discussed on the :doc:`Build +package ` doc page. If a packages requires (provided or external) libraries, you must configure and build those libraries **before** building LAMMPS itself and especially **before** enabling -such a package with "make yes-". Building :doc:`LAMMPS -with CMake ` can automate much of this for many types of +such a package with ``make yes-``. Building :doc:`LAMMPS with +CMake ` can automate much of this for many types of machines, especially workstations, desktops, and laptops, so we suggest you try it first when building LAMMPS in those cases. The commands below perform a default LAMMPS build, producing the LAMMPS -executable lmp_serial and lmp_mpi in lammps/src: +executable ``lmp_serial`` and ``lmp_mpi`` in ``lammps/src``: .. code-block:: bash - cd lammps/src - make serial # build a serial LAMMPS executable + cd lammps/src # change to main LAMMPS source folder + make serial # build a serial LAMMPS executable using GNU g++ make mpi # build a parallel LAMMPS executable with MPI make # see a variety of make options -This initial compilation can take a long time, since LAMMPS is a large -project with many features. If your machine has multiple CPU cores -(most do these days), using a command like "make -jN mpi" (with N = -the number of available CPU cores) can be much faster. If you plan to -do development on LAMMPS or need to re-compile LAMMPS repeatedly, the -installation of the ccache (= Compiler Cache) software may speed up -compilation even more. +Compilation can take a long time, since LAMMPS is a large project with +many features. If your machine has multiple CPU cores (most do these +days), you can speed this up by compiling sources in parallel with +``make -j N`` (with N being the maximum number of concurrently executed +tasks). Also installation of the `ccache `_ (= +Compiler Cache) software may speed up repeated compilation even more, +e.g. during code development. After the initial build, whenever you edit LAMMPS source files, or add or remove new files to the source directory (e.g. by installing or uninstalling packages), you must re-compile and relink the LAMMPS -executable with the same "make" command. This makefiles dependencies -should insure that only the subset of files that need to be are -re-compiled. +executable with the same ``make `` command. The makefile's +dependency tracking should insure that only the necessary subset of +files are re-compiled. If you change settings in the makefile, you have +to recompile *everything*. To delete all objects you can use ``make +clean-``. .. note:: @@ -65,13 +79,15 @@ re-compiled. correctly detect which parts need to be recompiled after changes were made to the sources. ----------- +Customized builds and alternate makefiles +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The lammps/src/MAKE tree contains the Makefile.machine files included -in the LAMMPS distribution. Typing "make machine" uses -*Makefile.machine*\ . Thus the "make serial" or "make mpi" lines above -use Makefile.serial and Makefile.mpi, respectively. Other makefiles -are in these directories: +The ``src/MAKE`` directory tree contains the ``Makefile.`` +files included in the LAMMPS distribution. Typing ``make example`` uses +``Makefile.example`` from one of those folders, if available. Thus the +``make serial`` and ``make mpi`` lines above use +``src/MAKE/Makefile.serial`` and ``src/MAKE/Makefile.mpi``, +respectively. Other makefiles are in these directories: .. code-block:: bash @@ -79,11 +95,16 @@ are in these directories: MACHINES # Makefiles for specific machines MINE # customized Makefiles you create (you may need to create this folder) -Typing "make" lists all the available Makefile.machine files. A file -with the same name can appear in multiple folders (not a good idea). -The order the directories are searched is as follows: src/MAKE/MINE, -src/MAKE, src/MAKE/OPTIONS, src/MAKE/MACHINES. This gives preference -to a customized file you put in src/MAKE/MINE. +Simply typing ``make`` lists all the available ``Makefile.`` +files with a single line description toward the end of the output. A +file with the same name can appear in multiple folders (not a good +idea). The order the directories are searched is as follows: +``src/MAKE/MINE``, ``src/MAKE``, ``src/MAKE/OPTIONS``, +``src/MAKE/MACHINES``. This gives preference to a customized file you +put in ``src/MAKE/MINE``. If you create your own custom makefile under +a new name, please edit the first line with the description and machine +name, so you will not confuse yourself, when looking at the machine +summary. Makefiles you may wish to try include these (some require a package first be installed). Many of these include specific compiler flags diff --git a/doc/src/Build_package.rst b/doc/src/Build_package.rst index 2e0bea723a..f2511bb6a4 100644 --- a/doc/src/Build_package.rst +++ b/doc/src/Build_package.rst @@ -130,6 +130,8 @@ src directory. ---------- +.. _cmake_presets: + **CMake shortcuts for installing many packages**\ : Instead of specifying all the CMake options via the command-line, diff --git a/doc/src/Errors.rst b/doc/src/Errors.rst index 896dfbcbef..48db5f6472 100644 --- a/doc/src/Errors.rst +++ b/doc/src/Errors.rst @@ -12,5 +12,6 @@ additional details for many of them. Errors_common Errors_bugs + Errors_debug Errors_messages Errors_warnings diff --git a/doc/src/Errors_bugs.rst b/doc/src/Errors_bugs.rst index e169b93d81..ff0b155795 100644 --- a/doc/src/Errors_bugs.rst +++ b/doc/src/Errors_bugs.rst @@ -1,7 +1,8 @@ Reporting bugs ============== -If you are confident that you have found a bug in LAMMPS, please follow the steps outlined below: +If you are confident that you have found a bug in LAMMPS, please follow +the steps outlined below: * Check the `New features and bug fixes `_ section of the `LAMMPS WWW site @@ -17,20 +18,22 @@ If you are confident that you have found a bug in LAMMPS, please follow the step * Check the `mailing list archives `_ to see if the issue has been discussed before. -If none of these steps yields any useful information, please file -a new bug report on the `GitHub Issue page `_\ . -The website will offer you to select a suitable template with explanations -and then you should replace those explanations with the information -that you can provide to reproduce your issue. +If none of these steps yields any useful information, please file a new +bug report on the `GitHub Issue page `_. The website will offer +you to select a suitable template with explanations and then you should +replace those explanations with the information that you can provide to +reproduce your issue. The most useful thing you can do to help us verify and fix a bug is to isolate the problem. Run it on the smallest number of atoms and fewest number of processors with the simplest input script that reproduces the -bug. Try to identify what command or combination of commands is -causing the problem and upload the complete input deck as a tar or zip -archive. Please avoid using binary restart files unless the issue requires -it. In the latter case you should also include an input deck to quickly +bug. Try to identify what command or combination of commands is causing +the problem and upload the complete input deck as a tar or zip archive. +Please avoid using binary restart files unless the issue requires it. +In the latter case you should also include an input deck to quickly generate this restart from a data file or a simple additional input. +This input deck can be used with tools like a debugger or `valgrind +`_ to further :doc:`debug the crash `. You may also send an email to the LAMMPS mailing list at "lammps-users at lists.sourceforge.net" describing the problem with the @@ -43,3 +46,4 @@ have looked at it. .. _lws: https://lammps.sandia.gov .. _gip: https://github.com/lammps/issues +.. _valgrind: https://valgrind.org diff --git a/doc/src/Errors_debug.rst b/doc/src/Errors_debug.rst new file mode 100644 index 0000000000..1e7e678602 --- /dev/null +++ b/doc/src/Errors_debug.rst @@ -0,0 +1,237 @@ +Debugging crashes +================= + +If LAMMPS crashes with a "segmentation fault" or a "bus error" or +similar message, then you can use the following two methods to further +narrow down the origin of the issue. This will help the LAMMPS +developers (or yourself) to understand the reason for the crash and +apply a fix (either to the input script or the source code). +This requires that your LAMMPS executable includes the required +:ref:`debug information `. Otherwise it is not possible to +look up the names of functions or variables. + +The following patch will introduce a bug into the code for pair style +:doc:`lj/cut ` when using the ``examples/melt/in.melt`` input. +We use it to show how to identify the origin of a segmentation fault. + +.. code-block:: diff + + --- a/src/pair_lj_cut.cpp + +++ b/src/pair_lj_cut.cpp + @@ -81,6 +81,7 @@ void PairLJCut::compute(int eflag, int vflag) + int nlocal = atom->nlocal; + double *special_lj = force->special_lj; + int newton_pair = force->newton_pair; + + double comx = 0.0; + + inum = list->inum; + ilist = list->ilist; + @@ -134,8 +135,10 @@ void PairLJCut::compute(int eflag, int vflag) + evdwl,0.0,fpair,delx,dely,delz); + } + } + - } + + + comx += atom->rmass[i]*x[i][0]; /* BUG */ + + } + + printf("comx = %g\n",comx); + if (vflag_fdotr) virial_fdotr_compute(); + } + +After recompiling LAMMPS and running the input you should get something like this: + +.. code-block: + + $ ./lmp -in in.melt + LAMMPS (19 Mar 2020) + OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) + using 1 OpenMP thread(s) per MPI task + Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 + Created orthogonal box = (0 0 0) to (16.796 16.796 16.796) + 1 by 1 by 1 MPI processor grid + Created 4000 atoms + create_atoms CPU = 0.000432253 secs + Neighbor list info ... + update every 20 steps, delay 0 steps, check no + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 12 12 12 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d/newton + bin: standard + Setting up Verlet run ... + Unit style : lj + Current step : 0 + Time step : 0.005 + Segmentation fault (core dumped) + + +Using the GDB debugger to get a stack trace +------------------------------------------- + +There are two options to use the GDB debugger for identifying the origin +of the segmentation fault or similar crash. The GDB debugger has many +more features and options, as can be seen for example its `online +documentation `_. + +Run LAMMPS from within the debugger +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Running LAMMPS under the control of the debugger as shown below only +works for a single MPI rank (for debugging a program running in parallel +you usually need a parallel debugger program). A simple way to launch +GDB is to prefix the LAMMPS command line with ``gdb --args`` and then +type the command "run" at the GDB prompt. This will launch the +debugger, load the LAMMPS executable and its debug info, and then run +it. When it reaches the code causing the segmentation fault, it will +stop with a message why it stopped, print the current line of code, and +drop back to the GDB prompt. + +.. code-block:: + + [...] + Setting up Verlet run ... + Unit style : lj + Current step : 0 + Time step : 0.005 + + Program received signal SIGSEGV, Segmentation fault. + 0x00000000006653ab in LAMMPS_NS::PairLJCut::compute (this=0x829740, eflag=1, vflag=) at /home/akohlmey/compile/lammps/src/pair_lj_cut.cpp:139 + 139 comx += atom->rmass[i]*x[i][0]; /* BUG */ + (gdb) + +Now typing the command "where" will show the stack of functions starting from +the current function back to "main()". + +.. code-block:: + + (gdb) where + #0 0x00000000006653ab in LAMMPS_NS::PairLJCut::compute (this=0x829740, eflag=1, vflag=) at /home/akohlmey/compile/lammps/src/pair_lj_cut.cpp:139 + #1 0x00000000004cf0a2 in LAMMPS_NS::Verlet::setup (this=0x7e6c90, flag=1) at /home/akohlmey/compile/lammps/src/verlet.cpp:131 + #2 0x000000000049db42 in LAMMPS_NS::Run::command (this=this@entry=0x7fffffffcca0, narg=narg@entry=1, arg=arg@entry=0x7e8750) + at /home/akohlmey/compile/lammps/src/run.cpp:177 + #3 0x000000000041258a in LAMMPS_NS::Input::command_creator (lmp=, narg=1, arg=0x7e8750) + at /home/akohlmey/compile/lammps/src/input.cpp:878 + #4 0x0000000000410ad3 in LAMMPS_NS::Input::execute_command (this=0x7d1410) at /home/akohlmey/compile/lammps/src/input.cpp:864 + #5 0x00000000004111fb in LAMMPS_NS::Input::file (this=0x7d1410) at /home/akohlmey/compile/lammps/src/input.cpp:229 + #6 0x000000000040933a in main (argc=, argv=) at /home/akohlmey/compile/lammps/src/main.cpp:65 + (gdb) + +You can also print the value of variables and see if there is anything +unexpected. Segmentation faults, for example, commonly happen when a +pointer variable is not assigned and still initialized to NULL. + +.. code-block:: + + (gdb) print x + $1 = (double **) 0x7ffff7ca1010 + (gdb) print i + $2 = 0 + (gdb) print x[0] + $3 = (double *) 0x7ffff6d80010 + (gdb) print x[0][0] + $4 = 0 + (gdb) print x[1][0] + $5 = 0.83979809569125363 + (gdb) print atom->rmass + $6 = (double *) 0x0 + (gdb) + + +Inspect a core dump file with the debugger +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +When an executable crashes with a "core dumped" message, it creates a +file "core" or "core." which contains the information about the +current state. This file may be located in the folder where you ran +LAMMPS or in some hidden folder managed by the systemd daemon. In the +latter case, you need to "extract" the core file with the ``coredumpctl`` +utility to the current folder. Example: ``coredumpctl -o core dump lmp``. +Now you can launch the debugger to load the executable, its debug info +and the core dump and drop you to a prompt like before. + +.. code-block:: + + $ gdb lmp core + Reading symbols from lmp... + [New LWP 1928535] + [Thread debugging using libthread_db enabled] + Using host libthread_db library "/lib64/libthread_db.so.1". + Core was generated by `./lmp -in in.melt'. + Program terminated with signal SIGSEGV, Segmentation fault. + #0 0x00000000006653ab in LAMMPS_NS::PairLJCut::compute (this=0x1b10740, eflag=1, vflag=) + at /home/akohlmey/compile/lammps/src/pair_lj_cut.cpp:139 + 139 comx += atom->rmass[i]*x[i][0]; /* BUG */ + (gdb) + +From here on, you use the same commands as shown before to get a stack +trace and print current values of (pointer) variables. + + +Using valgrind to get a stack trace +----------------------------------- + +The `valgrind `_ suite of tools allows to closely +inspect the behavior of a compiled program by essentially emulating a +CPU and instrumenting the program while running. This slows down +execution quite significantly, but can also report issues that are not +resulting in a crash. The default valgrind tool is a memory checker and +you can use it by prefixing the normal command line with ``valgrind``. +Unlike GDB, this will also work for parallel execution, but it is +recommended to redirect the valgrind output to a file (e.g. with +``--log-file=crash-%p.txt``, the %p will be substituted with the +process ID) so that the messages of the multiple valgrind instances to +the console are not mixed. + +.. code-block:: + + $ valgrind ./lmp -in in.melt + ==1933642== Memcheck, a memory error detector + ==1933642== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. + ==1933642== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info + ==1933642== Command: ./lmp -in in.melt + ==1933642== + LAMMPS (19 Mar 2020) + OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) + using 1 OpenMP thread(s) per MPI task + Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 + Created orthogonal box = (0 0 0) to (16.796 16.796 16.796) + 1 by 1 by 1 MPI processor grid + Created 4000 atoms + create_atoms CPU = 0.032964 secs + Neighbor list info ... + update every 20 steps, delay 0 steps, check no + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 12 12 12 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d/newton + bin: standard + Setting up Verlet run ... + Unit style : lj + Current step : 0 + Time step : 0.005 + ==1933642== Invalid read of size 8 + ==1933642== at 0x6653AB: LAMMPS_NS::PairLJCut::compute(int, int) (pair_lj_cut.cpp:139) + ==1933642== by 0x4CF0A1: LAMMPS_NS::Verlet::setup(int) (verlet.cpp:131) + ==1933642== by 0x49DB41: LAMMPS_NS::Run::command(int, char**) (run.cpp:177) + ==1933642== by 0x412589: void LAMMPS_NS::Input::command_creator(LAMMPS_NS::LAMMPS*, int, char**) (input.cpp:881) + ==1933642== by 0x410AD2: LAMMPS_NS::Input::execute_command() (input.cpp:864) + ==1933642== by 0x4111FA: LAMMPS_NS::Input::file() (input.cpp:229) + ==1933642== by 0x409339: main (main.cpp:65) + ==1933642== Address 0x0 is not stack'd, malloc'd or (recently) free'd + ==1933642== + +As you can see, the stack trace information is similar to that obtained +from GDB. In addition you get a more specific hint about what cause the +segmentation fault, i.e. that it is a NULL pointer dereference. To find +out which pointer exactly was NULL, you need to use the debugger, though. + diff --git a/doc/src/Howto.rst b/doc/src/Howto.rst index f4376898b1..0ca955ab86 100644 --- a/doc/src/Howto.rst +++ b/doc/src/Howto.rst @@ -16,6 +16,7 @@ Tutorials howto :name: tutorials :maxdepth: 1 + Howto_cmake Howto_github Howto_pylammps Howto_bash diff --git a/doc/src/Howto_cmake.rst b/doc/src/Howto_cmake.rst new file mode 100644 index 0000000000..db7b88dc3d --- /dev/null +++ b/doc/src/Howto_cmake.rst @@ -0,0 +1,483 @@ +Using CMake with LAMMPS tutorial +================================ + +The support for building LAMMPS with CMake is a recent addition to +LAMMPS thanks to the efforts of Christoph Junghans (LANL) and Richard +Berger (Temple U). One of the key strengths of CMake is that it is not +tied to a specific platform or build system and thus generate the files +necessary to build and develop for different build systems and on +different platforms. Note, that this applies to the build system itself +not the LAMMPS code. In other words, without additional porting effort, +it is not possible - for example - to compile LAMMPS with Visual C++ on +Windows. The build system output can also include support files +necessary to program LAMMPS as a project in integrated development +environments (IDE) like Eclipse, Visual Studio, QtCreator, Xcode, +CodeBlocks, Kate and others. + +A second important feature of CMake is, that it can detect and validate +available libraries, optimal settings, available support tools and so +on, so that by default LAMMPS will take advantage of available tools +without requiring to provide the details about how to enable/integrate +them. + +The downside of this approach is, that there is some complexity +associated with running CMake itself and how to customize the building +of LAMMPS. This tutorial will show how to manage this through some +selected examples. Please see the chapter about :doc:`building LAMMPS +` for descriptions of specific flags and options for LAMMPS in +general and for specific packages. + +CMake can be used through either the command-line interface (CLI) +program ``cmake`` (or ``cmake3``), a text mode interactive user +interface (TUI) program ``ccmake`` (or ``ccmake3``), or a graphical user +interface (GUI) program ``cmake-gui``. All of them are portable +software available on all supported platforms and can be used +interchangeably. The minimum supported CMake version is 3.10 (3.12 or +later is recommended). + +All details about features and settings for CMake are in the `CMake +online documentation `_. We focus +below on the most important aspects with respect to compiling LAMMPS. + +Prerequisites +------------- + +This tutorial assumes that you are operating in a command-line environment +using a shell like Bash. + +- Linux: any Terminal window will work +- MacOS X: launch the Terminal application. +- Windows 10: install and run the :doc:`Windows subsystem for Linux ` + +We also assume that you have downloaded and unpacked a recent LAMMPS source code package +or used Git to create a clone of the LAMMPS sources on your compilation machine. + +You should change into the top level directory of the LAMMPS source tree all +paths mentioned in the tutorial are relative to that. Immediately after downloading +it should look like this: + +.. code-block:: bash + + $ ls + bench doc lib potentials README tools + cmake examples LICENSE python src + +Build versus source directory +----------------------------- + +When using CMake the build procedure is separated into multiple distinct phases: + + #. **Configuration:** detect or define which features and settings + should be enable and used and how LAMMPS should be compiled + #. **Compilation:** generate and compile all necessary source files + and build libraries and executables. + #. **Installation:** copy selected files from the compilation into + your file system, so they can be used without having to keep the + source and build tree around. + +The configuration and compilation of LAMMPS has to happen in a dedicated +*build directory* which must be different from the source directory. +Also the source directory (``src``) must remain pristine, so it is not +allowed to "install" packages using the traditional make process and +after an compilation attempt all created source files must be removed. +This can be achieved with ``make no-all purge``. + +You can pick **any** folder outside the source tree. We recommend to +create a folder ``build`` in the top-level directory, or multiple +folders in case you want to have separate builds of LAMMPS with +different options (``build-parallel``, ``build-serial``) or with +different compilers (``build-gnu``, ``build-clang``, ``build-intel``) +and so on. All the auxiliary files created by one build process +(executable, object files, log files, etc) are stored in this directory +or sub-directories within it that CMake creates. + + +Running CMake +------------- + +CLI version +^^^^^^^^^^^ + +In the (empty) ``build`` directory, we now run the command ``cmake +../cmake``, which will start the configuration phase and you will see +the progress of the configuration printed to the screen followed by a +summary of the enabled features, options and compiler settings. A typical +summary screen will look like this: + +.. code-block:: + + $ cmake ../cmake/ + -- The CXX compiler identification is GNU 8.2.0 + -- Check for working CXX compiler: /opt/tools/gcc-8.2.0/bin/c++ + -- Check for working CXX compiler: /opt/tools/gcc-8.2.0/bin/c++ - works + -- Detecting CXX compiler ABI info + -- Detecting CXX compiler ABI info - done + -- Detecting CXX compile features + -- Detecting CXX compile features - done + -- Found Git: /usr/bin/git (found version "2.25.2") + -- Running check for auto-generated files from make-based build system + -- Found MPI_CXX: /usr/lib64/mpich/lib/libmpicxx.so (found version "3.1") + -- Found MPI: TRUE (found version "3.1") + -- Looking for C++ include omp.h + -- Looking for C++ include omp.h - found + -- Found OpenMP_CXX: -fopenmp (found version "4.5") + -- Found OpenMP: TRUE (found version "4.5") + -- Found JPEG: /usr/lib64/libjpeg.so (found version "62") + -- Found PNG: /usr/lib64/libpng.so (found version "1.6.37") + -- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11") + -- Found GZIP: /usr/bin/gzip + -- Found FFMPEG: /usr/bin/ffmpeg + -- Performing Test COMPILER_SUPPORTS-ffast-math + -- Performing Test COMPILER_SUPPORTS-ffast-math - Success + -- Performing Test COMPILER_SUPPORTS-march=native + -- Performing Test COMPILER_SUPPORTS-march=native - Success + -- Looking for C++ include cmath + -- Looking for C++ include cmath - found + -- Generating style_angle.h... + [...] + -- Generating lmpinstalledpkgs.h... + -- The following tools and libraries have been found and configured: + * Git + * MPI + * OpenMP + * JPEG + * PNG + * ZLIB + + -- <<< Build configuration >>> + Build type: RelWithDebInfo + Install path: /home/akohlmey/.local + Generator: Unix Makefiles using /usr/bin/gmake + -- <<< Compilers and Flags: >>> + -- C++ Compiler: /opt/tools/gcc-8.2.0/bin/c++ + Type: GNU + Version: 8.2.0 + C++ Flags: -O2 -g -DNDEBUG + Defines: LAMMPS_SMALLBIG;LAMMPS_MEMALIGN=64;LAMMPS_JPEG;LAMMPS_PNG;LAMMPS_GZIP;LAMMPS_FFMPEG + Options: -ffast-math;-march=native + -- <<< Linker flags: >>> + -- Executable name: lmp + -- Static library flags: + -- <<< MPI flags >>> + -- MPI includes: /usr/include/mpich-x86_64 + -- MPI libraries: /usr/lib64/mpich/lib/libmpicxx.so;/usr/lib64/mpich/lib/libmpi.so; + -- Configuring done + -- Generating done + -- Build files have been written to: /home/akohlmey/compile/lammps/build + +The ``cmake`` command has one mandatory argument, and that is a folder +with either the file ``CMakeLists.txt`` or ``CMakeCache.txt``. The +``CMakeCache.txt`` file is created during the CMake configuration run +and contains all active settings, thus after a first run of CMake +all future runs in the build folder can use the folder ``.`` and CMake +will know where to find the CMake scripts and reload the settings +from the previous step. This means, that one can modify an existing +configuration by re-running CMake, but only needs to provide flags +indicating the desired change, everything else will be retained. One +can also mix compilation and configuration, i.e. start with a minimal +configuration and then, if needed, enable additional features and +recompile. + +The steps above **will NOT compile the code**\ . The compilation can be +started in a portable fashion with ``cmake --build .``, or you use the +selected built tool, e.g. ``make``. + +TUI version +^^^^^^^^^^^ + +For the text mode UI CMake program the basic principle is the same. +You start the command ``ccmake ../cmake`` in the ``build`` folder. + +.. list-table:: + + * - .. figure:: JPG/ccmake-initial.png + :target: JPG/ccmake-initial.png + :align: center + + Initial ``ccmake`` screen + + - .. figure:: JPG/ccmake-config.png + :target: JPG/ccmake-config.png + :align: center + + Configure output of ``ccmake`` + + - .. figure:: JPG/ccmake-options.png + :target: JPG/ccmake-options.png + :align: center + + Options screen of ``ccmake`` + +This will show you the initial screen (left image) with the empty +configuration cache. Now you type the 'c' key to run the configuration +step. That will do a first configuration run and show the summary +(center image). You exit the summary screen with 'e' and see now the +main screen with detected options and settings. You can now make changes +by moving and down with the arrow keys of the keyboard and modify +entries. For on/off settings, the enter key will toggle the state. +For others, hitting enter will allow you to modify the value and +you commit the change by hitting the enter key again or cancel using +the escape key. All "new" settings will be marked with a star '\*' +and for as long as one setting is marked like this, you have to +re-run the configuration by hitting the 'c' key again, sometimes +multiple times unless the TUI shows the word "generate" next to the +letter 'g' and by hitting the 'g' key the build files will be written +to the folder and the TUI exits. You can quit without generating +build files by hitting 'q'. + +GUI version +^^^^^^^^^^^ + +For the graphical CMake program the steps are similar to the TUI +version. You can type the command ``cmake-gui ../cmake`` in the +``build`` folder. In this case the path to the CMake script folder is +not required, it can also be entered from the GUI. + +.. list-table:: + + * - .. figure:: JPG/cmake-gui-initial.png + :target: JPG/cmake-gui-initial.png + :align: center + + Initial ``cmake-gui`` screen + + - .. figure:: JPG/cmake-gui-popup.png + :target: JPG/cmake-gui-popup.png + :align: center + + Generator selection in ``cmake-gui`` + + - .. figure:: JPG/cmake-gui-options.png + :target: JPG/cmake-gui-options.png + :align: center + + Options screen of ``cmake-gui`` + +Again, you start with an empty configuration cache (left image) and need +to start the configuration step. For the very first configuration in a +folder, you will have a pop-up dialog (center image) asking to select +the desired build tool and some configuration settings (stick with the +default) and then you get the option screen with all new settings +highlighted in red. You can modify them (or not) and click on the +"configure" button again until satisfied and click on the "generate" +button to write out the build files. You can exit the GUI from the +"File" menu or hit "ctrl-q". + + +Setting options +--------------- + +Options that enable, disable or modify settings are modified by setting +the value of CMake variables. This is done on the command line with the +*-D* flag in the format ``-D VARIABLE=value``, e.g. ``-D +CMAKE_BUILD_TYPE=Release`` or ``-D BUILD_MPI=on``. There is one quirk: +when used before the CMake directory, there may be a space between the +*-D* flag and the variable, after it must not be. Such CMake variables +can have boolean values (on/off, yes/no, or 1/0 are all valid) or are +strings representing a choice, or a path, or are free format. If the +string would contain whitespace, it must be put in quotes, for example +``-D CMAKE_TUNE_FLAGS="-ftree-vectorize -ffast-math"``. + +CMake variables fall into two categories: 1) common CMake variables that +are used by default for any CMake configuration setup and 2) project +specific variables, i.e. settings that are specific for LAMMPS. +Also CMake variables can be flagged as *advanced*, which means they are +not shown in the text mode or graphical CMake program in the overview +of all settings by default, but only when explicitly requested (by hitting +the 't' key or clicking on the 'Advanced' check-box). + +Some common CMake variables +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. list-table:: + :header-rows: 1 + + * - Variable + - Description + * - ``CMAKE_INSTALL_PREFIX`` + - root directory of install location for ``make install`` (default: ``$HOME/.local``) + * - ``CMAKE_BUILD_TYPE`` + - controls compilation options: + one of ``RelWithDebInfo`` (default), ``Release``, ``Debug``, ``MinSizeRel`` + * - ``BUILD_SHARED_LIBS`` + - if set to ``on`` build the LAMMPS library as shared library (default: ``off``) + * - ``CMAKE_MAKE_PROGRAM`` + - name/path of the compilation command (default depends on *-G* option, usually ``make``) + * - ``CMAKE_VERBOSE_MAKEFILE`` + - if set to ``on`` echo commands while executing during build (default: ``off``) + * - ``CMAKE_C_COMPILER`` + - C compiler to be used for compilation (default: system specific, ``gcc`` on Linux) + * - ``CMAKE_CXX_COMPILER`` + - C++ compiler to be used for compilation (default: system specific, ``g++`` on Linux) + * - ``CMAKE_Fortran_COMPILER`` + - Fortran compiler to be used for compilation (default: system specific, ``gfortran`` on Linux) + * - ``CXX_COMPILER_LAUNCHER`` + - tool to launch the C++ compiler, e.g. ``ccache`` or ``distcc`` for faster compilation (default: empty) + +Some common LAMMPS specific variables +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. list-table:: + :header-rows: 1 + + * - Variable + - Description + * - ``BUILD_MPI`` + - build LAMMPS with MPI support (default: ``on`` if a working MPI available, else ``off``) + * - ``BUILD_OMP`` + - build LAMMPS with OpenMP support (default: ``on`` if compiler supports OpenMP fully, else ``off``) + * - ``BUILD_TOOLS`` + - compile some additional executables from the ``tools`` folder (default: ``off``) + * - ``BUILD_DOC`` + - include building the HTML format documentation for packaging/installing (default: ``off``) + * - ``CMAKE_TUNE_FLAGS`` + - common compiler flags, for optimization or instrumentation (default: compiler specific) + * - ``LAMMPS_MACHINE`` + - when set to ``name`` the LAMMPS executable and library will be called ``lmp_name`` and ``liblammps_name.a`` + * - ``LAMMPS_EXCEPTIONS`` + - when set to ``on`` errors will throw a C++ exception instead of aborting (default: ``off``) + * - ``FFT`` + - select which FFT library to use: ``FFTW3``, ``MKL``, ``KISS`` (default, unless FFTW3 is found) + * - ``FFT_SINGLE`` + - select whether to use single precision FFTs (default: ``off``) + * - ``WITH_JPEG`` + - whether to support JPEG format in :doc:`dump image ` (default: ``on`` if found) + * - ``WITH_PNG`` + - whether to support PNG format in :doc:`dump image ` (default: ``on`` if found) + * - ``WITH_GZIP`` + - whether to support reading and writing compressed files (default: ``on`` if found) + * - ``WITH_FFMPEG`` + - whether to support generating movies with :doc:`dump movie ` (default: ``on`` if found) + +Enabling or disabling LAMMPS packages +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The LAMMPS software is organized into a common core that is always +included and a large number of :doc:`add-on packages ` that +have to be enabled to be included into a LAMMPS executable. Packages +are enabled through setting variables of the kind ``PKG_`` to +``on`` and disabled by setting them to ``off`` (or using ``yes``, +``no``, ``1``, ``0`` correspondingly). ```` has to be replaced by +the name of the package, e.g. ``MOLECULE`` or ``USER-MISC``. + + +Using presets +------------- + +Since LAMMPS has a lot of optional features and packages, specifying +them all on the command line can be tedious. Or when selecting a +different compiler toolchain, multiple options have to be changed +consistently and that is rather error prone. Or when enabling certain +packages, they require consistent settings to be operated in a +particular mode. For this purpose, we are providing a selection of +"preset files" for CMake in the folder ``cmake/presets``. They +represent a way to pre-load or override the CMake configuration cache by +setting or changing CMake variables. Preset files are loaded using the +*-C* command line flag. You can combine loading multiple preset files or +change some variables later with additional *-D* flags. A few examples: + +.. code-block:: bash + + cmake -C ../cmake/preset/minimal.cmake -D PKG_MISC=on ../cmake + cmake -C ../cmake/preset/clang.cmake -C ../cmake/preset/most.cmake ../cmake + cmake -C ../cmake/preset/minimal.cmake -D BUILD_MPI=off ../cmake + +The first command will install the packages ``KSPACE``, ``MANYBODY``, +``MOLECULE``, ``RIGID`` and ``MISC``; the first four from the preset +file and the fifth from the explicit variable definition. The second +command will first switch the compiler toolchain to use the Clang +compilers and install a large number of packages that are not depending +on any special external libraries or tools and are not very unusual. +The third command will enable the first four packages like above and +then enforce compiling LAMMPS as a serial program (using the MPI STUBS +library). + +It is also possible to do this incrementally. + +.. code-block:: bash + + cmake -C ../cmake/preset/minimal.cmake ../cmake + cmake -D PKG_MISC=on . + +will achieve the same configuration like in the first example above. In +this scenario it is particularly convenient to do the second +configuration step using either the text mode or graphical user +interface (``ccmake`` or ``cmake-gui``). + +Compilation and build targets +----------------------------- + +The actual compilation will be started by running the selected build +command (on Linux this is by default ``make``, see below how to select +alternatives). You can also use the portable command ``cmake --build .`` +which will adapt to whatever the selected build command is. +This is particularly convenient, if you have set a custom build command +via the ``CMAKE_MAKE_PROGRAM`` variable. + +When calling the build program, you can also select which "target" is to +be build through appending the name of the target to the build command. +Example: ``cmake --build . all``. The following abstract targets are available: + +.. list-table:: + :header-rows: 1 + + * - Target + - Description + * - ``all`` + - build "everything" (default) + * - ``lammps`` + - build the LAMMPS library and executable + * - ``doc`` + - build the HTML documentation (if configured) + * - ``install`` + - install all target files into folders in ``CMAKE_INSTALL_PREFIX`` + * - ``test`` + - run some simple tests (if configured with ``-D ENABLE_TESTING=on``) + * - ``clean`` + - remove all generated files + + +Choosing generators +------------------- + +While CMake usually defaults to creating makefiles to compile software +with the ``make`` program, it supports multiple alternate build tools +(e.g. ``ninja-build`` which tends to be faster and more efficient in +parallelizing builds than ``make``) and can generate project files for +integrated development environments (IDEs) like VisualStudio, Eclipse or +CodeBlocks. This is specific to how the local CMake version was +configured and compiled. The list of available options can be seen at +the end of the output of ``cmake --help``. Example on Fedora 31 this is: + +.. code-block:: + + Generators + + The following generators are available on this platform (* marks default): + * Unix Makefiles = Generates standard UNIX makefiles. + Green Hills MULTI = Generates Green Hills MULTI files + (experimental, work-in-progress). + Ninja = Generates build.ninja files. + Ninja Multi-Config = Generates build-.ninja files. + Watcom WMake = Generates Watcom WMake makefiles. + CodeBlocks - Ninja = Generates CodeBlocks project files. + CodeBlocks - Unix Makefiles = Generates CodeBlocks project files. + CodeLite - Ninja = Generates CodeLite project files. + CodeLite - Unix Makefiles = Generates CodeLite project files. + Sublime Text 2 - Ninja = Generates Sublime Text 2 project files. + Sublime Text 2 - Unix Makefiles + = Generates Sublime Text 2 project files. + Kate - Ninja = Generates Kate project files. + Kate - Unix Makefiles = Generates Kate project files. + Eclipse CDT4 - Ninja = Generates Eclipse CDT 4.0 project files. + Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files. + +Below is a screenshot of using the CodeBlocks IDE with the ninja build tool +after running CMake as follows: + +.. code-block:: bash + + cmake -G 'CodeBlocks - Ninja' ../cmake/presets/most.cmake ../cmake/ + +.. image:: JPG/cmake-codeblocks.png + :align: center diff --git a/doc/src/Install_mac.rst b/doc/src/Install_mac.rst index 41b53c0595..642169ffe5 100644 --- a/doc/src/Install_mac.rst +++ b/doc/src/Install_mac.rst @@ -34,9 +34,9 @@ install the `openkim-models` package % brew install openkim-models If you have problems with the installation you can post issues to -`this link `_. +`this link `_. -.. _homebrew: https://github.com/Homebrew/homebrew-core/issues +.. _homebrew: https://brew.sh Thanks to Derek Thomas (derekt at cello.t.u-tokyo.ac.jp) for setting up the Homebrew capability. diff --git a/doc/src/JPG/ccmake-config.png b/doc/src/JPG/ccmake-config.png new file mode 100644 index 0000000000..ef75089646 Binary files /dev/null and b/doc/src/JPG/ccmake-config.png differ diff --git a/doc/src/JPG/ccmake-initial.png b/doc/src/JPG/ccmake-initial.png new file mode 100644 index 0000000000..d6291afde5 Binary files /dev/null and b/doc/src/JPG/ccmake-initial.png differ diff --git a/doc/src/JPG/ccmake-options.png b/doc/src/JPG/ccmake-options.png new file mode 100644 index 0000000000..b05d58c1d2 Binary files /dev/null and b/doc/src/JPG/ccmake-options.png differ diff --git a/doc/src/JPG/cmake-codeblocks.png b/doc/src/JPG/cmake-codeblocks.png new file mode 100644 index 0000000000..d0d96fec8c Binary files /dev/null and b/doc/src/JPG/cmake-codeblocks.png differ diff --git a/doc/src/JPG/cmake-gui-initial.png b/doc/src/JPG/cmake-gui-initial.png new file mode 100644 index 0000000000..062bc6ba83 Binary files /dev/null and b/doc/src/JPG/cmake-gui-initial.png differ diff --git a/doc/src/JPG/cmake-gui-options.png b/doc/src/JPG/cmake-gui-options.png new file mode 100644 index 0000000000..abbf634946 Binary files /dev/null and b/doc/src/JPG/cmake-gui-options.png differ diff --git a/doc/src/JPG/cmake-gui-popup.png b/doc/src/JPG/cmake-gui-popup.png new file mode 100644 index 0000000000..d623aad30b Binary files /dev/null and b/doc/src/JPG/cmake-gui-popup.png differ diff --git a/doc/src/Python_shlib.rst b/doc/src/Python_shlib.rst index 0c86362e12..b02fcd7bb8 100644 --- a/doc/src/Python_shlib.rst +++ b/doc/src/Python_shlib.rst @@ -1,6 +1,8 @@ Build LAMMPS as a shared library ================================ +.. TODO this is mostly redundant and should be addressed in the 'progguide' branch if it has not already + Build LAMMPS as a shared library using make ------------------------------------------- @@ -14,7 +16,7 @@ From the src directory, type .. code-block:: bash - make foo mode=shlib + make foo mode=shared where foo is the machine target name, such as mpi or serial. This should create the file liblammps_foo.so in the src directory, as @@ -39,7 +41,6 @@ shared library: .. code-block:: bash - -D BUILD_LIB=on # enable building LAMMPS as a library -D BUILD_SHARED_LIBS=on # enable building of LAMMPS shared library (both options are needed!) What this does is create a liblammps.so which contains the majority of LAMMPS @@ -59,7 +60,7 @@ CMAKE_INSTALL_PREFIX. # build library mkdir build cd build - cmake -D PKG_PYTHON=on -D BUILD_LIB=on -D BUILD_SHARED_LIBS=on -D CMAKE_INSTALL_PREFIX=$VIRTUAL_ENV ../cmake + cmake -D PKG_PYTHON=on -D BUILD_SHARED_LIBS=on -D CMAKE_INSTALL_PREFIX=$VIRTUAL_ENV ../cmake make -j 4 # install into prefix diff --git a/doc/src/balance.rst b/doc/src/balance.rst index 5e631fdd27..5873724924 100644 --- a/doc/src/balance.rst +++ b/doc/src/balance.rst @@ -175,23 +175,27 @@ a logical 3d grid of processors. They operate by changing the cutting planes (or lines) between processors in 3d (or 2d), to adjust the volume (area in 2d) assigned to each processor, as in the following 2d diagram where processor sub-domains are shown and particles are -colored by the processor that owns them. The leftmost diagram is the -default partitioning of the simulation box across processors (one -sub-box for each of 16 processors); the middle diagram is after a -"grid" method has been applied. +colored by the processor that owns them. -.. image:: JPG/balance_uniform_small.jpg - :target: JPG/balance_uniform.jpg -.. image:: JPG/balance_nonuniform_small.jpg - :target: JPG/balance_nonuniform.jpg -.. image:: JPG/balance_rcb_small.jpg - :target: JPG/balance_rcb.jpg +.. list-table:: -The *rcb* style is a "tiling" method which does not produce a logical -3d grid of processors. Rather it tiles the simulation domain with -rectangular sub-boxes of varying size and shape in an irregular -fashion so as to have equal numbers of particles (or weight) in each -sub-box, as in the rightmost diagram above. + * - .. figure:: JPG/balance_uniform_small.jpg + :target: JPG/balance_uniform.jpg + + - .. figure:: JPG/balance_nonuniform_small.jpg + :target: JPG/balance_nonuniform.jpg + + - .. figure:: JPG/balance_rcb_small.jpg + :target: JPG/balance_rcb.jpg + +The leftmost diagram is the default partitioning of the simulation box +across processors (one sub-box for each of 16 processors); the middle +diagram is after a "grid" method has been applied. The *rcb* style is a +"tiling" method which does not produce a logical 3d grid of processors. +Rather it tiles the simulation domain with rectangular sub-boxes of +varying size and shape in an irregular fashion so as to have equal +numbers of particles (or weight) in each sub-box, as in the rightmost +diagram above. The "grid" methods can be used with either of the :doc:`comm_style ` command options, *brick* or *tiled*\ . The diff --git a/doc/src/fix_balance.rst b/doc/src/fix_balance.rst index 13fdf6b1c7..b92644fcd9 100644 --- a/doc/src/fix_balance.rst +++ b/doc/src/fix_balance.rst @@ -154,28 +154,27 @@ of processors. It operates by changing the cutting planes (or lines) between processors in 3d (or 2d), to adjust the volume (area in 2d) assigned to each processor, as in the following 2d diagram where processor sub-domains are shown and atoms are colored by the processor -that owns them. The leftmost diagram is the default partitioning of -the simulation box across processors (one sub-box for each of 16 -processors); the middle diagram is after a "grid" method has been -applied. +that owns them. -.. |bal_uni| image:: JPG/balance_uniform_small.jpg - :target: JPG/balance_uniform.jpg - :width: 31% -.. |bal_non| image:: JPG/balance_nonuniform_small.jpg - :target: JPG/balance_nonuniform.jpg - :width: 31% -.. |bal_rcb| image:: JPG/balance_rcb_small.jpg - :target: JPG/balance_rcb.jpg - :width: 31% +.. list-table:: -|bal_uni| |bal_non| |bal_rcb| + * - .. figure:: JPG/balance_uniform_small.jpg + :target: JPG/balance_uniform.jpg -The *rcb* style is a "tiling" method which does not produce a logical -3d grid of processors. Rather it tiles the simulation domain with -rectangular sub-boxes of varying size and shape in an irregular -fashion so as to have equal numbers of particles (or weight) in each -sub-box, as in the rightmost diagram above. + - .. figure:: JPG/balance_nonuniform_small.jpg + :target: JPG/balance_nonuniform.jpg + + - .. figure:: JPG/balance_rcb_small.jpg + :target: JPG/balance_rcb.jpg + +The leftmost diagram is the default partitioning of the simulation box +across processors (one sub-box for each of 16 processors); the middle +diagram is after a "grid" method has been applied. The *rcb* style is a +"tiling" method which does not produce a logical 3d grid of processors. +Rather it tiles the simulation domain with rectangular sub-boxes of +varying size and shape in an irregular fashion so as to have equal +numbers of particles (or weight) in each sub-box, as in the rightmost +diagram above. The "grid" methods can be used with either of the :doc:`comm_style ` command options, *brick* or *tiled*\ . The diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index d925db3b93..c19349f3e6 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -492,6 +492,7 @@ cstdlib cstring cstyle csvr +ctrl Ctypes ctypes cuda @@ -584,6 +585,7 @@ dephasing dequidt Dequidt der +dereference derekt Derjagin Derjaguin @@ -2839,6 +2841,7 @@ Synechococcus sys sysdim Syst +systemd Sz Tabbernor tabinner diff --git a/src/MAKE/MACHINES/Makefile.aarch64_arm_openmpi_armpl b/src/MAKE/MACHINES/Makefile.aarch64_arm_openmpi_armpl index 9f29e9a87e..07dedba32a 100644 --- a/src/MAKE/MACHINES/Makefile.aarch64_arm_openmpi_armpl +++ b/src/MAKE/MACHINES/Makefile.aarch64_arm_openmpi_armpl @@ -1,4 +1,4 @@ -# g++_openmpi = OpenMPI with compiler set to GNU g++ +# aarch64_arm_openmpi_armpl = OpenMPI with compiler set to GNU g++ on 64-bit ARM SHELL = /bin/sh @@ -27,12 +27,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -45,7 +45,7 @@ MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -56,22 +56,22 @@ FFT_PATH = -L$(ARMPL_LIBRARIES) FFT_LIB = -larmpl_lp64 # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -86,28 +86,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.aarch64_arm_serial_armpl b/src/MAKE/MACHINES/Makefile.aarch64_arm_serial_armpl index 6397118357..d415f69397 100644 --- a/src/MAKE/MACHINES/Makefile.aarch64_arm_serial_armpl +++ b/src/MAKE/MACHINES/Makefile.aarch64_arm_serial_armpl @@ -1,4 +1,4 @@ -# arm_serial = Arm armclang compiler, no MPI +# aarch64_arm_serial_armpl = ARM 64-bit, armclang compiler, no MPI SHELL = /bin/sh @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -44,7 +44,7 @@ MPI_PATH = -L../STUBS MPI_LIB = -lmpi_stubs # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -55,22 +55,22 @@ FFT_PATH = -L$(ARMPL_LIBRARIES) FFT_LIB = -larmpl_lp64 # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.aarch64_g++_openmpi_armpl b/src/MAKE/MACHINES/Makefile.aarch64_g++_openmpi_armpl index 933c97cba4..b75d9ee06a 100644 --- a/src/MAKE/MACHINES/Makefile.aarch64_g++_openmpi_armpl +++ b/src/MAKE/MACHINES/Makefile.aarch64_g++_openmpi_armpl @@ -1,4 +1,4 @@ -# g++_openmpi = OpenMPI with compiler set to GNU g++ +# aarch64_g++_openmpi_armpl = ARM 64-bit using OpenMPI with compiler set to GNU g++ SHELL = /bin/sh @@ -32,7 +32,7 @@ SHLIBFLAGS = -shared LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -45,7 +45,7 @@ MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -56,22 +56,22 @@ FFT_PATH = -L$(ARMPL_LIBRARIES) FFT_LIB = -larmpl_lp64 # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -86,28 +86,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.aarch64_g++_serial_armpl b/src/MAKE/MACHINES/Makefile.aarch64_g++_serial_armpl index e7f1a81f3b..73cd0d6bed 100644 --- a/src/MAKE/MACHINES/Makefile.aarch64_g++_serial_armpl +++ b/src/MAKE/MACHINES/Makefile.aarch64_g++_serial_armpl @@ -1,4 +1,4 @@ -# g++_serial = GNU g++ compiler, no MPI +# aarch64_g++_serial_armpl = ARM 64-bit GNU g++ compiler, no MPI SHELL = /bin/sh @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -44,7 +44,7 @@ MPI_PATH = -L../STUBS MPI_LIB = -lmpi_stubs # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -55,22 +55,22 @@ FFT_PATH = -L$(ARMPL_LIBRARIES) FFT_LIB = -larmpl_lp64 # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.astra_arm b/src/MAKE/MACHINES/Makefile.astra_arm index 3734208936..3ea3e00935 100644 --- a/src/MAKE/MACHINES/Makefile.astra_arm +++ b/src/MAKE/MACHINES/Makefile.astra_arm @@ -1,4 +1,4 @@ -# astra_arm - ThunderX2 ARM/OpenMPI Based, use Arm-PL for FFTW +# astra_arm = ThunderX2 ARM/OpenMPI Based, use Arm-PL for FFTW # need to load the following modules: # 1) arm-based developer pack @@ -25,12 +25,12 @@ SIZE = size # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -43,7 +43,7 @@ MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -54,22 +54,22 @@ FFT_PATH = FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = +JPG_INC = +JPG_PATH = JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -84,28 +84,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.astra_gcc b/src/MAKE/MACHINES/Makefile.astra_gcc index 3ee43800fc..d607fbec84 100644 --- a/src/MAKE/MACHINES/Makefile.astra_gcc +++ b/src/MAKE/MACHINES/Makefile.astra_gcc @@ -1,4 +1,4 @@ -# astra-gcc - ThunderX2 GCC/OpenMPI Based, FFTW +# astra_gcc = ThunderX2 GCC/OpenMPI Based, FFTW # need to load the following modules: # 1) arm-based developer pack @@ -25,12 +25,12 @@ SIZE = size # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -43,7 +43,7 @@ MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -54,22 +54,22 @@ FFT_PATH = -I${FFTW_INC} FFT_LIB = -L${FFTW_LIB} -lfftw3 # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = +JPG_INC = +JPG_PATH = JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -84,28 +84,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.beacon b/src/MAKE/MACHINES/Makefile.beacon index 522d7b1859..87ef35b248 100644 --- a/src/MAKE/MACHINES/Makefile.beacon +++ b/src/MAKE/MACHINES/Makefile.beacon @@ -1,4 +1,4 @@ -# linux = RedHat Linux box, Intel icc, MPICH2, FFTW +# beacon = RedHat Linux box, Intel icc, MPICH2, FFTW SHELL = /bin/sh @@ -27,12 +27,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP -DLAMMPS_JPEG # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -45,7 +45,7 @@ MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -56,7 +56,7 @@ FFT_PATH = FFT_LIB = -L$(MKLROOT) -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library @@ -70,8 +70,8 @@ JPG_LIB = -ljpeg # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -86,28 +86,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.bgl b/src/MAKE/MACHINES/Makefile.bgl index 4759cde1ff..06d243e83a 100644 --- a/src/MAKE/MACHINES/Makefile.bgl +++ b/src/MAKE/MACHINES/Makefile.bgl @@ -32,12 +32,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -50,33 +50,33 @@ MPI_PATH = MPI_LIB = -lmpich.rts # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -DFFT_FFTW2 -FFT_PATH = -FFT_LIB = -lfftw +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -91,28 +91,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.bgq b/src/MAKE/MACHINES/Makefile.bgq index c995f41108..3d8ea41f5f 100644 --- a/src/MAKE/MACHINES/Makefile.bgq +++ b/src/MAKE/MACHINES/Makefile.bgq @@ -8,7 +8,7 @@ SHELL = /bin/bash # do not edit this section # select which compiler by editing Makefile.bgq.details -include ../MAKE/MACHINES/Makefile.bgq.details +include ../MAKE/MACHINES/bgq.make.details include Makefile.package.settings include Makefile.package @@ -26,28 +26,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.chama b/src/MAKE/MACHINES/Makefile.chama index aab5bb3d22..a8a9cebfdb 100644 --- a/src/MAKE/MACHINES/Makefile.chama +++ b/src/MAKE/MACHINES/Makefile.chama @@ -1,4 +1,4 @@ -# chama - Intel SandyBridge, mpic++, openmpi, no FFTW +# chama = Intel SandyBridge, mpic++, openmpi, no FFTW # need to load the following modules: # 1) intel/12.1 @@ -26,12 +26,12 @@ SIZE = size # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -39,38 +39,38 @@ LMP_INC = -DLAMMPS_GZIP # PATH = path for MPI library # LIB = name of MPI library -MPI_INC = -MPI_PATH = +MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 +MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -#FFT_INC = -DFFT_FFTW2 -I${FFTW_INCLUDE} -#FFT_PATH = -L${FFTW_LIB} -#FFT_LIB = -lfftw +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = +JPG_INC = +JPG_PATH = JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.cori2 b/src/MAKE/MACHINES/Makefile.cori2 index 45e1ab1f8a..86d38d7726 100644 --- a/src/MAKE/MACHINES/Makefile.cori2 +++ b/src/MAKE/MACHINES/Makefile.cori2 @@ -36,12 +36,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = #-DLAMMPS_GZIP -DLAMMPS_JPEG # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -50,11 +50,11 @@ LMP_INC = #-DLAMMPS_GZIP -DLAMMPS_JPEG # LIB = name of MPI library MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -MPI_PATH = +MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -65,7 +65,7 @@ FFT_PATH = FFT_LIB = -lfftw3f # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library @@ -79,8 +79,8 @@ JPG_LIB = #-ljpeg # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -93,30 +93,28 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules %.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< -%.d:%.cpp - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - # Individual dependencies depend : fastdep.exe $(SRC) diff --git a/src/MAKE/MACHINES/Makefile.cygwin b/src/MAKE/MACHINES/Makefile.cygwin index 53e94d975e..5cd6e79b69 100644 --- a/src/MAKE/MACHINES/Makefile.cygwin +++ b/src/MAKE/MACHINES/Makefile.cygwin @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -44,33 +44,33 @@ MPI_PATH = -L/cygdrive/c/cygwin/mpich2-1.0.4p1/lib MPI_LIB = -lmpich # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -DFFT_FFTW2 -I/cygdrive/c/cygwin/usr/local/include -FFT_PATH = -L/cygdrive/c/cygwin/usr/local/lib -FFT_LIB = -lfftw +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.glory b/src/MAKE/MACHINES/Makefile.glory index d856b1a07d..a128f88515 100644 --- a/src/MAKE/MACHINES/Makefile.glory +++ b/src/MAKE/MACHINES/Makefile.glory @@ -43,12 +43,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -61,33 +61,33 @@ MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -DFFT_FFTW2 -I${FFTW_INCLUDE} -FFT_PATH = -L${FFTW_LIB} -FFT_LIB = -lfftw +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -102,28 +102,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.icex b/src/MAKE/MACHINES/Makefile.icex index ceeec48870..6c3db3fb43 100644 --- a/src/MAKE/MACHINES/Makefile.icex +++ b/src/MAKE/MACHINES/Makefile.icex @@ -1,4 +1,4 @@ -# mpi = MPI with its default compiler +# icex = unknown 64-bit x86_64 machine SHELL = /bin/sh @@ -26,14 +26,14 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP #LMP_INC += -DLAMMPS_JPEG LMP_INC += -DLAMMPS_MEMALIGN=64 # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -42,37 +42,37 @@ LMP_INC += -DLAMMPS_MEMALIGN=64 # LIB = name of MPI library MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -MPI_PATH = -MPI_LIB = +MPI_PATH = +MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manual +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -FFT_PATH = -FFT_LIB = +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -87,18 +87,22 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules diff --git a/src/MAKE/MACHINES/Makefile.jaguar b/src/MAKE/MACHINES/Makefile.jaguar index 7f2ce560df..4a78205c61 100644 --- a/src/MAKE/MACHINES/Makefile.jaguar +++ b/src/MAKE/MACHINES/Makefile.jaguar @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP -DNODE_PARTITION # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -44,7 +44,7 @@ MPI_PATH = MPI_LIB = -lmpich -lpthread # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -55,22 +55,22 @@ FFT_PATH = -L$(FFTW_DIR) FFT_LIB = -lfftw3 # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.lassen_kokkos b/src/MAKE/MACHINES/Makefile.lassen_kokkos index 7484f25a4b..982d53933e 100644 --- a/src/MAKE/MACHINES/Makefile.lassen_kokkos +++ b/src/MAKE/MACHINES/Makefile.lassen_kokkos @@ -31,12 +31,12 @@ KOKKOS_ARCH = Power9,Volta70 # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -52,7 +52,7 @@ MPI_PATH = MPI_LIB = -L${MY_MPI_PATH}../lib -lmpi_ibm # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -63,22 +63,22 @@ FFT_PATH = FFT_LIB = -lcufft # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -93,28 +93,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.mac b/src/MAKE/MACHINES/Makefile.mac index d38ec202db..1bbd805c65 100644 --- a/src/MAKE/MACHINES/Makefile.mac +++ b/src/MAKE/MACHINES/Makefile.mac @@ -1,4 +1,4 @@ -# mac = Apple PowerBook G4 laptop, c++, no MPI, FFTW 2.1.5 +# mac = Apple PowerBook G4 laptop, c++, no MPI SHELL = /bin/sh @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -44,33 +44,33 @@ MPI_PATH = -L../STUBS MPI_LIB = -lmpi_stubs # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -DFFT_FFTW2 -FFT_PATH = -FFT_LIB = -lfftw +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.mac_mpi b/src/MAKE/MACHINES/Makefile.mac_mpi index 3437de017b..7c4fa6aa6d 100644 --- a/src/MAKE/MACHINES/Makefile.mac_mpi +++ b/src/MAKE/MACHINES/Makefile.mac_mpi @@ -1,4 +1,4 @@ -# mac_mpi = Apple laptop, MacPorts Open MPI 1.4.3, gcc 4.8, fftw, jpeg +# mac_mpi = Apple laptop, MacPorts Open MPI 1.4.3, gcc 4.8, jpeg SHELL = /bin/sh @@ -27,12 +27,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP -DLAMMPS_JPEG # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -51,14 +51,12 @@ MPI_LIB = # PATH = path for FFT library # LIB = name of FFT library -FFTW = /usr/local - -FFT_INC = -DFFT_FFTW2 -I${FFTW}/include -FFT_PATH = -L${FFTW}/lib -FFT_LIB = -lfftw +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library @@ -72,8 +70,8 @@ JPG_LIB = -ljpeg # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -88,28 +86,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.mingw32-cross b/src/MAKE/MACHINES/Makefile.mingw32-cross index 405c370574..c463d7df26 100644 --- a/src/MAKE/MACHINES/Makefile.mingw32-cross +++ b/src/MAKE/MACHINES/Makefile.mingw32-cross @@ -31,12 +31,12 @@ LIBOBJDIR = /Obj_mingw32 # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_SMALLSMALL -DLAMMPS_JPEG -DLAMMPS_PNG -DLAMMPS_XDR -DLAMMPS_GZIP -DLAMMPS_FFMPEG # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -49,18 +49,18 @@ MPI_PATH = -L../STUBS MPI_LIB = -lmpi_mingw32 # FFT library -# see discussion in Section 2.2 (step 6) of manual +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library FFT_INC = -FFT_PATH = +FFT_PATH = FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library @@ -74,8 +74,8 @@ JPG_LIB = -ljpeg -lpng -lz # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -90,28 +90,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.mingw32-cross-mpi b/src/MAKE/MACHINES/Makefile.mingw32-cross-mpi index ab54c6e794..7badd3bb79 100644 --- a/src/MAKE/MACHINES/Makefile.mingw32-cross-mpi +++ b/src/MAKE/MACHINES/Makefile.mingw32-cross-mpi @@ -31,12 +31,12 @@ LIBOBJDIR = /Obj_mingw32-mpi # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_SMALLSMALL -DLAMMPS_JPEG -DLAMMPS_PNG -DLAMMPS_XDR -DLAMMPS_GZIP -DLAMMPS_FFMPEG # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -49,18 +49,18 @@ MPI_PATH = -L../../tools/mingw-cross/mpich2-win32/lib MPI_LIB = -lmpi # FFT library -# see discussion in Section 2.2 (step 6) of manual +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library FFT_INC = -FFT_PATH = +FFT_PATH = FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library @@ -74,8 +74,8 @@ JPG_LIB = -ljpeg -lpng -lz # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -90,28 +90,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.mingw64-cross b/src/MAKE/MACHINES/Makefile.mingw64-cross index 21403dc630..66de4dedaf 100644 --- a/src/MAKE/MACHINES/Makefile.mingw64-cross +++ b/src/MAKE/MACHINES/Makefile.mingw64-cross @@ -31,12 +31,12 @@ LIBOBJDIR = /Obj_mingw64 # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_SMALLBIG -DLAMMPS_JPEG -DLAMMPS_PNG -DLAMMPS_XDR -DLAMMPS_GZIP -DLAMMPS_FFMPEG # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -49,7 +49,7 @@ MPI_PATH = -L../STUBS MPI_LIB = -lmpi_mingw64 # FFT library -# see discussion in Section 2.2 (step 6) of manual +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -60,7 +60,7 @@ FFT_PATH = FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library @@ -74,8 +74,8 @@ JPG_LIB = -ljpeg -lpng -lz # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -90,28 +90,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.mingw64-cross-mpi b/src/MAKE/MACHINES/Makefile.mingw64-cross-mpi index 084b51680f..40c52b6a73 100644 --- a/src/MAKE/MACHINES/Makefile.mingw64-cross-mpi +++ b/src/MAKE/MACHINES/Makefile.mingw64-cross-mpi @@ -31,12 +31,12 @@ LIBOBJDIR = /Obj_mingw64-mpi # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_SMALLBIG -DLAMMPS_JPEG -DLAMMPS_PNG -DLAMMPS_XDR -DLAMMPS_GZIP -DLAMMPS_FFMPEG # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -49,18 +49,18 @@ MPI_PATH = -L../../tools/mingw-cross/mpich2-win64/lib MPI_LIB = -lmpi # FFT library -# see discussion in Section 2.2 (step 6) of manual +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library FFT_INC = -FFT_PATH = +FFT_PATH = FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library @@ -74,8 +74,8 @@ JPG_LIB = -ljpeg -lpng -lz # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -90,28 +90,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.myrinet b/src/MAKE/MACHINES/Makefile.myrinet index 7cf09f30c7..82030fbeae 100644 --- a/src/MAKE/MACHINES/Makefile.myrinet +++ b/src/MAKE/MACHINES/Makefile.myrinet @@ -11,7 +11,7 @@ CCFLAGS = -O SHFLAGS = -fPIC DEPFLAGS = -M -LINK = G++ +LINK = g++ LINKFLAGS = -O LIB = SIZE = size @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -44,7 +44,7 @@ MPI_PATH = -L/opt/mpich-mx/lib -L/opt/mx/lib MPI_LIB = -lmpich -lmyriexpress # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -55,22 +55,22 @@ FFT_PATH = FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.power b/src/MAKE/MACHINES/Makefile.power index cbad7149df..d4d0f67fa5 100644 --- a/src/MAKE/MACHINES/Makefile.power +++ b/src/MAKE/MACHINES/Makefile.power @@ -27,12 +27,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -45,7 +45,7 @@ MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -56,22 +56,22 @@ FFT_PATH = -L/scr/oppe/LAMMPS/fftw-2.1.5/lib FFT_LIB = -lfftw # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -86,28 +86,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.redsky b/src/MAKE/MACHINES/Makefile.redsky index 8e943bbb78..461139e2e9 100644 --- a/src/MAKE/MACHINES/Makefile.redsky +++ b/src/MAKE/MACHINES/Makefile.redsky @@ -46,12 +46,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -64,33 +64,33 @@ MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -#FFT_INC = -DFFT_FFTW2 -I${FFTW_INCLUDE} -#FFT_PATH = -L${FFTW_LIB} -#FFT_LIB = -lfftw +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -105,28 +105,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.serial b/src/MAKE/MACHINES/Makefile.serial deleted file mode 100644 index 0c4515dcd1..0000000000 --- a/src/MAKE/MACHINES/Makefile.serial +++ /dev/null @@ -1,120 +0,0 @@ -# serial = RedHat Linux box, g++4, no MPI, no FFTs - -SHELL = /bin/sh - -# --------------------------------------------------------------------- -# compiler/linker settings -# specify flags and libraries needed for your compiler - -CC = g++ -CCFLAGS = -O -SHFLAGS = -fPIC -DEPFLAGS = -M - -LINK = g++ -LINKFLAGS = -O -LIB = -SIZE = size - -ARCHIVE = ar -ARFLAGS = -rc -SHLIBFLAGS = -shared - -# --------------------------------------------------------------------- -# LAMMPS-specific settings, all OPTIONAL -# specify settings for LAMMPS features you will use -# if you change any -D setting, do full re-compile after "make clean" - -# LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual - -LMP_INC = -DLAMMPS_GZIP - -# MPI library -# see discussion in Section 2.2 (step 5) of manual -# MPI wrapper compiler/linker can provide this info -# can point to dummy MPI library in src/STUBS as in Makefile.serial -# use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts -# INC = path for mpi.h, MPI compiler settings -# PATH = path for MPI library -# LIB = name of MPI library - -MPI_INC = -I../STUBS -MPI_PATH = -L../STUBS -MPI_LIB = -lmpi_stubs - -# FFT library -# see discussion in Section 2.2 (step 6) of manaul -# can be left blank to use provided KISS FFT library -# INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings -# PATH = path for FFT library -# LIB = name of FFT library - -FFT_INC = -FFT_PATH = -FFT_LIB = - -# JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual -# only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC -# INC = path(s) for jpeglib.h and/or png.h -# PATH = path(s) for JPEG library and/or PNG library -# LIB = name(s) of JPEG library and/or PNG library - -JPG_INC = -JPG_PATH = -JPG_LIB = - -# --------------------------------------------------------------------- -# build rules and dependencies -# do not edit this section - -include Makefile.package.settings -include Makefile.package - -EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) -EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) -EXTRA_LIB = $(PKG_LIB) $(MPI_LIB) $(FFT_LIB) $(JPG_LIB) $(PKG_SYSLIB) -EXTRA_CPP_DEPENDS = $(PKG_CPP_DEPENDS) -EXTRA_LINK_DEPENDS = $(PKG_LINK_DEPENDS) - -# Path to src files - -vpath %.cpp .. -vpath %.h .. - -# Link target - -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) - -# Library targets - -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) - -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) - -# Compilation rules - -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -# Individual dependencies - -depend : fastdep.exe $(SRC) - @./fastdep.exe $(EXTRA_INC) -- $^ > .depend || exit 1 - -fastdep.exe: ../DEPEND/fastdep.c - cc -O -o $@ $< - -sinclude .depend diff --git a/src/MAKE/MACHINES/Makefile.stampede b/src/MAKE/MACHINES/Makefile.stampede index ecd0810d1d..5966907d44 100644 --- a/src/MAKE/MACHINES/Makefile.stampede +++ b/src/MAKE/MACHINES/Makefile.stampede @@ -27,12 +27,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -45,7 +45,7 @@ MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -56,7 +56,7 @@ FFT_PATH = FFT_LIB = -L$(TACC_MKL_LIB) -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library @@ -70,12 +70,14 @@ JPG_LIB = -ljpeg # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) EXTRA_LIB = $(PKG_LIB) $(MPI_LIB) $(FFT_LIB) $(JPG_LIB) $(PKG_SYSLIB) +EXTRA_CPP_DEPENDS = $(PKG_CPP_DEPENDS) +EXTRA_LINK_DEPENDS = $(PKG_LINK_DEPENDS) # Path to src files @@ -84,30 +86,28 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules %.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< -%.d:%.cpp - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - # Individual dependencies depend : fastdep.exe $(SRC) diff --git a/src/MAKE/MACHINES/Makefile.storm b/src/MAKE/MACHINES/Makefile.storm index e5e379e5ce..3178d840e9 100644 --- a/src/MAKE/MACHINES/Makefile.storm +++ b/src/MAKE/MACHINES/Makefile.storm @@ -27,12 +27,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -45,33 +45,33 @@ MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -DFFT_FFTW2 -I/projects/fftw/fftw-2.1.5/include -FFT_PATH = -FFT_LIB = -lfftw +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -86,28 +86,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.tacc b/src/MAKE/MACHINES/Makefile.tacc index f684c19ecf..2cf263a8db 100644 --- a/src/MAKE/MACHINES/Makefile.tacc +++ b/src/MAKE/MACHINES/Makefile.tacc @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -44,36 +44,33 @@ MPI_PATH = MPI_LIB = -lmpich -lpthread # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFTW_INC = ${TACC_FFTW2_INC} -FFTW_LIB = ${TACC_FFTW2_LIB} - -FFT_INC = -DFFT_FFTW2 -I${FFTW_INC} -FFT_PATH = -L${FFTW_LIB} -FFT_LIB = ${FFTW_LIB}/libfftw.a +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -88,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.theta b/src/MAKE/MACHINES/Makefile.theta index 663f212020..52f8260711 100644 --- a/src/MAKE/MACHINES/Makefile.theta +++ b/src/MAKE/MACHINES/Makefile.theta @@ -30,12 +30,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP #-DLAMMPS_JPEG # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -48,7 +48,7 @@ MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -60,7 +60,7 @@ FFT_LIB = -L$(MKLROOT)/lib/intel64/ -Wl,--start-group -lmkl_intel_ilp64 \ -lmkl_intel_thread -lmkl_core -Wl,--end-group # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library @@ -80,6 +80,8 @@ include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) EXTRA_LIB = $(PKG_LIB) $(MPI_LIB) $(FFT_LIB) $(JPG_LIB) $(PKG_SYSLIB) +EXTRA_CPP_DEPENDS = $(PKG_CPP_DEPENDS) +EXTRA_LINK_DEPENDS = $(PKG_LINK_DEPENDS) # Path to src files @@ -88,30 +90,28 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules %.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< -%.d:%.cpp - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - # Individual dependencies depend : fastdep.exe $(SRC) diff --git a/src/MAKE/MACHINES/Makefile.ubuntu b/src/MAKE/MACHINES/Makefile.ubuntu index f274780f8e..2764f457a7 100644 --- a/src/MAKE/MACHINES/Makefile.ubuntu +++ b/src/MAKE/MACHINES/Makefile.ubuntu @@ -30,12 +30,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP -DLAMMPS_JPEG -DLAMMPS_PNG -DLAMMPS_FFMPEG # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -48,7 +48,7 @@ MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -59,7 +59,7 @@ FFT_PATH = FFT_LIB = -lfftw3 # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library @@ -73,8 +73,8 @@ JPG_LIB = -ljpeg -lpng # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -89,28 +89,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.ubuntu_simple b/src/MAKE/MACHINES/Makefile.ubuntu_simple index d4ac53a145..e162830ec5 100644 --- a/src/MAKE/MACHINES/Makefile.ubuntu_simple +++ b/src/MAKE/MACHINES/Makefile.ubuntu_simple @@ -29,12 +29,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -42,38 +42,38 @@ LMP_INC = -DLAMMPS_GZIP # PATH = path for MPI library # LIB = name of MPI library -MPI_INC = -MPI_PATH = +MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 +MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library FFT_INC = -FFT_PATH = +FFT_PATH = FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = +JPG_INC = +JPG_PATH = JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -88,28 +88,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.white b/src/MAKE/MACHINES/Makefile.white index 42daf850f3..b07e14a30e 100644 --- a/src/MAKE/MACHINES/Makefile.white +++ b/src/MAKE/MACHINES/Makefile.white @@ -1,4 +1,4 @@ -# kokkos_cuda = KOKKOS/CUDA package, OpenMPI with nvcc compiler, Kepler GPU +# white = KOKKOS/CUDA package, OpenMPI with nvcc compiler, Pascal GPU, Power8 CPU SHELL = /bin/sh @@ -30,12 +30,12 @@ KOKKOS_ARCH = Pascal60,Power8 # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -48,33 +48,33 @@ MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -FFT_PATH = -FFT_LIB = +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -89,28 +89,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.xe6 b/src/MAKE/MACHINES/Makefile.xe6 index 6b8b9595bf..0971965bbf 100644 --- a/src/MAKE/MACHINES/Makefile.xe6 +++ b/src/MAKE/MACHINES/Makefile.xe6 @@ -27,12 +27,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -45,33 +45,33 @@ MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -DFFT_FFTW2 -FFT_PATH = -FFT_LIB = -lfftw +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -86,28 +86,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.xt3 b/src/MAKE/MACHINES/Makefile.xt3 index 615bad3611..5752e61692 100644 --- a/src/MAKE/MACHINES/Makefile.xt3 +++ b/src/MAKE/MACHINES/Makefile.xt3 @@ -28,12 +28,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP -DLAMMPS_XDR # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -46,33 +46,33 @@ MPI_PATH = MPI_LIB = -lmpich -lpthread # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -DFFT_FFTW2 -I$(FFTW_INC) -FFT_PATH = -L$(FFTW_LIB) -FFT_LIB = -ldfftw +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -87,28 +87,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.xt5 b/src/MAKE/MACHINES/Makefile.xt5 index 2552a7060a..9c4cbe6ee6 100644 --- a/src/MAKE/MACHINES/Makefile.xt5 +++ b/src/MAKE/MACHINES/Makefile.xt5 @@ -27,12 +27,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -45,33 +45,33 @@ MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -DFFT_FFTW2 -I/home/sjplimp/fftw/fftw -FFT_PATH = -L/home/sjplimp/fftw/fftw/.libs -FFT_LIB = -lfftw +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -86,28 +86,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/MACHINES/Makefile.bgq.details b/src/MAKE/MACHINES/bgq.make.details similarity index 93% rename from src/MAKE/MACHINES/Makefile.bgq.details rename to src/MAKE/MACHINES/bgq.make.details index be20b43880..0febd69d26 100644 --- a/src/MAKE/MACHINES/Makefile.bgq.details +++ b/src/MAKE/MACHINES/bgq.make.details @@ -74,12 +74,12 @@ SHLIBFLAGS = # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -95,7 +95,7 @@ MPI_INC += -DMPICH_SKIP_MPICXX MPI_LIB += #/home/jhammond/OSPRI/branches/marpn/wrap/libmpiarbrpn.a # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -106,15 +106,15 @@ FFT_PATH = #/soft/libraries/alcf/current/xl/FFTW2 FFT_LIB = -L/soft/libraries/alcf/current/xl/FFTW2/lib -ldfftw # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = depend : fastdep.exe $(SRC) @./fastdep.exe $(EXTRA_INC) -- $^ > .depend || exit 1 diff --git a/src/MAKE/MINE/... b/src/MAKE/MINE/... new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/MAKE/Makefile.mpi b/src/MAKE/Makefile.mpi index 3be2e20f95..b79cfbb3fd 100644 --- a/src/MAKE/Makefile.mpi +++ b/src/MAKE/Makefile.mpi @@ -40,37 +40,37 @@ LMP_INC = -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 # -DLAMMPS_CXX98 # LIB = name of MPI library MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -MPI_PATH = -MPI_LIB = +MPI_PATH = +MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manual +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -FFT_PATH = -FFT_LIB = +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,18 +85,22 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules diff --git a/src/MAKE/Makefile.serial b/src/MAKE/Makefile.serial index 86ddd05053..01a160df33 100644 --- a/src/MAKE/Makefile.serial +++ b/src/MAKE/Makefile.serial @@ -44,7 +44,7 @@ MPI_PATH = -L../STUBS MPI_LIB = -lmpi_stubs # FFT library -# see discussion in Section 2.2 (step 6) of manual +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -55,7 +55,7 @@ FFT_PATH = FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library @@ -69,8 +69,8 @@ JPG_LIB = # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,18 +85,22 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules diff --git a/src/MAKE/OPTIONS/Makefile.big b/src/MAKE/OPTIONS/Makefile.big index 59de28cad7..56b0c48249 100644 --- a/src/MAKE/OPTIONS/Makefile.big +++ b/src/MAKE/OPTIONS/Makefile.big @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP -DLAMMPS_BIGBIG # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -40,37 +40,37 @@ LMP_INC = -DLAMMPS_GZIP -DLAMMPS_BIGBIG # LIB = name of MPI library MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -MPI_PATH = -MPI_LIB = +MPI_PATH = +MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manual +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -FFT_PATH = -FFT_LIB = +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.fftw b/src/MAKE/OPTIONS/Makefile.fftw index 75c3a1b92c..1abb96f6dd 100644 --- a/src/MAKE/OPTIONS/Makefile.fftw +++ b/src/MAKE/OPTIONS/Makefile.fftw @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -40,11 +40,11 @@ LMP_INC = -DLAMMPS_GZIP # LIB = name of MPI library MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -MPI_PATH = -MPI_LIB = +MPI_PATH = +MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manual +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -55,22 +55,22 @@ FFT_PATH = -L/usr/local/lib FFT_LIB = -lfftw3 # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.g++_mpich b/src/MAKE/OPTIONS/Makefile.g++_mpich index 83b63b9def..fa30f64f0b 100644 --- a/src/MAKE/OPTIONS/Makefile.g++_mpich +++ b/src/MAKE/OPTIONS/Makefile.g++_mpich @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -40,37 +40,37 @@ LMP_INC = -DLAMMPS_GZIP # LIB = name of MPI library MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -MPI_PATH = -MPI_LIB = +MPI_PATH = +MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -FFT_PATH = -FFT_LIB = +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.g++_mpich_link b/src/MAKE/OPTIONS/Makefile.g++_mpich_link index aadbf30853..42d66b2317 100644 --- a/src/MAKE/OPTIONS/Makefile.g++_mpich_link +++ b/src/MAKE/OPTIONS/Makefile.g++_mpich_link @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -44,33 +44,33 @@ MPI_PATH = -L/usr/local/lib MPI_LIB = -lmpich -lmpl -lpthread # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -FFT_PATH = -FFT_LIB = +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.g++_openmpi b/src/MAKE/OPTIONS/Makefile.g++_openmpi index 835bb5d024..f52aa49ad7 100644 --- a/src/MAKE/OPTIONS/Makefile.g++_openmpi +++ b/src/MAKE/OPTIONS/Makefile.g++_openmpi @@ -27,12 +27,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -41,37 +41,37 @@ LMP_INC = -DLAMMPS_GZIP # LIB = name of MPI library MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -MPI_PATH = -MPI_LIB = +MPI_PATH = +MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -FFT_PATH = -FFT_LIB = +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -86,28 +86,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.g++_openmpi_link b/src/MAKE/OPTIONS/Makefile.g++_openmpi_link index f3f565430d..0aaa8bbede 100644 --- a/src/MAKE/OPTIONS/Makefile.g++_openmpi_link +++ b/src/MAKE/OPTIONS/Makefile.g++_openmpi_link @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -44,33 +44,33 @@ MPI_PATH = -L/usr/local/lib MPI_LIB = -lmpi -lmpi_cxx # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -FFT_PATH = -FFT_LIB = +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.g++_serial b/src/MAKE/OPTIONS/Makefile.g++_serial index a01e4cae93..93e1c502d9 100644 --- a/src/MAKE/OPTIONS/Makefile.g++_serial +++ b/src/MAKE/OPTIONS/Makefile.g++_serial @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -44,33 +44,33 @@ MPI_PATH = -L../STUBS MPI_LIB = -lmpi_stubs # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -FFT_PATH = -FFT_LIB = +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.gpu b/src/MAKE/OPTIONS/Makefile.gpu index e822161c55..7cec50fbd8 100644 --- a/src/MAKE/OPTIONS/Makefile.gpu +++ b/src/MAKE/OPTIONS/Makefile.gpu @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -40,37 +40,37 @@ LMP_INC = -DLAMMPS_GZIP # LIB = name of MPI library MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -MPI_PATH = -MPI_LIB = +MPI_PATH = +MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manual +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -FFT_PATH = -FFT_LIB = +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.icc_mpich b/src/MAKE/OPTIONS/Makefile.icc_mpich index e59066562a..81256f85b6 100644 --- a/src/MAKE/OPTIONS/Makefile.icc_mpich +++ b/src/MAKE/OPTIONS/Makefile.icc_mpich @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -40,37 +40,37 @@ LMP_INC = -DLAMMPS_GZIP # LIB = name of MPI library MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -MPI_PATH = -MPI_LIB = +MPI_PATH = +MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -FFT_PATH = -FFT_LIB = +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.icc_mpich_link b/src/MAKE/OPTIONS/Makefile.icc_mpich_link index 0e9e530f88..5a8ae8b228 100644 --- a/src/MAKE/OPTIONS/Makefile.icc_mpich_link +++ b/src/MAKE/OPTIONS/Makefile.icc_mpich_link @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -44,33 +44,33 @@ MPI_PATH = -L/usr/local/lib MPI_LIB = -lmpich -lmpl -lpthread # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -FFT_PATH = -FFT_LIB = +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.icc_openmpi b/src/MAKE/OPTIONS/Makefile.icc_openmpi index 19a917e928..1ed258e717 100644 --- a/src/MAKE/OPTIONS/Makefile.icc_openmpi +++ b/src/MAKE/OPTIONS/Makefile.icc_openmpi @@ -27,12 +27,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -41,37 +41,37 @@ LMP_INC = -DLAMMPS_GZIP # LIB = name of MPI library MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -MPI_PATH = -MPI_LIB = +MPI_PATH = +MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -FFT_PATH = -FFT_LIB = +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -86,28 +86,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.icc_openmpi_link b/src/MAKE/OPTIONS/Makefile.icc_openmpi_link index 5e991c6b90..33a5c529b8 100644 --- a/src/MAKE/OPTIONS/Makefile.icc_openmpi_link +++ b/src/MAKE/OPTIONS/Makefile.icc_openmpi_link @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -44,33 +44,33 @@ MPI_PATH = -L/usr/local/lib MPI_LIB = -lmpi -lmpi_cxx # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -FFT_PATH = -FFT_LIB = +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.icc_serial b/src/MAKE/OPTIONS/Makefile.icc_serial index 34bf091932..6880e9e2dc 100644 --- a/src/MAKE/OPTIONS/Makefile.icc_serial +++ b/src/MAKE/OPTIONS/Makefile.icc_serial @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -44,33 +44,33 @@ MPI_PATH = -L../STUBS MPI_LIB = -lmpi_stubs # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -FFT_PATH = -FFT_LIB = +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.intel_coprocessor b/src/MAKE/OPTIONS/Makefile.intel_coprocessor index 44f5c99f70..7964b1303e 100644 --- a/src/MAKE/OPTIONS/Makefile.intel_coprocessor +++ b/src/MAKE/OPTIONS/Makefile.intel_coprocessor @@ -1,4 +1,4 @@ -# intel_phi = USER-INTEL package with Phi offload support, Intel MPI, MKL FFT +# intel_coprocessor = USER-INTEL package with Phi offload support, Intel MPI, MKL FFT SHELL = /bin/sh @@ -29,12 +29,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP -DLAMMPS_JPEG # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -43,11 +43,11 @@ LMP_INC = -DLAMMPS_GZIP -DLAMMPS_JPEG # LIB = name of MPI library MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -MPI_PATH = +MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -58,7 +58,7 @@ FFT_PATH = FFT_LIB = -L$(MKLROOT)/lib/intel64/ -lmkl_intel_ilp64 -lmkl_sequential -lmkl_core # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library @@ -72,8 +72,8 @@ JPG_LIB = -ljpeg # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -88,28 +88,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.intel_cpu b/src/MAKE/OPTIONS/Makefile.intel_cpu index f52b4f3029..8d887a0d7b 100644 --- a/src/MAKE/OPTIONS/Makefile.intel_cpu +++ b/src/MAKE/OPTIONS/Makefile.intel_cpu @@ -1,4 +1,4 @@ -# intel_cpu_intelmpi = USER-INTEL package, Intel MPI, MKL FFT +# intel_cpu = USER-INTEL package, Intel MPI, MKL FFT SHELL = /bin/sh @@ -30,12 +30,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP -DLAMMPS_JPEG # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -44,11 +44,11 @@ LMP_INC = -DLAMMPS_GZIP -DLAMMPS_JPEG # LIB = name of MPI library MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -MPI_PATH = +MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -59,7 +59,7 @@ FFT_PATH = FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library @@ -73,8 +73,8 @@ JPG_LIB = -ljpeg # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -89,28 +89,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.intel_cpu_intelmpi b/src/MAKE/OPTIONS/Makefile.intel_cpu_intelmpi index 07d720a592..f085aac55a 100644 --- a/src/MAKE/OPTIONS/Makefile.intel_cpu_intelmpi +++ b/src/MAKE/OPTIONS/Makefile.intel_cpu_intelmpi @@ -30,12 +30,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -48,7 +48,7 @@ MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -59,22 +59,22 @@ FFT_PATH = FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -89,28 +89,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.intel_cpu_mpich b/src/MAKE/OPTIONS/Makefile.intel_cpu_mpich index 51cf975e5c..7f6b687334 100644 --- a/src/MAKE/OPTIONS/Makefile.intel_cpu_mpich +++ b/src/MAKE/OPTIONS/Makefile.intel_cpu_mpich @@ -30,12 +30,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -48,7 +48,7 @@ MPI_PATH = -L/usr/local/lib MPI_LIB = -lmpich -lmpl -lpthread # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -73,8 +73,8 @@ JPG_LIB = # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -89,28 +89,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.intel_cpu_openmpi b/src/MAKE/OPTIONS/Makefile.intel_cpu_openmpi index 342637a460..5401101546 100644 --- a/src/MAKE/OPTIONS/Makefile.intel_cpu_openmpi +++ b/src/MAKE/OPTIONS/Makefile.intel_cpu_openmpi @@ -31,12 +31,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -49,7 +49,7 @@ MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -60,22 +60,22 @@ FFT_PATH = FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -90,28 +90,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.jpeg b/src/MAKE/OPTIONS/Makefile.jpeg index f74a2eb1f7..7d4e029033 100644 --- a/src/MAKE/OPTIONS/Makefile.jpeg +++ b/src/MAKE/OPTIONS/Makefile.jpeg @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP -DLAMMPS_JPEG # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -40,22 +40,22 @@ LMP_INC = -DLAMMPS_GZIP -DLAMMPS_JPEG # LIB = name of MPI library MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -MPI_PATH = -MPI_LIB = +MPI_PATH = +MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manual +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -FFT_PATH = -FFT_LIB = +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library @@ -69,8 +69,8 @@ JPG_LIB = -ljpeg # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.knl b/src/MAKE/OPTIONS/Makefile.knl index ab1b756a67..92030fb953 100644 --- a/src/MAKE/OPTIONS/Makefile.knl +++ b/src/MAKE/OPTIONS/Makefile.knl @@ -29,12 +29,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP -DLAMMPS_JPEG # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -43,11 +43,11 @@ LMP_INC = -DLAMMPS_GZIP -DLAMMPS_JPEG # LIB = name of MPI library MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -MPI_PATH = +MPI_PATH = MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -58,7 +58,7 @@ FFT_PATH = FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library @@ -72,12 +72,14 @@ JPG_LIB = -ljpeg # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) EXTRA_LIB = $(PKG_LIB) $(MPI_LIB) $(FFT_LIB) $(JPG_LIB) $(PKG_SYSLIB) +EXTRA_CPP_DEPENDS = $(PKG_CPP_DEPENDS) +EXTRA_LINK_DEPENDS = $(PKG_LINK_DEPENDS) # Path to src files @@ -86,30 +88,28 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules %.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< -%.d:%.cpp - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - # Individual dependencies depend : fastdep.exe $(SRC) diff --git a/src/MAKE/OPTIONS/Makefile.kokkos_cuda_mpi b/src/MAKE/OPTIONS/Makefile.kokkos_cuda_mpi index ba34bc25eb..b9b262ed1d 100644 --- a/src/MAKE/OPTIONS/Makefile.kokkos_cuda_mpi +++ b/src/MAKE/OPTIONS/Makefile.kokkos_cuda_mpi @@ -31,7 +31,7 @@ KOKKOS_ARCH = Kepler35 # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP @@ -45,11 +45,11 @@ LMP_INC = -DLAMMPS_GZIP # LIB = name of MPI library MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -MPI_PATH = -MPI_LIB = +MPI_PATH = +MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -60,22 +60,22 @@ FFT_PATH = FFT_LIB = -lcufft # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -90,28 +90,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.kokkos_mpi_only b/src/MAKE/OPTIONS/Makefile.kokkos_mpi_only index 7aea2f366a..8cc4375b59 100644 --- a/src/MAKE/OPTIONS/Makefile.kokkos_mpi_only +++ b/src/MAKE/OPTIONS/Makefile.kokkos_mpi_only @@ -27,12 +27,12 @@ KOKKOS_DEVICES = Serial # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -41,37 +41,37 @@ LMP_INC = -DLAMMPS_GZIP # LIB = name of MPI library MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -MPI_PATH = -MPI_LIB = +MPI_PATH = +MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manual +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -FFT_PATH = -FFT_LIB = +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -86,28 +86,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.kokkos_omp b/src/MAKE/OPTIONS/Makefile.kokkos_omp index d0e12796c0..750751b73c 100644 --- a/src/MAKE/OPTIONS/Makefile.kokkos_omp +++ b/src/MAKE/OPTIONS/Makefile.kokkos_omp @@ -27,12 +27,12 @@ KOKKOS_DEVICES = OpenMP # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -41,37 +41,37 @@ LMP_INC = -DLAMMPS_GZIP # LIB = name of MPI library MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -MPI_PATH = -MPI_LIB = +MPI_PATH = +MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manual +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -FFT_PATH = -FFT_LIB = +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -86,28 +86,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.kokkos_phi b/src/MAKE/OPTIONS/Makefile.kokkos_phi index 7dc0bb091a..4e85b9e5b8 100644 --- a/src/MAKE/OPTIONS/Makefile.kokkos_phi +++ b/src/MAKE/OPTIONS/Makefile.kokkos_phi @@ -28,12 +28,12 @@ KOKKOS_ARCH = KNL # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -42,37 +42,37 @@ LMP_INC = -DLAMMPS_GZIP # LIB = name of MPI library MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -MPI_PATH = -MPI_LIB = +MPI_PATH = +MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manual +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -FFT_PATH = -FFT_LIB = +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -87,39 +87,34 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies -#depend : fastdep.exe $(SRC) -# @./fastdep.exe $(EXTRA_INC) -- $^ > .depend || exit 1 +depend : fastdep.exe $(SRC) + @./fastdep.exe $(EXTRA_INC) -- $^ > .depend || exit 1 -#fastdep.exe: ../DEPEND/fastdep.c -# cc -O -o $@ $< +fastdep.exe: ../DEPEND/fastdep.c + cc -O -o $@ $< -#sinclude .depend - -DEPENDS = $(OBJ:.o=.d) -sinclude $(DEPENDS) \ No newline at end of file +sinclude .depend diff --git a/src/MAKE/OPTIONS/Makefile.mgptfast b/src/MAKE/OPTIONS/Makefile.mgptfast index ed27993706..6baae1e2ee 100644 --- a/src/MAKE/OPTIONS/Makefile.mgptfast +++ b/src/MAKE/OPTIONS/Makefile.mgptfast @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -40,37 +40,37 @@ LMP_INC = -DLAMMPS_GZIP # LIB = name of MPI library MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -MPI_PATH = -MPI_LIB = +MPI_PATH = +MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manual +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -FFT_PATH = -FFT_LIB = +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.omp b/src/MAKE/OPTIONS/Makefile.omp index fd485d5416..80afad79ae 100644 --- a/src/MAKE/OPTIONS/Makefile.omp +++ b/src/MAKE/OPTIONS/Makefile.omp @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -40,37 +40,37 @@ LMP_INC = -DLAMMPS_GZIP # LIB = name of MPI library MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -MPI_PATH = -MPI_LIB = +MPI_PATH = +MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manual +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -FFT_PATH = -FFT_LIB = +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.opt b/src/MAKE/OPTIONS/Makefile.opt index 29903565dc..662f25eee6 100644 --- a/src/MAKE/OPTIONS/Makefile.opt +++ b/src/MAKE/OPTIONS/Makefile.opt @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -40,37 +40,37 @@ LMP_INC = -DLAMMPS_GZIP # LIB = name of MPI library MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -MPI_PATH = -MPI_LIB = +MPI_PATH = +MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manual +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -FFT_PATH = -FFT_LIB = +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.pgi_mpich_link b/src/MAKE/OPTIONS/Makefile.pgi_mpich_link index 444a2ffc12..57101c55ae 100644 --- a/src/MAKE/OPTIONS/Makefile.pgi_mpich_link +++ b/src/MAKE/OPTIONS/Makefile.pgi_mpich_link @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -44,33 +44,33 @@ MPI_PATH = -L/usr/local/mpich-1.2.6/pg/lib MPI_LIB = -lmpich # FFT library -# see discussion in Section 2.2 (step 6) of manaul +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library -FFT_INC = -FFT_PATH = -FFT_LIB = +FFT_INC = +FFT_PATH = +FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library # LIB = name(s) of JPEG library and/or PNG library -JPG_INC = -JPG_PATH = -JPG_LIB = +JPG_INC = +JPG_PATH = +JPG_LIB = # --------------------------------------------------------------------- # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/MAKE/OPTIONS/Makefile.png b/src/MAKE/OPTIONS/Makefile.png index 34b54dfb93..442dddeb66 100644 --- a/src/MAKE/OPTIONS/Makefile.png +++ b/src/MAKE/OPTIONS/Makefile.png @@ -26,12 +26,12 @@ SHLIBFLAGS = -shared # if you change any -D setting, do full re-compile after "make clean" # LAMMPS ifdef settings -# see possible settings in Section 2.2 (step 4) of manual +# see possible settings in Section 3.5 of the manual LMP_INC = -DLAMMPS_GZIP -DLAMMPS_PNG # MPI library -# see discussion in Section 2.2 (step 5) of manual +# see discussion in Section 3.4 of the manual # MPI wrapper compiler/linker can provide this info # can point to dummy MPI library in src/STUBS as in Makefile.serial # use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts @@ -40,11 +40,11 @@ LMP_INC = -DLAMMPS_GZIP -DLAMMPS_PNG # LIB = name of MPI library MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -MPI_PATH = -MPI_LIB = +MPI_PATH = +MPI_LIB = # FFT library -# see discussion in Section 2.2 (step 6) of manual +# see discussion in Section 3.5.2 of manual # can be left blank to use provided KISS FFT library # INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings # PATH = path for FFT library @@ -55,7 +55,7 @@ FFT_PATH = FFT_LIB = # JPEG and/or PNG library -# see discussion in Section 2.2 (step 7) of manual +# see discussion in Section 3.5.4 of manual # only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC # INC = path(s) for jpeglib.h and/or png.h # PATH = path(s) for JPEG library and/or PNG library @@ -69,8 +69,8 @@ JPG_LIB = -lpng # build rules and dependencies # do not edit this section -include Makefile.package.settings -include Makefile.package +include Makefile.package.settings +include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) @@ -85,28 +85,26 @@ vpath %.h .. # Link target -$(EXE): $(OBJ) $(EXTRA_LINK_DEPENDS) - $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE) - $(SIZE) $(EXE) +$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS) + $(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@ + $(SIZE) $@ # Library targets -lib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) +$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ) + @rm -f $(ARLIB) + @ln -s ../$(ARLIB) $(ARLIB) -shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \ - $(OBJ) $(EXTRA_LIB) $(LIB) +$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS) + $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \ + $(OBJ) $(EXTRA_LIB) $(LIB) + @rm -f $(SHLIB) + @ln -s ../$(SHLIB) $(SHLIB) # Compilation rules -%.o:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< - -%.d:%.cpp $(EXTRA_CPP_DEPENDS) - $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ - -%.o:%.cu $(EXTRA_CPP_DEPENDS) +%.o:%.cpp $(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $< # Individual dependencies diff --git a/src/Makefile b/src/Makefile index bce5089500..a78068e092 100644 --- a/src/Makefile +++ b/src/Makefile @@ -7,38 +7,31 @@ PYTHON = python # Definitions -ROOT = lmp -EXE = lmp_$@ +ROOT = lmp +EXE = lmp_$@ ARLIB = liblammps_$@.a -SHLIB = liblammps_$@.so +SHLIB = liblammps_$@.so ARLINK = liblammps.a SHLINK = liblammps.so TMPNAME= tmp_$@_name +LMPLINK=$(shell echo $(ARLIB) | sed -e 's,lib\([+0-9a-z_-]\+\)\.a$$,-L. -l\1,') OBJDIR = Obj_$@ OBJSHDIR = Obj_shared_$@ -SRC = $(wildcard *.cpp) -INC = $(filter-out lmpinstalledpkgs.h lmpgitversion.h,$(wildcard *.h)) -OBJ = $(SRC:.cpp=.o) +SRC = $(wildcard *.cpp) +INC = $(filter-out lmpinstalledpkgs.h lmpgitversion.h,$(wildcard *.h)) +OBJ = $(SRC:.cpp=.o) SRCLIB = $(filter-out main.cpp,$(SRC)) OBJLIB = $(filter-out main.o,$(OBJ)) -# Command-line options for mode: exe (default), shexe, lib, shlib +# Command-line options for mode: static (default), shared, or print -mode = exe +mode = static objdir = $(OBJDIR) -ifeq ($(mode),shexe) -objdir = $(OBJSHDIR) -endif - -ifeq ($(mode),lib) -objdir = $(OBJDIR) -endif - -ifeq ($(mode),shlib) +ifeq ($(mode),shared) objdir = $(OBJSHDIR) endif @@ -124,12 +117,10 @@ help: @echo 'make lib-package args="..." download/build/install a package library' @echo 'make purge purge obsolete copies of source files' @echo '' - @echo 'make machine build LAMMPS for machine' - @echo 'make mode=lib machine build LAMMPS as static lib for machine' - @echo 'make mode=shlib machine build LAMMPS as shared lib for machine' - @echo 'make mode=shexe machine build LAMMPS as shared exe for machine' - @echo 'make makelist create Makefile.list used by old makes' - @echo 'make -f Makefile.list machine build LAMMPS for machine (old)' + @echo 'make machine build LAMMPS for machine with static library' + @echo 'make mode=static machine same as above' + @echo 'make mode=shared machine build LAMMPS for machine with shared library' + @echo 'make mode=print machine print compiler/linker flags' @echo '' @echo 'machine is one of these from src/MAKE:' @echo '' @@ -191,11 +182,9 @@ gitversion: mv ${TMPNAME}.lmpgitversion lmpgitversion.h || rm ${TMPNAME}.lmpgitversion ; \ else mv ${TMPNAME}.lmpgitversion lmpgitversion.h ; fi -# Build LAMMPS in one of 4 modes -# exe = exe with static compile in Obj_machine (default) -# shexe = exe with shared compile in Obj_shared_machine -# lib = static lib in Obj_machine -# shlib = shared lib in Obj_shared_machine +# Build LAMMPS in one of 2 modes +# static = static compile in Obj_machine (default) +# shared = shared compile in Obj_shared_machine .DEFAULT: @if [ $@ = "serial" ]; \ @@ -223,34 +212,39 @@ gitversion: @cp Makefile.package Makefile.package.settings $(objdir) @cd $(objdir); rm -f .depend; \ $(MAKE) $(MFLAGS) "SRC = $(SRC)" "INC = $(INC)" depend || : -ifeq ($(mode),exe) - @cd $(objdir); \ - $(MAKE) $(MFLAGS) "OBJ = $(OBJ)" "INC = $(INC)" "SHFLAGS =" \ - "EXE = ../$(EXE)" ../$(EXE) -endif -ifeq ($(mode),shexe) - @cd $(objdir); \ - $(MAKE) $(MFLAGS) "OBJ = $(OBJ)" "INC = $(INC)" \ - "EXE = ../$(EXE)" ../$(EXE) -endif -ifeq ($(mode),lib) + @rm -f $(ARLINK) $(SHLINK) $(EXE) +ifeq ($(mode),static) @cd $(objdir); \ $(MAKE) $(MFLAGS) "OBJ = $(OBJLIB)" "INC = $(INC)" "SHFLAGS =" \ - "EXE = ../$(ARLIB)" lib - @rm -f $(ARLINK) + "LMPLIB = $(ARLIB)" "ARLIB = $(ARLIB)" "SHLIB = $(SHLIB)" \ + "LMPLINK = $(LMPLINK)" "EXE = ../$(EXE)" ../$(EXE) @ln -s $(ARLIB) $(ARLINK) endif -ifeq ($(mode),shlib) +ifeq ($(mode),shared) @cd $(objdir); \ $(MAKE) $(MFLAGS) "OBJ = $(OBJLIB)" "INC = $(INC)" \ - "EXE = ../$(SHLIB)" shlib - @rm -f $(SHLINK) + "LMPLIB = $(SHLIB)" "ARLIB = $(ARLIB)" "SHLIB = $(SHLIB)" \ + "LMPLINK = $(LMPLINK)" "EXE = ../$(EXE)" ../$(EXE) @ln -s $(SHLIB) $(SHLINK) endif +# backward compatibility +ifeq ($(mode),exe) + $(MAKE) $(MFLAGS) mode=static $@ +endif +ifeq ($(mode),lib) + $(MAKE) $(MFLAGS) mode=static $@ +endif +ifeq ($(mode),shexe) + $(MAKE) $(MFLAGS) mode=shared $@ +endif +ifeq ($(mode),shlib) + $(MAKE) $(MFLAGS) mode=shared $@ +endif + ifeq ($(mode),print) @cd $(objdir); \ $(MAKE) $(MFLAGS) "OBJ = $(OBJLIB)" "INC = $(INC)" \ - "EXE = ../$(SHLIB)" -f ../Makefile.print + "EXE = ../$(ARLIB)" -f ../Makefile.print endif # Remove machine-specific object files @@ -267,12 +261,6 @@ clean-%: then cd STUBS; $(MAKE) clean; cd ..; fi rm -rf Obj_$(@:clean-%=%) Obj_shared_$(@:clean-%=%) -# Create Makefile.list - -makelist: - @$(SHELL) Make.sh style - @$(SHELL) Make.sh Makefile.list - # Make MPI STUBS library mpi-stubs: diff --git a/src/Makefile.print b/src/Makefile.print index 8398eb2589..d6e4976061 100644 --- a/src/Makefile.print +++ b/src/Makefile.print @@ -6,6 +6,7 @@ include Makefile # get location of the LAMMPS tree LMPDIR=$(shell echo $${PWD} | sed -e 's,/src/Obj_[+0-9a-z_-]\+$$,,') +LMPLIB=$(shell echo $(EXE) | sed -e 's,\.\./lib\([+0-9a-z_-]\+\)\.a$$,-L${LMPDIR}/src -l\1,') do-print: @echo '# LAMMPS source tree is in:' $(LMPDIR) @@ -18,5 +19,5 @@ do-print: @echo '# Linking: ' @echo LDFLAGS=$(LINKFLAGS) @echo '# Libraries: ' - @echo LDLIBS=$(EXTRA_PATH) $(EXTRA_LIB) $(LIB) | sed -e s,-L\\.\\./\\.\\./,-L${LMPDIR}/,g -e s,-L\\.\\./,-L${LMPDIR}/src/,g -e s,$(HOME),\\$$\\{HOME\\},g + @echo LDLIBS=$(LMPLIB) $(EXTRA_PATH) $(EXTRA_LIB) $(LIB) | sed -e s,-L\\.\\./\\.\\./,-L${LMPDIR}/,g -e s,-L\\.\\./,-L${LMPDIR}/src/,g -e s,$(HOME),\\$$\\{HOME\\},g diff --git a/tools/singularity/README.md b/tools/singularity/README.md index 9bd0c2fdcc..a01b1688b8 100644 --- a/tools/singularity/README.md +++ b/tools/singularity/README.md @@ -49,8 +49,11 @@ make | centos7.def | CentOS 7.x with EPEL enabled, no LaTeX | | centos8.def | CentOS 8.x with EPEL enabled | | fedora30_mingw.def | Fedora 30 with MinGW cross-compiler toolchain | +| fedora32_mingw.def | Fedora 32 with MinGW cross-compiler toolchain | | ubuntu16.04.def | Ubuntu 16.04LTS with MPI == OpenMPI, no LaTeX | | ubuntu18.04.def | Ubuntu 18.04LTS with MPI == OpenMPI | | ubuntu18.04_amd_rocm.def | Ubuntu 18.04LTS with AMD ROCm toolkit | +| ubuntu18.04_amd_rocm_cuda.def | Ubuntu 18.04LTS with -"- plus Nvidia CUDA 10.2 | | ubuntu18.04_nvidia.def | Ubuntu 18.04LTS with Nvidia CUDA 10.2 toolkit | | ubuntu18.04_intel_opencl.def | Ubuntu 18.04LTS with Intel OpenCL runtime | +| ubuntu20.04.def | Ubuntu 20.04LTS with MPI == OpenMPI | diff --git a/tools/singularity/centos7.def b/tools/singularity/centos7.def index e1ae6e6373..028823bc49 100644 --- a/tools/singularity/centos7.def +++ b/tools/singularity/centos7.def @@ -6,13 +6,17 @@ From: centos:7 yum -y update yum -y install vim-enhanced \ ccache gcc-c++ gcc-gfortran clang gdb valgrind-openmpi \ - make cmake cmake3 ninja-build patch which file git \ + make cmake cmake3 ninja-build patch which file git Lmod \ libpng-devel libjpeg-devel openmpi-devel mpich-devel python-devel \ python-virtualenv fftw-devel voro++-devel eigen3-devel gsl-devel openblas-devel enchant %environment LC_ALL=C export LC_ALL + unset LOADEDMODULES + . /etc/profile.d/z00_lmod.sh + module purge + module load mpi %labels Author akohlmey diff --git a/tools/singularity/centos8.def b/tools/singularity/centos8.def index 77a8964abb..fff96c5c4a 100644 --- a/tools/singularity/centos8.def +++ b/tools/singularity/centos8.def @@ -19,6 +19,10 @@ From: centos:8 %environment LC_ALL=C export LC_ALL + unset LOADEDMODULES + . /etc/profile.d/modules.sh + module purge + module load mpi %labels Author akohlmey diff --git a/tools/singularity/fedora30_mingw.def b/tools/singularity/fedora30_mingw.def index 2df658676c..ef83d8f0a7 100644 --- a/tools/singularity/fedora30_mingw.def +++ b/tools/singularity/fedora30_mingw.def @@ -36,6 +36,12 @@ From: fedora:30 %environment LC_ALL=C export LC_ALL + # we need to reset any module variables + # inherited from the host. + unset LOADEDMODULES + source /etc/profile.d/modules.sh + module purge + module load mpi %labels Author akohlmey diff --git a/tools/singularity/fedora32_mingw.def b/tools/singularity/fedora32_mingw.def new file mode 100644 index 0000000000..43d5659a19 --- /dev/null +++ b/tools/singularity/fedora32_mingw.def @@ -0,0 +1,47 @@ +BootStrap: docker +From: fedora:32 + +%post + dnf -y update + dnf -y install vim-enhanced git file make cmake patch which file Lmod \ + ninja-build clang libomp-devel libubsan libasan libtsan \ + dos2unix findutils rsync python-devel libjpeg-devel libpng-devel \ + ccache gcc-c++ gcc-gfortran gdb valgrind eigen3-devel openblas-devel \ + openmpi-devel mpich-devel fftw-devel voro++-devel gsl-devel \ + mingw-filesystem-base mingw32-nsis mingw-binutils-generic \ + mingw32-filesystem mingw32-pkg-config \ + mingw64-filesystem mingw64-pkg-config \ + mingw32-crt mingw32-headers mingw32-binutils \ + mingw64-crt mingw64-headers mingw64-binutils \ + mingw32-cpp mingw32-gcc mingw32-gcc-gfortran mingw32-gcc-c++ \ + mingw64-cpp mingw64-gcc mingw64-gcc-gfortran mingw64-gcc-c++ \ + mingw32-libgomp mingw64-libgomp \ + mingw32-winpthreads mingw64-winpthreads \ + mingw32-winpthreads-static mingw64-winpthreads-static \ + mingw32-eigen3 mingw64-eigen3 \ + mingw32-libjpeg-turbo mingw64-libjpeg-turbo \ + mingw32-libjpeg-turbo-static mingw64-libjpeg-turbo-static \ + mingw32-libpng mingw64-libpng \ + mingw32-libpng-static mingw64-libpng-static \ + mingw32-zlib mingw64-zlib \ + mingw32-zlib-static mingw64-zlib-static \ + mingw32-expat mingw64-expat \ + mingw64-expat-static mingw32-expat-static \ + mingw32-sqlite-static mingw64-sqlite-static \ + enchant python3-virtualenv doxygen \ + texlive-latex-fonts texlive-pslatex texlive-collection-latexrecommended \ + texlive-latex texlive-latexconfig doxygen-latex texlive-collection-latex \ + texlive-latex-bin texlive-lualatex-math texlive-fncychap texlive-tabulary \ + texlive-framed texlive-wrapfig texlive-upquote texlive-capt-of \ + texlive-needspace texlive-titlesec texlive-anysize texlive-dvipng + +%environment + LC_ALL=C + export LC_ALL + unset LOADEDMODULES + . /etc/profile.d/modules.sh + module purge + module load mpi + +%labels + Author akohlmey diff --git a/tools/singularity/ubuntu18.04_amd_rocm_cuda.def b/tools/singularity/ubuntu18.04_amd_rocm_cuda.def index 601969dc8b..3ef7813a20 100644 --- a/tools/singularity/ubuntu18.04_amd_rocm_cuda.def +++ b/tools/singularity/ubuntu18.04_amd_rocm_cuda.def @@ -9,7 +9,7 @@ From: lammps/default/lammps_development:ubuntu18.04_amd_rocm export LIBRARY_PATH=/usr/local/cuda/lib64/stubs %post - + export DEBIAN_FRONTEND=noninteractive wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub diff --git a/tools/singularity/ubuntu20.04.def b/tools/singularity/ubuntu20.04.def index 4ebc88447d..37c67b9373 100644 --- a/tools/singularity/ubuntu20.04.def +++ b/tools/singularity/ubuntu20.04.def @@ -29,6 +29,7 @@ From: ubuntu:20.04 libjpeg-dev \ liblapack-dev \ libopenblas-dev \ + libomp-dev \ libpng-dev \ libproj-dev \ libvtk6-dev \ @@ -45,7 +46,6 @@ From: ubuntu:20.04 ssh \ texlive \ texlive-latex-recommended \ - texlive-latex-extra \ texlive-pictures \ texlive-publishers \ texlive-science \