diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 2d259791f2..f67699c54d 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -156,8 +156,7 @@ if(BUILD_MPI) endif() endif() else() - enable_language(C) - file(GLOB MPI_SOURCES ${LAMMPS_SOURCE_DIR}/STUBS/mpi.c) + file(GLOB MPI_SOURCES ${LAMMPS_SOURCE_DIR}/STUBS/mpi.cpp) add_library(mpi_stubs STATIC ${MPI_SOURCES}) set_target_properties(mpi_stubs PROPERTIES OUTPUT_NAME lammps_mpi_stubs${LAMMPS_MACHINE}) target_include_directories(mpi_stubs PUBLIC $) @@ -778,9 +777,7 @@ if(PKG_GPU) message(STATUS "<<< GPU package settings >>> -- GPU API: ${GPU_API}") if(GPU_API STREQUAL "CUDA") - message(STATUS "GPU architecture: ${GPU_ARCH}") - elseif(GPU_API STREQUAL "OPENCL") - message(STATUS "OpenCL tuning: ${OCL_TUNE}") + message(STATUS "GPU default architecture: ${GPU_ARCH}") elseif(GPU_API STREQUAL "HIP") message(STATUS "HIP platform: ${HIP_PLATFORM}") message(STATUS "HIP architecture: ${HIP_ARCH}") diff --git a/cmake/Modules/Documentation.cmake b/cmake/Modules/Documentation.cmake index 189c32e301..5a42244b9e 100644 --- a/cmake/Modules/Documentation.cmake +++ b/cmake/Modules/Documentation.cmake @@ -50,9 +50,9 @@ if(BUILD_DOC) OUTPUT ${DOC_BUILD_DIR}/requirements.txt DEPENDS docenv ${DOCENV_REQUIREMENTS_FILE} COMMAND ${CMAKE_COMMAND} -E copy ${DOCENV_REQUIREMENTS_FILE} ${DOC_BUILD_DIR}/requirements.txt - COMMAND ${DOCENV_BINARY_DIR}/pip install --upgrade pip - COMMAND ${DOCENV_BINARY_DIR}/pip install --upgrade ${LAMMPS_DOC_DIR}/utils/converters - COMMAND ${DOCENV_BINARY_DIR}/pip install --use-feature=2020-resolver -r ${DOC_BUILD_DIR}/requirements.txt --upgrade + COMMAND ${DOCENV_BINARY_DIR}/pip $ENV{PIP_OPTIONS} install --upgrade pip + COMMAND ${DOCENV_BINARY_DIR}/pip $ENV{PIP_OPTIONS} install --upgrade ${LAMMPS_DOC_DIR}/utils/converters + COMMAND ${DOCENV_BINARY_DIR}/pip $ENV{PIP_OPTIONS} install -r ${DOC_BUILD_DIR}/requirements.txt --upgrade ) # download mathjax distribution and unpack to folder "mathjax" diff --git a/cmake/Modules/GTest.cmake b/cmake/Modules/GTest.cmake index 060a7e42f9..0c62291d5e 100644 --- a/cmake/Modules/GTest.cmake +++ b/cmake/Modules/GTest.cmake @@ -20,10 +20,10 @@ ExternalProject_Add(googletest -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} - BUILD_BYPRODUCTS /lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${GTEST_LIB_POSTFIX}.a - /lib/${CMAKE_FIND_LIBRARY_PREFIXES}gmock${GTEST_LIB_POSTFIX}.a - /lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${GTEST_LIB_POSTFIX}.a - /lib/${CMAKE_FIND_LIBRARY_PREFIXES}gmock_main${GTEST_LIB_POSTFIX}.a + BUILD_BYPRODUCTS /lib/libgtest${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} + /lib/libgmock${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} + /lib/libgtest_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} + /lib/libgmock_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} LOG_DOWNLOAD ON LOG_CONFIGURE ON LOG_BUILD ON @@ -39,10 +39,10 @@ file(MAKE_DIRECTORY ${GTEST_INCLUDE_DIR}) file(MAKE_DIRECTORY ${GMOCK_INCLUDE_DIR}) ExternalProject_Get_Property(googletest BINARY_DIR) -set(GTEST_LIBRARY_PATH ${BINARY_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${GTEST_LIB_POSTFIX}.a) -set(GMOCK_LIBRARY_PATH ${BINARY_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gmock${GTEST_LIB_POSTFIX}.a) -set(GTEST_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${GTEST_LIB_POSTFIX}.a) -set(GMOCK_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gmock_main${GTEST_LIB_POSTFIX}.a) +set(GTEST_LIBRARY_PATH ${BINARY_DIR}/lib/libgtest${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) +set(GMOCK_LIBRARY_PATH ${BINARY_DIR}/lib/libgmock${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) +set(GTEST_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/libgtest_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) +set(GMOCK_MAIN_LIBRARY_PATH ${BINARY_DIR}/lib/libgmock_main${GTEST_LIB_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) # Prevent GoogleTest from overriding our compiler/linker options # when building with Visual Studio diff --git a/cmake/Modules/OpenCLLoader.cmake b/cmake/Modules/OpenCLLoader.cmake new file mode 100644 index 0000000000..5ab121f841 --- /dev/null +++ b/cmake/Modules/OpenCLLoader.cmake @@ -0,0 +1,48 @@ +message(STATUS "Downloading and building OpenCL loader library") + +include(ExternalProject) +set(OPENCL_LOADER_URL "https://download.lammps.org/thirdparty/opencl-loader-2020.12.18.tar.gz" CACHE STRING "URL for OpenCL loader tarball") +mark_as_advanced(OPENCL_LOADER_URL) +ExternalProject_Add(opencl_loader + URL ${OPENCL_LOADER_URL} + URL_MD5 011cdcbd41030be94f3fced6d763a52a + SOURCE_DIR "${CMAKE_BINARY_DIR}/opencl_loader-src" + BINARY_DIR "${CMAKE_BINARY_DIR}/opencl_loader-build" + CMAKE_ARGS ${CMAKE_REQUEST_PIC} ${CMAKE_EXTRA_OPENCL_LOADER_OPTS} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + -DCMAKE_INSTALL_PREFIX= + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} + BUILD_BYPRODUCTS /libOpenCL${CMAKE_STATIC_LIBRARY_SUFFIX} + LOG_DOWNLOAD ON + LOG_CONFIGURE ON + LOG_BUILD ON + INSTALL_COMMAND "" + TEST_COMMAND "") + +ExternalProject_Get_Property(opencl_loader SOURCE_DIR) +set(OPENCL_LOADER_INCLUDE_DIR ${SOURCE_DIR}/inc) + +# workaround for CMake 3.10 on ubuntu 18.04 +file(MAKE_DIRECTORY ${OPENCL_LOADER_INCLUDE_DIR}) + +ExternalProject_Get_Property(opencl_loader BINARY_DIR) +set(OPENCL_LOADER_LIBRARY_PATH "${BINARY_DIR}/libOpenCL${CMAKE_STATIC_LIBRARY_SUFFIX}") + +find_package(Threads QUIET) +if(NOT WIN32) + set(OPENCL_LOADER_DEP_LIBS "Threads::Threads;${CMAKE_DL_LIBS}") +else() + set(OPENCL_LOADER_DEP_LIBS "cfgmgr32;runtimeobject") +endif() + +add_library(OpenCL::OpenCL UNKNOWN IMPORTED) +add_dependencies(OpenCL::OpenCL opencl_loader) + +set_target_properties(OpenCL::OpenCL PROPERTIES + IMPORTED_LOCATION ${OPENCL_LOADER_LIBRARY_PATH} + INTERFACE_INCLUDE_DIRECTORIES ${OPENCL_LOADER_INCLUDE_DIR} + INTERFACE_LINK_LIBRARIES "${OPENCL_LOADER_DEP_LIBS}") + + diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index 4c52eee68b..043d41e0ef 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -1,7 +1,9 @@ set(GPU_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/GPU) set(GPU_SOURCES ${GPU_SOURCES_DIR}/gpu_extra.h ${GPU_SOURCES_DIR}/fix_gpu.h - ${GPU_SOURCES_DIR}/fix_gpu.cpp) + ${GPU_SOURCES_DIR}/fix_gpu.cpp + ${GPU_SOURCES_DIR}/fix_nh_gpu.h + ${GPU_SOURCES_DIR}/fix_nh_gpu.cpp) target_compile_definitions(lammps PRIVATE -DLMP_GPU) set(GPU_API "opencl" CACHE STRING "API used by GPU package") @@ -97,9 +99,13 @@ if(GPU_API STREQUAL "CUDA") if(CUDA_VERSION VERSION_GREATER_EQUAL "10.0") string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_75,code=[sm_75,compute_75]") endif() - # Ampere (GPU Arch 8.0 and 8.6) is supported by CUDA 11 and later + # Ampere (GPU Arch 8.0) is supported by CUDA 11 and later if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0") - string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_80,code=[sm_80,compute_80] -gencode arch=compute_86,code=[sm_86,compute_86]") + string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_80,code=[sm_80,compute_80]") + endif() + # Ampere (GPU Arch 8.6) is supported by CUDA 11.1 and later + if(CUDA_VERSION VERSION_GREATER_EQUAL "11.1") + string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_86,code=[sm_86,compute_86]") endif() if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0") message(WARNING "Unsupported CUDA version. Use at your own risk.") @@ -139,27 +145,13 @@ if(GPU_API STREQUAL "CUDA") 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. - set(LAMMPS_THIRDPARTY_URL "https://download.lammps.org/thirdparty") - file(DOWNLOAD "${LAMMPS_THIRDPARTY_URL}/opencl-win-devel.tar.gz" "${CMAKE_CURRENT_BINARY_DIR}/opencl-win-devel.tar.gz" - EXPECTED_MD5 2c00364888d5671195598b44c2e0d44d) - execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf opencl-win-devel.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - add_library(OpenCL::OpenCL UNKNOWN IMPORTED) - if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86") - set_target_properties(OpenCL::OpenCL PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/OpenCL/lib_win32/libOpenCL.dll") - elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64") - set_target_properties(OpenCL::OpenCL PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/OpenCL/lib_win64/libOpenCL.dll") - endif() - set_target_properties(OpenCL::OpenCL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/OpenCL/include") + option(USE_STATIC_OPENCL_LOADER "Download and include a static OpenCL ICD loader" ON) + mark_as_advanced(USE_STATIC_OPENCL_LOADER) + if (USE_STATIC_OPENCL_LOADER) + include(OpenCLLoader) else() find_package(OpenCL REQUIRED) endif() - set(OCL_TUNE "generic" CACHE STRING "OpenCL Device Tuning") - set(OCL_TUNE_VALUES intel fermi kepler cypress generic) - set_property(CACHE OCL_TUNE PROPERTY STRINGS ${OCL_TUNE_VALUES}) - validate_option(OCL_TUNE OCL_TUNE_VALUES) - string(TOUPPER ${OCL_TUNE} OCL_TUNE) include(OpenCLUtils) set(OCL_COMMON_HEADERS ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_preprocessor.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_aux_fun1.h) @@ -203,7 +195,7 @@ elseif(GPU_API STREQUAL "OPENCL") add_library(gpu STATIC ${GPU_LIB_SOURCES}) target_link_libraries(gpu PRIVATE OpenCL::OpenCL) target_include_directories(gpu PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/gpu) - target_compile_definitions(gpu PRIVATE -D_${GPU_PREC_SETTING} -D${OCL_TUNE}_OCL -DMPI_GERYON -DUCL_NO_EXIT) + target_compile_definitions(gpu PRIVATE -D_${GPU_PREC_SETTING} -DMPI_GERYON -DGERYON_NUMA_FISSION -DUCL_NO_EXIT) target_compile_definitions(gpu PRIVATE -DUSE_OPENCL) target_link_libraries(lammps PRIVATE gpu) @@ -211,6 +203,7 @@ elseif(GPU_API STREQUAL "OPENCL") add_executable(ocl_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp) target_compile_definitions(ocl_get_devices PRIVATE -DUCL_OPENCL) target_link_libraries(ocl_get_devices PRIVATE OpenCL::OpenCL) + add_dependencies(ocl_get_devices OpenCL::OpenCL) elseif(GPU_API STREQUAL "HIP") if(NOT DEFINED HIP_PATH) if(NOT DEFINED ENV{HIP_PATH}) @@ -393,13 +386,10 @@ elseif(GPU_API STREQUAL "HIP") target_link_libraries(lammps PRIVATE gpu) endif() -# GPU package -FindStyleHeaders(${GPU_SOURCES_DIR} FIX_CLASS fix_ FIX) - set_property(GLOBAL PROPERTY "GPU_SOURCES" "${GPU_SOURCES}") - -# detects styles which have GPU version +# detect styles which have a GPU version RegisterStylesExt(${GPU_SOURCES_DIR} gpu GPU_SOURCES) +RegisterFixStyle(${GPU_SOURCES_DIR}/fix_gpu.h) get_property(GPU_SOURCES GLOBAL PROPERTY GPU_SOURCES) diff --git a/cmake/Modules/Packages/KIM.cmake b/cmake/Modules/Packages/KIM.cmake index 83a96d02b8..5482d3071c 100644 --- a/cmake/Modules/Packages/KIM.cmake +++ b/cmake/Modules/Packages/KIM.cmake @@ -69,14 +69,14 @@ if(DOWNLOAD_KIM) BUILD_RPATH "${_rpath_prefix}/kim_build-prefix/lib" ) else() - if(KIM-API_FOUND AND KIM_API_VERSION VERSION_GREATER_EQUAL 2.2.0) + if(KIM-API_FOUND AND KIM-API_VERSION VERSION_GREATER_EQUAL 2.2.0) # For kim-api >= 2.2.0 - find_package(KIM-API ${KIM-API_MIN_VERSION} CONFIG REQUIRED) + find_package(KIM-API 2.2.0 CONFIG REQUIRED) target_link_libraries(lammps PRIVATE KIM-API::kim-api) else() # For kim-api 2.1.3 (consistent with previous version of this file) find_package(PkgConfig REQUIRED) - pkg_check_modules(KIM-API REQUIRED IMPORTED_TARGET libkim-api>=KIM-API_MIN_VERSION) + pkg_check_modules(KIM-API REQUIRED IMPORTED_TARGET libkim-api>=${KIM-API_MIN_VERSION}) target_link_libraries(lammps PRIVATE PkgConfig::KIM-API) endif() endif() diff --git a/cmake/Modules/Packages/MESSAGE.cmake b/cmake/Modules/Packages/MESSAGE.cmake index fb62763828..6ff4e322aa 100644 --- a/cmake/Modules/Packages/MESSAGE.cmake +++ b/cmake/Modules/Packages/MESSAGE.cmake @@ -2,9 +2,8 @@ if(LAMMPS_SIZES STREQUAL BIGBIG) message(FATAL_ERROR "The MESSAGE Package is not compatible with -DLAMMPS_BIGBIG") endif() option(MESSAGE_ZMQ "Use ZeroMQ in MESSAGE package" OFF) -file(GLOB_RECURSE cslib_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.F - ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.c - ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.cpp) +file(GLOB_RECURSE cslib_SOURCES + ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.cpp) add_library(cslib STATIC ${cslib_SOURCES}) target_compile_definitions(cslib PRIVATE -DLAMMPS_${LAMMPS_SIZES}) diff --git a/cmake/Modules/YAML.cmake b/cmake/Modules/YAML.cmake index a080b566be..f2ba34e1b6 100644 --- a/cmake/Modules/YAML.cmake +++ b/cmake/Modules/YAML.cmake @@ -12,7 +12,7 @@ ExternalProject_Add(libyaml CXX=${CMAKE_CXX_COMPILER} CC=${CMAKE_C_COMPILER} --prefix= --disable-shared - BUILD_BYPRODUCTS /lib/${CMAKE_FIND_LIBRARY_PREFIXES}yaml.a + BUILD_BYPRODUCTS /lib/libyaml${CMAKE_STATIC_LIBRARY_SUFFIX} TEST_COMMAND "") ExternalProject_Get_Property(libyaml INSTALL_DIR) @@ -23,7 +23,7 @@ set(YAML_LIBRARY_DIR ${INSTALL_DIR}/lib) file(MAKE_DIRECTORY ${YAML_INCLUDE_DIR}) file(MAKE_DIRECTORY ${YAML_LIBRARY_DIR}) -set(YAML_LIBRARY_PATH ${INSTALL_DIR}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}yaml.a) +set(YAML_LIBRARY_PATH ${INSTALL_DIR}/lib/libyaml${CMAKE_STATIC_LIBRARY_SUFFIX}) add_library(Yaml::Yaml UNKNOWN IMPORTED) set_target_properties(Yaml::Yaml PROPERTIES diff --git a/doc/Makefile b/doc/Makefile index 6032aff45f..7deaaf2a2e 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -47,6 +47,8 @@ HAS_PDFLATEX = YES endif endif +# override settings for PIP commands +# PIP_OPTIONS = --cert /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt --proxy http://proxy.mydomain.org #SPHINXEXTRA = -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocessing.cpu_count())') $(shell test -f $(BUILDDIR)/doxygen/xml/run.stamp && printf -- "-E") @@ -228,13 +230,13 @@ $(VENV): @( \ $(VIRTUALENV) -p $(PYTHON) $(VENV); \ . $(VENV)/bin/activate; \ - pip install --upgrade pip; \ - pip install -r $(BUILDDIR)/utils/requirements.txt; \ + pip $(PIP_OPTIONS) install --upgrade pip; \ + pip $(PIP_OPTIONS) install -r $(BUILDDIR)/utils/requirements.txt; \ deactivate;\ ) $(MATHJAX): - @git clone --depth 1 https://github.com/mathjax/MathJax.git $@ + @git clone --depth 1 git://github.com/mathjax/MathJax.git $@ $(TXT2RST) $(ANCHORCHECK): $(VENV) @( \ diff --git a/doc/src/Build_basics.rst b/doc/src/Build_basics.rst index cb6bd9f6aa..c7baa21e62 100644 --- a/doc/src/Build_basics.rst +++ b/doc/src/Build_basics.rst @@ -95,7 +95,7 @@ standard. A more detailed discussion of that is below. .. note:: - The file ``src/STUBS/mpi.c`` provides a CPU timer function + The file ``src/STUBS/mpi.cpp`` 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 diff --git a/doc/src/Build_extras.rst b/doc/src/Build_extras.rst index 8f1154a167..9180933007 100644 --- a/doc/src/Build_extras.rst +++ b/doc/src/Build_extras.rst @@ -120,8 +120,6 @@ CMake build -D GPU_API=value # value = opencl (default) or cuda or hip -D GPU_PREC=value # precision setting # value = double or mixed (default) or single - -D OCL_TUNE=value # hardware choice for GPU_API=opencl - # generic (default) or intel (Intel CPU) or fermi, kepler, cypress (NVIDIA) -D GPU_ARCH=value # primary GPU hardware choice for GPU_API=cuda # value = sm_XX, see below # default is sm_50 @@ -135,6 +133,8 @@ CMake build # value = yes (default) or no -D CUDA_MPS_SUPPORT=value # enables some tweaks required to run with active nvidia-cuda-mps daemon # value = yes or no (default) + -D USE_STATIC_OPENCL_LOADER=value # downloads/includes OpenCL ICD loader library, no local OpenCL headers/libs needed + # value = yes (default) or no :code:`GPU_ARCH` settings for different GPU hardware is as follows: @@ -161,6 +161,12 @@ When building with CMake, you **must NOT** build the GPU library in ``lib/gpu`` using the traditional build procedure. CMake will detect files generated by that process and will terminate with an error and a suggestion for how to remove them. +If you are compiling for OpenCL, the default setting is to download, build, and +link with a static OpenCL ICD loader library and standard OpenCL headers. This +way no local OpenCL development headers or library needs to be present and only +OpenCL compatible drivers need to be installed to use OpenCL. If this is not +desired, you can set :code:`USE_STATIC_OPENCL_LOADER` to :code:`no`. + If you are compiling with HIP, note that before running CMake you will have to set appropriate environment variables. Some variables such as :code:`HCC_AMDGPU_TARGET` or :code:`CUDA_PATH` are necessary for :code:`hipcc` @@ -258,18 +264,18 @@ To build with this package, the KIM library with API v2 must be downloaded and built on your system. It must include the KIM models that you want to use with LAMMPS. -If you would like to use the :doc:`kim_query ` +If you would like to use the :doc:`kim query ` command, you also need to have libcurl installed with the matching development headers and the curl-config tool. -If you would like to use the :doc:`kim_property ` +If you would like to use the :doc:`kim property ` command, you need to build LAMMPS with the PYTHON package installed and linked to Python 3.6 or later. See the :ref:`PYTHON package build info ` for more details on this. After successfully building LAMMPS with Python, you -also need to install the kim-property Python package, which can be easily done using -*pip* as ``pip install kim-property``, or from the *conda-forge* channel as -``conda install kim-property`` if LAMMPS is built in Conda. More detailed -information is available at: +also need to install the ``kim-property`` Python package, which can be easily +done using *pip* as ``pip install kim-property``, or from the *conda-forge* +channel as ``conda install kim-property`` if LAMMPS is built in Conda. More +detailed information is available at: `kim-property installation `_. In addition to installing the KIM API, it is also necessary to install the @@ -309,7 +315,7 @@ minutes to hours) to build. Of course you only need to do that once.) You can download and build the KIM library manually if you prefer; follow the instructions in ``lib/kim/README``. You can also do - this in one step from the lammps/src dir, using a command like + this in one step from the lammps/src directory, using a command like these, which simply invoke the ``lib/kim/Install.py`` script with the specified args. @@ -329,7 +335,7 @@ minutes to hours) to build. Of course you only need to do that once.) .. code-block:: make - LMP_INC = -DLMP_NO_SSL_CHECK + LMP_INC = -DLMP_NO_SSL_CHECK Debugging OpenKIM web queries in LAMMPS ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -377,10 +383,11 @@ Enabling the extra unit tests have some requirements, Conda. More detailed information is available at: `kim-property installation `_. * It is also necessary to install - ``EAM_Dynamo_Mendelev_2007_Zr__MO_848899341753_000``, and - ``EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005`` KIM models. + ``EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000``, + ``EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005``, and + ``LennardJones612_UniversalShifted__MO_959249795837_003`` KIM models. See `Obtaining KIM Models `_ - to learn how to install a pre-build binary of the OpenKIM Repository of + to learn how to install a pre-built binary of the OpenKIM Repository of Models or see `Installing KIM Models `_ to learn how to install the specific KIM models. diff --git a/doc/src/Build_link.rst b/doc/src/Build_link.rst index 3d66371304..5255620231 100644 --- a/doc/src/Build_link.rst +++ b/doc/src/Build_link.rst @@ -20,16 +20,8 @@ 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 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. + and the LAMMPS library unless LAMMPS is to be compiled without (real) + MPI support using the include STUBS MPI library. Link with LAMMPS as a static library ------------------------------------ @@ -110,7 +102,7 @@ executable, that are also required to link the LAMMPS executable. .. code-block:: bash - gcc -c -O -I${HOME}/lammps/src/STUBS -I${HOME}/lammps/src -caller.c + gcc -c -O -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_serial -lpoems -lmpi_stubs @@ -174,7 +166,7 @@ the POEMS package installed becomes: .. code-block:: bash - gcc -c -O -I${HOME}/lammps/src/STUBS -I${HOME}/lammps/src -caller.c + gcc -c -O -I${HOME}/lammps/src -caller.c g++ -o caller caller.o -L${HOME}/lammps/src -llammps_serial Locating liblammps.so at runtime diff --git a/doc/src/Build_manual.rst b/doc/src/Build_manual.rst index 59e4e3235b..3bf0337b31 100644 --- a/doc/src/Build_manual.rst +++ b/doc/src/Build_manual.rst @@ -74,7 +74,11 @@ For the documentation build a python virtual environment is set up in the folder ``doc/docenv`` and various python packages are installed into that virtual environment via the ``pip`` tool. For rendering embedded LaTeX code also the `MathJax `_ JavaScript -engine needs to be downloaded. +engine needs to be downloaded. If you need to pass additional options +to the pip commands to work (e.g. to use a web proxy or to point to +additional SSL certificates) you can set them via the ``PIP_OPTIONS`` +environment variable or uncomment and edit the ``PIP_OPTIONS`` setting +at beginning of the makefile. The actual translation is then done via ``make`` commands in the doc folder. The following ``make`` commands are available: @@ -108,7 +112,10 @@ installation of the HTML manual pages into the "install" step when installing LAMMPS after the CMake build via ``cmake --build . --target install``. The documentation build is included in the default build target, but can also be requested independently with -``cmake --build . --target doc``. +``cmake --build . --target doc``. If you need to pass additional options +to the pip commands to work (e.g. to use a web proxy or to point to +additional SSL certificates) you can set them via the ``PIP_OPTIONS`` +environment variable. .. code-block:: bash diff --git a/doc/src/Commands_all.rst b/doc/src/Commands_all.rst index a38bd5f0db..132425948e 100644 --- a/doc/src/Commands_all.rst +++ b/doc/src/Commands_all.rst @@ -60,11 +60,7 @@ An alphabetic list of all general LAMMPS commands. * :doc:`include ` * :doc:`info ` * :doc:`jump ` - * :doc:`kim_init ` - * :doc:`kim_interactions ` - * :doc:`kim_param ` - * :doc:`kim_property ` - * :doc:`kim_query ` + * :doc:`kim ` * :doc:`kspace_modify ` * :doc:`kspace_style ` * :doc:`label