Compare commits
342 Commits
patch_8Feb
...
patch_23Ju
| Author | SHA1 | Date | |
|---|---|---|---|
| 83ba1c9d20 | |||
| ce10614cab | |||
| facbeac052 | |||
| 188ee5af15 | |||
| f176b8b14c | |||
| 2396b2feea | |||
| 4399c1b6c1 | |||
| fd046c8fd8 | |||
| 09b7694601 | |||
| df20503434 | |||
| f4aa24a36a | |||
| 007c04bc97 | |||
| 418d1e16e1 | |||
| 6471d781d0 | |||
| 97ddc5917c | |||
| a95ff20647 | |||
| 9e0a9e2601 | |||
| 8b34d65970 | |||
| 0a1c2bcccc | |||
| c9442c591c | |||
| b7d316031d | |||
| 361e9f3ea5 | |||
| 28120793b8 | |||
| f32ce8377e | |||
| 9021b8bc6a | |||
| 838fe3020d | |||
| b4d4dcbcbc | |||
| 52a892ec46 | |||
| 0ee3d9da5d | |||
| 50afb292b0 | |||
| 275ef9da17 | |||
| b6a87390a3 | |||
| 72178631c5 | |||
| f8859c5fca | |||
| 979119a29b | |||
| bc66572275 | |||
| 609231675f | |||
| d9675b5da4 | |||
| 7d32b4f42a | |||
| 697e5b15ec | |||
| ade0718c11 | |||
| 31033ff6e0 | |||
| 9a598ba5a8 | |||
| ff20448b1d | |||
| af5229ba58 | |||
| b180200c48 | |||
| 27441cf2ea | |||
| db61bf609b | |||
| 015fa4cb0a | |||
| 62f6f91146 | |||
| e163b0b1d7 | |||
| 169a886898 | |||
| cbd276c49d | |||
| 183c6c06ff | |||
| 93a46da58e | |||
| 6b6a47bd3c | |||
| 4a0a98a0fd | |||
| 369ea4fd26 | |||
| d63c002bf5 | |||
| e931d3153b | |||
| 2913c063d4 | |||
| 5606b57646 | |||
| 0fafe34008 | |||
| a9a1640d67 | |||
| 812363fb99 | |||
| b40e0be1c9 | |||
| 1be973da07 | |||
| aca2c52795 | |||
| 536b2ab7e5 | |||
| ccef293161 | |||
| 4b0de87813 | |||
| fa22aef31b | |||
| cb7544a615 | |||
| a9be4906b7 | |||
| 6f36d21a04 | |||
| c55a15c4dc | |||
| 8f01dad1a9 | |||
| db6e1aa20d | |||
| 3cee69a077 | |||
| 69ffe71595 | |||
| 16fa033111 | |||
| 8e494aa771 | |||
| d203cce8b5 | |||
| f8de1b1a75 | |||
| de89a25a25 | |||
| f982e95267 | |||
| 293d0cdb58 | |||
| 011f2651ee | |||
| a8d3c43a77 | |||
| c19641f8b3 | |||
| 6596b343ff | |||
| b6dbb0330c | |||
| 0dd138666a | |||
| 33b9fec150 | |||
| 32b020a165 | |||
| c1db230331 | |||
| 254c052ecc | |||
| 8e889dfa7c | |||
| 5b6a52a646 | |||
| 55f56deb63 | |||
| bfe127a720 | |||
| d95c8911a3 | |||
| 0380f9d854 | |||
| 71b1d60363 | |||
| 8b1f92fabd | |||
| 419af0cf28 | |||
| 9030c59932 | |||
| ee88078150 | |||
| 04451f6072 | |||
| 2364f7f08b | |||
| 7f82a58f51 | |||
| 1caf074ba1 | |||
| 34677f78c2 | |||
| e095609ac6 | |||
| 1122408957 | |||
| 5f9b78ca01 | |||
| fe138fc75c | |||
| 31c324ff61 | |||
| 30564ed8b7 | |||
| f05bfe45a8 | |||
| 88c8b6ec6f | |||
| f01e28f574 | |||
| 96627d27b1 | |||
| b3fc574a6a | |||
| 8a3f7560c9 | |||
| 8406e92a9a | |||
| 3b376b4448 | |||
| ca3b7be623 | |||
| c825c52d2f | |||
| 0ea0e4ce59 | |||
| d53d4b4d99 | |||
| b37cd14dd1 | |||
| a921a6bdc1 | |||
| 51a0345941 | |||
| 8d70960e2d | |||
| 5661703b30 | |||
| bc30304f72 | |||
| c76da483fb | |||
| 036a1e47d2 | |||
| 5430c3b592 | |||
| 9b7cb8200c | |||
| 550eedbb1f | |||
| 3a058f278d | |||
| 0f7f0b5f86 | |||
| 3de7534b84 | |||
| 7065462faf | |||
| 2e9d8e1ccb | |||
| 19b84f7cbd | |||
| 9b7c445a15 | |||
| 91e56444ce | |||
| 9b3c8c36bd | |||
| 3403520967 | |||
| d8f969f1df | |||
| 3487deccb6 | |||
| 0926fc627d | |||
| 7999778d94 | |||
| b4ef4c1ff2 | |||
| 72b08e4b87 | |||
| faa64a84e8 | |||
| 32b67fff2b | |||
| f3dbf4122d | |||
| e25ac786da | |||
| f30fba0061 | |||
| 03f319604f | |||
| 0782dab1ec | |||
| c43cce54ab | |||
| 281a368702 | |||
| f28d69b429 | |||
| e674e0c927 | |||
| eebabf99b8 | |||
| 23a19f4431 | |||
| d618b0ffc0 | |||
| ffc71b8733 | |||
| 564df78698 | |||
| 8db0b5ca39 | |||
| 79e26fe829 | |||
| 523d4b0242 | |||
| fe39a3e581 | |||
| 081cc1f992 | |||
| 53c80c2c00 | |||
| 554b64a147 | |||
| dc08dba592 | |||
| 0eaa2775cd | |||
| 852673ce41 | |||
| 8c711e405a | |||
| 25b9f95061 | |||
| ee66a6f8c1 | |||
| b694a5f582 | |||
| 7ab3fce93f | |||
| 1f9509cb6f | |||
| cad1d8ece4 | |||
| b709d75f80 | |||
| 5839909061 | |||
| 30f374de58 | |||
| 0f9fec05fb | |||
| 972a86f0ec | |||
| 7338ebfc94 | |||
| 7132152693 | |||
| c9925f64f7 | |||
| 6da523c8b8 | |||
| 0522284589 | |||
| e10a66dabc | |||
| 51dd631a76 | |||
| d37249787e | |||
| f44841de69 | |||
| 54c5337d2d | |||
| efb0e63bf6 | |||
| 13d78c3afa | |||
| f2910b1d9c | |||
| 78b22a64aa | |||
| 8bb1880c9d | |||
| e7b36c7b90 | |||
| d7804e3770 | |||
| 8d0f9695d2 | |||
| 52b2e4f364 | |||
| 41140149ea | |||
| 85e556ac8f | |||
| cd5437a7e2 | |||
| 00cc82ac94 | |||
| 20f87e3f1d | |||
| 97e34f0667 | |||
| 3e5da9b09a | |||
| a62fcca7a4 | |||
| 778d59fa6b | |||
| 3833a85d7a | |||
| 6d961ab29f | |||
| 001824e0f6 | |||
| 953d32f9b3 | |||
| edba922665 | |||
| 53806d4601 | |||
| 67597722d5 | |||
| 337794a9e9 | |||
| 5f5fb895ff | |||
| 0302d03bc6 | |||
| 0a4fef369f | |||
| 7d5fc356fe | |||
| 8103e5a18f | |||
| e5b56b67fe | |||
| 8ffb7e5f89 | |||
| cb9ab48ce7 | |||
| 1ebb1cee40 | |||
| f0e7101bd2 | |||
| 6fd8b2b177 | |||
| 6edaf42b3d | |||
| 79c047487d | |||
| ac5acb9abf | |||
| 87fbbd3b13 | |||
| 8ac0ec6473 | |||
| 8acba74c4d | |||
| 34bcbdf41d | |||
| d519ca0213 | |||
| a392e8dc09 | |||
| a4d4f77bc2 | |||
| 83a8f72d83 | |||
| 3c54b56cfe | |||
| ff1a08f148 | |||
| 5a53b0fc03 | |||
| e550600ebe | |||
| 7cb13be52a | |||
| ab56d7ecd7 | |||
| bd6ac3ee6d | |||
| 27ca0a8f41 | |||
| f688b9b6b5 | |||
| 16c61b3cc0 | |||
| fb480f22fc | |||
| d0507559a4 | |||
| 58eb331b08 | |||
| c68015ca87 | |||
| 583c22d6e0 | |||
| 58a4694d92 | |||
| 97cf345528 | |||
| 0658abbdd4 | |||
| 72026a58bf | |||
| 7152231a10 | |||
| 8fe8a667b6 | |||
| 560c543e69 | |||
| c5e6650924 | |||
| 10373ea5c9 | |||
| 992b1cf582 | |||
| 1505f3de06 | |||
| 566efe04f2 | |||
| 7586adbb6a | |||
| 69d6ddccc5 | |||
| 5ae496dcef | |||
| bc5d742623 | |||
| 882e699163 | |||
| 9c725d79d6 | |||
| 79fbf437a3 | |||
| d130aa4289 | |||
| 5d8b83a251 | |||
| 5a2548a83d | |||
| a85b310e1f | |||
| e51fd40547 | |||
| 62f271658b | |||
| 0aa742934f | |||
| a26a709a7b | |||
| 027293d285 | |||
| f7d049ac2d | |||
| ea0ff1c8f7 | |||
| 5c1bb5f13a | |||
| 24d9b4b611 | |||
| a0e75c9006 | |||
| 2435b953e1 | |||
| c042e12323 | |||
| e9efe46db9 | |||
| ecc14b7308 | |||
| 0152fe5cdf | |||
| 892d17af22 | |||
| 2cca00203e | |||
| 9f4626a62a | |||
| e890a0b45e | |||
| 68223f0385 | |||
| 1291a88bff | |||
| d9b687450a | |||
| bd950b37d7 | |||
| 21fcdf8c56 | |||
| 6b400fb4bf | |||
| d982298ab2 | |||
| 765fd7f763 | |||
| 0325047c01 | |||
| 2dce8923ee | |||
| 8d1ba074be | |||
| 4675a3b560 | |||
| 8999b1f69f | |||
| 6c2b19c11b | |||
| a425334928 | |||
| db2faf2789 | |||
| fdbb7d0da4 | |||
| 52cd99918f | |||
| a3e6a95ffb | |||
| 5b65169997 | |||
| 5f3bf69e30 | |||
| 507c02b9af | |||
| b7fe47ba48 | |||
| 7dfd11da4b | |||
| 97ba95f30e | |||
| c1945b4ec9 | |||
| c4291a4b8e | |||
| 5b5dfa86c5 | |||
| 3ca3f6959f | |||
| f7b7bfa406 | |||
| 3d2f29c92d |
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -3,6 +3,7 @@
|
|||||||
.github export-ignore
|
.github export-ignore
|
||||||
.lgtm.yml export-ignore
|
.lgtm.yml export-ignore
|
||||||
SECURITY.md export-ignore
|
SECURITY.md export-ignore
|
||||||
|
CITATION.cff export-ignore
|
||||||
* text=auto
|
* text=auto
|
||||||
*.jpg -text
|
*.jpg -text
|
||||||
*.pdf -text
|
*.pdf -text
|
||||||
|
|||||||
66
.github/CODEOWNERS
vendored
66
.github/CODEOWNERS
vendored
@ -13,39 +13,44 @@ lib/kim/* @ellio167
|
|||||||
lib/mesont/* @iafoss
|
lib/mesont/* @iafoss
|
||||||
|
|
||||||
# whole packages
|
# whole packages
|
||||||
src/COMPRESS/* @rbberger
|
src/ADIOS/* @pnorbert
|
||||||
src/GPU/* @ndtrung81
|
src/AMOEBA/* @sjplimp
|
||||||
src/KOKKOS/* @stanmoore1
|
src/BPM/* @jtclemm
|
||||||
src/KIM/* @ellio167
|
|
||||||
src/LATTE/* @cnegre
|
|
||||||
src/MESSAGE/* @sjplimp
|
|
||||||
src/MLIAP/* @athomps
|
|
||||||
src/SNAP/* @athomps
|
|
||||||
src/SPIN/* @julient31
|
|
||||||
src/BROWNIAN/* @samueljmcameron
|
src/BROWNIAN/* @samueljmcameron
|
||||||
src/CG-DNA/* @ohenrich
|
src/CG-DNA/* @ohenrich
|
||||||
src/CG-SDK/* @akohlmey
|
src/CG-SDK/* @yskmiyazaki
|
||||||
src/COLVARS/* @giacomofiorin
|
src/COLVARS/* @giacomofiorin
|
||||||
|
src/COMPRESS/* @rbberger
|
||||||
src/DIELECTRIC/* @ndtrung81
|
src/DIELECTRIC/* @ndtrung81
|
||||||
|
src/ELECTRODE/* @ludwig-ahrens
|
||||||
src/FEP/* @agiliopadua
|
src/FEP/* @agiliopadua
|
||||||
src/ML-HDNNP/* @singraber
|
src/GPU/* @ndtrung81
|
||||||
|
src/GRANULAR/* @jtclemm @dsbolin
|
||||||
src/INTEL/* @wmbrownintel
|
src/INTEL/* @wmbrownintel
|
||||||
|
src/KIM/* @ellio167
|
||||||
|
src/KOKKOS/* @stanmoore1
|
||||||
|
src/LATTE/* @cnegre
|
||||||
src/MANIFOLD/* @Pakketeretet2
|
src/MANIFOLD/* @Pakketeretet2
|
||||||
src/MDI/* @taylor-a-barnes
|
src/MDI/* @taylor-a-barnes @sjplimp
|
||||||
src/MEAM/* @martok
|
src/MEAM/* @martok
|
||||||
src/MESONT/* @iafoss
|
src/MESONT/* @iafoss
|
||||||
|
src/ML-HDNNP/* @singraber
|
||||||
|
src/ML-IAP/* @athomps
|
||||||
|
src/ML-PACE/* @yury-lysogorskiy
|
||||||
src/MOFFF/* @hheenen
|
src/MOFFF/* @hheenen
|
||||||
src/MOLFILE/* @akohlmey
|
src/MOLFILE/* @akohlmey
|
||||||
src/NETCDF/* @pastewka
|
src/NETCDF/* @pastewka
|
||||||
src/ML-PACE/* @yury-lysogorskiy
|
|
||||||
src/PLUMED/* @gtribello
|
|
||||||
src/PHONON/* @lingtikong
|
|
||||||
src/PTM/* @pmla
|
|
||||||
src/OPENMP/* @akohlmey
|
src/OPENMP/* @akohlmey
|
||||||
|
src/PHONON/* @lingtikong
|
||||||
|
src/PLUGIN/* @akohlmey
|
||||||
|
src/PLUMED/* @gtribello
|
||||||
|
src/PTM/* @pmla
|
||||||
src/QMMM/* @akohlmey
|
src/QMMM/* @akohlmey
|
||||||
src/REAXFF/* @hasanmetin @stanmoore1
|
|
||||||
src/REACTION/* @jrgissing
|
src/REACTION/* @jrgissing
|
||||||
|
src/REAXFF/* @hasanmetin @stanmoore1
|
||||||
src/SCAFACOS/* @rhalver
|
src/SCAFACOS/* @rhalver
|
||||||
|
src/SNAP/* @athomps
|
||||||
|
src/SPIN/* @julient31
|
||||||
src/TALLY/* @akohlmey
|
src/TALLY/* @akohlmey
|
||||||
src/UEF/* @danicholson
|
src/UEF/* @danicholson
|
||||||
src/VTK/* @rbberger
|
src/VTK/* @rbberger
|
||||||
@ -119,26 +124,32 @@ src/dump_movie.* @akohlmey
|
|||||||
src/exceptions.h @rbberger
|
src/exceptions.h @rbberger
|
||||||
src/fix_nh.* @athomps
|
src/fix_nh.* @athomps
|
||||||
src/info.* @akohlmey @rbberger
|
src/info.* @akohlmey @rbberger
|
||||||
src/timer.* @akohlmey
|
|
||||||
src/min* @sjplimp @stanmoore1
|
src/min* @sjplimp @stanmoore1
|
||||||
|
src/platform.* @akohlmey
|
||||||
|
src/timer.* @akohlmey
|
||||||
src/utils.* @akohlmey @rbberger
|
src/utils.* @akohlmey @rbberger
|
||||||
src/verlet.* @sjplimp @stanmoore1
|
src/verlet.* @sjplimp @stanmoore1
|
||||||
src/math_eigen_impl.h @jewettaij
|
src/math_eigen_impl.h @jewettaij
|
||||||
|
|
||||||
# tools
|
# tools
|
||||||
tools/msi2lmp/* @akohlmey
|
tools/coding_standard/* @akohlmey @rbberger
|
||||||
tools/emacs/* @HaoZeke
|
tools/emacs/* @HaoZeke
|
||||||
tools/singularity/* @akohlmey @rbberger
|
tools/lammps-shell/* @akohlmey
|
||||||
tools/coding_standard/* @rbberger
|
tools/msi2lmp/* @akohlmey
|
||||||
tools/valgrind/* @akohlmey
|
|
||||||
tools/swig/* @akohlmey
|
|
||||||
tools/offline/* @rbberger
|
tools/offline/* @rbberger
|
||||||
|
tools/singularity/* @akohlmey @rbberger
|
||||||
|
tools/swig/* @akohlmey
|
||||||
|
tools/valgrind/* @akohlmey
|
||||||
|
tools/vim/* @hammondkd
|
||||||
|
|
||||||
# tests
|
# tests
|
||||||
unittest/* @akohlmey @rbberger
|
unittest/* @akohlmey
|
||||||
|
|
||||||
# cmake
|
# cmake
|
||||||
cmake/* @junghans @rbberger
|
cmake/* @junghans @rbberger
|
||||||
|
cmake/Modules/LAMMPSInterfacePlugin.cmake @akohlmey
|
||||||
|
cmake/Modules/MPI4WIN.cmake @akohlmey
|
||||||
|
cmake/Modules/OpenCLLoader.cmake @akohlmey
|
||||||
cmake/Modules/Packages/COLVARS.cmake @junghans @rbberger @giacomofiorin
|
cmake/Modules/Packages/COLVARS.cmake @junghans @rbberger @giacomofiorin
|
||||||
cmake/Modules/Packages/KIM.cmake @junghans @rbberger @ellio167
|
cmake/Modules/Packages/KIM.cmake @junghans @rbberger @ellio167
|
||||||
cmake/presets/*.cmake @akohlmey
|
cmake/presets/*.cmake @akohlmey
|
||||||
@ -147,13 +158,12 @@ cmake/presets/*.cmake @akohlmey
|
|||||||
python/* @rbberger
|
python/* @rbberger
|
||||||
|
|
||||||
# fortran
|
# fortran
|
||||||
fortran/* @akohlmey
|
fortran/* @akohlmey @hammondkd
|
||||||
|
|
||||||
# docs
|
# docs
|
||||||
doc/utils/*/* @rbberger
|
doc/* @akohlmey
|
||||||
doc/Makefile @rbberger
|
|
||||||
doc/README @rbberger
|
|
||||||
examples/plugin/* @akohlmey
|
examples/plugin/* @akohlmey
|
||||||
|
examples/PACKAGES/pace/plugin/* @akohlmey
|
||||||
|
|
||||||
# for releases
|
# for releases
|
||||||
src/version.h @sjplimp
|
src/version.h @sjplimp
|
||||||
|
|||||||
7
.github/ISSUE_TEMPLATE/help_request.md
vendored
7
.github/ISSUE_TEMPLATE/help_request.md
vendored
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: Request for Help
|
name: Request for Help
|
||||||
about: "Don't post help requests here, email the lammps-users mailing list"
|
about: "Don't post help requests here, post in the LAMMPS forum"
|
||||||
title: ""
|
title: ""
|
||||||
labels: invalid
|
labels: invalid
|
||||||
assignees: ''
|
assignees: ''
|
||||||
@ -8,8 +8,9 @@ assignees: ''
|
|||||||
---
|
---
|
||||||
|
|
||||||
Please **do not** post requests for help (e.g. with installing or using LAMMPS) here.
|
Please **do not** post requests for help (e.g. with installing or using LAMMPS) here.
|
||||||
Instead send an e-mail to the lammps-users mailing list.
|
Instead, you can post to the LAMMPS category in the Materials Science Community
|
||||||
|
Discourse forum at: https://matsci.org/lammps/
|
||||||
|
|
||||||
This issue tracker is for tracking LAMMPS development related issues only.
|
This issue tracker is for tracking LAMMPS development related issues only.
|
||||||
|
|
||||||
Thanks for your cooperation.
|
Thank you in advance for your cooperation.
|
||||||
|
|||||||
6
.github/codecov.yml
vendored
6
.github/codecov.yml
vendored
@ -7,7 +7,7 @@ coverage:
|
|||||||
threshold: 10%
|
threshold: 10%
|
||||||
only_pulls: false
|
only_pulls: false
|
||||||
branches:
|
branches:
|
||||||
- "master"
|
- "develop"
|
||||||
flags:
|
flags:
|
||||||
- "unit"
|
- "unit"
|
||||||
paths:
|
paths:
|
||||||
@ -16,14 +16,14 @@ coverage:
|
|||||||
project:
|
project:
|
||||||
default:
|
default:
|
||||||
branches:
|
branches:
|
||||||
- "master"
|
- "develop"
|
||||||
paths:
|
paths:
|
||||||
- "src"
|
- "src"
|
||||||
informational: true
|
informational: true
|
||||||
patch:
|
patch:
|
||||||
default:
|
default:
|
||||||
branches:
|
branches:
|
||||||
- "master"
|
- "develop"
|
||||||
paths:
|
paths:
|
||||||
- "src"
|
- "src"
|
||||||
informational: true
|
informational: true
|
||||||
|
|||||||
14
.github/workflows/compile-msvc.yml
vendored
14
.github/workflows/compile-msvc.yml
vendored
@ -3,7 +3,11 @@ name: "Native Windows Compilation and Unit Tests"
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [develop]
|
branches:
|
||||||
|
- develop
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- develop
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
@ -22,15 +26,19 @@ jobs:
|
|||||||
- name: Select Python version
|
- name: Select Python version
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
python-version: '3.11'
|
||||||
|
|
||||||
- name: Building LAMMPS via CMake
|
- name: Building LAMMPS via CMake
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install numpy
|
python3 -m pip install numpy
|
||||||
python3 -m pip install pyyaml
|
python3 -m pip install pyyaml
|
||||||
|
nuget install MSMPIsdk
|
||||||
|
nuget install MSMPIDIST
|
||||||
cmake -C cmake/presets/windows.cmake \
|
cmake -C cmake/presets/windows.cmake \
|
||||||
-D PKG_PYTHON=on \
|
-D PKG_PYTHON=on \
|
||||||
|
-D WITH_PNG=off \
|
||||||
|
-D WITH_JPEG=off \
|
||||||
-S cmake -B build \
|
-S cmake -B build \
|
||||||
-D BUILD_SHARED_LIBS=on \
|
-D BUILD_SHARED_LIBS=on \
|
||||||
-D LAMMPS_EXCEPTIONS=on \
|
-D LAMMPS_EXCEPTIONS=on \
|
||||||
@ -46,4 +54,4 @@ jobs:
|
|||||||
- name: Run Unit Tests
|
- name: Run Unit Tests
|
||||||
working-directory: build
|
working-directory: build
|
||||||
shell: bash
|
shell: bash
|
||||||
run: ctest -V -C Release
|
run: ctest -V -C Release -E FixTimestep:python_move_nve
|
||||||
|
|||||||
7
.github/workflows/unittest-macos.yml
vendored
7
.github/workflows/unittest-macos.yml
vendored
@ -3,7 +3,11 @@ name: "Unittest for MacOS"
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [develop]
|
branches:
|
||||||
|
- develop
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- develop
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
@ -39,6 +43,7 @@ jobs:
|
|||||||
working-directory: build
|
working-directory: build
|
||||||
run: |
|
run: |
|
||||||
ccache -z
|
ccache -z
|
||||||
|
python3 -m pip install numpy
|
||||||
python3 -m pip install pyyaml
|
python3 -m pip install pyyaml
|
||||||
cmake -C ../cmake/presets/clang.cmake \
|
cmake -C ../cmake/presets/clang.cmake \
|
||||||
-C ../cmake/presets/most.cmake \
|
-C ../cmake/presets/most.cmake \
|
||||||
|
|||||||
91
CITATION.cff
Normal file
91
CITATION.cff
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
# YAML 1.2
|
||||||
|
---
|
||||||
|
cff-version: 1.2.0
|
||||||
|
title: "LAMMPS: Large-scale Atomic/Molecular Massively Parallel Simulator"
|
||||||
|
type: software
|
||||||
|
authors:
|
||||||
|
- family-names: "Plimpton"
|
||||||
|
given-names: "Steven J."
|
||||||
|
- family-names: "Kohlmeyer"
|
||||||
|
given-names: "Axel"
|
||||||
|
orcid: "https://orcid.org/0000-0001-6204-6475"
|
||||||
|
- family-names: "Thompson"
|
||||||
|
given-names: "Aidan P."
|
||||||
|
orcid: "https://orcid.org/0000-0002-0324-9114"
|
||||||
|
- family-names: "Moore"
|
||||||
|
given-names: "Stan G."
|
||||||
|
- family-names: "Berger"
|
||||||
|
given-names: "Richard"
|
||||||
|
orcid: "https://orcid.org/0000-0002-3044-8266"
|
||||||
|
doi: 10.5281/zenodo.3726416
|
||||||
|
license: GPL-2.0-only
|
||||||
|
url: https://www.lammps.org
|
||||||
|
repository-code: https://github.com/lammps/lammps/
|
||||||
|
keywords:
|
||||||
|
- "Molecular Dynamics"
|
||||||
|
- "Materials Modeling"
|
||||||
|
message: "If you are referencing LAMMPS in a publication, please cite the paper below."
|
||||||
|
preferred-citation:
|
||||||
|
type: article
|
||||||
|
doi: "10.1016/j.cpc.2021.108171"
|
||||||
|
url: "https://www.sciencedirect.com/science/article/pii/S0010465521002836"
|
||||||
|
authors:
|
||||||
|
- family-names: "Thompson"
|
||||||
|
given-names: "Aidan P."
|
||||||
|
orcid: "https://orcid.org/0000-0002-0324-9114"
|
||||||
|
- family-names: "Aktulga"
|
||||||
|
given-names: "H. Metin"
|
||||||
|
- family-names: "Berger"
|
||||||
|
given-names: "Richard"
|
||||||
|
orcid: "https://orcid.org/0000-0002-3044-8266"
|
||||||
|
- family-names: "Bolintineanu"
|
||||||
|
given-names: "Dan S."
|
||||||
|
- family-names: "Brown"
|
||||||
|
given-names: "W. Michael"
|
||||||
|
- family-names: "Crozier"
|
||||||
|
given-names: "Paul S."
|
||||||
|
- family-names: "in 't Veld"
|
||||||
|
given-names: "Pieter J."
|
||||||
|
- family-names: "Kohlmeyer"
|
||||||
|
given-names: "Axel"
|
||||||
|
orcid: "https://orcid.org/0000-0001-6204-6475"
|
||||||
|
- family-names: "Moore"
|
||||||
|
given-names: "Stan G."
|
||||||
|
- family-names: "Nguyen"
|
||||||
|
given-names: "Trung Dac"
|
||||||
|
- family-names: "Shan"
|
||||||
|
given-names: "Ray"
|
||||||
|
- family-names: "Stevens"
|
||||||
|
given-names: "Mark J."
|
||||||
|
- family-names: "Tranchida"
|
||||||
|
given-names: "Julien"
|
||||||
|
- family-names: "Trott"
|
||||||
|
given-names: "Christian"
|
||||||
|
- family-names: "Plimpton"
|
||||||
|
given-names: "Steven J."
|
||||||
|
title: "LAMMPS - a flexible simulation tool for particle-based materials modeling at the atomic, meso, and continuum scales"
|
||||||
|
journal: "Computer Physics Communications"
|
||||||
|
keywords:
|
||||||
|
- Molecular dynamics
|
||||||
|
- Materials modeling
|
||||||
|
- Parallel algorithms
|
||||||
|
- LAMMPS
|
||||||
|
month: 2
|
||||||
|
volume: 271
|
||||||
|
issn: 0010-4655
|
||||||
|
pages: 108171
|
||||||
|
year: 2022
|
||||||
|
references:
|
||||||
|
- title: "Fast Parallel Algorithms for Short-Range Molecular Dynamics"
|
||||||
|
type: article
|
||||||
|
journal: Journal of Computational Physics
|
||||||
|
volume: 117
|
||||||
|
number: 1
|
||||||
|
pages: "1-19"
|
||||||
|
year: 1995
|
||||||
|
issn: 0021-9991
|
||||||
|
doi: 10.1006/jcph.1995.1039
|
||||||
|
url: https://www.sciencedirect.com/science/article/pii/S002199918571039X
|
||||||
|
authors:
|
||||||
|
- family-names: "Plimpton"
|
||||||
|
given-names: "Steve"
|
||||||
4
README
4
README
@ -16,8 +16,8 @@ National Laboratories, a US Department of Energy facility, with
|
|||||||
funding from the DOE. It is an open-source code, distributed freely
|
funding from the DOE. It is an open-source code, distributed freely
|
||||||
under the terms of the GNU Public License (GPL) version 2.
|
under the terms of the GNU Public License (GPL) version 2.
|
||||||
|
|
||||||
The primary author of the code is Steve Plimpton, who can be emailed
|
The code is maintained by the LAMMPS development team who can be emailed
|
||||||
at sjplimp@sandia.gov. The LAMMPS WWW Site at www.lammps.org has
|
at developers@lammps.org. The LAMMPS WWW Site at www.lammps.org has
|
||||||
more information about the code and its uses.
|
more information about the code and its uses.
|
||||||
|
|
||||||
The LAMMPS distribution includes the following files and directories:
|
The LAMMPS distribution includes the following files and directories:
|
||||||
|
|||||||
31
SECURITY.md
31
SECURITY.md
@ -14,14 +14,14 @@ and tested by the LAMMPS developers, so it is easy to import bad
|
|||||||
behavior from calling functions in one of those libraries.
|
behavior from calling functions in one of those libraries.
|
||||||
|
|
||||||
Thus is is quite easy to crash LAMMPS through malicious input and do all
|
Thus is is quite easy to crash LAMMPS through malicious input and do all
|
||||||
kinds of filesystem manipulations. And because of that LAMMPS should
|
kinds of file system manipulations. And because of that LAMMPS should
|
||||||
**NEVER** be compiled or **run** as superuser, either from a "root" or
|
**NEVER** be compiled or **run** as superuser, either from a "root" or
|
||||||
"administrator" account directly or indirectly via "sudo" or "su".
|
"administrator" account directly or indirectly via "sudo" or "su".
|
||||||
|
|
||||||
Therefore what could be seen as a security vulnerability is usually
|
Therefore what could be seen as a security vulnerability is usually
|
||||||
either a user mistake or a bug in the code. Bugs can be reported in
|
either a user mistake or a bug in the code. Bugs can be reported in the
|
||||||
the LAMMPS project
|
LAMMPS project [issue tracker on
|
||||||
[issue tracker on GitHub](https://github.com/lammps/lammps/issues).
|
GitHub](https://github.com/lammps/lammps/issues).
|
||||||
|
|
||||||
To mitigate issues with using homoglyphs or bidirectional reordering in
|
To mitigate issues with using homoglyphs or bidirectional reordering in
|
||||||
unicode, which have been demonstrated as a vector to obfuscate and hide
|
unicode, which have been demonstrated as a vector to obfuscate and hide
|
||||||
@ -30,10 +30,19 @@ for unicode characters and only all-ASCII source code is accepted.
|
|||||||
|
|
||||||
# Version Updates
|
# Version Updates
|
||||||
|
|
||||||
LAMMPS follows continuous release development model. We aim to keep all
|
LAMMPS follows a continuous release development model. We aim to keep
|
||||||
release versions (stable or patch) fully functional and employ a variety
|
the development version (`develop` branch) always fully functional and
|
||||||
of automatic testing procedures to detect failures of existing
|
employ a variety of automatic testing procedures to detect failures
|
||||||
functionality from adding new features before releases are made. Thus
|
of existing functionality from adding or modifying features. Most of
|
||||||
bugfixes and updates are only integrated into the current development
|
those tests are run on pull requests *before* merging to the `develop`
|
||||||
branch and thus the next (patch) release and users are recommended to
|
branch. The `develop` branch is protected, so all changes *must* be
|
||||||
update regularly.
|
submitted as a pull request and thus cannot avoid the automated tests.
|
||||||
|
|
||||||
|
Additional tests are run *after* merging. Before releases are made
|
||||||
|
*all* tests must have cleared. Then a release tag is applied and the
|
||||||
|
`release` branch is fast-forwarded to that tag. This is often referred
|
||||||
|
to as a patch release. Bug fixes and updates are
|
||||||
|
applied first to the `develop` branch. Later, they appear in the `release`
|
||||||
|
branch when the next patch release occurs.
|
||||||
|
For stable releases, selected bug fixes, updates, and new functionality
|
||||||
|
are pushed to the `stable` branch and a new stable tag is applied.
|
||||||
|
|||||||
@ -3,15 +3,31 @@
|
|||||||
# This file is part of LAMMPS
|
# This file is part of LAMMPS
|
||||||
# Created by Christoph Junghans and Richard Berger
|
# Created by Christoph Junghans and Richard Berger
|
||||||
cmake_minimum_required(VERSION 3.10)
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
########################################
|
||||||
# set policy to silence warnings about ignoring <PackageName>_ROOT but use it
|
# set policy to silence warnings about ignoring <PackageName>_ROOT but use it
|
||||||
if(POLICY CMP0074)
|
if(POLICY CMP0074)
|
||||||
cmake_policy(SET CMP0074 NEW)
|
cmake_policy(SET CMP0074 NEW)
|
||||||
endif()
|
endif()
|
||||||
|
# set policy to silence warnings about ignoring ${CMAKE_REQUIRED_LIBRARIES} but use it
|
||||||
|
if(POLICY CMP0075)
|
||||||
|
cmake_policy(SET CMP0075 NEW)
|
||||||
|
endif()
|
||||||
# set policy to silence warnings about missing executable permissions in
|
# set policy to silence warnings about missing executable permissions in
|
||||||
# pythonx.y-config when cross-compiling. review occasionally if it may be set to NEW
|
# pythonx.y-config when cross-compiling. review occasionally if it may be set to NEW
|
||||||
if(POLICY CMP0109)
|
if(POLICY CMP0109)
|
||||||
cmake_policy(SET CMP0109 OLD)
|
cmake_policy(SET CMP0109 OLD)
|
||||||
endif()
|
endif()
|
||||||
|
# set policy to silence warnings about timestamps of downloaded files. review occasionally if it may be set to NEW
|
||||||
|
if(POLICY CMP0135)
|
||||||
|
cmake_policy(SET CMP0135 OLD)
|
||||||
|
endif()
|
||||||
|
########################################
|
||||||
|
# Use CONFIGURE_DEPENDS as option for file(GLOB...) when available
|
||||||
|
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||||
|
unset(CONFIGURE_DEPENDS)
|
||||||
|
else()
|
||||||
|
set(CONFIGURE_DEPENDS CONFIGURE_DEPENDS)
|
||||||
|
endif()
|
||||||
########################################
|
########################################
|
||||||
|
|
||||||
project(lammps CXX)
|
project(lammps CXX)
|
||||||
@ -100,7 +116,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
|||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4)
|
||||||
set(CMAKE_TUNE_DEFAULT "-xCOMMON-AVX512")
|
set(CMAKE_TUNE_DEFAULT "-xCOMMON-AVX512")
|
||||||
else()
|
else()
|
||||||
set(CMAKE_TUNE_DEFAULT "-xHost")
|
set(CMAKE_TUNE_DEFAULT "-xHost -fp-model fast=2 -no-prec-div -qoverride-limits -diag-disable=10441 -diag-disable=2196")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -135,13 +151,11 @@ set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "Use compiler extensions")
|
|||||||
# ugly hacks for MSVC which by default always reports an old C++ standard in the __cplusplus macro
|
# ugly hacks for MSVC which by default always reports an old C++ standard in the __cplusplus macro
|
||||||
# and prints lots of pointless warnings about "unsafe" functions
|
# and prints lots of pointless warnings about "unsafe" functions
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
if((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Intel"))
|
||||||
add_compile_options(/Zc:__cplusplus)
|
add_compile_options(/Zc:__cplusplus)
|
||||||
add_compile_options(/wd4244)
|
add_compile_options(/wd4244)
|
||||||
add_compile_options(/wd4267)
|
add_compile_options(/wd4267)
|
||||||
if(LAMMPS_EXCEPTIONS)
|
add_compile_options(/EHsc)
|
||||||
add_compile_options(/EHsc)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
||||||
endif()
|
endif()
|
||||||
@ -154,6 +168,19 @@ endif()
|
|||||||
########################################################################
|
########################################################################
|
||||||
# User input options #
|
# User input options #
|
||||||
########################################################################
|
########################################################################
|
||||||
|
# set path to python interpreter and thus enforcing python version when
|
||||||
|
# in a virtual environment and PYTHON_EXECUTABLE is not set on command line
|
||||||
|
if(DEFINED ENV{VIRTUAL_ENV} AND NOT PYTHON_EXECUTABLE)
|
||||||
|
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
|
||||||
|
set(PYTHON_EXECUTABLE "$ENV{VIRTUAL_ENV}/Scripts/python.exe")
|
||||||
|
else()
|
||||||
|
set(PYTHON_EXECUTABLE "$ENV{VIRTUAL_ENV}/bin/python")
|
||||||
|
endif()
|
||||||
|
set(Python_EXECUTABLE "${PYTHON_EXECUTABLE}")
|
||||||
|
message(STATUS "Running in virtual environment: $ENV{VIRTUAL_ENV}\n"
|
||||||
|
" Setting Python interpreter to: ${PYTHON_EXECUTABLE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(LAMMPS_MACHINE "" CACHE STRING "Suffix to append to lmp binary (WON'T enable any features automatically")
|
set(LAMMPS_MACHINE "" CACHE STRING "Suffix to append to lmp binary (WON'T enable any features automatically")
|
||||||
mark_as_advanced(LAMMPS_MACHINE)
|
mark_as_advanced(LAMMPS_MACHINE)
|
||||||
if(LAMMPS_MACHINE)
|
if(LAMMPS_MACHINE)
|
||||||
@ -175,8 +202,8 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
file(GLOB ALL_SOURCES ${LAMMPS_SOURCE_DIR}/[^.]*.cpp)
|
file(GLOB ALL_SOURCES ${CONFIGURE_DEPENDS} ${LAMMPS_SOURCE_DIR}/[^.]*.cpp)
|
||||||
file(GLOB MAIN_SOURCES ${LAMMPS_SOURCE_DIR}/main.cpp)
|
file(GLOB MAIN_SOURCES ${CONFIGURE_DEPENDS} ${LAMMPS_SOURCE_DIR}/main.cpp)
|
||||||
list(REMOVE_ITEM ALL_SOURCES ${MAIN_SOURCES})
|
list(REMOVE_ITEM ALL_SOURCES ${MAIN_SOURCES})
|
||||||
add_library(lammps ${ALL_SOURCES})
|
add_library(lammps ${ALL_SOURCES})
|
||||||
|
|
||||||
@ -295,6 +322,15 @@ if(PKG_ADIOS)
|
|||||||
# script that defines the MPI::MPI_C target
|
# script that defines the MPI::MPI_C target
|
||||||
enable_language(C)
|
enable_language(C)
|
||||||
find_package(ADIOS2 REQUIRED)
|
find_package(ADIOS2 REQUIRED)
|
||||||
|
if(BUILD_MPI)
|
||||||
|
if(NOT ADIOS2_HAVE_MPI)
|
||||||
|
message(FATAL_ERROR "ADIOS2 must be built with MPI support when LAMMPS has MPI enabled")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
if(ADIOS2_HAVE_MPI)
|
||||||
|
message(FATAL_ERROR "ADIOS2 must be built without MPI support when LAMMPS has MPI disabled")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
target_link_libraries(lammps PRIVATE adios2::adios2)
|
target_link_libraries(lammps PRIVATE adios2::adios2)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -363,12 +399,13 @@ pkg_depends(DIELECTRIC EXTRA-PAIR)
|
|||||||
pkg_depends(CG-DNA MOLECULE)
|
pkg_depends(CG-DNA MOLECULE)
|
||||||
pkg_depends(CG-DNA ASPHERE)
|
pkg_depends(CG-DNA ASPHERE)
|
||||||
pkg_depends(ELECTRODE KSPACE)
|
pkg_depends(ELECTRODE KSPACE)
|
||||||
|
pkg_depends(EXTRA-MOLECULE MOLECULE)
|
||||||
|
|
||||||
# detect if we may enable OpenMP support by default
|
# detect if we may enable OpenMP support by default
|
||||||
set(BUILD_OMP_DEFAULT OFF)
|
set(BUILD_OMP_DEFAULT OFF)
|
||||||
find_package(OpenMP QUIET)
|
find_package(OpenMP COMPONENTS CXX QUIET)
|
||||||
if(OpenMP_FOUND)
|
if(OpenMP_CXX_FOUND)
|
||||||
check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE)
|
check_omp_h_include()
|
||||||
if(HAVE_OMP_H_INCLUDE)
|
if(HAVE_OMP_H_INCLUDE)
|
||||||
set(BUILD_OMP_DEFAULT ON)
|
set(BUILD_OMP_DEFAULT ON)
|
||||||
endif()
|
endif()
|
||||||
@ -377,8 +414,8 @@ endif()
|
|||||||
option(BUILD_OMP "Build with OpenMP support" ${BUILD_OMP_DEFAULT})
|
option(BUILD_OMP "Build with OpenMP support" ${BUILD_OMP_DEFAULT})
|
||||||
|
|
||||||
if(BUILD_OMP)
|
if(BUILD_OMP)
|
||||||
find_package(OpenMP REQUIRED)
|
find_package(OpenMP COMPONENTS CXX REQUIRED)
|
||||||
check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE)
|
check_omp_h_include()
|
||||||
if(NOT HAVE_OMP_H_INCLUDE)
|
if(NOT HAVE_OMP_H_INCLUDE)
|
||||||
message(FATAL_ERROR "Cannot find the 'omp.h' header file required for full OpenMP support")
|
message(FATAL_ERROR "Cannot find the 'omp.h' header file required for full OpenMP support")
|
||||||
endif()
|
endif()
|
||||||
@ -410,8 +447,8 @@ if(PKG_MSCG OR PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_LATTE OR PKG_ELECTRODE
|
|||||||
status(FATAL_ERROR "Cannot build internal linear algebra library as CMake build tool lacks Fortran support")
|
status(FATAL_ERROR "Cannot build internal linear algebra library as CMake build tool lacks Fortran support")
|
||||||
endif()
|
endif()
|
||||||
enable_language(Fortran)
|
enable_language(Fortran)
|
||||||
file(GLOB LAPACK_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/linalg/[^.]*.[fF])
|
file(GLOB LINALG_SOURCES ${CONFIGURE_DEPENDS} ${LAMMPS_LIB_SOURCE_DIR}/linalg/[^.]*.[fF])
|
||||||
add_library(linalg STATIC ${LAPACK_SOURCES})
|
add_library(linalg STATIC ${LINALG_SOURCES})
|
||||||
set_target_properties(linalg PROPERTIES OUTPUT_NAME lammps_linalg${LAMMPS_MACHINE})
|
set_target_properties(linalg PROPERTIES OUTPUT_NAME lammps_linalg${LAMMPS_MACHINE})
|
||||||
set(BLAS_LIBRARIES "$<TARGET_FILE:linalg>")
|
set(BLAS_LIBRARIES "$<TARGET_FILE:linalg>")
|
||||||
set(LAPACK_LIBRARIES "$<TARGET_FILE:linalg>")
|
set(LAPACK_LIBRARIES "$<TARGET_FILE:linalg>")
|
||||||
@ -539,8 +576,8 @@ endforeach()
|
|||||||
foreach(PKG ${STANDARD_PACKAGES})
|
foreach(PKG ${STANDARD_PACKAGES})
|
||||||
set(${PKG}_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/${PKG})
|
set(${PKG}_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/${PKG})
|
||||||
|
|
||||||
file(GLOB ${PKG}_SOURCES ${${PKG}_SOURCES_DIR}/[^.]*.cpp)
|
file(GLOB ${PKG}_SOURCES ${CONFIGURE_DEPENDS} ${${PKG}_SOURCES_DIR}/[^.]*.cpp)
|
||||||
file(GLOB ${PKG}_HEADERS ${${PKG}_SOURCES_DIR}/[^.]*.h)
|
file(GLOB ${PKG}_HEADERS ${CONFIGURE_DEPENDS} ${${PKG}_SOURCES_DIR}/[^.]*.h)
|
||||||
|
|
||||||
# check for package files in src directory due to old make system
|
# check for package files in src directory due to old make system
|
||||||
DetectBuildSystemConflict(${LAMMPS_SOURCE_DIR} ${${PKG}_SOURCES} ${${PKG}_HEADERS})
|
DetectBuildSystemConflict(${LAMMPS_SOURCE_DIR} ${${PKG}_SOURCES} ${${PKG}_HEADERS})
|
||||||
@ -567,8 +604,8 @@ endforeach()
|
|||||||
foreach(PKG ${SUFFIX_PACKAGES})
|
foreach(PKG ${SUFFIX_PACKAGES})
|
||||||
set(${PKG}_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/${PKG})
|
set(${PKG}_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/${PKG})
|
||||||
|
|
||||||
file(GLOB ${PKG}_SOURCES ${${PKG}_SOURCES_DIR}/[^.]*.cpp)
|
file(GLOB ${PKG}_SOURCES ${CONFIGURE_DEPENDS} ${${PKG}_SOURCES_DIR}/[^.]*.cpp)
|
||||||
file(GLOB ${PKG}_HEADERS ${${PKG}_SOURCES_DIR}/[^.]*.h)
|
file(GLOB ${PKG}_HEADERS ${CONFIGURE_DEPENDS} ${${PKG}_SOURCES_DIR}/[^.]*.h)
|
||||||
|
|
||||||
# check for package files in src directory due to old make system
|
# check for package files in src directory due to old make system
|
||||||
DetectBuildSystemConflict(${LAMMPS_SOURCE_DIR} ${${PKG}_SOURCES} ${${PKG}_HEADERS})
|
DetectBuildSystemConflict(${LAMMPS_SOURCE_DIR} ${${PKG}_SOURCES} ${${PKG}_HEADERS})
|
||||||
@ -584,10 +621,10 @@ foreach(PKG_LIB POEMS ATC AWPMD H5MD MESONT)
|
|||||||
string(TOLOWER "${PKG_LIB}" PKG_LIB)
|
string(TOLOWER "${PKG_LIB}" PKG_LIB)
|
||||||
if(PKG_LIB STREQUAL "mesont")
|
if(PKG_LIB STREQUAL "mesont")
|
||||||
enable_language(Fortran)
|
enable_language(Fortran)
|
||||||
file(GLOB_RECURSE ${PKG_LIB}_SOURCES
|
file(GLOB_RECURSE ${PKG_LIB}_SOURCES ${CONFIGURE_DEPENDS}
|
||||||
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.f90)
|
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.f90)
|
||||||
else()
|
else()
|
||||||
file(GLOB_RECURSE ${PKG_LIB}_SOURCES
|
file(GLOB_RECURSE ${PKG_LIB}_SOURCES ${CONFIGURE_DEPENDS}
|
||||||
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.c
|
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.c
|
||||||
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.cpp)
|
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.cpp)
|
||||||
endif()
|
endif()
|
||||||
@ -706,18 +743,17 @@ list(FIND LANGUAGES "Fortran" _index)
|
|||||||
if(_index GREATER -1)
|
if(_index GREATER -1)
|
||||||
target_link_libraries(lammps PRIVATE ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES})
|
target_link_libraries(lammps PRIVATE ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
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
|
set(LAMMPS_CXX_HEADERS angle.h atom.h bond.h citeme.h comm.h command.h compute.h dihedral.h domain.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
|
error.h exceptions.h fix.h force.h group.h improper.h input.h info.h kspace.h lammps.h lattice.h
|
||||||
pair.h pointers.h region.h timer.h universe.h update.h utils.h variable.h)
|
library.h lmppython.h lmptype.h memory.h modify.h neighbor.h neigh_list.h output.h pair.h
|
||||||
if(LAMMPS_EXCEPTIONS)
|
platform.h pointers.h region.h timer.h universe.h update.h utils.h variable.h)
|
||||||
list(APPEND LAMMPS_CXX_HEADERS exceptions.h)
|
set(LAMMPS_FMT_HEADERS core.h format.h)
|
||||||
endif()
|
|
||||||
|
|
||||||
set_target_properties(lammps PROPERTIES OUTPUT_NAME lammps${LAMMPS_MACHINE})
|
set_target_properties(lammps PROPERTIES OUTPUT_NAME lammps${LAMMPS_MACHINE})
|
||||||
set_target_properties(lammps PROPERTIES SOVERSION ${SOVERSION})
|
set_target_properties(lammps PROPERTIES SOVERSION ${SOVERSION})
|
||||||
set_target_properties(lammps PROPERTIES PREFIX "lib")
|
set_target_properties(lammps PROPERTIES PREFIX "lib")
|
||||||
target_include_directories(lammps PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/lammps>)
|
target_include_directories(lammps PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/lammps>)
|
||||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps)
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/fmt)
|
||||||
foreach(_HEADER ${LAMMPS_CXX_HEADERS})
|
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_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_custom_target(${_HEADER} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER})
|
||||||
@ -726,6 +762,14 @@ foreach(_HEADER ${LAMMPS_CXX_HEADERS})
|
|||||||
install(FILES ${LAMMPS_SOURCE_DIR}/${_HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps)
|
install(FILES ${LAMMPS_SOURCE_DIR}/${_HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps)
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
foreach(_HEADER ${LAMMPS_FMT_HEADERS})
|
||||||
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/fmt/${_HEADER} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LAMMPS_SOURCE_DIR}/fmt/${_HEADER} ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/fmt/${_HEADER} DEPENDS ${LAMMPS_SOURCE_DIR}/fmt/${_HEADER})
|
||||||
|
add_custom_target(fmt_${_HEADER} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/fmt/${_HEADER})
|
||||||
|
add_dependencies(lammps fmt_${_HEADER})
|
||||||
|
if(BUILD_SHARED_LIBS)
|
||||||
|
install(FILES ${LAMMPS_SOURCE_DIR}/fmt/${_HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps/fmt)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
target_include_directories(lammps INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/includes>)
|
target_include_directories(lammps INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/includes>)
|
||||||
add_library(LAMMPS::lammps ALIAS lammps)
|
add_library(LAMMPS::lammps ALIAS lammps)
|
||||||
get_target_property(LAMMPS_DEFINES lammps INTERFACE_COMPILE_DEFINITIONS)
|
get_target_property(LAMMPS_DEFINES lammps INTERFACE_COMPILE_DEFINITIONS)
|
||||||
@ -780,9 +824,13 @@ if(BUILD_SHARED_LIBS)
|
|||||||
set(Python_ADDITIONAL_VERSIONS 3.12 3.11 3.10 3.9 3.8 3.7 3.6)
|
set(Python_ADDITIONAL_VERSIONS 3.12 3.11 3.10 3.9 3.8 3.7 3.6)
|
||||||
find_package(PythonInterp) # Deprecated since version 3.12
|
find_package(PythonInterp) # Deprecated since version 3.12
|
||||||
if(PYTHONINTERP_FOUND)
|
if(PYTHONINTERP_FOUND)
|
||||||
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
|
# backward compatibility
|
||||||
|
if(PYTHON_EXECUTABLE)
|
||||||
|
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||||
|
endif()
|
||||||
find_package(Python COMPONENTS Interpreter)
|
find_package(Python COMPONENTS Interpreter)
|
||||||
endif()
|
endif()
|
||||||
if(BUILD_IS_MULTI_CONFIG)
|
if(BUILD_IS_MULTI_CONFIG)
|
||||||
@ -815,16 +863,25 @@ endif()
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
if(BUILD_SHARED_LIBS OR PKG_PYTHON)
|
if(BUILD_SHARED_LIBS OR PKG_PYTHON)
|
||||||
if(CMAKE_VERSION VERSION_LESS 3.12)
|
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||||
|
# adjust so we find Python 3 versions before Python 2 on old systems with old CMake
|
||||||
|
set(Python_ADDITIONAL_VERSIONS 3.12 3.11 3.10 3.9 3.8 3.7 3.6)
|
||||||
find_package(PythonInterp) # Deprecated since version 3.12
|
find_package(PythonInterp) # Deprecated since version 3.12
|
||||||
if(PYTHONINTERP_FOUND)
|
if(PYTHONINTERP_FOUND)
|
||||||
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
|
# backward compatibility
|
||||||
|
if(PYTHON_EXECUTABLE)
|
||||||
|
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||||
|
endif()
|
||||||
find_package(Python COMPONENTS Interpreter)
|
find_package(Python COMPONENTS Interpreter)
|
||||||
endif()
|
endif()
|
||||||
if(Python_EXECUTABLE)
|
if(Python_EXECUTABLE)
|
||||||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/python)
|
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/python/lib)
|
||||||
install(CODE "execute_process(COMMAND ${Python_EXECUTABLE} setup.py build -b ${CMAKE_BINARY_DIR}/python install --prefix=${CMAKE_INSTALL_PREFIX} --root=\$ENV{DESTDIR}/ WORKING_DIRECTORY ${LAMMPS_PYTHON_DIR})")
|
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/python/src)
|
||||||
|
file(COPY ${LAMMPS_SOURCE_DIR}/version.h DESTINATION ${CMAKE_BINARY_DIR}/python/src)
|
||||||
|
file(COPY ${LAMMPS_PYTHON_DIR}/README ${LAMMPS_PYTHON_DIR}/pyproject.toml ${LAMMPS_PYTHON_DIR}/setup.py ${LAMMPS_PYTHON_DIR}/lammps DESTINATION ${CMAKE_BINARY_DIR}/python/lib)
|
||||||
|
install(CODE "if(\"\$ENV{DESTDIR}\" STREQUAL \"\")\n execute_process(COMMAND ${Python_EXECUTABLE} -m pip install -v ${CMAKE_BINARY_DIR}/python/lib --prefix=${CMAKE_INSTALL_PREFIX})\n else()\n execute_process(COMMAND ${Python_EXECUTABLE} -m pip install -v ${CMAKE_BINARY_DIR}/python/lib --prefix=${CMAKE_INSTALL_PREFIX} --root=\$ENV{DESTDIR})\n endif()")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -839,6 +896,23 @@ if(ClangFormat_FOUND)
|
|||||||
WORKING_DIRECTORY ${LAMMPS_SOURCE_DIR})
|
WORKING_DIRECTORY ${LAMMPS_SOURCE_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# extract Kokkos compilation settings
|
||||||
|
get_cmake_property(_allvars VARIABLES)
|
||||||
|
foreach(_var ${_allvars})
|
||||||
|
if(${_var})
|
||||||
|
string(REGEX MATCH "Kokkos_ENABLE_(SERIAL|THREADS|OPENMP|CUDA|HIP|SYCL|OPENMPTARGET|HPX)" _match ${_var})
|
||||||
|
if(_match)
|
||||||
|
string(REGEX REPLACE "Kokkos_ENABLE_(OPENMP|SERIAL|CUDA|HIP|SYCL)" "\\1" _match ${_var})
|
||||||
|
list(APPEND KOKKOS_DEVICE ${_match})
|
||||||
|
endif()
|
||||||
|
string(REGEX MATCH "Kokkos_ARCH" _match ${_var})
|
||||||
|
if(_match)
|
||||||
|
string(REGEX REPLACE "Kokkos_ARCH_(.*)" "\\1" _match ${_var})
|
||||||
|
list(APPEND KOKKOS_ARCH ${_match})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
get_target_property(DEFINES lammps COMPILE_DEFINITIONS)
|
get_target_property(DEFINES lammps COMPILE_DEFINITIONS)
|
||||||
if(BUILD_IS_MULTI_CONFIG)
|
if(BUILD_IS_MULTI_CONFIG)
|
||||||
set(LAMMPS_BUILD_TYPE "Multi-Config")
|
set(LAMMPS_BUILD_TYPE "Multi-Config")
|
||||||
@ -850,6 +924,7 @@ feature_summary(DESCRIPTION "The following tools and libraries have been found a
|
|||||||
message(STATUS "<<< Build configuration >>>
|
message(STATUS "<<< Build configuration >>>
|
||||||
LAMMPS Version: ${PROJECT_VERSION}
|
LAMMPS Version: ${PROJECT_VERSION}
|
||||||
Operating System: ${CMAKE_SYSTEM_NAME} ${CMAKE_LINUX_DISTRO} ${CMAKE_DISTRO_VERSION}
|
Operating System: ${CMAKE_SYSTEM_NAME} ${CMAKE_LINUX_DISTRO} ${CMAKE_DISTRO_VERSION}
|
||||||
|
CMake Version: ${CMAKE_VERSION}
|
||||||
Build type: ${LAMMPS_BUILD_TYPE}
|
Build type: ${LAMMPS_BUILD_TYPE}
|
||||||
Install path: ${CMAKE_INSTALL_PREFIX}
|
Install path: ${CMAKE_INSTALL_PREFIX}
|
||||||
Generator: ${CMAKE_GENERATOR} using ${CMAKE_MAKE_PROGRAM}")
|
Generator: ${CMAKE_GENERATOR} using ${CMAKE_MAKE_PROGRAM}")
|
||||||
@ -936,7 +1011,10 @@ if(PKG_GPU)
|
|||||||
message(STATUS "GPU precision: ${GPU_PREC}")
|
message(STATUS "GPU precision: ${GPU_PREC}")
|
||||||
endif()
|
endif()
|
||||||
if(PKG_KOKKOS)
|
if(PKG_KOKKOS)
|
||||||
message(STATUS "Kokkos Arch: ${KOKKOS_ARCH}")
|
message(STATUS "Kokkos Devices: ${KOKKOS_DEVICE}")
|
||||||
|
if(KOKKOS_ARCH)
|
||||||
|
message(STATUS "Kokkos Architecture: ${KOKKOS_ARCH}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(PKG_KSPACE)
|
if(PKG_KSPACE)
|
||||||
message(STATUS "<<< FFT settings >>>
|
message(STATUS "<<< FFT settings >>>
|
||||||
|
|||||||
@ -72,7 +72,7 @@
|
|||||||
"configurationType": "Debug",
|
"configurationType": "Debug",
|
||||||
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
||||||
"installRoot": "${workspaceRoot}\\install\\${name}",
|
"installRoot": "${workspaceRoot}\\install\\${name}",
|
||||||
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe",
|
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe -DBUILD_MPI=off",
|
||||||
"buildCommandArgs": "",
|
"buildCommandArgs": "",
|
||||||
"ctestCommandArgs": "",
|
"ctestCommandArgs": "",
|
||||||
"inheritEnvironments": [ "clang_cl_x64" ],
|
"inheritEnvironments": [ "clang_cl_x64" ],
|
||||||
@ -105,7 +105,7 @@
|
|||||||
"configurationType": "Release",
|
"configurationType": "Release",
|
||||||
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
||||||
"installRoot": "${workspaceRoot}\\install\\${name}",
|
"installRoot": "${workspaceRoot}\\install\\${name}",
|
||||||
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe",
|
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe -DBUILD_MPI=off",
|
||||||
"buildCommandArgs": "",
|
"buildCommandArgs": "",
|
||||||
"ctestCommandArgs": "-V",
|
"ctestCommandArgs": "-V",
|
||||||
"inheritEnvironments": [ "clang_cl_x64" ],
|
"inheritEnvironments": [ "clang_cl_x64" ],
|
||||||
@ -305,4 +305,4 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -17,7 +17,7 @@ if(BUILD_DOC)
|
|||||||
endif()
|
endif()
|
||||||
find_package(Doxygen 1.8.10 REQUIRED)
|
find_package(Doxygen 1.8.10 REQUIRED)
|
||||||
|
|
||||||
file(GLOB DOC_SOURCES ${LAMMPS_DOC_DIR}/src/[^.]*.rst)
|
file(GLOB DOC_SOURCES ${CONFIGURE_DEPENDS} ${LAMMPS_DOC_DIR}/src/[^.]*.rst)
|
||||||
|
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
@ -56,16 +56,27 @@ if(BUILD_DOC)
|
|||||||
)
|
)
|
||||||
|
|
||||||
set(MATHJAX_URL "https://github.com/mathjax/MathJax/archive/3.1.3.tar.gz" CACHE STRING "URL for MathJax tarball")
|
set(MATHJAX_URL "https://github.com/mathjax/MathJax/archive/3.1.3.tar.gz" CACHE STRING "URL for MathJax tarball")
|
||||||
set(MATHJAX_MD5 "d1c98c746888bfd52ca8ebc10704f92f" CACHE STRING "MD5 checksum of MathJax tarball")
|
set(MATHJAX_MD5 "b81661c6e6ba06278e6ae37b30b0c492" CACHE STRING "MD5 checksum of MathJax tarball")
|
||||||
mark_as_advanced(MATHJAX_URL)
|
mark_as_advanced(MATHJAX_URL)
|
||||||
|
GetFallbackURL(MATHJAX_URL MATHJAX_FALLBACK)
|
||||||
|
|
||||||
# download mathjax distribution and unpack to folder "mathjax"
|
# download mathjax distribution and unpack to folder "mathjax"
|
||||||
if(NOT EXISTS ${DOC_BUILD_STATIC_DIR}/mathjax/es5)
|
if(NOT EXISTS ${DOC_BUILD_STATIC_DIR}/mathjax/es5)
|
||||||
file(DOWNLOAD ${MATHJAX_URL}
|
if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/mathjax.tar.gz)
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/mathjax.tar.gz"
|
file(MD5 ${CMAKE_CURRENT_BINARY_DIR}/mathjax.tar.gz)
|
||||||
EXPECTED_MD5 ${MATHJAX_MD5})
|
endif()
|
||||||
|
if(NOT "${DL_MD5}" STREQUAL "${MATHJAX_MD5}")
|
||||||
|
file(DOWNLOAD ${MATHJAX_URL} "${CMAKE_CURRENT_BINARY_DIR}/mathjax.tar.gz" STATUS DL_STATUS SHOW_PROGRESS)
|
||||||
|
file(MD5 ${CMAKE_CURRENT_BINARY_DIR}/mathjax.tar.gz DL_MD5)
|
||||||
|
if((NOT DL_STATUS EQUAL 0) OR (NOT "${DL_MD5}" STREQUAL "${MATHJAX_MD5}"))
|
||||||
|
message(WARNING "Download from primary URL ${MATHJAX_URL} failed\nTrying fallback URL ${MATHJAX_FALLBACK}")
|
||||||
|
file(DOWNLOAD ${MATHJAX_FALLBACK} ${CMAKE_BINARY_DIR}/libpace.tar.gz EXPECTED_HASH MD5=${MATHJAX_MD5} SHOW_PROGRESS)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(STATUS "Using already downloaded archive ${CMAKE_BINARY_DIR}/libpace.tar.gz")
|
||||||
|
endif()
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf mathjax.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf mathjax.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
file(GLOB MATHJAX_VERSION_DIR ${CMAKE_CURRENT_BINARY_DIR}/MathJax-*)
|
file(GLOB MATHJAX_VERSION_DIR ${CONFIGURE_DEPENDS} ${CMAKE_CURRENT_BINARY_DIR}/MathJax-*)
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E rename ${MATHJAX_VERSION_DIR} ${DOC_BUILD_STATIC_DIR}/mathjax)
|
execute_process(COMMAND ${CMAKE_COMMAND} -E rename ${MATHJAX_VERSION_DIR} ${DOC_BUILD_STATIC_DIR}/mathjax)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@ -9,8 +9,22 @@ function(ExternalCMakeProject target url hash basedir cmakedir cmakefile)
|
|||||||
|
|
||||||
get_filename_component(archive ${url} NAME)
|
get_filename_component(archive ${url} NAME)
|
||||||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/_deps/src)
|
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/_deps/src)
|
||||||
message(STATUS "Downloading ${url}")
|
if(EXISTS ${CMAKE_BINARY_DIR}/_deps/${archive})
|
||||||
file(DOWNLOAD ${url} ${CMAKE_BINARY_DIR}/_deps/${archive} EXPECTED_HASH MD5=${hash} SHOW_PROGRESS)
|
file(MD5 ${CMAKE_BINARY_DIR}/_deps/${archive} DL_MD5)
|
||||||
|
endif()
|
||||||
|
if(NOT "${DL_MD5}" STREQUAL "${hash}")
|
||||||
|
message(STATUS "Downloading ${url}")
|
||||||
|
file(DOWNLOAD ${url} ${CMAKE_BINARY_DIR}/_deps/${archive} STATUS DL_STATUS SHOW_PROGRESS)
|
||||||
|
file(MD5 ${CMAKE_BINARY_DIR}/_deps/${archive} DL_MD5)
|
||||||
|
if((NOT DL_STATUS EQUAL 0) OR (NOT "${DL_MD5}" STREQUAL "${hash}"))
|
||||||
|
set(${target}_URL ${url})
|
||||||
|
GetFallbackURL(${target}_URL fallback)
|
||||||
|
message(WARNING "Download from primary URL ${url} failed\nTrying fallback URL ${fallback}")
|
||||||
|
file(DOWNLOAD ${fallback} ${CMAKE_BINARY_DIR}/_deps/${archive} EXPECTED_HASH MD5=${hash} SHOW_PROGRESS)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(STATUS "Using already downloaded archive ${CMAKE_BINARY_DIR}/_deps/${archive}")
|
||||||
|
endif()
|
||||||
message(STATUS "Unpacking and configuring ${archive}")
|
message(STATUS "Unpacking and configuring ${archive}")
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_BINARY_DIR}/_deps/${archive}
|
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_BINARY_DIR}/_deps/${archive}
|
||||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/_deps/src)
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/_deps/src)
|
||||||
|
|||||||
@ -1,5 +1,10 @@
|
|||||||
# Find clang-format
|
# Find clang-format
|
||||||
find_program(ClangFormat_EXECUTABLE NAMES clang-format
|
find_program(ClangFormat_EXECUTABLE NAMES clang-format
|
||||||
|
clang-format-15.0
|
||||||
|
clang-format-14.0
|
||||||
|
clang-format-13.0
|
||||||
|
clang-format-12.0
|
||||||
|
clang-format-11.0
|
||||||
clang-format-10.0
|
clang-format-10.0
|
||||||
clang-format-9.0
|
clang-format-9.0
|
||||||
clang-format-8.0
|
clang-format-8.0
|
||||||
@ -14,19 +19,27 @@ if(ClangFormat_EXECUTABLE)
|
|||||||
OUTPUT_VARIABLE clang_format_version
|
OUTPUT_VARIABLE clang_format_version
|
||||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
|
if(clang_format_version MATCHES "^(Ubuntu |)clang-format version .*")
|
||||||
if(clang_format_version MATCHES "^clang-format version .*")
|
# Arch Linux output:
|
||||||
# Arch Linux
|
|
||||||
# clang-format version 10.0.0
|
# clang-format version 10.0.0
|
||||||
|
#
|
||||||
# Ubuntu 18.04 LTS Output
|
# Ubuntu 18.04 LTS output:
|
||||||
# clang-format version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
|
# clang-format version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
|
||||||
string(REGEX REPLACE "clang-format version ([0-9.]+).*"
|
#
|
||||||
"\\1"
|
# Ubuntu 20.04 LTS output:
|
||||||
|
# clang-format version 10.0.0-4ubuntu1
|
||||||
|
#
|
||||||
|
# Ubuntu 22.04 LTS output:
|
||||||
|
# Ubuntu clang-format version 14.0.0-1ubuntu1
|
||||||
|
#
|
||||||
|
# Fedora 36 output:
|
||||||
|
# clang-format version 14.0.5 (Fedora 14.0.5-1.fc36)
|
||||||
|
string(REGEX REPLACE "^(Ubuntu |)clang-format version ([0-9.]+).*"
|
||||||
|
"\\2"
|
||||||
ClangFormat_VERSION
|
ClangFormat_VERSION
|
||||||
"${clang_format_version}")
|
"${clang_format_version}")
|
||||||
elseif(clang_format_version MATCHES ".*LLVM version .*")
|
elseif(clang_format_version MATCHES ".*LLVM version .*")
|
||||||
# CentOS 7 Output
|
# CentOS 7 output:
|
||||||
# LLVM (http://llvm.org/):
|
# LLVM (http://llvm.org/):
|
||||||
# LLVM version 3.4.2
|
# LLVM version 3.4.2
|
||||||
# Optimized build.
|
# Optimized build.
|
||||||
|
|||||||
@ -22,7 +22,7 @@ endif()
|
|||||||
if(Python_EXECUTABLE)
|
if(Python_EXECUTABLE)
|
||||||
get_filename_component(_python_path ${Python_EXECUTABLE} PATH)
|
get_filename_component(_python_path ${Python_EXECUTABLE} PATH)
|
||||||
find_program(Cythonize_EXECUTABLE
|
find_program(Cythonize_EXECUTABLE
|
||||||
NAMES cythonize3 cythonize cythonize.bat
|
NAMES cythonize-${Python_VERSION_MAJOR}.${Python_VERSION_MINOR} cythonize3 cythonize cythonize.bat
|
||||||
HINTS ${_python_path})
|
HINTS ${_python_path})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@ -1,19 +0,0 @@
|
|||||||
find_path(ZMQ_INCLUDE_DIR zmq.h)
|
|
||||||
find_library(ZMQ_LIBRARY NAMES zmq)
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
find_package_handle_standard_args(ZMQ DEFAULT_MSG ZMQ_LIBRARY ZMQ_INCLUDE_DIR)
|
|
||||||
|
|
||||||
# Copy the results to the output variables and target.
|
|
||||||
if(ZMQ_FOUND)
|
|
||||||
set(ZMQ_LIBRARIES ${ZMQ_LIBRARY})
|
|
||||||
set(ZMQ_INCLUDE_DIRS ${ZMQ_INCLUDE_DIR})
|
|
||||||
|
|
||||||
if(NOT TARGET ZMQ::ZMQ)
|
|
||||||
add_library(ZMQ::ZMQ UNKNOWN IMPORTED)
|
|
||||||
set_target_properties(ZMQ::ZMQ PROPERTIES
|
|
||||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
|
||||||
IMPORTED_LOCATION "${ZMQ_LIBRARY}"
|
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${ZMQ_INCLUDE_DIR}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
@ -6,6 +6,9 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
|||||||
"Please remove CMakeCache.txt and CMakeFiles first.")
|
"Please remove CMakeCache.txt and CMakeFiles first.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(LAMMPS_THIRDPARTY_URL "https://download.lammps.org/thirdparty"
|
||||||
|
CACHE STRING "URL for thirdparty package downloads")
|
||||||
|
|
||||||
# global LAMMPS/plugin build settings
|
# global LAMMPS/plugin build settings
|
||||||
set(LAMMPS_SOURCE_DIR "" CACHE PATH "Location of LAMMPS sources folder")
|
set(LAMMPS_SOURCE_DIR "" CACHE PATH "Location of LAMMPS sources folder")
|
||||||
if(NOT LAMMPS_SOURCE_DIR)
|
if(NOT LAMMPS_SOURCE_DIR)
|
||||||
@ -62,7 +65,7 @@ endfunction(validate_option)
|
|||||||
|
|
||||||
# helper function for getting the most recently modified file or folder from a glob pattern
|
# helper function for getting the most recently modified file or folder from a glob pattern
|
||||||
function(get_newest_file path variable)
|
function(get_newest_file path variable)
|
||||||
file(GLOB _dirs ${path})
|
file(GLOB _dirs ${CONFIGURE_DEPENDS} ${path})
|
||||||
set(_besttime 2000-01-01T00:00:00)
|
set(_besttime 2000-01-01T00:00:00)
|
||||||
set(_bestfile "<unknown>")
|
set(_bestfile "<unknown>")
|
||||||
foreach(_dir ${_dirs})
|
foreach(_dir ${_dirs})
|
||||||
@ -78,6 +81,25 @@ function(get_newest_file path variable)
|
|||||||
set(${variable} ${_bestfile} PARENT_SCOPE)
|
set(${variable} ${_bestfile} PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
# get LAMMPS version date
|
||||||
|
function(get_lammps_version version_header variable)
|
||||||
|
file(STRINGS ${version_header} line REGEX LAMMPS_VERSION)
|
||||||
|
string(REGEX REPLACE "#define LAMMPS_VERSION \"([0-9]+) ([A-Za-z]+) ([0-9]+)\"" "\\1\\2\\3" date "${line}")
|
||||||
|
set(${variable} "${date}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# determine canonical URL for downloading backup copy from download.lammps.org/thirdparty
|
||||||
|
function(GetFallbackURL input output)
|
||||||
|
string(REPLACE "_URL" "" _tmp ${input})
|
||||||
|
string(TOLOWER ${_tmp} libname)
|
||||||
|
string(REGEX REPLACE "^https://.*/([^/]+gz)" "${LAMMPS_THIRDPARTY_URL}/${libname}-\\1" newurl "${${input}}")
|
||||||
|
if ("${newurl}" STREQUAL "${${input}}")
|
||||||
|
set(${output} "" PARENT_SCOPE)
|
||||||
|
else()
|
||||||
|
set(${output} ${newurl} PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endfunction(GetFallbackURL)
|
||||||
|
|
||||||
#################################################################################
|
#################################################################################
|
||||||
# LAMMPS C++ interface. We only need the header related parts except on windows.
|
# LAMMPS C++ interface. We only need the header related parts except on windows.
|
||||||
add_library(lammps INTERFACE)
|
add_library(lammps INTERFACE)
|
||||||
@ -89,6 +111,7 @@ endif()
|
|||||||
################################################################################
|
################################################################################
|
||||||
# MPI configuration
|
# MPI configuration
|
||||||
if(NOT CMAKE_CROSSCOMPILING)
|
if(NOT CMAKE_CROSSCOMPILING)
|
||||||
|
set(MPI_CXX_SKIP_MPICXX TRUE)
|
||||||
find_package(MPI QUIET)
|
find_package(MPI QUIET)
|
||||||
option(BUILD_MPI "Build MPI version" ${MPI_FOUND})
|
option(BUILD_MPI "Build MPI version" ${MPI_FOUND})
|
||||||
else()
|
else()
|
||||||
@ -101,45 +124,76 @@ if(BUILD_MPI)
|
|||||||
set(MPI_CXX_SKIP_MPICXX TRUE)
|
set(MPI_CXX_SKIP_MPICXX TRUE)
|
||||||
# We use a non-standard procedure to cross-compile with MPI on Windows
|
# We use a non-standard procedure to cross-compile with MPI on Windows
|
||||||
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING)
|
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING)
|
||||||
# Download and configure custom MPICH files for Windows
|
# Download and configure MinGW compatible MPICH development files for Windows
|
||||||
message(STATUS "Downloading and configuring MPICH-1.4.1 for Windows")
|
option(USE_MSMPI "Use Microsoft's MS-MPI SDK instead of MPICH2-1.4.1" OFF)
|
||||||
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win64-devel.tar.gz" CACHE STRING "URL for MPICH2 (win64) tarball")
|
if(USE_MSMPI)
|
||||||
set(MPICH2_WIN32_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win32-devel.tar.gz" CACHE STRING "URL for MPICH2 (win32) tarball")
|
message(STATUS "Downloading and configuring MS-MPI 10.1 for Windows cross-compilation")
|
||||||
set(MPICH2_WIN64_DEVEL_MD5 "4939fdb59d13182fd5dd65211e469f14" CACHE STRING "MD5 checksum of MPICH2 (win64) tarball")
|
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/msmpi-win64-devel.tar.gz" CACHE STRING "URL for MS-MPI (win64) tarball")
|
||||||
set(MPICH2_WIN32_DEVEL_MD5 "a61d153500dce44e21b755ee7257e031" CACHE STRING "MD5 checksum of MPICH2 (win32) tarball")
|
set(MPICH2_WIN64_DEVEL_MD5 "86314daf1bffb809f1fcbefb8a547490" CACHE STRING "MD5 checksum of MS-MPI (win64) tarball")
|
||||||
mark_as_advanced(MPICH2_WIN64_DEVEL_URL)
|
mark_as_advanced(MPICH2_WIN64_DEVEL_URL)
|
||||||
mark_as_advanced(MPICH2_WIN32_DEVEL_URL)
|
mark_as_advanced(MPICH2_WIN64_DEVEL_MD5)
|
||||||
mark_as_advanced(MPICH2_WIN64_DEVEL_MD5)
|
|
||||||
mark_as_advanced(MPICH2_WIN32_DEVEL_MD5)
|
|
||||||
|
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
||||||
ExternalProject_Add(mpi4win_build
|
ExternalProject_Add(mpi4win_build
|
||||||
URL ${MPICH2_WIN64_DEVEL_URL}
|
URL ${MPICH2_WIN64_DEVEL_URL}
|
||||||
URL_MD5 ${MPICH2_WIN64_DEVEL_MD5}
|
URL_MD5 ${MPICH2_WIN64_DEVEL_MD5}
|
||||||
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
|
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
|
||||||
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
|
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmsmpi.a)
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Only x86 64-bit builds are supported with MS-MPI")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
|
||||||
|
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
|
||||||
|
add_library(MPI::MPI_CXX UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(MPI::MPI_CXX PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmsmpi.a"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
|
||||||
|
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
||||||
|
add_dependencies(MPI::MPI_CXX mpi4win_build)
|
||||||
|
|
||||||
|
# set variables for status reporting at the end of CMake run
|
||||||
|
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
|
||||||
|
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
||||||
|
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmsmpi.a")
|
||||||
else()
|
else()
|
||||||
ExternalProject_Add(mpi4win_build
|
# Download and configure custom MPICH files for Windows
|
||||||
URL ${MPICH2_WIN32_DEVEL_URL}
|
message(STATUS "Downloading and configuring MPICH-1.4.1 for Windows")
|
||||||
URL_MD5 ${MPICH2_WIN32_DEVEL_MD5}
|
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win64-devel.tar.gz" CACHE STRING "URL for MPICH2 (win64) tarball")
|
||||||
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
|
set(MPICH2_WIN64_DEVEL_MD5 "4939fdb59d13182fd5dd65211e469f14" CACHE STRING "MD5 checksum of MPICH2 (win64) tarball")
|
||||||
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
|
mark_as_advanced(MPICH2_WIN64_DEVEL_URL)
|
||||||
|
mark_as_advanced(MPICH2_WIN64_DEVEL_MD5)
|
||||||
|
|
||||||
|
include(ExternalProject)
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
||||||
|
ExternalProject_Add(mpi4win_build
|
||||||
|
URL ${MPICH2_WIN64_DEVEL_URL}
|
||||||
|
URL_MD5 ${MPICH2_WIN64_DEVEL_MD5}
|
||||||
|
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
|
||||||
|
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
|
||||||
|
else()
|
||||||
|
ExternalProject_Add(mpi4win_build
|
||||||
|
URL ${MPICH2_WIN32_DEVEL_URL}
|
||||||
|
URL_MD5 ${MPICH2_WIN32_DEVEL_MD5}
|
||||||
|
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
|
||||||
|
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
|
||||||
|
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
|
||||||
|
add_library(MPI::MPI_CXX UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(MPI::MPI_CXX PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmpi.a"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
|
||||||
|
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
||||||
|
add_dependencies(MPI::MPI_CXX mpi4win_build)
|
||||||
|
|
||||||
|
# set variables for status reporting at the end of CMake run
|
||||||
|
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
|
||||||
|
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
||||||
|
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
|
|
||||||
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
|
|
||||||
add_library(MPI::MPI_CXX UNKNOWN IMPORTED)
|
|
||||||
set_target_properties(MPI::MPI_CXX PROPERTIES
|
|
||||||
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmpi.a"
|
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
|
|
||||||
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
|
||||||
add_dependencies(MPI::MPI_CXX mpi4win_build)
|
|
||||||
|
|
||||||
# set variables for status reporting at the end of CMake run
|
|
||||||
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
|
|
||||||
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
|
||||||
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a")
|
|
||||||
else()
|
else()
|
||||||
find_package(MPI REQUIRED)
|
find_package(MPI REQUIRED)
|
||||||
option(LAMMPS_LONGLONG_TO_LONG "Workaround if your system or MPI version does not recognize 'long long' data types" OFF)
|
option(LAMMPS_LONGLONG_TO_LONG "Workaround if your system or MPI version does not recognize 'long long' data types" OFF)
|
||||||
|
|||||||
@ -24,9 +24,24 @@ function(validate_option name values)
|
|||||||
endif()
|
endif()
|
||||||
endfunction(validate_option)
|
endfunction(validate_option)
|
||||||
|
|
||||||
|
# helper function to check for usable omp.h header
|
||||||
|
function(check_omp_h_include)
|
||||||
|
find_package(OpenMP COMPONENTS CXX QUIET)
|
||||||
|
if(OpenMP_CXX_FOUND)
|
||||||
|
set(CMAKE_REQUIRED_FLAGS ${OpenMP_CXX_FLAGS})
|
||||||
|
set(CMAKE_REQUIRED_INCLUDES ${OpenMP_CXX_INCLUDE_DIRS})
|
||||||
|
set(CMAKE_REQUIRED_LINK_OPTIONS ${OpenMP_CXX_FLAGS})
|
||||||
|
set(CMAKE_REQUIRED_LIBRARIES ${OpenMP_CXX_LIBRARIES})
|
||||||
|
check_include_file_cxx(omp.h _have_omp_h)
|
||||||
|
else()
|
||||||
|
set(_have_omp_h FALSE)
|
||||||
|
endif()
|
||||||
|
set(HAVE_OMP_H_INCLUDE ${_have_omp_h} PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
# helper function for getting the most recently modified file or folder from a glob pattern
|
# helper function for getting the most recently modified file or folder from a glob pattern
|
||||||
function(get_newest_file path variable)
|
function(get_newest_file path variable)
|
||||||
file(GLOB _dirs ${path})
|
file(GLOB _dirs ${CONFIGURE_DEPENDS} ${path})
|
||||||
set(_besttime 2000-01-01T00:00:00)
|
set(_besttime 2000-01-01T00:00:00)
|
||||||
set(_bestfile "<unknown>")
|
set(_bestfile "<unknown>")
|
||||||
foreach(_dir ${_dirs})
|
foreach(_dir ${_dirs})
|
||||||
@ -65,8 +80,8 @@ endfunction()
|
|||||||
|
|
||||||
function(check_for_autogen_files source_dir)
|
function(check_for_autogen_files source_dir)
|
||||||
message(STATUS "Running check for auto-generated files from make-based build system")
|
message(STATUS "Running check for auto-generated files from make-based build system")
|
||||||
file(GLOB SRC_AUTOGEN_FILES ${source_dir}/style_*.h)
|
file(GLOB SRC_AUTOGEN_FILES ${CONFIGURE_DEPENDS} ${source_dir}/style_*.h)
|
||||||
file(GLOB SRC_AUTOGEN_PACKAGES ${source_dir}/packages_*.h)
|
file(GLOB SRC_AUTOGEN_PACKAGES ${CONFIGURE_DEPENDS} ${source_dir}/packages_*.h)
|
||||||
list(APPEND SRC_AUTOGEN_FILES ${SRC_AUTOGEN_PACKAGES} ${source_dir}/lmpinstalledpkgs.h ${source_dir}/lmpgitversion.h)
|
list(APPEND SRC_AUTOGEN_FILES ${SRC_AUTOGEN_PACKAGES} ${source_dir}/lmpinstalledpkgs.h ${source_dir}/lmpgitversion.h)
|
||||||
list(APPEND SRC_AUTOGEN_FILES ${SRC_AUTOGEN_PACKAGES} ${source_dir}/mliap_model_python_couple.h ${source_dir}/mliap_model_python_couple.cpp)
|
list(APPEND SRC_AUTOGEN_FILES ${SRC_AUTOGEN_PACKAGES} ${source_dir}/mliap_model_python_couple.h ${source_dir}/mliap_model_python_couple.cpp)
|
||||||
foreach(_SRC ${SRC_AUTOGEN_FILES})
|
foreach(_SRC ${SRC_AUTOGEN_FILES})
|
||||||
@ -85,7 +100,7 @@ endfunction()
|
|||||||
|
|
||||||
macro(pkg_depends PKG1 PKG2)
|
macro(pkg_depends PKG1 PKG2)
|
||||||
if(PKG_${PKG1} AND NOT (PKG_${PKG2} OR BUILD_${PKG2}))
|
if(PKG_${PKG1} AND NOT (PKG_${PKG2} OR BUILD_${PKG2}))
|
||||||
message(FATAL_ERROR "The ${PKG1} package needs LAMMPS to be build with the ${PKG2} package")
|
message(FATAL_ERROR "The ${PKG1} package needs LAMMPS to be built with the ${PKG2} package")
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
@ -110,14 +125,16 @@ function(FetchPotentials pkgfolder potfolder)
|
|||||||
math(EXPR plusone "${blank}+1")
|
math(EXPR plusone "${blank}+1")
|
||||||
string(SUBSTRING ${line} 0 ${blank} pot)
|
string(SUBSTRING ${line} 0 ${blank} pot)
|
||||||
string(SUBSTRING ${line} ${plusone} -1 sum)
|
string(SUBSTRING ${line} ${plusone} -1 sum)
|
||||||
if(EXISTS ${LAMMPS_POTENTIALS_DIR}/${pot})
|
if(EXISTS "${LAMMPS_POTENTIALS_DIR}/${pot}")
|
||||||
file(MD5 "${LAMMPS_POTENTIALS_DIR}/${pot}" oldsum)
|
file(MD5 "${LAMMPS_POTENTIALS_DIR}/${pot}" oldsum)
|
||||||
endif()
|
endif()
|
||||||
if(NOT sum STREQUAL oldsum)
|
if(NOT sum STREQUAL oldsum)
|
||||||
message(STATUS "Checking external potential ${pot} from ${LAMMPS_POTENTIALS_URL}")
|
message(STATUS "Downloading external potential ${pot} from ${LAMMPS_POTENTIALS_URL}")
|
||||||
file(DOWNLOAD "${LAMMPS_POTENTIALS_URL}/${pot}.${sum}" "${CMAKE_BINARY_DIR}/${pot}"
|
string(MD5 TMP_EXT "${CMAKE_BINARY_DIR}")
|
||||||
|
file(DOWNLOAD "${LAMMPS_POTENTIALS_URL}/${pot}.${sum}" "${CMAKE_BINARY_DIR}/${pot}.${TMP_EXT}"
|
||||||
EXPECTED_HASH MD5=${sum} SHOW_PROGRESS)
|
EXPECTED_HASH MD5=${sum} SHOW_PROGRESS)
|
||||||
file(COPY "${CMAKE_BINARY_DIR}/${pot}" DESTINATION ${LAMMPS_POTENTIALS_DIR})
|
file(COPY "${CMAKE_BINARY_DIR}/${pot}.${TMP_EXT}" DESTINATION "${LAMMPS_POTENTIALS_DIR}")
|
||||||
|
file(RENAME "${LAMMPS_POTENTIALS_DIR}/${pot}.${TMP_EXT}" "${LAMMPS_POTENTIALS_DIR}/${pot}")
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
@ -132,3 +149,15 @@ if((CMAKE_SYSTEM_NAME STREQUAL "Linux") AND (EXISTS /etc/os-release))
|
|||||||
set(CMAKE_LINUX_DISTRO ${distro})
|
set(CMAKE_LINUX_DISTRO ${distro})
|
||||||
set(CMAKE_DISTRO_VERSION ${disversion})
|
set(CMAKE_DISTRO_VERSION ${disversion})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# determine canonical URL for downloading backup copy from download.lammps.org/thirdparty
|
||||||
|
function(GetFallbackURL input output)
|
||||||
|
string(REPLACE "_URL" "" _tmp ${input})
|
||||||
|
string(TOLOWER ${_tmp} libname)
|
||||||
|
string(REGEX REPLACE "^https://.*/([^/]+gz)" "${LAMMPS_THIRDPARTY_URL}/${libname}-\\1" newurl "${${input}}")
|
||||||
|
if ("${newurl}" STREQUAL "${${input}}")
|
||||||
|
set(${output} "" PARENT_SCOPE)
|
||||||
|
else()
|
||||||
|
set(${output} ${newurl} PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endfunction(GetFallbackURL)
|
||||||
|
|||||||
@ -1,39 +1,74 @@
|
|||||||
# Download and configure custom MPICH files for Windows
|
# Download and configure MinGW compatible MPICH development files for Windows
|
||||||
message(STATUS "Downloading and configuring MPICH-1.4.1 for Windows")
|
option(USE_MSMPI "Use Microsoft's MS-MPI SDK instead of MPICH2-1.4.1" OFF)
|
||||||
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win64-devel.tar.gz" CACHE STRING "URL for MPICH2 (win64) tarball")
|
|
||||||
set(MPICH2_WIN32_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win32-devel.tar.gz" CACHE STRING "URL for MPICH2 (win32) tarball")
|
|
||||||
set(MPICH2_WIN64_DEVEL_MD5 "4939fdb59d13182fd5dd65211e469f14" CACHE STRING "MD5 checksum of MPICH2 (win64) tarball")
|
|
||||||
set(MPICH2_WIN32_DEVEL_MD5 "a61d153500dce44e21b755ee7257e031" CACHE STRING "MD5 checksum of MPICH2 (win32) tarball")
|
|
||||||
mark_as_advanced(MPICH2_WIN64_DEVEL_URL)
|
|
||||||
mark_as_advanced(MPICH2_WIN32_DEVEL_URL)
|
|
||||||
mark_as_advanced(MPICH2_WIN64_DEVEL_MD5)
|
|
||||||
mark_as_advanced(MPICH2_WIN32_DEVEL_MD5)
|
|
||||||
|
|
||||||
include(ExternalProject)
|
if(USE_MSMPI)
|
||||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
message(STATUS "Downloading and configuring MS-MPI 10.1 for Windows cross-compilation")
|
||||||
ExternalProject_Add(mpi4win_build
|
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/msmpi-win64-devel.tar.gz" CACHE STRING "URL for MS-MPI (win64) tarball")
|
||||||
URL ${MPICH2_WIN64_DEVEL_URL}
|
set(MPICH2_WIN64_DEVEL_MD5 "86314daf1bffb809f1fcbefb8a547490" CACHE STRING "MD5 checksum of MS-MPI (win64) tarball")
|
||||||
URL_MD5 ${MPICH2_WIN64_DEVEL_MD5}
|
mark_as_advanced(MPICH2_WIN64_DEVEL_URL)
|
||||||
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
|
mark_as_advanced(MPICH2_WIN64_DEVEL_MD5)
|
||||||
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
|
|
||||||
|
include(ExternalProject)
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
||||||
|
ExternalProject_Add(mpi4win_build
|
||||||
|
URL ${MPICH2_WIN64_DEVEL_URL}
|
||||||
|
URL_MD5 ${MPICH2_WIN64_DEVEL_MD5}
|
||||||
|
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
|
||||||
|
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmsmpi.a)
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Only x86 64-bit builds are supported with MS-MPI")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
|
||||||
|
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
|
||||||
|
add_library(MPI::MPI_CXX UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(MPI::MPI_CXX PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmsmpi.a"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
|
||||||
|
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
||||||
|
add_dependencies(MPI::MPI_CXX mpi4win_build)
|
||||||
|
|
||||||
|
# set variables for status reporting at the end of CMake run
|
||||||
|
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
|
||||||
|
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
||||||
|
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmsmpi.a")
|
||||||
else()
|
else()
|
||||||
ExternalProject_Add(mpi4win_build
|
message(STATUS "Downloading and configuring MPICH2-1.4.1 for Windows cross-compilation")
|
||||||
URL ${MPICH2_WIN32_DEVEL_URL}
|
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win64-devel.tar.gz" CACHE STRING "URL for MPICH2 (win64) tarball")
|
||||||
URL_MD5 ${MPICH2_WIN32_DEVEL_MD5}
|
set(MPICH2_WIN32_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win32-devel.tar.gz" CACHE STRING "URL for MPICH2 (win32) tarball")
|
||||||
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
|
set(MPICH2_WIN64_DEVEL_MD5 "4939fdb59d13182fd5dd65211e469f14" CACHE STRING "MD5 checksum of MPICH2 (win64) tarball")
|
||||||
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
|
set(MPICH2_WIN32_DEVEL_MD5 "a61d153500dce44e21b755ee7257e031" CACHE STRING "MD5 checksum of MPICH2 (win32) tarball")
|
||||||
|
mark_as_advanced(MPICH2_WIN64_DEVEL_URL)
|
||||||
|
mark_as_advanced(MPICH2_WIN32_DEVEL_URL)
|
||||||
|
mark_as_advanced(MPICH2_WIN64_DEVEL_MD5)
|
||||||
|
mark_as_advanced(MPICH2_WIN32_DEVEL_MD5)
|
||||||
|
|
||||||
|
include(ExternalProject)
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
||||||
|
ExternalProject_Add(mpi4win_build
|
||||||
|
URL ${MPICH2_WIN64_DEVEL_URL}
|
||||||
|
URL_MD5 ${MPICH2_WIN64_DEVEL_MD5}
|
||||||
|
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
|
||||||
|
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
|
||||||
|
else()
|
||||||
|
ExternalProject_Add(mpi4win_build
|
||||||
|
URL ${MPICH2_WIN32_DEVEL_URL}
|
||||||
|
URL_MD5 ${MPICH2_WIN32_DEVEL_MD5}
|
||||||
|
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
|
||||||
|
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
|
||||||
|
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
|
||||||
|
add_library(MPI::MPI_CXX UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(MPI::MPI_CXX PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmpi.a"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
|
||||||
|
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
||||||
|
add_dependencies(MPI::MPI_CXX mpi4win_build)
|
||||||
|
|
||||||
|
# set variables for status reporting at the end of CMake run
|
||||||
|
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
|
||||||
|
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
||||||
|
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
|
|
||||||
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
|
|
||||||
add_library(MPI::MPI_CXX UNKNOWN IMPORTED)
|
|
||||||
set_target_properties(MPI::MPI_CXX PROPERTIES
|
|
||||||
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmpi.a"
|
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
|
|
||||||
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
|
||||||
add_dependencies(MPI::MPI_CXX mpi4win_build)
|
|
||||||
|
|
||||||
# set variables for status reporting at the end of CMake run
|
|
||||||
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
|
|
||||||
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
|
||||||
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a")
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
set(COLVARS_SOURCE_DIR ${LAMMPS_LIB_SOURCE_DIR}/colvars)
|
set(COLVARS_SOURCE_DIR ${LAMMPS_LIB_SOURCE_DIR}/colvars)
|
||||||
|
|
||||||
file(GLOB COLVARS_SOURCES ${COLVARS_SOURCE_DIR}/[^.]*.cpp)
|
file(GLOB COLVARS_SOURCES ${CONFIGURE_DEPENDS} ${COLVARS_SOURCE_DIR}/[^.]*.cpp)
|
||||||
|
|
||||||
option(COLVARS_DEBUG "Debugging messages for Colvars (quite verbose)" OFF)
|
option(COLVARS_DEBUG "Debugging messages for Colvars (quite verbose)" OFF)
|
||||||
|
|
||||||
@ -9,7 +9,7 @@ option(COLVARS_LEPTON "Build and link the Lepton library" ON)
|
|||||||
|
|
||||||
if(COLVARS_LEPTON)
|
if(COLVARS_LEPTON)
|
||||||
set(LEPTON_DIR ${LAMMPS_LIB_SOURCE_DIR}/colvars/lepton)
|
set(LEPTON_DIR ${LAMMPS_LIB_SOURCE_DIR}/colvars/lepton)
|
||||||
file(GLOB LEPTON_SOURCES ${LEPTON_DIR}/src/[^.]*.cpp)
|
file(GLOB LEPTON_SOURCES ${CONFIGURE_DEPENDS} ${LEPTON_DIR}/src/[^.]*.cpp)
|
||||||
add_library(lepton STATIC ${LEPTON_SOURCES})
|
add_library(lepton STATIC ${LEPTON_SOURCES})
|
||||||
# Change the define below to LEPTON_BUILDING_SHARED_LIBRARY when linking Lepton as a DLL with MSVC
|
# Change the define below to LEPTON_BUILDING_SHARED_LIBRARY when linking Lepton as a DLL with MSVC
|
||||||
target_compile_definitions(lepton PRIVATE -DLEPTON_BUILDING_STATIC_LIBRARY)
|
target_compile_definitions(lepton PRIVATE -DLEPTON_BUILDING_STATIC_LIBRARY)
|
||||||
|
|||||||
@ -1,4 +1,9 @@
|
|||||||
find_package(ZLIB REQUIRED)
|
find_package(ZLIB)
|
||||||
|
if(NOT ZLIB_FOUND)
|
||||||
|
message(WARNING "No Zlib development support found. Disabling COMPRESS package...")
|
||||||
|
set(PKG_COMPRESS OFF CACHE BOOL "" FORCE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
target_link_libraries(lammps PRIVATE ZLIB::ZLIB)
|
target_link_libraries(lammps PRIVATE ZLIB::ZLIB)
|
||||||
|
|
||||||
find_package(PkgConfig QUIET)
|
find_package(PkgConfig QUIET)
|
||||||
|
|||||||
@ -26,7 +26,7 @@ elseif(GPU_PREC STREQUAL "SINGLE")
|
|||||||
set(GPU_PREC_SETTING "SINGLE_SINGLE")
|
set(GPU_PREC_SETTING "SINGLE_SINGLE")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
file(GLOB GPU_LIB_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cpp)
|
file(GLOB GPU_LIB_SOURCES ${CONFIGURE_DEPENDS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cpp)
|
||||||
file(MAKE_DIRECTORY ${LAMMPS_LIB_BINARY_DIR}/gpu)
|
file(MAKE_DIRECTORY ${LAMMPS_LIB_BINARY_DIR}/gpu)
|
||||||
|
|
||||||
if(GPU_API STREQUAL "CUDA")
|
if(GPU_API STREQUAL "CUDA")
|
||||||
@ -55,7 +55,7 @@ if(GPU_API STREQUAL "CUDA")
|
|||||||
set(GPU_ARCH "sm_50" 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)")
|
||||||
|
|
||||||
# ensure that no *cubin.h files exist from a compile in the lib/gpu folder
|
# ensure that no *cubin.h files exist from a compile in the lib/gpu folder
|
||||||
file(GLOB GPU_LIB_OLD_CUBIN_HEADERS ${LAMMPS_LIB_SOURCE_DIR}/gpu/*_cubin.h)
|
file(GLOB GPU_LIB_OLD_CUBIN_HEADERS ${CONFIGURE_DEPENDS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/*_cubin.h)
|
||||||
if(GPU_LIB_OLD_CUBIN_HEADERS)
|
if(GPU_LIB_OLD_CUBIN_HEADERS)
|
||||||
message(FATAL_ERROR "########################################################################\n"
|
message(FATAL_ERROR "########################################################################\n"
|
||||||
"Found file(s) generated by the make-based build system in lib/gpu\n"
|
"Found file(s) generated by the make-based build system in lib/gpu\n"
|
||||||
@ -65,15 +65,15 @@ if(GPU_API STREQUAL "CUDA")
|
|||||||
"########################################################################")
|
"########################################################################")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu ${CMAKE_CURRENT_SOURCE_DIR}/gpu/[^.]*.cu)
|
file(GLOB GPU_LIB_CU ${CONFIGURE_DEPENDS} ${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)
|
list(REMOVE_ITEM GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_pppm.cu)
|
||||||
|
|
||||||
cuda_include_directories(${LAMMPS_LIB_SOURCE_DIR}/gpu ${LAMMPS_LIB_BINARY_DIR}/gpu)
|
cuda_include_directories(${LAMMPS_LIB_SOURCE_DIR}/gpu ${LAMMPS_LIB_BINARY_DIR}/gpu)
|
||||||
|
|
||||||
if(CUDPP_OPT)
|
if(CUDPP_OPT)
|
||||||
cuda_include_directories(${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini)
|
cuda_include_directories(${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini)
|
||||||
file(GLOB GPU_LIB_CUDPP_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini/[^.]*.cpp)
|
file(GLOB GPU_LIB_CUDPP_SOURCES ${CONFIGURE_DEPENDS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini/[^.]*.cpp)
|
||||||
file(GLOB GPU_LIB_CUDPP_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini/[^.]*.cu)
|
file(GLOB GPU_LIB_CUDPP_CU ${CONFIGURE_DEPENDS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini/[^.]*.cu)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# build arch/gencode commands for nvcc based on CUDA toolkit version and use choice
|
# build arch/gencode commands for nvcc based on CUDA toolkit version and use choice
|
||||||
@ -82,6 +82,7 @@ if(GPU_API STREQUAL "CUDA")
|
|||||||
|
|
||||||
# apply the following to build "fat" CUDA binaries only for known CUDA toolkits since version 8.0
|
# apply the following to build "fat" CUDA binaries only for known CUDA toolkits since version 8.0
|
||||||
# only the Kepler achitecture and beyond is supported
|
# only the Kepler achitecture and beyond is supported
|
||||||
|
# comparison chart according to: https://en.wikipedia.org/wiki/CUDA#GPUs_supported
|
||||||
if(CUDA_VERSION VERSION_LESS 8.0)
|
if(CUDA_VERSION VERSION_LESS 8.0)
|
||||||
message(FATAL_ERROR "CUDA Toolkit version 8.0 or later is required")
|
message(FATAL_ERROR "CUDA Toolkit version 8.0 or later is required")
|
||||||
elseif(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
|
elseif(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
|
||||||
@ -120,14 +121,14 @@ if(GPU_API STREQUAL "CUDA")
|
|||||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.1")
|
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.1")
|
||||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_86,code=[sm_86,compute_86]")
|
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_86,code=[sm_86,compute_86]")
|
||||||
endif()
|
endif()
|
||||||
# Hopper (GPU Arch 9.0) is supported by CUDA 12.0? and later
|
# Lovelace (GPU Arch 8.9) is supported by CUDA 11.8 and later
|
||||||
|
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.8")
|
||||||
|
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_90,code=[sm_90,compute_90]")
|
||||||
|
endif()
|
||||||
|
# Hopper (GPU Arch 9.0) is supported by CUDA 12.0 and later
|
||||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
|
if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
|
||||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_90,code=[sm_90,compute_90]")
|
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_90,code=[sm_90,compute_90]")
|
||||||
endif()
|
endif()
|
||||||
# # Lovelace (GPU Arch 9.x) is supported by CUDA 12.0? and later
|
|
||||||
#if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
|
|
||||||
# string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_9x,code=[sm_9x,compute_9x]")
|
|
||||||
#endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
cuda_compile_fatbin(GPU_GEN_OBJS ${GPU_LIB_CU} OPTIONS ${CUDA_REQUEST_PIC}
|
cuda_compile_fatbin(GPU_GEN_OBJS ${GPU_LIB_CU} OPTIONS ${CUDA_REQUEST_PIC}
|
||||||
@ -182,7 +183,7 @@ elseif(GPU_API STREQUAL "OPENCL")
|
|||||||
include(OpenCLUtils)
|
include(OpenCLUtils)
|
||||||
set(OCL_COMMON_HEADERS ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_preprocessor.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_aux_fun1.h)
|
set(OCL_COMMON_HEADERS ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_preprocessor.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_aux_fun1.h)
|
||||||
|
|
||||||
file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu)
|
file(GLOB GPU_LIB_CU ${CONFIGURE_DEPENDS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu)
|
||||||
list(REMOVE_ITEM GPU_LIB_CU
|
list(REMOVE_ITEM GPU_LIB_CU
|
||||||
${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_gayberne.cu
|
${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_gayberne.cu
|
||||||
${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_gayberne_lj.cu
|
${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_gayberne_lj.cu
|
||||||
@ -233,7 +234,8 @@ elseif(GPU_API STREQUAL "OPENCL")
|
|||||||
elseif(GPU_API STREQUAL "HIP")
|
elseif(GPU_API STREQUAL "HIP")
|
||||||
if(NOT DEFINED HIP_PATH)
|
if(NOT DEFINED HIP_PATH)
|
||||||
if(NOT DEFINED ENV{HIP_PATH})
|
if(NOT DEFINED ENV{HIP_PATH})
|
||||||
set(HIP_PATH "/opt/rocm/hip" CACHE PATH "Path to HIP installation")
|
message(FATAL_ERROR "GPU_API=HIP requires HIP_PATH to be defined.\n"
|
||||||
|
"Either pass the HIP_PATH as a CMake option via -DHIP_PATH=... or set the HIP_PATH environment variable.")
|
||||||
else()
|
else()
|
||||||
set(HIP_PATH $ENV{HIP_PATH} CACHE PATH "Path to HIP installation")
|
set(HIP_PATH $ENV{HIP_PATH} CACHE PATH "Path to HIP installation")
|
||||||
endif()
|
endif()
|
||||||
@ -261,6 +263,8 @@ elseif(GPU_API STREQUAL "HIP")
|
|||||||
|
|
||||||
if(HIP_PLATFORM STREQUAL "hcc" OR HIP_PLATFORM STREQUAL "amd")
|
if(HIP_PLATFORM STREQUAL "hcc" OR HIP_PLATFORM STREQUAL "amd")
|
||||||
set(HIP_ARCH "gfx906" CACHE STRING "HIP target architecture")
|
set(HIP_ARCH "gfx906" CACHE STRING "HIP target architecture")
|
||||||
|
elseif(HIP_PLATFORM STREQUAL "spirv")
|
||||||
|
set(HIP_ARCH "spirv" CACHE STRING "HIP target architecture")
|
||||||
elseif(HIP_PLATFORM STREQUAL "nvcc")
|
elseif(HIP_PLATFORM STREQUAL "nvcc")
|
||||||
find_package(CUDA REQUIRED)
|
find_package(CUDA REQUIRED)
|
||||||
set(HIP_ARCH "sm_50" 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)")
|
||||||
@ -273,6 +277,7 @@ elseif(GPU_API STREQUAL "HIP")
|
|||||||
else()
|
else()
|
||||||
# build arch/gencode commands for nvcc based on CUDA toolkit version and use choice
|
# 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
|
# --arch translates directly instead of JIT, so this should be for the preferred or most common architecture
|
||||||
|
# comparison chart according to: https://en.wikipedia.org/wiki/CUDA#GPUs_supported
|
||||||
set(HIP_CUDA_GENCODE "-arch=${HIP_ARCH}")
|
set(HIP_CUDA_GENCODE "-arch=${HIP_ARCH}")
|
||||||
# Kepler (GPU Arch 3.0) is supported by CUDA 5 to CUDA 10.2
|
# Kepler (GPU Arch 3.0) is supported by CUDA 5 to CUDA 10.2
|
||||||
if((CUDA_VERSION VERSION_GREATER_EQUAL "5.0") AND (CUDA_VERSION VERSION_LESS "11.0"))
|
if((CUDA_VERSION VERSION_GREATER_EQUAL "5.0") AND (CUDA_VERSION VERSION_LESS "11.0"))
|
||||||
@ -302,14 +307,22 @@ elseif(GPU_API STREQUAL "HIP")
|
|||||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0")
|
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0")
|
||||||
string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_80,code=[sm_80,compute_80]")
|
string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_80,code=[sm_80,compute_80]")
|
||||||
endif()
|
endif()
|
||||||
# Hopper (GPU Arch 9.0) is supported by CUDA 12.0? and later
|
# Ampere (GPU Arch 8.6) is supported by CUDA 11.1 and later
|
||||||
|
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.1")
|
||||||
|
string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_86,code=[sm_86,compute_86]")
|
||||||
|
endif()
|
||||||
|
# Lovelace (GPU Arch 8.9) is supported by CUDA 11.8 and later
|
||||||
|
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.8")
|
||||||
|
string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_90,code=[sm_90,compute_90]")
|
||||||
|
endif()
|
||||||
|
# Hopper (GPU Arch 9.0) is supported by CUDA 12.0 and later
|
||||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
|
if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
|
||||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_90,code=[sm_90,compute_90]")
|
string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_90,code=[sm_90,compute_90]")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu ${CMAKE_CURRENT_SOURCE_DIR}/gpu/[^.]*.cu)
|
file(GLOB GPU_LIB_CU ${CONFIGURE_DEPENDS} ${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)
|
list(REMOVE_ITEM GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_pppm.cu)
|
||||||
|
|
||||||
set(GPU_LIB_CU_HIP "")
|
set(GPU_LIB_CU_HIP "")
|
||||||
@ -340,7 +353,14 @@ elseif(GPU_API STREQUAL "HIP")
|
|||||||
VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} --fatbin --use_fast_math -DUSE_HIP -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES} ${HIP_CUDA_GENCODE} -I${LAMMPS_LIB_SOURCE_DIR}/gpu -o ${CUBIN_FILE} ${CU_FILE}
|
VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} --fatbin --use_fast_math -DUSE_HIP -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES} ${HIP_CUDA_GENCODE} -I${LAMMPS_LIB_SOURCE_DIR}/gpu -o ${CUBIN_FILE} ${CU_FILE}
|
||||||
DEPENDS ${CU_FILE}
|
DEPENDS ${CU_FILE}
|
||||||
COMMENT "Generating ${CU_NAME}.cubin")
|
COMMENT "Generating ${CU_NAME}.cubin")
|
||||||
endif()
|
elseif(HIP_PLATFORM STREQUAL "spirv")
|
||||||
|
configure_file(${CU_FILE} ${CU_CPP_FILE} COPYONLY)
|
||||||
|
|
||||||
|
add_custom_command(OUTPUT ${CUBIN_FILE}
|
||||||
|
VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} -c -O3 -DUSE_HIP -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES} -I${LAMMPS_LIB_SOURCE_DIR}/gpu -o ${CUBIN_FILE} ${CU_CPP_FILE}
|
||||||
|
DEPENDS ${CU_CPP_FILE}
|
||||||
|
COMMENT "Gerating ${CU_NAME}.cubin")
|
||||||
|
endif()
|
||||||
|
|
||||||
add_custom_command(OUTPUT ${CUBIN_H_FILE}
|
add_custom_command(OUTPUT ${CUBIN_H_FILE}
|
||||||
COMMAND ${CMAKE_COMMAND} -D SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -D VARNAME=${CU_NAME} -D HEADER_FILE=${CUBIN_H_FILE} -D SOURCE_FILE=${CUBIN_FILE} -P ${CMAKE_CURRENT_SOURCE_DIR}/Modules/GenerateBinaryHeader.cmake
|
COMMAND ${CMAKE_COMMAND} -D SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -D VARNAME=${CU_NAME} -D HEADER_FILE=${CUBIN_H_FILE} -D SOURCE_FILE=${CUBIN_FILE} -P ${CMAKE_CURRENT_SOURCE_DIR}/Modules/GenerateBinaryHeader.cmake
|
||||||
@ -380,15 +400,17 @@ elseif(GPU_API STREQUAL "HIP")
|
|||||||
|
|
||||||
if(DOWNLOAD_CUB)
|
if(DOWNLOAD_CUB)
|
||||||
message(STATUS "CUB download requested")
|
message(STATUS "CUB download requested")
|
||||||
set(CUB_URL "https://github.com/NVlabs/cub/archive/1.12.0.tar.gz" CACHE STRING "URL for CUB tarball")
|
# TODO: test update to current version 1.17.2
|
||||||
|
set(CUB_URL "https://github.com/nvidia/cub/archive/1.12.0.tar.gz" CACHE STRING "URL for CUB tarball")
|
||||||
set(CUB_MD5 "1cf595beacafff104700921bac8519f3" CACHE STRING "MD5 checksum of CUB tarball")
|
set(CUB_MD5 "1cf595beacafff104700921bac8519f3" CACHE STRING "MD5 checksum of CUB tarball")
|
||||||
mark_as_advanced(CUB_URL)
|
mark_as_advanced(CUB_URL)
|
||||||
mark_as_advanced(CUB_MD5)
|
mark_as_advanced(CUB_MD5)
|
||||||
|
GetFallbackURL(CUB_URL CUB_FALLBACK)
|
||||||
|
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
|
|
||||||
ExternalProject_Add(CUB
|
ExternalProject_Add(CUB
|
||||||
URL ${CUB_URL}
|
URL ${CUB_URL} ${CUB_FALLBACK}
|
||||||
URL_MD5 ${CUB_MD5}
|
URL_MD5 ${CUB_MD5}
|
||||||
PREFIX "${CMAKE_CURRENT_BINARY_DIR}"
|
PREFIX "${CMAKE_CURRENT_BINARY_DIR}"
|
||||||
CONFIGURE_COMMAND ""
|
CONFIGURE_COMMAND ""
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
if(CMAKE_CXX_STANDARD LESS 14)
|
if(CMAKE_CXX_STANDARD LESS 14)
|
||||||
message(FATAL_ERROR "The KOKKOS package requires the C++ standard to be set to at least C++14")
|
message(FATAL_ERROR "The KOKKOS package requires the C++ standard to be set to at least C++14")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# consistency checks and Kokkos options/settings required by LAMMPS
|
# consistency checks and Kokkos options/settings required by LAMMPS
|
||||||
if(Kokkos_ENABLE_CUDA)
|
if(Kokkos_ENABLE_CUDA)
|
||||||
@ -15,8 +16,9 @@ if(Kokkos_ENABLE_OPENMP)
|
|||||||
if(NOT BUILD_OMP)
|
if(NOT BUILD_OMP)
|
||||||
message(FATAL_ERROR "Must enable BUILD_OMP with Kokkos_ENABLE_OPENMP")
|
message(FATAL_ERROR "Must enable BUILD_OMP with Kokkos_ENABLE_OPENMP")
|
||||||
else()
|
else()
|
||||||
if(LAMMPS_OMP_COMPAT_LEVEL LESS 4)
|
# NVHPC does not seem to provide a detectable OpenMP version, but is far beyond version 3.1
|
||||||
message(FATAL_ERROR "Compiler must support OpenMP 4.0 or later with Kokkos_ENABLE_OPENMP")
|
if((OpenMP_CXX_VERSION VERSION_LESS 3.1) AND NOT (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC"))
|
||||||
|
message(FATAL_ERROR "Compiler must support OpenMP 3.1 or later with Kokkos_ENABLE_OPENMP")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -47,12 +49,14 @@ if(DOWNLOAD_KOKKOS)
|
|||||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}")
|
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}")
|
||||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
|
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/3.6.00.tar.gz" CACHE STRING "URL for KOKKOS tarball")
|
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/3.6.01.tar.gz" CACHE STRING "URL for KOKKOS tarball")
|
||||||
set(KOKKOS_MD5 "b5c44ea961031795f434002cd7b31c20" CACHE STRING "MD5 checksum of KOKKOS tarball")
|
set(KOKKOS_MD5 "0ec97fc0c356dd65bd2487defe81a7bf" CACHE STRING "MD5 checksum of KOKKOS tarball")
|
||||||
mark_as_advanced(KOKKOS_URL)
|
mark_as_advanced(KOKKOS_URL)
|
||||||
mark_as_advanced(KOKKOS_MD5)
|
mark_as_advanced(KOKKOS_MD5)
|
||||||
|
GetFallbackURL(KOKKOS_URL KOKKOS_FALLBACK)
|
||||||
|
|
||||||
ExternalProject_Add(kokkos_build
|
ExternalProject_Add(kokkos_build
|
||||||
URL ${KOKKOS_URL}
|
URL ${KOKKOS_URL} ${KOKKOS_FALLBACK}
|
||||||
URL_MD5 ${KOKKOS_MD5}
|
URL_MD5 ${KOKKOS_MD5}
|
||||||
CMAKE_ARGS ${KOKKOS_LIB_BUILD_ARGS}
|
CMAKE_ARGS ${KOKKOS_LIB_BUILD_ARGS}
|
||||||
BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libkokkoscore.a <INSTALL_DIR>/lib/libkokkoscontainers.a
|
BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libkokkoscore.a <INSTALL_DIR>/lib/libkokkoscontainers.a
|
||||||
@ -72,7 +76,7 @@ if(DOWNLOAD_KOKKOS)
|
|||||||
add_dependencies(LAMMPS::KOKKOSCORE kokkos_build)
|
add_dependencies(LAMMPS::KOKKOSCORE kokkos_build)
|
||||||
add_dependencies(LAMMPS::KOKKOSCONTAINERS kokkos_build)
|
add_dependencies(LAMMPS::KOKKOSCONTAINERS kokkos_build)
|
||||||
elseif(EXTERNAL_KOKKOS)
|
elseif(EXTERNAL_KOKKOS)
|
||||||
find_package(Kokkos 3.6.00 REQUIRED CONFIG)
|
find_package(Kokkos 3.6.01 REQUIRED CONFIG)
|
||||||
target_link_libraries(lammps PRIVATE Kokkos::kokkos)
|
target_link_libraries(lammps PRIVATE Kokkos::kokkos)
|
||||||
target_link_libraries(lmp PRIVATE Kokkos::kokkos)
|
target_link_libraries(lmp PRIVATE Kokkos::kokkos)
|
||||||
else()
|
else()
|
||||||
|
|||||||
@ -19,17 +19,19 @@ if(DOWNLOAD_LATTE)
|
|||||||
set(LATTE_MD5 "820e73a457ced178c08c71389a385de7" CACHE STRING "MD5 checksum of LATTE tarball")
|
set(LATTE_MD5 "820e73a457ced178c08c71389a385de7" CACHE STRING "MD5 checksum of LATTE tarball")
|
||||||
mark_as_advanced(LATTE_URL)
|
mark_as_advanced(LATTE_URL)
|
||||||
mark_as_advanced(LATTE_MD5)
|
mark_as_advanced(LATTE_MD5)
|
||||||
|
GetFallbackURL(LATTE_URL LATTE_FALLBACK)
|
||||||
|
|
||||||
# CMake cannot pass BLAS or LAPACK library variable to external project if they are a list
|
# CMake cannot pass BLAS or LAPACK library variable to external project if they are a list
|
||||||
list(LENGTH BLAS_LIBRARIES} NUM_BLAS)
|
list(LENGTH BLAS_LIBRARIES} NUM_BLAS)
|
||||||
list(LENGTH LAPACK_LIBRARIES NUM_LAPACK)
|
list(LENGTH LAPACK_LIBRARIES NUM_LAPACK)
|
||||||
if((NUM_BLAS GREATER 1) OR (NUM_LAPACK GREATER 1))
|
if((NUM_BLAS GREATER 1) OR (NUM_LAPACK GREATER 1) AND NOT USE_INTERNAL_LINALG)
|
||||||
message(FATAL_ERROR "Cannot compile downloaded LATTE library due to a technical limitation")
|
message(FATAL_ERROR "Cannot compile downloaded LATTE library due to a technical limitation. "
|
||||||
|
"Try to configure LAMMPS with '-D USE_INTERNAL_LINALG=on' added as a workaround.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
ExternalProject_Add(latte_build
|
ExternalProject_Add(latte_build
|
||||||
URL ${LATTE_URL}
|
URL ${LATTE_URL} ${LATTE_FALLBACK}
|
||||||
URL_MD5 ${LATTE_MD5}
|
URL_MD5 ${LATTE_MD5}
|
||||||
SOURCE_SUBDIR cmake
|
SOURCE_SUBDIR cmake
|
||||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> ${CMAKE_REQUEST_PIC} -DCMAKE_INSTALL_LIBDIR=lib
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> ${CMAKE_REQUEST_PIC} -DCMAKE_INSTALL_LIBDIR=lib
|
||||||
|
|||||||
@ -12,6 +12,7 @@ if(DOWNLOAD_MDI)
|
|||||||
set(MDI_MD5 "836f5da400d8cff0f0e4435640f9454f" CACHE STRING "MD5 checksum for MDI tarball")
|
set(MDI_MD5 "836f5da400d8cff0f0e4435640f9454f" CACHE STRING "MD5 checksum for MDI tarball")
|
||||||
mark_as_advanced(MDI_URL)
|
mark_as_advanced(MDI_URL)
|
||||||
mark_as_advanced(MDI_MD5)
|
mark_as_advanced(MDI_MD5)
|
||||||
|
GetFallbackURL(MDI_URL MDI_FALLBACK)
|
||||||
enable_language(C)
|
enable_language(C)
|
||||||
|
|
||||||
# only ON/OFF are allowed for "mpi" flag when building MDI library
|
# only ON/OFF are allowed for "mpi" flag when building MDI library
|
||||||
@ -42,7 +43,7 @@ if(DOWNLOAD_MDI)
|
|||||||
# support cross-compilation and ninja-build
|
# support cross-compilation and ninja-build
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
ExternalProject_Add(mdi_build
|
ExternalProject_Add(mdi_build
|
||||||
URL ${MDI_URL}
|
URL ${MDI_URL} ${MDI_FALLBACK}
|
||||||
URL_MD5 ${MDI_MD5}
|
URL_MD5 ${MDI_MD5}
|
||||||
CMAKE_ARGS ${CMAKE_REQUEST_PIC}
|
CMAKE_ARGS ${CMAKE_REQUEST_PIC}
|
||||||
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
||||||
|
|||||||
@ -6,10 +6,11 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
option(DOWNLOAD_N2P2 "Download n2p2 library instead of using an already installed one)" ${DOWNLOAD_N2P2_DEFAULT})
|
option(DOWNLOAD_N2P2 "Download n2p2 library instead of using an already installed one)" ${DOWNLOAD_N2P2_DEFAULT})
|
||||||
if(DOWNLOAD_N2P2)
|
if(DOWNLOAD_N2P2)
|
||||||
set(N2P2_URL "https://github.com/CompPhysVienna/n2p2/archive/v2.1.4.tar.gz" CACHE STRING "URL for n2p2 tarball")
|
set(N2P2_URL "https://github.com/CompPhysVienna/n2p2/archive/v2.2.0.tar.gz" CACHE STRING "URL for n2p2 tarball")
|
||||||
set(N2P2_MD5 "9595b066636cd6b90b0fef93398297a5" CACHE STRING "MD5 checksum of N2P2 tarball")
|
set(N2P2_MD5 "a2d9ab7f676b3a74a324fc1eda0a911d" CACHE STRING "MD5 checksum of N2P2 tarball")
|
||||||
mark_as_advanced(N2P2_URL)
|
mark_as_advanced(N2P2_URL)
|
||||||
mark_as_advanced(N2P2_MD5)
|
mark_as_advanced(N2P2_MD5)
|
||||||
|
GetFallbackURL(N2P2_URL N2P2_FALLBACK)
|
||||||
|
|
||||||
# adjust settings from detected compiler to compiler platform in n2p2 library
|
# adjust settings from detected compiler to compiler platform in n2p2 library
|
||||||
# set compiler specific flag to turn on C++11 syntax (required on macOS and CentOS 7)
|
# set compiler specific flag to turn on C++11 syntax (required on macOS and CentOS 7)
|
||||||
@ -44,7 +45,9 @@ if(DOWNLOAD_N2P2)
|
|||||||
else()
|
else()
|
||||||
# get path to MPI include directory
|
# get path to MPI include directory
|
||||||
get_target_property(N2P2_MPI_INCLUDE MPI::MPI_CXX INTERFACE_INCLUDE_DIRECTORIES)
|
get_target_property(N2P2_MPI_INCLUDE MPI::MPI_CXX INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
set(N2P2_PROJECT_OPTIONS "-I${N2P2_MPI_INCLUDE}")
|
foreach (_INCL ${N2P2_MPI_INCLUDE})
|
||||||
|
set(N2P2_PROJECT_OPTIONS "${N2P2_PROJECT_OPTIONS} -I${_INCL}")
|
||||||
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# prefer GNU make, if available. N2P2 lib seems to need it.
|
# prefer GNU make, if available. N2P2 lib seems to need it.
|
||||||
@ -70,12 +73,12 @@ if(DOWNLOAD_N2P2)
|
|||||||
# download compile n2p2 library. much patch MPI calls in LAMMPS interface to accommodate MPI-2 (e.g. for cross-compiling)
|
# download compile n2p2 library. much patch MPI calls in LAMMPS interface to accommodate MPI-2 (e.g. for cross-compiling)
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
ExternalProject_Add(n2p2_build
|
ExternalProject_Add(n2p2_build
|
||||||
URL ${N2P2_URL}
|
URL ${N2P2_URL} ${N2P2_FALLBACK}
|
||||||
URL_MD5 ${N2P2_MD5}
|
URL_MD5 ${N2P2_MD5}
|
||||||
UPDATE_COMMAND ""
|
UPDATE_COMMAND ""
|
||||||
CONFIGURE_COMMAND ""
|
CONFIGURE_COMMAND ""
|
||||||
PATCH_COMMAND sed -i -e "s/\\(MPI_\\(P\\|Unp\\)ack(\\)/\\1(void *) /" src/libnnpif/LAMMPS/InterfaceLammps.cpp
|
PATCH_COMMAND sed -i -e "s/\\(MPI_\\(P\\|Unp\\)ack(\\)/\\1(void *) /" src/libnnpif/LAMMPS/InterfaceLammps.cpp
|
||||||
BUILD_COMMAND ${N2P2_MAKE} -f makefile libnnpif ${N2P2_BUILD_OPTIONS}
|
BUILD_COMMAND ${N2P2_MAKE} -C <SOURCE_DIR>/src -f makefile libnnpif ${N2P2_BUILD_OPTIONS}
|
||||||
BUILD_ALWAYS YES
|
BUILD_ALWAYS YES
|
||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ""
|
||||||
BUILD_IN_SOURCE 1
|
BUILD_IN_SOURCE 1
|
||||||
|
|||||||
@ -2,7 +2,13 @@
|
|||||||
set(MLIAP_ENABLE_PYTHON_DEFAULT OFF)
|
set(MLIAP_ENABLE_PYTHON_DEFAULT OFF)
|
||||||
if(PKG_PYTHON)
|
if(PKG_PYTHON)
|
||||||
find_package(Cythonize QUIET)
|
find_package(Cythonize QUIET)
|
||||||
if(Cythonize_FOUND)
|
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.14)
|
||||||
|
find_package(Python COMPONENTS NumPy QUIET)
|
||||||
|
else()
|
||||||
|
# assume we have NumPy
|
||||||
|
set(Python_NumPy_FOUND ON)
|
||||||
|
endif()
|
||||||
|
if(Cythonize_FOUND AND Python_NumPy_FOUND)
|
||||||
set(MLIAP_ENABLE_PYTHON_DEFAULT ON)
|
set(MLIAP_ENABLE_PYTHON_DEFAULT ON)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -11,6 +17,9 @@ option(MLIAP_ENABLE_PYTHON "Build ML-IAP package with Python support" ${MLIAP_EN
|
|||||||
|
|
||||||
if(MLIAP_ENABLE_PYTHON)
|
if(MLIAP_ENABLE_PYTHON)
|
||||||
find_package(Cythonize REQUIRED)
|
find_package(Cythonize REQUIRED)
|
||||||
|
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.14)
|
||||||
|
find_package(Python COMPONENTS NumPy REQUIRED)
|
||||||
|
endif()
|
||||||
if(NOT PKG_PYTHON)
|
if(NOT PKG_PYTHON)
|
||||||
message(FATAL_ERROR "Must enable PYTHON package for including Python support in ML-IAP")
|
message(FATAL_ERROR "Must enable PYTHON package for including Python support in ML-IAP")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@ -3,9 +3,23 @@ set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2
|
|||||||
set(PACELIB_MD5 "32394d799bc282bb57696c78c456e64f" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
|
set(PACELIB_MD5 "32394d799bc282bb57696c78c456e64f" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
|
||||||
mark_as_advanced(PACELIB_URL)
|
mark_as_advanced(PACELIB_URL)
|
||||||
mark_as_advanced(PACELIB_MD5)
|
mark_as_advanced(PACELIB_MD5)
|
||||||
|
GetFallbackURL(PACELIB_URL PACELIB_FALLBACK)
|
||||||
|
|
||||||
# download library sources to build folder
|
# download library sources to build folder
|
||||||
file(DOWNLOAD ${PACELIB_URL} ${CMAKE_BINARY_DIR}/libpace.tar.gz EXPECTED_HASH MD5=${PACELIB_MD5}) #SHOW_PROGRESS
|
if(EXISTS ${CMAKE_BINARY_DIR}/libpace.tar.gz)
|
||||||
|
file(MD5 ${CMAKE_BINARY_DIR}/libpace.tar.gz DL_MD5)
|
||||||
|
endif()
|
||||||
|
if(NOT "${DL_MD5}" STREQUAL "${PACELIB_MD5}")
|
||||||
|
message(STATUS "Downloading ${PACELIB_URL}")
|
||||||
|
file(DOWNLOAD ${PACELIB_URL} ${CMAKE_BINARY_DIR}/libpace.tar.gz STATUS DL_STATUS SHOW_PROGRESS)
|
||||||
|
file(MD5 ${CMAKE_BINARY_DIR}/libpace.tar.gz DL_MD5)
|
||||||
|
if((NOT DL_STATUS EQUAL 0) OR (NOT "${DL_MD5}" STREQUAL "${PACELIB_MD5}"))
|
||||||
|
message(WARNING "Download from primary URL ${PACELIB_URL} failed\nTrying fallback URL ${PACELIB_FALLBACK}")
|
||||||
|
file(DOWNLOAD ${PACELIB_FALLBACK} ${CMAKE_BINARY_DIR}/libpace.tar.gz EXPECTED_HASH MD5=${PACELIB_MD5} SHOW_PROGRESS)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(STATUS "Using already downloaded archive ${CMAKE_BINARY_DIR}/libpace.tar.gz")
|
||||||
|
endif()
|
||||||
|
|
||||||
# uncompress downloaded sources
|
# uncompress downloaded sources
|
||||||
execute_process(
|
execute_process(
|
||||||
@ -22,8 +36,8 @@ set(YAML_CPP_BUILD_TOOLS OFF)
|
|||||||
add_subdirectory(${lib-pace}/yaml-cpp build-yaml-cpp)
|
add_subdirectory(${lib-pace}/yaml-cpp build-yaml-cpp)
|
||||||
set(YAML_CPP_INCLUDE_DIR ${lib-pace}/yaml-cpp/include)
|
set(YAML_CPP_INCLUDE_DIR ${lib-pace}/yaml-cpp/include)
|
||||||
|
|
||||||
file(GLOB PACE_EVALUATOR_INCLUDE_DIR ${lib-pace}/ML-PACE)
|
file(GLOB PACE_EVALUATOR_INCLUDE_DIR ${CONFIGURE_DEPENDS} ${lib-pace}/ML-PACE)
|
||||||
file(GLOB PACE_EVALUATOR_SOURCES ${lib-pace}/ML-PACE/*.cpp)
|
file(GLOB PACE_EVALUATOR_SOURCES ${CONFIGURE_DEPENDS} ${lib-pace}/ML-PACE/*.cpp)
|
||||||
list(FILTER PACE_EVALUATOR_SOURCES EXCLUDE REGEX pair_pace.cpp)
|
list(FILTER PACE_EVALUATOR_SOURCES EXCLUDE REGEX pair_pace.cpp)
|
||||||
|
|
||||||
add_library(pace STATIC ${PACE_EVALUATOR_SOURCES})
|
add_library(pace STATIC ${PACE_EVALUATOR_SOURCES})
|
||||||
|
|||||||
@ -16,6 +16,7 @@ if(DOWNLOAD_QUIP)
|
|||||||
set(temp "${temp}DEFINES += -DGETARG_F2003 -DFORTRAN_UNDERSCORE\n")
|
set(temp "${temp}DEFINES += -DGETARG_F2003 -DFORTRAN_UNDERSCORE\n")
|
||||||
set(temp "${temp}F95FLAGS += -fpp -free -fPIC\n")
|
set(temp "${temp}F95FLAGS += -fpp -free -fPIC\n")
|
||||||
set(temp "${temp}F77FLAGS += -fpp -fixed -fPIC\n")
|
set(temp "${temp}F77FLAGS += -fpp -fixed -fPIC\n")
|
||||||
|
set(temp "${temp}F95_PRE_FILENAME_FLAG = -Tf\n")
|
||||||
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
|
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
|
||||||
set(temp "${temp}FPP=${CMAKE_Fortran_COMPILER} -E -x f95-cpp-input\nOPTIM=${CMAKE_Fortran_FLAGS_${BTYPE}}\n")
|
set(temp "${temp}FPP=${CMAKE_Fortran_COMPILER} -E -x f95-cpp-input\nOPTIM=${CMAKE_Fortran_FLAGS_${BTYPE}}\n")
|
||||||
set(temp "${temp}DEFINES += -DGETARG_F2003 -DGETENV_F2003 -DGFORTRAN -DFORTRAN_UNDERSCORE\n")
|
set(temp "${temp}DEFINES += -DGETARG_F2003 -DGETENV_F2003 -DGFORTRAN -DFORTRAN_UNDERSCORE\n")
|
||||||
@ -58,12 +59,12 @@ if(DOWNLOAD_QUIP)
|
|||||||
BUILD_COMMAND env QUIP_ARCH=lammps make libquip
|
BUILD_COMMAND env QUIP_ARCH=lammps make libquip
|
||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ""
|
||||||
BUILD_IN_SOURCE YES
|
BUILD_IN_SOURCE YES
|
||||||
BUILD_BYPRODUCTS <SOURCE_DIR>/build/lammps/libquip.a
|
BUILD_BYPRODUCTS <SOURCE_DIR>/build/lammps/${CMAKE_STATIC_LIBRARY_PREFIX}quip${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||||
)
|
)
|
||||||
ExternalProject_get_property(quip_build SOURCE_DIR)
|
ExternalProject_get_property(quip_build SOURCE_DIR)
|
||||||
add_library(LAMMPS::QUIP UNKNOWN IMPORTED)
|
add_library(LAMMPS::QUIP UNKNOWN IMPORTED)
|
||||||
set_target_properties(LAMMPS::QUIP PROPERTIES
|
set_target_properties(LAMMPS::QUIP PROPERTIES
|
||||||
IMPORTED_LOCATION "${SOURCE_DIR}/build/lammps/libquip.a"
|
IMPORTED_LOCATION "${SOURCE_DIR}/build/lammps/${CMAKE_STATIC_LIBRARY_PREFIX}quip${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||||
INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}")
|
INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}")
|
||||||
target_link_libraries(lammps PRIVATE LAMMPS::QUIP)
|
target_link_libraries(lammps PRIVATE LAMMPS::QUIP)
|
||||||
add_dependencies(LAMMPS::QUIP quip_build)
|
add_dependencies(LAMMPS::QUIP quip_build)
|
||||||
|
|||||||
@ -47,22 +47,23 @@ if(DOWNLOAD_PLUMED)
|
|||||||
endif()
|
endif()
|
||||||
message(STATUS "PLUMED download requested - we will build our own")
|
message(STATUS "PLUMED download requested - we will build our own")
|
||||||
if(PLUMED_MODE STREQUAL "STATIC")
|
if(PLUMED_MODE STREQUAL "STATIC")
|
||||||
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/libplumed.a")
|
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/${CMAKE_STATIC_LIBRARY_PREFIX}plumed${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||||
elseif(PLUMED_MODE STREQUAL "SHARED")
|
elseif(PLUMED_MODE STREQUAL "SHARED")
|
||||||
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/libplumed${CMAKE_SHARED_LIBRARY_SUFFIX};<INSTALL_DIR>/lib/libplumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/${CMAKE_SHARED_LIBRARY_PREFIX}plumed${CMAKE_SHARED_LIBRARY_SUFFIX};<INSTALL_DIR>/lib/${CMAKE_SHARED_LIBRARY_PREFIX}plumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||||
elseif(PLUMED_MODE STREQUAL "RUNTIME")
|
elseif(PLUMED_MODE STREQUAL "RUNTIME")
|
||||||
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/libplumedWrapper.a")
|
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/${CMAKE_STATIC_LIBRARY_PREFIX}plumedWrapper${CMAKE_STATIC_LIBRARY_PREFIX}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.7.4/plumed-src-2.7.4.tgz" CACHE STRING "URL for PLUMED tarball")
|
set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.8.1/plumed-src-2.8.1.tgz" CACHE STRING "URL for PLUMED tarball")
|
||||||
set(PLUMED_MD5 "858e0b6aed173748fc85b6bc8a9dcb3e" CACHE STRING "MD5 checksum of PLUMED tarball")
|
set(PLUMED_MD5 "6bfe72ebdae63dc38a9ca27d9b0e08f8" CACHE STRING "MD5 checksum of PLUMED tarball")
|
||||||
|
|
||||||
mark_as_advanced(PLUMED_URL)
|
mark_as_advanced(PLUMED_URL)
|
||||||
mark_as_advanced(PLUMED_MD5)
|
mark_as_advanced(PLUMED_MD5)
|
||||||
|
GetFallbackURL(PLUMED_URL PLUMED_FALLBACK)
|
||||||
|
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
ExternalProject_Add(plumed_build
|
ExternalProject_Add(plumed_build
|
||||||
URL ${PLUMED_URL}
|
URL ${PLUMED_URL} ${PLUMED_FALLBACK}
|
||||||
URL_MD5 ${PLUMED_MD5}
|
URL_MD5 ${PLUMED_MD5}
|
||||||
BUILD_IN_SOURCE 1
|
BUILD_IN_SOURCE 1
|
||||||
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR>
|
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR>
|
||||||
@ -78,12 +79,12 @@ if(DOWNLOAD_PLUMED)
|
|||||||
add_library(LAMMPS::PLUMED UNKNOWN IMPORTED)
|
add_library(LAMMPS::PLUMED UNKNOWN IMPORTED)
|
||||||
add_dependencies(LAMMPS::PLUMED plumed_build)
|
add_dependencies(LAMMPS::PLUMED plumed_build)
|
||||||
if(PLUMED_MODE STREQUAL "STATIC")
|
if(PLUMED_MODE STREQUAL "STATIC")
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/libplumed.a INTERFACE_LINK_LIBRARIES "${PLUMED_LINK_LIBS};${CMAKE_DL_LIBS}")
|
set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}plumed${CMAKE_STATIC_LIBRARY_SUFFIX} INTERFACE_LINK_LIBRARIES "${PLUMED_LINK_LIBS};${CMAKE_DL_LIBS}")
|
||||||
elseif(PLUMED_MODE STREQUAL "SHARED")
|
elseif(PLUMED_MODE STREQUAL "SHARED")
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/libplumed${CMAKE_SHARED_LIBRARY_SUFFIX} INTERFACE_LINK_LIBRARIES "${INSTALL_DIR}/lib/libplumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX};${CMAKE_DL_LIBS}")
|
set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}plumed${CMAKE_SHARED_LIBRARY_SUFFIX} INTERFACE_LINK_LIBRARIES "${INSTALL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}plumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX};${CMAKE_DL_LIBS}")
|
||||||
elseif(PLUMED_MODE STREQUAL "RUNTIME")
|
elseif(PLUMED_MODE STREQUAL "RUNTIME")
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_COMPILE_DEFINITIONS "__PLUMED_DEFAULT_KERNEL=${INSTALL_DIR}/lib/libplumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_COMPILE_DEFINITIONS "__PLUMED_DEFAULT_KERNEL=${INSTALL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}plumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/libplumedWrapper.a INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS}")
|
set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}plumedWrapper${CMAKE_STATIC_LIBRARY_SUFFIX} INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS}")
|
||||||
endif()
|
endif()
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/include)
|
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/include)
|
||||||
file(MAKE_DIRECTORY ${INSTALL_DIR}/include)
|
file(MAKE_DIRECTORY ${INSTALL_DIR}/include)
|
||||||
@ -96,7 +97,7 @@ else()
|
|||||||
elseif(PLUMED_MODE STREQUAL "SHARED")
|
elseif(PLUMED_MODE STREQUAL "SHARED")
|
||||||
include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.shared)
|
include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.shared)
|
||||||
elseif(PLUMED_MODE STREQUAL "RUNTIME")
|
elseif(PLUMED_MODE STREQUAL "RUNTIME")
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_COMPILE_DEFINITIONS "__PLUMED_DEFAULT_KERNEL=${PLUMED_LIBDIR}/libplumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_COMPILE_DEFINITIONS "__PLUMED_DEFAULT_KERNEL=${PLUMED_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}plumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||||
include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.runtime)
|
include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.runtime)
|
||||||
endif()
|
endif()
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_LINK_LIBRARIES "${PLUMED_LOAD}")
|
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_LINK_LIBRARIES "${PLUMED_LOAD}")
|
||||||
|
|||||||
@ -1,8 +1,28 @@
|
|||||||
if(CMAKE_VERSION VERSION_LESS 3.12)
|
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||||
|
if(NOT PYTHON_VERSION_STRING)
|
||||||
|
set(Python_ADDITIONAL_VERSIONS 3.12 3.11 3.10 3.9 3.8 3.7 3.6)
|
||||||
|
# search for interpreter first, so we have a consistent library
|
||||||
|
find_package(PythonInterp) # Deprecated since version 3.12
|
||||||
|
if(PYTHONINTERP_FOUND)
|
||||||
|
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
# search for the library matching the selected interpreter
|
||||||
|
set(Python_ADDITIONAL_VERSIONS ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
|
||||||
find_package(PythonLibs REQUIRED) # Deprecated since version 3.12
|
find_package(PythonLibs REQUIRED) # Deprecated since version 3.12
|
||||||
|
if(NOT (PYTHON_VERSION_STRING STREQUAL PYTHONLIBS_VERSION_STRING))
|
||||||
|
message(FATAL_ERROR "Python Library version ${PYTHONLIBS_VERSION_STRING} does not match Interpreter version ${PYTHON_VERSION_STRING}")
|
||||||
|
endif()
|
||||||
target_include_directories(lammps PRIVATE ${PYTHON_INCLUDE_DIRS})
|
target_include_directories(lammps PRIVATE ${PYTHON_INCLUDE_DIRS})
|
||||||
target_link_libraries(lammps PRIVATE ${PYTHON_LIBRARIES})
|
target_link_libraries(lammps PRIVATE ${PYTHON_LIBRARIES})
|
||||||
else()
|
else()
|
||||||
|
if(NOT Python_INTERPRETER)
|
||||||
|
# backward compatibility
|
||||||
|
if(PYTHON_EXECUTABLE)
|
||||||
|
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||||
|
endif()
|
||||||
|
find_package(Python COMPONENTS Interpreter)
|
||||||
|
endif()
|
||||||
find_package(Python REQUIRED COMPONENTS Interpreter Development)
|
find_package(Python REQUIRED COMPONENTS Interpreter Development)
|
||||||
target_link_libraries(lammps PRIVATE Python::Python)
|
target_link_libraries(lammps PRIVATE Python::Python)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@ -18,6 +18,8 @@ if(DOWNLOAD_SCAFACOS)
|
|||||||
set(SCAFACOS_MD5 "bd46d74e3296bd8a444d731bb10c1738" CACHE STRING "MD5 checksum of SCAFACOS tarball")
|
set(SCAFACOS_MD5 "bd46d74e3296bd8a444d731bb10c1738" CACHE STRING "MD5 checksum of SCAFACOS tarball")
|
||||||
mark_as_advanced(SCAFACOS_URL)
|
mark_as_advanced(SCAFACOS_URL)
|
||||||
mark_as_advanced(SCAFACOS_MD5)
|
mark_as_advanced(SCAFACOS_MD5)
|
||||||
|
GetFallbackURL(SCAFACOS_URL SCAFACOS_FALLBACK)
|
||||||
|
|
||||||
|
|
||||||
# version 1.0.1 needs a patch to compile and linke cleanly with GCC 10 and later.
|
# version 1.0.1 needs a patch to compile and linke cleanly with GCC 10 and later.
|
||||||
file(DOWNLOAD ${LAMMPS_THIRDPARTY_URL}/scafacos-1.0.1-fix.diff ${CMAKE_CURRENT_BINARY_DIR}/scafacos-1.0.1.fix.diff
|
file(DOWNLOAD ${LAMMPS_THIRDPARTY_URL}/scafacos-1.0.1-fix.diff ${CMAKE_CURRENT_BINARY_DIR}/scafacos-1.0.1.fix.diff
|
||||||
@ -30,7 +32,7 @@ if(DOWNLOAD_SCAFACOS)
|
|||||||
|
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
ExternalProject_Add(scafacos_build
|
ExternalProject_Add(scafacos_build
|
||||||
URL ${SCAFACOS_URL}
|
URL ${SCAFACOS_URL} ${SCAFACOS_FALLBACK}
|
||||||
URL_MD5 ${SCAFACOS_MD5}
|
URL_MD5 ${SCAFACOS_MD5}
|
||||||
PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_BINARY_DIR}/scafacos-1.0.1.fix.diff
|
PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_BINARY_DIR}/scafacos-1.0.1.fix.diff
|
||||||
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --disable-doc
|
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --disable-doc
|
||||||
|
|||||||
@ -1,4 +1,9 @@
|
|||||||
find_package(VTK REQUIRED NO_MODULE)
|
find_package(VTK REQUIRED NO_MODULE)
|
||||||
include(${VTK_USE_FILE})
|
|
||||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_VTK)
|
target_compile_definitions(lammps PRIVATE -DLAMMPS_VTK)
|
||||||
target_link_libraries(lammps PRIVATE ${VTK_LIBRARIES})
|
if (VTK_MAJOR_VERSION VERSION_LESS 9.0)
|
||||||
|
include(${VTK_USE_FILE})
|
||||||
|
target_link_libraries(lammps PRIVATE ${VTK_LIBRARIES})
|
||||||
|
else()
|
||||||
|
target_link_libraries(lammps PRIVATE VTK::CommonCore VTK::IOCore VTK::CommonDataModel VTK::IOXML VTK::IOLegacy VTK::IOParallelXML)
|
||||||
|
vtk_module_autoinit(TARGETS lammps MODULES VTK::CommonCore VTK::IOCore VTK::CommonDataModel VTK::IOXML VTK::IOLegacy VTK::IOParallelXML)
|
||||||
|
endif()
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
function(FindStyleHeaders path style_class file_pattern headers)
|
function(FindStyleHeaders path style_class file_pattern headers)
|
||||||
file(GLOB files "${path}/${file_pattern}*.h")
|
file(GLOB files ${CONFIGURE_DEPENDS} "${path}/${file_pattern}*.h")
|
||||||
get_property(hlist GLOBAL PROPERTY ${headers})
|
get_property(hlist GLOBAL PROPERTY ${headers})
|
||||||
|
|
||||||
foreach(file_name ${files})
|
foreach(file_name ${files})
|
||||||
@ -184,7 +184,7 @@ endfunction(DetectBuildSystemConflict)
|
|||||||
|
|
||||||
|
|
||||||
function(FindPackagesHeaders path style_class file_pattern headers)
|
function(FindPackagesHeaders path style_class file_pattern headers)
|
||||||
file(GLOB files "${path}/${file_pattern}*.h")
|
file(GLOB files ${CONFIGURE_DEPENDS} "${path}/${file_pattern}*.h")
|
||||||
get_property(plist GLOBAL PROPERTY ${headers})
|
get_property(plist GLOBAL PROPERTY ${headers})
|
||||||
|
|
||||||
foreach(file_name ${files})
|
foreach(file_name ${files})
|
||||||
|
|||||||
@ -6,7 +6,7 @@ if(ENABLE_TESTING)
|
|||||||
find_program(VALGRIND_BINARY NAMES valgrind)
|
find_program(VALGRIND_BINARY NAMES valgrind)
|
||||||
# generate custom suppression file
|
# generate custom suppression file
|
||||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/lammps.supp "\n")
|
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/lammps.supp "\n")
|
||||||
file(GLOB VALGRIND_SUPPRESSION_FILES ${LAMMPS_TOOLS_DIR}/valgrind/[^.]*.supp)
|
file(GLOB VALGRIND_SUPPRESSION_FILES ${CONFIGURE_DEPENDS} ${LAMMPS_TOOLS_DIR}/valgrind/[^.]*.supp)
|
||||||
foreach(SUPP ${VALGRIND_SUPPRESSION_FILES})
|
foreach(SUPP ${VALGRIND_SUPPRESSION_FILES})
|
||||||
file(READ ${SUPP} SUPPRESSIONS)
|
file(READ ${SUPP} SUPPRESSIONS)
|
||||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/lammps.supp "${SUPPRESSIONS}")
|
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/lammps.supp "${SUPPRESSIONS}")
|
||||||
|
|||||||
@ -26,7 +26,7 @@ if(BUILD_TOOLS)
|
|||||||
|
|
||||||
enable_language(C)
|
enable_language(C)
|
||||||
get_filename_component(MSI2LMP_SOURCE_DIR ${LAMMPS_TOOLS_DIR}/msi2lmp/src ABSOLUTE)
|
get_filename_component(MSI2LMP_SOURCE_DIR ${LAMMPS_TOOLS_DIR}/msi2lmp/src ABSOLUTE)
|
||||||
file(GLOB MSI2LMP_SOURCES ${MSI2LMP_SOURCE_DIR}/[^.]*.c)
|
file(GLOB MSI2LMP_SOURCES ${CONFIGURE_DEPENDS} ${MSI2LMP_SOURCE_DIR}/[^.]*.c)
|
||||||
add_executable(msi2lmp ${MSI2LMP_SOURCES})
|
add_executable(msi2lmp ${MSI2LMP_SOURCES})
|
||||||
if(STANDARD_MATH_LIB)
|
if(STANDARD_MATH_LIB)
|
||||||
target_link_libraries(msi2lmp PRIVATE ${STANDARD_MATH_LIB})
|
target_link_libraries(msi2lmp PRIVATE ${STANDARD_MATH_LIB})
|
||||||
@ -50,12 +50,16 @@ if(BUILD_LAMMPS_SHELL)
|
|||||||
|
|
||||||
add_executable(lammps-shell ${LAMMPS_TOOLS_DIR}/lammps-shell/lammps-shell.cpp ${ICON_RC_FILE})
|
add_executable(lammps-shell ${LAMMPS_TOOLS_DIR}/lammps-shell/lammps-shell.cpp ${ICON_RC_FILE})
|
||||||
target_include_directories(lammps-shell PRIVATE ${LAMMPS_TOOLS_DIR}/lammps-shell)
|
target_include_directories(lammps-shell PRIVATE ${LAMMPS_TOOLS_DIR}/lammps-shell)
|
||||||
|
target_link_libraries(lammps-shell PRIVATE lammps PkgConfig::READLINE)
|
||||||
|
|
||||||
# workaround for broken readline pkg-config file on FreeBSD
|
# workaround for broken readline pkg-config file on FreeBSD
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
||||||
target_include_directories(lammps-shell PRIVATE /usr/local/include)
|
target_include_directories(lammps-shell PRIVATE /usr/local/include)
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(lammps-shell PRIVATE lammps PkgConfig::READLINE)
|
if(CMAKE_SYSTEM_NAME STREQUAL "LinuxMUSL")
|
||||||
|
pkg_check_modules(TERMCAP IMPORTED_TARGET REQUIRED termcap)
|
||||||
|
target_link_libraries(lammps-shell PRIVATE lammps PkgConfig::TERMCAP)
|
||||||
|
endif()
|
||||||
install(TARGETS lammps-shell EXPORT LAMMPS_Targets DESTINATION ${CMAKE_INSTALL_BINDIR})
|
install(TARGETS lammps-shell EXPORT LAMMPS_Targets DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
install(DIRECTORY ${LAMMPS_TOOLS_DIR}/lammps-shell/icons DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/)
|
install(DIRECTORY ${LAMMPS_TOOLS_DIR}/lammps-shell/icons DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/)
|
||||||
install(FILES ${LAMMPS_TOOLS_DIR}/lammps-shell/lammps-shell.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications/)
|
install(FILES ${LAMMPS_TOOLS_DIR}/lammps-shell/lammps-shell.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications/)
|
||||||
|
|||||||
@ -3,6 +3,13 @@
|
|||||||
# prefer flang over gfortran, if available
|
# prefer flang over gfortran, if available
|
||||||
find_program(CLANG_FORTRAN NAMES flang gfortran f95)
|
find_program(CLANG_FORTRAN NAMES flang gfortran f95)
|
||||||
set(ENV{OMPI_FC} ${CLANG_FORTRAN})
|
set(ENV{OMPI_FC} ${CLANG_FORTRAN})
|
||||||
|
get_filename_component(_tmp_fc ${CLANG_FORTRAN} NAME)
|
||||||
|
if (_tmp_fc STREQUAL "flang")
|
||||||
|
set(FC_STD_VERSION "-std=f2018")
|
||||||
|
set(BUILD_MPI OFF)
|
||||||
|
else()
|
||||||
|
set(FC_STD_VERSION "-std=f2003")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(CMAKE_CXX_COMPILER "clang++" CACHE STRING "" FORCE)
|
set(CMAKE_CXX_COMPILER "clang++" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_C_COMPILER "clang" CACHE STRING "" FORCE)
|
set(CMAKE_C_COMPILER "clang" CACHE STRING "" FORCE)
|
||||||
@ -10,9 +17,9 @@ set(CMAKE_Fortran_COMPILER ${CLANG_FORTRAN} CACHE STRING "" FORCE)
|
|||||||
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE)
|
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE)
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
|
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Wextra -g -std=f2003" CACHE STRING "" FORCE)
|
set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Wextra -g ${FC_STD_VERSION}" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
|
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG ${FC_STD_VERSION}" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
|
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG ${FC_STD_VERSION}" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_C_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE)
|
set(CMAKE_C_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE)
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
|
set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
|
||||||
@ -21,10 +28,3 @@ set(MPI_CXX "clang++" CACHE STRING "" FORCE)
|
|||||||
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
||||||
|
|
||||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||||
set(OpenMP_C "clang" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX "clang++" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_FLAGS "-fopenmp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_omp_LIBRARY "libomp.so" CACHE PATH "" FORCE)
|
|
||||||
|
|||||||
@ -19,11 +19,3 @@ set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Og -g -std=f2003" CACHE STRING "" FORCE)
|
|||||||
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
|
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
|
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
|
||||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||||
|
|
||||||
set(OpenMP_C "gcc" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_LIB_NAMES "gomp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX "g++" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_FLAGS "-fopenmp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_LIB_NAMES "gomp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_omp_LIBRARY "libgomp.so" CACHE PATH "" FORCE)
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# preset that will enable Intel compilers with support for MPI and OpenMP (on Linux boxes)
|
# preset that will enable the classic Intel compilers with support for MPI and OpenMP (on Linux boxes)
|
||||||
|
|
||||||
set(CMAKE_CXX_COMPILER "icpc" CACHE STRING "" FORCE)
|
set(CMAKE_CXX_COMPILER "icpc" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_C_COMPILER "icc" CACHE STRING "" FORCE)
|
set(CMAKE_C_COMPILER "icc" CACHE STRING "" FORCE)
|
||||||
@ -18,11 +18,11 @@ set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
|||||||
|
|
||||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||||
set(OpenMP_C "icc" CACHE STRING "" FORCE)
|
set(OpenMP_C "icc" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_C_FLAGS "-qopenmp" CACHE STRING "" FORCE)
|
set(OpenMP_C_FLAGS "-qopenmp -qopenmp-simd" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_CXX "icpc" CACHE STRING "" FORCE)
|
set(OpenMP_CXX "icpc" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_CXX_FLAGS "-qopenmp" CACHE STRING "" FORCE)
|
set(OpenMP_CXX_FLAGS "-qopenmp -qopenmp-simd" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_Fortran_FLAGS "-qopenmp" CACHE STRING "" FORCE)
|
set(OpenMP_Fortran_FLAGS "-qopenmp -qopenmp-simd" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_omp_LIBRARY "libiomp5.so" CACHE PATH "" FORCE)
|
set(OpenMP_omp_LIBRARY "libiomp5.so" CACHE PATH "" FORCE)
|
||||||
|
|
||||||
|
|||||||
9
cmake/presets/nvhpc.cmake
Normal file
9
cmake/presets/nvhpc.cmake
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# preset that will enable Nvidia HPC SDK compilers with support for MPI and OpenMP (on Linux boxes)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_COMPILER "nvc++" CACHE STRING "" FORCE)
|
||||||
|
set(CMAKE_C_COMPILER "nvc" CACHE STRING "" FORCE)
|
||||||
|
set(CMAKE_Fortran_COMPILER "nvfortran" CACHE STRING "" FORCE)
|
||||||
|
set(MPI_CXX "nvc++" CACHE STRING "" FORCE)
|
||||||
|
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
||||||
|
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||||
|
|
||||||
@ -18,11 +18,11 @@ set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
|||||||
|
|
||||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||||
set(OpenMP_C "icx" CACHE STRING "" FORCE)
|
set(OpenMP_C "icx" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_C_FLAGS "-qopenmp" CACHE STRING "" FORCE)
|
set(OpenMP_C_FLAGS "-qopenmp -qopenmp-simd" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_CXX "icpx" CACHE STRING "" FORCE)
|
set(OpenMP_CXX "icpx" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_CXX_FLAGS "-qopenmp" CACHE STRING "" FORCE)
|
set(OpenMP_CXX_FLAGS "-qopenmp -qopenmp-simd" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_Fortran_FLAGS "-qopenmp" CACHE STRING "" FORCE)
|
set(OpenMP_Fortran_FLAGS "-qopenmp -qopenmp-simd" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_omp_LIBRARY "libiomp5.so" CACHE PATH "" FORCE)
|
set(OpenMP_omp_LIBRARY "libiomp5.so" CACHE PATH "" FORCE)
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# preset that will restore gcc/g++ with support for MPI and OpenMP (on Linux boxes)
|
# preset that will set gcc/g++ with extra warnings enabled and support for MPI and OpenMP (on Linux boxes)
|
||||||
|
|
||||||
set(CMAKE_CXX_COMPILER "g++" CACHE STRING "" FORCE)
|
set(CMAKE_CXX_COMPILER "g++" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_C_COMPILER "gcc" CACHE STRING "" FORCE)
|
set(CMAKE_C_COMPILER "gcc" CACHE STRING "" FORCE)
|
||||||
@ -17,10 +17,3 @@ set(MPI_Fortran "gfortran" CACHE STRING "" FORCE)
|
|||||||
set(MPI_Fortran_COMPILER "mpifort" CACHE STRING "" FORCE)
|
set(MPI_Fortran_COMPILER "mpifort" CACHE STRING "" FORCE)
|
||||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||||
|
|
||||||
set(OpenMP_C "gcc" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_LIB_NAMES "gomp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX "g++" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_FLAGS "-fopenmp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_LIB_NAMES "gomp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_omp_LIBRARY "libgomp.so" CACHE PATH "" FORCE)
|
|
||||||
|
|||||||
@ -7,10 +7,3 @@ set(MPI_CXX "pgc++" CACHE STRING "" FORCE)
|
|||||||
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
||||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||||
|
|
||||||
set(OpenMP_C "pgcc" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_FLAGS "-mp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX "pgc++" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_FLAGS "-mp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_omp_LIBRARY "libomp.so" CACHE PATH "" FORCE)
|
|
||||||
|
|||||||
26
doc/Makefile
26
doc/Makefile
@ -38,16 +38,14 @@ endif
|
|||||||
# override settings for PIP commands
|
# override settings for PIP commands
|
||||||
# PIP_OPTIONS = --cert /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt --proxy http://proxy.mydomain.org
|
# 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")
|
|
||||||
|
|
||||||
# temporarily disable caching so that the hack for the sphinx-tabs extensions to get proper non-html output works
|
# temporarily disable caching so that the hack for the sphinx-tabs extensions to get proper non-html output works
|
||||||
SPHINXEXTRA = -E -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocessing.cpu_count())')
|
SPHINXEXTRA = -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocessing.cpu_count())')
|
||||||
|
|
||||||
# grab list of sources from doxygen config file.
|
# grab list of sources from doxygen config file.
|
||||||
# we only want to use explicitly listed files.
|
# we only want to use explicitly listed files.
|
||||||
DOXYFILES = $(shell sed -n -e 's/\#.*$$//' -e '/^ *INPUT \+=/,/^[A-Z_]\+ \+=/p' doxygen/Doxyfile.in | sed -e 's/@LAMMPS_SOURCE_DIR@/..\/src/g' -e 's/\\//g' -e 's/ \+/ /' -e 's/[A-Z_]\+ \+= *\(YES\|NO\|\)//')
|
DOXYFILES = $(shell sed -n -e 's/\#.*$$//' -e '/^ *INPUT \+=/,/^[A-Z_]\+ \+=/p' doxygen/Doxyfile.in | sed -e 's/@LAMMPS_SOURCE_DIR@/..\/src/g' -e 's/\\//g' -e 's/ \+/ /' -e 's/[A-Z_]\+ \+= *\(YES\|NO\|\)//')
|
||||||
|
|
||||||
.PHONY: help clean-all clean clean-spelling epub mobi rst html pdf spelling anchor_check style_check char_check xmlgen fasthtml
|
.PHONY: help clean-all clean clean-spelling epub mobi html pdf spelling anchor_check style_check char_check role_check xmlgen fasthtml
|
||||||
|
|
||||||
# ------------------------------------------
|
# ------------------------------------------
|
||||||
|
|
||||||
@ -89,6 +87,8 @@ html: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX)
|
|||||||
@$(MAKE) $(MFLAGS) -C graphviz all
|
@$(MAKE) $(MFLAGS) -C graphviz all
|
||||||
@(\
|
@(\
|
||||||
. $(VENV)/bin/activate ; env PYTHONWARNINGS= \
|
. $(VENV)/bin/activate ; env PYTHONWARNINGS= \
|
||||||
|
sphinx-build -E $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) html ;\
|
||||||
|
touch $(RSTDIR)/Fortran.rst ;\
|
||||||
sphinx-build $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) html ;\
|
sphinx-build $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) html ;\
|
||||||
ln -sf Manual.html html/index.html;\
|
ln -sf Manual.html html/index.html;\
|
||||||
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
|
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
|
||||||
@ -96,6 +96,7 @@ html: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX)
|
|||||||
rst_anchor_check src/*.rst ;\
|
rst_anchor_check src/*.rst ;\
|
||||||
python $(BUILDDIR)/utils/check-packages.py -s ../src -d src ;\
|
python $(BUILDDIR)/utils/check-packages.py -s ../src -d src ;\
|
||||||
env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\
|
env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\
|
||||||
|
env LC_ALL=C grep -n ' :[a-z]\+`' $(RSTDIR)/*.rst ;\
|
||||||
python $(BUILDDIR)/utils/check-styles.py -s ../src -d src ;\
|
python $(BUILDDIR)/utils/check-styles.py -s ../src -d src ;\
|
||||||
echo "############################################" ;\
|
echo "############################################" ;\
|
||||||
deactivate ;\
|
deactivate ;\
|
||||||
@ -114,7 +115,9 @@ fasthtml: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX)
|
|||||||
@mkdir -p fasthtml
|
@mkdir -p fasthtml
|
||||||
@(\
|
@(\
|
||||||
. $(VENV)/bin/activate ; env PYTHONWARNINGS= \
|
. $(VENV)/bin/activate ; env PYTHONWARNINGS= \
|
||||||
sphinx-build -j 4 -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/fasthtml/doctrees $(RSTDIR) fasthtml ;\
|
sphinx-build $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/fasthtml/doctrees $(RSTDIR) fasthtml ;\
|
||||||
|
touch $(RSTDIR)/Fortran.rst ;\
|
||||||
|
sphinx-build $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/fasthtml/doctrees $(RSTDIR) fasthtml ;\
|
||||||
deactivate ;\
|
deactivate ;\
|
||||||
)
|
)
|
||||||
@rm -rf fasthtml/_sources
|
@rm -rf fasthtml/_sources
|
||||||
@ -144,6 +147,8 @@ epub: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK)
|
|||||||
@cp src/JPG/*.* epub/JPG
|
@cp src/JPG/*.* epub/JPG
|
||||||
@(\
|
@(\
|
||||||
. $(VENV)/bin/activate ;\
|
. $(VENV)/bin/activate ;\
|
||||||
|
sphinx-build -E $(SPHINXEXTRA) -b epub -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) epub ;\
|
||||||
|
touch $(RSTDIR)/Fortran.rst ;\
|
||||||
sphinx-build $(SPHINXEXTRA) -b epub -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) epub ;\
|
sphinx-build $(SPHINXEXTRA) -b epub -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) epub ;\
|
||||||
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
|
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
|
||||||
deactivate ;\
|
deactivate ;\
|
||||||
@ -163,12 +168,15 @@ pdf: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK)
|
|||||||
@if [ "$(HAS_PDFLATEX)" == "NO" ] ; then echo "PDFLaTeX or latexmk were not found! Please check README for further instructions" 1>&2; exit 1; fi
|
@if [ "$(HAS_PDFLATEX)" == "NO" ] ; then echo "PDFLaTeX or latexmk were not found! Please check README for further instructions" 1>&2; exit 1; fi
|
||||||
@(\
|
@(\
|
||||||
. $(VENV)/bin/activate ; env PYTHONWARNINGS= \
|
. $(VENV)/bin/activate ; env PYTHONWARNINGS= \
|
||||||
sphinx-build $(SPHINXEXTRA) -b latex -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\
|
sphinx-build -E $(SPHINXEXTRA) -b latex -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\
|
||||||
|
touch $(RSTDIR)/Fortran.rst ;\
|
||||||
|
sphinx-build $(SPHINXEXTRA) -b latex -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\
|
||||||
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
|
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
|
||||||
echo "############################################" ;\
|
echo "############################################" ;\
|
||||||
rst_anchor_check src/*.rst ;\
|
rst_anchor_check src/*.rst ;\
|
||||||
python utils/check-packages.py -s ../src -d src ;\
|
python utils/check-packages.py -s ../src -d src ;\
|
||||||
env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\
|
env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\
|
||||||
|
env LC_ALL=C grep -n ' :[a-z]\+`' $(RSTDIR)/*.rst ;\
|
||||||
python utils/check-styles.py -s ../src -d src ;\
|
python utils/check-styles.py -s ../src -d src ;\
|
||||||
echo "############################################" ;\
|
echo "############################################" ;\
|
||||||
deactivate ;\
|
deactivate ;\
|
||||||
@ -214,6 +222,9 @@ package_check : $(VENV)
|
|||||||
char_check :
|
char_check :
|
||||||
@( env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst && exit 1 || : )
|
@( env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst && exit 1 || : )
|
||||||
|
|
||||||
|
role_check :
|
||||||
|
@( env LC_ALL=C grep -n ' :[a-z]\+`' $(RSTDIR)/*.rst && exit 1 || : )
|
||||||
|
|
||||||
xmlgen : doxygen/xml/index.xml
|
xmlgen : doxygen/xml/index.xml
|
||||||
|
|
||||||
doxygen/Doxyfile: doxygen/Doxyfile.in
|
doxygen/Doxyfile: doxygen/Doxyfile.in
|
||||||
@ -242,7 +253,6 @@ $(MATHJAX):
|
|||||||
$(ANCHORCHECK): $(VENV)
|
$(ANCHORCHECK): $(VENV)
|
||||||
@( \
|
@( \
|
||||||
. $(VENV)/bin/activate; \
|
. $(VENV)/bin/activate; \
|
||||||
(cd utils/converters;\
|
pip $(PIP_OPTIONS) install -e utils/converters;\
|
||||||
python setup.py develop);\
|
|
||||||
deactivate;\
|
deactivate;\
|
||||||
)
|
)
|
||||||
|
|||||||
@ -40,8 +40,9 @@ environment and local folders.
|
|||||||
Installing prerequisites for the documentation build
|
Installing prerequisites for the documentation build
|
||||||
|
|
||||||
To run the HTML documention build toolchain, python 3.x, doxygen, git,
|
To run the HTML documention build toolchain, python 3.x, doxygen, git,
|
||||||
and virtualenv have to be installed. Also internet access is initially
|
and the venv python module have to be installed if not already available.
|
||||||
required to download external files and tools.
|
Also internet access is initially required to download external files
|
||||||
|
and tools.
|
||||||
|
|
||||||
Building the PDF format manual requires in addition a compatible LaTeX
|
Building the PDF format manual requires in addition a compatible LaTeX
|
||||||
installation with support for PDFLaTeX and several add-on LaTeX packages
|
installation with support for PDFLaTeX and several add-on LaTeX packages
|
||||||
|
|||||||
@ -4,45 +4,44 @@ This purpose of this document is to provide a point of reference
|
|||||||
for LAMMPS developers and contributors as to what conventions
|
for LAMMPS developers and contributors as to what conventions
|
||||||
should be used to structure and format files in the LAMMPS manual.
|
should be used to structure and format files in the LAMMPS manual.
|
||||||
|
|
||||||
Last change: 2020-04-23
|
Last change: 2022-12-30
|
||||||
|
|
||||||
## File format and tools
|
## File format and tools
|
||||||
|
|
||||||
In fall 2019, the LAMMPS documentation file format has changed from
|
In fall 2019, the LAMMPS documentation file format has changed from a
|
||||||
a home grown minimal markup designed to generate HTML format files
|
home grown markup designed to generate HTML format files only, to
|
||||||
from a mostly plain text format to using the reStructuredText file
|
[reStructuredText](https://docutils.sourceforge.io/rst.html>. For a
|
||||||
format. For a transition period all files in the old .txt format
|
transition period all files in the old .txt format were transparently
|
||||||
were transparently converted to .rst and then processed. The txt2rst
|
converted to .rst and then processed. The `txt2rst tool` is still
|
||||||
tool is still included in the distribution to obtain an initial .rst
|
included in the distribution to obtain an initial .rst file for legacy
|
||||||
file for integration into the manual. Since the transition to
|
integration into the manual. Since that transition to reStructured
|
||||||
reStructured text as source format, many of the artifacts or the
|
text, many of the artifacts of the translation have been removed though,
|
||||||
translation have been removed though and parts of the documentation
|
and parts of the documentation refactored and expanded to take advantage
|
||||||
refactored and expanded to take advantage of the capabilities
|
of the capabilities reStructuredText and associated tools. The
|
||||||
reStructuredText and associated tools. The conversion from the
|
conversion from the source to the final formats (HTML, PDF, and
|
||||||
source to the final formats (HTML, PDF, and optionally e-book
|
optionally e-book reader formats ePUB and MOBI) is mostly automated and
|
||||||
reader formats ePUB and MOBI) is mostly automated and controlled
|
controlled by a Makefile in the `doc` folder. This makefile assumes that
|
||||||
by a Makefile in the `doc` folder. This makefile assumes that the
|
the processing is done on a Unix-like machine and Python 3.5 or later
|
||||||
processing is done on a Unix-like machine and Python 3.5 or later
|
and a matching venv module are available. Additional Python
|
||||||
and a matching virtualenv module are available. Additional Python
|
packages (like the Sphinx tool and several extensions) are transparently
|
||||||
packages (like the Sphinx tool and several extensions) are
|
installed into a virtual environment over the internet using the `pip`
|
||||||
transparently installed into a virtual environment over the
|
package manager. Further requirements and details are discussed in the
|
||||||
internet using the `pip` package manager. Further requirements
|
manual.
|
||||||
and details are discussed in the manual.
|
|
||||||
|
|
||||||
## Work in progress
|
## Work in progress
|
||||||
|
|
||||||
The refactoring and improving of the documentation is an ongoing
|
The refactoring and improving of the documentation is an ongoing
|
||||||
process, so statements in this document may not always be fully
|
process, so statements in this document may not always be fully
|
||||||
up-to-date. If in doubt, contact the LAMMPS developers.
|
up-to-date. When in doubt, contact the LAMMPS developers.
|
||||||
|
|
||||||
## General structure
|
## General structure
|
||||||
|
|
||||||
The layout and formatting of added files should follow the example
|
The layout and formatting of added files should follow the example of
|
||||||
of the existing files. Since those are directly derived from their
|
the existing files. Since many of those were initially derived from
|
||||||
former .txt format versions and the manual has been maintained in
|
their former .txt format versions and the manual has been maintained in
|
||||||
that format for many years, there is a large degree of consistency
|
that format for many years, there is a large degree of consistency
|
||||||
already, so comparison with similar files should give you a good
|
already, so comparison with similar files should give you a good idea
|
||||||
idea what kind of information and sections are needed.
|
what kind of information and sections are needed.
|
||||||
|
|
||||||
## Formatting conventions
|
## Formatting conventions
|
||||||
|
|
||||||
@ -52,21 +51,27 @@ It seems to be sufficient to have this consistent only within
|
|||||||
any single file and it is not (yet) enforced strictly, but making
|
any single file and it is not (yet) enforced strictly, but making
|
||||||
this globally consistent makes it easier to move sections around.
|
this globally consistent makes it easier to move sections around.
|
||||||
|
|
||||||
Filenames, folders, paths, (shell) commands, definitions, makefile
|
File names, folders, paths, (shell) commands, definitions, makefile
|
||||||
settings and similar should be formatted as "literals" with
|
settings and similar should be formatted as "literals" with
|
||||||
double backward quotes bracketing the item: \`\`path/to/some/file\`\`
|
double backward quotes bracketing the item: \`\`path/to/some/file\`\`
|
||||||
|
|
||||||
Keywords and options are formatted in italics: \*option\*
|
Keywords and options are formatted in italics: \*option\*
|
||||||
|
|
||||||
Mathematical expressions, equations, symbols are typeset using
|
Mathematical expressions, equations, symbols are typeset using
|
||||||
either a `.. math:`` block or the `:math:` role.
|
either a `.. math:` block or the `:math:` role.
|
||||||
|
|
||||||
Groups of shell commands or LAMMPS input script or C/C++ source
|
Groups of shell commands or LAMMPS input script or C/C++/Python source
|
||||||
code should be typeset into a `.. code-block::` section. A syntax
|
code should be typeset into a `.. code-block::` section. A syntax
|
||||||
highlighting extension for LAMMPS input scripts is provided, so
|
highlighting extension for LAMMPS input scripts is provided, so `LAMMPS`
|
||||||
`LAMMPS` can be used to indicate the language in the code block
|
can be used to indicate the language in the code block in addition to
|
||||||
in addition to `bash`, `c`, or `python`. When no syntax style
|
`bash`, `c`, `c++`, `console`, `csh`, `diff', `fortran`, `json`, `make`,
|
||||||
is indicated, no syntax highlighting is performed.
|
`perl`, `powershell`, `python`, `sh`, or `tcl`, `text`, or `yaml`. When
|
||||||
|
no syntax style is indicated, no syntax highlighting is performed. When
|
||||||
|
typesetting commands executed on the shell, please do not prefix
|
||||||
|
commands with a shell prompt and use `bash` highlighting, except when
|
||||||
|
the block also shows the output from that command. In the latter case,
|
||||||
|
please use a dollar sign as the shell prompt and `console` for syntax
|
||||||
|
highlighting.
|
||||||
|
|
||||||
As an alternative, e.g. to typeset the syntax of file formats
|
As an alternative, e.g. to typeset the syntax of file formats
|
||||||
a `.. parsed-literal::` block can be used, which allows some
|
a `.. parsed-literal::` block can be used, which allows some
|
||||||
@ -89,22 +94,30 @@ by ` :class: note`.
|
|||||||
|
|
||||||
## Required steps when adding a custom style to LAMMPS
|
## Required steps when adding a custom style to LAMMPS
|
||||||
|
|
||||||
When adding a new style (e.g. pair style or a compute or a fix)
|
When adding a new style (e.g. pair style or a compute or a fix) or a new
|
||||||
or a new command, it is **required** to include the corresponding
|
command, it is **required** to include the **corresponding documentation**
|
||||||
documentation. Those are often new files that need to be added.
|
in [reStructuredText format](https://docutils.sourceforge.io/rst.html).
|
||||||
In order to be included in the documentation, those new files
|
Those are often new files that need to be added. In order to be
|
||||||
need to be reference in a `.. toctree::` block. Most of those
|
included in the documentation, those new files need to be referenced in a
|
||||||
use patterns with wildcards, so the addition will be automatic.
|
`.. toctree::` block. Most of those use patterns with wild cards, so the
|
||||||
However, those additions also need to be added to some lists of
|
addition will be automatic. However, those additions also need to be
|
||||||
styles or commands. The `make style\_check` command will perform
|
added to some lists of styles or commands. The `make style\_check`
|
||||||
a test and report any missing entries and list the affected files.
|
command when executed in the `doc` folder will perform a test and report
|
||||||
Any references defined with `.. \_refname:` have to be unique
|
any missing entries and list the affected files. Any references defined
|
||||||
across all documentation files and this can be checked for with
|
with `.. \_refname:` have to be unique across all documentation files
|
||||||
`make anchor\_check`. Finally, a spell-check should be done,
|
and this can be checked for with `make anchor\_check`. Finally, a
|
||||||
which is triggered via `make spelling`. Any offenses need to
|
spell-check should be done, which is triggered via `make spelling`. Any
|
||||||
be corrected and false positives should be added to the file
|
offenses need to be corrected and false positives should be added to the
|
||||||
`utils/sphinx-config/false\_positives.txt`.
|
file `utils/sphinx-config/false\_positives.txt`.
|
||||||
|
|
||||||
## Required additional steps when adding a new package to LAMMPS
|
## Required additional steps when adding a new package to LAMMPS
|
||||||
|
|
||||||
TODO
|
When adding a new package, the package must be added to the list of
|
||||||
|
packages in the `Packages_list.rst` file. If additional build instructions
|
||||||
|
need to be followed, a corresponding section should be added to the
|
||||||
|
`Build_extras.rst` file and linked from the list at the top of the
|
||||||
|
file as well as the equivalent list in the `Build_packages.rst` file.
|
||||||
|
|
||||||
|
A detailed description of the package and pointers to configuration,
|
||||||
|
included commands and examples, external pages, author information and
|
||||||
|
more should be added to the `Packages_details.rst` file.
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
.TH LAMMPS "1" "23 June 2022" "2022-6-23"
|
.TH LAMMPS "1" "23 June 2022 - Update 3" "2022-6-23"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
.B LAMMPS
|
.B LAMMPS
|
||||||
\- Molecular Dynamics Simulator. Version 23 June 2022
|
\- Molecular Dynamics Simulator. Version 23 June 2022 - Update 3
|
||||||
|
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B lmp
|
.B lmp
|
||||||
@ -161,7 +161,7 @@ list references for specific cite-able features used during a
|
|||||||
run.
|
run.
|
||||||
.TP
|
.TP
|
||||||
\fB\-pk <style> [options]\fR or \fB\-package <style> [options]\fR
|
\fB\-pk <style> [options]\fR or \fB\-package <style> [options]\fR
|
||||||
Invoke the \fBpackage\R command with <style> and optional arguments.
|
Invoke the \fBpackage\fR command with <style> and optional arguments.
|
||||||
The syntax is the same as if the command appeared in an input script.
|
The syntax is the same as if the command appeared in an input script.
|
||||||
For example "-pk gpu 2" is the same as "package gpu 2" in the input
|
For example "-pk gpu 2" is the same as "package gpu 2" in the input
|
||||||
script. The possible styles and options are discussed in the
|
script. The possible styles and options are discussed in the
|
||||||
|
|||||||
@ -314,7 +314,7 @@ Bibliography
|
|||||||
Espanol, Revenga, Physical Review E, 67, 026705 (2003).
|
Espanol, Revenga, Physical Review E, 67, 026705 (2003).
|
||||||
|
|
||||||
**(Espanol1997)**
|
**(Espanol1997)**
|
||||||
Espanol, Europhys Lett, 40(6): 631-636 (1997). DOI: 10.1209/epl/i1997-00515-8
|
Espanol, Europhys Lett, 40(6): 631-636 (1997). DOI:10.1209/epl/i1997-00515-8
|
||||||
|
|
||||||
**(Evans and Morriss)**
|
**(Evans and Morriss)**
|
||||||
Evans and Morriss, Phys Rev A, 30, 1528 (1984).
|
Evans and Morriss, Phys Rev A, 30, 1528 (1984).
|
||||||
@ -368,7 +368,7 @@ Bibliography
|
|||||||
Frenkel and Smit, Understanding Molecular Simulation, Academic Press, London, 2002.
|
Frenkel and Smit, Understanding Molecular Simulation, Academic Press, London, 2002.
|
||||||
|
|
||||||
**(GLE4MD)**
|
**(GLE4MD)**
|
||||||
`http://gle4md.org/ <http://gle4md.org/>`_
|
`https://gle4md.org/ <https://gle4md.org/>`_
|
||||||
|
|
||||||
**(Gao)**
|
**(Gao)**
|
||||||
Gao and Weber, Nuclear Instruments and Methods in Physics Research B 191 (2012) 504.
|
Gao and Weber, Nuclear Instruments and Methods in Physics Research B 191 (2012) 504.
|
||||||
@ -401,13 +401,13 @@ Bibliography
|
|||||||
Hayre, and Farago, Comp Phys Comm, 185, 524 (2014)
|
Hayre, and Farago, Comp Phys Comm, 185, 524 (2014)
|
||||||
|
|
||||||
**(Groot)**
|
**(Groot)**
|
||||||
Groot and Warren, J Chem Phys, 107: 4423-4435 (1997). DOI: 10.1063/1.474784
|
Groot and Warren, J Chem Phys, 107: 4423-4435 (1997). DOI:10.1063/1.474784
|
||||||
|
|
||||||
**(Guenole)**
|
**(Guenole)**
|
||||||
Guenole, Noehring, Vaid, Houlle, Xie, Prakash, Bitzek, Comput Mater Sci, 175, 109584 (2020).
|
Guenole, Noehring, Vaid, Houlle, Xie, Prakash, Bitzek, Comput Mater Sci, 175, 109584 (2020).
|
||||||
|
|
||||||
**(Gullet)**
|
**(Gullet)**
|
||||||
Gullet, Wagner, Slepoy, SANDIA Report 2003-8782 (2003).
|
Gullet, Wagner, Slepoy, SANDIA Report 2003-8782 (2003). DOI:10.2172/918395
|
||||||
|
|
||||||
**(Guo)**
|
**(Guo)**
|
||||||
Guo and Thirumalai, Journal of Molecular Biology, 263, 323-43 (1996).
|
Guo and Thirumalai, Journal of Molecular Biology, 263, 323-43 (1996).
|
||||||
@ -461,7 +461,7 @@ Bibliography
|
|||||||
Hunt, Mol Simul, 42, 347 (2016).
|
Hunt, Mol Simul, 42, 347 (2016).
|
||||||
|
|
||||||
**(IPI)**
|
**(IPI)**
|
||||||
`http://epfl-cosmo.github.io/gle4md/index.html?page=ipi <http://epfl-cosmo.github.io/gle4md/index.html?page=ipi>`_
|
`https://ipi-code.org/ <https://ipi-code.org/>`
|
||||||
|
|
||||||
**(IPI-CPC)**
|
**(IPI-CPC)**
|
||||||
Ceriotti, More and Manolopoulos, Comp Phys Comm, 185, 1019-1026 (2014).
|
Ceriotti, More and Manolopoulos, Comp Phys Comm, 185, 1019-1026 (2014).
|
||||||
@ -605,16 +605,16 @@ Bibliography
|
|||||||
I.\ Leven et al, J. Chem.Theory Comput. 12, 2896-905 (2016).
|
I.\ Leven et al, J. Chem.Theory Comput. 12, 2896-905 (2016).
|
||||||
|
|
||||||
**(Li2013_POF)**
|
**(Li2013_POF)**
|
||||||
Li, Hu, Wang, Ma, Zhou, Phys Fluids, 25: 072103 (2013). DOI: 10.1063/1.4812366.
|
Li, Hu, Wang, Ma, Zhou, Phys Fluids, 25: 072103 (2013). DOI:10.1063/1.4812366.
|
||||||
|
|
||||||
**(Li2014_JCP)**
|
**(Li2014_JCP)**
|
||||||
Li, Tang, Lei, Caswell, Karniadakis, J Comput Phys, 265: 113-127 (2014). DOI: 10.1016/j.jcp.2014.02.003.
|
Li, Tang, Lei, Caswell, Karniadakis, J Comput Phys, 265: 113-127 (2014). DOI:10.1016/j.jcp.2014.02.003.
|
||||||
|
|
||||||
**(Li2015_CC)**
|
**(Li2015_CC)**
|
||||||
Li, Tang, Li, Karniadakis, Chem Commun, 51: 11038-11040 (2015). DOI: 10.1039/C5CC01684C.
|
Li, Tang, Li, Karniadakis, Chem Commun, 51: 11038-11040 (2015). DOI:10.1039/C5CC01684C.
|
||||||
|
|
||||||
**(Li2015_JCP)**
|
**(Li2015_JCP)**
|
||||||
Li, Yazdani, Tartakovsky, Karniadakis, J Chem Phys, 143: 014101 (2015). DOI: 10.1063/1.4923254.
|
Li, Yazdani, Tartakovsky, Karniadakis, J Chem Phys, 143: 014101 (2015). DOI:10.1063/1.4923254.
|
||||||
|
|
||||||
**(Lisal)**
|
**(Lisal)**
|
||||||
M.\ Lisal, J.K. Brennan, J. Bonet Avalos, "Dissipative particle dynamics at isothermal, isobaric, isoenergetic, and isoenthalpic conditions using Shardlow-like splitting algorithms.",
|
M.\ Lisal, J.K. Brennan, J. Bonet Avalos, "Dissipative particle dynamics at isothermal, isobaric, isoenergetic, and isoenthalpic conditions using Shardlow-like splitting algorithms.",
|
||||||
@ -733,8 +733,8 @@ Bibliography
|
|||||||
**(Mishin)**
|
**(Mishin)**
|
||||||
Mishin, Mehl, and Papaconstantopoulos, Acta Mater, 53, 4029 (2005).
|
Mishin, Mehl, and Papaconstantopoulos, Acta Mater, 53, 4029 (2005).
|
||||||
|
|
||||||
**(Mitchell and Finchham)**
|
**(Mitchell and Fincham)**
|
||||||
Mitchell, Finchham, J Phys Condensed Matter, 5, 1031-1038 (1993).
|
Mitchell, Fincham, J Phys Condensed Matter, 5, 1031-1038 (1993).
|
||||||
|
|
||||||
**(Mitchell2011)**
|
**(Mitchell2011)**
|
||||||
Mitchell. A non-local, ordinary-state-based viscoelasticity model for peridynamics. Sandia National Lab Report, 8064:1-28 (2011).
|
Mitchell. A non-local, ordinary-state-based viscoelasticity model for peridynamics. Sandia National Lab Report, 8064:1-28 (2011).
|
||||||
@ -875,7 +875,7 @@ Bibliography
|
|||||||
G.A. Tribello, M. Bonomi, D. Branduardi, C. Camilloni and G. Bussi, Comp. Phys. Comm 185, 604 (2014)
|
G.A. Tribello, M. Bonomi, D. Branduardi, C. Camilloni and G. Bussi, Comp. Phys. Comm 185, 604 (2014)
|
||||||
|
|
||||||
**(Paquay)**
|
**(Paquay)**
|
||||||
Paquay and Kusters, Biophys. J., 110, 6, (2016). preprint available at `arXiv:1411.3019 <http://arxiv.org/abs/1411.3019/>`_.
|
Paquay and Kusters, Biophys. J., 110, 6, (2016). preprint available at `arXiv:1411.3019 <https://arxiv.org/abs/1411.3019/>`_.
|
||||||
|
|
||||||
**(Park)**
|
**(Park)**
|
||||||
Park, Schulten, J. Chem. Phys. 120 (13), 5946 (2004)
|
Park, Schulten, J. Chem. Phys. 120 (13), 5946 (2004)
|
||||||
@ -1373,7 +1373,7 @@ Bibliography
|
|||||||
Zhu, Tajkhorshid, and Schulten, Biophys. J. 83, 154 (2002).
|
Zhu, Tajkhorshid, and Schulten, Biophys. J. 83, 154 (2002).
|
||||||
|
|
||||||
**(Ziegler)**
|
**(Ziegler)**
|
||||||
J.F. Ziegler, J. P. Biersack and U. Littmark, "The Stopping and Range of Ions in Matter," Volume 1, Pergamon, 1985.
|
J.F. Ziegler, J. P. Biersack and U. Littmark, "The Stopping and Range of Ions in Matter", Volume 1, Pergamon, 1985.
|
||||||
|
|
||||||
**(Zimmerman2004)**
|
**(Zimmerman2004)**
|
||||||
Zimmerman, JA; Webb, EB; Hoyt, JJ;. Jones, RE; Klein, PA; Bammann, DJ, "Calculation of stress in atomistic simulation." Special Issue of Modelling and Simulation in Materials Science and Engineering (2004),12:S319.
|
Zimmerman, JA; Webb, EB; Hoyt, JJ;. Jones, RE; Klein, PA; Bammann, DJ, "Calculation of stress in atomistic simulation." Special Issue of Modelling and Simulation in Materials Science and Engineering (2004),12:S319.
|
||||||
|
|||||||
@ -276,7 +276,7 @@ LAMMPS.
|
|||||||
|
|
||||||
Parallel build (see ``src/MAKE/Makefile.mpi``):
|
Parallel build (see ``src/MAKE/Makefile.mpi``):
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: make
|
||||||
|
|
||||||
CC = mpicxx
|
CC = mpicxx
|
||||||
CCFLAGS = -g -O3
|
CCFLAGS = -g -O3
|
||||||
@ -296,7 +296,7 @@ LAMMPS.
|
|||||||
|
|
||||||
If compilation stops with a message like the following:
|
If compilation stops with a message like the following:
|
||||||
|
|
||||||
.. code-block::
|
.. code-block:: output
|
||||||
|
|
||||||
g++ -g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -I../STUBS -c ../main.cpp
|
g++ -g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -I../STUBS -c ../main.cpp
|
||||||
In file included from ../pointers.h:24:0,
|
In file included from ../pointers.h:24:0,
|
||||||
|
|||||||
@ -140,36 +140,62 @@ of the LAMMPS project on GitHub.
|
|||||||
The unit testing facility is integrated into the CMake build process
|
The unit testing facility is integrated into the CMake build process
|
||||||
of the LAMMPS source code distribution itself. It can be enabled by
|
of the LAMMPS source code distribution itself. It can be enabled by
|
||||||
setting ``-D ENABLE_TESTING=on`` during the CMake configuration step.
|
setting ``-D ENABLE_TESTING=on`` during the CMake configuration step.
|
||||||
It requires the `YAML <http://pyyaml.org/>`_ library and development
|
It requires the `YAML <https://pyyaml.org/>`_ library and development
|
||||||
headers (if those are not found locally a recent version will be
|
headers (if those are not found locally a recent version will be
|
||||||
downloaded and compiled along with LAMMPS and the test program) to
|
downloaded and compiled along with LAMMPS and the test program) to
|
||||||
compile and will download and compile a specific recent version of the
|
compile and will download and compile a specific recent version of the
|
||||||
`Googletest <https://github.com/google/googletest/>`_ C++ test framework
|
`Googletest <https://github.com/google/googletest/>`_ C++ test framework
|
||||||
for implementing the tests.
|
for implementing the tests.
|
||||||
|
|
||||||
|
.. admonition:: Software version requirements for testing
|
||||||
|
:class: note
|
||||||
|
|
||||||
|
The compiler and library version requirements for the testing
|
||||||
|
framework are more strict than for the main part of LAMMPS. For
|
||||||
|
example the default GNU C++ and Fortran compilers of RHEL/CentOS 7.x
|
||||||
|
(version 4.8.x) are not sufficient. The CMake configuration will try
|
||||||
|
to detect incompatible versions and either skip incompatible tests or
|
||||||
|
stop with an error. Also the number of tests will depend on
|
||||||
|
installed LAMMPS packages, development environment, operating system,
|
||||||
|
and configuration settings.
|
||||||
|
|
||||||
After compilation is complete, the unit testing is started in the build
|
After compilation is complete, the unit testing is started in the build
|
||||||
folder using the ``ctest`` command, which is part of the CMake software.
|
folder using the ``ctest`` command, which is part of the CMake software.
|
||||||
The output of this command will be looking something like this::
|
The output of this command will be looking something like this:
|
||||||
|
|
||||||
[...]$ ctest
|
.. code-block:: console
|
||||||
Test project /home/akohlmey/compile/lammps/build-testing
|
|
||||||
Start 1: MolPairStyle:hybrid-overlay
|
|
||||||
1/109 Test #1: MolPairStyle:hybrid-overlay ......... Passed 0.02 sec
|
|
||||||
Start 2: MolPairStyle:hybrid
|
|
||||||
2/109 Test #2: MolPairStyle:hybrid ................. Passed 0.01 sec
|
|
||||||
Start 3: MolPairStyle:lj_class2
|
|
||||||
[...]
|
|
||||||
Start 107: PotentialFileReader
|
|
||||||
107/109 Test #107: PotentialFileReader ................ Passed 0.04 sec
|
|
||||||
Start 108: EIMPotentialFileReader
|
|
||||||
108/109 Test #108: EIMPotentialFileReader ............. Passed 0.03 sec
|
|
||||||
Start 109: TestSimpleCommands
|
|
||||||
109/109 Test #109: TestSimpleCommands ................. Passed 0.02 sec
|
|
||||||
|
|
||||||
100% tests passed, 0 tests failed out of 26
|
$ ctest
|
||||||
|
Test project /home/akohlmey/compile/lammps/build-testing
|
||||||
|
Start 1: RunLammps
|
||||||
|
1/563 Test #1: RunLammps .......................................... Passed 0.28 sec
|
||||||
|
Start 2: HelpMessage
|
||||||
|
2/563 Test #2: HelpMessage ........................................ Passed 0.06 sec
|
||||||
|
Start 3: InvalidFlag
|
||||||
|
3/563 Test #3: InvalidFlag ........................................ Passed 0.06 sec
|
||||||
|
Start 4: Tokenizer
|
||||||
|
4/563 Test #4: Tokenizer .......................................... Passed 0.05 sec
|
||||||
|
Start 5: MemPool
|
||||||
|
5/563 Test #5: MemPool ............................................ Passed 0.05 sec
|
||||||
|
Start 6: ArgUtils
|
||||||
|
6/563 Test #6: ArgUtils ........................................... Passed 0.05 sec
|
||||||
|
[...]
|
||||||
|
Start 561: ImproperStyle:zero
|
||||||
|
561/563 Test #561: ImproperStyle:zero ................................. Passed 0.07 sec
|
||||||
|
Start 562: TestMliapPyUnified
|
||||||
|
562/563 Test #562: TestMliapPyUnified ................................. Passed 0.16 sec
|
||||||
|
Start 563: TestPairList
|
||||||
|
563/563 Test #563: TestPairList ....................................... Passed 0.06 sec
|
||||||
|
|
||||||
Total Test time (real) = 25.57 sec
|
100% tests passed, 0 tests failed out of 563
|
||||||
|
|
||||||
|
Label Time Summary:
|
||||||
|
generated = 0.85 sec*proc (3 tests)
|
||||||
|
noWindows = 4.16 sec*proc (2 tests)
|
||||||
|
slow = 78.33 sec*proc (67 tests)
|
||||||
|
unstable = 28.23 sec*proc (34 tests)
|
||||||
|
|
||||||
|
Total Test time (real) = 132.34 sec
|
||||||
|
|
||||||
The ``ctest`` command has many options, the most important ones are:
|
The ``ctest`` command has many options, the most important ones are:
|
||||||
|
|
||||||
@ -200,11 +226,13 @@ Fortran) and testing different aspects of the LAMMPS software and its features.
|
|||||||
The tests will adapt to the compilation settings of LAMMPS, so that tests
|
The tests will adapt to the compilation settings of LAMMPS, so that tests
|
||||||
will be skipped if prerequisite features are not available in LAMMPS.
|
will be skipped if prerequisite features are not available in LAMMPS.
|
||||||
|
|
||||||
.. note::
|
.. admonition:: Work in Progress
|
||||||
|
:class: note
|
||||||
|
|
||||||
The unit test framework was added in spring 2020 and is under active
|
The unit test framework was added in spring 2020 and is under active
|
||||||
development. The coverage is not complete and will be expanded over
|
development. The coverage is not complete and will be expanded over
|
||||||
time.
|
time. Preference is given to parts of the code base that are easy to
|
||||||
|
test or commonly used.
|
||||||
|
|
||||||
Tests for styles of the same kind of style (e.g. pair styles or bond
|
Tests for styles of the same kind of style (e.g. pair styles or bond
|
||||||
styles) are performed with the same test executable using different
|
styles) are performed with the same test executable using different
|
||||||
@ -238,9 +266,9 @@ the CMake option ``-D BUILD_MPI=off`` can significantly speed up testing,
|
|||||||
since this will skip the MPI initialization for each test run.
|
since this will skip the MPI initialization for each test run.
|
||||||
Below is an example command and output:
|
Below is an example command and output:
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: console
|
||||||
|
|
||||||
[tests]$ test_pair_style mol-pair-lj_cut.yaml
|
$ test_pair_style mol-pair-lj_cut.yaml
|
||||||
[==========] Running 6 tests from 1 test suite.
|
[==========] Running 6 tests from 1 test suite.
|
||||||
[----------] Global test environment set-up.
|
[----------] Global test environment set-up.
|
||||||
[----------] 6 tests from PairStyle
|
[----------] 6 tests from PairStyle
|
||||||
@ -520,7 +548,7 @@ commands like the following:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ clang-format -i some_file.cpp
|
clang-format -i some_file.cpp
|
||||||
|
|
||||||
|
|
||||||
The following target are available for both, GNU make and CMake:
|
The following target are available for both, GNU make and CMake:
|
||||||
@ -529,3 +557,19 @@ The following target are available for both, GNU make and CMake:
|
|||||||
|
|
||||||
make format-src # apply clang-format to all files in src and the package folders
|
make format-src # apply clang-format to all files in src and the package folders
|
||||||
make format-tests # apply clang-format to all files in the unittest tree
|
make format-tests # apply clang-format to all files in the unittest tree
|
||||||
|
|
||||||
|
----------
|
||||||
|
|
||||||
|
.. _gh-cli:
|
||||||
|
|
||||||
|
GitHub command line interface
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
GitHub is developing a `tool for the command line
|
||||||
|
<https://cli.github.com>`_ that interacts with the GitHub website via a
|
||||||
|
command called ``gh``. This can be extremely convenient when working
|
||||||
|
with a Git repository hosted on GitHub (like LAMMPS). It is thus highly
|
||||||
|
recommended to install it when doing LAMMPS development.
|
||||||
|
|
||||||
|
The capabilities of the ``gh`` command is continually expanding, so
|
||||||
|
please see the documentation at https://cli.github.com/manual/
|
||||||
|
|||||||
@ -12,11 +12,11 @@ in addition to
|
|||||||
- Traditional make
|
- Traditional make
|
||||||
* - .. code-block:: bash
|
* - .. code-block:: bash
|
||||||
|
|
||||||
$ cmake -D PKG_NAME=yes
|
cmake -D PKG_NAME=yes
|
||||||
|
|
||||||
- .. code-block:: bash
|
- .. code-block:: console
|
||||||
|
|
||||||
$ make yes-name
|
make yes-name
|
||||||
|
|
||||||
as described on the :doc:`Build_package <Build_package>` page.
|
as described on the :doc:`Build_package <Build_package>` page.
|
||||||
|
|
||||||
@ -28,14 +28,16 @@ You may need to tell LAMMPS where it is found on your system.
|
|||||||
|
|
||||||
This is the list of packages that may require additional steps.
|
This is the list of packages that may require additional steps.
|
||||||
|
|
||||||
|
.. this list must be kept in sync with its counterpart in Build_package.rst
|
||||||
.. table_from_list::
|
.. table_from_list::
|
||||||
:columns: 6
|
:columns: 6
|
||||||
|
|
||||||
* :ref:`ADIOS <adios>`
|
* :ref:`ADIOS <adios>`
|
||||||
* :ref:`ATC <atc>`
|
* :ref:`ATC <atc>`
|
||||||
* :ref:`AWPMD <awpmd>`
|
* :ref:`AWPMD <awpmd>`
|
||||||
* :ref:`COLVARS <colvars>`
|
* :ref:`COLVARS <colvar>`
|
||||||
* :ref:`COMPRESS <compress>`
|
* :ref:`COMPRESS <compress>`
|
||||||
|
* :ref:`ELECTRODE <electrode>`
|
||||||
* :ref:`GPU <gpu>`
|
* :ref:`GPU <gpu>`
|
||||||
* :ref:`H5MD <h5md>`
|
* :ref:`H5MD <h5md>`
|
||||||
* :ref:`INTEL <intel>`
|
* :ref:`INTEL <intel>`
|
||||||
@ -123,6 +125,7 @@ CMake build
|
|||||||
-D GPU_API=value # value = opencl (default) or cuda or hip
|
-D GPU_API=value # value = opencl (default) or cuda or hip
|
||||||
-D GPU_PREC=value # precision setting
|
-D GPU_PREC=value # precision setting
|
||||||
# value = double or mixed (default) or single
|
# value = double or mixed (default) or single
|
||||||
|
-D HIP_PATH # path to HIP installation. Must be set if GPU_API=HIP
|
||||||
-D GPU_ARCH=value # primary GPU hardware choice for GPU_API=cuda
|
-D GPU_ARCH=value # primary GPU hardware choice for GPU_API=cuda
|
||||||
# value = sm_XX, see below
|
# value = sm_XX, see below
|
||||||
# default is sm_50
|
# default is sm_50
|
||||||
@ -147,7 +150,9 @@ CMake build
|
|||||||
* sm_60 or sm_61 for Pascal (supported since CUDA 8)
|
* sm_60 or sm_61 for Pascal (supported since CUDA 8)
|
||||||
* sm_70 for Volta (supported since CUDA 9)
|
* sm_70 for Volta (supported since CUDA 9)
|
||||||
* sm_75 for Turing (supported since CUDA 10)
|
* sm_75 for Turing (supported since CUDA 10)
|
||||||
* sm_80 for Ampere (supported since CUDA 11)
|
* sm_80 or sm_86 for Ampere (supported since CUDA 11, sm_86 since CUDA 11.1)
|
||||||
|
* sm_89 for Lovelace (supported since CUDA 11.8)
|
||||||
|
* sm_90 for Hopper (supported since CUDA 12.0)
|
||||||
|
|
||||||
A more detailed list can be found, for example,
|
A more detailed list can be found, for example,
|
||||||
at `Wikipedia's CUDA article <https://en.wikipedia.org/wiki/CUDA#GPUs_supported>`_
|
at `Wikipedia's CUDA article <https://en.wikipedia.org/wiki/CUDA#GPUs_supported>`_
|
||||||
@ -215,15 +220,15 @@ LAMMPS code. This also applies to the ``-DLAMMPS_BIGBIG``\ ,
|
|||||||
Makefile you use.
|
Makefile you use.
|
||||||
|
|
||||||
You can also build the library in one step from the ``lammps/src`` dir,
|
You can also build the library in one step from the ``lammps/src`` dir,
|
||||||
using a command like these, which simply invoke the ``lib/gpu/Install.py``
|
using a command like these, which simply invokes the ``lib/gpu/Install.py``
|
||||||
script with the specified args:
|
script with the specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-gpu # print help message
|
make lib-gpu # print help message
|
||||||
$ make lib-gpu args="-b" # build GPU library with default Makefile.linux
|
make lib-gpu args="-b" # build GPU library with default Makefile.linux
|
||||||
$ make lib-gpu args="-m xk7 -p single -o xk7.single" # create new Makefile.xk7.single, altered for single-precision
|
make lib-gpu args="-m xk7 -p single -o xk7.single" # create new Makefile.xk7.single, altered for single-precision
|
||||||
$ make lib-gpu args="-m mpi -a sm_60 -p mixed -b" # build GPU library with mixed precision and P100 using other settings in Makefile.mpi
|
make lib-gpu args="-m mpi -a sm_60 -p mixed -b" # build GPU library with mixed precision and P100 using other settings in Makefile.mpi
|
||||||
|
|
||||||
Note that this procedure starts with a Makefile.machine in lib/gpu, as
|
Note that this procedure starts with a Makefile.machine in lib/gpu, as
|
||||||
specified by the "-m" switch. For your convenience, machine makefiles
|
specified by the "-m" switch. For your convenience, machine makefiles
|
||||||
@ -295,7 +300,7 @@ detailed information is available at:
|
|||||||
|
|
||||||
In addition to installing the KIM API, it is also necessary to install the
|
In addition to installing the KIM API, it is also necessary to install the
|
||||||
library of KIM models (interatomic potentials).
|
library of KIM models (interatomic potentials).
|
||||||
See `Obtaining KIM Models <http://openkim.org/doc/usage/obtaining-models>`_ to
|
See `Obtaining KIM Models <https://openkim.org/doc/usage/obtaining-models>`_ to
|
||||||
learn how to install a pre-build binary of the OpenKIM Repository of Models.
|
learn how to install a pre-build binary of the OpenKIM Repository of Models.
|
||||||
See the list of all KIM models here: https://openkim.org/browse/models
|
See the list of all KIM models here: https://openkim.org/browse/models
|
||||||
|
|
||||||
@ -331,18 +336,18 @@ 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;
|
You can download and build the KIM library manually if you prefer;
|
||||||
follow the instructions in ``lib/kim/README``. You can also do
|
follow the instructions in ``lib/kim/README``. You can also do
|
||||||
this in one step from the lammps/src directory, 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
|
these, which simply invokes the ``lib/kim/Install.py`` script with
|
||||||
the specified args.
|
the specified args.
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-kim # print help message
|
make lib-kim # print help message
|
||||||
$ make lib-kim args="-b " # (re-)install KIM API lib with only example models
|
make lib-kim args="-b " # (re-)install KIM API lib with only example models
|
||||||
$ make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # ditto plus one model
|
make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # ditto plus one model
|
||||||
$ make lib-kim args="-b -a everything" # install KIM API lib with all models
|
make lib-kim args="-b -a everything" # install KIM API lib with all models
|
||||||
$ make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # add one model or model driver
|
make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # add one model or model driver
|
||||||
$ make lib-kim args="-p /usr/local" # use an existing KIM API installation at the provided location
|
make lib-kim args="-p /usr/local" # use an existing KIM API installation at the provided location
|
||||||
$ make lib-kim args="-p /usr/local -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver
|
make lib-kim args="-p /usr/local -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver
|
||||||
|
|
||||||
When using the "-b " option, the KIM library is built using its native
|
When using the "-b " option, the KIM library is built using its native
|
||||||
cmake build system. The ``lib/kim/Install.py`` script supports a
|
cmake build system. The ``lib/kim/Install.py`` script supports a
|
||||||
@ -354,7 +359,7 @@ minutes to hours) to build. Of course you only need to do that once.)
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ CMAKE=cmake3 CXX=g++-11 CC=gcc-11 FC=gfortran-11 make lib-kim args="-b " # (re-)install KIM API lib using cmake3 and gnu v11 compilers with only example models
|
CMAKE=cmake3 CXX=g++-11 CC=gcc-11 FC=gfortran-11 make lib-kim args="-b " # (re-)install KIM API lib using cmake3 and gnu v11 compilers with only example models
|
||||||
|
|
||||||
Settings for debugging OpenKIM web queries discussed below need to
|
Settings for debugging OpenKIM web queries discussed below need to
|
||||||
be applied by adding them to the ``LMP_INC`` variable through
|
be applied by adding them to the ``LMP_INC`` variable through
|
||||||
@ -413,7 +418,7 @@ Enabling the extra unit tests have some requirements,
|
|||||||
``EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000``,
|
``EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000``,
|
||||||
``EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005``, and
|
``EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005``, and
|
||||||
``LennardJones612_UniversalShifted__MO_959249795837_003`` KIM models.
|
``LennardJones612_UniversalShifted__MO_959249795837_003`` KIM models.
|
||||||
See `Obtaining KIM Models <http://openkim.org/doc/usage/obtaining-models>`_
|
See `Obtaining KIM Models <https://openkim.org/doc/usage/obtaining-models>`_
|
||||||
to learn how to install a pre-built binary of the OpenKIM Repository of
|
to learn how to install a pre-built binary of the OpenKIM Repository of
|
||||||
Models or see
|
Models or see
|
||||||
`Installing KIM Models <https://openkim.org/doc/usage/obtaining-models/#installing_models>`_
|
`Installing KIM Models <https://openkim.org/doc/usage/obtaining-models/#installing_models>`_
|
||||||
@ -807,11 +812,11 @@ library.
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-latte # print help message
|
make lib-latte # print help message
|
||||||
$ make lib-latte args="-b" # download and build in lib/latte/LATTE-master
|
make lib-latte args="-b" # download and build in lib/latte/LATTE-master
|
||||||
$ make lib-latte args="-p $HOME/latte" # use existing LATTE installation in $HOME/latte
|
make lib-latte args="-p $HOME/latte" # use existing LATTE installation in $HOME/latte
|
||||||
$ make lib-latte args="-b -m gfortran" # download and build in lib/latte and
|
make lib-latte args="-b -m gfortran" # download and build in lib/latte and
|
||||||
# copy Makefile.lammps.gfortran to Makefile.lammps
|
# copy Makefile.lammps.gfortran to Makefile.lammps
|
||||||
|
|
||||||
Note that 3 symbolic (soft) links, ``includelink`` and ``liblink``
|
Note that 3 symbolic (soft) links, ``includelink`` and ``liblink``
|
||||||
and ``filelink.o``, are created in ``lib/latte`` to point to
|
and ``filelink.o``, are created in ``lib/latte`` to point to
|
||||||
@ -905,17 +910,17 @@ more details.
|
|||||||
You can download and build the MS-CG library manually if you
|
You can download and build the MS-CG library manually if you
|
||||||
prefer; follow the instructions in ``lib/mscg/README``\ . You can
|
prefer; follow the instructions in ``lib/mscg/README``\ . You can
|
||||||
also do it in one step from the ``lammps/src`` dir, using a
|
also do it in one step from the ``lammps/src`` dir, using a
|
||||||
command like these, which simply invoke the
|
command like these, which simply invokes the
|
||||||
``lib/mscg/Install.py`` script with the specified args:
|
``lib/mscg/Install.py`` script with the specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-mscg # print help message
|
make lib-mscg # print help message
|
||||||
$ make lib-mscg args="-b -m serial" # download and build in lib/mscg/MSCG-release-master
|
make lib-mscg args="-b -m serial" # download and build in lib/mscg/MSCG-release-master
|
||||||
# with the settings compatible with "make serial"
|
# with the settings compatible with "make serial"
|
||||||
$ make lib-mscg args="-b -m mpi" # download and build in lib/mscg/MSCG-release-master
|
make lib-mscg args="-b -m mpi" # download and build in lib/mscg/MSCG-release-master
|
||||||
# with the settings compatible with "make mpi"
|
# with the settings compatible with "make mpi"
|
||||||
$ make lib-mscg args="-p /usr/local/mscg-release" # use the existing MS-CG installation in /usr/local/mscg-release
|
make lib-mscg args="-p /usr/local/mscg-release" # use the existing MS-CG installation in /usr/local/mscg-release
|
||||||
|
|
||||||
Note that 2 symbolic (soft) links, ``includelink`` and ``liblink``,
|
Note that 2 symbolic (soft) links, ``includelink`` and ``liblink``,
|
||||||
will be created in ``lib/mscg`` to point to the MS-CG
|
will be created in ``lib/mscg`` to point to the MS-CG
|
||||||
@ -962,15 +967,15 @@ POEMS package
|
|||||||
``lib/poems``\ . You can do this manually if you prefer; follow
|
``lib/poems``\ . You can do this manually if you prefer; follow
|
||||||
the instructions in ``lib/poems/README``\ . You can also do it in
|
the instructions in ``lib/poems/README``\ . You can also do it in
|
||||||
one step from the ``lammps/src`` dir, using a command like these,
|
one step from the ``lammps/src`` dir, using a command like these,
|
||||||
which simply invoke the ``lib/poems/Install.py`` script with the
|
which simply invokes the ``lib/poems/Install.py`` script with the
|
||||||
specified args:
|
specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-poems # print help message
|
make lib-poems # print help message
|
||||||
$ make lib-poems args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
|
make lib-poems args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
|
||||||
$ make lib-poems args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
|
make lib-poems args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
|
||||||
$ make lib-poems args="-m icc" # build with Intel icc compiler
|
make lib-poems args="-m icc" # build with Intel icc compiler
|
||||||
|
|
||||||
The build should produce two files: ``lib/poems/libpoems.a`` and
|
The build should produce two files: ``lib/poems/libpoems.a`` and
|
||||||
``lib/poems/Makefile.lammps``. The latter is copied from an
|
``lib/poems/Makefile.lammps``. The latter is copied from an
|
||||||
@ -1025,7 +1030,7 @@ VORONOI package
|
|||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
To build with this package, you must download and build the
|
To build with this package, you must download and build the
|
||||||
`Voro++ library <http://math.lbl.gov/voro++>`_ or install a
|
`Voro++ library <https://math.lbl.gov/voro++>`_ or install a
|
||||||
binary package provided by your operating system.
|
binary package provided by your operating system.
|
||||||
|
|
||||||
.. tabs::
|
.. tabs::
|
||||||
@ -1051,15 +1056,15 @@ binary package provided by your operating system.
|
|||||||
You can download and build the Voro++ library manually if you
|
You can download and build the Voro++ library manually if you
|
||||||
prefer; follow the instructions in ``lib/voronoi/README``. You
|
prefer; follow the instructions in ``lib/voronoi/README``. You
|
||||||
can also do it in one step from the ``lammps/src`` dir, using a
|
can also do it in one step from the ``lammps/src`` dir, using a
|
||||||
command like these, which simply invoke the
|
command like these, which simply invokes the
|
||||||
``lib/voronoi/Install.py`` script with the specified args:
|
``lib/voronoi/Install.py`` script with the specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-voronoi # print help message
|
make lib-voronoi # print help message
|
||||||
$ make lib-voronoi args="-b" # download and build the default version in lib/voronoi/voro++-<version>
|
make lib-voronoi args="-b" # download and build the default version in lib/voronoi/voro++-<version>
|
||||||
$ make lib-voronoi args="-p $HOME/voro++" # use existing Voro++ installation in $HOME/voro++
|
make lib-voronoi args="-p $HOME/voro++" # use existing Voro++ installation in $HOME/voro++
|
||||||
$ make lib-voronoi args="-b -v voro++0.4.6" # download and build the 0.4.6 version in lib/voronoi/voro++-0.4.6
|
make lib-voronoi args="-b -v voro++0.4.6" # download and build the 0.4.6 version in lib/voronoi/voro++-0.4.6
|
||||||
|
|
||||||
Note that 2 symbolic (soft) links, ``includelink`` and
|
Note that 2 symbolic (soft) links, ``includelink`` and
|
||||||
``liblink``, are created in lib/voronoi to point to the Voro++
|
``liblink``, are created in lib/voronoi to point to the Voro++
|
||||||
@ -1100,13 +1105,13 @@ systems.
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make yes-adios
|
make yes-adios
|
||||||
|
|
||||||
otherwise, set ADIOS2_DIR environment variable when turning on the package:
|
otherwise, set ADIOS2_DIR environment variable when turning on the package:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ ADIOS2_DIR=path make yes-adios # path is where ADIOS 2.x is installed
|
ADIOS2_DIR=path make yes-adios # path is where ADIOS 2.x is installed
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
@ -1130,15 +1135,15 @@ The ATC package requires the MANYBODY package also be installed.
|
|||||||
``lib/atc``. You can do this manually if you prefer; follow the
|
``lib/atc``. You can do this manually if you prefer; follow the
|
||||||
instructions in ``lib/atc/README``. You can also do it in one
|
instructions in ``lib/atc/README``. You can also do it in one
|
||||||
step from the ``lammps/src`` dir, using a command like these,
|
step from the ``lammps/src`` dir, using a command like these,
|
||||||
which simply invoke the ``lib/atc/Install.py`` script with the
|
which simply invokes the ``lib/atc/Install.py`` script with the
|
||||||
specified args:
|
specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-atc # print help message
|
make lib-atc # print help message
|
||||||
$ make lib-atc args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
|
make lib-atc args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
|
||||||
$ make lib-atc args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
make lib-atc args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
||||||
$ make lib-atc args="-m icc" # build with Intel icc compiler
|
make lib-atc args="-m icc" # build with Intel icc compiler
|
||||||
|
|
||||||
The build should produce two files: ``lib/atc/libatc.a`` and
|
The build should produce two files: ``lib/atc/libatc.a`` and
|
||||||
``lib/atc/Makefile.lammps``. The latter is copied from an
|
``lib/atc/Makefile.lammps``. The latter is copied from an
|
||||||
@ -1157,17 +1162,17 @@ The ATC package requires the MANYBODY package also be installed.
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-linalg # print help message
|
make lib-linalg # print help message
|
||||||
$ make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
|
make lib-linalg args="-m serial" # build with GNU C++ compiler (settings as with "make serial")
|
||||||
$ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
|
make lib-linalg args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
|
||||||
$ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
|
make lib-linalg args="-m g++" # build with GNU Fortran compiler
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
.. _awpmd:
|
.. _awpmd:
|
||||||
|
|
||||||
AWPMD package
|
AWPMD package
|
||||||
------------------
|
-------------
|
||||||
|
|
||||||
.. tabs::
|
.. tabs::
|
||||||
|
|
||||||
@ -1181,15 +1186,15 @@ AWPMD package
|
|||||||
``lib/awpmd``. You can do this manually if you prefer; follow the
|
``lib/awpmd``. You can do this manually if you prefer; follow the
|
||||||
instructions in ``lib/awpmd/README``. You can also do it in one
|
instructions in ``lib/awpmd/README``. You can also do it in one
|
||||||
step from the ``lammps/src`` dir, using a command like these,
|
step from the ``lammps/src`` dir, using a command like these,
|
||||||
which simply invoke the ``lib/awpmd/Install.py`` script with the
|
which simply invokes the ``lib/awpmd/Install.py`` script with the
|
||||||
specified args:
|
specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-awpmd # print help message
|
make lib-awpmd # print help message
|
||||||
$ make lib-awpmd args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
|
make lib-awpmd args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
|
||||||
$ make lib-awpmd args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
make lib-awpmd args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
||||||
$ make lib-awpmd args="-m icc" # build with Intel icc compiler
|
make lib-awpmd args="-m icc" # build with Intel icc compiler
|
||||||
|
|
||||||
The build should produce two files: ``lib/awpmd/libawpmd.a`` and
|
The build should produce two files: ``lib/awpmd/libawpmd.a`` and
|
||||||
``lib/awpmd/Makefile.lammps``. The latter is copied from an
|
``lib/awpmd/Makefile.lammps``. The latter is copied from an
|
||||||
@ -1208,21 +1213,20 @@ AWPMD package
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-linalg # print help message
|
make lib-linalg # print help message
|
||||||
$ make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
|
make lib-linalg args="-m serial" # build with GNU C++ compiler (settings as with "make serial")
|
||||||
$ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
|
make lib-linalg args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
|
||||||
$ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
|
make lib-linalg args="-m g++" # build with GNU C++ compiler
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
.. _colvars:
|
.. _colvar:
|
||||||
|
|
||||||
COLVARS package
|
COLVARS package
|
||||||
---------------------------------------
|
---------------
|
||||||
|
|
||||||
This package includes the `Colvars library
|
This package enables the use of the `Colvars <https://colvars.github.io/>`_
|
||||||
<https://colvars.github.io/>`_ into the LAMMPS distribution, which can
|
module included in the LAMMPS source distribution.
|
||||||
be built for the most part with all major versions of the C++ language.
|
|
||||||
|
|
||||||
|
|
||||||
.. tabs::
|
.. tabs::
|
||||||
@ -1244,15 +1248,15 @@ be built for the most part with all major versions of the C++ language.
|
|||||||
|
|
||||||
In general, it is safer to use build setting consistent with the
|
In general, it is safer to use build setting consistent with the
|
||||||
rest of LAMMPS. This is best carried out from the LAMMPS src
|
rest of LAMMPS. This is best carried out from the LAMMPS src
|
||||||
directory using a command like these, which simply invoke the
|
directory using a command like these, which simply invokes the
|
||||||
``lib/colvars/Install.py`` script with the specified args:
|
``lib/colvars/Install.py`` script with the specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-colvars # print help message
|
make lib-colvars # print help message
|
||||||
$ make lib-colvars args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
|
make lib-colvars args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
|
||||||
$ make lib-colvars args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
make lib-colvars args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
||||||
$ make lib-colvars args="-m g++-debug" # build with GNU g++ compiler and colvars debugging enabled
|
make lib-colvars args="-m g++-debug" # build with GNU g++ compiler and colvars debugging enabled
|
||||||
|
|
||||||
The "machine" argument of the "-m" flag is used to find a
|
The "machine" argument of the "-m" flag is used to find a
|
||||||
Makefile.machine to use as build recipe. If it does not already
|
Makefile.machine to use as build recipe. If it does not already
|
||||||
@ -1264,8 +1268,8 @@ be built for the most part with all major versions of the C++ language.
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ COLVARS_DEBUG=yes make lib-colvars args="-m machine" # Build with debug code (much slower)
|
COLVARS_DEBUG=yes make lib-colvars args="-m machine" # Build with debug code (much slower)
|
||||||
$ COLVARS_LEPTON=no make lib-colvars args="-m machine" # Build without Lepton (included otherwise)
|
COLVARS_LEPTON=no make lib-colvars args="-m machine" # Build without Lepton (included otherwise)
|
||||||
|
|
||||||
The build should produce two files: the library ``lib/colvars/libcolvars.a``
|
The build should produce two files: the library ``lib/colvars/libcolvars.a``
|
||||||
(which also includes Lepton objects if enabled) and the specification file
|
(which also includes Lepton objects if enabled) and the specification file
|
||||||
@ -1285,27 +1289,40 @@ This package depends on the KSPACE package.
|
|||||||
|
|
||||||
.. tab:: CMake build
|
.. tab:: CMake build
|
||||||
|
|
||||||
No additional settings are needed besides ``-D PKG_KSPACE=yes`` and ``-D
|
No additional settings are needed besides ``-D PKG_KSPACE=yes`` and
|
||||||
PKG_ELECTRODE=yes``.
|
``-D PKG_ELECTRODE=yes``.
|
||||||
|
|
||||||
.. tab:: Traditional make
|
.. tab:: Traditional make
|
||||||
|
|
||||||
The package is activated with ``make yes-KSPACE`` and ``make
|
Before building LAMMPS, you must configure the ELECTRODE support
|
||||||
yes-ELECTRODE``
|
libraries and settings in ``lib/electrode``. You can do this
|
||||||
|
manually, if you prefer, or do it in one step from the
|
||||||
|
``lammps/src`` dir, using a command like these, which simply
|
||||||
Note that the ``Makefile.lammps`` file has settings for the BLAS and
|
invokes the ``lib/electrode/Install.py`` script with the specified
|
||||||
LAPACK linear algebra libraries. As explained in ``lib/awpmd/README``
|
args:
|
||||||
these can either exist on your system, or you can use the files provided
|
|
||||||
in ``lib/linalg``. In the latter case you also need to build the library
|
|
||||||
in ``lib/linalg`` with a command like these:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-linalg # print help message
|
make lib-electrode # print help message
|
||||||
$ make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
|
make lib-electrode args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
|
||||||
$ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
|
make lib-electrode args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
||||||
$ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
|
|
||||||
|
|
||||||
|
Note that the ``Makefile.lammps`` file has settings for the BLAS
|
||||||
|
and LAPACK linear algebra libraries. These can either exist on
|
||||||
|
your system, or you can use the files provided in ``lib/linalg``.
|
||||||
|
In the latter case you also need to build the library in
|
||||||
|
``lib/linalg`` with a command like these:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
make lib-linalg # print help message
|
||||||
|
make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
|
||||||
|
make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
|
||||||
|
make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
|
||||||
|
|
||||||
|
The package itself is activated with ``make yes-KSPACE`` and
|
||||||
|
``make yes-ELECTRODE``
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
@ -1342,8 +1359,8 @@ at: `https://github.com/ICAMS/lammps-user-pace/ <https://github.com/ICAMS/lammps
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-pace # print help message
|
make lib-pace # print help message
|
||||||
$ make lib-pace args="-b" # download and build the default version in lib/pace
|
make lib-pace args="-b" # download and build the default version in lib/pace
|
||||||
|
|
||||||
You should not need to edit the ``lib/pace/Makefile.lammps`` file.
|
You should not need to edit the ``lib/pace/Makefile.lammps`` file.
|
||||||
|
|
||||||
@ -1442,10 +1459,10 @@ LAMMPS build.
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-plumed # print help message
|
make lib-plumed # print help message
|
||||||
$ make lib-plumed args="-b" # download and build PLUMED in lib/plumed/plumed2
|
make lib-plumed args="-b" # download and build PLUMED in lib/plumed/plumed2
|
||||||
$ make lib-plumed args="-p $HOME/.local" # use existing PLUMED installation in $HOME/.local
|
make lib-plumed args="-p $HOME/.local" # use existing PLUMED installation in $HOME/.local
|
||||||
$ make lib-plumed args="-p /usr/local -m shared" # use existing PLUMED installation in
|
make lib-plumed args="-p /usr/local -m shared" # use existing PLUMED installation in
|
||||||
# /usr/local and use shared linkage mode
|
# /usr/local and use shared linkage mode
|
||||||
|
|
||||||
Note that 2 symbolic (soft) links, ``includelink`` and ``liblink``
|
Note that 2 symbolic (soft) links, ``includelink`` and ``liblink``
|
||||||
@ -1458,8 +1475,8 @@ LAMMPS build.
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make yes-plumed
|
make yes-plumed
|
||||||
$ make machine
|
make machine
|
||||||
|
|
||||||
Once this compilation completes you should be able to run LAMMPS
|
Once this compilation completes you should be able to run LAMMPS
|
||||||
in the usual way. For shared linkage mode, libplumed.so must be
|
in the usual way. For shared linkage mode, libplumed.so must be
|
||||||
@ -1506,13 +1523,13 @@ the HDF5 library.
|
|||||||
``lib/h5md``. You can do this manually if you prefer; follow the
|
``lib/h5md``. You can do this manually if you prefer; follow the
|
||||||
instructions in ``lib/h5md/README``. You can also do it in one
|
instructions in ``lib/h5md/README``. You can also do it in one
|
||||||
step from the ``lammps/src`` dir, using a command like these,
|
step from the ``lammps/src`` dir, using a command like these,
|
||||||
which simply invoke the ``lib/h5md/Install.py`` script with the
|
which simply invokes the ``lib/h5md/Install.py`` script with the
|
||||||
specified args:
|
specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-h5md # print help message
|
make lib-h5md # print help message
|
||||||
$ make lib-h5md args="-m h5cc" # build with h5cc compiler
|
make lib-h5md args="-m h5cc" # build with h5cc compiler
|
||||||
|
|
||||||
The build should produce two files: ``lib/h5md/libch5md.a`` and
|
The build should produce two files: ``lib/h5md/libch5md.a`` and
|
||||||
``lib/h5md/Makefile.lammps``. The latter is copied from an
|
``lib/h5md/Makefile.lammps``. The latter is copied from an
|
||||||
@ -1562,14 +1579,14 @@ details please see ``lib/hdnnp/README`` and the `n2p2 build documentation
|
|||||||
You can download and build the *n2p2* library manually if you prefer;
|
You can download and build the *n2p2* library manually if you prefer;
|
||||||
follow the instructions in ``lib/hdnnp/README``\ . You can also do it in
|
follow the instructions in ``lib/hdnnp/README``\ . You can also do it in
|
||||||
one step from the ``lammps/src`` dir, using a command like these, which
|
one step from the ``lammps/src`` dir, using a command like these, which
|
||||||
simply invoke the ``lib/hdnnp/Install.py`` script with the specified args:
|
simply invokes the ``lib/hdnnp/Install.py`` script with the specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-hdnnp # print help message
|
make lib-hdnnp # print help message
|
||||||
$ make lib-hdnnp args="-b" # download and build in lib/hdnnp/n2p2-...
|
make lib-hdnnp args="-b" # download and build in lib/hdnnp/n2p2-...
|
||||||
$ make lib-hdnnp args="-b -v 2.1.4" # download and build specific version
|
make lib-hdnnp args="-b -v 2.1.4" # download and build specific version
|
||||||
$ make lib-hdnnp args="-p /usr/local/n2p2" # use the existing n2p2 installation in /usr/local/n2p2
|
make lib-hdnnp args="-p /usr/local/n2p2" # use the existing n2p2 installation in /usr/local/n2p2
|
||||||
|
|
||||||
Note that 3 symbolic (soft) links, ``includelink``, ``liblink`` and
|
Note that 3 symbolic (soft) links, ``includelink``, ``liblink`` and
|
||||||
``Makefile.lammps``, will be created in ``lib/hdnnp`` to point to
|
``Makefile.lammps``, will be created in ``lib/hdnnp`` to point to
|
||||||
@ -1669,8 +1686,8 @@ MDI package
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ python Install.py -m gcc # build using gcc compiler
|
python Install.py -m gcc # build using gcc compiler
|
||||||
$ python Install.py -m icc # build using icc compiler
|
python Install.py -m icc # build using icc compiler
|
||||||
|
|
||||||
The build should produce two files: ``lib/mdi/includelink/mdi.h``
|
The build should produce two files: ``lib/mdi/includelink/mdi.h``
|
||||||
and ``lib/mdi/liblink/libmdi.so``\ .
|
and ``lib/mdi/liblink/libmdi.so``\ .
|
||||||
@ -1699,14 +1716,14 @@ they will be downloaded the first time this package is installed.
|
|||||||
Before building LAMMPS, you must build the *mesont* library in
|
Before building LAMMPS, you must build the *mesont* library in
|
||||||
``lib/mesont``\ . You can also do it in one step from the
|
``lib/mesont``\ . You can also do it in one step from the
|
||||||
``lammps/src`` dir, using a command like these, which simply
|
``lammps/src`` dir, using a command like these, which simply
|
||||||
invoke the ``lib/mesont/Install.py`` script with the specified
|
invokes the ``lib/mesont/Install.py`` script with the specified
|
||||||
args:
|
args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-mesont # print help message
|
make lib-mesont # print help message
|
||||||
$ make lib-mesont args="-m gfortran" # build with GNU g++ compiler (settings as with "make serial")
|
make lib-mesont args="-m gfortran" # build with GNU g++ compiler (settings as with "make serial")
|
||||||
$ make lib-mesont args="-m ifort" # build with Intel icc compiler
|
make lib-mesont args="-m ifort" # build with Intel icc compiler
|
||||||
|
|
||||||
The build should produce two files: ``lib/mesont/libmesont.a`` and
|
The build should produce two files: ``lib/mesont/libmesont.a`` and
|
||||||
``lib/mesont/Makefile.lammps``\ . The latter is copied from an
|
``lib/mesont/Makefile.lammps``\ . The latter is copied from an
|
||||||
@ -1819,6 +1836,22 @@ OPENMP package
|
|||||||
For other platforms and compilers, please consult the
|
For other platforms and compilers, please consult the
|
||||||
documentation about OpenMP support for your compiler.
|
documentation about OpenMP support for your compiler.
|
||||||
|
|
||||||
|
.. admonition:: Adding OpenMP support on macOS
|
||||||
|
:class: note
|
||||||
|
|
||||||
|
Apple offers the `Xcode package and IDE
|
||||||
|
<https://developer.apple.com/xcode/>`_ for compiling software on
|
||||||
|
macOS, so you have likely installed it to compile LAMMPS. Their
|
||||||
|
compiler is based on `Clang <https://clang.llvm.org/>`, but while it
|
||||||
|
is capable of processing OpenMP directives, the necessary header
|
||||||
|
files and OpenMP runtime library are missing. The `R developers
|
||||||
|
<https://www.r-project.org/>` have figured out a way to build those
|
||||||
|
in a compatible fashion. One can download them from
|
||||||
|
`https://mac.r-project.org/openmp/
|
||||||
|
<https://mac.r-project.org/openmp/>`_. Simply adding those files as
|
||||||
|
instructed enables the Xcode C++ compiler to compile LAMMPS with ``-D
|
||||||
|
BUILD_OMP=yes``.
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
.. _qmmm:
|
.. _qmmm:
|
||||||
@ -1868,15 +1901,15 @@ verified to work in February 2020 with Quantum Espresso versions 6.3 to
|
|||||||
``lib/qmmm``. You can do this manually if you prefer; follow the
|
``lib/qmmm``. You can do this manually if you prefer; follow the
|
||||||
first two steps explained in ``lib/qmmm/README``. You can also do
|
first two steps explained in ``lib/qmmm/README``. You can also do
|
||||||
it in one step from the ``lammps/src`` dir, using a command like
|
it in one step from the ``lammps/src`` dir, using a command like
|
||||||
these, which simply invoke the ``lib/qmmm/Install.py`` script with
|
these, which simply invokes the ``lib/qmmm/Install.py`` script with
|
||||||
the specified args:
|
the specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-qmmm # print help message
|
make lib-qmmm # print help message
|
||||||
$ make lib-qmmm args="-m serial" # build with GNU Fortran compiler (settings as in "make serial")
|
make lib-qmmm args="-m serial" # build with GNU Fortran compiler (settings as in "make serial")
|
||||||
$ make lib-qmmm args="-m mpi" # build with default MPI compiler (settings as in "make mpi")
|
make lib-qmmm args="-m mpi" # build with default MPI compiler (settings as in "make mpi")
|
||||||
$ make lib-qmmm args="-m gfortran" # build with GNU Fortran compiler
|
make lib-qmmm args="-m gfortran" # build with GNU Fortran compiler
|
||||||
|
|
||||||
The build should produce two files: ``lib/qmmm/libqmmm.a`` and
|
The build should produce two files: ``lib/qmmm/libqmmm.a`` and
|
||||||
``lib/qmmm/Makefile.lammps``. The latter is copied from an
|
``lib/qmmm/Makefile.lammps``. The latter is copied from an
|
||||||
@ -1913,8 +1946,8 @@ within CMake will download the non-commercial use version.
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
-D DOWNLOAD_QUIP=value # download OpenKIM API v2 for build, value = no (default) or yes
|
-D DOWNLOAD_QUIP=value # download QUIP library for build, value = no (default) or yes
|
||||||
-D QUIP_LIBRARY=path # path to libquip.a (only needed if a custom location)
|
-D QUIP_LIBRARY=path # path to libquip.a (only needed if a custom location)
|
||||||
|
|
||||||
CMake will try to download and build the QUIP library from GitHub, if it is not
|
CMake will try to download and build the QUIP library from GitHub, if it is not
|
||||||
found on the local machine. This requires to have git installed. It will use the same compilers
|
found on the local machine. This requires to have git installed. It will use the same compilers
|
||||||
@ -1965,7 +1998,7 @@ To build with this package, you must download and build the
|
|||||||
You can download and build the ScaFaCoS library manually if you
|
You can download and build the ScaFaCoS library manually if you
|
||||||
prefer; follow the instructions in ``lib/scafacos/README``. You
|
prefer; follow the instructions in ``lib/scafacos/README``. You
|
||||||
can also do it in one step from the ``lammps/src`` dir, using a
|
can also do it in one step from the ``lammps/src`` dir, using a
|
||||||
command like these, which simply invoke the
|
command like these, which simply invokes the
|
||||||
``lib/scafacos/Install.py`` script with the specified args:
|
``lib/scafacos/Install.py`` script with the specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
@ -2009,14 +2042,14 @@ Eigen3 is a template library, so you do not need to build it.
|
|||||||
You can download the Eigen3 library manually if you prefer; follow
|
You can download the Eigen3 library manually if you prefer; follow
|
||||||
the instructions in ``lib/smd/README``. You can also do it in one
|
the instructions in ``lib/smd/README``. You can also do it in one
|
||||||
step from the ``lammps/src`` dir, using a command like these,
|
step from the ``lammps/src`` dir, using a command like these,
|
||||||
which simply invoke the ``lib/smd/Install.py`` script with the
|
which simply invokes the ``lib/smd/Install.py`` script with the
|
||||||
specified args:
|
specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-smd # print help message
|
make lib-smd # print help message
|
||||||
$ make lib-smd args="-b" # download to lib/smd/eigen3
|
make lib-smd args="-b" # download to lib/smd/eigen3
|
||||||
$ make lib-smd args="-p /usr/include/eigen3" # use existing Eigen installation in /usr/include/eigen3
|
make lib-smd args="-p /usr/include/eigen3" # use existing Eigen installation in /usr/include/eigen3
|
||||||
|
|
||||||
Note that a symbolic (soft) link named ``includelink`` is created
|
Note that a symbolic (soft) link named ``includelink`` is created
|
||||||
in ``lib/smd`` to point to the Eigen dir. When LAMMPS builds it
|
in ``lib/smd`` to point to the Eigen dir. When LAMMPS builds it
|
||||||
|
|||||||
@ -209,7 +209,7 @@ You can verify whether all required shared libraries are found with the
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ LD_LIBRARY_PATH=/home/user/lammps/src ldd caller
|
LD_LIBRARY_PATH=/home/user/lammps/src ldd caller
|
||||||
linux-vdso.so.1 (0x00007ffe729e0000)
|
linux-vdso.so.1 (0x00007ffe729e0000)
|
||||||
liblammps.so => /home/user/lammps/src/liblammps.so (0x00007fc91bb9e000)
|
liblammps.so => /home/user/lammps/src/liblammps.so (0x00007fc91bb9e000)
|
||||||
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fc91b984000)
|
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fc91b984000)
|
||||||
@ -222,7 +222,7 @@ If a required library is missing, you would get a 'not found' entry:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ ldd caller
|
ldd caller
|
||||||
linux-vdso.so.1 (0x00007ffd672fe000)
|
linux-vdso.so.1 (0x00007ffd672fe000)
|
||||||
liblammps.so => not found
|
liblammps.so => not found
|
||||||
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fb7c7e86000)
|
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fb7c7e86000)
|
||||||
|
|||||||
@ -48,18 +48,15 @@ Build using GNU make
|
|||||||
|
|
||||||
The LAMMPS manual is written in `reStructuredText <rst_>`_ format which
|
The LAMMPS manual is written in `reStructuredText <rst_>`_ format which
|
||||||
can be translated to different output format using the `Sphinx
|
can be translated to different output format using the `Sphinx
|
||||||
<sphinx_>`_ document generator tool. It also incorporates programmer
|
<https://sphinx-doc.org>`_ document generator tool. It also
|
||||||
documentation extracted from the LAMMPS C++ sources through the `Doxygen
|
incorporates programmer documentation extracted from the LAMMPS C++
|
||||||
<https://doxygen.nl>`_ program. Currently the translation to HTML, PDF
|
sources through the `Doxygen <https://doxygen.nl>`_ program. Currently
|
||||||
(via LaTeX), ePUB (for many e-book readers) and MOBI (for Amazon Kindle
|
the translation to HTML, PDF (via LaTeX), ePUB (for many e-book readers)
|
||||||
readers) are supported. For that to work a Python 3 interpreter, the
|
and MOBI (for Amazon Kindle readers) are supported. For that to work a
|
||||||
``doxygen`` tools and internet access to download additional files and
|
Python 3 interpreter, the ``doxygen`` tools and internet access to
|
||||||
tools are required. This download is usually only required once or
|
download additional files and tools are required. This download is
|
||||||
after the documentation folder is returned to a pristine state with
|
usually only required once or after the documentation folder is returned
|
||||||
``make clean-all``.
|
to a pristine state with ``make clean-all``.
|
||||||
|
|
||||||
.. _rst: https://docutils.readthedocs.io/en/sphinx-docs/user/rst/quickstart.html
|
|
||||||
.. _sphinx: https://www.sphinx-doc.org
|
|
||||||
|
|
||||||
For the documentation build a python virtual environment is set up in
|
For the documentation build a python virtual environment is set up in
|
||||||
the folder ``doc/docenv`` and various python packages are installed into
|
the folder ``doc/docenv`` and various python packages are installed into
|
||||||
@ -128,38 +125,29 @@ common setups:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
sudo apt-get install python-virtualenv git doxygen
|
sudo apt-get install git doxygen
|
||||||
|
|
||||||
.. tab:: RHEL or CentOS (Version 7.x)
|
.. tab:: RHEL or CentOS (Version 7.x)
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
sudo yum install python3-virtualenv git doxygen
|
sudo yum install git doxygen
|
||||||
|
|
||||||
.. tab:: Fedora or RHEL/CentOS (8.x or later)
|
.. tab:: Fedora or RHEL/CentOS (8.x or later)
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
sudo dnf install python3-virtualenv git doxygen
|
sudo dnf install git doxygen
|
||||||
|
|
||||||
.. tab:: MacOS X
|
.. tab:: macOS
|
||||||
|
|
||||||
*Python 3*
|
*Python 3*
|
||||||
|
|
||||||
Download the latest Python 3 MacOS X package from
|
If Python 3 is not available on your macOS system, you can
|
||||||
|
download the latest Python 3 macOS package from
|
||||||
`https://www.python.org <https://www.python.org>`_ and install it.
|
`https://www.python.org <https://www.python.org>`_ and install it.
|
||||||
This will install both Python 3 and pip3.
|
This will install both Python 3 and pip3.
|
||||||
|
|
||||||
*virtualenv*
|
|
||||||
|
|
||||||
Once Python 3 is installed, open a Terminal and type
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
pip3 install virtualenv
|
|
||||||
|
|
||||||
This will install virtualenv from the Python Package Index.
|
|
||||||
|
|
||||||
Prerequisites for PDF
|
Prerequisites for PDF
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
@ -179,7 +167,7 @@ math expressions transparently into embedded images.
|
|||||||
For converting the generated ePUB file to a MOBI format file (for e-book
|
For converting the generated ePUB file to a MOBI format file (for e-book
|
||||||
readers, like Kindle, that cannot read ePUB), you also need to have the
|
readers, like Kindle, that cannot read ePUB), you also need to have the
|
||||||
``ebook-convert`` tool from the "calibre" software
|
``ebook-convert`` tool from the "calibre" software
|
||||||
installed. `http://calibre-ebook.com/ <http://calibre-ebook.com/>`_
|
installed. `https://calibre-ebook.com/ <https://calibre-ebook.com/>`_
|
||||||
Typing ``make mobi`` will first create the ePUB file and then convert
|
Typing ``make mobi`` will first create the ePUB file and then convert
|
||||||
it. On the Kindle readers in particular, you also have support for PDF
|
it. On the Kindle readers in particular, you also have support for PDF
|
||||||
files, so you could download and view the PDF version as an alternative.
|
files, so you could download and view the PDF version as an alternative.
|
||||||
@ -219,9 +207,20 @@ be multiple tests run automatically:
|
|||||||
- A test that only standard, printable ASCII text characters are used.
|
- A test that only standard, printable ASCII text characters are used.
|
||||||
This runs the command ``env LC_ALL=C grep -n '[^ -~]' src/*.rst`` and
|
This runs the command ``env LC_ALL=C grep -n '[^ -~]' src/*.rst`` and
|
||||||
thus prints all offending lines with filename and line number
|
thus prints all offending lines with filename and line number
|
||||||
prepended to the screen. Special characters like the Angstrom
|
prepended to the screen. Special characters like Greek letters
|
||||||
:math:`\mathrm{\mathring{A}}` should be typeset with embedded math
|
(:math:`\alpha~~\sigma~~\epsilon`), super- or subscripts
|
||||||
(like this ``:math:`\mathrm{\mathring{A}}```\ ).
|
(:math:`x^2~~\mathrm{U}_{LJ}`), mathematical expressions
|
||||||
|
(:math:`\frac{1}{2}\mathrm{N}~~x\to\infty`), or the Angstrom symbol
|
||||||
|
(:math:`\AA`) should be typeset with embedded LaTeX (like this
|
||||||
|
``:math:`\alpha \sigma \epsilon```, ``:math:`x^2 \mathrm{E}_{LJ}```,
|
||||||
|
``:math:`\frac{1}{2}\mathrm{N} x\to\infty```, or ``:math:`\AA```\ ).
|
||||||
|
|
||||||
|
- Embedded LaTeX is rendered in HTML output with `MathJax
|
||||||
|
<https://www.mathjax.org/>`_ and in PDF output by passing the embedded
|
||||||
|
text to LaTeX. Some care has to be taken, though, since there are
|
||||||
|
limitations which macros and features can be used in either mode, so
|
||||||
|
it is recommended to always check whether any new or changed
|
||||||
|
documentation does translate and render correctly with either output.
|
||||||
|
|
||||||
- A test whether all styles are documented and listed in their
|
- A test whether all styles are documented and listed in their
|
||||||
respective overview pages. A typical output with warnings looks like this:
|
respective overview pages. A typical output with warnings looks like this:
|
||||||
@ -252,6 +251,5 @@ manual with ``make spelling``. This requires `a library called enchant
|
|||||||
positives* (e.g. keywords, names, abbreviations) those can be added to
|
positives* (e.g. keywords, names, abbreviations) those can be added to
|
||||||
the file ``lammps/doc/utils/sphinx-config/false_positives.txt``.
|
the file ``lammps/doc/utils/sphinx-config/false_positives.txt``.
|
||||||
|
|
||||||
.. _rst: https://docutils.readthedocs.io/en/sphinx-docs/user/rst/quickstart.html
|
|
||||||
|
|
||||||
.. _lws: https://www.lammps.org
|
.. _lws: https://www.lammps.org
|
||||||
|
.. _rst: https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html
|
||||||
|
|||||||
@ -30,14 +30,16 @@ steps, as explained on the :doc:`Build extras <Build_extras>` page.
|
|||||||
These links take you to the extra instructions for those select
|
These links take you to the extra instructions for those select
|
||||||
packages:
|
packages:
|
||||||
|
|
||||||
|
.. this list must be kept in sync with its counterpart in Build_extras.rst
|
||||||
.. table_from_list::
|
.. table_from_list::
|
||||||
:columns: 6
|
:columns: 6
|
||||||
|
|
||||||
* :ref:`ADIOS <adios>`
|
* :ref:`ADIOS <adios>`
|
||||||
* :ref:`ATC <atc>`
|
* :ref:`ATC <atc>`
|
||||||
* :ref:`AWPMD <awpmd>`
|
* :ref:`AWPMD <awpmd>`
|
||||||
* :ref:`COLVARS <colvars>`
|
* :ref:`COLVARS <colvar>`
|
||||||
* :ref:`COMPRESS <compress>`
|
* :ref:`COMPRESS <compress>`
|
||||||
|
* :ref:`ELECTRODE <electrode>`
|
||||||
* :ref:`GPU <gpu>`
|
* :ref:`GPU <gpu>`
|
||||||
* :ref:`H5MD <h5md>`
|
* :ref:`H5MD <h5md>`
|
||||||
* :ref:`INTEL <intel>`
|
* :ref:`INTEL <intel>`
|
||||||
@ -45,7 +47,10 @@ packages:
|
|||||||
* :ref:`KOKKOS <kokkos>`
|
* :ref:`KOKKOS <kokkos>`
|
||||||
* :ref:`LATTE <latte>`
|
* :ref:`LATTE <latte>`
|
||||||
* :ref:`MACHDYN <machdyn>`
|
* :ref:`MACHDYN <machdyn>`
|
||||||
|
* :ref:`MDI <mdi>`
|
||||||
|
* :ref:`MESONT <mesont>`
|
||||||
* :ref:`ML-HDNNP <ml-hdnnp>`
|
* :ref:`ML-HDNNP <ml-hdnnp>`
|
||||||
|
* :ref:`ML-IAP <mliap>`
|
||||||
* :ref:`ML-PACE <ml-pace>`
|
* :ref:`ML-PACE <ml-pace>`
|
||||||
* :ref:`ML-QUIP <ml-quip>`
|
* :ref:`ML-QUIP <ml-quip>`
|
||||||
* :ref:`MOLFILE <molfile>`
|
* :ref:`MOLFILE <molfile>`
|
||||||
|
|||||||
@ -111,26 +111,25 @@ LAMMPS can use them if they are available on your system.
|
|||||||
files in its default search path. You must specify ``FFT_LIB``
|
files in its default search path. You must specify ``FFT_LIB``
|
||||||
with the appropriate FFT libraries to include in the link.
|
with the appropriate FFT libraries to include in the link.
|
||||||
|
|
||||||
The `KISS FFT library <http://kissfft.sf.net>`_ is included in the LAMMPS
|
The `KISS FFT library <https://github.com/mborgerding/kissfft>`_ is
|
||||||
distribution. It is portable across all platforms. Depending on the size
|
included in the LAMMPS distribution. It is portable across all
|
||||||
of the FFTs and the number of processors used, the other libraries listed
|
platforms. Depending on the size of the FFTs and the number of
|
||||||
here can be faster.
|
processors used, the other libraries listed here can be faster.
|
||||||
|
|
||||||
However, note that long-range Coulombics are only a portion of the
|
However, note that long-range Coulombics are only a portion of the
|
||||||
per-timestep CPU cost, FFTs are only a portion of long-range
|
per-timestep CPU cost, FFTs are only a portion of long-range Coulombics,
|
||||||
Coulombics, and 1d FFTs are only a portion of the FFT cost (parallel
|
and 1d FFTs are only a portion of the FFT cost (parallel communication
|
||||||
communication can be costly). A breakdown of these timings is printed
|
can be costly). A breakdown of these timings is printed to the screen
|
||||||
to the screen at the end of a run when using the
|
at the end of a run when using the :doc:`kspace_style pppm
|
||||||
:doc:`kspace_style pppm <kspace_style>` command. The
|
<kspace_style>` command. The :doc:`Screen and logfile output
|
||||||
:doc:`Screen and logfile output <Run_output>`
|
<Run_output>` page gives more details. A more detailed (and time
|
||||||
page gives more details. A more detailed (and time consuming)
|
consuming) report of the FFT performance is generated with the
|
||||||
report of the FFT performance is generated with the
|
|
||||||
:doc:`kspace_modify fftbench yes <kspace_modify>` command.
|
:doc:`kspace_modify fftbench yes <kspace_modify>` command.
|
||||||
|
|
||||||
FFTW is a fast, portable FFT library that should also work on any
|
FFTW is a fast, portable FFT library that should also work on any
|
||||||
platform and can be faster than the KISS FFT library. You can
|
platform and can be faster than the KISS FFT library. You can download
|
||||||
download it from `www.fftw.org <http://www.fftw.org>`_. LAMMPS requires
|
it from `www.fftw.org <https://www.fftw.org>`_. LAMMPS requires version
|
||||||
version 3.X; the legacy version 2.1.X is no longer supported.
|
3.X; the legacy version 2.1.X is no longer supported.
|
||||||
|
|
||||||
Building FFTW for your box should be as simple as ``./configure; make;
|
Building FFTW for your box should be as simple as ``./configure; make;
|
||||||
make install``. The install command typically requires root privileges
|
make install``. The install command typically requires root privileges
|
||||||
|
|||||||
@ -14,7 +14,9 @@
|
|||||||
General commands
|
General commands
|
||||||
================
|
================
|
||||||
|
|
||||||
An alphabetic list of general LAMMPS commands.
|
An alphabetic list of general LAMMPS commands. Note that style
|
||||||
|
commands with many variants, can be more easily accessed via the small
|
||||||
|
table above.
|
||||||
|
|
||||||
.. table_from_list::
|
.. table_from_list::
|
||||||
:columns: 5
|
:columns: 5
|
||||||
|
|||||||
@ -40,9 +40,6 @@ OPT.
|
|||||||
* :doc:`ave/time <fix_ave_time>`
|
* :doc:`ave/time <fix_ave_time>`
|
||||||
* :doc:`aveforce <fix_aveforce>`
|
* :doc:`aveforce <fix_aveforce>`
|
||||||
* :doc:`balance <fix_balance>`
|
* :doc:`balance <fix_balance>`
|
||||||
* :doc:`brownian <fix_brownian>`
|
|
||||||
* :doc:`brownian/asphere <fix_brownian>`
|
|
||||||
* :doc:`brownian/sphere <fix_brownian>`
|
|
||||||
* :doc:`bocs <fix_bocs>`
|
* :doc:`bocs <fix_bocs>`
|
||||||
* :doc:`bond/break <fix_bond_break>`
|
* :doc:`bond/break <fix_bond_break>`
|
||||||
* :doc:`bond/create <fix_bond_create>`
|
* :doc:`bond/create <fix_bond_create>`
|
||||||
@ -50,6 +47,9 @@ OPT.
|
|||||||
* :doc:`bond/react <fix_bond_react>`
|
* :doc:`bond/react <fix_bond_react>`
|
||||||
* :doc:`bond/swap <fix_bond_swap>`
|
* :doc:`bond/swap <fix_bond_swap>`
|
||||||
* :doc:`box/relax <fix_box_relax>`
|
* :doc:`box/relax <fix_box_relax>`
|
||||||
|
* :doc:`brownian <fix_brownian>`
|
||||||
|
* :doc:`brownian/asphere <fix_brownian>`
|
||||||
|
* :doc:`brownian/sphere <fix_brownian>`
|
||||||
* :doc:`charge/regulation <fix_charge_regulation>`
|
* :doc:`charge/regulation <fix_charge_regulation>`
|
||||||
* :doc:`cmap <fix_cmap>`
|
* :doc:`cmap <fix_cmap>`
|
||||||
* :doc:`colvars <fix_colvars>`
|
* :doc:`colvars <fix_colvars>`
|
||||||
|
|||||||
@ -91,8 +91,8 @@ OPT.
|
|||||||
* :doc:`coul/wolf/cs <pair_cs>`
|
* :doc:`coul/wolf/cs <pair_cs>`
|
||||||
* :doc:`dpd (giko) <pair_dpd>`
|
* :doc:`dpd (giko) <pair_dpd>`
|
||||||
* :doc:`dpd/fdt <pair_dpd_fdt>`
|
* :doc:`dpd/fdt <pair_dpd_fdt>`
|
||||||
* :doc:`dpd/ext (k) <pair_dpd_ext>`
|
* :doc:`dpd/ext (ko) <pair_dpd_ext>`
|
||||||
* :doc:`dpd/ext/tstat (k) <pair_dpd_ext>`
|
* :doc:`dpd/ext/tstat (ko) <pair_dpd_ext>`
|
||||||
* :doc:`dpd/fdt/energy (k) <pair_dpd_fdt>`
|
* :doc:`dpd/fdt/energy (k) <pair_dpd_fdt>`
|
||||||
* :doc:`dpd/tstat (gko) <pair_dpd>`
|
* :doc:`dpd/tstat (gko) <pair_dpd>`
|
||||||
* :doc:`dsmc <pair_dsmc>`
|
* :doc:`dsmc <pair_dsmc>`
|
||||||
|
|||||||
@ -123,14 +123,15 @@ LAMMPS:
|
|||||||
.. _six:
|
.. _six:
|
||||||
|
|
||||||
6. If you want text with spaces to be treated as a single argument, it
|
6. If you want text with spaces to be treated as a single argument, it
|
||||||
can be enclosed in either single or double or triple quotes. A long
|
can be enclosed in either single (') or double (") or triple (""")
|
||||||
single argument enclosed in single or double quotes can span multiple
|
quotes. A long single argument enclosed in single or double quotes
|
||||||
lines if the "&" character is used, as described above. When the
|
can span multiple lines if the "&" character is used, as described
|
||||||
lines are concatenated together (and the "&" characters and line
|
in :ref:`1 <one>` above. When the lines are concatenated together
|
||||||
breaks removed), the text will become a single line. If you want
|
by LAMMPS (and the "&" characters and line breaks removed), the
|
||||||
multiple lines of an argument to retain their line breaks, the text
|
combined text will become a single line. If you want multiple lines
|
||||||
can be enclosed in triple quotes, in which case "&" characters are
|
of an argument to retain their line breaks, the text can be enclosed
|
||||||
not needed. For example:
|
in triple quotes, in which case "&" characters are not needed and do
|
||||||
|
not function as line continuation character. For example:
|
||||||
|
|
||||||
.. code-block:: LAMMPS
|
.. code-block:: LAMMPS
|
||||||
|
|
||||||
@ -144,8 +145,9 @@ LAMMPS:
|
|||||||
System temperature = $t
|
System temperature = $t
|
||||||
"""
|
"""
|
||||||
|
|
||||||
In each case, the single, double, or triple quotes are removed when
|
In each of these cases, the single, double, or triple quotes are
|
||||||
the single argument they enclose is stored internally.
|
removed and the enclosed text stored internally as a single
|
||||||
|
argument.
|
||||||
|
|
||||||
See the :doc:`dump modify format <dump_modify>`, :doc:`print
|
See the :doc:`dump modify format <dump_modify>`, :doc:`print
|
||||||
<print>`, :doc:`if <if>`, and :doc:`python <python>` commands for
|
<print>`, :doc:`if <if>`, and :doc:`python <python>` commands for
|
||||||
|
|||||||
@ -2,14 +2,17 @@ Removed commands and packages
|
|||||||
=============================
|
=============================
|
||||||
|
|
||||||
This page lists LAMMPS commands and packages that have been removed from
|
This page lists LAMMPS commands and packages that have been removed from
|
||||||
the distribution and provides suggestions for alternatives or replacements.
|
the distribution and provides suggestions for alternatives or
|
||||||
LAMMPS has special dummy styles implemented, that will stop LAMMPS and
|
replacements. LAMMPS has special dummy styles implemented, that will
|
||||||
print a suitable error message in most cases, when a style/command is used
|
stop LAMMPS and print a suitable error message in most cases, when a
|
||||||
that has been removed.
|
style/command is used that has been removed or will replace the command
|
||||||
|
with the direct alternative (if available) and print a warning.
|
||||||
|
|
||||||
Fix ave/spatial and fix ave/spatial/sphere
|
Fix ave/spatial and fix ave/spatial/sphere
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
|
|
||||||
|
.. deprecated:: 11Dec2015
|
||||||
|
|
||||||
The fixes ave/spatial and ave/spatial/sphere have been removed from LAMMPS
|
The fixes ave/spatial and ave/spatial/sphere have been removed from LAMMPS
|
||||||
since they were superseded by the more general and extensible "chunk
|
since they were superseded by the more general and extensible "chunk
|
||||||
infrastructure". Here the system is partitioned in one of many possible
|
infrastructure". Here the system is partitioned in one of many possible
|
||||||
@ -30,18 +33,21 @@ The code in the :ref:`MEAM package <PKG-MEAM>` is a translation of the
|
|||||||
Fortran code of MEAM into C++, which removes several restrictions
|
Fortran code of MEAM into C++, which removes several restrictions
|
||||||
(e.g. there can be multiple instances in hybrid pair styles) and allows
|
(e.g. there can be multiple instances in hybrid pair styles) and allows
|
||||||
for some optimizations leading to better performance. The pair style
|
for some optimizations leading to better performance. The pair style
|
||||||
:doc:`meam <pair_meam>` has the exact same syntax.
|
:doc:`meam <pair_meam>` has the exact same syntax. For a transition
|
||||||
|
period the C++ version of MEAM was called USER-MEAMC so it could
|
||||||
|
coexist with the Fortran version.
|
||||||
|
|
||||||
REAX package
|
REAX package
|
||||||
------------
|
------------
|
||||||
|
|
||||||
The REAX package has been removed since it was superseded by the
|
The REAX package has been removed since it was superseded by the
|
||||||
:ref:`REAXFF package <PKG-REAXFF>`. The REAXFF
|
:ref:`REAXFF package <PKG-REAXFF>`. The REAXFF package has been tested
|
||||||
package has been tested to yield equivalent results to the REAX package,
|
to yield equivalent results to the REAX package, offers better
|
||||||
offers better performance, supports OpenMP multi-threading via OPENMP,
|
performance, supports OpenMP multi-threading via OPENMP, and GPU and
|
||||||
and GPU and threading parallelization through KOKKOS. The new pair styles
|
threading parallelization through KOKKOS. The new pair styles are not
|
||||||
are not syntax compatible with the removed reax pair style, so input
|
syntax compatible with the removed reax pair style, so input files will
|
||||||
files will have to be adapted.
|
have to be adapted. The REAXFF package was originally called
|
||||||
|
USER-REAXC.
|
||||||
|
|
||||||
USER-CUDA package
|
USER-CUDA package
|
||||||
-----------------
|
-----------------
|
||||||
@ -60,5 +66,6 @@ restart2data tool
|
|||||||
The functionality of the restart2data tool has been folded into the
|
The functionality of the restart2data tool has been folded into the
|
||||||
LAMMPS executable directly instead of having a separate tool. A
|
LAMMPS executable directly instead of having a separate tool. A
|
||||||
combination of the commands :doc:`read_restart <read_restart>` and
|
combination of the commands :doc:`read_restart <read_restart>` and
|
||||||
:doc:`write_data <write_data>` can be used to the same effect. For added
|
:doc:`write_data <write_data>` can be used to the same effect. For
|
||||||
convenience this conversion can also be triggered by :doc:`command line flags <Run_options>`
|
added convenience this conversion can also be triggered by
|
||||||
|
:doc:`command line flags <Run_options>`
|
||||||
|
|||||||
@ -17,6 +17,7 @@ of time and requests from the LAMMPS user community.
|
|||||||
Developer_flow
|
Developer_flow
|
||||||
Developer_write
|
Developer_write
|
||||||
Developer_notes
|
Developer_notes
|
||||||
|
Developer_updating
|
||||||
Developer_plugins
|
Developer_plugins
|
||||||
Developer_unittest
|
Developer_unittest
|
||||||
Classes
|
Classes
|
||||||
|
|||||||
@ -50,7 +50,7 @@ parallel each MPI process creates such an instance. This can be seen
|
|||||||
in the ``main.cpp`` file where the core steps of running a LAMMPS
|
in the ``main.cpp`` file where the core steps of running a LAMMPS
|
||||||
simulation are the following 3 lines of code:
|
simulation are the following 3 lines of code:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
LAMMPS *lammps = new LAMMPS(argc, argv, lammps_comm);
|
LAMMPS *lammps = new LAMMPS(argc, argv, lammps_comm);
|
||||||
lammps->input->file();
|
lammps->input->file();
|
||||||
@ -78,7 +78,7 @@ LAMMPS makes extensive use of the object oriented programming (OOP)
|
|||||||
principles of *compositing* and *inheritance*. Classes like the
|
principles of *compositing* and *inheritance*. Classes like the
|
||||||
``LAMMPS`` class are a **composite** containing pointers to instances
|
``LAMMPS`` class are a **composite** containing pointers to instances
|
||||||
of other classes like ``Atom``, ``Comm``, ``Force``, ``Neighbor``,
|
of other classes like ``Atom``, ``Comm``, ``Force``, ``Neighbor``,
|
||||||
``Modify``, and so on. Each of these classes implement certain
|
``Modify``, and so on. Each of these classes implements certain
|
||||||
functionality by storing and manipulating data related to the
|
functionality by storing and manipulating data related to the
|
||||||
simulation and providing member functions that trigger certain
|
simulation and providing member functions that trigger certain
|
||||||
actions. Some of those classes like ``Force`` are themselves
|
actions. Some of those classes like ``Force`` are themselves
|
||||||
@ -87,9 +87,9 @@ interactions. Similarly the ``Modify`` class contains a list of
|
|||||||
``Fix`` and ``Compute`` classes. If the input commands that
|
``Fix`` and ``Compute`` classes. If the input commands that
|
||||||
correspond to these classes include the word *style*, then LAMMPS
|
correspond to these classes include the word *style*, then LAMMPS
|
||||||
stores only a single instance of that class. E.g. *atom_style*,
|
stores only a single instance of that class. E.g. *atom_style*,
|
||||||
*comm_style*, *pair_style*, *bond_style*. It the input command does
|
*comm_style*, *pair_style*, *bond_style*. If the input command does
|
||||||
not include the word *style*, there can be many instances of that
|
**not** include the word *style*, then there may be many instances of
|
||||||
class defined. E.g. *region*, *fix*, *compute*, *dump*.
|
that class defined, for example *region*, *fix*, *compute*, *dump*.
|
||||||
|
|
||||||
**Inheritance** enables creation of *derived* classes that can share
|
**Inheritance** enables creation of *derived* classes that can share
|
||||||
common functionality in their base class while providing a consistent
|
common functionality in their base class while providing a consistent
|
||||||
@ -232,7 +232,7 @@ macro ``PairStyle()`` will associate the style name "lj/cut"
|
|||||||
with a factory function creating an instance of the ``PairLJCut``
|
with a factory function creating an instance of the ``PairLJCut``
|
||||||
class.
|
class.
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
// from force.h
|
// from force.h
|
||||||
typedef Pair *(*PairCreator)(LAMMPS *);
|
typedef Pair *(*PairCreator)(LAMMPS *);
|
||||||
@ -360,7 +360,7 @@ characters; "{:<8}" would do this as left aligned, "{:^8}" as centered,
|
|||||||
argument type must be compatible or else the {fmt} formatting code will
|
argument type must be compatible or else the {fmt} formatting code will
|
||||||
throw an exception. Some format string examples are given below:
|
throw an exception. Some format string examples are given below:
|
||||||
|
|
||||||
.. code-block:: C
|
.. code-block:: c++
|
||||||
|
|
||||||
auto mesg = fmt::format(" CPU time: {:4d}:{:02d}:{:02d}\n", cpuh, cpum, cpus);
|
auto mesg = fmt::format(" CPU time: {:4d}:{:02d}:{:02d}\n", cpuh, cpum, cpus);
|
||||||
mesg = fmt::format("{:<8s}| {:<10.5g} | {:<10.5g} | {:<10.5g} |{:6.1f} |{:6.2f}\n",
|
mesg = fmt::format("{:<8s}| {:<10.5g} | {:<10.5g} | {:<10.5g} |{:6.1f} |{:6.2f}\n",
|
||||||
|
|||||||
@ -105,7 +105,7 @@ list, where each pair of atoms is listed only once (except when the
|
|||||||
pairs straddling sub-domains or periodic boundaries will be listed twice).
|
pairs straddling sub-domains or periodic boundaries will be listed twice).
|
||||||
Thus these are the default settings when a neighbor list request is created in:
|
Thus these are the default settings when a neighbor list request is created in:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
void Pair::init_style()
|
void Pair::init_style()
|
||||||
{
|
{
|
||||||
@ -129,7 +129,7 @@ neighbor list request to the specific needs of a style an additional
|
|||||||
request flag is needed. The :doc:`tersoff <pair_tersoff>` pair style,
|
request flag is needed. The :doc:`tersoff <pair_tersoff>` pair style,
|
||||||
for example, needs a "full" neighbor list:
|
for example, needs a "full" neighbor list:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
void PairTersoff::init_style()
|
void PairTersoff::init_style()
|
||||||
{
|
{
|
||||||
@ -141,7 +141,7 @@ When a pair style supports r-RESPA time integration with different cutoff region
|
|||||||
the request flag may depend on the corresponding r-RESPA settings. Here an example
|
the request flag may depend on the corresponding r-RESPA settings. Here an example
|
||||||
from pair style lj/cut:
|
from pair style lj/cut:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
void PairLJCut::init_style()
|
void PairLJCut::init_style()
|
||||||
{
|
{
|
||||||
@ -160,7 +160,7 @@ Granular pair styles need neighbor lists based on particle sizes and not cutoff
|
|||||||
and also may require to have the list of previous neighbors available ("history").
|
and also may require to have the list of previous neighbors available ("history").
|
||||||
For example with:
|
For example with:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
if (use_history) neighbor->add_request(this, NeighConst::REQ_SIZE | NeighConst::REQ_HISTORY);
|
if (use_history) neighbor->add_request(this, NeighConst::REQ_SIZE | NeighConst::REQ_HISTORY);
|
||||||
else neighbor->add_request(this, NeighConst::REQ_SIZE);
|
else neighbor->add_request(this, NeighConst::REQ_SIZE);
|
||||||
@ -170,7 +170,7 @@ settings each request can set an id which is then used in the corresponding
|
|||||||
``init_list()`` function to assign it to the suitable pointer variable. This is
|
``init_list()`` function to assign it to the suitable pointer variable. This is
|
||||||
done for example by the :doc:`pair style meam <pair_meam>`:
|
done for example by the :doc:`pair style meam <pair_meam>`:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
void PairMEAM::init_style()
|
void PairMEAM::init_style()
|
||||||
{
|
{
|
||||||
@ -189,7 +189,7 @@ just once) and this can also be indicated by a flag. As an example here
|
|||||||
is the request from the ``FixPeriNeigh`` class which is created
|
is the request from the ``FixPeriNeigh`` class which is created
|
||||||
internally by :doc:`Peridynamics pair styles <pair_peri>`:
|
internally by :doc:`Peridynamics pair styles <pair_peri>`:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
neighbor->add_request(this, NeighConst::REQ_FULL | NeighConst::REQ_OCCASIONAL);
|
neighbor->add_request(this, NeighConst::REQ_FULL | NeighConst::REQ_OCCASIONAL);
|
||||||
|
|
||||||
@ -198,7 +198,7 @@ than what is usually inferred from the pair style settings (largest cutoff of
|
|||||||
all pair styles plus neighbor list skin). The following is used in the
|
all pair styles plus neighbor list skin). The following is used in the
|
||||||
:doc:`compute rdf <compute_rdf>` command implementation:
|
:doc:`compute rdf <compute_rdf>` command implementation:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
if (cutflag)
|
if (cutflag)
|
||||||
neighbor->add_request(this, NeighConst::REQ_OCCASIONAL)->set_cutoff(mycutneigh);
|
neighbor->add_request(this, NeighConst::REQ_OCCASIONAL)->set_cutoff(mycutneigh);
|
||||||
@ -212,7 +212,7 @@ for printing the neighbor list summary the name of the requesting command
|
|||||||
should be set. Below is the request from the :doc:`delete atoms <delete_atoms>`
|
should be set. Below is the request from the :doc:`delete atoms <delete_atoms>`
|
||||||
command:
|
command:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
neighbor->add_request(this, "delete_atoms", NeighConst::REQ_FULL);
|
neighbor->add_request(this, "delete_atoms", NeighConst::REQ_FULL);
|
||||||
|
|
||||||
|
|||||||
@ -3,9 +3,9 @@ Parallel algorithms
|
|||||||
|
|
||||||
LAMMPS is designed to enable running simulations in parallel using the
|
LAMMPS is designed to enable running simulations in parallel using the
|
||||||
MPI parallel communication standard with distributed data via domain
|
MPI parallel communication standard with distributed data via domain
|
||||||
decomposition. The parallelization aims to be efficient result in good
|
decomposition. The parallelization aims to be efficient, and resulting
|
||||||
strong scaling (= good speedup for the same system) and good weak
|
in good strong scaling (= good speedup for the same system) and good
|
||||||
scaling (= the computational cost of enlarging the system is
|
weak scaling (= the computational cost of enlarging the system is
|
||||||
proportional to the system size). Additional parallelization using GPUs
|
proportional to the system size). Additional parallelization using GPUs
|
||||||
or OpenMP can also be applied within the sub-domain assigned to an MPI
|
or OpenMP can also be applied within the sub-domain assigned to an MPI
|
||||||
process. For clarity, most of the following illustrations show the 2d
|
process. For clarity, most of the following illustrations show the 2d
|
||||||
|
|||||||
@ -95,7 +95,7 @@ a class ``PairMorse2`` in the files ``pair_morse2.h`` and
|
|||||||
``pair_morse2.cpp`` with the factory function and initialization
|
``pair_morse2.cpp`` with the factory function and initialization
|
||||||
function would look like this:
|
function would look like this:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
#include "lammpsplugin.h"
|
#include "lammpsplugin.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
@ -141,7 +141,7 @@ list of argument strings), then the pointer type is ``lammpsplugin_factory2``
|
|||||||
and it must be assigned to the *creator.v2* member of the plugin struct.
|
and it must be assigned to the *creator.v2* member of the plugin struct.
|
||||||
Below is an example for that:
|
Below is an example for that:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
#include "lammpsplugin.h"
|
#include "lammpsplugin.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
@ -176,7 +176,7 @@ demonstrated in the following example, which also shows that the
|
|||||||
implementation of the plugin class may be within the same source
|
implementation of the plugin class may be within the same source
|
||||||
file as the plugin interface code:
|
file as the plugin interface code:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
#include "lammpsplugin.h"
|
#include "lammpsplugin.h"
|
||||||
|
|
||||||
|
|||||||
@ -194,7 +194,7 @@ macro. These tests operate by capturing the screen output when executing
|
|||||||
the failing command and then comparing that with a provided regular
|
the failing command and then comparing that with a provided regular
|
||||||
expression string pattern. Example:
|
expression string pattern. Example:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
TEST_F(SimpleCommandsTest, UnknownCommand)
|
TEST_F(SimpleCommandsTest, UnknownCommand)
|
||||||
{
|
{
|
||||||
@ -249,7 +249,7 @@ MPI support. These include tests where LAMMPS is run in multi-partition
|
|||||||
mode or only on a subset of the MPI world communicator. The CMake
|
mode or only on a subset of the MPI world communicator. The CMake
|
||||||
script code for adding this kind of test looks like this:
|
script code for adding this kind of test looks like this:
|
||||||
|
|
||||||
.. code-block:: CMake
|
.. code-block:: cmake
|
||||||
|
|
||||||
if (BUILD_MPI)
|
if (BUILD_MPI)
|
||||||
add_executable(test_library_mpi test_library_mpi.cpp)
|
add_executable(test_library_mpi test_library_mpi.cpp)
|
||||||
@ -489,7 +489,7 @@ to update the YAML files. Running a command like
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ test_pair_style mol-pair-lennard_mdf.yaml -g new.yaml
|
test_pair_style mol-pair-lennard_mdf.yaml -g new.yaml
|
||||||
|
|
||||||
will read the settings from the ``mol-pair-lennard_mdf.yaml`` file and then compute
|
will read the settings from the ``mol-pair-lennard_mdf.yaml`` file and then compute
|
||||||
the reference data and write a new file with to ``new.yaml``. If this step fails,
|
the reference data and write a new file with to ``new.yaml``. If this step fails,
|
||||||
@ -500,13 +500,13 @@ It is also possible to do an update in place with:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ test_pair_style mol-pair-lennard_mdf.yaml -u
|
test_pair_style mol-pair-lennard_mdf.yaml -u
|
||||||
|
|
||||||
And one can finally run the full set of tests with:
|
And one can finally run the full set of tests with:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ test_pair_style mol-pair-lennard_mdf.yaml
|
test_pair_style mol-pair-lennard_mdf.yaml
|
||||||
|
|
||||||
This will just print a summary of the groups of tests. When using the "-v" flag
|
This will just print a summary of the groups of tests. When using the "-v" flag
|
||||||
the test will also keep any LAMMPS output and when using the "-s" flag, there
|
the test will also keep any LAMMPS output and when using the "-s" flag, there
|
||||||
|
|||||||
425
doc/src/Developer_updating.rst
Normal file
425
doc/src/Developer_updating.rst
Normal file
@ -0,0 +1,425 @@
|
|||||||
|
Notes for updating code written for older LAMMPS versions
|
||||||
|
---------------------------------------------------------
|
||||||
|
|
||||||
|
This section documents how C++ source files that are available *outside
|
||||||
|
of the LAMMPS source distribution* (e.g. in external USER packages or as
|
||||||
|
source files provided as a supplement to a publication) that are written
|
||||||
|
for an older version of LAMMPS and thus need to be updated to be
|
||||||
|
compatible with the current version of LAMMPS. Due to the active
|
||||||
|
development of LAMMPS it is likely to always be incomplete. Please
|
||||||
|
contact developers@lammps.org in case you run across an issue that is not
|
||||||
|
(yet) listed here. Please also review the latest information about the
|
||||||
|
LAMMPS :doc:`programming style conventions <Modify_style>`, especially
|
||||||
|
if you are considering to submit the updated version for inclusion into
|
||||||
|
the LAMMPS distribution.
|
||||||
|
|
||||||
|
Available topics in mostly chronological order are:
|
||||||
|
|
||||||
|
- `Setting flags in the constructor`_
|
||||||
|
- `Rename of pack/unpack_comm() to pack/unpack_forward_comm()`_
|
||||||
|
- `Use ev_init() to initialize variables derived from eflag and vflag`_
|
||||||
|
- `Use utils::numeric() functions instead of force->numeric()`_
|
||||||
|
- `Use utils::open_potential() function to open potential files`_
|
||||||
|
- `Simplify customized error messages`_
|
||||||
|
- `Use of "override" instead of "virtual"`_
|
||||||
|
- `Simplified and more compact neighbor list requests`_
|
||||||
|
- `Split of fix STORE into fix STORE/GLOBAL and fix STORE/PERATOM`_
|
||||||
|
- `Use Output::get_dump_by_id() instead of Output::find_dump()`_
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
Setting flags in the constructor
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
As LAMMPS gains additional functionality, new flags may need to be set
|
||||||
|
in the constructor or a class to signal compatibility with such features.
|
||||||
|
Most of the time the defaults are chosen conservatively, but sometimes
|
||||||
|
the conservative choice is the uncommon choice, and then those settings
|
||||||
|
need to be made when updating code.
|
||||||
|
|
||||||
|
Pair styles:
|
||||||
|
|
||||||
|
- ``manybody_flag``: set to 1 if your pair style is not pair-wise additive
|
||||||
|
- ``restartinfo``: set to 0 if your pair style does not store data in restart files
|
||||||
|
|
||||||
|
|
||||||
|
Rename of pack/unpack_comm() to pack/unpack_forward_comm()
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. versionchanged:: 8Aug2014
|
||||||
|
|
||||||
|
In this change set the functions to pack data into communication buffers
|
||||||
|
and to unpack data from communication buffers for :doc:`forward
|
||||||
|
communications <Developer_comm_ops>` were renamed from ``pack_comm()``
|
||||||
|
and ``unpack_comm()`` to ``pack_forward_comm()`` and
|
||||||
|
``unpack_forward_comm()``, respectively. Also the meaning of the return
|
||||||
|
value of these functions was changed: rather than returning the number
|
||||||
|
of items per atom stored in the buffer, now the total number of items
|
||||||
|
added (or unpacked) needs to be returned. Here is an example from the
|
||||||
|
`PairEAM` class. Of course the member function declaration in corresponding
|
||||||
|
header file needs to be updated accordingly.
|
||||||
|
|
||||||
|
Old:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
int PairEAM::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
|
||||||
|
{
|
||||||
|
int m = 0;
|
||||||
|
for (int i = 0; i < n; i++) {
|
||||||
|
int j = list[i];
|
||||||
|
buf[m++] = fp[j];
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
New:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
int PairEAM::pack_forward_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
|
||||||
|
{
|
||||||
|
int m = 0;
|
||||||
|
for (int i = 0; i < n; i++) {
|
||||||
|
int j = list[i];
|
||||||
|
buf[m++] = fp[j];
|
||||||
|
}
|
||||||
|
return m;
|
||||||
|
}
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
Because the various "pack" and "unpack" functions are defined in the
|
||||||
|
respective base classes as dummy functions doing nothing, and because
|
||||||
|
of the the name mismatch the custom versions in the derived class
|
||||||
|
will no longer be called, there will be no compilation error when
|
||||||
|
this change is not applied. Only calculations will suddenly produce
|
||||||
|
incorrect results because the required forward communication calls
|
||||||
|
will cease to function correctly.
|
||||||
|
|
||||||
|
Use ev_init() to initialize variables derived from eflag and vflag
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. versionchanged:: 29Mar2019
|
||||||
|
|
||||||
|
There are several variables that need to be initialized based on
|
||||||
|
the values of the "eflag" and "vflag" variables and since sometimes
|
||||||
|
there are new bits added and new variables need to be set to 1 or 0.
|
||||||
|
To make this consistent, across all styles, there is now an inline
|
||||||
|
function ``ev_init(eflag, vflag)`` that makes those settings
|
||||||
|
consistently and calls either ``ev_setup()`` or ``ev_unset()``.
|
||||||
|
Example from a pair style:
|
||||||
|
|
||||||
|
Old:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
if (eflag || vflag) ev_setup(eflag, vflag);
|
||||||
|
else evflag = vflag_fdotr = eflag_global = eflag_atom = 0;
|
||||||
|
|
||||||
|
New:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
ev_init(eflag, vflag);
|
||||||
|
|
||||||
|
Not applying this change will not cause a compilation error, but
|
||||||
|
can lead to inconsistent behavior and incorrect tallying of
|
||||||
|
energy or virial.
|
||||||
|
|
||||||
|
Use utils::numeric() functions instead of force->numeric()
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. versionchanged:: 18Sep2020
|
||||||
|
|
||||||
|
The "numeric()" conversion functions (including "inumeric()",
|
||||||
|
"bnumeric()", and "tnumeric()") have been moved from the Force class to
|
||||||
|
the utils namespace. Also they take an additional argument that selects
|
||||||
|
whether the ``Error::all()`` or ``Error::one()`` function should be
|
||||||
|
called in case of an error. The former should be used when *all* MPI
|
||||||
|
processes call the conversion function and the latter *must* be used
|
||||||
|
when they are called from only one or a subset of the MPI processes.
|
||||||
|
|
||||||
|
Old:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
val = force->numeric(FLERR, arg[1]);
|
||||||
|
num = force->inumeric(FLERR, arg[2]);
|
||||||
|
|
||||||
|
New:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
val = utils::numeric(FLERR, true, arg[1], lmp);
|
||||||
|
num = utils::inumeric(FLERR, false, arg[2], lmp);
|
||||||
|
|
||||||
|
.. seealso::
|
||||||
|
|
||||||
|
:cpp:func:`utils::numeric() <LAMMPS_NS::utils::numeric>`,
|
||||||
|
:cpp:func:`utils::inumeric() <LAMMPS_NS::utils::inumeric>`,
|
||||||
|
:cpp:func:`utils::bnumeric() <LAMMPS_NS::utils::bnumeric>`,
|
||||||
|
:cpp:func:`utils::tnumeric() <LAMMPS_NS::utils::tnumeric>`
|
||||||
|
|
||||||
|
Use utils::open_potential() function to open potential files
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. versionchanged:: 18Sep2020
|
||||||
|
|
||||||
|
The :cpp:func:`utils::open_potential()
|
||||||
|
<LAMMPS_NS::utils::open_potential>` function must be used to replace
|
||||||
|
calls to ``force->open_potential()`` and should be used to replace
|
||||||
|
``fopen()`` for opening potential files for reading. The custom
|
||||||
|
function does three additional steps compared to ``fopen()``: 1) it will
|
||||||
|
try to parse the ``UNITS:`` and ``DATE:`` metadata will stop with an
|
||||||
|
error on a units mismatch and will print the date info, if present, in
|
||||||
|
the log file; 2) for pair styles that support it, it will set up
|
||||||
|
possible automatic unit conversions based on the embedded unit
|
||||||
|
information and LAMMPS' current units setting; 3) it will not only try
|
||||||
|
to open a potential file at the given path, but will also search in the
|
||||||
|
folders listed in the ``LAMMPS_POTENTIALS`` environment variable. This
|
||||||
|
allows to keep potential files in a common location instead of having to
|
||||||
|
copy them around for simulations.
|
||||||
|
|
||||||
|
Old:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
fp = force->open_potential(filename);
|
||||||
|
fp = fopen(filename, "r");
|
||||||
|
|
||||||
|
New:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
fp = utils::open_potential(filename, lmp);
|
||||||
|
|
||||||
|
Simplify customized error messages
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. versionchanged:: 14May2021
|
||||||
|
|
||||||
|
Aided by features of the bundled {fmt} library, error messages now
|
||||||
|
can have a variable number of arguments and the string will be interpreted
|
||||||
|
as a {fmt} style format string so that custom error messages can be
|
||||||
|
easily customized without having to use temporary buffers and ``sprintf()``.
|
||||||
|
Example:
|
||||||
|
|
||||||
|
Old:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
if (fptr == NULL) {
|
||||||
|
char str[128];
|
||||||
|
sprintf(str,"Cannot open AEAM potential file %s",filename);
|
||||||
|
error->one(FLERR,str);
|
||||||
|
}
|
||||||
|
|
||||||
|
New:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
if (fptr == nullptr)
|
||||||
|
error->one(FLERR, "Cannot open AEAM potential file {}: {}", filename, utils::getsyserror());
|
||||||
|
|
||||||
|
Use of "override" instead of "virtual"
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. versionchanged:: 17Feb2022
|
||||||
|
|
||||||
|
Since LAMMPS requires C++11 we switched to use the "override" keyword
|
||||||
|
instead of "virtual" to indicate polymorphism in derived classes. This
|
||||||
|
allows the C++ compiler to better detect inconsistencies when an
|
||||||
|
override is intended or not. Please note that "override" has to be
|
||||||
|
added to **all** polymorph functions in derived classes and "virtual"
|
||||||
|
*only* to the function in the base class (or the destructor). Here is
|
||||||
|
an example from the ``FixWallReflect`` class:
|
||||||
|
|
||||||
|
Old:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
FixWallReflect(class LAMMPS *, int, char **);
|
||||||
|
virtual ~FixWallReflect();
|
||||||
|
int setmask();
|
||||||
|
void init();
|
||||||
|
void post_integrate();
|
||||||
|
|
||||||
|
New:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
FixWallReflect(class LAMMPS *, int, char **);
|
||||||
|
~FixWallReflect() override;
|
||||||
|
int setmask() override;
|
||||||
|
void init() override;
|
||||||
|
void post_integrate() override;
|
||||||
|
|
||||||
|
This change set will neither cause a compilation failure, nor will it
|
||||||
|
change functionality, but if you plan to submit the updated code for
|
||||||
|
inclusion into the LAMMPS distribution, it will be requested for achieve
|
||||||
|
a consistent :doc:`programming style <Modify_style>`.
|
||||||
|
|
||||||
|
Simplified function names for forward and reverse communication
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. versionchanged:: 24Mar2022
|
||||||
|
|
||||||
|
Rather then using the function name to distinguish between the different
|
||||||
|
forward and reverse communication functions for styles, LAMMPS now uses
|
||||||
|
the type of the "this" pointer argument.
|
||||||
|
|
||||||
|
Old:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
comm->forward_comm_pair(this);
|
||||||
|
comm->forward_comm_fix(this);
|
||||||
|
comm->forward_comm_compute(this);
|
||||||
|
comm->forward_comm_dump(this);
|
||||||
|
comm->reverse_comm_pair(this);
|
||||||
|
comm->reverse_comm_fix(this);
|
||||||
|
comm->reverse_comm_compute(this);
|
||||||
|
comm->reverse_comm_dump(this);
|
||||||
|
|
||||||
|
New:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
comm->forward_comm(this);
|
||||||
|
comm->reverse_comm(this);
|
||||||
|
|
||||||
|
This change is **required** or else the code will not compile.
|
||||||
|
|
||||||
|
Simplified and more compact neighbor list requests
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. versionchanged:: 24Mar2022
|
||||||
|
|
||||||
|
This change set reduces the amount of code required to request a
|
||||||
|
neighbor list. It enforces consistency and no longer requires to change
|
||||||
|
internal data of the request. More information on neighbor list
|
||||||
|
requests can be :doc:`found here <Developer_notes>`. Example from the
|
||||||
|
``ComputeRDF`` class:
|
||||||
|
|
||||||
|
Old:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
int irequest = neighbor->request(this,instance_me);
|
||||||
|
neighbor->requests[irequest]->pair = 0;
|
||||||
|
neighbor->requests[irequest]->compute = 1;
|
||||||
|
neighbor->requests[irequest]->occasional = 1;
|
||||||
|
if (cutflag) {
|
||||||
|
neighbor->requests[irequest]->cut = 1;
|
||||||
|
neighbor->requests[irequest]->cutoff = mycutneigh;
|
||||||
|
}
|
||||||
|
|
||||||
|
New:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
auto req = neighbor->add_request(this, NeighConst::REQ_OCCASIONAL);
|
||||||
|
if (cutflag) req->set_cutoff(mycutneigh);
|
||||||
|
|
||||||
|
Public access to the ``NeighRequest`` class data members has been
|
||||||
|
removed so this update is **required** to avoid compilation failure.
|
||||||
|
|
||||||
|
Split of fix STORE into fix STORE/GLOBAL and fix STORE/PERATOM
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. versionchanged:: 15Sep2022
|
||||||
|
|
||||||
|
This change splits the GLOBAL and PERATOM modes of fix STORE into two
|
||||||
|
separate fixes STORE/GLOBAL and STORE/PERATOM. There was very little
|
||||||
|
shared code between the two fix STORE modes and the two different code
|
||||||
|
paths had to be prefixed with if statements. Furthermore, some flags
|
||||||
|
were used differently in the two modes leading to confusion. Splitting
|
||||||
|
the code into two fix styles, makes it more easily maintainable. Since
|
||||||
|
these are internal fixes, there is no user visible change.
|
||||||
|
|
||||||
|
Old:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
#include "fix_store.h"
|
||||||
|
|
||||||
|
FixStore *fix = dynamic_cast<FixStore *>(
|
||||||
|
modify->add_fix(fmt::format("{} {} STORE peratom 1 13",id_pole,group->names[0]));
|
||||||
|
|
||||||
|
FixStore *fix = dynamic_cast<FixStore *>(modify->get_fix_by_id(id_pole));
|
||||||
|
|
||||||
|
New:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
#include "fix_store_peratom.h"
|
||||||
|
|
||||||
|
FixStorePeratom *fix = dynamic_cast<FixStorePeratom *>(
|
||||||
|
modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 13",id_pole,group->names[0]));
|
||||||
|
|
||||||
|
FixStorePeratom *fix = dynamic_cast<FixStorePeratom *>(modify->get_fix_by_id(id_pole));
|
||||||
|
|
||||||
|
Old:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
#include "fix_store.h"
|
||||||
|
|
||||||
|
FixStore *fix = dynamic_cast<FixStore *>(
|
||||||
|
modify->add_fix(fmt::format("{} {} STORE global 1 1",id_fix,group->names[igroup]));
|
||||||
|
|
||||||
|
FixStore *fix = dynamic_cast<FixStore *>(modify->get_fix_by_id(id_fix));
|
||||||
|
|
||||||
|
New:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
#include "fix_store_global.h"
|
||||||
|
|
||||||
|
FixStoreGlobal *fix = dynamic_cast<FixStoreGlobal *>(
|
||||||
|
modify->add_fix(fmt::format("{} {} STORE/GLOBAL 1 1",id_fix,group->names[igroup]));
|
||||||
|
|
||||||
|
FixStoreGlobal *fix = dynamic_cast<FixStoreGlobal *>(modify->get_fix_by_id(id_fix));
|
||||||
|
|
||||||
|
This change is **required** or else the code will not compile.
|
||||||
|
|
||||||
|
Use Output::get_dump_by_id() instead of Output::find_dump()
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. versionchanged:: 15Sep2022
|
||||||
|
|
||||||
|
The accessor function to individual dump style instances has been changed
|
||||||
|
from ``Output::find_dump()`` returning the index of the dump instance in
|
||||||
|
the list of dumps to ``Output::get_dump_by_id()`` returning a pointer to
|
||||||
|
the dump directly. Example:
|
||||||
|
|
||||||
|
Old:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
int idump = output->find_dump(arg[iarg+1]);
|
||||||
|
if (idump < 0)
|
||||||
|
error->all(FLERR,"Dump ID in hyper command does not exist");
|
||||||
|
memory->grow(dumplist,ndump+1,"hyper:dumplist");
|
||||||
|
dumplist[ndump++] = idump;
|
||||||
|
|
||||||
|
[...]
|
||||||
|
|
||||||
|
if (dumpflag)
|
||||||
|
for (int idump = 0; idump < ndump; idump++)
|
||||||
|
output->dump[dumplist[idump]]->write();
|
||||||
|
|
||||||
|
New:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
auto idump = output->get_dump_by_id(arg[iarg+1]);
|
||||||
|
if (!idump) error->all(FLERR,"Dump ID {} in hyper command does not exist", arg[iarg+1]);
|
||||||
|
dumplist.emplace_back(idump);
|
||||||
|
|
||||||
|
[...]
|
||||||
|
|
||||||
|
if (dumpflag) for (auto idump : dumplist) idump->write();
|
||||||
|
|
||||||
|
This change is **required** or else the code will not compile.
|
||||||
@ -205,7 +205,7 @@ Argument processing
|
|||||||
Convenience functions
|
Convenience functions
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
.. doxygenfunction:: logmesg(LAMMPS *lmp, const S &format, Args&&... args)
|
.. doxygenfunction:: logmesg(LAMMPS *lmp, const std::string &format, Args&&... args)
|
||||||
:project: progguide
|
:project: progguide
|
||||||
|
|
||||||
.. doxygenfunction:: logmesg(LAMMPS *lmp, const std::string &mesg)
|
.. doxygenfunction:: logmesg(LAMMPS *lmp, const std::string &mesg)
|
||||||
@ -305,7 +305,7 @@ are all "whitespace" characters, i.e. the space character, the tabulator
|
|||||||
character, the carriage return character, the linefeed character, and
|
character, the carriage return character, the linefeed character, and
|
||||||
the form feed character.
|
the form feed character.
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
:caption: Tokenizer class example listing entries of the PATH environment variable
|
:caption: Tokenizer class example listing entries of the PATH environment variable
|
||||||
|
|
||||||
#include "tokenizer.h"
|
#include "tokenizer.h"
|
||||||
@ -337,7 +337,7 @@ tokenizer into a ``try`` / ``catch`` block to handle errors. The
|
|||||||
when a (type of) number is requested as next token that is not
|
when a (type of) number is requested as next token that is not
|
||||||
compatible with the string representing the next word.
|
compatible with the string representing the next word.
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
:caption: ValueTokenizer class example with exception handling
|
:caption: ValueTokenizer class example with exception handling
|
||||||
|
|
||||||
#include "tokenizer.h"
|
#include "tokenizer.h"
|
||||||
@ -415,7 +415,7 @@ one or two array indices "[<number>]" with numbers > 0.
|
|||||||
|
|
||||||
A typical code segment would look like this:
|
A typical code segment would look like this:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
:caption: Usage example for ArgInfo class
|
:caption: Usage example for ArgInfo class
|
||||||
|
|
||||||
int nvalues = 0;
|
int nvalues = 0;
|
||||||
@ -464,7 +464,7 @@ open the file, and will call the :cpp:class:`LAMMPS_NS::Error` class in
|
|||||||
case of failures to read or to convert numbers, so that LAMMPS will be
|
case of failures to read or to convert numbers, so that LAMMPS will be
|
||||||
aborted.
|
aborted.
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
:caption: Use of PotentialFileReader class in pair style coul/streitz
|
:caption: Use of PotentialFileReader class in pair style coul/streitz
|
||||||
|
|
||||||
PotentialFileReader reader(lmp, file, "coul/streitz");
|
PotentialFileReader reader(lmp, file, "coul/streitz");
|
||||||
@ -543,7 +543,7 @@ chunk size needs to be known in advance, 2) with :cpp:func:`MyPage::vget()
|
|||||||
its size is registered later with :cpp:func:`MyPage::vgot()
|
its size is registered later with :cpp:func:`MyPage::vgot()
|
||||||
<LAMMPS_NS::MyPage::vgot>`.
|
<LAMMPS_NS::MyPage::vgot>`.
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
:caption: Example of using :cpp:class:`MyPage <LAMMPS_NS::MyPage>`
|
:caption: Example of using :cpp:class:`MyPage <LAMMPS_NS::MyPage>`
|
||||||
|
|
||||||
#include "my_page.h"
|
#include "my_page.h"
|
||||||
|
|||||||
@ -26,7 +26,7 @@ constructor with the signature: ``FixPrintVel(class LAMMPS *, int, char **)``.
|
|||||||
Every fix must be registered in LAMMPS by writing the following lines
|
Every fix must be registered in LAMMPS by writing the following lines
|
||||||
of code in the header before include guards:
|
of code in the header before include guards:
|
||||||
|
|
||||||
.. code-block:: c
|
.. code-block:: c++
|
||||||
|
|
||||||
#ifdef FIX_CLASS
|
#ifdef FIX_CLASS
|
||||||
// clang-format off
|
// clang-format off
|
||||||
@ -47,7 +47,7 @@ keyword when it parses the input script.
|
|||||||
Let's write a simple fix which will print the average velocity at the end
|
Let's write a simple fix which will print the average velocity at the end
|
||||||
of each timestep. First of all, implement a constructor:
|
of each timestep. First of all, implement a constructor:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
FixPrintVel::FixPrintVel(LAMMPS *lmp, int narg, char **arg)
|
FixPrintVel::FixPrintVel(LAMMPS *lmp, int narg, char **arg)
|
||||||
: Fix(lmp, narg, arg)
|
: Fix(lmp, narg, arg)
|
||||||
@ -72,7 +72,7 @@ in the Fix class called ``nevery`` which specifies how often the method
|
|||||||
|
|
||||||
The next method we need to implement is ``setmask()``:
|
The next method we need to implement is ``setmask()``:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
int FixPrintVel::setmask()
|
int FixPrintVel::setmask()
|
||||||
{
|
{
|
||||||
@ -87,7 +87,7 @@ during execution. The constant ``END_OF_STEP`` corresponds to the
|
|||||||
are called during a timestep and the order in which they are called
|
are called during a timestep and the order in which they are called
|
||||||
are shown in the previous section.
|
are shown in the previous section.
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
void FixPrintVel::end_of_step()
|
void FixPrintVel::end_of_step()
|
||||||
{
|
{
|
||||||
@ -143,7 +143,7 @@ The group membership information of an atom is contained in the *mask*
|
|||||||
property of and atom and the bit corresponding to a given group is
|
property of and atom and the bit corresponding to a given group is
|
||||||
stored in the groupbit variable which is defined in Fix base class:
|
stored in the groupbit variable which is defined in Fix base class:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
for (int i = 0; i < nlocal; ++i) {
|
for (int i = 0; i < nlocal; ++i) {
|
||||||
if (atom->mask[i] & groupbit) {
|
if (atom->mask[i] & groupbit) {
|
||||||
@ -174,7 +174,7 @@ to store positions of atoms from previous timestep, we need to add
|
|||||||
``double** xold`` to the header file. Than add allocation code
|
``double** xold`` to the header file. Than add allocation code
|
||||||
to the constructor:
|
to the constructor:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
FixSavePos::FixSavePos(LAMMPS *lmp, int narg, char **arg), xold(nullptr)
|
FixSavePos::FixSavePos(LAMMPS *lmp, int narg, char **arg), xold(nullptr)
|
||||||
{
|
{
|
||||||
@ -190,7 +190,7 @@ to the constructor:
|
|||||||
|
|
||||||
Implement the aforementioned methods:
|
Implement the aforementioned methods:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
double FixSavePos::memory_usage()
|
double FixSavePos::memory_usage()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -40,7 +40,7 @@ We use it to show how to identify the origin of a segmentation fault.
|
|||||||
|
|
||||||
After recompiling LAMMPS and running the input you should get something like this:
|
After recompiling LAMMPS and running the input you should get something like this:
|
||||||
|
|
||||||
.. code-block::
|
.. code-block:: console
|
||||||
|
|
||||||
$ ./lmp -in in.melt
|
$ ./lmp -in in.melt
|
||||||
LAMMPS (19 Mar 2020)
|
LAMMPS (19 Mar 2020)
|
||||||
@ -75,7 +75,7 @@ Using the GDB debugger to get a stack trace
|
|||||||
There are two options to use the GDB debugger for identifying the origin
|
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
|
of the segmentation fault or similar crash. The GDB debugger has many
|
||||||
more features and options, as can be seen for example its `online
|
more features and options, as can be seen for example its `online
|
||||||
documentation <http://sourceware.org/gdb/current/onlinedocs/gdb/>`_.
|
documentation <https://sourceware.org/gdb/current/onlinedocs/gdb/>`_.
|
||||||
|
|
||||||
Run LAMMPS from within the debugger
|
Run LAMMPS from within the debugger
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@ -90,8 +90,9 @@ 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
|
stop with a message why it stopped, print the current line of code, and
|
||||||
drop back to the GDB prompt.
|
drop back to the GDB prompt.
|
||||||
|
|
||||||
.. code-block::
|
.. code-block:: console
|
||||||
|
|
||||||
|
(gdb) run
|
||||||
[...]
|
[...]
|
||||||
Setting up Verlet run ...
|
Setting up Verlet run ...
|
||||||
Unit style : lj
|
Unit style : lj
|
||||||
@ -106,7 +107,7 @@ drop back to the GDB prompt.
|
|||||||
Now typing the command "where" will show the stack of functions starting from
|
Now typing the command "where" will show the stack of functions starting from
|
||||||
the current function back to "main()".
|
the current function back to "main()".
|
||||||
|
|
||||||
.. code-block::
|
.. code-block:: console
|
||||||
|
|
||||||
(gdb) where
|
(gdb) where
|
||||||
#0 0x00000000006653ab in LAMMPS_NS::PairLJCut::compute (this=0x829740, eflag=1, vflag=<optimized out>) at /home/akohlmey/compile/lammps/src/pair_lj_cut.cpp:139
|
#0 0x00000000006653ab in LAMMPS_NS::PairLJCut::compute (this=0x829740, eflag=1, vflag=<optimized out>) at /home/akohlmey/compile/lammps/src/pair_lj_cut.cpp:139
|
||||||
@ -124,7 +125,7 @@ You can also print the value of variables and see if there is anything
|
|||||||
unexpected. Segmentation faults, for example, commonly happen when a
|
unexpected. Segmentation faults, for example, commonly happen when a
|
||||||
pointer variable is not assigned and still initialized to NULL.
|
pointer variable is not assigned and still initialized to NULL.
|
||||||
|
|
||||||
.. code-block::
|
.. code-block:: console
|
||||||
|
|
||||||
(gdb) print x
|
(gdb) print x
|
||||||
$1 = (double **) 0x7ffff7ca1010
|
$1 = (double **) 0x7ffff7ca1010
|
||||||
@ -153,7 +154,7 @@ utility to the current folder. Example: ``coredumpctl -o core dump lmp``.
|
|||||||
Now you can launch the debugger to load the executable, its debug info
|
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.
|
and the core dump and drop you to a prompt like before.
|
||||||
|
|
||||||
.. code-block::
|
.. code-block:: console
|
||||||
|
|
||||||
$ gdb lmp core
|
$ gdb lmp core
|
||||||
Reading symbols from lmp...
|
Reading symbols from lmp...
|
||||||
@ -186,7 +187,7 @@ recommended to redirect the valgrind output to a file (e.g. with
|
|||||||
process ID) so that the messages of the multiple valgrind instances to
|
process ID) so that the messages of the multiple valgrind instances to
|
||||||
the console are not mixed.
|
the console are not mixed.
|
||||||
|
|
||||||
.. code-block::
|
.. code-block:: console
|
||||||
|
|
||||||
$ valgrind ./lmp -in in.melt
|
$ valgrind ./lmp -in in.melt
|
||||||
==1933642== Memcheck, a memory error detector
|
==1933642== Memcheck, a memory error detector
|
||||||
|
|||||||
@ -476,65 +476,6 @@ Doc page with :doc:`WARNING messages <Errors_warnings>`
|
|||||||
*Bonds defined but no bond types*
|
*Bonds defined but no bond types*
|
||||||
The data file header lists bonds but no bond types.
|
The data file header lists bonds but no bond types.
|
||||||
|
|
||||||
*Bond/react: Cannot use fix bond/react with non-molecular systems*
|
|
||||||
Only systems with bonds that can be changed can be used. Atom_style
|
|
||||||
template does not qualify.
|
|
||||||
|
|
||||||
*Bond/react: Invalid template atom ID in map file*
|
|
||||||
Atom IDs in molecule templates range from 1 to the number of atoms in the template.
|
|
||||||
|
|
||||||
*Bond/react: Rmax cutoff is longer than pairwise cutoff*
|
|
||||||
This is not allowed because bond creation is done using the pairwise
|
|
||||||
neighbor list.
|
|
||||||
|
|
||||||
*Bond/react: Molecule template ID for fix bond/react does not exist*
|
|
||||||
A valid molecule template must have been created with the molecule
|
|
||||||
command.
|
|
||||||
|
|
||||||
*Bond/react: Reaction templates must contain the same number of atoms*
|
|
||||||
There should be a one-to-one correspondence between atoms in the
|
|
||||||
pre-reacted and post-reacted templates, as specified by the map file.
|
|
||||||
|
|
||||||
*Bond/react: Unknown section in map file*
|
|
||||||
Please ensure reaction map files are properly formatted.
|
|
||||||
|
|
||||||
*Bond/react: Atom/Bond type affected by reaction too close to template edge*
|
|
||||||
This means an atom which changes type or connectivity during the
|
|
||||||
reaction is too close to an 'edge' atom defined in the map
|
|
||||||
file. This could cause incorrect assignment of bonds, angle, etc.
|
|
||||||
Generally, this means you must include more atoms in your templates,
|
|
||||||
such that there are at least two atoms between each atom involved in
|
|
||||||
the reaction and an edge atom.
|
|
||||||
|
|
||||||
*Bond/react: Fix bond/react needs ghost atoms from farther away*
|
|
||||||
This is because a processor needs to map the entire unreacted
|
|
||||||
molecule template onto simulation atoms it knows about. The
|
|
||||||
comm_modify cutoff command can be used to extend the communication
|
|
||||||
range.
|
|
||||||
|
|
||||||
*Bond/react: A deleted atom cannot remain bonded to an atom that is not deleted*
|
|
||||||
Self-explanatory.
|
|
||||||
|
|
||||||
*Bond/react: First neighbors of chiral atoms must be of mutually different types*
|
|
||||||
Self-explanatory.
|
|
||||||
|
|
||||||
*Bond/react: Chiral atoms must have exactly four first neighbors*
|
|
||||||
Self-explanatory.
|
|
||||||
|
|
||||||
*Bond/react: Molecule template 'Coords' section required for chiralIDs keyword*
|
|
||||||
The coordinates of atoms in the pre-reacted template are used to determine
|
|
||||||
chirality.
|
|
||||||
|
|
||||||
*Bond/react special bond generation overflow*
|
|
||||||
The number of special bonds per-atom created by a reaction exceeds the
|
|
||||||
system setting. See the read_data or create_box command for how to
|
|
||||||
specify this value.
|
|
||||||
|
|
||||||
*Bond/react topology/atom exceed system topology/atom*
|
|
||||||
The number of bonds, angles etc per-atom created by a reaction exceeds
|
|
||||||
the system setting. See the read_data or create_box command for how to
|
|
||||||
specify this value.
|
|
||||||
|
|
||||||
*Both restart files must use % or neither*
|
*Both restart files must use % or neither*
|
||||||
Self-explanatory.
|
Self-explanatory.
|
||||||
|
|
||||||
@ -3521,6 +3462,65 @@ Doc page with :doc:`WARNING messages <Errors_warnings>`
|
|||||||
acquire needed info, The comm_modify cutoff command can be used to
|
acquire needed info, The comm_modify cutoff command can be used to
|
||||||
extend the communication range.
|
extend the communication range.
|
||||||
|
|
||||||
|
*Fix bond/react: Cannot use fix bond/react with non-molecular systems*
|
||||||
|
Only systems with bonds that can be changed can be used. Atom_style
|
||||||
|
template does not qualify.
|
||||||
|
|
||||||
|
*Fix bond/react: Invalid template atom ID in map file*
|
||||||
|
Atom IDs in molecule templates range from 1 to the number of atoms in the template.
|
||||||
|
|
||||||
|
*Fix bond/react: Rmax cutoff is longer than pairwise cutoff*
|
||||||
|
This is not allowed because bond creation is done using the pairwise
|
||||||
|
neighbor list.
|
||||||
|
|
||||||
|
*Fix bond/react: Molecule template ID for fix bond/react does not exist*
|
||||||
|
A valid molecule template must have been created with the molecule
|
||||||
|
command.
|
||||||
|
|
||||||
|
*Fix bond/react: Reaction templates must contain the same number of atoms*
|
||||||
|
There should be a one-to-one correspondence between atoms in the
|
||||||
|
pre-reacted and post-reacted templates, as specified by the map file.
|
||||||
|
|
||||||
|
*Fix bond/react: Unknown section in map file*
|
||||||
|
Please ensure reaction map files are properly formatted.
|
||||||
|
|
||||||
|
*Fix bond/react: Atom/Bond type affected by reaction too close to template edge*
|
||||||
|
This means an atom which changes type or connectivity during the
|
||||||
|
reaction is too close to an 'edge' atom defined in the map
|
||||||
|
file. This could cause incorrect assignment of bonds, angle, etc.
|
||||||
|
Generally, this means you must include more atoms in your templates,
|
||||||
|
such that there are at least two atoms between each atom involved in
|
||||||
|
the reaction and an edge atom.
|
||||||
|
|
||||||
|
*Fix bond/react: Fix bond/react needs ghost atoms from farther away*
|
||||||
|
This is because a processor needs to map the entire unreacted
|
||||||
|
molecule template onto simulation atoms it knows about. The
|
||||||
|
comm_modify cutoff command can be used to extend the communication
|
||||||
|
range.
|
||||||
|
|
||||||
|
*Fix bond/react: A deleted atom cannot remain bonded to an atom that is not deleted*
|
||||||
|
Self-explanatory.
|
||||||
|
|
||||||
|
*Fix bond/react: First neighbors of chiral atoms must be of mutually different types*
|
||||||
|
Self-explanatory.
|
||||||
|
|
||||||
|
*Fix bond/react: Chiral atoms must have exactly four first neighbors*
|
||||||
|
Self-explanatory.
|
||||||
|
|
||||||
|
*Fix bond/react: Molecule template 'Coords' section required for chiralIDs keyword*
|
||||||
|
The coordinates of atoms in the pre-reacted template are used to determine
|
||||||
|
chirality.
|
||||||
|
|
||||||
|
*Fix bond/react special bond generation overflow*
|
||||||
|
The number of special bonds per-atom created by a reaction exceeds the
|
||||||
|
system setting. See the read_data or create_box command for how to
|
||||||
|
specify this value.
|
||||||
|
|
||||||
|
*Fix bond/react topology/atom exceed system topology/atom*
|
||||||
|
The number of bonds, angles etc per-atom created by a reaction exceeds
|
||||||
|
the system setting. See the read_data or create_box command for how to
|
||||||
|
specify this value.
|
||||||
|
|
||||||
*Fix bond/swap cannot use dihedral or improper styles*
|
*Fix bond/swap cannot use dihedral or improper styles*
|
||||||
These styles cannot be defined when using this fix.
|
These styles cannot be defined when using this fix.
|
||||||
|
|
||||||
|
|||||||
@ -68,14 +68,6 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
|
|||||||
length, multiplying by the number of bonds in the interaction (e.g. 3
|
length, multiplying by the number of bonds in the interaction (e.g. 3
|
||||||
for a dihedral) and adding a small amount of stretch.
|
for a dihedral) and adding a small amount of stretch.
|
||||||
|
|
||||||
*Bond/react: Atom affected by reaction too close to template edge*
|
|
||||||
This means an atom which changes type or connectivity during the
|
|
||||||
reaction is too close to an 'edge' atom defined in the superimpose
|
|
||||||
file. This could cause incorrect assignment of bonds, angle, etc.
|
|
||||||
Generally, this means you must include more atoms in your templates,
|
|
||||||
such that there are at least two atoms between each atom involved in
|
|
||||||
the reaction and an edge atom.
|
|
||||||
|
|
||||||
*Both groups in compute group/group have a net charge; the Kspace boundary correction to energy will be non-zero*
|
*Both groups in compute group/group have a net charge; the Kspace boundary correction to energy will be non-zero*
|
||||||
Self-explanatory.
|
Self-explanatory.
|
||||||
|
|
||||||
@ -206,12 +198,20 @@ Doc page with :doc:`ERROR messages <Errors_messages>`
|
|||||||
*Fix SRD walls overlap but fix srd overlap not set*
|
*Fix SRD walls overlap but fix srd overlap not set*
|
||||||
You likely want to set this in your input script.
|
You likely want to set this in your input script.
|
||||||
|
|
||||||
* Fix bond/create is used multiple times or with fix bond/break - may not work as expected*
|
*Fix bond/create is used multiple times or with fix bond/break - may not work as expected*
|
||||||
When using fix bond/create multiple times or in combination with
|
When using fix bond/create multiple times or in combination with
|
||||||
fix bond/break, the individual fix instances do not share information
|
fix bond/break, the individual fix instances do not share information
|
||||||
about changes they made at the same time step and thus it may result
|
about changes they made at the same time step and thus it may result
|
||||||
in unexpected behavior.
|
in unexpected behavior.
|
||||||
|
|
||||||
|
*Fix bond/react: Atom affected by reaction too close to template edge*
|
||||||
|
This means an atom which changes type or connectivity during the
|
||||||
|
reaction is too close to an 'edge' atom defined in the superimpose
|
||||||
|
file. This could cause incorrect assignment of bonds, angle, etc.
|
||||||
|
Generally, this means you must include more atoms in your templates,
|
||||||
|
such that there are at least two atoms between each atom involved in
|
||||||
|
the reaction and an edge atom.
|
||||||
|
|
||||||
*Fix bond/swap will ignore defined angles*
|
*Fix bond/swap will ignore defined angles*
|
||||||
See the page for fix bond/swap for more info on this
|
See the page for fix bond/swap for more info on this
|
||||||
restriction.
|
restriction.
|
||||||
@ -804,4 +804,3 @@ This will most likely cause errors in kinetic fluctuations.
|
|||||||
|
|
||||||
*Using pair tail corrections with pair_modify compute no*
|
*Using pair tail corrections with pair_modify compute no*
|
||||||
The tail corrections will thus not be computed.
|
The tail corrections will thus not be computed.
|
||||||
|
|
||||||
|
|||||||
@ -1,32 +1,51 @@
|
|||||||
The ``LIBLAMMPS`` Fortran Module
|
The :f:mod:`LIBLAMMPS` Fortran Module
|
||||||
********************************
|
*************************************
|
||||||
|
|
||||||
The ``LIBLAMMPS`` module provides an interface to call LAMMPS from a
|
The :f:mod:`LIBLAMMPS` module provides an interface to call LAMMPS from
|
||||||
Fortran code. It is based on the LAMMPS C-library interface and
|
Fortran. It is based on the LAMMPS C library interface and requires a
|
||||||
requires a Fortran 2003 compatible compiler to be compiled.
|
fully Fortran 2003-compatible compiler to be compiled. It is designed
|
||||||
|
to be self-contained and not require any support functions written in C,
|
||||||
|
C++, or Fortran other than those in the C library interface and the
|
||||||
|
LAMMPS Fortran module itself.
|
||||||
|
|
||||||
While C libraries have a defined binary interface (ABI) and can thus be
|
While C libraries have a defined binary interface (ABI) and can thus be
|
||||||
used from multiple compiler versions from different vendors for as long
|
used from multiple compiler versions from different vendors as long as
|
||||||
as they are compatible with the hosting operating system, the same is
|
they are compatible with the hosting operating system, the same is not
|
||||||
not true for Fortran codes. Thus the LAMMPS Fortran module needs to be
|
true for Fortran programs. Thus, the LAMMPS Fortran module needs to be
|
||||||
compiled alongside the code using it from the source code in
|
compiled alongside the code using it from the source code in
|
||||||
``fortran/lammps.f90``. When linking, you also need to
|
``fortran/lammps.f90`` *and* with the same compiler used to build the
|
||||||
:doc:`link to the LAMMPS library <Build_link>`. A typical command line
|
rest of the Fortran code that interfaces to LAMMPS. When linking, you
|
||||||
for a simple program using the Fortran interface would be:
|
also need to :doc:`link to the LAMMPS library <Build_link>`. A typical
|
||||||
|
command line for a simple program using the Fortran interface would be:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
mpifort -o testlib.x lammps.f90 testlib.f90 -L. -llammps
|
mpifort -o testlib.x lammps.f90 testlib.f90 -L. -llammps
|
||||||
|
|
||||||
Please note, that the MPI compiler wrapper is only required when the
|
Please note that the MPI compiler wrapper is only required when the
|
||||||
calling the library from an MPI parallel code. Please also note the
|
calling the library *from* an MPI-parallelized program. Otherwise,
|
||||||
order of the source files: the ``lammps.f90`` file needs to be compiled
|
using the plain Fortran compiler (gfortran, ifort, flang, etc.) will
|
||||||
first, since it provides the ``LIBLAMMPS`` module that is imported by
|
suffice, since there are no direct references to MPI library features,
|
||||||
the Fortran code using the interface. A working example code can be
|
definitions and subroutine calls; MPI communicators are referred to by
|
||||||
found together with equivalent examples in C and C++ in the
|
their integer index representation as required by the Fortran MPI
|
||||||
``examples/COUPLE/simple`` folder of the LAMMPS distribution.
|
interface. It may be necessary to link to additional libraries,
|
||||||
|
depending on how LAMMPS was configured and whether the LAMMPS library
|
||||||
|
:doc:`was compiled as a static or dynamic library <Build_link>`.
|
||||||
|
|
||||||
.. versionadded:: 9Oct2020
|
If the LAMMPS library itself has been compiled with MPI support, the
|
||||||
|
resulting executable will be able to run LAMMPS in parallel with
|
||||||
|
``mpirun``, ``mpiexec``, or equivalent. This may be either on the
|
||||||
|
"world" communicator or a sub-communicator created by the calling
|
||||||
|
Fortran code. If, on the other hand, the LAMMPS library has been
|
||||||
|
compiled **without** MPI support, each LAMMPS instance will run
|
||||||
|
independently using just one processor.
|
||||||
|
|
||||||
|
Please also note that the order of the source files matters: the
|
||||||
|
``lammps.f90`` file needs to be compiled first, since it provides the
|
||||||
|
:f:mod:`LIBLAMMPS` module that would need to be imported by the calling
|
||||||
|
Fortran code in order to uses the Fortran interface.
|
||||||
|
A working example can be found together with equivalent examples in C and
|
||||||
|
C++ in the ``examples/COUPLE/simple`` folder of the LAMMPS distribution.
|
||||||
|
|
||||||
.. admonition:: Work in Progress
|
.. admonition:: Work in Progress
|
||||||
:class: note
|
:class: note
|
||||||
@ -49,61 +68,96 @@ found together with equivalent examples in C and C++ in the
|
|||||||
Creating or deleting a LAMMPS object
|
Creating or deleting a LAMMPS object
|
||||||
************************************
|
************************************
|
||||||
|
|
||||||
With the Fortran interface the creation of a :cpp:class:`LAMMPS
|
With the Fortran interface, the creation of a :cpp:class:`LAMMPS
|
||||||
<LAMMPS_NS::LAMMPS>` instance is included in the constructor for
|
<LAMMPS_NS::LAMMPS>` instance is included in the constructor for
|
||||||
creating the :f:func:`lammps` derived type. To import the definition of
|
creating the :f:func:`lammps` derived type. To import the definition of
|
||||||
that type and its type bound procedures you need to add a ``USE
|
that type and its type-bound procedures, you need to add a ``USE LIBLAMMPS``
|
||||||
LIBLAMMPS`` statement. Internally it will call either
|
statement. Internally, it will call either
|
||||||
:cpp:func:`lammps_open_fortran` or :cpp:func:`lammps_open_no_mpi` from
|
:cpp:func:`lammps_open_fortran` or :cpp:func:`lammps_open_no_mpi` from
|
||||||
the C library API to create the class instance. All arguments are
|
the C library API to create the class instance. All arguments are
|
||||||
optional and :cpp:func:`lammps_mpi_init` will be called automatically,
|
optional and :cpp:func:`lammps_mpi_init` will be called automatically
|
||||||
if it is needed. Similarly, a possible call to :cpp:func:`lammps_finalize`
|
if it is needed. Similarly, a possible call to
|
||||||
is integrated into the :f:func:`close` function and triggered with
|
:cpp:func:`lammps_mpi_finalize` is integrated into the :f:func:`close`
|
||||||
the optional logical argument set to ``.true.``. Here is a simple example:
|
function and triggered with the optional logical argument set to
|
||||||
|
``.TRUE.``. Here is a simple example:
|
||||||
|
|
||||||
.. code-block:: fortran
|
.. code-block:: fortran
|
||||||
|
|
||||||
PROGRAM testlib
|
PROGRAM testlib
|
||||||
USE LIBLAMMPS ! include the LAMMPS library interface
|
USE LIBLAMMPS ! include the LAMMPS library interface
|
||||||
TYPE(lammps) :: lmp ! derived type to hold LAMMPS instance
|
IMPLICIT NONE
|
||||||
CHARACTER(len=*), DIMENSION(*), PARAMETER :: args = &
|
TYPE(lammps) :: lmp ! derived type to hold LAMMPS instance
|
||||||
[ CHARACTER(len=12) :: 'liblammps', '-log', 'none' ]
|
CHARACTER(LEN=12), PARAMETER :: args(3) = &
|
||||||
|
[ CHARACTER(LEN=12) :: 'liblammps', '-log', 'none' ]
|
||||||
|
|
||||||
! create a LAMMPS instance (and initialize MPI)
|
! create a LAMMPS instance (and initialize MPI)
|
||||||
lmp = lammps(args)
|
lmp = lammps(args)
|
||||||
! get and print numerical version code
|
! get and print numerical version code
|
||||||
PRINT*, 'LAMMPS Version: ', lmp%version()
|
PRINT*, 'LAMMPS Version: ', lmp%version()
|
||||||
! delete LAMMPS instance (and shuts down MPI)
|
! delete LAMMPS instance (and shutdown MPI)
|
||||||
CALL lmp%close(.true.)
|
CALL lmp%close(.TRUE.)
|
||||||
|
|
||||||
END PROGRAM testlib
|
END PROGRAM testlib
|
||||||
|
|
||||||
|
It is also possible to pass command line flags from Fortran to C/C++ and
|
||||||
|
thus make the resulting executable behave similarly to the standalone
|
||||||
|
executable (it will ignore the `-in/-i` flag, though). This allows
|
||||||
|
using the command line to configure accelerator and suffix settings,
|
||||||
|
configure screen and logfile output, or to set index style variables
|
||||||
|
from the command line and more. Here is a correspondingly adapted
|
||||||
|
version of the previous example:
|
||||||
|
|
||||||
|
.. code-block:: fortran
|
||||||
|
|
||||||
|
PROGRAM testlib2
|
||||||
|
USE LIBLAMMPS ! include the LAMMPS library interface
|
||||||
|
IMPLICIT NONE
|
||||||
|
TYPE(lammps) :: lmp ! derived type to hold LAMMPS instance
|
||||||
|
CHARACTER(LEN=128), ALLOCATABLE :: command_args(:)
|
||||||
|
INTEGER :: i, argc
|
||||||
|
|
||||||
|
! copy command line flags to `command_args()`
|
||||||
|
argc = COMMAND_ARGUMENT_COUNT()
|
||||||
|
ALLOCATE(command_args(0:argc))
|
||||||
|
DO i=0, argc
|
||||||
|
CALL GET_COMMAND_ARGUMENT(i, command_args(i))
|
||||||
|
END DO
|
||||||
|
|
||||||
|
! create a LAMMPS instance (and initialize MPI)
|
||||||
|
lmp = lammps(command_args)
|
||||||
|
! get and print numerical version code
|
||||||
|
PRINT*, 'Program name: ', command_args(0)
|
||||||
|
PRINT*, 'LAMMPS Version: ', lmp%version()
|
||||||
|
! delete LAMMPS instance (and shuts down MPI)
|
||||||
|
CALL lmp%close(.TRUE.)
|
||||||
|
DEALLOCATE(command_args)
|
||||||
|
END PROGRAM testlib2
|
||||||
|
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
Executing LAMMPS commands
|
Executing LAMMPS commands
|
||||||
=========================
|
*************************
|
||||||
|
|
||||||
Once a LAMMPS instance is created, it is possible to "drive" the LAMMPS
|
Once a LAMMPS instance is created, it is possible to "drive" the LAMMPS
|
||||||
simulation by telling LAMMPS to read commands from a file, or pass
|
simulation by telling LAMMPS to read commands from a file or to pass
|
||||||
individual or multiple commands from strings or lists of strings. This
|
individual or multiple commands from strings or lists of strings. This
|
||||||
is done similar to how it is implemented in the `C-library
|
is done similarly to how it is implemented in the :doc:`C library
|
||||||
<pg_lib_execute>` interface. Before handing off the calls to the
|
interface <Library_execute>`. Before handing off the calls to the
|
||||||
C-library interface, the corresponding Fortran versions of the calls
|
C library interface, the corresponding Fortran versions of the calls
|
||||||
(:f:func:`file`, :f:func:`command`, :f:func:`commands_list`, and
|
(:f:func:`file`, :f:func:`command`, :f:func:`commands_list`, and
|
||||||
:f:func:`commands_string`) have to make a copy of the strings passed as
|
:f:func:`commands_string`) have to make copies of the strings passed as
|
||||||
arguments so that they can be modified to be compatible with the
|
arguments so that they can be modified to be compatible with the
|
||||||
requirements of strings in C without affecting the original strings.
|
requirements of strings in C without affecting the original strings.
|
||||||
Those copies are automatically deleted after the functions return.
|
Those copies are automatically deleted after the functions return.
|
||||||
Below is a small demonstration of the uses of the different functions:
|
Below is a small demonstration of the uses of the different functions.
|
||||||
|
|
||||||
.. code-block:: fortran
|
.. code-block:: fortran
|
||||||
|
|
||||||
PROGRAM testcmd
|
PROGRAM testcmd
|
||||||
USE LIBLAMMPS
|
USE LIBLAMMPS
|
||||||
TYPE(lammps) :: lmp
|
TYPE(lammps) :: lmp
|
||||||
CHARACTER(len=512) :: cmds
|
CHARACTER(LEN=512) :: cmds
|
||||||
CHARACTER(len=40),ALLOCATABLE :: cmdlist(:)
|
CHARACTER(LEN=40), ALLOCATABLE :: cmdlist(:)
|
||||||
CHARACTER(len=10) :: trimmed
|
CHARACTER(LEN=10) :: trimmed
|
||||||
INTEGER :: i
|
INTEGER :: i
|
||||||
|
|
||||||
lmp = lammps()
|
lmp = lammps()
|
||||||
@ -111,10 +165,10 @@ Below is a small demonstration of the uses of the different functions:
|
|||||||
CALL lmp%command('variable zpos index 1.0')
|
CALL lmp%command('variable zpos index 1.0')
|
||||||
! define 10 groups of 10 atoms each
|
! define 10 groups of 10 atoms each
|
||||||
ALLOCATE(cmdlist(10))
|
ALLOCATE(cmdlist(10))
|
||||||
DO i=1,10
|
DO i=1, 10
|
||||||
WRITE(trimmed,'(I10)') 10*i
|
WRITE(trimmed,'(I10)') 10*i
|
||||||
WRITE(cmdlist(i),'(A,I1,A,I10,A,A)') &
|
WRITE(cmdlist(i),'(A,I1,A,I10,A,A)') &
|
||||||
'group g',i-1,' id ',10*(i-1)+1,':',ADJUSTL(trimmed)
|
'group g', i-1, ' id ', 10*(i-1)+1, ':', ADJUSTL(trimmed)
|
||||||
END DO
|
END DO
|
||||||
CALL lmp%commands_list(cmdlist)
|
CALL lmp%commands_list(cmdlist)
|
||||||
! run multiple commands from multi-line string
|
! run multiple commands from multi-line string
|
||||||
@ -123,8 +177,7 @@ Below is a small demonstration of the uses of the different functions:
|
|||||||
'create_box 1 box' // NEW_LINE('A') // &
|
'create_box 1 box' // NEW_LINE('A') // &
|
||||||
'create_atoms 1 single 1.0 1.0 ${zpos}'
|
'create_atoms 1 single 1.0 1.0 ${zpos}'
|
||||||
CALL lmp%commands_string(cmds)
|
CALL lmp%commands_string(cmds)
|
||||||
CALL lmp%close()
|
CALL lmp%close(.TRUE.)
|
||||||
|
|
||||||
END PROGRAM testcmd
|
END PROGRAM testcmd
|
||||||
|
|
||||||
---------------
|
---------------
|
||||||
|
|||||||
@ -83,6 +83,7 @@ Packages howto
|
|||||||
Howto_coreshell
|
Howto_coreshell
|
||||||
Howto_drude
|
Howto_drude
|
||||||
Howto_drude2
|
Howto_drude2
|
||||||
|
Howto_peri
|
||||||
Howto_manifold
|
Howto_manifold
|
||||||
Howto_spins
|
Howto_spins
|
||||||
|
|
||||||
|
|||||||
@ -3,24 +3,20 @@ CHARMM, AMBER, COMPASS, and DREIDING force fields
|
|||||||
|
|
||||||
A force field has 2 parts: the formulas that define it and the
|
A force field has 2 parts: the formulas that define it and the
|
||||||
coefficients used for a particular system. Here we only discuss
|
coefficients used for a particular system. Here we only discuss
|
||||||
formulas implemented in LAMMPS that correspond to formulas commonly
|
formulas implemented in LAMMPS that correspond to formulas commonly used
|
||||||
used in the CHARMM, AMBER, COMPASS, and DREIDING force fields. Setting
|
in the CHARMM, AMBER, COMPASS, and DREIDING force fields. Setting
|
||||||
coefficients is done either from special sections in an input data file
|
coefficients is done either from special sections in an input data file
|
||||||
via the :doc:`read_data <read_data>` command or in the input script with
|
via the :doc:`read_data <read_data>` command or in the input script with
|
||||||
commands like :doc:`pair_coeff <pair_coeff>` or
|
commands like :doc:`pair_coeff <pair_coeff>` or :doc:`bond_coeff
|
||||||
:doc:`bond_coeff <bond_coeff>` and so on. See the :doc:`Tools <Tools>` doc
|
<bond_coeff>` and so on. See the :doc:`Tools <Tools>` doc page for
|
||||||
page for additional tools that can use CHARMM, AMBER, or Materials
|
additional tools that can use CHARMM, AMBER, or Materials Studio
|
||||||
Studio generated files to assign force field coefficients and convert
|
generated files to assign force field coefficients and convert their
|
||||||
their output into LAMMPS input.
|
output into LAMMPS input.
|
||||||
|
|
||||||
See :ref:`(MacKerell) <howto-MacKerell>` for a description of the CHARMM force
|
See :ref:`(MacKerell) <howto-MacKerell>` for a description of the CHARMM
|
||||||
field. See :ref:`(Cornell) <howto-Cornell>` for a description of the AMBER
|
force field. See :ref:`(Cornell) <howto-Cornell>` for a description of
|
||||||
force field. See :ref:`(Sun) <howto-Sun>` for a description of the COMPASS
|
the AMBER force field. See :ref:`(Sun) <howto-Sun>` for a description
|
||||||
force field.
|
of the COMPASS force field.
|
||||||
|
|
||||||
.. _charmm: http://www.scripps.edu/brooks
|
|
||||||
|
|
||||||
.. _amber: http://amber.scripps.edu
|
|
||||||
|
|
||||||
The interaction styles listed below compute force field formulas that
|
The interaction styles listed below compute force field formulas that
|
||||||
are consistent with common options in CHARMM or AMBER. See each
|
are consistent with common options in CHARMM or AMBER. See each
|
||||||
@ -41,9 +37,10 @@ command's documentation for the formula it computes.
|
|||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
For CHARMM, newer *charmmfsw* or *charmmfsh* styles were released
|
For CHARMM, newer *charmmfsw* or *charmmfsh* styles were released in
|
||||||
in March 2017. We recommend they be used instead of the older *charmm*
|
March 2017. We recommend they be used instead of the older *charmm*
|
||||||
styles. See discussion of the differences on the :doc:`pair charmm <pair_charmm>` and :doc:`dihedral charmm <dihedral_charmm>` doc
|
styles. See discussion of the differences on the :doc:`pair charmm
|
||||||
|
<pair_charmm>` and :doc:`dihedral charmm <dihedral_charmm>` doc
|
||||||
pages.
|
pages.
|
||||||
|
|
||||||
COMPASS is a general force field for atomistic simulation of common
|
COMPASS is a general force field for atomistic simulation of common
|
||||||
|
|||||||
@ -46,7 +46,7 @@ This tutorial assumes that you are operating in a command-line environment
|
|||||||
using a shell like Bash.
|
using a shell like Bash.
|
||||||
|
|
||||||
- Linux: any Terminal window will work
|
- Linux: any Terminal window will work
|
||||||
- MacOS X: launch the Terminal application.
|
- macOS: launch the Terminal application.
|
||||||
- Windows 10: install and run the :doc:`Windows Subsystem for Linux <Howto_wsl>`
|
- Windows 10: install and run the :doc:`Windows Subsystem for Linux <Howto_wsl>`
|
||||||
|
|
||||||
We also assume that you have downloaded and unpacked a recent LAMMPS source code package
|
We also assume that you have downloaded and unpacked a recent LAMMPS source code package
|
||||||
@ -56,7 +56,7 @@ 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
|
paths mentioned in the tutorial are relative to that. Immediately after downloading
|
||||||
it should look like this:
|
it should look like this:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: console
|
||||||
|
|
||||||
$ ls
|
$ ls
|
||||||
bench doc lib potentials README tools
|
bench doc lib potentials README tools
|
||||||
@ -104,7 +104,7 @@ the progress of the configuration printed to the screen followed by a
|
|||||||
summary of the enabled features, options and compiler settings. A typical
|
summary of the enabled features, options and compiler settings. A typical
|
||||||
summary screen will look like this:
|
summary screen will look like this:
|
||||||
|
|
||||||
.. code-block::
|
.. code-block:: console
|
||||||
|
|
||||||
$ cmake ../cmake/
|
$ cmake ../cmake/
|
||||||
-- The CXX compiler identification is GNU 8.2.0
|
-- The CXX compiler identification is GNU 8.2.0
|
||||||
|
|||||||
@ -10,7 +10,7 @@ changes or additions you have made to LAMMPS into the official LAMMPS
|
|||||||
distribution. It uses the process of updating this very tutorial as an
|
distribution. It uses the process of updating this very tutorial as an
|
||||||
example to describe the individual steps and options. You need to be
|
example to describe the individual steps and options. You need to be
|
||||||
familiar with git and you may want to have a look at the `git book
|
familiar with git and you may want to have a look at the `git book
|
||||||
<http://git-scm.com/book/>`_ to familiarize yourself with some of the
|
<https://git-scm.com/book/>`_ to familiarize yourself with some of the
|
||||||
more advanced git features used below.
|
more advanced git features used below.
|
||||||
|
|
||||||
As of fall 2016, submitting contributions to LAMMPS via pull requests
|
As of fall 2016, submitting contributions to LAMMPS via pull requests
|
||||||
@ -78,13 +78,13 @@ machine via HTTPS:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ git clone https://github.com/<your user name>/lammps.git <some name>
|
git clone https://github.com/<your user name>/lammps.git <some name>
|
||||||
|
|
||||||
or, if you have set up your GitHub account for using SSH keys, via SSH:
|
or, if you have set up your GitHub account for using SSH keys, via SSH:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ git clone git@github.com:<your user name>/lammps.git
|
git clone git@github.com:<your user name>/lammps.git
|
||||||
|
|
||||||
You can find the proper URL by clicking the "Clone or download"-button:
|
You can find the proper URL by clicking the "Clone or download"-button:
|
||||||
|
|
||||||
@ -103,21 +103,21 @@ and use git pull:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ cd mylammps
|
cd mylammps
|
||||||
$ git checkout develop
|
git checkout develop
|
||||||
$ git pull https://github.com/lammps/lammps develop
|
git pull https://github.com/lammps/lammps develop
|
||||||
|
|
||||||
You can also add this URL as a remote:
|
You can also add this URL as a remote:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ git remote add upstream https://www.github.com/lammps/lammps
|
git remote add upstream https://www.github.com/lammps/lammps
|
||||||
|
|
||||||
From then on you can update your upstream branches with:
|
From then on you can update your upstream branches with:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ git fetch upstream
|
git fetch upstream
|
||||||
|
|
||||||
and then refer to the upstream repository branches with
|
and then refer to the upstream repository branches with
|
||||||
`upstream/develop` or `upstream/release` and so on.
|
`upstream/develop` or `upstream/release` and so on.
|
||||||
@ -129,8 +129,8 @@ workflow that updated this tutorial, and hence we will call the branch
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ git fetch upstream
|
git fetch upstream
|
||||||
$ git checkout -b github-tutorial-update upstream/develop
|
git checkout -b github-tutorial-update upstream/develop
|
||||||
|
|
||||||
Now that we have changed branches, we can make our changes to our local
|
Now that we have changed branches, we can make our changes to our local
|
||||||
repository. Just remember that if you want to start working on another,
|
repository. Just remember that if you want to start working on another,
|
||||||
@ -150,8 +150,8 @@ After everything is done, add the files to the branch and commit them:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ git add doc/src/Howto_github.txt
|
git add doc/src/Howto_github.txt
|
||||||
$ git add doc/src/JPG/tutorial*.png
|
git add doc/src/JPG/tutorial*.png
|
||||||
|
|
||||||
.. warning::
|
.. warning::
|
||||||
|
|
||||||
@ -174,13 +174,13 @@ useful message that explains the change.
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ git commit -m 'Finally updated the GitHub tutorial'
|
git commit -m 'Finally updated the GitHub tutorial'
|
||||||
|
|
||||||
After the commit, the changes can be pushed to the same branch on GitHub:
|
After the commit, the changes can be pushed to the same branch on GitHub:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ git push
|
git push
|
||||||
|
|
||||||
Git will ask you for your user name and password on GitHub if you have
|
Git will ask you for your user name and password on GitHub if you have
|
||||||
not configured anything. If your local branch is not present on GitHub yet,
|
not configured anything. If your local branch is not present on GitHub yet,
|
||||||
@ -188,7 +188,7 @@ it will ask you to add it by running
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ git push --set-upstream origin github-tutorial-update
|
git push --set-upstream origin github-tutorial-update
|
||||||
|
|
||||||
If you correctly type your user name and
|
If you correctly type your user name and
|
||||||
password, the feature branch should be added to your fork on GitHub.
|
password, the feature branch should be added to your fork on GitHub.
|
||||||
@ -198,13 +198,13 @@ If you want to make really sure you push to the right repository
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ git push origin
|
git push origin
|
||||||
|
|
||||||
or using an explicit URL:
|
or using an explicit URL:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ git push git@github.com:Pakketeretet2/lammps.git
|
git push git@github.com:Pakketeretet2/lammps.git
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
@ -412,10 +412,10 @@ we need to pull Axel's change back into our branch, and merge them:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ git add Howto_github.txt
|
git add Howto_github.txt
|
||||||
$ git add JPG/tutorial_reverse_pull_request*.png
|
git add JPG/tutorial_reverse_pull_request*.png
|
||||||
$ git commit -m "Updated text and images on reverse pull requests"
|
git commit -m "Updated text and images on reverse pull requests"
|
||||||
$ git pull
|
git pull
|
||||||
|
|
||||||
In this case, the merge was painless because git could auto-merge:
|
In this case, the merge was painless because git could auto-merge:
|
||||||
|
|
||||||
@ -428,10 +428,10 @@ commit and push again:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ git add Howto_github.txt
|
git add Howto_github.txt
|
||||||
$ git add JPG/tutorial_reverse_pull_request6.png
|
git add JPG/tutorial_reverse_pull_request6.png
|
||||||
$ git commit -m "Merged Axel's suggestions and updated text"
|
git commit -m "Merged Axel's suggestions and updated text"
|
||||||
$ git push git@github.com:Pakketeretet2/lammps
|
git push git@github.com:Pakketeretet2/lammps
|
||||||
|
|
||||||
This merge also shows up on the lammps GitHub page:
|
This merge also shows up on the lammps GitHub page:
|
||||||
|
|
||||||
@ -456,9 +456,9 @@ branch!
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ git checkout develop
|
git checkout develop
|
||||||
$ git pull https://github.com/lammps/lammps develop
|
git pull https://github.com/lammps/lammps develop
|
||||||
$ git branch -d github-tutorial-update
|
git branch -d github-tutorial-update
|
||||||
|
|
||||||
If you do not pull first, it is not really a problem but git will warn
|
If you do not pull first, it is not really a problem but git will warn
|
||||||
you at the next statement that you are deleting a local branch that
|
you at the next statement that you are deleting a local branch that
|
||||||
@ -472,7 +472,7 @@ to your remote(s) as well:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ git push origin :github-tutorial-update
|
git push origin :github-tutorial-update
|
||||||
|
|
||||||
**Recent changes in the workflow**
|
**Recent changes in the workflow**
|
||||||
|
|
||||||
@ -486,5 +486,6 @@ simplify comparisons between releases. Finally, all patches and
|
|||||||
submissions are subject to automatic testing and code checks to make
|
submissions are subject to automatic testing and code checks to make
|
||||||
sure they at the very least compile.
|
sure they at the very least compile.
|
||||||
|
|
||||||
A discussion of the LAMMPS developer GitHub workflow can be found in the file
|
A discussion of the LAMMPS developer GitHub workflow can be found in the
|
||||||
`doc/github-development-workflow.md <https://github.com/lammps/lammps/blob/develop/doc/github-development-workflow.md>`_
|
file `doc/github-development-workflow.md
|
||||||
|
<https://github.com/lammps/lammps/blob/develop/doc/github-development-workflow.md>`_
|
||||||
|
|||||||
@ -47,4 +47,4 @@ to the relevant fixes.
|
|||||||
.. _Paquay1:
|
.. _Paquay1:
|
||||||
|
|
||||||
**(Paquay)** Paquay and Kusters, Biophys. J., 110, 6, (2016).
|
**(Paquay)** Paquay and Kusters, Biophys. J., 110, 6, (2016).
|
||||||
preprint available at `arXiv:1411.3019 <http://arxiv.org/abs/1411.3019/>`_.
|
preprint available at `arXiv:1411.3019 <https://arxiv.org/abs/1411.3019/>`_.
|
||||||
|
|||||||
@ -22,10 +22,11 @@ commands you specify.
|
|||||||
As discussed below, LAMMPS gives you a variety of ways to determine
|
As discussed below, LAMMPS gives you a variety of ways to determine
|
||||||
what quantities are computed and printed when the thermodynamics,
|
what quantities are computed and printed when the thermodynamics,
|
||||||
dump, or fix commands listed above perform output. Throughout this
|
dump, or fix commands listed above perform output. Throughout this
|
||||||
discussion, note that users can also :doc:`add their own computes and fixes to LAMMPS <Modify>` which can then generate values that can then be
|
discussion, note that users can also :doc:`add their own computes and
|
||||||
output with these commands.
|
fixes to LAMMPS <Modify>` which can then generate values that can then
|
||||||
|
be output with these commands.
|
||||||
|
|
||||||
The following sub-sections discuss different LAMMPS command related
|
The following sub-sections discuss different LAMMPS commands related
|
||||||
to output and the kind of data they operate on and produce:
|
to output and the kind of data they operate on and produce:
|
||||||
|
|
||||||
* :ref:`Global/per-atom/local data <global>`
|
* :ref:`Global/per-atom/local data <global>`
|
||||||
@ -94,11 +95,11 @@ script references the data determines which style is meant. Example: if
|
|||||||
a compute provides both a global scalar and a per-atom vector, the
|
a compute provides both a global scalar and a per-atom vector, the
|
||||||
former will be accessed by using ``c_ID`` in an equal-style variable,
|
former will be accessed by using ``c_ID`` in an equal-style variable,
|
||||||
while the latter will be accessed by using ``c_ID`` in an atom-style
|
while the latter will be accessed by using ``c_ID`` in an atom-style
|
||||||
variable. Note that atom-style variable formulas can also access global
|
variable. Note that atom-style variable formulas can also access
|
||||||
scalars, but in this case it is not possible to do directly because of
|
global scalars, but in this case it is not possible to do this
|
||||||
the ambiguity. Instead, an equal-style variable can be defined which
|
directly because of the ambiguity. Instead, an equal-style variable
|
||||||
accesses the global scalar, and that variable used in the atom-style
|
can be defined which accesses the global scalar, and that variable can
|
||||||
variable formula in place of ``c_ID``.
|
be used in the atom-style variable formula in place of ``c_ID``.
|
||||||
|
|
||||||
.. _thermo:
|
.. _thermo:
|
||||||
|
|
||||||
@ -141,9 +142,10 @@ There is also a :doc:`dump custom <dump>` format where the user
|
|||||||
specifies what values are output with each atom. Pre-defined atom
|
specifies what values are output with each atom. Pre-defined atom
|
||||||
attributes can be specified (id, x, fx, etc). Three additional kinds
|
attributes can be specified (id, x, fx, etc). Three additional kinds
|
||||||
of keywords can also be specified (c_ID, f_ID, v_name), where a
|
of keywords can also be specified (c_ID, f_ID, v_name), where a
|
||||||
:doc:`compute <compute>` or :doc:`fix <fix>` or :doc:`variable <variable>`
|
:doc:`compute <compute>` or :doc:`fix <fix>` or :doc:`variable
|
||||||
provides the values to be output. In each case, the compute, fix, or
|
<variable>` provides the values to be output. In each case, the
|
||||||
variable must generate per-atom values for input to the :doc:`dump custom <dump>` command.
|
compute, fix, or variable must generate per-atom values for input to
|
||||||
|
the :doc:`dump custom <dump>` command.
|
||||||
|
|
||||||
There is also a :doc:`dump local <dump>` format where the user specifies
|
There is also a :doc:`dump local <dump>` format where the user specifies
|
||||||
what local values to output. A pre-defined index keyword can be
|
what local values to output. A pre-defined index keyword can be
|
||||||
@ -160,12 +162,13 @@ Fixes that write output files
|
|||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
Several fixes take various quantities as input and can write output
|
Several fixes take various quantities as input and can write output
|
||||||
files: :doc:`fix ave/time <fix_ave_time>`, :doc:`fix ave/chunk <fix_ave_chunk>`, :doc:`fix ave/histo <fix_ave_histo>`,
|
files: :doc:`fix ave/time <fix_ave_time>`, :doc:`fix ave/chunk
|
||||||
:doc:`fix ave/correlate <fix_ave_correlate>`, and :doc:`fix print <fix_print>`.
|
<fix_ave_chunk>`, :doc:`fix ave/histo <fix_ave_histo>`, :doc:`fix
|
||||||
|
ave/correlate <fix_ave_correlate>`, and :doc:`fix print <fix_print>`.
|
||||||
|
|
||||||
The :doc:`fix ave/time <fix_ave_time>` command enables direct output to
|
The :doc:`fix ave/time <fix_ave_time>` command enables direct output
|
||||||
a file and/or time-averaging of global scalars or vectors. The user
|
to a file and/or time-averaging of global scalars or vectors. The
|
||||||
specifies one or more quantities as input. These can be global
|
user specifies one or more quantities as input. These can be global
|
||||||
:doc:`compute <compute>` values, global :doc:`fix <fix>` values, or
|
:doc:`compute <compute>` values, global :doc:`fix <fix>` values, or
|
||||||
:doc:`variables <variable>` of any style except the atom style which
|
:doc:`variables <variable>` of any style except the atom style which
|
||||||
produces per-atom values. Since a variable can refer to keywords used
|
produces per-atom values. Since a variable can refer to keywords used
|
||||||
@ -184,8 +187,8 @@ atoms, e.g. individual molecules. The per-atom quantities can be atom
|
|||||||
density (mass or number) or atom attributes such as position,
|
density (mass or number) or atom attributes such as position,
|
||||||
velocity, force. They can also be per-atom quantities calculated by a
|
velocity, force. They can also be per-atom quantities calculated by a
|
||||||
:doc:`compute <compute>`, by a :doc:`fix <fix>`, or by an atom-style
|
:doc:`compute <compute>`, by a :doc:`fix <fix>`, or by an atom-style
|
||||||
:doc:`variable <variable>`. The chunk-averaged output of this fix can
|
:doc:`variable <variable>`. The chunk-averaged output of this fix is
|
||||||
also be used as input to other output commands.
|
global and can also be used as input to other output commands.
|
||||||
|
|
||||||
The :doc:`fix ave/histo <fix_ave_histo>` command enables direct output
|
The :doc:`fix ave/histo <fix_ave_histo>` command enables direct output
|
||||||
to a file of histogrammed quantities, which can be global or per-atom
|
to a file of histogrammed quantities, which can be global or per-atom
|
||||||
@ -202,32 +205,35 @@ written to the screen and log file or to a separate file, periodically
|
|||||||
during a running simulation. The line can contain one or more
|
during a running simulation. The line can contain one or more
|
||||||
:doc:`variable <variable>` values for any style variable except the
|
:doc:`variable <variable>` values for any style variable except the
|
||||||
vector or atom styles). As explained above, variables themselves can
|
vector or atom styles). As explained above, variables themselves can
|
||||||
contain references to global values generated by :doc:`thermodynamic keywords <thermo_style>`, :doc:`computes <compute>`,
|
contain references to global values generated by :doc:`thermodynamic
|
||||||
:doc:`fixes <fix>`, or other :doc:`variables <variable>`, or to per-atom
|
keywords <thermo_style>`, :doc:`computes <compute>`, :doc:`fixes
|
||||||
values for a specific atom. Thus the :doc:`fix print <fix_print>`
|
<fix>`, or other :doc:`variables <variable>`, or to per-atom values
|
||||||
command is a means to output a wide variety of quantities separate
|
for a specific atom. Thus the :doc:`fix print <fix_print>` command is
|
||||||
from normal thermodynamic or dump file output.
|
a means to output a wide variety of quantities separate from normal
|
||||||
|
thermodynamic or dump file output.
|
||||||
|
|
||||||
.. _computeoutput:
|
.. _computeoutput:
|
||||||
|
|
||||||
Computes that process output quantities
|
Computes that process output quantities
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
The :doc:`compute reduce <compute_reduce>` and :doc:`compute reduce/region <compute_reduce>` commands take one or more per-atom
|
The :doc:`compute reduce <compute_reduce>` and :doc:`compute
|
||||||
or local vector quantities as inputs and "reduce" them (sum, min, max,
|
reduce/region <compute_reduce>` commands take one or more per-atom or
|
||||||
|
local vector quantities as inputs and "reduce" them (sum, min, max,
|
||||||
ave) to scalar quantities. These are produced as output values which
|
ave) to scalar quantities. These are produced as output values which
|
||||||
can be used as input to other output commands.
|
can be used as input to other output commands.
|
||||||
|
|
||||||
The :doc:`compute slice <compute_slice>` command take one or more global
|
The :doc:`compute slice <compute_slice>` command take one or more
|
||||||
vector or array quantities as inputs and extracts a subset of their
|
global vector or array quantities as inputs and extracts a subset of
|
||||||
values to create a new vector or array. These are produced as output
|
their values to create a new vector or array. These are produced as
|
||||||
values which can be used as input to other output commands.
|
output values which can be used as input to other output commands.
|
||||||
|
|
||||||
The :doc:`compute property/atom <compute_property_atom>` command takes a
|
The :doc:`compute property/atom <compute_property_atom>` command takes
|
||||||
list of one or more pre-defined atom attributes (id, x, fx, etc) and
|
a list of one or more pre-defined atom attributes (id, x, fx, etc) and
|
||||||
stores the values in a per-atom vector or array. These are produced
|
stores the values in a per-atom vector or array. These are produced
|
||||||
as output values which can be used as input to other output commands.
|
as output values which can be used as input to other output commands.
|
||||||
The list of atom attributes is the same as for the :doc:`dump custom <dump>` command.
|
The list of atom attributes is the same as for the :doc:`dump custom
|
||||||
|
<dump>` command.
|
||||||
|
|
||||||
The :doc:`compute property/local <compute_property_local>` command takes
|
The :doc:`compute property/local <compute_property_local>` command takes
|
||||||
a list of one or more pre-defined local attributes (bond info, angle
|
a list of one or more pre-defined local attributes (bond info, angle
|
||||||
|
|||||||
1078
doc/src/Howto_peri.rst
Normal file
1078
doc/src/Howto_peri.rst
Normal file
File diff suppressed because it is too large
Load Diff
@ -152,14 +152,14 @@ Creating a new instance of PyLammps
|
|||||||
To create a PyLammps object you need to first import the class from the lammps
|
To create a PyLammps object you need to first import the class from the lammps
|
||||||
module. By using the default constructor, a new *lammps* instance is created.
|
module. By using the default constructor, a new *lammps* instance is created.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
from lammps import PyLammps
|
from lammps import PyLammps
|
||||||
L = PyLammps()
|
L = PyLammps()
|
||||||
|
|
||||||
You can also initialize PyLammps on top of this existing *lammps* object:
|
You can also initialize PyLammps on top of this existing *lammps* object:
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
from lammps import lammps, PyLammps
|
from lammps import lammps, PyLammps
|
||||||
lmp = lammps()
|
lmp = lammps()
|
||||||
@ -180,14 +180,14 @@ For instance, let's take the following LAMMPS command:
|
|||||||
In the original interface this command can be executed with the following
|
In the original interface this command can be executed with the following
|
||||||
Python code if *L* was a lammps instance:
|
Python code if *L* was a lammps instance:
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
L.command("region box block 0 10 0 5 -0.5 0.5")
|
L.command("region box block 0 10 0 5 -0.5 0.5")
|
||||||
|
|
||||||
With the PyLammps interface, any command can be split up into arbitrary parts
|
With the PyLammps interface, any command can be split up into arbitrary parts
|
||||||
separated by white-space, passed as individual arguments to a region method.
|
separated by white-space, passed as individual arguments to a region method.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
L.region("box block", 0, 10, 0, 5, -0.5, 0.5)
|
L.region("box block", 0, 10, 0, 5, -0.5, 0.5)
|
||||||
|
|
||||||
@ -199,14 +199,14 @@ The benefit of this approach is avoiding redundant command calls and easier
|
|||||||
parameterization. In the original interface parameterization needed to be done
|
parameterization. In the original interface parameterization needed to be done
|
||||||
manually by creating formatted strings.
|
manually by creating formatted strings.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
L.command("region box block %f %f %f %f %f %f" % (xlo, xhi, ylo, yhi, zlo, zhi))
|
L.command("region box block %f %f %f %f %f %f" % (xlo, xhi, ylo, yhi, zlo, zhi))
|
||||||
|
|
||||||
In contrast, methods of PyLammps accept parameters directly and will convert
|
In contrast, methods of PyLammps accept parameters directly and will convert
|
||||||
them automatically to a final command string.
|
them automatically to a final command string.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
L.region("box block", xlo, xhi, ylo, yhi, zlo, zhi)
|
L.region("box block", xlo, xhi, ylo, yhi, zlo, zhi)
|
||||||
|
|
||||||
@ -256,7 +256,7 @@ LAMMPS variables can be both defined and accessed via the PyLammps interface.
|
|||||||
|
|
||||||
To define a variable you can use the :doc:`variable <variable>` command:
|
To define a variable you can use the :doc:`variable <variable>` command:
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
L.variable("a index 2")
|
L.variable("a index 2")
|
||||||
|
|
||||||
@ -265,14 +265,14 @@ A dictionary of all variables is returned by L.variables
|
|||||||
you can access an individual variable by retrieving a variable object from the
|
you can access an individual variable by retrieving a variable object from the
|
||||||
L.variables dictionary by name
|
L.variables dictionary by name
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
a = L.variables['a']
|
a = L.variables['a']
|
||||||
|
|
||||||
The variable value can then be easily read and written by accessing the value
|
The variable value can then be easily read and written by accessing the value
|
||||||
property of this object.
|
property of this object.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
print(a.value)
|
print(a.value)
|
||||||
a.value = 4
|
a.value = 4
|
||||||
@ -284,7 +284,7 @@ LAMMPS expressions can be immediately evaluated by using the eval method. The
|
|||||||
passed string parameter can be any expression containing global thermo values,
|
passed string parameter can be any expression containing global thermo values,
|
||||||
variables, compute or fix data.
|
variables, compute or fix data.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
result = L.eval("ke") # kinetic energy
|
result = L.eval("ke") # kinetic energy
|
||||||
result = L.eval("pe") # potential energy
|
result = L.eval("pe") # potential energy
|
||||||
@ -298,7 +298,7 @@ All atoms in the current simulation can be accessed by using the L.atoms list.
|
|||||||
Each element of this list is an object which exposes its properties (id, type,
|
Each element of this list is an object which exposes its properties (id, type,
|
||||||
position, velocity, force, etc.).
|
position, velocity, force, etc.).
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
# access first atom
|
# access first atom
|
||||||
L.atoms[0].id
|
L.atoms[0].id
|
||||||
@ -311,7 +311,7 @@ position, velocity, force, etc.).
|
|||||||
|
|
||||||
Some properties can also be used to set:
|
Some properties can also be used to set:
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
# set position in 2D simulation
|
# set position in 2D simulation
|
||||||
L.atoms[0].position = (1.0, 0.0)
|
L.atoms[0].position = (1.0, 0.0)
|
||||||
@ -328,7 +328,7 @@ after a run via the L.runs list. This list contains a growing list of run data.
|
|||||||
The first element is the output of the first run, the second element that of
|
The first element is the output of the first run, the second element that of
|
||||||
the second run.
|
the second run.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
L.run(1000)
|
L.run(1000)
|
||||||
L.runs[0] # data of first 1000 time steps
|
L.runs[0] # data of first 1000 time steps
|
||||||
@ -339,14 +339,14 @@ the second run.
|
|||||||
Each run contains a dictionary of all trajectories. Each trajectory is
|
Each run contains a dictionary of all trajectories. Each trajectory is
|
||||||
accessible through its thermo name:
|
accessible through its thermo name:
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
L.runs[0].thermo.Step # list of time steps in first run
|
L.runs[0].thermo.Step # list of time steps in first run
|
||||||
L.runs[0].thermo.Ke # list of kinetic energy values in first run
|
L.runs[0].thermo.Ke # list of kinetic energy values in first run
|
||||||
|
|
||||||
Together with matplotlib plotting data out of LAMMPS becomes simple:
|
Together with matplotlib plotting data out of LAMMPS becomes simple:
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
import matplotlib.plot as plt
|
import matplotlib.plot as plt
|
||||||
steps = L.runs[0].thermo.Step
|
steps = L.runs[0].thermo.Step
|
||||||
@ -406,7 +406,7 @@ Four atoms are placed in the simulation and the dihedral potential is applied on
|
|||||||
them using a datafile. Then one of the atoms is rotated along the central axis by
|
them using a datafile. Then one of the atoms is rotated along the central axis by
|
||||||
setting its position from Python, which changes the dihedral angle.
|
setting its position from Python, which changes the dihedral angle.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
phi = [d \* math.pi / 180 for d in range(360)]
|
phi = [d \* math.pi / 180 for d in range(360)]
|
||||||
|
|
||||||
@ -439,7 +439,7 @@ Initially, a 2D system is created in a state with minimal energy.
|
|||||||
|
|
||||||
It is then disordered by moving each atom by a random delta.
|
It is then disordered by moving each atom by a random delta.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
random.seed(27848)
|
random.seed(27848)
|
||||||
deltaperturb = 0.2
|
deltaperturb = 0.2
|
||||||
@ -458,7 +458,7 @@ It is then disordered by moving each atom by a random delta.
|
|||||||
Finally, the Monte Carlo algorithm is implemented in Python. It continuously
|
Finally, the Monte Carlo algorithm is implemented in Python. It continuously
|
||||||
moves random atoms by a random delta and only accepts certain moves.
|
moves random atoms by a random delta and only accepts certain moves.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
estart = L.eval("pe")
|
estart = L.eval("pe")
|
||||||
elast = estart
|
elast = estart
|
||||||
@ -517,7 +517,7 @@ PyLammps can be run in parallel using mpi4py. This python package can be install
|
|||||||
The following is a short example which reads in an existing LAMMPS input file and
|
The following is a short example which reads in an existing LAMMPS input file and
|
||||||
executes it in parallel. You can find in.melt in the examples/melt folder.
|
executes it in parallel. You can find in.melt in the examples/melt folder.
|
||||||
|
|
||||||
.. code-block:: Python
|
.. code-block:: python
|
||||||
|
|
||||||
from mpi4py import MPI
|
from mpi4py import MPI
|
||||||
from lammps import PyLammps
|
from lammps import PyLammps
|
||||||
|
|||||||
@ -38,7 +38,7 @@ the partial charge assignments change:
|
|||||||
See the :ref:`(Berendsen) <howto-Berendsen>` reference for more details on both
|
See the :ref:`(Berendsen) <howto-Berendsen>` reference for more details on both
|
||||||
the SPC and SPC/E models.
|
the SPC and SPC/E models.
|
||||||
|
|
||||||
Wikipedia also has a nice article on `water models <http://en.wikipedia.org/wiki/Water_model>`_.
|
Wikipedia also has a nice article on `water models <https://en.wikipedia.org/wiki/Water_model>`_.
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|||||||
@ -30,9 +30,11 @@ can be coupled to another Langevin thermostat applied to the atoms
|
|||||||
using :doc:`fix langevin <fix_langevin>` in order to simulate
|
using :doc:`fix langevin <fix_langevin>` in order to simulate
|
||||||
thermostatted spin-lattice systems.
|
thermostatted spin-lattice systems.
|
||||||
|
|
||||||
The magnetic Gilbert damping can also be applied using :doc:`fix langevin/spin <fix_langevin_spin>`. It allows to either dissipate
|
The magnetic damping can also be applied
|
||||||
the thermal energy of the Langevin thermostat, or to perform a
|
using :doc:`fix langevin/spin <fix_langevin_spin>`.
|
||||||
relaxation of the magnetic configuration toward an equilibrium state.
|
It allows to either dissipate the thermal energy of the Langevin
|
||||||
|
thermostat, or to perform a relaxation of the magnetic configuration
|
||||||
|
toward an equilibrium state.
|
||||||
|
|
||||||
The command :doc:`fix setforce/spin <fix_setforce>` allows to set the
|
The command :doc:`fix setforce/spin <fix_setforce>` allows to set the
|
||||||
components of the magnetic precession vectors (while erasing and
|
components of the magnetic precession vectors (while erasing and
|
||||||
@ -52,9 +54,11 @@ All the computed magnetic properties can be output by two main
|
|||||||
commands. The first one is :doc:`compute spin <compute_spin>`, that
|
commands. The first one is :doc:`compute spin <compute_spin>`, that
|
||||||
enables to evaluate magnetic averaged quantities, such as the total
|
enables to evaluate magnetic averaged quantities, such as the total
|
||||||
magnetization of the system along x, y, or z, the spin temperature, or
|
magnetization of the system along x, y, or z, the spin temperature, or
|
||||||
the magnetic energy. The second command is :doc:`compute property/atom <compute_property_atom>`. It enables to output all the
|
the magnetic energy. The second command
|
||||||
per atom magnetic quantities. Typically, the orientation of a given
|
is :doc:`compute property/atom <compute_property_atom>`.
|
||||||
magnetic spin, or the magnetic force acting on this spin.
|
It enables to output all the per atom magnetic quantities. Typically,
|
||||||
|
the orientation of a given magnetic spin, or the magnetic force
|
||||||
|
acting on this spin.
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|||||||
@ -43,7 +43,7 @@ JSON
|
|||||||
"ke": $(ke)
|
"ke": $(ke)
|
||||||
}""" file current_state.json screen no
|
}""" file current_state.json screen no
|
||||||
|
|
||||||
.. code-block:: JSON
|
.. code-block:: json
|
||||||
:caption: current_state.json
|
:caption: current_state.json
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
@ -49,7 +49,7 @@ details:
|
|||||||
| :math:`\theta` of HOH angle = 104.52\ :math:`^{\circ}`
|
| :math:`\theta` of HOH angle = 104.52\ :math:`^{\circ}`
|
||||||
|
|
|
|
||||||
|
|
||||||
Wikipedia also has a nice article on `water models <http://en.wikipedia.org/wiki/Water_model>`_.
|
Wikipedia also has a nice article on `water models <https://en.wikipedia.org/wiki/Water_model>`_.
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|||||||
@ -8,18 +8,28 @@ This site M is located at a fixed distance away from the oxygen along
|
|||||||
the bisector of the HOH bond angle. A bond style of *harmonic* and an
|
the bisector of the HOH bond angle. A bond style of *harmonic* and an
|
||||||
angle style of *harmonic* or *charmm* should also be used.
|
angle style of *harmonic* or *charmm* should also be used.
|
||||||
|
|
||||||
A TIP4P model is run with LAMMPS using either this command
|
A TIP4P model is run with LAMMPS using either these commands
|
||||||
for a cutoff model:
|
for a cutoff model:
|
||||||
|
|
||||||
|
* :doc:`pair_style tip4p/cut <pair_lj_cut_tip4p>`
|
||||||
* :doc:`pair_style lj/cut/tip4p/cut <pair_lj_cut_tip4p>`
|
* :doc:`pair_style lj/cut/tip4p/cut <pair_lj_cut_tip4p>`
|
||||||
|
|
||||||
or these two commands for a long-range model:
|
or these commands for a long-range model:
|
||||||
|
|
||||||
|
* :doc:`pair_style tip4p/long <pair_coul>`
|
||||||
* :doc:`pair_style lj/cut/tip4p/long <pair_lj_cut_tip4p>`
|
* :doc:`pair_style lj/cut/tip4p/long <pair_lj_cut_tip4p>`
|
||||||
|
* :doc:`pair_style lj/long/tip4p/long <pair_lj_long>`
|
||||||
|
* :doc:`pair_style tip4p/long/soft <pair_fep_soft>`
|
||||||
|
* :doc:`pair_style lj/cut/tip4p/long/soft <pair_fep_soft>`
|
||||||
* :doc:`kspace_style pppm/tip4p <kspace_style>`
|
* :doc:`kspace_style pppm/tip4p <kspace_style>`
|
||||||
|
* :doc:`kspace_style pppm/disp/tip4p <kspace_style>`
|
||||||
|
|
||||||
For both models, the bond lengths and bond angles should be held fixed
|
The bond lengths and bond angles should be held fixed using the
|
||||||
using the :doc:`fix shake <fix_shake>` command.
|
:doc:`fix shake <fix_shake>` or :doc:`fix rattle <fix_shake>` command,
|
||||||
|
unless a parameterization for a flexible TIP4P model is used. The
|
||||||
|
parameter sets listed below are all for rigid TIP4P model variants and
|
||||||
|
thus the bond and angle force constants are not used and can be set to
|
||||||
|
any legal value; only equilibrium length and angle are used.
|
||||||
|
|
||||||
These are the additional parameters (in real units) to set for O and H
|
These are the additional parameters (in real units) to set for O and H
|
||||||
atoms and the water molecule to run a rigid TIP4P model with a cutoff
|
atoms and the water molecule to run a rigid TIP4P model with a cutoff
|
||||||
@ -87,17 +97,18 @@ solver (e.g. Ewald or PPPM in LAMMPS):
|
|||||||
| LJ :math:`\epsilon`, :math:`\sigma` of OH, HH = 0.0
|
| LJ :math:`\epsilon`, :math:`\sigma` of OH, HH = 0.0
|
||||||
|
|
|
|
||||||
|
|
||||||
Note that the when using the TIP4P pair style, the neighbor list
|
Note that the when using the TIP4P pair style, the neighbor list cutoff
|
||||||
cutoff for Coulomb interactions is effectively extended by a distance
|
for Coulomb interactions is effectively extended by a distance 2 \* (OM
|
||||||
2 \* (OM distance), to account for the offset distance of the
|
distance), to account for the offset distance of the fictitious charges
|
||||||
fictitious charges on O atoms in water molecules. Thus it is
|
on O atoms in water molecules. Thus it is typically best in an
|
||||||
typically best in an efficiency sense to use a LJ cutoff >= Coulomb
|
efficiency sense to use a LJ cutoff >= Coulomb cutoff + 2\*(OM
|
||||||
cutoff + 2\*(OM distance), to shrink the size of the neighbor list.
|
distance), to shrink the size of the neighbor list. This leads to
|
||||||
This leads to slightly larger cost for the long-range calculation, so
|
slightly larger cost for the long-range calculation, so you can test the
|
||||||
you can test the trade-off for your model. The OM distance and the LJ
|
trade-off for your model. The OM distance and the LJ and Coulombic
|
||||||
and Coulombic cutoffs are set in the :doc:`pair_style lj/cut/tip4p/long <pair_lj_cut_tip4p>` command.
|
cutoffs are set in the :doc:`pair_style lj/cut/tip4p/long
|
||||||
|
<pair_lj_cut_tip4p>` command.
|
||||||
|
|
||||||
Wikipedia also has a nice article on `water models <http://en.wikipedia.org/wiki/Water_model>`_.
|
Wikipedia also has a nice article on `water models <https://en.wikipedia.org/wiki/Water_model>`_.
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|||||||
@ -68,7 +68,8 @@ liquid Ar via the GK formalism:
|
|||||||
# Sample LAMMPS input script for viscosity of liquid Ar
|
# Sample LAMMPS input script for viscosity of liquid Ar
|
||||||
|
|
||||||
units real
|
units real
|
||||||
variable T equal 86.4956
|
variable T equal 200.0 # run temperature
|
||||||
|
variable Tinit equal 250.0 # equilibration temperature
|
||||||
variable V equal vol
|
variable V equal vol
|
||||||
variable dt equal 4.0
|
variable dt equal 4.0
|
||||||
variable p equal 400 # correlation length
|
variable p equal 400 # correlation length
|
||||||
@ -99,12 +100,14 @@ liquid Ar via the GK formalism:
|
|||||||
|
|
||||||
# equilibration and thermalization
|
# equilibration and thermalization
|
||||||
|
|
||||||
velocity all create $T 102486 mom yes rot yes dist gaussian
|
velocity all create ${Tinit} 102486 mom yes rot yes dist gaussian
|
||||||
fix NVT all nvt temp $T $T 10 drag 0.2
|
fix NVT all nvt temp ${Tinit} ${Tinit} 10 drag 0.2
|
||||||
run 8000
|
run 8000
|
||||||
|
|
||||||
# viscosity calculation, switch to NVE if desired
|
# viscosity calculation, switch to NVE if desired
|
||||||
|
|
||||||
|
velocity all create $T 102486 mom yes rot yes dist gaussian
|
||||||
|
fix NVT all nvt temp $T $T 10 drag 0.2
|
||||||
#unfix NVT
|
#unfix NVT
|
||||||
#fix NVE all nve
|
#fix NVE all nve
|
||||||
|
|
||||||
@ -122,7 +125,7 @@ liquid Ar via the GK formalism:
|
|||||||
run 100000
|
run 100000
|
||||||
variable v equal (v_v11+v_v22+v_v33)/3.0
|
variable v equal (v_v11+v_v22+v_v33)/3.0
|
||||||
variable ndens equal count(all)/vol
|
variable ndens equal count(all)/vol
|
||||||
print "average viscosity: $v [Pa.s] @ $T K, ${ndens} /A^3"
|
print "average viscosity: $v [Pa.s] @ $T K, ${ndens} atoms/A^3"
|
||||||
|
|
||||||
The fifth method is related to the above Green-Kubo method,
|
The fifth method is related to the above Green-Kubo method,
|
||||||
but uses the Einstein formulation, analogous to the Einstein
|
but uses the Einstein formulation, analogous to the Einstein
|
||||||
@ -131,9 +134,9 @@ time-integrated momentum fluxes play the role of Cartesian
|
|||||||
coordinates, whose mean-square displacement increases linearly
|
coordinates, whose mean-square displacement increases linearly
|
||||||
with time at sufficiently long times.
|
with time at sufficiently long times.
|
||||||
|
|
||||||
The sixth is periodic perturbation method. It is also a non-equilibrium MD method.
|
The sixth is the periodic perturbation method, which is also a non-equilibrium MD method.
|
||||||
However, instead of measure the momentum flux in response of applied velocity gradient,
|
However, instead of measuring the momentum flux in response to an applied velocity gradient,
|
||||||
it measures the velocity profile in response of applied stress.
|
it measures the velocity profile in response to applied stress.
|
||||||
A cosine-shaped periodic acceleration is added to the system via the
|
A cosine-shaped periodic acceleration is added to the system via the
|
||||||
:doc:`fix accelerate/cos <fix_accelerate_cos>` command,
|
:doc:`fix accelerate/cos <fix_accelerate_cos>` command,
|
||||||
and the :doc:`compute viscosity/cos<compute_viscosity_cos>` command is used to monitor the
|
and the :doc:`compute viscosity/cos<compute_viscosity_cos>` command is used to monitor the
|
||||||
|
|||||||
@ -17,9 +17,10 @@ formats. See the :doc:`Tools <Tools>` page for details.
|
|||||||
|
|
||||||
A Python-based toolkit distributed by our group can read native LAMMPS
|
A Python-based toolkit distributed by our group can read native LAMMPS
|
||||||
dump files, including custom dump files with additional columns of
|
dump files, including custom dump files with additional columns of
|
||||||
user-specified atom information, and convert them to various formats
|
user-specified atom information, and convert them to various formats or
|
||||||
or pipe them into visualization software directly. See the `Pizza.py WWW site <pizza_>`_ for details. Specifically, Pizza.py can convert
|
pipe them into visualization software directly. See the `Pizza.py WWW
|
||||||
LAMMPS dump files into PDB, XYZ, `EnSight <ensight_>`_, and VTK formats.
|
site <pizza_>`_ for details. Specifically, Pizza.py can convert LAMMPS
|
||||||
|
dump files into PDB, XYZ, `EnSight <ensight_>`_, and VTK formats.
|
||||||
Pizza.py can pipe LAMMPS dump files directly into the Raster3d and
|
Pizza.py can pipe LAMMPS dump files directly into the Raster3d and
|
||||||
RasMol visualization programs. Pizza.py has tools that do interactive
|
RasMol visualization programs. Pizza.py has tools that do interactive
|
||||||
3d OpenGL visualization and one that creates SVG images of dump file
|
3d OpenGL visualization and one that creates SVG images of dump file
|
||||||
|
|||||||
@ -3,10 +3,20 @@ Install LAMMPS
|
|||||||
|
|
||||||
You can download LAMMPS as an executable or as source code.
|
You can download LAMMPS as an executable or as source code.
|
||||||
|
|
||||||
With source code, you also have to :doc:`build LAMMPS <Build>`. But you
|
When downloading the LAMMPS source code, you also have to :doc:`build
|
||||||
have more flexibility as to what features to include or exclude in the
|
LAMMPS <Build>`. But you have more flexibility as to what features to
|
||||||
build. If you plan to :doc:`modify or extend LAMMPS <Modify>`, then you
|
include or exclude in the build. When you download and install
|
||||||
need the source code.
|
pre-compiled LAMMPS executables, you are limited to install which
|
||||||
|
version of LAMMPS is available and which features are included of these
|
||||||
|
builds. If you plan to :doc:`modify or extend LAMMPS <Modify>`, then
|
||||||
|
you **must** build LAMMPS from the source code.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
If you have questions about the pre-compiled LAMMPS executables, you
|
||||||
|
need to contact the people preparing those executables. The LAMMPS
|
||||||
|
developers have no control over their choices of how they configure
|
||||||
|
and build their packages and when they update them.
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
|
|||||||
@ -1,24 +1,25 @@
|
|||||||
Download an executable for Linux or Mac via Conda
|
Download an executable for Linux or Mac via Conda
|
||||||
-------------------------------------------------
|
-------------------------------------------------
|
||||||
|
|
||||||
Binaries are available for MacOS or Linux via `Conda <conda_>`_.
|
Pre-compiled LAMMPS binaries are available for macOS or Linux via the
|
||||||
|
`Conda <conda_>`_ package management system.
|
||||||
|
|
||||||
First, one must setup the Conda package manager on your system. Follow the
|
First, one must setup the Conda package manager on your system. Follow the
|
||||||
instructions to install `Miniconda <mini_conda_install_>`_, then create a conda
|
instructions to install `Miniconda <mini_conda_install_>`_, then create a conda
|
||||||
environment (named `my-lammps-env` or whatever you prefer) for your lammps
|
environment (named `my-lammps-env` or whatever you prefer) for your LAMMPS
|
||||||
install:
|
install:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
% conda config --add channels conda-forge
|
conda config --add channels conda-forge
|
||||||
% conda create -n my-lammps-env
|
conda create -n my-lammps-env
|
||||||
|
|
||||||
Then, you can install lammps on your system with the following command:
|
Then, you can install LAMMPS on your system with the following command:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
% conda activate my-lammps-env
|
conda activate my-lammps-env
|
||||||
% conda install lammps
|
conda install lammps
|
||||||
|
|
||||||
The LAMMPS binary is built with the :ref:`KIM package <kim>` which
|
The LAMMPS binary is built with the :ref:`KIM package <kim>` which
|
||||||
results in Conda also installing the `kim-api` binaries when LAMMPS is
|
results in Conda also installing the `kim-api` binaries when LAMMPS is
|
||||||
@ -27,7 +28,7 @@ install the `openkim-models` package
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
% conda install openkim-models
|
conda install openkim-models
|
||||||
|
|
||||||
If you have problems with the installation you can post issues to
|
If you have problems with the installation you can post issues to
|
||||||
`this link <conda_forge_lammps_>`_.
|
`this link <conda_forge_lammps_>`_.
|
||||||
@ -38,3 +39,10 @@ up the Conda capability.
|
|||||||
.. _openkim: https://openkim.org
|
.. _openkim: https://openkim.org
|
||||||
.. _conda: https://docs.conda.io/en/latest/index.html
|
.. _conda: https://docs.conda.io/en/latest/index.html
|
||||||
.. _mini_conda_install: https://docs.conda.io/en/latest/miniconda.html
|
.. _mini_conda_install: https://docs.conda.io/en/latest/miniconda.html
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
If you have questions about these pre-compiled LAMMPS executables,
|
||||||
|
you need to contact the people preparing those packages. The LAMMPS
|
||||||
|
developers have no control over their choices of how they configure
|
||||||
|
and build their packages and when they update them.
|
||||||
|
|||||||
@ -41,7 +41,7 @@ create a local copy of the LAMMPS repository with a command like:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ git clone -b release https://github.com/lammps/lammps.git mylammps
|
git clone -b release https://github.com/lammps/lammps.git mylammps
|
||||||
|
|
||||||
where "mylammps" is the name of the directory you wish to create on
|
where "mylammps" is the name of the directory you wish to create on
|
||||||
your machine and "release" is one of the 3 branches listed above.
|
your machine and "release" is one of the 3 branches listed above.
|
||||||
@ -78,10 +78,10 @@ from within the "mylammps" directory:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ git checkout release # not needed if you always stay in this branch
|
git checkout release # not needed if you always stay in this branch
|
||||||
$ git checkout stable # use one of these 3 checkout commands
|
git checkout stable # use one of these 3 checkout commands
|
||||||
$ git checkout develop # to choose the branch to follow
|
git checkout develop # to choose the branch to follow
|
||||||
$ git pull
|
git pull
|
||||||
|
|
||||||
Doing a "pull" will not change any files you have added to the LAMMPS
|
Doing a "pull" will not change any files you have added to the LAMMPS
|
||||||
directory structure. It will also not change any existing LAMMPS
|
directory structure. It will also not change any existing LAMMPS
|
||||||
@ -97,7 +97,7 @@ this is as follows.
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ git checkout tagID
|
git checkout tagID
|
||||||
|
|
||||||
Stable versions and what tagID to use for a particular stable version
|
Stable versions and what tagID to use for a particular stable version
|
||||||
are discussed on `this page <https://www.lammps.org/bug.html#version>`_.
|
are discussed on `this page <https://www.lammps.org/bug.html#version>`_.
|
||||||
@ -138,13 +138,13 @@ changed. How to do this depends on the build system you are using.
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make purge # remove any deprecated src files
|
make purge # remove any deprecated src files
|
||||||
$ make package-update # sync package files with src files
|
make package-update # sync package files with src files
|
||||||
$ make foo # re-build for your machine (mpi, serial, etc)
|
make foo # re-build for your machine (mpi, serial, etc)
|
||||||
|
|
||||||
to enforce consistency of the source between the src folder
|
to enforce consistency of the source between the src folder
|
||||||
and package directories. This is OK to do even if you don't
|
and package directories. This is OK to do even if you don't
|
||||||
use any packages. The "make purge" command removes any deprecated
|
use any packages. The ``make purge`` command removes any deprecated
|
||||||
src files if they were removed by the patch from a package
|
src files if they were removed by the patch from a package
|
||||||
sub-directory.
|
sub-directory.
|
||||||
|
|
||||||
@ -160,9 +160,9 @@ changed. How to do this depends on the build system you are using.
|
|||||||
:class: note
|
:class: note
|
||||||
|
|
||||||
The servers at github.com support the "https://" access protocol for
|
The servers at github.com support the "https://" access protocol for
|
||||||
anonymous, read-only access. If you have a suitably configured GitHub
|
anonymous, read-only access. If you have a suitably configured
|
||||||
account, you may also use SSH protocol with the
|
GitHub account, you may also use SSH protocol with the URL
|
||||||
URL "git@github.com:lammps/lammps.git".
|
"git@github.com:lammps/lammps.git".
|
||||||
|
|
||||||
The LAMMPS GitHub project is currently managed by Axel Kohlmeyer
|
The LAMMPS GitHub project is currently managed by Axel Kohlmeyer
|
||||||
(Temple U, akohlmey at gmail.com).
|
(Temple U, akohlmey at gmail.com).
|
||||||
|
|||||||
@ -3,13 +3,19 @@ Download an executable for Linux
|
|||||||
|
|
||||||
Binaries are available for different versions of Linux:
|
Binaries are available for different versions of Linux:
|
||||||
|
|
||||||
| :ref:`Pre-built Ubuntu Linux executables <ubuntu>`
|
- :ref:`Pre-built Ubuntu Linux executables <ubuntu>`
|
||||||
| :ref:`Pre-built Fedora Linux executables <fedora>`
|
- :ref:`Pre-built Fedora Linux executables <fedora>`
|
||||||
| :ref:`Pre-built EPEL Linux executables (RHEL, CentOS) <epel>`
|
- :ref:`Pre-built EPEL Linux executables (RHEL, CentOS) <epel>`
|
||||||
| :ref:`Pre-built OpenSuse Linux executables <opensuse>`
|
- :ref:`Pre-built OpenSuse Linux executables <opensuse>`
|
||||||
| :ref:`Gentoo Linux executable <gentoo>`
|
- :ref:`Gentoo Linux executable <gentoo>`
|
||||||
| :ref:`Arch Linux build-script <arch>`
|
- :ref:`Arch Linux build-script <arch>`
|
||||||
|
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
If you have questions about these pre-compiled LAMMPS executables,
|
||||||
|
you need to contact the people preparing those packages. The LAMMPS
|
||||||
|
developers have no control over their choices of how they configure
|
||||||
|
and build their packages and when they update them.
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
@ -18,86 +24,53 @@ Binaries are available for different versions of Linux:
|
|||||||
Pre-built Ubuntu Linux executables
|
Pre-built Ubuntu Linux executables
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
A pre-built LAMMPS executable suitable for running on the latest
|
A pre-built LAMMPS executable suitable for running on the latest Ubuntu
|
||||||
Ubuntu Linux versions, can be downloaded as a Debian package. This
|
Linux versions, can be downloaded as a Debian package. This allows you
|
||||||
allows you to install LAMMPS with a single command, and stay
|
to install LAMMPS with a single command, and stay (mostly) up-to-date
|
||||||
up-to-date with the current stable version of LAMMPS by simply updating
|
with the current stable version of LAMMPS by simply updating your
|
||||||
your operating system. Please note, that the repository below offers
|
operating system.
|
||||||
two LAMMPS packages, ``lammps-daily`` and ``lammps-stable``. The
|
|
||||||
LAMMPS developers recommend to use the ``lammps-stable`` package for
|
|
||||||
any production simulations. The ``lammps-daily`` package is built
|
|
||||||
from the LAMMPS development sources, and those versions may have known
|
|
||||||
issues and bugs when new features are added and the software has not
|
|
||||||
undergone full release testing.
|
|
||||||
|
|
||||||
To install the appropriate personal-package archives (PPAs), do the
|
|
||||||
following once:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
$ sudo add-apt-repository ppa:gladky-anton/lammps
|
|
||||||
$ sudo add-apt-repository ppa:openkim/latest
|
|
||||||
$ sudo apt-get update
|
|
||||||
|
|
||||||
To install LAMMPS do the following once:
|
To install LAMMPS do the following once:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ sudo apt-get install lammps-stable
|
sudo apt-get install lammps
|
||||||
|
|
||||||
This downloads an executable named ``lmp_stable`` to your box, which
|
This downloads an executable named ``lmp`` to your box and multiple
|
||||||
can then be used in the usual way to run input scripts:
|
packages with supporting data, examples and libraries as well as any
|
||||||
|
missing dependencies. This executable can then be used in the usual way
|
||||||
|
to run input scripts:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ lmp_stable -in in.lj
|
lmp -in in.lj
|
||||||
|
|
||||||
To update LAMMPS to the most current stable version, do the following:
|
To update LAMMPS to the latest packaged version, do the following:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ sudo apt-get update
|
sudo apt-get update
|
||||||
|
|
||||||
which will also update other packages on your system.
|
which will also update other packages on your system.
|
||||||
|
|
||||||
To get a copy of the current documentation and examples:
|
The ``lmp`` binary is built with the :ref:`KIM package <kim>` included,
|
||||||
|
which results in the above command also installing the ``kim-api``
|
||||||
|
binaries when LAMMPS is installed. In order to use potentials from
|
||||||
|
`openkim.org <openkim_>`_, you can also install the ``openkim-models``
|
||||||
|
package
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ sudo apt-get install lammps-stable-doc
|
sudo apt-get install openkim-models
|
||||||
|
|
||||||
which will download the doc files in
|
|
||||||
``/usr/share/doc/lammps-stable-doc/doc`` and example problems in
|
|
||||||
``/usr/share/doc/lammps-doc/examples``.
|
|
||||||
|
|
||||||
To get a copy of the current potentials files:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
$ sudo apt-get install lammps-stable-data
|
|
||||||
|
|
||||||
which will download the potentials files to
|
|
||||||
``/usr/share/lammps-stable/potentials``. The ``lmp_stable`` binary is
|
|
||||||
hard-coded to look for potential files in this directory (it does not
|
|
||||||
use the ``LAMMPS_POTENTIALS`` environment variable, as described
|
|
||||||
in :doc:`pair_coeff <pair_coeff>` command).
|
|
||||||
|
|
||||||
The ``lmp_stable`` binary is built with the :ref:`KIM package <kim>` which
|
|
||||||
results in the above command also installing the ``kim-api`` binaries when LAMMPS
|
|
||||||
is installed. In order to use potentials from `openkim.org <openkim_>`_, you
|
|
||||||
can install the ``openkim-models`` package
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
$ sudo apt-get install openkim-models
|
|
||||||
|
|
||||||
|
Or use the KIM-API commands to download and install individual models.
|
||||||
To un-install LAMMPS, do the following:
|
To un-install LAMMPS, do the following:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ sudo apt-get remove lammps-stable
|
sudo apt-get remove lammps
|
||||||
|
|
||||||
Please use ``lmp_stable -help`` to see which compilation options, packages,
|
Please use ``lmp -help`` to see which compilation options, packages,
|
||||||
and styles are included in the binary.
|
and styles are included in the binary.
|
||||||
|
|
||||||
Thanks to Anton Gladky (gladky.anton at gmail.com) for setting up this
|
Thanks to Anton Gladky (gladky.anton at gmail.com) for setting up this
|
||||||
@ -110,29 +83,29 @@ Ubuntu package capability.
|
|||||||
Pre-built Fedora Linux executables
|
Pre-built Fedora Linux executables
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
Pre-built LAMMPS packages for stable releases are available
|
Pre-built LAMMPS packages for stable releases are available in the
|
||||||
in the Fedora Linux distribution as of version 28. The packages
|
Fedora Linux distribution as of Fedora version 28. The packages can be
|
||||||
can be installed via the dnf package manager. There are 3 basic
|
installed via the dnf package manager. There are 3 basic varieties
|
||||||
varieties (lammps = no MPI, lammps-mpich = MPICH MPI library,
|
(lammps = no MPI, lammps-mpich = MPICH MPI library, lammps-openmpi =
|
||||||
lammps-openmpi = OpenMPI MPI library) and for each support for
|
OpenMPI MPI library) and for each support for linking to the C library
|
||||||
linking to the C library interface (lammps-devel, lammps-mpich-devel,
|
interface (lammps-devel, lammps-mpich-devel, lammps-openmpi-devel), the
|
||||||
lammps-openmpi-devel), the header for compiling programs using
|
header for compiling programs using the C library interface
|
||||||
the C library interface (lammps-headers), and the LAMMPS python
|
(lammps-headers), and the LAMMPS python module for Python 3. All
|
||||||
module for Python 3. All packages can be installed at the same
|
packages can be installed at the same time and the name of the LAMMPS
|
||||||
time and the name of the LAMMPS executable is ``lmp`` and ``lmp_openmpi``
|
executable is ``lmp`` and ``lmp_openmpi`` or ``lmp_mpich`` respectively.
|
||||||
or ``lmp_mpich`` respectively. By default, ``lmp`` will refer to the
|
By default, ``lmp`` will refer to the serial executable, unless one of
|
||||||
serial executable, unless one of the MPI environment modules is loaded
|
the MPI environment modules is loaded (``module load mpi/mpich-x86_64``
|
||||||
(``module load mpi/mpich-x86_64`` or ``module load mpi/openmpi-x86_64``).
|
or ``module load mpi/openmpi-x86_64``). Then the corresponding parallel
|
||||||
Then the corresponding parallel LAMMPS executable can be used.
|
LAMMPS executable can be used. The same mechanism applies when loading
|
||||||
The same mechanism applies when loading the LAMMPS python module.
|
the LAMMPS python module.
|
||||||
|
|
||||||
To install LAMMPS with OpenMPI and run an input ``in.lj`` with 2 CPUs do:
|
To install LAMMPS with OpenMPI and run an input ``in.lj`` with 2 CPUs do:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ dnf install lammps-openmpi
|
dnf install lammps-openmpi
|
||||||
$ module load mpi/openmpi-x86_64
|
module load mpi/openmpi-x86_64
|
||||||
$ mpirun -np 2 lmp -in in.lj
|
mpirun -np 2 lmp -in in.lj
|
||||||
|
|
||||||
The ``dnf install`` command is needed only once. In case of a new LAMMPS
|
The ``dnf install`` command is needed only once. In case of a new LAMMPS
|
||||||
stable release, ``dnf update`` will automatically update to the newer
|
stable release, ``dnf update`` will automatically update to the newer
|
||||||
@ -148,7 +121,7 @@ can install the `openkim-models` package
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ dnf install openkim-models
|
dnf install openkim-models
|
||||||
|
|
||||||
Please use ``lmp -help`` to see which compilation options, packages,
|
Please use ``lmp -help`` to see which compilation options, packages,
|
||||||
and styles are included in the binary.
|
and styles are included in the binary.
|
||||||
@ -189,14 +162,14 @@ in OpenSuse as of Leap 15.0. You can install the package with:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ zypper install lammps
|
zypper install lammps
|
||||||
|
|
||||||
This includes support for OpenMPI. The name of the LAMMPS executable
|
This includes support for OpenMPI. The name of the LAMMPS executable
|
||||||
is ``lmp``. Thus to run an input in parallel on 2 CPUs you would do:
|
is ``lmp``. Thus to run an input in parallel on 2 CPUs you would do:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ mpirun -np 2 lmp -in in.lj
|
mpirun -np 2 lmp -in in.lj
|
||||||
|
|
||||||
Please use ``lmp -help`` to see which compilation options, packages,
|
Please use ``lmp -help`` to see which compilation options, packages,
|
||||||
and styles are included in the binary.
|
and styles are included in the binary.
|
||||||
@ -208,7 +181,7 @@ can install the `openkim-models` package
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ zypper install openkim-models
|
zypper install openkim-models
|
||||||
|
|
||||||
Thanks to Christoph Junghans (LANL) for making LAMMPS available in OpenSuse.
|
Thanks to Christoph Junghans (LANL) for making LAMMPS available in OpenSuse.
|
||||||
|
|
||||||
@ -224,7 +197,7 @@ typing:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
% emerge --ask lammps
|
emerge --ask lammps
|
||||||
|
|
||||||
Note that in Gentoo the LAMMPS source is downloaded and the package is
|
Note that in Gentoo the LAMMPS source is downloaded and the package is
|
||||||
built on the your machine.
|
built on the your machine.
|
||||||
@ -233,7 +206,7 @@ Certain LAMMPS packages can be enable via USE flags, type
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
% equery uses lammps
|
equery uses lammps
|
||||||
|
|
||||||
for details.
|
for details.
|
||||||
|
|
||||||
@ -256,10 +229,10 @@ any of the above names in-place of lammps.
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ git clone https://aur.archlinux.org/lammps.git
|
git clone https://aur.archlinux.org/lammps.git
|
||||||
$ cd lammps
|
cd lammps
|
||||||
$ makepkg -s
|
makepkg -s
|
||||||
$ makepkg -i
|
makepkg -i
|
||||||
|
|
||||||
To update, you may repeat the above, or change into the cloned directory,
|
To update, you may repeat the above, or change into the cloned directory,
|
||||||
and execute the following, after which, if there are any changes, you may
|
and execute the following, after which, if there are any changes, you may
|
||||||
@ -267,9 +240,16 @@ use makepkg as above.
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ git pull
|
git pull
|
||||||
|
|
||||||
Alternatively, you may use an AUR helper to install these packages.
|
Alternatively, you may use an AUR helper to install these packages.
|
||||||
|
|
||||||
Note that the AUR provides build-scripts that download the source and
|
Note that the AUR provides build-scripts that download the source and
|
||||||
the build the package on your machine.
|
the build the package on your machine.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
It looks like the Arch Linux AUR repository build scripts for LAMMPS
|
||||||
|
have not been updated since the 29 October 2020 version. You may want
|
||||||
|
to consider installing a more current version of LAMMPS from source
|
||||||
|
directly.
|
||||||
|
|||||||
@ -12,7 +12,7 @@ the following commands:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
% brew install lammps
|
brew install lammps
|
||||||
|
|
||||||
This will install the executables "lammps_serial" and "lammps_mpi", as well as
|
This will install the executables "lammps_serial" and "lammps_mpi", as well as
|
||||||
the LAMMPS "doc", "potentials", "tools", "bench", and "examples" directories.
|
the LAMMPS "doc", "potentials", "tools", "bench", and "examples" directories.
|
||||||
@ -22,7 +22,7 @@ Lennard-Jones benchmark file:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
% brew test lammps -v
|
brew test lammps -v
|
||||||
|
|
||||||
The LAMMPS binary is built with the :ref:`KIM package <kim>` which
|
The LAMMPS binary is built with the :ref:`KIM package <kim>` which
|
||||||
results in Homebrew also installing the `kim-api` binaries when LAMMPS is
|
results in Homebrew also installing the `kim-api` binaries when LAMMPS is
|
||||||
@ -31,7 +31,7 @@ install the `openkim-models` package
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
% brew install openkim-models
|
brew install openkim-models
|
||||||
|
|
||||||
If you have problems with the installation you can post issues to
|
If you have problems with the installation you can post issues to
|
||||||
`this link <https://github.com/Homebrew/homebrew-core/issues>`_.
|
`this link <https://github.com/Homebrew/homebrew-core/issues>`_.
|
||||||
|
|||||||
@ -26,7 +26,7 @@ command:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ tar -xzvf lammps*.tar.gz
|
tar -xzvf lammps*.tar.gz
|
||||||
|
|
||||||
This will create a LAMMPS directory with the version date
|
This will create a LAMMPS directory with the version date
|
||||||
in its name, e.g. lammps-23Jun18.
|
in its name, e.g. lammps-23Jun18.
|
||||||
@ -40,7 +40,7 @@ with the following command, to create a lammps-<version> dir:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ unzip lammps*.zip
|
unzip lammps*.zip
|
||||||
|
|
||||||
This version corresponds to the selected LAMMPS patch or stable
|
This version corresponds to the selected LAMMPS patch or stable
|
||||||
release.
|
release.
|
||||||
|
|||||||
@ -6,7 +6,7 @@ Windows system can be downloaded from this site:
|
|||||||
|
|
||||||
.. parsed-literal::
|
.. parsed-literal::
|
||||||
|
|
||||||
`http://packages.lammps.org/windows.html <http://packages.lammps.org/windows.html>`_
|
`https://packages.lammps.org/windows.html <https://packages.lammps.org/windows.html>`_
|
||||||
|
|
||||||
Note that each installer package has a date in its name, which
|
Note that each installer package has a date in its name, which
|
||||||
corresponds to the LAMMPS version of the same date. Installers for
|
corresponds to the LAMMPS version of the same date. Installers for
|
||||||
|
|||||||
@ -4,13 +4,13 @@ Authors of LAMMPS
|
|||||||
The primary LAMMPS developers are at Sandia National Labs and Temple
|
The primary LAMMPS developers are at Sandia National Labs and Temple
|
||||||
University:
|
University:
|
||||||
|
|
||||||
* `Steve Plimpton <sjp_>`_, sjplimp at sandia.gov
|
* `Steve Plimpton <sjp_>`_, sjplimp at gmail.com
|
||||||
* Aidan Thompson, athomps at sandia.gov
|
* Aidan Thompson, athomps at sandia.gov
|
||||||
* Stan Moore, stamoor at sandia.gov
|
* Stan Moore, stamoor at sandia.gov
|
||||||
* Axel Kohlmeyer, akohlmey at gmail.com
|
* Axel Kohlmeyer, akohlmey at gmail.com
|
||||||
* Richard Berger, richard.berger at outlook.com
|
* Richard Berger, richard.berger at outlook.com
|
||||||
|
|
||||||
.. _sjp: http://www.cs.sandia.gov/~sjplimp
|
.. _sjp: https://sjplimp.github.io
|
||||||
.. _lws: https://www.lammps.org
|
.. _lws: https://www.lammps.org
|
||||||
|
|
||||||
Past developers include Paul Crozier and Mark Stevens, both at Sandia,
|
Past developers include Paul Crozier and Mark Stevens, both at Sandia,
|
||||||
|
|||||||
@ -27,15 +27,15 @@ namely https://www.lammps.org.
|
|||||||
The original publication describing the parallel algorithms used in the
|
The original publication describing the parallel algorithms used in the
|
||||||
initial versions of LAMMPS is:
|
initial versions of LAMMPS is:
|
||||||
|
|
||||||
`S. Plimpton, Fast Parallel Algorithms for Short-Range Molecular Dynamics, J Comp Phys, 117, 1-19 (1995). <http://www.sandia.gov/~sjplimp/papers/jcompphys95.pdf>`_
|
`S. Plimpton, Fast Parallel Algorithms for Short-Range Molecular Dynamics, J Comp Phys, 117, 1-19 (1995). <https://doi.org/10.1006/jcph.1995.1039>`_
|
||||||
|
|
||||||
|
|
||||||
DOI for the LAMMPS source code
|
DOI for the LAMMPS source code
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
LAMMPS developers use the `Zenodo service at CERN <https://zenodo.org/>`_
|
The LAMMPS developers use the `Zenodo service at CERN <https://zenodo.org/>`_
|
||||||
to create digital object identifies (DOI) for stable releases of the
|
to create digital object identifiers (DOI) for stable releases of the
|
||||||
LAMMPS source code. There are two types of DOIs for the LAMMPS source code.
|
LAMMPS source code. There are two types of DOIs for the LAMMPS source code.
|
||||||
|
|
||||||
The canonical DOI for **all** versions of LAMMPS, which will always
|
The canonical DOI for **all** versions of LAMMPS, which will always
|
||||||
point to the **latest** stable release version is:
|
point to the **latest** stable release version is:
|
||||||
|
|||||||
@ -95,7 +95,7 @@ commands)
|
|||||||
* metal-organic framework potentials (QuickFF, MO-FF)
|
* metal-organic framework potentials (QuickFF, MO-FF)
|
||||||
* implicit solvent potentials: hydrodynamic lubrication, Debye
|
* implicit solvent potentials: hydrodynamic lubrication, Debye
|
||||||
* force-field compatibility with common CHARMM, AMBER, DREIDING, OPLS, GROMACS, COMPASS options
|
* force-field compatibility with common CHARMM, AMBER, DREIDING, OPLS, GROMACS, COMPASS options
|
||||||
* access to the `OpenKIM Repository <http://openkim.org>`_ of potentials via :doc:`kim command <kim_commands>`
|
* access to the `OpenKIM Repository <https://openkim.org>`_ of potentials via the :doc:`kim command <kim_commands>`
|
||||||
* hybrid potentials: multiple pair, bond, angle, dihedral, improper potentials can be used in one simulation
|
* hybrid potentials: multiple pair, bond, angle, dihedral, improper potentials can be used in one simulation
|
||||||
* overlaid potentials: superposition of multiple pair potentials (including many-body) with optional scale factor
|
* overlaid potentials: superposition of multiple pair potentials (including many-body) with optional scale factor
|
||||||
|
|
||||||
@ -205,7 +205,7 @@ Pre- and post-processing
|
|||||||
|
|
||||||
.. _pizza: https://lammps.github.io/pizza
|
.. _pizza: https://lammps.github.io/pizza
|
||||||
|
|
||||||
.. _python: http://www.python.org
|
.. _python: https://www.python.org
|
||||||
|
|
||||||
.. _special:
|
.. _special:
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,7 @@ Here are suggestions on how to perform these tasks:
|
|||||||
linear bead-spring polymer chains. The moltemplate program is a true
|
linear bead-spring polymer chains. The moltemplate program is a true
|
||||||
molecular builder that will generate complex molecular models. See
|
molecular builder that will generate complex molecular models. See
|
||||||
the :doc:`Tools <Tools>` page for details on tools packaged with
|
the :doc:`Tools <Tools>` page for details on tools packaged with
|
||||||
LAMMPS. The `Pre/post processing page <http:/www.lammps.org/prepost.html>`_ of the LAMMPS website
|
LAMMPS. The `Pre/post processing page <https:/www.lammps.org/prepost.html>`_ of the LAMMPS website
|
||||||
describes a variety of third party tools for this task. Furthermore,
|
describes a variety of third party tools for this task. Furthermore,
|
||||||
some LAMMPS internal commands allow to reconstruct, or selectively add
|
some LAMMPS internal commands allow to reconstruct, or selectively add
|
||||||
topology information, as well as provide the option to insert molecule
|
topology information, as well as provide the option to insert molecule
|
||||||
@ -80,5 +80,5 @@ Here are suggestions on how to perform these tasks:
|
|||||||
`Pizza.py <https://lammps.github.io/pizza>`_ which can do certain kinds of
|
`Pizza.py <https://lammps.github.io/pizza>`_ which can do certain kinds of
|
||||||
setup, analysis, plotting, and visualization (via OpenGL) for LAMMPS
|
setup, analysis, plotting, and visualization (via OpenGL) for LAMMPS
|
||||||
simulations. It thus provides some functionality for several of the
|
simulations. It thus provides some functionality for several of the
|
||||||
above bullets. Pizza.py is written in `Python <http://www.python.org>`_
|
above bullets. Pizza.py is written in `Python <https://www.python.org>`_
|
||||||
and is available for download from `this page <http://www.cs.sandia.gov/~sjplimp/download.html>`_.
|
and is available for download from `this page <https://sjplimp.github.io/download.html>`_.
|
||||||
|
|||||||
@ -23,9 +23,9 @@ applies to LAMMPS is in the LICENSE file included in the LAMMPS distribution.
|
|||||||
|
|
||||||
.. _lgpl: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
|
.. _lgpl: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
|
||||||
|
|
||||||
.. _gnuorg: http://www.gnu.org
|
.. _gnuorg: https://www.gnu.org
|
||||||
|
|
||||||
.. _opensource: http://www.opensource.org
|
.. _opensource: https://www.opensource.org
|
||||||
|
|
||||||
Here is a more specific summary of what the GPL means for LAMMPS users:
|
Here is a more specific summary of what the GPL means for LAMMPS users:
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user