From 5fbb1fa3318db5b577e06a282cf49ee872e2fd28 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 19 Mar 2020 06:14:59 -0400 Subject: [PATCH 1/7] small tweak to MinGW preset and correct corresponding entry in documentation --- cmake/presets/mingw-cross.cmake | 6 ++++-- doc/src/Build_package.rst | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake/presets/mingw-cross.cmake b/cmake/presets/mingw-cross.cmake index 920b377e48..0e0bee033e 100644 --- a/cmake/presets/mingw-cross.cmake +++ b/cmake/presets/mingw-cross.cmake @@ -4,8 +4,8 @@ set(WIN_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-INTEL USER-MANIFOLD USER-MEAMC USER-MESO USER-MISC USER-MGPT USER-MOFFF USER-MOLFILE - USER-OMP USER-PHONON USER-PTM USER-QTB USER-REAXC USER-SDPD - USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF USER-YAFF) + USER-OMP USER-PHONON USER-PTM USER-QTB USER-REACTION USER-REAXC + USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF USER-YAFF) foreach(PKG ${WIN_PACKAGES}) set(PKG_${PKG} ON CACHE BOOL "" FORCE) @@ -14,4 +14,6 @@ endforeach() set(DOWNLOAD_VORO ON CACHE BOOL "" FORCE) set(DOWNLOAD_EIGEN3 ON CACHE BOOL "" FORCE) set(LAMMPS_MEMALIGN "0" CACHE STRING "" FORCE) +set(CMAKE_TUNE_FLAGS "" CACHE STRING "" FORCE) +set(BUILD_TOOLS ON CACHE BOOL "" FORCE) set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/lammps-installer") diff --git a/doc/src/Build_package.rst b/doc/src/Build_package.rst index dabe65ee0f..2e0bea723a 100644 --- a/doc/src/Build_package.rst +++ b/doc/src/Build_package.rst @@ -151,9 +151,9 @@ one of them as a starting point and customize it to your needs. cmake -C ../cmake/presets/nolib.cmake [OPTIONS] ../cmake # disable packages that do require extra libraries or tools cmake -C ../cmake/presets/clang.cmake [OPTIONS] ../cmake # change settings to use the Clang compilers by default cmake -C ../cmake/presets/intel.cmake [OPTIONS] ../cmake # change settings to use the Intel compilers by default - cmake -C ../cmake/presets/mingw.cmake [OPTIONS] ../cmake # enable packages compatible with MinGW compilers for Windows cmake -C ../cmake/presets/all_on.cmake [OPTIONS] ../cmake # enable all packages cmake -C ../cmake/presets/all_off.cmake [OPTIONS] ../cmake # disable all packages + mingw64-cmake -C ../cmake/presets/mingw-cross.cmake [OPTIONS] ../cmake # compile with MinGW cross compilers .. note:: From 3bd529342e6a6c4d5597740ff6d8313fc73d0d30 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 19 Mar 2020 08:06:37 -0400 Subject: [PATCH 2/7] cross-compilation improvements --- cmake/CMakeLists.txt | 4 ++-- cmake/Modules/Packages/KIM.cmake | 1 + cmake/Modules/Packages/MSCG.cmake | 1 + cmake/presets/mingw-cross.cmake | 16 +++++++++------- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 62829c44b6..6571924298 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -255,8 +255,8 @@ 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}) - set(BLAS_LIBRARIES linalg) - set(LAPACK_LIBRARIES linalg) + set(BLAS_LIBRARIES "${CMAKE_BINARY_DIR}/liblinalg.a") + set(LAPACK_LIBRARIES "${CMAKE_BINARY_DIR}/liblinalg.a") else() list(APPEND LAPACK_LIBRARIES ${BLAS_LIBRARIES}) endif() diff --git a/cmake/Modules/Packages/KIM.cmake b/cmake/Modules/Packages/KIM.cmake index bb68f8fef4..84d9ec9c71 100644 --- a/cmake/Modules/Packages/KIM.cmake +++ b/cmake/Modules/Packages/KIM.cmake @@ -49,6 +49,7 @@ if(PKG_KIM) -DCMAKE_INSTALL_PREFIX= -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} BUILD_BYPRODUCTS /${CMAKE_INSTALL_LIBDIR}/libkim-api${CMAKE_SHARED_LIBRARY_SUFFIX} ) ExternalProject_get_property(kim_build INSTALL_DIR) diff --git a/cmake/Modules/Packages/MSCG.cmake b/cmake/Modules/Packages/MSCG.cmake index b1cc6fad46..35f0c57449 100644 --- a/cmake/Modules/Packages/MSCG.cmake +++ b/cmake/Modules/Packages/MSCG.cmake @@ -23,6 +23,7 @@ if(PKG_MSCG) -DCMAKE_INSTALL_PREFIX= -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} BUILD_COMMAND ${CMAKE_COMMAND} --build . --target mscg INSTALL_COMMAND "" BUILD_BYPRODUCTS /libmscg.a diff --git a/cmake/presets/mingw-cross.cmake b/cmake/presets/mingw-cross.cmake index 0e0bee033e..41a0023e0b 100644 --- a/cmake/presets/mingw-cross.cmake +++ b/cmake/presets/mingw-cross.cmake @@ -1,11 +1,13 @@ set(WIN_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU - GRANULAR KSPACE MANYBODY MC MISC MOLECULE OPT PERI POEMS QEQ - REPLICA RIGID SHOCK SNAP SPIN SRD VORONOI USER-ATC USER-AWPMD - USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS USER-DIFFRACTION - USER-DPD USER-DRUDE USER-EFF USER-FEP USER-INTEL USER-MANIFOLD - USER-MEAMC USER-MESO USER-MISC USER-MGPT USER-MOFFF USER-MOLFILE - USER-OMP USER-PHONON USER-PTM USER-QTB USER-REACTION USER-REAXC - USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF USER-YAFF) + GRANULAR KSPACE LATTE MANYBODY MC MISC MOLECULE OPT PERI + POEMS QEQ REPLICA RIGID SHOCK SNAP SPIN SRD VORONOI + USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK + USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF + USER-FEP USER-INTEL USER-MANIFOLD USER-MEAMC USER-MESO + USER-MISC USER-MGPT USER-MOFFF USER-MOLFILE USER-OMP + USER-PHONON USER-PTM USER-QTB USER-REACTION USER-REAXC + USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF + USER-YAFF) foreach(PKG ${WIN_PACKAGES}) set(PKG_${PKG} ON CACHE BOOL "" FORCE) From b1af0a5bd86aaaefdac07e39644173da3c79eec1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 19 Mar 2020 08:56:59 -0400 Subject: [PATCH 3/7] add workaround in CMake support for building with MinGW cross-compilers --- cmake/Modules/Packages/KIM.cmake | 6 ++++-- cmake/Modules/Packages/LATTE.cmake | 13 +++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/cmake/Modules/Packages/KIM.cmake b/cmake/Modules/Packages/KIM.cmake index 84d9ec9c71..c1e52bd3e5 100644 --- a/cmake/Modules/Packages/KIM.cmake +++ b/cmake/Modules/Packages/KIM.cmake @@ -35,6 +35,8 @@ if(PKG_KIM) option(DOWNLOAD_KIM "Download KIM-API from OpenKIM instead of using an already installed one" ${DOWNLOAD_KIM_DEFAULT}) if(DOWNLOAD_KIM) message(STATUS "KIM-API download requested - we will build our own") + # Workaround for cross compilation with MinGW, which messes up ${CMAKE_INSTALL_LIBDIR} + string(REPLACE ${CMAKE_INSTALL_PREFIX} "" _KIM_LIBDIR ${CMAKE_INSTALL_LIBDIR}) include(ExternalProject) enable_language(C) enable_language(Fortran) @@ -50,11 +52,11 @@ if(PKG_KIM) -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} - BUILD_BYPRODUCTS /${CMAKE_INSTALL_LIBDIR}/libkim-api${CMAKE_SHARED_LIBRARY_SUFFIX} + BUILD_BYPRODUCTS /${_KIM_LIBDIR}/libkim-api${CMAKE_SHARED_LIBRARY_SUFFIX} ) ExternalProject_get_property(kim_build INSTALL_DIR) set(KIM-API_INCLUDE_DIRS ${INSTALL_DIR}/include/kim-api) - set(KIM-API_LDFLAGS ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libkim-api${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(KIM-API_LDFLAGS ${INSTALL_DIR}/${_KIM_LIBDIR}/libkim-api${CMAKE_SHARED_LIBRARY_SUFFIX}) list(APPEND LAMMPS_DEPS kim_build) else() find_package(KIM-API ${KIM-API_MIN_VERSION} REQUIRED) diff --git a/cmake/Modules/Packages/LATTE.cmake b/cmake/Modules/Packages/LATTE.cmake index bc89b00111..093c9b7f22 100644 --- a/cmake/Modules/Packages/LATTE.cmake +++ b/cmake/Modules/Packages/LATTE.cmake @@ -9,6 +9,8 @@ if(PKG_LATTE) option(DOWNLOAD_LATTE "Download the LATTE library instead of using an already installed one" ${DOWNLOAD_LATTE_DEFAULT}) if(DOWNLOAD_LATTE) message(STATUS "LATTE download requested - we will build our own") + # Workaround for cross compilation with MinGW, which messes up ${CMAKE_INSTALL_LIBDIR} + string(REPLACE ${CMAKE_INSTALL_PREFIX} "" _LATTE_LIBDIR ${CMAKE_INSTALL_LIBDIR}) include(ExternalProject) ExternalProject_Add(latte_build URL https://github.com/lanl/LATTE/archive/v1.2.1.tar.gz @@ -18,17 +20,20 @@ if(PKG_LATTE) -DBLAS_LIBRARIES=${BLAS_LIBRARIES} -DLAPACK_LIBRARIES=${LAPACK_LIBRARIES} -DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER} -DCMAKE_Fortran_FLAGS=${CMAKE_Fortran_FLAGS} -DCMAKE_Fortran_FLAGS_${BTYPE}=${CMAKE_Fortran_FLAGS_${BTYPE}} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} - BUILD_BYPRODUCTS /${CMAKE_INSTALL_LIBDIR}/liblatte.a + -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} + BUILD_BYPRODUCTS /${_LATTE_LIBDIR}/liblatte.a ) - ExternalProject_get_property(latte_build INSTALL_DIR) - set(LATTE_LIBRARIES ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/liblatte.a) list(APPEND LAMMPS_DEPS latte_build) + ExternalProject_get_property(latte_build INSTALL_DIR) + set(LATTE_LIBRARIES ${INSTALL_DIR}/${_LATTE_LIBDIR}/liblatte.a) else() find_package(LATTE) if(NOT LATTE_FOUND) message(FATAL_ERROR "LATTE library not found, help CMake to find it by setting LATTE_LIBRARY, or set DOWNLOAD_LATTE=ON to download it") endif() endif() + if(NOT LAPACK_FOUND) + add_dependencies(latte_build linalg) + endif() list(APPEND LAMMPS_LINK_LIBS ${LATTE_LIBRARIES} ${LAPACK_LIBRARIES}) endif() From 38edf20d084193d563a3ba78f3d2bef804494943 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 19 Mar 2020 10:46:42 -0400 Subject: [PATCH 4/7] add CMake support for building LAMMPS for windows with MPI - Handle the MPI support as an External project. - Also we can enable a few more packages now, that depend on MPI - Improved dependency tracking for parallel builds - cross compiler build can now also work with ninja --- cmake/CMakeLists.txt | 43 ++++++++++++++++++++++---------- cmake/Modules/MPI4WIN.cmake | 23 +++++++++++++++++ cmake/Modules/Packages/GPU.cmake | 6 +++++ cmake/presets/mingw-cross.cmake | 8 +++++- 4 files changed, 66 insertions(+), 14 deletions(-) create mode 100644 cmake/Modules/MPI4WIN.cmake diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 6571924298..a8b2a5661d 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -167,18 +167,25 @@ if(PKG_USER-ADIOS) list(APPEND LAMMPS_LINK_LIBS adios2::adios2) endif() -# do MPI detection after language activation, if MPI for these language is required +# do MPI detection after language activation, +# in case MPI for these languages is required set(MPI_CXX_SKIP_MPICXX TRUE) find_package(MPI QUIET) option(BUILD_MPI "Build MPI version" ${MPI_FOUND}) + if(BUILD_MPI) - find_package(MPI REQUIRED) - include_directories(${MPI_CXX_INCLUDE_PATH}) - add_definitions(-DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1) - list(APPEND LAMMPS_LINK_LIBS ${MPI_CXX_LIBRARIES}) - option(LAMMPS_LONGLONG_TO_LONG "Workaround if your system or MPI version does not recognize 'long long' data types" OFF) - if(LAMMPS_LONGLONG_TO_LONG) - add_definitions(-DLAMMPS_LONGLONG_TO_LONG) + # We use a non-standard procedure to compile with MPI on windows + if (CMAKE_SYSTEM_NAME STREQUAL Windows) + include(MPI4WIN) + else() + find_package(MPI REQUIRED) + include_directories(${MPI_CXX_INCLUDE_PATH}) + add_definitions(-DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1) + list(APPEND LAMMPS_LINK_LIBS ${MPI_CXX_LIBRARIES}) + option(LAMMPS_LONGLONG_TO_LONG "Workaround if your system or MPI version does not recognize 'long long' data types" OFF) + if(LAMMPS_LONGLONG_TO_LONG) + add_definitions(-DLAMMPS_LONGLONG_TO_LONG) + endif() endif() else() enable_language(C) @@ -335,11 +342,6 @@ include(Packages/MESSAGE) include(Packages/MSCG) include(Packages/COMPRESS) -# the windows version of LAMMPS requires a couple extra libraries -if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - list(APPEND LAMMPS_LINK_LIBS -lwsock32 -lpsapi) -endif() - set(CMAKE_TUNE_FLAGS "${CMAKE_TUNE_DEFAULT}" CACHE STRING "Compiler specific optimization or instrumentation") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_TUNE_FLAGS}") if(CMAKE_Fortran_FLAGS) @@ -428,6 +430,9 @@ 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(LAMMPS_USE_MPI4WIN) + add_dependencies(${PKG_LIB} mpi4win_build) + endif() list(APPEND LAMMPS_LINK_LIBS ${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) @@ -465,6 +470,18 @@ include(Packages/OPT) include(Packages/USER-INTEL) include(Packages/GPU) +###################################################################### +# the windows version of LAMMPS requires a couple extra libraries +# and the MPI library - if use - has to be linked right before those +# and after everything else that is compiled locally +###################################################################### +if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + if(LAMMPS_USE_MPI4WIN) + list(APPEND LAMMPS_LINK_LIBS ${MPI4WIN_LIBRARIES}) + endif() + list(APPEND LAMMPS_LINK_LIBS -lwsock32 -lpsapi) +endif() + ###################################################### # Generate style headers based on global list of # styles registered during package selection diff --git a/cmake/Modules/MPI4WIN.cmake b/cmake/Modules/MPI4WIN.cmake new file mode 100644 index 0000000000..1f3195041a --- /dev/null +++ b/cmake/Modules/MPI4WIN.cmake @@ -0,0 +1,23 @@ +# Download and configure custom MPICH files for Windows +message(STATUS "Downloading and configuring MPICH-1.4.1 for Windows") +include(ExternalProject) +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + ExternalProject_Add(mpi4win_build + URL https://download.lammps.org/thirdparty/mpich2-win64-devel.tar.gz + URL_MD5 4939fdb59d13182fd5dd65211e469f14 + CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" + BUILD_BYPRODUCTS /lib/libmpi.a) +else() + ExternalProject_Add(mpi4win_build + URL https://download.lammps.org/thirdparty/mpich2-win32-devel.tar.gz + URL_MD5 a61d153500dce44e21b755ee7257e031 + CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" + BUILD_BYPRODUCTS /lib/libmpi.a) +endif() + +ExternalProject_get_property(mpi4win_build SOURCE_DIR) +add_definitions(-DMPICH_SKIP_MPICXX) +include_directories("${SOURCE_DIR}/include") +set(MPI4WIN_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a") +list(APPEND LAMMPS_DEPS mpi4win_build) +set(LAMMPS_USE_MPI4WIN ON) diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index 200d8fb51e..abbcb1f495 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -108,6 +108,9 @@ if(PKG_GPU) endif() list(APPEND LAMMPS_LINK_LIBS gpu) + if(LAMMPS_USE_MPI4WIN) + add_dependencies(gpu mpi4win_build) + endif() add_executable(nvc_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp) target_compile_definitions(nvc_get_devices PRIVATE -DUCL_CUDADR) @@ -169,6 +172,9 @@ if(PKG_GPU) target_compile_definitions(gpu PRIVATE -DUSE_OPENCL) list(APPEND LAMMPS_LINK_LIBS gpu) + if(LAMMPS_USE_MPI4WIN) + add_dependencies(gpu mpi4win_build) + endif() add_executable(ocl_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp) target_compile_definitions(ocl_get_devices PRIVATE -DUCL_OPENCL) diff --git a/cmake/presets/mingw-cross.cmake b/cmake/presets/mingw-cross.cmake index 41a0023e0b..1285c3f262 100644 --- a/cmake/presets/mingw-cross.cmake +++ b/cmake/presets/mingw-cross.cmake @@ -3,7 +3,7 @@ set(WIN_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU POEMS QEQ REPLICA RIGID SHOCK SNAP SPIN SRD VORONOI USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF - USER-FEP USER-INTEL USER-MANIFOLD USER-MEAMC USER-MESO + USER-FEP USER-INTEL USER-MANIFOLD USER-MEAMC USER-MESODPD USER-MISC USER-MGPT USER-MOFFF USER-MOLFILE USER-OMP USER-PHONON USER-PTM USER-QTB USER-REACTION USER-REAXC USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF @@ -13,6 +13,12 @@ foreach(PKG ${WIN_PACKAGES}) set(PKG_${PKG} ON CACHE BOOL "" FORCE) endforeach() +# these two packages require a full MPI implementation +if(BUILD_MPI) + set(PKG_MPIIO ON CACHE BOOL "" FORCE) + set(PKG_USER-LB ON CACHE BOOL "" FORCE) +endif() + set(DOWNLOAD_VORO ON CACHE BOOL "" FORCE) set(DOWNLOAD_EIGEN3 ON CACHE BOOL "" FORCE) set(LAMMPS_MEMALIGN "0" CACHE STRING "" FORCE) From 3d0fc4a1121def79934c70185a8d122f439eb04d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 19 Mar 2020 11:09:27 -0400 Subject: [PATCH 5/7] update docs for updated CMake support with MinGW --- doc/src/Build_windows.rst | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/doc/src/Build_windows.rst b/doc/src/Build_windows.rst index 2b7bd27209..1ad9dee123 100644 --- a/doc/src/Build_windows.rst +++ b/doc/src/Build_windows.rst @@ -83,10 +83,16 @@ traditional build system, but CMake has also been successfully tested using the mingw32-cmake and mingw64-cmake wrappers that are bundled with the cross-compiler environment on Fedora machines. A CMake preset selecting all packages compatible with this cross-compilation build -is provided. You will likely need to disable the GPU package unless you -download and install the contents of the pre-compiled `OpenCL ICD loader library `_ -into your MinGW64 cross-compiler environment. The cross-compilation -currently will only produce non-MPI serial binaries. +is provided. The GPU package can only be compiled with OpenCL support +and you need to download and install the pre-compiled +`OpenCL ICD loader library `_ +into your MinGW64 cross-compiler environment. With CMake this will be +done transparently. To compile with MPI support, a pre-compiled +library and the corresponding header files are required. There is +`one package for 32-bit Windows `_ +and `a second package for 64-bit Windows `_. +When building with CMake, the matching package will be downloaded +automatically, but MPI support has to be explicitly enabled with ``-DBUILD_MPI=on``. Please keep in mind, though, that this only applies to **compiling** LAMMPS. Whether the resulting binaries do work correctly is not tested by the From 23509d0785e3872db01e47bef19861c7338ecf0b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 19 Mar 2020 11:09:41 -0400 Subject: [PATCH 6/7] add missing entries for new pair styles --- doc/src/pair_style.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/src/pair_style.rst b/doc/src/pair_style.rst index 0433dfa861..5b5e6e6fe8 100644 --- a/doc/src/pair_style.rst +++ b/doc/src/pair_style.rst @@ -140,6 +140,8 @@ accelerated styles exist. * :doc:`coul/long/cs ` - long-range Coulombic potential and core/shell * :doc:`coul/long/soft ` - long-range Coulombic potential with a soft core * :doc:`coul/msm ` - long-range MSM Coulombics +* :doc:`coul/slater/cut ` - smeared out Coulombics +* :doc:`coul/slater/long ` - long-range smeared out Coulombics * :doc:`coul/shield ` - Coulombics for boron nitride for use with :doc:`ilp/graphene/hbn ` potential * :doc:`coul/streitz ` - Coulombics via Streitz/Mintmire Slater orbitals * :doc:`coul/wolf ` - Coulombics via Wolf potential From 61ebf897e4f86816a8e2df9df4a68c25e68adfa1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 19 Mar 2020 13:31:23 -0400 Subject: [PATCH 7/7] expand comment about MinGW cross-compiler hack --- cmake/Modules/Packages/KIM.cmake | 3 ++- cmake/Modules/Packages/LATTE.cmake | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/Modules/Packages/KIM.cmake b/cmake/Modules/Packages/KIM.cmake index c1e52bd3e5..617068ce13 100644 --- a/cmake/Modules/Packages/KIM.cmake +++ b/cmake/Modules/Packages/KIM.cmake @@ -35,7 +35,8 @@ if(PKG_KIM) option(DOWNLOAD_KIM "Download KIM-API from OpenKIM instead of using an already installed one" ${DOWNLOAD_KIM_DEFAULT}) if(DOWNLOAD_KIM) message(STATUS "KIM-API download requested - we will build our own") - # Workaround for cross compilation with MinGW, which messes up ${CMAKE_INSTALL_LIBDIR} + # Workaround for cross compilation with MinGW where ${CMAKE_INSTALL_LIBDIR} + # is a full path, so we need to remove the prefix string(REPLACE ${CMAKE_INSTALL_PREFIX} "" _KIM_LIBDIR ${CMAKE_INSTALL_LIBDIR}) include(ExternalProject) enable_language(C) diff --git a/cmake/Modules/Packages/LATTE.cmake b/cmake/Modules/Packages/LATTE.cmake index 093c9b7f22..9f665d7f0e 100644 --- a/cmake/Modules/Packages/LATTE.cmake +++ b/cmake/Modules/Packages/LATTE.cmake @@ -9,7 +9,8 @@ if(PKG_LATTE) option(DOWNLOAD_LATTE "Download the LATTE library instead of using an already installed one" ${DOWNLOAD_LATTE_DEFAULT}) if(DOWNLOAD_LATTE) message(STATUS "LATTE download requested - we will build our own") - # Workaround for cross compilation with MinGW, which messes up ${CMAKE_INSTALL_LIBDIR} + # Workaround for cross compilation with MinGW where ${CMAKE_INSTALL_LIBDIR} + # is a full path, so we need to remove the prefix string(REPLACE ${CMAKE_INSTALL_PREFIX} "" _LATTE_LIBDIR ${CMAKE_INSTALL_LIBDIR}) include(ExternalProject) ExternalProject_Add(latte_build