Compare commits
650 Commits
develop
...
maintenanc
| Author | SHA1 | Date | |
|---|---|---|---|
| e788f090f5 | |||
| b91e1129fa | |||
| eb6e0dbb1f | |||
| 98f1f12827 | |||
| 0b07b0f009 | |||
| 92ea683359 | |||
| 12e1307281 | |||
| 597885df19 | |||
| 53768758f1 | |||
| f854f2ddaa | |||
| 8488916ad9 | |||
| 95ca8a253e | |||
| 31df7d5fc2 | |||
| 013dfbaaab | |||
| 1864db1c17 | |||
| 8e13598d8b | |||
| dd2f781a68 | |||
| ce0688cbf9 | |||
| 5fdb34aff1 | |||
| b3da9ebee8 | |||
| be6d90c8b7 | |||
| 5223a9a0b1 | |||
| b3a6f63d55 | |||
| 374bc21a9d | |||
| 72c70090f0 | |||
| f36cbc1325 | |||
| cd7033562b | |||
| f0799c6d3d | |||
| ecd702793e | |||
| d1d55a0006 | |||
| 893451c123 | |||
| e49763ec3b | |||
| 6760687c56 | |||
| a4a9738d94 | |||
| dc7c26fa80 | |||
| 418eb585d7 | |||
| a87178efb8 | |||
| c1b803c0fc | |||
| 55c8461c44 | |||
| cc74b2b502 | |||
| 1a85f8ac25 | |||
| 2e73891370 | |||
| 964c556bed | |||
| 8c2216a692 | |||
| 95e1ecc8fc | |||
| e252944da1 | |||
| 6804cf9321 | |||
| 32504f701c | |||
| 0db50bd5d7 | |||
| 055c74c430 | |||
| 7e6f5af731 | |||
| 687c525a9f | |||
| afc4bbdaa6 | |||
| ff7c50edd0 | |||
| 642e220bd2 | |||
| bd4641ac0f | |||
| c4911f9eea | |||
| def9245092 | |||
| 1d5c4ee4b4 | |||
| 2d50f74ae5 | |||
| bd2990f20b | |||
| 8f6b334e54 | |||
| c8a97fc943 | |||
| 66fc58c936 | |||
| fdd3efe72f | |||
| 671b0caaf9 | |||
| ddf0edcb98 | |||
| b6086601e4 | |||
| b0d55b38e4 | |||
| 26527bd5b2 | |||
| 29b29fcf66 | |||
| c2c8f06511 | |||
| 461051be95 | |||
| 73b023cccf | |||
| 7546143ad3 | |||
| 505365c80c | |||
| 09cffd2df5 | |||
| 290aa116f5 | |||
| bda0e59177 | |||
| 3b07abbf5f | |||
| cf45119a70 | |||
| 849b6fc95d | |||
| 9ef8f8590e | |||
| 3a3ba77ced | |||
| 3eae4066f3 | |||
| eae76faa1f | |||
| 2818f86bdf | |||
| f03fd33137 | |||
| 0562db29cb | |||
| 857c413572 | |||
| df776c0dc1 | |||
| f0ffce3940 | |||
| ae66910c7b | |||
| 6c791477ae | |||
| 9ffa9c6eb1 | |||
| 5a4d659fc3 | |||
| 32e3c1c2df | |||
| c7162f96f5 | |||
| abdb785ca5 | |||
| 0a0850ddf8 | |||
| 59f3f52304 | |||
| d35cdbc074 | |||
| c64945060d | |||
| 81980666de | |||
| 7d4757e745 | |||
| e7bbc48097 | |||
| 3454810c80 | |||
| 71ee3ea7aa | |||
| 74b1f10bbd | |||
| 8bcb6cc9ff | |||
| 32dbf9a2e9 | |||
| a21ade450e | |||
| eeaea74e71 | |||
| ec3c04bb9c | |||
| 7c89fa1492 | |||
| 741a3175a6 | |||
| 7cb10a480a | |||
| 62cfa3151c | |||
| a3a67ef3f3 | |||
| 64d7bbb375 | |||
| 602088f60b | |||
| ff19f3406c | |||
| d7f281f494 | |||
| ba2ea35210 | |||
| 00907af0df | |||
| ff6df29692 | |||
| 29aba1d068 | |||
| 90b195d548 | |||
| 8945a6d47c | |||
| ccd7a3d5e2 | |||
| f111f05ecf | |||
| fa9cdff45c | |||
| 156c9cf1d2 | |||
| 0cc67bc3f2 | |||
| 5e4655b2cd | |||
| d1088b4287 | |||
| d0ec0503fb | |||
| 5817fa5dc1 | |||
| d11c8ca8bc | |||
| 2a28f8311b | |||
| a9323f1f36 | |||
| 2e26836110 | |||
| f2c07c96ec | |||
| f38dc51051 | |||
| 11bf6eab2a | |||
| 00e9308853 | |||
| eb91b226e0 | |||
| 0926c691ed | |||
| 9d512e10d7 | |||
| 9d68c3ac45 | |||
| ae6a83c19f | |||
| 36c052ef49 | |||
| 06a39d9558 | |||
| 9b8bd6b78b | |||
| 62472e7465 | |||
| c19fefb782 | |||
| 12364742b1 | |||
| 1308a61a46 | |||
| 7c60bce3a2 | |||
| 4f47d59d1e | |||
| 608be97c14 | |||
| 088954fe79 | |||
| 2d56b01153 | |||
| 6025dbd46f | |||
| 1fc6862046 | |||
| e135bd7696 | |||
| d984ba9e32 | |||
| b97611a919 | |||
| 43662165f0 | |||
| 0a9278d45b | |||
| 177dbe638e | |||
| 6fcf20f098 | |||
| 733f88d207 | |||
| 2b166f201e | |||
| 748ffe0fa6 | |||
| 9f418715b1 | |||
| a23698f962 | |||
| 0435e156ba | |||
| f8c51818e7 | |||
| 5e7377414e | |||
| dea9c0f53c | |||
| ea330c3c0f | |||
| 266924d6e1 | |||
| 928209c64b | |||
| 36e03bcd36 | |||
| 9f55ae6fdb | |||
| a8b82f8e41 | |||
| 3895f7100f | |||
| 0b06bce086 | |||
| 9c60b5f7af | |||
| 19c0242530 | |||
| 06ba77c554 | |||
| ddfad6853e | |||
| 7cdad6fa06 | |||
| f068d8395a | |||
| 13cc5fe9bd | |||
| 35edb0f3b1 | |||
| fb6d4eb607 | |||
| 260060f4a4 | |||
| 1f8f0f37c1 | |||
| bae0fe562e | |||
| 07f56405a4 | |||
| 5791ca7263 | |||
| 87de8b79ca | |||
| 3c131f8c76 | |||
| d829cebd83 | |||
| 45eff54f79 | |||
| 199c25c2e7 | |||
| 5e0c01d056 | |||
| a6f2a6b674 | |||
| deaa96fea1 | |||
| e8df9e46a5 | |||
| f7e3b893ce | |||
| 269c9c6f6e | |||
| 85d1597f2e | |||
| 66098ddd39 | |||
| 6c67165049 | |||
| 2320d28f7c | |||
| a1aa66ee8b | |||
| 7468f6c30f | |||
| 912c1acedb | |||
| a76a37bf67 | |||
| a3bc393b89 | |||
| e0256f8d3e | |||
| 65e1bf61dc | |||
| 448d02f12e | |||
| cc3406ff72 | |||
| 0fbcf89058 | |||
| a22cdba3d6 | |||
| eda90863b8 | |||
| 423bbaa51a | |||
| a9e42c6c6c | |||
| 849d308268 | |||
| ffd53e4945 | |||
| 4545b3b9e9 | |||
| 3853d32e85 | |||
| e86ae3912e | |||
| 7adeb3adee | |||
| 59587e0f69 | |||
| 4258d6f923 | |||
| 8813038a6c | |||
| 872eb1c0cc | |||
| ec6080b369 | |||
| 8b8d1d7bdb | |||
| 7acafd8989 | |||
| 940833113b | |||
| 644e8064d4 | |||
| b6714794c7 | |||
| 26bbf12e2a | |||
| d406d2ab6b | |||
| 12fae74fa9 | |||
| a8a089f25c | |||
| 2709b47b64 | |||
| aa742516a4 | |||
| 16c79f0af7 | |||
| 2099411873 | |||
| 927dfe76e7 | |||
| c9a1cf0656 | |||
| 9fa8130bc1 | |||
| 758b08f695 | |||
| b14a323e73 | |||
| 4b9efca3c0 | |||
| 1ca87cd021 | |||
| 73c1b69dc7 | |||
| 02babb2344 | |||
| c1c7473a7a | |||
| 9845e070a9 | |||
| 90a4518122 | |||
| 65ecc87f7e | |||
| d485647d02 | |||
| d49bed3c27 | |||
| b9a14a5ccf | |||
| 014b304827 | |||
| 90b455bbac | |||
| c0ab7e9a9e | |||
| 845e2f8954 | |||
| 3e56d6945b | |||
| 74f05273e7 | |||
| e8b9611bd6 | |||
| d65af29020 | |||
| a38fce9b2c | |||
| f254201397 | |||
| 89e442dac1 | |||
| 4693cc88fa | |||
| 2b2ea9aaa2 | |||
| a3cd14bb82 | |||
| c752de6621 | |||
| d781541f5f | |||
| 89cfeafbc7 | |||
| 7377d6cc20 | |||
| 85e497a97d | |||
| 30fabc5a28 | |||
| b8466e5caf | |||
| 3ccd6fa483 | |||
| fec7422781 | |||
| f710205874 | |||
| 1ecf754b2d | |||
| b54a487266 | |||
| f4e4bc93c9 | |||
| d3a717c030 | |||
| 3ddcc0ca51 | |||
| 5dc7ea9663 | |||
| 6f71fb6d2f | |||
| 884961f267 | |||
| 698285904d | |||
| df4eb09e6f | |||
| 2aa1ed6923 | |||
| 9e622e767a | |||
| e410a2816a | |||
| f489ff1699 | |||
| ec839d494c | |||
| 346d1de4dd | |||
| 29819b29ae | |||
| 076c711dba | |||
| c4a822a4cf | |||
| 84b2b1c231 | |||
| 4c47ff284c | |||
| 503d7230a6 | |||
| e46d511885 | |||
| 7c6ec1409f | |||
| dcfdbef0a0 | |||
| 6b02db9e21 | |||
| 001c1cd938 | |||
| d74fd195a3 | |||
| eb2b5aa0ac | |||
| 89d3c0b0a6 | |||
| f0abbc80be | |||
| 3cb951e729 | |||
| bea24c70a6 | |||
| 87f022576d | |||
| 20d10ec751 | |||
| 2e502b59bb | |||
| 0ed1b85d6f | |||
| 8b665764cc | |||
| 77da90df2a | |||
| 69693750ce | |||
| b41e3c9939 | |||
| 1208f3dd5e | |||
| 04a5fe06e7 | |||
| dc94ff97de | |||
| 31b5ffbeca | |||
| 570c9d190f | |||
| b5e21701ee | |||
| 0cb72423b8 | |||
| 8fc48ad374 | |||
| 6fbb96140f | |||
| c00326debc | |||
| 112f311591 | |||
| f3be84a22b | |||
| 307a5b9592 | |||
| 14d9e2b722 | |||
| 78fe9585a4 | |||
| f0f8b49afb | |||
| d0cfe2d00f | |||
| b1654f11c1 | |||
| 6573a8d882 | |||
| aa68d6aacd | |||
| bdc08a99fe | |||
| fc6fe9e740 | |||
| e2fede9076 | |||
| 48cde7c566 | |||
| 14583e5fb6 | |||
| ab2558db15 | |||
| 5fa0c4951a | |||
| f8a0e1524e | |||
| 592bd770a8 | |||
| 13c56473a2 | |||
| 3d7088a9d9 | |||
| 2f6567ad76 | |||
| 910bb4e111 | |||
| 6e7e2b7aee | |||
| bdbb391364 | |||
| ea67e3104d | |||
| 6c94fb5eea | |||
| 84bfbe7936 | |||
| 891e97ecf5 | |||
| 1fa18a45a8 | |||
| 9a60dbbf31 | |||
| 92d07ceba4 | |||
| fe90838843 | |||
| 2d0aa2daf5 | |||
| 696c2d15da | |||
| b570782d5e | |||
| 88cd314dc9 | |||
| 7e51d1e049 | |||
| d8c4115b86 | |||
| baa3c8e98c | |||
| 1a258d4349 | |||
| 87bbd70fd2 | |||
| 850e4d14cd | |||
| 0717019b2d | |||
| 0c7720843b | |||
| 4c18b2fe99 | |||
| 1d7b0b730f | |||
| 2946087b45 | |||
| 94b2cd7fc5 | |||
| dea53be1a5 | |||
| c3c72a3bff | |||
| 82b86031ef | |||
| 3dda8d752c | |||
| e5809d8be1 | |||
| 9861c93225 | |||
| 65b21b8772 | |||
| 8d8f6c3efd | |||
| 7d2238d7be | |||
| 638f6e9551 | |||
| a6979e5489 | |||
| 411574a39c | |||
| 874f5577d4 | |||
| 456449d4ff | |||
| 22cfd97f46 | |||
| 453469d6fe | |||
| e699ced7bd | |||
| 6baa2f432c | |||
| c114938867 | |||
| e8294aa207 | |||
| 6e32b0cada | |||
| 6243735af4 | |||
| 5816c0875a | |||
| a31617ef7b | |||
| d5c7da1b0e | |||
| 0b1453f7ea | |||
| ba204b3989 | |||
| fd86bbd982 | |||
| 020a4f6ee7 | |||
| 36b9d93b52 | |||
| cbe2266e40 | |||
| fb10881636 | |||
| dcbb09f321 | |||
| b00cb7e6bd | |||
| edfe752b2a | |||
| 6d28d53d60 | |||
| 9976d58b34 | |||
| 46265e36ce | |||
| 2a8d16ee4b | |||
| 54035fba79 | |||
| 7ac835a12f | |||
| 6058fcc37e | |||
| ee5ee22b47 | |||
| 6138369079 | |||
| b7820bfd0e | |||
| 50b8fe9c61 | |||
| 8fa42612e6 | |||
| a6c5f3f714 | |||
| 573021b362 | |||
| 688f4f5288 | |||
| 2831b904e9 | |||
| bff40d2add | |||
| 7d2b2ff776 | |||
| 1d09911bdb | |||
| e446b17d41 | |||
| e7ce03aa0a | |||
| a9eaa71f8c | |||
| 6203c18ef0 | |||
| a7aacd2440 | |||
| 2178ba2513 | |||
| 8277218cbb | |||
| 13d7178f95 | |||
| 1255772864 | |||
| 0878fca16e | |||
| 147ad3c67c | |||
| 05e4dded0f | |||
| 5739203ad3 | |||
| 3c232ce6a6 | |||
| f24ced3bb6 | |||
| d8b74e907e | |||
| 039161112b | |||
| 522608b59e | |||
| 24e65b618b | |||
| e22cea04e2 | |||
| a70aece450 | |||
| 92d5772dfa | |||
| 5f04990bc2 | |||
| d9a7365273 | |||
| eaa00c238a | |||
| 20dae33563 | |||
| 9d360af2c5 | |||
| cafa9ccec2 | |||
| 9296357851 | |||
| c53afef070 | |||
| 7bdac7eafd | |||
| a01a6f3a27 | |||
| bfd15408ba | |||
| 48e0859f0d | |||
| 66930a4e5c | |||
| c434b96a9b | |||
| 6d3945d367 | |||
| 84443eb114 | |||
| e37b579237 | |||
| 58c2c89d1b | |||
| 023960e7d5 | |||
| 84975f31cb | |||
| 27e8d0f19c | |||
| 9befd421ca | |||
| b3e54549db | |||
| 85393862af | |||
| ac1db251cb | |||
| 3f48d48eea | |||
| d9804d7590 | |||
| 4128d52e1c | |||
| 2d961e76b3 | |||
| 016c9ef4b2 | |||
| e69c65431f | |||
| a40e9222aa | |||
| 283e2103e3 | |||
| 2808e6fc52 | |||
| c742b20c5a | |||
| 530f487dd7 | |||
| ba8ca9258b | |||
| cd21f67cc6 | |||
| 07257595ff | |||
| 413d485617 | |||
| 8759a18437 | |||
| f79e9a113f | |||
| c1fa89186a | |||
| 609f5ec64b | |||
| 38b79eeb9b | |||
| 7035249abd | |||
| 816d74d80c | |||
| 4926164050 | |||
| a102d64a95 | |||
| 77db8e422a | |||
| ee0c5dc121 | |||
| 184f5a7f5e | |||
| 162b9c3ff3 | |||
| 4d06a9928f | |||
| 938682a751 | |||
| 00bccbf067 | |||
| 67085517ff | |||
| 3a2d94822a | |||
| c272e8f94f | |||
| 7f41eb6d9a | |||
| a716df7e59 | |||
| 08eae40f9a | |||
| b6c031fd03 | |||
| 990c07a133 | |||
| 4e94e697ec | |||
| 4526dccaca | |||
| 917606e40e | |||
| acaae8a36f | |||
| 28803ee78d | |||
| dd498fcbf8 | |||
| 0f8af20d0b | |||
| 00ef4ca3f6 | |||
| 50fbe61616 | |||
| 854c6d93e2 | |||
| e8e2c5f986 | |||
| cff21ce808 | |||
| 97c4875a08 | |||
| c9aedf9df8 | |||
| 723dc17d80 | |||
| c90f874a0d | |||
| 4ed5243d9b | |||
| 71c7d143b7 | |||
| e944140ff2 | |||
| b54545d1a4 | |||
| fc7119982b | |||
| 9e45df19c1 | |||
| 8bfec75568 | |||
| 0f948e98f2 | |||
| b9ce258935 | |||
| 058f87e019 | |||
| 6c2e469f5d | |||
| 810e3e5fa5 | |||
| a5374997d2 | |||
| e65ed32ecd | |||
| d326327bd7 | |||
| aa1c901f94 | |||
| 2ba7059c00 | |||
| 23691d4336 | |||
| 78adc1727a | |||
| 9def610c08 | |||
| a939e93a08 | |||
| 308207d5f9 | |||
| 75d0d9be1d | |||
| 2f71bc7886 | |||
| ddbdaaafdc | |||
| 8946995199 | |||
| d567fdae97 | |||
| ed9bfb433f | |||
| f8493ed805 | |||
| f3beb206c9 | |||
| b5480e4e1b | |||
| f634b25e31 | |||
| b21db641d9 | |||
| 6ba94d1619 | |||
| ce756540e8 | |||
| bb462b9ea3 | |||
| 63eda98779 | |||
| 0ca72bb58e | |||
| a6bcf507e1 | |||
| a1621a7229 | |||
| 62d41c6afb | |||
| 5480d25e36 | |||
| a4145ec852 | |||
| 5b16f15b25 | |||
| e77aaba3a4 | |||
| 7f08e8d11c | |||
| f62b129dec | |||
| db967a5bbf | |||
| f20af66312 | |||
| 01766c7631 | |||
| 7846bb59db | |||
| c27951cb1f | |||
| 4ab82d76ad | |||
| c6cbc1f965 | |||
| 88e58e9189 | |||
| e14005c443 | |||
| 9570c2fb50 | |||
| 180ce5277f | |||
| e81b86e114 | |||
| 6c6262a637 | |||
| 062bb88561 | |||
| cf5b653a9a | |||
| c5a5e4a099 | |||
| ccab900342 | |||
| fc400af724 | |||
| b1ea4d9601 | |||
| 2ca3be7b16 | |||
| 31b94aa1b0 | |||
| b1b94980fa | |||
| 770ad34267 | |||
| 10c523a950 | |||
| 62ef884564 | |||
| b3860a82de | |||
| 1deb3d8865 | |||
| 266e519013 | |||
| fffb86cb02 | |||
| fcaabe510e | |||
| a6043d92cb | |||
| ee16f6503e | |||
| 84168fc84d | |||
| 8a5fd08fa1 | |||
| 8944609419 | |||
| e90478e932 | |||
| 52c23785c5 | |||
| 088ff4ad27 | |||
| e32ae65aa1 | |||
| a5bf853c35 | |||
| b0a1b58c68 | |||
| bdaf3c64a6 | |||
| ccc478ad96 | |||
| fadb210052 | |||
| c105a187d9 | |||
| d74f86f2cd | |||
| c5b35970dc | |||
| 5626836995 | |||
| 53111f8c0e | |||
| e0ca512f50 | |||
| e87bad43f9 |
6
.github/CODEOWNERS
vendored
6
.github/CODEOWNERS
vendored
@ -71,10 +71,7 @@ src/EXTRA-COMMAND/group_ndx.* @akohlmey
|
||||
src/EXTRA-COMMAND/ndx_group.* @akohlmey
|
||||
src/EXTRA-COMPUTE/compute_stress_mop*.* @RomainVermorel
|
||||
src/EXTRA-COMPUTE/compute_born_matrix.* @Bibobu @athomps
|
||||
src/EXTRA-DUMP/dump_extxyz.* @fxcoudert
|
||||
src/EXTRA-FIX/fix_deform_pressure.* @jtclemm
|
||||
src/EXTRA-PAIR/pair_dispersion_d3.* @soniasolomoni @arthurfl
|
||||
src/EXTRA-PAIR/d3_parameters.h @soniasolomoni @arthurfl
|
||||
src/MISC/*_tracker.* @jtclemm
|
||||
src/MC/fix_gcmc.* @athomps
|
||||
src/MC/fix_sgcmc.* @athomps
|
||||
@ -104,8 +101,7 @@ src/group.* @sjplimp
|
||||
src/improper.* @sjplimp
|
||||
src/info.* @akohlmey
|
||||
src/kspace.* @sjplimp
|
||||
src/lmptype.h @sjplimp
|
||||
src/label_map.* @jrgissing @akohlmey
|
||||
src/lmptyp.h @sjplimp
|
||||
src/library.* @sjplimp @akohlmey
|
||||
src/main.cpp @sjplimp
|
||||
src/min_*.* @sjplimp
|
||||
|
||||
370
.github/release_steps.md
vendored
370
.github/release_steps.md
vendored
@ -1,370 +0,0 @@
|
||||
# LAMMPS Release Steps
|
||||
|
||||
The following notes chronicle the current steps for preparing and
|
||||
publishing LAMMPS releases. For definitions of LAMMPS versions and
|
||||
releases, please refer to [the corresponding section in the LAMMPS
|
||||
manual](https://docs.lammps.org/Manual_version.html).
|
||||
|
||||
## LAMMPS Feature Release
|
||||
|
||||
A LAMMPS feature release is currently prepared after about 500 to 750
|
||||
commits to the 'develop' branch or after a period of four weeks up to
|
||||
two months. This is not a fixed rule, though, since external
|
||||
circumstances can cause delays in preparing a release, or pull requests
|
||||
that are desired to be merged for the release are not yet completed.
|
||||
|
||||
### Preparing a 'next\_release' branch
|
||||
|
||||
Create a 'next\_release' branch off 'develop' and make the following changes:
|
||||
|
||||
- set the LAMMPS\_VERSION define to the planned release date in
|
||||
src/version.h in the format "D Mmm YYYY" or "DD Mmm YYYY"
|
||||
- remove the LAMMPS\_UPDATE define in src/version.h
|
||||
- update the release date in doc/lammps.1
|
||||
- update all TBD arguments for ..versionadded::, ..versionchanged::
|
||||
..deprecated:: to the planned release date in the format "DMmmYYYY" or
|
||||
"DDMmmYYYY"
|
||||
- check release notes for merged new features and check if
|
||||
..versionadded:: or ..versionchanged:: are missing and need to be
|
||||
added
|
||||
|
||||
Submit this pull request. This is the last pull request merged for the
|
||||
release and should not contain any other changes. (Exceptions: this
|
||||
document, last minute trivial(!) changes).
|
||||
|
||||
This PR shall not be merged before **all** pending tests have completed
|
||||
and cleared. We currently use a mix of automated tests running on
|
||||
either Temple's Jenkins cluster or GitHub workflows. Those include time
|
||||
consuming tests not run on pull requests. If needed, a bug-fix pull
|
||||
request should be created and merged to clear all tests.
|
||||
|
||||
### Create release on GitHub
|
||||
|
||||
When all pending pull requests for the release are merged and have
|
||||
cleared testing, the 'next\_release' branch is merged into 'develop'.
|
||||
|
||||
Check out or update the 'develop' branch locally, pull the latest
|
||||
changes, merge them into 'release' with a fast forward(!) merge, and
|
||||
apply a suitable release tag (for historical reasons the tag starts with
|
||||
"patch_" followed by the date, and finally push everything back to
|
||||
GitHub. There should be no commits made to 'release' but only
|
||||
fast forward merges. Example:
|
||||
|
||||
```
|
||||
git checkout develop
|
||||
git pull
|
||||
git checkout release
|
||||
git pull
|
||||
git merge --ff-only develop
|
||||
git tag -s -m "LAMMPS feature release 4 February 2025" patch_4Feb2025
|
||||
git push git@github.com:lammps/lammps.git --tags develop release
|
||||
```
|
||||
|
||||
Applying this tag will trigger two actions on the Temple Jenkins cluster:
|
||||
- The online manual at https://docs.lammps.org/ will be updated to the
|
||||
state of the 'release' branch. Merges to the 'develop' branch will
|
||||
trigger updating https://docs.lammps.org/latest/ so by reviewing the
|
||||
version of the manual under the "latest" URL, it is possible to preview
|
||||
what the updated release documentation will look like.
|
||||
- A downloadable tar archive of the LAMMPS distribution that includes the
|
||||
html format documentation and a PDF of the manual will be created and
|
||||
uploaded to the download server at https://download.lammps.org/tars
|
||||
Note that the file is added, but the `index.html` file is not updated,
|
||||
so it is not yet publicly visible.
|
||||
|
||||
Go to https://github.com/lammps/lammps/releases and create a new (draft)
|
||||
release page with a summary of all the changes included and references
|
||||
to the pull requests they were merged from or check the existing draft
|
||||
for any necessary changes from pull requests that were merged but are
|
||||
not listed. Then select the applied tag for the release in the "Choose
|
||||
a tag" drop-down list. Go to the bottom of the list and select the "Set
|
||||
as pre-release" checkbox. The "Set as the latest release" button is
|
||||
reserved for stable releases and updates to them.
|
||||
|
||||
If everything is in order, you can click on the "Publish release"
|
||||
button. Otherwise, click on "Save draft" and finish pending tasks until
|
||||
you can return to edit the release page and publish it.
|
||||
|
||||
### Prepare pre-compiled packages, update packages to GitHub
|
||||
|
||||
A suitable build environment is provided with the
|
||||
https://download.lammps.org/static/fedora41_musl_mingw.sif container
|
||||
image. The corresponding container build definition file is maintained
|
||||
in the tools/singularity folder of the LAMMPS source distribution.
|
||||
|
||||
#### Fully portable static Linux x86_64 non-MPI binaries
|
||||
|
||||
The following commands use the Fedora container to build a fully static
|
||||
LAMMPS installation using a musl-libc cross-compiler, install it into a
|
||||
`lammps-static` folder, and create a tarball called
|
||||
`lammps-linux-x86_64-4Feb2025.tar.gz` (or using a corresponding date
|
||||
with a future release) from the `lammps-static` folder.
|
||||
|
||||
``` sh
|
||||
rm -rf release-packages
|
||||
mkdir release-packages
|
||||
cd release-packages
|
||||
wget https://download.lammps.org/static/fedora41_musl_mingw.sif
|
||||
apptainer shell fedora41_musl_mingw.sif
|
||||
git clone -b release --depth 10 https://github.com/lammps/lammps.git lammps-release
|
||||
cmake -S lammps-release/cmake -B build-release -G Ninja -D CMAKE_INSTALL_PREFIX=$PWD/lammps-static -D CMAKE_TOOLCHAIN_FILE=/usr/musl/share/cmake/linux-musl.cmake -C lammps-release/cmake/presets/most.cmake -C lammps-release/cmake/presets/kokkos-openmp.cmake -D DOWNLOAD_POTENTIALS=OFF -D BUILD_MPI=OFF -D BUILD_TESTING=OFF -D CMAKE_BUILD_TYPE=Release -D PKG_ATC=ON -D PKG_AWPMD=ON -D PKG_MANIFOLD=ON -D PKG_MESONT=ON -D PKG_MGPT=ON -D PKG_ML-PACE=ON -D PKG_ML-RANN=ON -D PKG_MOLFILE=ON -D PKG_PTM=ON -D PKG_QTB=ON -D PKG_SMTBQ=ON
|
||||
cmake --build build-release --target all
|
||||
cmake --build build-release --target install
|
||||
/usr/musl/bin/x86_64-linux-musl-strip -g lammps-static/bin/*
|
||||
tar -czvvf ../lammps-linux-x86_64-4Feb2025.tar.gz lammps-static
|
||||
exit # fedora 41 container
|
||||
cd ..
|
||||
```
|
||||
|
||||
The resulting tar archive can be uploaded to the GitHub release page with:
|
||||
|
||||
``` sh
|
||||
gh release upload patch_4Feb2025 lammps-linux-x86_64-4Feb2025.tar.gz
|
||||
```
|
||||
|
||||
#### Linux x86_64 Flatpak bundle with GUI included
|
||||
|
||||
Make sure you have the `flatpak` and `flatpak-builder` packages
|
||||
installed locally (they require binaries that run with elevated
|
||||
privileges and thus cannot be used from the container) and build a
|
||||
LAMMPS and LAMMPS-GUI flatpak bundle in the `release-packages` folder
|
||||
with:
|
||||
|
||||
``` sh
|
||||
cd release-packages
|
||||
flatpak --user remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
|
||||
flatpak-builder --force-clean --verbose --repo=$PWD/flatpak-repo --install-deps-from=flathub --state-dir=$PWD --user --ccache --default-branch=release flatpak-build lammps-release/tools/lammps-gui/org.lammps.lammps-gui.yml
|
||||
flatpak build-bundle --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo --verbose $PWD/flatpak-repo ../LAMMPS-Linux-x86_64-GUI-4Feb2025.flatpak org.lammps.lammps-gui release
|
||||
cd ..
|
||||
```
|
||||
|
||||
The resulting flatpak bundle file can be uploaded to the GitHub release page with:
|
||||
|
||||
``` sh
|
||||
gh release upload patch_4Feb2025 LAMMPS-Linux-x86_64-GUI-4Feb2025.flatpak
|
||||
```
|
||||
|
||||
#### LAMMPS Source tarball
|
||||
|
||||
The container for the static binary can also be used to prepare the source
|
||||
tarball including the HTML and PDF manual (this is currently done automatically
|
||||
when the releases is created and the tarball uploaded to https://download.lammps.org/tars/).
|
||||
The steps are as follows:
|
||||
|
||||
``` sh
|
||||
cd release-packages
|
||||
apptainer shell fedora41_musl_mingw.sif
|
||||
cd lammps-release
|
||||
rm -f ../release.tar*
|
||||
git archive --output=../release.tar --prefix=lammps-4Feb2025/ HEAD
|
||||
cd doc
|
||||
make clean-all
|
||||
make html pdf
|
||||
tar -rf ../../release.tar --transform 's,^,lammps-4Feb2025/doc/,' html Manual.pdf
|
||||
gzip -9v ../../release.tar
|
||||
mv ../../release.tar.gz ../../lammps-src-4Feb2025.tar.gz
|
||||
exit # fedora41 container
|
||||
cd ..
|
||||
```
|
||||
|
||||
The resulting source tarball can be uploaded to the GitHub release page with:
|
||||
|
||||
``` sh
|
||||
gh release upload patch_4Feb2025 lammps-src-4Feb2025.tar.gz
|
||||
```
|
||||
|
||||
#### Build Windows Installer Packages with MinGW Linux-to-Windows Cross-compiler
|
||||
|
||||
The various Windows installer packages can also be built with
|
||||
apptainer container image.
|
||||
|
||||
``` sh
|
||||
cd release-packages
|
||||
apptainer shell fedora41_musl_mingw.sif
|
||||
git clone --depth 10 https://github.com/lammps/lammps-packages.git lammps-packages
|
||||
cd lammps-packages/mingw-cross
|
||||
ln -sf ../../lammps-release lammps
|
||||
./buildall.sh release >& mk.log & less +F mk.log
|
||||
```
|
||||
|
||||
The installer with the GUI included can be uploaded to the GitHub release page with:
|
||||
|
||||
``` sh
|
||||
ln -sf LAMMPS-64bit-GUI-4Feb2025.exe LAMMPS-Win10-64bit-GUI-4Feb2025.exe
|
||||
gh release upload patch_4Feb2025 LAMMPS-Win10-64bit-GUI-4Feb2025.exe
|
||||
```
|
||||
|
||||
The symbolic link is used to have a consistent naming scheme for the packages
|
||||
attached to the GitHub release page.
|
||||
|
||||
#### Clean up:
|
||||
|
||||
``` sh
|
||||
cd ..
|
||||
rm -r release-packages
|
||||
```
|
||||
|
||||
#### Build Multi-arch App-bundle with GUI for macOS
|
||||
|
||||
Building app-bundles for macOS is not as easily automated and portable
|
||||
as some of the other steps. It requires a machine actually running
|
||||
macOS. In that machine the Xcode compiler package needs to be
|
||||
installed. This also includes tools for building and manipulating disk
|
||||
images. This compiler supports building executables for both, the
|
||||
x86_64 and the arm64 architectures. This requires building with CMake
|
||||
and using the CMake settings:
|
||||
|
||||
``` sh
|
||||
-D CMAKE_OSX_ARCHITECTURES=arm64;x86_64
|
||||
-D CMAKE_OSX_DEPLOYMENT_TARGET=11.0
|
||||
```
|
||||
|
||||
This will add the compiler flags `-arch arm64 -arch x86_64
|
||||
-mmacosx-version-min=11.0` and thus produce object for both
|
||||
architectures and support for macOS versions back to version 11 (aka Big
|
||||
Sur). With these settings the following libraries should be compiled
|
||||
and installed (e.g. to `$HOME/.local`) as static libraries only:
|
||||
- libomp taken from the LLVM/Clang source distribution (to support OpenMP)
|
||||
- jpeg
|
||||
- zlib
|
||||
- png
|
||||
- Qt (for LAMMPS-GUI)
|
||||
|
||||
When configuring LAMMPS the `cmake/presets/clang.cmake` should be used
|
||||
and as many packages as possible enabled. For LAMMPS-GUI, MPI should be
|
||||
disabled with `-D BUILD_MPI=OFF` and LAMMPS-GUI enabled with
|
||||
`-D BUILD_LAMMPS_GUI=ON`. If the CMake configuration is successful,
|
||||
settings for building a macOS app-bundle are enabled and with `cmake
|
||||
--build build --target dmg` extra steps will be executed that will build
|
||||
a macOS application installer image under the name
|
||||
`LAMMPS_GUI-macOS-multiarch-4Feb2025.dmg`
|
||||
|
||||
The application image can be uploaded to the GitHub release page with:
|
||||
|
||||
``` sh
|
||||
ln -sf LAMMPS_GUI-macOS-multiarch-4Feb2025.dmg LAMMPS-macOS-multiarch-GUI-4Feb2025.dmg
|
||||
gh release upload patch_4Feb2025 LAMMPS-macOS-multiarch-GUI-4Feb2025.dmg
|
||||
```
|
||||
|
||||
The symbolic link is used to have a consistent naming scheme for the packages
|
||||
attached to the GitHub release page.
|
||||
|
||||
We are currently building the application images on macOS 12 (aka Monterey).
|
||||
|
||||
#### Build Linux x86_64 binary tarball with GUI on Ubuntu 20.04LTS
|
||||
|
||||
While the flatpak Linux version uses portable runtime libraries provided
|
||||
by the flatpak environment, we also build regular Linux executables that
|
||||
use a wrapper script and matching shared libraries in a tarball. To be
|
||||
compatible with many Linux distributions, one has to build this on a
|
||||
very old Linux distribution, since most Linux system libraries are
|
||||
usually backward compatible but not forward compatible. This is
|
||||
currently done on an Ubuntu 20.04LTS system. Once LAMMPS moves to
|
||||
require CMake 3.20 and C++17, we will have to move to Ubuntu 22.04LTS.
|
||||
This installation (either on a real or a virtual machine) should have
|
||||
the packages installed that are indicated in
|
||||
`tools/singularity/ubuntu20.04.def` plus Qt version 5.x with development
|
||||
headers, so that LAMMPS-GUI can be compiled.
|
||||
|
||||
Also the building of the binary tarball and setup of the bundled
|
||||
libraries and wrapper scripts is automated and can executed with `cmake
|
||||
--build build --target tgz`. This should produce a file
|
||||
`LAMMPS_GUI-Linux-amd64-4Feb2025.tar.gz` which can be uploaded to the
|
||||
GitHub release page with:
|
||||
|
||||
``` sh
|
||||
ln -sf LAMMPS_GUI-Linux-amd64-4Feb2025.tar.gz LAMMPS-Linux-x86_64-GUI-4Feb2025.tar.gz
|
||||
gh release upload patch_4Feb2025 LAMMPS-Linux-x86_64-GUI-4Feb2025.tar.gz
|
||||
```
|
||||
|
||||
### Update download page on LAMMPS website
|
||||
|
||||
Check out the LAMMPS website repo
|
||||
https://github.com/lammps/lammps-website.git and edit the file
|
||||
`src/download.txt` for the new release. Test translation with `make
|
||||
html` and review `html/download.html` Then add and commit to git and
|
||||
push the changes to GitHub. The Temple Jenkis cluster will
|
||||
automatically update https://www.lammps.org/download.html accordingly.
|
||||
|
||||
Also notify Steve of the release so he can update `src/bug.txt` on the
|
||||
website from the available release notes.
|
||||
|
||||
## LAMMPS Stable Release
|
||||
|
||||
A LAMMPS stable release is prepared about once per year in the months
|
||||
July, August, or September. One (or two, if needed) feature releases
|
||||
before the stable release shall contain only bug fixes or minor feature
|
||||
updates in optional packages. Also substantial changes to the core of
|
||||
the code shall be applied rather toward the beginning of a development
|
||||
cycle between two stable releases than toward the end. The intention is
|
||||
to stablilize significant change to the core and have outside users and
|
||||
developers try them out during the development cycle; the sooner the
|
||||
changes are included, the better chances for spotting peripheral bugs
|
||||
and issues.
|
||||
|
||||
### Prerequesites
|
||||
|
||||
Before making a stable release all remaining backported bugfixes shall
|
||||
be released as a (final) stable update release (see below).
|
||||
|
||||
A LAMMPS stable release process starts like a feature release (see
|
||||
above), only that this feature release is called a "Stable Release
|
||||
Candidate" and no assets are uploaded to GitHub.
|
||||
|
||||
### Synchronize 'maintenance' branch with 'release'
|
||||
|
||||
The state of the 'release' branch is then transferred to the
|
||||
'maintenance' branch (which will have diverged significantly from
|
||||
'release' due to the selectively backported bug fixes).
|
||||
|
||||
### Fast-forward merge of 'maintenance' into 'stable' and apply tag
|
||||
|
||||
At this point it should be possible to do a fast-forward merge of
|
||||
'maintenance' to 'stable' and then apply the stable\_DMmmYYYY tag.
|
||||
|
||||
### Push branches and tags
|
||||
|
||||
## LAMMPS Stable Update Release
|
||||
|
||||
After making a stable release, bugfixes from the 'develop' branch
|
||||
are selectively backported to the 'maintenance' branch. This is
|
||||
done with "git cherry-pick \<commit hash\>' wherever possible.
|
||||
The LAMMPS\_UPDATE define in "src/version.h" is set to "Maintenance".
|
||||
|
||||
### Prerequesites
|
||||
|
||||
When a sufficient number of bugfixes has accumulated or an urgent
|
||||
or important bugfix needs to be distributed a new stable update
|
||||
release is made. To make this publicly visible a pull request
|
||||
is submitted that will merge 'maintenance' into 'stable'. Before
|
||||
merging, set LAMMPS\_UPDATE in "src/version.h" to "Update #" with
|
||||
"#" indicating the update count (1, 2, and so on).
|
||||
Also draft suitable release notes under https://github.com/lammps/lammps/releases
|
||||
|
||||
### Fast-forward merge of 'maintenance' into 'stable', apply tag, and publish
|
||||
|
||||
Do a fast-forward merge of 'maintenance' to 'stable' and then
|
||||
apply the stable\_DMmmYYYY\_update# tag and push branch and tag
|
||||
to GitHub. The corresponding pull request will be automatically
|
||||
closed. Example:
|
||||
|
||||
```
|
||||
git checkout maintenance
|
||||
git pull
|
||||
git checkout stable
|
||||
git pull
|
||||
git merge --ff-only maintenance
|
||||
git tag -s -m 'Update 2 for Stable LAMMPS version 29 August 2024' stable_29Aug2024_update2
|
||||
git push git@github.com:lammps/lammps.git --tags maintenance stable
|
||||
```
|
||||
|
||||
Associate draft release notes with new tag and publish as "latest release".
|
||||
|
||||
On https://ci.lammps.org/ go to "dev", "stable" and manually execute
|
||||
the "update\_release" task. This will update https://docs.lammps.org/stable
|
||||
and prepare a stable tarball.
|
||||
|
||||
### Build and upload binary packages and source tarball to GitHub
|
||||
|
||||
The build procedure is the same as for the feature releases, only
|
||||
that packages are built from the 'stable' branch.
|
||||
103
.github/workflows/check-cpp23.yml
vendored
103
.github/workflows/check-cpp23.yml
vendored
@ -1,103 +0,0 @@
|
||||
# GitHub action to build LAMMPS on Linux with gcc or clang and C++23
|
||||
name: "Check for C++23 Compatibility"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{github.event_name == 'pull_request'}}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build with C++23 support enabled
|
||||
if: ${{ github.repository == 'lammps/lammps' }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
max-parallel: 2
|
||||
matrix:
|
||||
idx: [ gcc, clang ]
|
||||
env:
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Install extra packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ccache \
|
||||
clang \
|
||||
libcurl4-openssl-dev \
|
||||
libeigen3-dev \
|
||||
libfftw3-dev \
|
||||
libomp-dev \
|
||||
mold \
|
||||
mpi-default-bin \
|
||||
mpi-default-dev \
|
||||
ninja-build \
|
||||
python3-dev
|
||||
|
||||
- name: Create Build Environment
|
||||
run: mkdir build
|
||||
|
||||
- name: Set up ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: linux-cpp23-ccache-${{ matrix.idx }}-${{ github.sha }}
|
||||
restore-keys: linux-cpp23-ccache-${{ matrix.idx }}
|
||||
|
||||
- name: Building LAMMPS via CMake
|
||||
shell: bash
|
||||
run: |
|
||||
ccache -z
|
||||
python3 -m venv linuxenv
|
||||
source linuxenv/bin/activate
|
||||
python3 -m pip install numpy
|
||||
python3 -m pip install pyyaml
|
||||
cmake -S cmake -B build \
|
||||
-C cmake/presets/most.cmake \
|
||||
-C cmake/presets/kokkos-openmp.cmake \
|
||||
-C cmake/presets/${{ matrix.idx }}.cmake \
|
||||
-D CMAKE_CXX_STANDARD=23 \
|
||||
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-D CMAKE_BUILD_TYPE=Debug \
|
||||
-D CMAKE_CXX_FLAGS_DEBUG="-Og -g" \
|
||||
-D DOWNLOAD_POTENTIALS=off \
|
||||
-D FFT=KISS \
|
||||
-D BUILD_MPI=on \
|
||||
-D BUILD_SHARED_LIBS=on \
|
||||
-D BUILD_TOOLS=off \
|
||||
-D ENABLE_TESTING=off \
|
||||
-D MLIAP_ENABLE_ACE=on \
|
||||
-D MLIAP_ENABLE_PYTHON=off \
|
||||
-D PKG_AWPMD=on \
|
||||
-D PKG_GPU=on \
|
||||
-D GPU_API=opencl \
|
||||
-D PKG_KOKKOS=on \
|
||||
-D PKG_LATBOLTZ=on \
|
||||
-D PKG_MDI=on \
|
||||
-D PKG_MANIFOLD=on \
|
||||
-D PKG_ML-PACE=on \
|
||||
-D PKG_ML-RANN=off \
|
||||
-D PKG_MOLFILE=on \
|
||||
-D PKG_RHEO=on \
|
||||
-D PKG_PTM=on \
|
||||
-D PKG_PYTHON=on \
|
||||
-D PKG_QTB=on \
|
||||
-D PKG_SMTBQ=on \
|
||||
-G Ninja
|
||||
cmake --build build
|
||||
ccache -s
|
||||
89
.github/workflows/check-vla.yml
vendored
89
.github/workflows/check-vla.yml
vendored
@ -1,89 +0,0 @@
|
||||
# GitHub action to build LAMMPS on Linux with gcc and -Werror=vla
|
||||
name: "Check for Variable Length Arrays"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build with -Werror=vla
|
||||
if: ${{ github.repository == 'lammps/lammps' }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Install extra packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ccache \
|
||||
libeigen3-dev \
|
||||
libcurl4-openssl-dev \
|
||||
mold \
|
||||
mpi-default-bin \
|
||||
mpi-default-dev \
|
||||
ninja-build \
|
||||
python3-dev
|
||||
|
||||
- name: Create Build Environment
|
||||
run: mkdir build
|
||||
|
||||
- name: Set up ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: linux-vla-ccache-${{ github.sha }}
|
||||
restore-keys: linux-vla-ccache-
|
||||
|
||||
- name: Building LAMMPS via CMake
|
||||
shell: bash
|
||||
run: |
|
||||
ccache -z
|
||||
python3 -m venv linuxenv
|
||||
source linuxenv/bin/activate
|
||||
python3 -m pip install numpy
|
||||
python3 -m pip install pyyaml
|
||||
cmake -S cmake -B build \
|
||||
-C cmake/presets/most.cmake \
|
||||
-D CMAKE_CXX_COMPILER=g++ \
|
||||
-D CMAKE_C_COMPILER=gcc \
|
||||
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-D CMAKE_BUILD_TYPE=Debug \
|
||||
-D CMAKE_CXX_FLAGS_DEBUG="-Og -g -Werror=vla" \
|
||||
-D DOWNLOAD_POTENTIALS=off \
|
||||
-D BUILD_MPI=on \
|
||||
-D BUILD_SHARED_LIBS=off \
|
||||
-D BUILD_TOOLS=off \
|
||||
-D ENABLE_TESTING=off \
|
||||
-D MLIAP_ENABLE_ACE=on \
|
||||
-D MLIAP_ENABLE_PYTHON=off \
|
||||
-D PKG_AWPMD=on \
|
||||
-D PKG_GPU=on \
|
||||
-D GPU_API=opencl \
|
||||
-D PKG_LATBOLTZ=on \
|
||||
-D PKG_MDI=on \
|
||||
-D PKG_MANIFOLD=on \
|
||||
-D PKG_ML-PACE=on \
|
||||
-D PKG_ML-RANN=on \
|
||||
-D PKG_MOLFILE=on \
|
||||
-D PKG_RHEO=on \
|
||||
-D PKG_PTM=on \
|
||||
-D PKG_PYTHON=on \
|
||||
-D PKG_QTB=on \
|
||||
-D PKG_SMTBQ=on \
|
||||
-G Ninja
|
||||
cmake --build build
|
||||
ccache -s
|
||||
51
.github/workflows/compile-msvc.yml
vendored
51
.github/workflows/compile-msvc.yml
vendored
@ -1,5 +1,5 @@
|
||||
# GitHub action to test LAMMPS on Windows with Visual C++
|
||||
name: "Windows Unit Tests"
|
||||
# GitHub action to build LAMMPS on Windows with Visual C++
|
||||
name: "Native Windows Compilation and Unit Tests"
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -11,17 +11,11 @@ on:
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{github.event_name == 'pull_request'}}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Windows Compilation Test
|
||||
if: ${{ github.repository == 'lammps/lammps' }}
|
||||
runs-on: windows-latest
|
||||
env:
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
@ -29,41 +23,36 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Enable MSVC++
|
||||
uses: lammps/setup-msvc-dev@v3
|
||||
with:
|
||||
arch: x64
|
||||
|
||||
- name: Install Ccache
|
||||
run: |
|
||||
choco install ccache ninja -y
|
||||
|
||||
- name: Set up ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: win-unit-ccache-${{ github.sha }}
|
||||
restore-keys: win-unit-ccache-
|
||||
|
||||
- name: Select Python version
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Building LAMMPS via CMake
|
||||
shell: bash
|
||||
run: |
|
||||
ccache -z
|
||||
python3 -m pip install numpy
|
||||
python3 -m pip install pyyaml
|
||||
cmake -C cmake\presets\windows.cmake -D CMAKE_CXX_COMPILER=cl -D CMAKE_CXX_COMPILER_LAUNCHER=ccache -D CMAKE_C_COMPILER=cl -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_Fortran_COMPILER="" -D DOWNLOAD_POTENTIALS=off -D PKG_PYTHON=on -D WITH_PNG=off -D WITH_JPEG=off -S cmake -B build -D BUILD_SHARED_LIBS=on -D ENABLE_TESTING=on -D CMAKE_BUILD_TYPE=Release -G Ninja
|
||||
cmake --build build
|
||||
ccache -s
|
||||
nuget install MSMPIsdk
|
||||
nuget install MSMPIDIST
|
||||
cmake -C cmake/presets/windows.cmake \
|
||||
-D DOWNLOAD_POTENTIALS=off \
|
||||
-D PKG_PYTHON=on \
|
||||
-D WITH_PNG=off \
|
||||
-D WITH_JPEG=off \
|
||||
-S cmake -B build \
|
||||
-D BUILD_SHARED_LIBS=on \
|
||||
-D LAMMPS_EXCEPTIONS=on \
|
||||
-D ENABLE_TESTING=on
|
||||
cmake --build build --config Release --parallel 2
|
||||
|
||||
- name: Run LAMMPS executable
|
||||
shell: bash
|
||||
run: |
|
||||
build\lmp.exe -h
|
||||
build\lmp.exe -in bench\in.lj
|
||||
./build/Release/lmp.exe -h
|
||||
./build/Release/lmp.exe -in bench/in.lj
|
||||
|
||||
- name: Run Unit Tests
|
||||
working-directory: build
|
||||
run: ctest -V -E FixTimestep:python_move_nve
|
||||
shell: bash
|
||||
run: ctest -V -C Release -E FixTimestep:python_move_nve
|
||||
|
||||
1
.github/workflows/coverity.yml
vendored
1
.github/workflows/coverity.yml
vendored
@ -67,6 +67,7 @@ jobs:
|
||||
-D PKG_MANIFOLD=on \
|
||||
-D PKG_MDI=on \
|
||||
-D PKG_MGPT=on \
|
||||
-D PKG_ML-PACE=on \
|
||||
-D PKG_ML-RANN=on \
|
||||
-D PKG_MOLFILE=on \
|
||||
-D PKG_NETCDF=on \
|
||||
|
||||
109
.github/workflows/full-regression.yml
vendored
109
.github/workflows/full-regression.yml
vendored
@ -1,109 +0,0 @@
|
||||
# GitHub action to build LAMMPS on Linux and run regression tests
|
||||
name: "Full Regression Test"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build LAMMPS
|
||||
# restrict to official LAMMPS repository
|
||||
if: ${{ github.repository == 'lammps/lammps' }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
strategy:
|
||||
max-parallel: 8
|
||||
matrix:
|
||||
idx: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 2
|
||||
show-progress: false
|
||||
|
||||
- name: Install extra packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ccache ninja-build libeigen3-dev \
|
||||
libcurl4-openssl-dev python3-dev \
|
||||
mpi-default-bin mpi-default-dev
|
||||
|
||||
- name: Create Build Environment
|
||||
run: mkdir build
|
||||
|
||||
- name: Set up ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: linux-full-ccache-${{ github.sha }}
|
||||
restore-keys: linux-full-ccache-
|
||||
|
||||
- name: Building LAMMPS via CMake
|
||||
shell: bash
|
||||
run: |
|
||||
ccache -z
|
||||
python3 -m venv linuxenv
|
||||
source linuxenv/bin/activate
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install numpy pyyaml junit_xml
|
||||
cmake -S cmake -B build \
|
||||
-C cmake/presets/gcc.cmake \
|
||||
-C cmake/presets/most.cmake \
|
||||
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-D BUILD_SHARED_LIBS=off \
|
||||
-D DOWNLOAD_POTENTIALS=off \
|
||||
-D PKG_MANIFOLD=on \
|
||||
-D PKG_ML-PACE=on \
|
||||
-D PKG_ML-RANN=on \
|
||||
-D PKG_RHEO=on \
|
||||
-D PKG_PTM=on \
|
||||
-D PKG_PYTHON=on \
|
||||
-D PKG_QTB=on \
|
||||
-D PKG_SMTBQ=on \
|
||||
-G Ninja
|
||||
cmake --build build
|
||||
ccache -s
|
||||
|
||||
- name: Run Full Regression Tests
|
||||
shell: bash
|
||||
run: |
|
||||
source linuxenv/bin/activate
|
||||
python3 tools/regression-tests/run_tests.py \
|
||||
--lmp-bin=build/lmp \
|
||||
--config-file=tools/regression-tests/config_serial.yaml \
|
||||
--examples-top-level=examples --analyze --num-workers=8
|
||||
|
||||
python3 tools/regression-tests/run_tests.py \
|
||||
--lmp-bin=build/lmp \
|
||||
--config-file=tools/regression-tests/config_serial.yaml \
|
||||
--list-input=input-list-${{ matrix.idx }}.txt \
|
||||
--output-file=output-${{ matrix.idx }}.xml \
|
||||
--progress-file=progress-${{ matrix.idx }}.yaml \
|
||||
--log-file=run-${{ matrix.idx }}.log
|
||||
|
||||
tar -cvf full-regression-test-${{ matrix.idx }}.tar run-${{ matrix.idx }}.log progress-${{ matrix.idx }}.yaml output-${{ matrix.idx }}.xml
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: full-regression-test-artifact-${{ matrix.idx }}
|
||||
path: full-regression-test-${{ matrix.idx }}.tar
|
||||
|
||||
merge:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Merge Artifacts
|
||||
uses: actions/upload-artifact/merge@v4
|
||||
with:
|
||||
name: merged-full-regresssion-artifact
|
||||
pattern: full-regression-test-artifact-*
|
||||
|
||||
126
.github/workflows/kokkos-regression.yaml
vendored
126
.github/workflows/kokkos-regression.yaml
vendored
@ -1,126 +0,0 @@
|
||||
# GitHub action to build LAMMPS on Linux and run selected regression tests
|
||||
name: "Kokkos OpenMP Regression Test"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build LAMMPS with Kokkos OpenMP
|
||||
# restrict to official LAMMPS repository
|
||||
if: ${{ github.repository == 'lammps/lammps' }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
strategy:
|
||||
max-parallel: 6
|
||||
matrix:
|
||||
idx: [ 'pair-0', 'pair-1', 'fix-0', 'fix-1', 'compute', 'misc' ]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 2
|
||||
show-progress: false
|
||||
|
||||
- name: Install extra packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ccache ninja-build libeigen3-dev \
|
||||
libcurl4-openssl-dev python3-dev \
|
||||
mpi-default-bin mpi-default-dev
|
||||
|
||||
- name: Create Build Environment
|
||||
run: mkdir build
|
||||
|
||||
- name: Set up ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: linux-kokkos-ccache-${{ github.sha }}
|
||||
restore-keys: linux-kokkos-ccache-
|
||||
|
||||
- name: Building LAMMPS via CMake
|
||||
shell: bash
|
||||
run: |
|
||||
ccache -z
|
||||
python3 -m venv linuxenv
|
||||
source linuxenv/bin/activate
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install numpy pyyaml junit_xml
|
||||
cmake -S cmake -B build \
|
||||
-C cmake/presets/gcc.cmake \
|
||||
-C cmake/presets/basic.cmake \
|
||||
-C cmake/presets/kokkos-openmp.cmake \
|
||||
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-D BUILD_SHARED_LIBS=off \
|
||||
-D DOWNLOAD_POTENTIALS=off \
|
||||
-D PKG_AMOEBA=on \
|
||||
-D PKG_ASPHERE=on \
|
||||
-D PKG_BROWNIAN=on \
|
||||
-D PKG_CLASS2=on \
|
||||
-D PKG_COLLOID=on \
|
||||
-D PKG_CORESHELL=on \
|
||||
-D PKG_DIPOLE=on \
|
||||
-D PKG_DPD-BASIC=on \
|
||||
-D PKG_EXTRA-COMPUTE=on \
|
||||
-D PKG_EXTRA-FIX=on \
|
||||
-D PKG_EXTRA-MOLECULE=on \
|
||||
-D PKG_EXTRA-PAIR=on \
|
||||
-D PKG_GRANULAR=on \
|
||||
-D PKG_LEPTON=on \
|
||||
-D PKG_MC=on \
|
||||
-D PKG_MEAM=on \
|
||||
-D PKG_POEMS=on \
|
||||
-D PKG_PYTHON=on \
|
||||
-D PKG_QEQ=on \
|
||||
-D PKG_REAXFF=on \
|
||||
-D PKG_REPLICA=on \
|
||||
-D PKG_SRD=on \
|
||||
-D PKG_SPH=on \
|
||||
-D PKG_VORONOI=on \
|
||||
-G Ninja
|
||||
cmake --build build
|
||||
ccache -s
|
||||
|
||||
- name: Run Regression Tests for Selected Examples
|
||||
shell: bash
|
||||
run: |
|
||||
source linuxenv/bin/activate
|
||||
python3 tools/regression-tests/get_kokkos_input.py \
|
||||
--examples-top-level=examples --batch-size=50 \
|
||||
--filter-out="balance;fire;gcmc;granregion;hyper;mc;mdi;mliap;neb;pace;prd;pour;python;rigid;snap;streitz;shear;ttm"
|
||||
|
||||
export OMP_PROC_BIND=false
|
||||
python3 tools/regression-tests/run_tests.py \
|
||||
--lmp-bin=build/lmp \
|
||||
--config-file=tools/regression-tests/config_kokkos_openmp.yaml \
|
||||
--list-input=input-list-${{ matrix.idx }}-kk.txt \
|
||||
--output-file=output-${{ matrix.idx }}.xml \
|
||||
--progress-file=progress-${{ matrix.idx }}.yaml \
|
||||
--log-file=run-${{ matrix.idx }}.log \
|
||||
--quick-max=100
|
||||
|
||||
tar -cvf kokkos-regression-test-${{ matrix.idx }}.tar run-${{ matrix.idx }}.log progress-${{ matrix.idx }}.yaml output-${{ matrix.idx }}.xml
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: kokkos-regression-test-artifact-${{ matrix.idx }}
|
||||
path: kokkos-regression-test-${{ matrix.idx }}.tar
|
||||
|
||||
merge:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Merge Artifacts
|
||||
uses: actions/upload-artifact/merge@v4
|
||||
with:
|
||||
name: merged-kokkos-regresssion-artifact
|
||||
pattern: kokkos-regression-test-artifact-*
|
||||
53
.github/workflows/lammps-gui-flatpak.yml
vendored
53
.github/workflows/lammps-gui-flatpak.yml
vendored
@ -1,53 +0,0 @@
|
||||
# GitHub action to build LAMMPS-GUI as a flatpak bundle
|
||||
name: "Build LAMMPS-GUI as flatpak bundle"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{github.event_name == 'pull_request'}}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: LAMMPS-GUI flatpak build
|
||||
if: ${{ github.repository == 'lammps/lammps' }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Install extra packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ccache \
|
||||
libeigen3-dev \
|
||||
libcurl4-openssl-dev \
|
||||
mold \
|
||||
ninja-build \
|
||||
python3-dev \
|
||||
flatpak \
|
||||
flatpak-builder
|
||||
|
||||
- name: Set up access to flatpak repo
|
||||
run: flatpak --user remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
|
||||
|
||||
- name: Build flatpak
|
||||
run: |
|
||||
mkdir flatpack-state
|
||||
sed -i -e 's/branch:.*/branch: develop/' tools/lammps-gui/org.lammps.lammps-gui.yml
|
||||
flatpak-builder --force-clean --verbose --repo=flatpak-repo \
|
||||
--install-deps-from=flathub --state-dir=flatpak-state \
|
||||
--user --ccache --default-branch=${{ github.ref_name }} \
|
||||
flatpak-build tools/lammps-gui/org.lammps.lammps-gui.yml
|
||||
flatpak build-bundle --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo \
|
||||
--verbose flatpak-repo LAMMPS-Linux-x86_64-GUI.flatpak \
|
||||
org.lammps.lammps-gui ${{ github.ref_name }}
|
||||
flatpak install -y -v --user LAMMPS-Linux-x86_64-GUI.flatpak
|
||||
118
.github/workflows/quick-regression.yml
vendored
118
.github/workflows/quick-regression.yml
vendored
@ -1,118 +0,0 @@
|
||||
# GitHub action to build LAMMPS on Linux and run selected regression tests
|
||||
name: "Quick Regression Test"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{github.event_name == 'pull_request'}}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build LAMMPS
|
||||
# restrict to official LAMMPS repository
|
||||
if: ${{ github.repository == 'lammps/lammps' }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
strategy:
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
idx: [ 0, 1, 2, 3 ]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
show-progress: false
|
||||
|
||||
- name: Install extra packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ccache ninja-build libeigen3-dev \
|
||||
libcurl4-openssl-dev python3-dev \
|
||||
mpi-default-bin mpi-default-dev
|
||||
|
||||
- name: Create Build Environment
|
||||
run: mkdir build
|
||||
|
||||
- name: Set up ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: linux-quick-ccache-${{ github.sha }}
|
||||
restore-keys: linux-quick-ccache-
|
||||
|
||||
- name: Building LAMMPS via CMake
|
||||
shell: bash
|
||||
run: |
|
||||
ccache -z
|
||||
python3 -m venv linuxenv
|
||||
source linuxenv/bin/activate
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install numpy pyyaml junit_xml
|
||||
cmake -S cmake -B build \
|
||||
-C cmake/presets/gcc.cmake \
|
||||
-C cmake/presets/most.cmake \
|
||||
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-D BUILD_SHARED_LIBS=off \
|
||||
-D DOWNLOAD_POTENTIALS=off \
|
||||
-D PKG_MANIFOLD=on \
|
||||
-D PKG_ML-PACE=on \
|
||||
-D PKG_ML-RANN=on \
|
||||
-D PKG_RHEO=on \
|
||||
-D PKG_PTM=on \
|
||||
-D PKG_PYTHON=on \
|
||||
-D PKG_QTB=on \
|
||||
-D PKG_SMTBQ=on \
|
||||
-G Ninja
|
||||
cmake --build build
|
||||
ccache -s
|
||||
|
||||
- name: Run Regression Tests for Modified Styles
|
||||
shell: bash
|
||||
run: |
|
||||
source linuxenv/bin/activate
|
||||
python3 tools/regression-tests/run_tests.py \
|
||||
--lmp-bin=build/lmp \
|
||||
--config-file=tools/regression-tests/config_quick.yaml \
|
||||
--examples-top-level=examples \
|
||||
--quick-reference=tools/regression-tests/reference.yaml \
|
||||
--quick --quick-branch=origin/develop --quick-max=100 --num-workers=4
|
||||
|
||||
if [ -f input-list-${{ matrix.idx }}.txt ]
|
||||
then \
|
||||
python3 tools/regression-tests/run_tests.py \
|
||||
--lmp-bin=build/lmp \
|
||||
--config-file=tools/regression-tests/config_quick.yaml \
|
||||
--list-input=input-list-${{ matrix.idx }}.txt \
|
||||
--output-file=output-${{ matrix.idx }}.xml \
|
||||
--progress-file=progress-${{ matrix.idx }}.yaml \
|
||||
--log-file=run-${{ matrix.idx }}.log
|
||||
fi
|
||||
|
||||
tar -cvf quick-regression-test-${{ matrix.idx }}.tar run-${{ matrix.idx }}.log progress-${{ matrix.idx }}.yaml output-${{ matrix.idx }}.xml
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: quick-regression-test-artifact-${{ matrix.idx }}
|
||||
path: quick-regression-test-${{ matrix.idx }}.tar
|
||||
|
||||
merge:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Merge Artifacts
|
||||
uses: actions/upload-artifact/merge@v4
|
||||
with:
|
||||
name: merged-quick-regresssion-artifact
|
||||
pattern: quick-regression-test-artifact-*
|
||||
|
||||
38
.github/workflows/style-check.yml
vendored
38
.github/workflows/style-check.yml
vendored
@ -1,38 +0,0 @@
|
||||
# GitHub action to run checks from tools/coding_standard
|
||||
name: "Check for Programming Style Conformance"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{github.event_name == 'pull_request'}}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Programming Style Conformance
|
||||
if: ${{ github.repository == 'lammps/lammps' }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Run Tests
|
||||
working-directory: src
|
||||
shell: bash
|
||||
run: |
|
||||
make check-whitespace
|
||||
make check-permissions
|
||||
make check-homepage
|
||||
make check-errordocs
|
||||
make check-fmtlib
|
||||
81
.github/workflows/unittest-arm64.yml
vendored
81
.github/workflows/unittest-arm64.yml
vendored
@ -1,81 +0,0 @@
|
||||
# GitHub action to build LAMMPS on Linux with ARM64 and run standard unit tests
|
||||
name: "Unittest for Linux on ARM64"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [develop]
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{github.event_name == 'pull_request'}}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Linux ARM64 Unit Test
|
||||
if: ${{ github.repository == 'lammps/lammps' }}
|
||||
runs-on: ubuntu-22.04-arm
|
||||
env:
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Install extra packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ccache \
|
||||
libeigen3-dev \
|
||||
libcurl4-openssl-dev \
|
||||
mold \
|
||||
ninja-build \
|
||||
python3-dev
|
||||
|
||||
- name: Create Build Environment
|
||||
run: mkdir build
|
||||
|
||||
- name: Set up ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: linux-unit-ccache-${{ github.sha }}
|
||||
restore-keys: linux-unit-ccache-
|
||||
|
||||
- name: Building LAMMPS via CMake
|
||||
shell: bash
|
||||
run: |
|
||||
ccache -z
|
||||
python3 -m venv linuxenv
|
||||
source linuxenv/bin/activate
|
||||
python3 -m pip install numpy
|
||||
python3 -m pip install pyyaml
|
||||
cmake -S cmake -B build \
|
||||
-C cmake/presets/gcc.cmake \
|
||||
-C cmake/presets/most.cmake \
|
||||
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-D BUILD_SHARED_LIBS=on \
|
||||
-D DOWNLOAD_POTENTIALS=off \
|
||||
-D ENABLE_TESTING=on \
|
||||
-D MLIAP_ENABLE_ACE=on \
|
||||
-D MLIAP_ENABLE_PYTHON=off \
|
||||
-D PKG_MANIFOLD=on \
|
||||
-D PKG_ML-PACE=on \
|
||||
-D PKG_ML-RANN=on \
|
||||
-D PKG_RHEO=on \
|
||||
-D PKG_PTM=on \
|
||||
-D PKG_PYTHON=on \
|
||||
-D PKG_QTB=on \
|
||||
-D PKG_SMTBQ=on \
|
||||
-G Ninja
|
||||
cmake --build build
|
||||
ccache -s
|
||||
|
||||
- name: Run Tests
|
||||
working-directory: build
|
||||
shell: bash
|
||||
run: ctest -V -LE unstable
|
||||
86
.github/workflows/unittest-linux.yml
vendored
86
.github/workflows/unittest-linux.yml
vendored
@ -1,86 +0,0 @@
|
||||
# GitHub action to build LAMMPS on Linux and run standard unit tests
|
||||
name: "Unittest for Linux /w LAMMPS_BIGBIG"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{github.event_name == 'pull_request'}}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Linux Unit Test
|
||||
if: ${{ github.repository == 'lammps/lammps' }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Install extra packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ccache \
|
||||
libeigen3-dev \
|
||||
libcurl4-openssl-dev \
|
||||
mold \
|
||||
ninja-build \
|
||||
python3-dev
|
||||
|
||||
- name: Create Build Environment
|
||||
run: mkdir build
|
||||
|
||||
- name: Set up ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: linux-unit-ccache-${{ github.sha }}
|
||||
restore-keys: linux-unit-ccache-
|
||||
|
||||
- name: Building LAMMPS via CMake
|
||||
shell: bash
|
||||
run: |
|
||||
ccache -z
|
||||
python3 -m venv linuxenv
|
||||
source linuxenv/bin/activate
|
||||
python3 -m pip install numpy
|
||||
python3 -m pip install pyyaml
|
||||
cmake -S cmake -B build \
|
||||
-C cmake/presets/gcc.cmake \
|
||||
-C cmake/presets/most.cmake \
|
||||
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-D BUILD_SHARED_LIBS=on \
|
||||
-D LAMMPS_SIZES=bigbig \
|
||||
-D DOWNLOAD_POTENTIALS=off \
|
||||
-D ENABLE_TESTING=on \
|
||||
-D MLIAP_ENABLE_ACE=on \
|
||||
-D MLIAP_ENABLE_PYTHON=off \
|
||||
-D PKG_MANIFOLD=on \
|
||||
-D PKG_ML-PACE=on \
|
||||
-D PKG_ML-RANN=on \
|
||||
-D PKG_RHEO=on \
|
||||
-D PKG_PTM=on \
|
||||
-D PKG_PYTHON=on \
|
||||
-D PKG_QTB=on \
|
||||
-D PKG_SMTBQ=on \
|
||||
-G Ninja
|
||||
cmake --build build
|
||||
ccache -s
|
||||
|
||||
- name: Run Tests
|
||||
working-directory: build
|
||||
shell: bash
|
||||
run: ctest -V
|
||||
4
.github/workflows/unittest-macos.yml
vendored
4
.github/workflows/unittest-macos.yml
vendored
@ -11,10 +11,6 @@ on:
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{github.event_name == 'pull_request'}}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS Unit Test
|
||||
|
||||
16
README
16
README
@ -23,21 +23,17 @@ more information about the code and its uses.
|
||||
The LAMMPS distribution includes the following files and directories:
|
||||
|
||||
README this file
|
||||
LICENSE the GNU General Public License (GPLv2)
|
||||
CITATION.cff Citation information for LAMMPS in CFF format
|
||||
bench benchmark inputs
|
||||
LICENSE the GNU General Public License (GPL)
|
||||
bench benchmark problems
|
||||
cmake CMake build files
|
||||
doc documentation
|
||||
examples example inputs for many LAMMPS commands
|
||||
fortran Fortran 2003 module for LAMMPS
|
||||
examples simple test problems
|
||||
fortran Fortran wrapper for LAMMPS
|
||||
lib additional provided or external libraries
|
||||
potentials interatomic potential files
|
||||
python Python module for LAMMPS
|
||||
python Python wrappers for LAMMPS
|
||||
src source files
|
||||
third_party Copies of thirdparty software bundled with LAMMPS
|
||||
tools pre- and post-processing tools
|
||||
unittest test programs for use with CTest
|
||||
.github Git and GitHub related files and tools
|
||||
|
||||
Point your browser at any of these files to get started:
|
||||
|
||||
@ -46,8 +42,6 @@ https://docs.lammps.org/Intro.html hi-level introduction
|
||||
https://docs.lammps.org/Build.html how to build LAMMPS
|
||||
https://docs.lammps.org/Run_head.html how to run LAMMPS
|
||||
https://docs.lammps.org/Commands_all.html Table of available commands
|
||||
https://docs.lammps.org/Howto.html Short tutorials and HowTo discussions
|
||||
https://docs.lammps.org/Errors.html How to interpret and debug errors
|
||||
https://docs.lammps.org/Library.html LAMMPS library interfaces
|
||||
https://docs.lammps.org/Modify.html how to modify and extend LAMMPS
|
||||
https://docs.lammps.org/Developer.html LAMMPS developer info
|
||||
|
||||
@ -4,10 +4,6 @@
|
||||
# This file is part of LAMMPS
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
########################################
|
||||
# initialize version variables with project command
|
||||
if(POLICY CMP0048)
|
||||
cmake_policy(SET CMP0048 NEW)
|
||||
endif()
|
||||
# set policy to silence warnings about ignoring <PackageName>_ROOT but use it
|
||||
if(POLICY CMP0074)
|
||||
cmake_policy(SET CMP0074 NEW)
|
||||
@ -28,10 +24,7 @@ endif()
|
||||
|
||||
########################################
|
||||
|
||||
project(lammps
|
||||
DESCRIPTION "The LAMMPS Molecular Dynamics Simulator"
|
||||
HOMEPAGE_URL "https://www.lammps.org"
|
||||
LANGUAGES CXX C)
|
||||
project(lammps CXX)
|
||||
set(SOVERSION 0)
|
||||
get_property(BUILD_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
|
||||
@ -48,7 +41,6 @@ set(LAMMPS_DOC_DIR ${LAMMPS_DIR}/doc)
|
||||
set(LAMMPS_TOOLS_DIR ${LAMMPS_DIR}/tools)
|
||||
set(LAMMPS_PYTHON_DIR ${LAMMPS_DIR}/python)
|
||||
set(LAMMPS_POTENTIALS_DIR ${LAMMPS_DIR}/potentials)
|
||||
set(LAMMPS_THIRDPARTY_DIR ${LAMMPS_DIR}/third_party)
|
||||
|
||||
set(LAMMPS_DOWNLOADS_URL "https://download.lammps.org" CACHE STRING "Base URL for LAMMPS downloads")
|
||||
set(LAMMPS_POTENTIALS_URL "${LAMMPS_DOWNLOADS_URL}/potentials")
|
||||
@ -110,45 +102,51 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Qrestrict")
|
||||
endif()
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /QxCOMMON-AVX512")
|
||||
set(CMAKE_TUNE_DEFAULT "/QxCOMMON-AVX512")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /QxHost")
|
||||
set(CMAKE_TUNE_DEFAULT "/QxHost")
|
||||
endif()
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -restrict")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -xCOMMON-AVX512")
|
||||
set(CMAKE_TUNE_DEFAULT "-xCOMMON-AVX512")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -xHost -fp-model fast=2 -no-prec-div -qoverride-limits -diag-disable=10441 -diag-disable=11074 -diag-disable=11076 -diag-disable=2196")
|
||||
set(CMAKE_TUNE_DEFAULT "-xHost -fp-model fast=2 -no-prec-div -qoverride-limits -diag-disable=10441 -diag-disable=11074 -diag-disable=11076 -diag-disable=2196")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# silence excessive warnings for new Intel Compilers
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fp-model precise -Wno-tautological-constant-compare -Wno-unused-command-line-argument")
|
||||
set(CMAKE_TUNE_DEFAULT "-Wno-tautological-constant-compare -Wno-unused-command-line-argument")
|
||||
endif()
|
||||
|
||||
# silence excessive warnings for PGI/NVHPC compilers
|
||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC") OR (CMAKE_CXX_COMPILER_ID STREQUAL "PGI"))
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Minform=severe")
|
||||
set(CMAKE_TUNE_DEFAULT "-Minform=severe")
|
||||
endif()
|
||||
|
||||
# this hack is required to compile fmt lib with CrayClang version 15.0.2
|
||||
# CrayClang is only directly recognized by version 3.28 and later
|
||||
if(CMAKE_VERSION VERSION_LESS 3.28)
|
||||
get_filename_component(_exe "${CMAKE_CXX_COMPILER}" NAME)
|
||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (_exe STREQUAL "crayCC"))
|
||||
set(CMAKE_TUNE_DEFAULT "-DFMT_STATIC_THOUSANDS_SEPARATOR")
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "CrayClang")
|
||||
set(CMAKE_TUNE_DEFAULT "-DFMT_STATIC_THOUSANDS_SEPARATOR")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# silence nvcc warnings
|
||||
if((PKG_KOKKOS) AND (Kokkos_ENABLE_CUDA) AND NOT
|
||||
((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
|
||||
OR (CMAKE_CXX_COMPILER_ID STREQUAL "XLClang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "CrayClang")))
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xcudafe --diag_suppress=unrecognized_pragma,--diag_suppress=128")
|
||||
if((PKG_KOKKOS) AND (Kokkos_ENABLE_CUDA) AND NOT (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
|
||||
set(CMAKE_TUNE_DEFAULT "${CMAKE_TUNE_DEFAULT} -Xcudafe --diag_suppress=unrecognized_pragma")
|
||||
endif()
|
||||
|
||||
# we *require* C++11 without extensions but prefer C++17.
|
||||
# Kokkos requires at least C++17 (currently)
|
||||
# we require C++11 without extensions. Kokkos requires at least C++17 (currently)
|
||||
if(NOT CMAKE_CXX_STANDARD)
|
||||
if(cxx_std_17 IN_LIST CMAKE_CXX_COMPILE_FEATURES)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
else()
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
endif()
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
endif()
|
||||
if(CMAKE_CXX_STANDARD LESS 11)
|
||||
message(FATAL_ERROR "C++ standard must be set to at least 11")
|
||||
@ -156,10 +154,6 @@ endif()
|
||||
if(PKG_KOKKOS AND (CMAKE_CXX_STANDARD LESS 17))
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
endif()
|
||||
# turn off C++17 check in lmptype.h
|
||||
if(LAMMPS_CXX11)
|
||||
add_compile_definitions(LAMMPS_CXX11)
|
||||
endif()
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
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
|
||||
@ -171,7 +165,6 @@ if(MSVC)
|
||||
add_compile_options(/wd4267)
|
||||
add_compile_options(/wd4250)
|
||||
add_compile_options(/EHsc)
|
||||
add_compile_options(/utf-8)
|
||||
endif()
|
||||
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
@ -197,14 +190,10 @@ if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND BUILD_SHARED_LIBS)
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
endif()
|
||||
|
||||
# do not include the (obsolete) MPI C++ bindings which makes for leaner object files
|
||||
# and avoids namespace conflicts. Put this early to increase its visbility.
|
||||
set(MPI_CXX_SKIP_MPICXX TRUE CACHE BOOL "Skip MPI C++ Bindings" FORCE)
|
||||
|
||||
########################################################################
|
||||
# User input options #
|
||||
########################################################################
|
||||
# backward compatibility with older LAMMPS documentation
|
||||
# backward compatibility with CMake before 3.12 and older LAMMPS documentation
|
||||
if (PYTHON_EXECUTABLE)
|
||||
set(Python_EXECUTABLE "${PYTHON_EXECUTABLE}")
|
||||
endif()
|
||||
@ -220,12 +209,6 @@ if(DEFINED ENV{VIRTUAL_ENV} AND NOT Python_EXECUTABLE)
|
||||
" Setting Python interpreter to: ${Python_EXECUTABLE}")
|
||||
endif()
|
||||
|
||||
find_package(Python COMPONENTS Interpreter QUIET)
|
||||
# NOTE: RHEL 8.0 and Ubuntu 18.04LTS ship with Python 3.6, Python 3.8 was EOL in 2024
|
||||
if(Python_VERSION VERSION_LESS 3.6)
|
||||
message(FATAL_ERROR "LAMMPS requires Python 3.6 or later")
|
||||
endif()
|
||||
|
||||
set(LAMMPS_MACHINE "" CACHE STRING "Suffix to append to lmp binary (WON'T enable any features automatically")
|
||||
mark_as_advanced(LAMMPS_MACHINE)
|
||||
if(LAMMPS_MACHINE)
|
||||
@ -238,6 +221,15 @@ option(CMAKE_POSITION_INDEPENDENT_CODE "Create object compatible with shared lib
|
||||
option(BUILD_TOOLS "Build and install LAMMPS tools (msi2lmp, binary2txt, chain)" OFF)
|
||||
option(BUILD_LAMMPS_GUI "Build and install the LAMMPS GUI" OFF)
|
||||
|
||||
# Support using clang-tidy for C++ files with selected options
|
||||
set(ENABLE_CLANG_TIDY OFF CACHE BOOL "Include clang-tidy processing when compiling")
|
||||
if(ENABLE_CLANG_TIDY)
|
||||
set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-checks=-*,performance-trivially-destructible,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,readability-redundant-control-flow,readability-redundant-declaration,readability-redundant-function-ptr-dereference,readability-redundant-member-init,readability-redundant-string-cstr,readability-redundant-string-init,readability-simplify-boolean-expr,readability-static-accessed-through-instance,readability-static-definition-in-anonymous-namespace,readability-qualified-auto,misc-unused-parameters,modernize-deprecated-ios-base-aliases,modernize-loop-convert,modernize-shrink-to-fit,modernize-use-auto,modernize-use-using,modernize-use-override,modernize-use-bool-literals,modernize-use-emplace,modernize-return-braced-init-list,modernize-use-equals-default,modernize-use-equals-delete,modernize-replace-random-shuffle,modernize-deprecated-headers,modernize-use-nullptr,modernize-use-noexcept,modernize-redundant-void-arg;-fix;-header-filter=.*,header-filter=library.h,header-filter=fmt/*.h" CACHE STRING "clang-tidy settings")
|
||||
else()
|
||||
unset(CMAKE_CXX_CLANG_TIDY CACHE)
|
||||
endif()
|
||||
|
||||
|
||||
file(GLOB ALL_SOURCES CONFIGURE_DEPENDS ${LAMMPS_SOURCE_DIR}/[^.]*.cpp)
|
||||
file(GLOB MAIN_SOURCES CONFIGURE_DEPENDS ${LAMMPS_SOURCE_DIR}/main.cpp)
|
||||
list(REMOVE_ITEM ALL_SOURCES ${MAIN_SOURCES})
|
||||
@ -262,7 +254,6 @@ option(CMAKE_VERBOSE_MAKEFILE "Generate verbose Makefiles" OFF)
|
||||
set(STANDARD_PACKAGES
|
||||
ADIOS
|
||||
AMOEBA
|
||||
APIP
|
||||
ASPHERE
|
||||
ATC
|
||||
AWPMD
|
||||
@ -359,12 +350,12 @@ endforeach()
|
||||
# packages with special compiler needs or external libs
|
||||
######################################################
|
||||
target_include_directories(lammps PUBLIC $<BUILD_INTERFACE:${LAMMPS_SOURCE_DIR}>)
|
||||
target_include_directories(lammps PUBLIC $<BUILD_INTERFACE:${LAMMPS_THIRDPARTY_DIR}>)
|
||||
|
||||
if(PKG_ADIOS)
|
||||
# The search for ADIOS2 must come before MPI because
|
||||
# it includes its own MPI search with the latest FindMPI.cmake
|
||||
# script that defines the MPI::MPI_C target
|
||||
enable_language(C)
|
||||
find_package(ADIOS2 REQUIRED)
|
||||
if(BUILD_MPI)
|
||||
if(NOT ADIOS2_HAVE_MPI)
|
||||
@ -379,18 +370,21 @@ if(PKG_ADIOS)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_CROSSCOMPILING)
|
||||
find_package(MPI QUIET COMPONENTS CXX)
|
||||
find_package(MPI QUIET)
|
||||
option(BUILD_MPI "Build MPI version" ${MPI_FOUND})
|
||||
else()
|
||||
option(BUILD_MPI "Build MPI version" OFF)
|
||||
endif()
|
||||
|
||||
if(BUILD_MPI)
|
||||
# do not include the (obsolete) MPI C++ bindings which makes
|
||||
# for leaner object files and avoids namespace conflicts
|
||||
set(MPI_CXX_SKIP_MPICXX TRUE)
|
||||
# We use a non-standard procedure to cross-compile with MPI on Windows
|
||||
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING)
|
||||
include(MPI4WIN)
|
||||
else()
|
||||
find_package(MPI REQUIRED COMPONENTS CXX)
|
||||
find_package(MPI REQUIRED)
|
||||
option(LAMMPS_LONGLONG_TO_LONG "Workaround if your system or MPI version does not recognize 'long long' data types" OFF)
|
||||
if(LAMMPS_LONGLONG_TO_LONG)
|
||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_LONGLONG_TO_LONG)
|
||||
@ -404,8 +398,8 @@ else()
|
||||
target_link_libraries(lammps PUBLIC mpi_stubs)
|
||||
endif()
|
||||
|
||||
set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)")
|
||||
set(LAMMPS_SIZES_VALUES smallbig bigbig)
|
||||
set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallsmall: all 32-bit, smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)")
|
||||
set(LAMMPS_SIZES_VALUES smallbig bigbig smallsmall)
|
||||
set_property(CACHE LAMMPS_SIZES PROPERTY STRINGS ${LAMMPS_SIZES_VALUES})
|
||||
validate_option(LAMMPS_SIZES LAMMPS_SIZES_VALUES)
|
||||
string(TOUPPER ${LAMMPS_SIZES} LAMMPS_SIZES)
|
||||
@ -423,19 +417,6 @@ if(NOT ${LAMMPS_MEMALIGN} STREQUAL "0")
|
||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_MEMALIGN=${LAMMPS_MEMALIGN})
|
||||
endif()
|
||||
|
||||
# this hack is required to compile fmt lib with CrayClang version 15.0.2
|
||||
# CrayClang is only directly recognized by CMake version 3.28 and later
|
||||
if(CMAKE_VERSION VERSION_LESS 3.28)
|
||||
get_filename_component(_exe "${CMAKE_CXX_COMPILER}" NAME)
|
||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (_exe STREQUAL "crayCC"))
|
||||
target_compile_definitions(lammps PRIVATE -DFMT_STATIC_THOUSANDS_SEPARATOR)
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "CrayClang")
|
||||
target_compile_definitions(lammps PRIVATE -DFMT_STATIC_THOUSANDS_SEPARATOR)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# "hard" dependencies between packages resulting
|
||||
# in an error instead of skipping over files
|
||||
pkg_depends(ML-IAP ML-SNAP)
|
||||
@ -451,7 +432,6 @@ pkg_depends(ELECTRODE KSPACE)
|
||||
pkg_depends(EXTRA-MOLECULE MOLECULE)
|
||||
pkg_depends(MESONT MOLECULE)
|
||||
pkg_depends(RHEO BPM)
|
||||
pkg_depends(APIP ML-PACE)
|
||||
|
||||
# detect if we may enable OpenMP support by default
|
||||
set(BUILD_OMP_DEFAULT OFF)
|
||||
@ -494,13 +474,13 @@ if(BUILD_OMP)
|
||||
if(CMAKE_VERSION VERSION_LESS 3.28)
|
||||
get_filename_component(_exe "${CMAKE_CXX_COMPILER}" NAME)
|
||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (_exe STREQUAL "crayCC"))
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fopenmp")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -fopenmp")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_${BTYPE} "${CMAKE_SHARED_LINKER_FLAGS_${BTYPE}} -fopenmp")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS_${BTYPE} "${CMAKE_STATIC_LINKER_FLAGS_${BTYPE}} -fopenmp")
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "CrayClang")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fopenmp")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -fopenmp")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_${BTYPE} "${CMAKE_SHARED_LINKER_FLAGS_${BTYPE}} -fopenmp")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS_${BTYPE} "${CMAKE_STATIC_LINKER_FLAGS_${BTYPE}} -fopenmp")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@ -517,7 +497,8 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") AND (CMAKE_CXX_STANDARD GREATER_EQUA
|
||||
PROPERTIES COMPILE_OPTIONS "-std=c++14")
|
||||
endif()
|
||||
|
||||
if(PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_ML-POD OR PKG_ELECTRODE OR PKG_RHEO OR BUILD_TOOLS)
|
||||
if(PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_ML-POD OR PKG_ELECTRODE OR BUILD_TOOLS)
|
||||
enable_language(C)
|
||||
if (NOT USE_INTERNAL_LINALG)
|
||||
find_package(LAPACK)
|
||||
find_package(BLAS)
|
||||
@ -534,6 +515,22 @@ if(PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_ML-POD OR PKG_ELECTRODE OR PKG_RHE
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(CURL QUIET)
|
||||
option(WITH_CURL "Enable libcurl support" ${CURL_FOUND})
|
||||
if(WITH_CURL)
|
||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_CURL)
|
||||
|
||||
# need to use pkgconfig for fully static bins to find custom static libs
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "LinuxMUSL")
|
||||
include(FindPkgConfig)
|
||||
pkg_check_modules(CURL IMPORTED_TARGET libcurl libssl libcrypto)
|
||||
target_link_libraries(lammps PUBLIC PkgConfig::CURL)
|
||||
else()
|
||||
find_package(CURL REQUIRED)
|
||||
target_link_libraries(lammps PRIVATE CURL::libcurl)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# tweak jpeg library names to avoid linker errors with MinGW cross-compilation
|
||||
set(JPEG_NAMES libjpeg libjpeg-62)
|
||||
find_package(JPEG QUIET)
|
||||
@ -591,22 +588,12 @@ else()
|
||||
endif()
|
||||
|
||||
foreach(PKG_WITH_INCL KSPACE PYTHON ML-IAP VORONOI COLVARS ML-HDNNP MDI MOLFILE NETCDF
|
||||
PLUMED QMMM ML-QUIP SCAFACOS MACHDYN VTK KIM COMPRESS ML-PACE LEPTON EXTRA-COMMAND)
|
||||
PLUMED QMMM ML-QUIP SCAFACOS MACHDYN VTK KIM COMPRESS ML-PACE LEPTON RHEO)
|
||||
if(PKG_${PKG_WITH_INCL})
|
||||
include(Packages/${PKG_WITH_INCL})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# settings for misc packages and styles
|
||||
if(PKG_MISC)
|
||||
option(LAMMPS_ASYNC_IMD "Asynchronous IMD processing" OFF)
|
||||
mark_as_advanced(LAMMPS_ASYNC_IMD)
|
||||
if(LAMMPS_ASYNC_IMD)
|
||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_ASYNC_IMD)
|
||||
message(STATUS "Using IMD in asynchronous mode")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# optionally enable building script wrappers using swig
|
||||
option(WITH_SWIG "Build scripting language wrappers with SWIG" OFF)
|
||||
if(WITH_SWIG)
|
||||
@ -614,6 +601,15 @@ if(WITH_SWIG)
|
||||
add_subdirectory(${LAMMPS_SWIG_DIR} swig)
|
||||
endif()
|
||||
|
||||
set(CMAKE_TUNE_FLAGS "${CMAKE_TUNE_DEFAULT}" CACHE STRING "Compiler and machine specific optimization flags (compilation only)")
|
||||
separate_arguments(CMAKE_TUNE_FLAGS)
|
||||
foreach(_FLAG ${CMAKE_TUNE_FLAGS})
|
||||
target_compile_options(lammps PRIVATE ${_FLAG})
|
||||
# skip these flags when linking the main executable
|
||||
if(NOT (("${_FLAG}" STREQUAL "-Xcudafe") OR (("${_FLAG}" STREQUAL "--diag_suppress=unrecognized_pragma"))))
|
||||
target_compile_options(lmp PRIVATE ${_FLAG})
|
||||
endif()
|
||||
endforeach()
|
||||
########################################################################
|
||||
# Basic system tests (standard libraries, headers, functions, types) #
|
||||
########################################################################
|
||||
@ -842,15 +838,9 @@ foreach(_DEF ${LAMMPS_DEFINES})
|
||||
set(LAMMPS_API_DEFINES "${LAMMPS_API_DEFINES} -D${_DEF}")
|
||||
endforeach()
|
||||
if(BUILD_SHARED_LIBS)
|
||||
install(TARGETS lammps EXPORT LAMMPS_Targets
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
install(TARGETS lammps EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
if(NOT BUILD_MPI)
|
||||
install(TARGETS mpi_stubs EXPORT LAMMPS_Targets
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
install(TARGETS mpi_stubs EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
configure_file(pkgconfig/liblammps.pc.in ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc @ONLY)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
@ -918,7 +908,7 @@ endif()
|
||||
include(Testing)
|
||||
include(CodeCoverage)
|
||||
include(CodingStandard)
|
||||
find_package(ClangFormat 11.0 QUIET)
|
||||
find_package(ClangFormat 11.0)
|
||||
|
||||
if(ClangFormat_FOUND)
|
||||
add_custom_target(format-src
|
||||
@ -991,9 +981,6 @@ message(STATUS "<<< Compilers and Flags: >>>
|
||||
C++ Standard: ${CMAKE_CXX_STANDARD}
|
||||
C++ Flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BTYPE}}
|
||||
Defines: ${DEFINES}")
|
||||
if(CMAKE_CXX_COMPILER_LAUNCHER)
|
||||
message(STATUS " Launcher: ${CMAKE_CXX_COMPILER_LAUNCHER}")
|
||||
endif()
|
||||
get_target_property(OPTIONS lammps COMPILE_OPTIONS)
|
||||
if(OPTIONS)
|
||||
message(" Options: ${OPTIONS}")
|
||||
@ -1012,9 +999,6 @@ if(_index GREATER -1)
|
||||
Type: ${CMAKE_C_COMPILER_ID}
|
||||
Version: ${CMAKE_C_COMPILER_VERSION}
|
||||
C Flags: ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${BTYPE}}")
|
||||
if(CMAKE_C_COMPILER_LAUNCHER)
|
||||
message(STATUS " Launcher: ${CMAKE_C_COMPILER_LAUNCHER}")
|
||||
endif()
|
||||
endif()
|
||||
message(STATUS "<<< Linker flags: >>>")
|
||||
message(STATUS "Executable name: ${LAMMPS_BINARY}")
|
||||
|
||||
@ -7,76 +7,76 @@
|
||||
# For Python coverage the coverage package needs to be installed
|
||||
###############################################################################
|
||||
if(ENABLE_COVERAGE)
|
||||
find_program(GCOVR_BINARY gcovr)
|
||||
find_package_handle_standard_args(GCOVR DEFAULT_MSG GCOVR_BINARY)
|
||||
find_program(GCOVR_BINARY gcovr)
|
||||
find_package_handle_standard_args(GCOVR DEFAULT_MSG GCOVR_BINARY)
|
||||
|
||||
find_program(COVERAGE_BINARY coverage)
|
||||
find_package_handle_standard_args(COVERAGE DEFAULT_MSG COVERAGE_BINARY)
|
||||
find_program(COVERAGE_BINARY coverage)
|
||||
find_package_handle_standard_args(COVERAGE DEFAULT_MSG COVERAGE_BINARY)
|
||||
|
||||
if(GCOVR_FOUND)
|
||||
get_filename_component(ABSOLUTE_LAMMPS_SOURCE_DIR ${LAMMPS_SOURCE_DIR} ABSOLUTE)
|
||||
if(GCOVR_FOUND)
|
||||
get_filename_component(ABSOLUTE_LAMMPS_SOURCE_DIR ${LAMMPS_SOURCE_DIR} ABSOLUTE)
|
||||
|
||||
add_custom_target(
|
||||
gen_coverage_xml
|
||||
COMMAND ${GCOVR_BINARY} -s -x -r ${ABSOLUTE_LAMMPS_SOURCE_DIR} --object-directory=${CMAKE_BINARY_DIR} -o coverage.xml
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMENT "Generating XML coverage report..."
|
||||
)
|
||||
add_custom_target(
|
||||
gen_coverage_xml
|
||||
COMMAND ${GCOVR_BINARY} -s -x -r ${ABSOLUTE_LAMMPS_SOURCE_DIR} --object-directory=${CMAKE_BINARY_DIR} -o coverage.xml
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMENT "Generating XML coverage report..."
|
||||
)
|
||||
|
||||
set(COVERAGE_HTML_DIR ${CMAKE_BINARY_DIR}/coverage_html)
|
||||
set(COVERAGE_HTML_DIR ${CMAKE_BINARY_DIR}/coverage_html)
|
||||
|
||||
add_custom_target(coverage_html_folder
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${COVERAGE_HTML_DIR})
|
||||
add_custom_target(coverage_html_folder
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${COVERAGE_HTML_DIR})
|
||||
|
||||
add_custom_target(
|
||||
gen_coverage_html
|
||||
COMMAND ${GCOVR_BINARY} -s --html --html-details -r ${ABSOLUTE_LAMMPS_SOURCE_DIR} --object-directory=${CMAKE_BINARY_DIR} -o ${COVERAGE_HTML_DIR}/index.html
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMENT "Generating HTML coverage report..."
|
||||
)
|
||||
add_dependencies(gen_coverage_html coverage_html_folder)
|
||||
add_custom_target(
|
||||
gen_coverage_html
|
||||
COMMAND ${GCOVR_BINARY} -s --html --html-details -r ${ABSOLUTE_LAMMPS_SOURCE_DIR} --object-directory=${CMAKE_BINARY_DIR} -o ${COVERAGE_HTML_DIR}/index.html
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMENT "Generating HTML coverage report..."
|
||||
)
|
||||
add_dependencies(gen_coverage_html coverage_html_folder)
|
||||
|
||||
add_custom_target(clean_coverage_html
|
||||
${CMAKE_COMMAND} -E remove_directory ${COVERAGE_HTML_DIR}
|
||||
COMMENT "Deleting HTML coverage report..."
|
||||
)
|
||||
add_custom_target(clean_coverage_html
|
||||
${CMAKE_COMMAND} -E remove_directory ${COVERAGE_HTML_DIR}
|
||||
COMMENT "Deleting HTML coverage report..."
|
||||
)
|
||||
|
||||
add_custom_target(reset_coverage
|
||||
${CMAKE_COMMAND} -E remove -f */*.gcda */*/*.gcda */*/*/*.gcda
|
||||
*/*/*/*/*.gcda */*/*/*/*/*.gcda */*/*/*/*/*/*.gcda
|
||||
*/*/*/*/*/*/*/*.gcda */*/*/*/*/*/*/*/*.gcda
|
||||
*/*/*/*/*/*/*/*/*/*.gcda */*/*/*/*/*/*/*/*/*/*.gcda
|
||||
WORKIND_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMENT "Deleting coverage data files..."
|
||||
)
|
||||
add_dependencies(reset_coverage clean_coverage_html)
|
||||
endif()
|
||||
add_custom_target(reset_coverage
|
||||
${CMAKE_COMMAND} -E remove -f */*.gcda */*/*.gcda */*/*/*.gcda
|
||||
*/*/*/*/*.gcda */*/*/*/*/*.gcda */*/*/*/*/*/*.gcda
|
||||
*/*/*/*/*/*/*/*.gcda */*/*/*/*/*/*/*/*.gcda
|
||||
*/*/*/*/*/*/*/*/*/*.gcda */*/*/*/*/*/*/*/*/*/*.gcda
|
||||
WORKIND_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMENT "Deleting coverage data files..."
|
||||
)
|
||||
add_dependencies(reset_coverage clean_coverage_html)
|
||||
endif()
|
||||
|
||||
if(COVERAGE_FOUND)
|
||||
set(PYTHON_COVERAGE_HTML_DIR ${CMAKE_BINARY_DIR}/python_coverage_html)
|
||||
configure_file(.coveragerc.in ${CMAKE_BINARY_DIR}/.coveragerc @ONLY)
|
||||
if(COVERAGE_FOUND)
|
||||
set(PYTHON_COVERAGE_HTML_DIR ${CMAKE_BINARY_DIR}/python_coverage_html)
|
||||
configure_file(.coveragerc.in ${CMAKE_BINARY_DIR}/.coveragerc @ONLY)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_BINARY_DIR}/unittest/python/.coverage
|
||||
COMMAND ${COVERAGE_BINARY} combine
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/unittest/python
|
||||
COMMENT "Combine Python coverage files..."
|
||||
)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_BINARY_DIR}/unittest/python/.coverage
|
||||
COMMAND ${COVERAGE_BINARY} combine
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/unittest/python
|
||||
COMMENT "Combine Python coverage files..."
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
gen_python_coverage_html
|
||||
COMMAND ${COVERAGE_BINARY} html --rcfile=${CMAKE_BINARY_DIR}/.coveragerc -d ${PYTHON_COVERAGE_HTML_DIR}
|
||||
DEPENDS ${CMAKE_BINARY_DIR}/unittest/python/.coverage ${CMAKE_BINARY_DIR}/.coveragerc
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/unittest/python
|
||||
COMMENT "Generating HTML Python coverage report..."
|
||||
)
|
||||
add_custom_target(
|
||||
gen_python_coverage_html
|
||||
COMMAND ${COVERAGE_BINARY} html --rcfile=${CMAKE_BINARY_DIR}/.coveragerc -d ${PYTHON_COVERAGE_HTML_DIR}
|
||||
DEPENDS ${CMAKE_BINARY_DIR}/unittest/python/.coverage ${CMAKE_BINARY_DIR}/.coveragerc
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/unittest/python
|
||||
COMMENT "Generating HTML Python coverage report..."
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
gen_python_coverage_xml
|
||||
COMMAND ${COVERAGE_BINARY} xml --rcfile=${CMAKE_BINARY_DIR}/.coveragerc -o ${CMAKE_BINARY_DIR}/python_coverage.xml
|
||||
DEPENDS ${CMAKE_BINARY_DIR}/unittest/python/.coverage ${CMAKE_BINARY_DIR}/.coveragerc
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/unittest/python
|
||||
COMMENT "Generating XML Python coverage report..."
|
||||
)
|
||||
endif()
|
||||
add_custom_target(
|
||||
gen_python_coverage_xml
|
||||
COMMAND ${COVERAGE_BINARY} xml --rcfile=${CMAKE_BINARY_DIR}/.coveragerc -o ${CMAKE_BINARY_DIR}/python_coverage.xml
|
||||
DEPENDS ${CMAKE_BINARY_DIR}/unittest/python/.coverage ${CMAKE_BINARY_DIR}/.coveragerc
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/unittest/python
|
||||
COMMENT "Generating XML Python coverage report..."
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -1,39 +1,40 @@
|
||||
# use default (or custom) Python executable.
|
||||
# Python version check is in main CMakeLists.txt file
|
||||
if(Python_EXECUTABLE)
|
||||
# use default (or custom) Python executable, if version is sufficient
|
||||
if(Python_VERSION VERSION_GREATER_EQUAL 3.6)
|
||||
set(Python3_EXECUTABLE ${Python_EXECUTABLE})
|
||||
endif()
|
||||
find_package(Python3 COMPONENTS Interpreter)
|
||||
|
||||
if(Python3_EXECUTABLE)
|
||||
add_custom_target(
|
||||
check-whitespace
|
||||
${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/whitespace.py .
|
||||
WORKING_DIRECTORY ${LAMMPS_DIR}
|
||||
COMMENT "Check for whitespace errors")
|
||||
add_custom_target(
|
||||
check-homepage
|
||||
${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/homepage.py .
|
||||
WORKING_DIRECTORY ${LAMMPS_DIR}
|
||||
COMMENT "Check for homepage URL errors")
|
||||
add_custom_target(
|
||||
check-permissions
|
||||
${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/permissions.py .
|
||||
WORKING_DIRECTORY ${LAMMPS_DIR}
|
||||
COMMENT "Check for permission errors")
|
||||
add_custom_target(
|
||||
fix-whitespace
|
||||
${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/whitespace.py -f .
|
||||
WORKING_DIRECTORY ${LAMMPS_DIR}
|
||||
COMMENT "Fix whitespace errors")
|
||||
add_custom_target(
|
||||
fix-homepage
|
||||
${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/homepage.py -f .
|
||||
WORKING_DIRECTORY ${LAMMPS_DIR}
|
||||
COMMENT "Fix homepage URL errors")
|
||||
add_custom_target(
|
||||
fix-permissions
|
||||
${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/permissions.py -f .
|
||||
WORKING_DIRECTORY ${LAMMPS_DIR}
|
||||
COMMENT "Fix permission errors")
|
||||
if(Python3_VERSION VERSION_GREATER_EQUAL 3.6)
|
||||
add_custom_target(
|
||||
check-whitespace
|
||||
${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/whitespace.py .
|
||||
WORKING_DIRECTORY ${LAMMPS_DIR}
|
||||
COMMENT "Check for whitespace errors")
|
||||
add_custom_target(
|
||||
check-homepage
|
||||
${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/homepage.py .
|
||||
WORKING_DIRECTORY ${LAMMPS_DIR}
|
||||
COMMENT "Check for homepage URL errors")
|
||||
add_custom_target(
|
||||
check-permissions
|
||||
${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/permissions.py .
|
||||
WORKING_DIRECTORY ${LAMMPS_DIR}
|
||||
COMMENT "Check for permission errors")
|
||||
add_custom_target(
|
||||
fix-whitespace
|
||||
${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/whitespace.py -f .
|
||||
WORKING_DIRECTORY ${LAMMPS_DIR}
|
||||
COMMENT "Fix whitespace errors")
|
||||
add_custom_target(
|
||||
fix-homepage
|
||||
${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/homepage.py -f .
|
||||
WORKING_DIRECTORY ${LAMMPS_DIR}
|
||||
COMMENT "Fix homepage URL errors")
|
||||
add_custom_target(
|
||||
fix-permissions
|
||||
${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/permissions.py -f .
|
||||
WORKING_DIRECTORY ${LAMMPS_DIR}
|
||||
COMMENT "Fix permission errors")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -4,8 +4,6 @@
|
||||
option(BUILD_DOC "Build LAMMPS HTML documentation" OFF)
|
||||
|
||||
if(BUILD_DOC)
|
||||
option(BUILD_DOC_VENV "Build LAMMPS documentation virtual environment" ON)
|
||||
mark_as_advanced(BUILD_DOC_VENV)
|
||||
# Current Sphinx versions require at least Python 3.8
|
||||
# use default (or custom) Python executable, if version is sufficient
|
||||
if(Python_VERSION VERSION_GREATER_EQUAL 3.8)
|
||||
@ -13,13 +11,21 @@ if(BUILD_DOC)
|
||||
endif()
|
||||
find_package(Python3 REQUIRED COMPONENTS Interpreter)
|
||||
if(Python3_VERSION VERSION_LESS 3.8)
|
||||
message(FATAL_ERROR "Python 3.8 and up is required to build the LAMMPS HTML documentation")
|
||||
message(FATAL_ERROR "Python 3.8 and up is required to build the HTML documentation")
|
||||
endif()
|
||||
set(VIRTUALENV ${Python3_EXECUTABLE} -m venv)
|
||||
|
||||
find_package(Doxygen 1.8.10 REQUIRED)
|
||||
file(GLOB DOC_SOURCES CONFIGURE_DEPENDS ${LAMMPS_DOC_DIR}/src/[^.]*.rst)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT docenv
|
||||
COMMAND ${VIRTUALENV} docenv
|
||||
)
|
||||
|
||||
set(DOCENV_BINARY_DIR ${CMAKE_BINARY_DIR}/docenv/bin)
|
||||
set(DOCENV_REQUIREMENTS_FILE ${LAMMPS_DOC_DIR}/utils/requirements.txt)
|
||||
|
||||
set(SPHINX_CONFIG_DIR ${LAMMPS_DOC_DIR}/utils/sphinx-config)
|
||||
set(SPHINX_CONFIG_FILE_TEMPLATE ${SPHINX_CONFIG_DIR}/conf.py.in)
|
||||
set(SPHINX_STATIC_DIR ${SPHINX_CONFIG_DIR}/_static)
|
||||
@ -38,35 +44,17 @@ if(BUILD_DOC)
|
||||
# configure paths in conf.py, since relative paths change when file is copied
|
||||
configure_file(${SPHINX_CONFIG_FILE_TEMPLATE} ${DOC_BUILD_CONFIG_FILE})
|
||||
|
||||
if(BUILD_DOC_VENV)
|
||||
add_custom_command(
|
||||
OUTPUT docenv
|
||||
COMMAND ${VIRTUALENV} docenv
|
||||
)
|
||||
add_custom_command(
|
||||
OUTPUT ${DOC_BUILD_DIR}/requirements.txt
|
||||
DEPENDS docenv ${DOCENV_REQUIREMENTS_FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${DOCENV_REQUIREMENTS_FILE} ${DOC_BUILD_DIR}/requirements.txt
|
||||
COMMAND ${DOCENV_BINARY_DIR}/pip $ENV{PIP_OPTIONS} install --upgrade pip
|
||||
COMMAND ${DOCENV_BINARY_DIR}/pip $ENV{PIP_OPTIONS} install --upgrade ${LAMMPS_DOC_DIR}/utils/converters
|
||||
COMMAND ${DOCENV_BINARY_DIR}/pip $ENV{PIP_OPTIONS} install -r ${DOC_BUILD_DIR}/requirements.txt --upgrade
|
||||
)
|
||||
|
||||
set(DOCENV_BINARY_DIR ${CMAKE_BINARY_DIR}/docenv/bin)
|
||||
set(DOCENV_REQUIREMENTS_FILE ${LAMMPS_DOC_DIR}/utils/requirements.txt)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${DOC_BUILD_DIR}/requirements.txt
|
||||
DEPENDS docenv ${DOCENV_REQUIREMENTS_FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${DOCENV_REQUIREMENTS_FILE} ${DOC_BUILD_DIR}/requirements.txt
|
||||
COMMAND ${DOCENV_BINARY_DIR}/pip $ENV{PIP_OPTIONS} install --upgrade pip
|
||||
COMMAND ${DOCENV_BINARY_DIR}/pip $ENV{PIP_OPTIONS} install --upgrade ${LAMMPS_DOC_DIR}/utils/converters
|
||||
COMMAND ${DOCENV_BINARY_DIR}/pip $ENV{PIP_OPTIONS} install -r ${DOC_BUILD_DIR}/requirements.txt --upgrade
|
||||
)
|
||||
|
||||
set(DOCENV_DEPS docenv ${DOC_BUILD_DIR}/requirements.txt)
|
||||
if(NOT TARGET Sphinx::sphinx-build)
|
||||
add_executable(Sphinx::sphinx-build IMPORTED GLOBAL)
|
||||
set_target_properties(Sphinx::sphinx-build PROPERTIES IMPORTED_LOCATION "${DOCENV_BINARY_DIR}/sphinx-build")
|
||||
endif()
|
||||
else()
|
||||
find_package(Sphinx)
|
||||
endif()
|
||||
|
||||
set(MATHJAX_URL "https://github.com/mathjax/MathJax/archive/3.2.2.tar.gz" CACHE STRING "URL for MathJax tarball")
|
||||
set(MATHJAX_MD5 "08dd6ef33ca08870220d9aade2a62845" CACHE STRING "MD5 checksum of 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 "b81661c6e6ba06278e6ae37b30b0c492" CACHE STRING "MD5 checksum of MathJax tarball")
|
||||
mark_as_advanced(MATHJAX_URL)
|
||||
GetFallbackURL(MATHJAX_URL MATHJAX_FALLBACK)
|
||||
|
||||
@ -109,9 +97,8 @@ if(BUILD_DOC)
|
||||
endif()
|
||||
add_custom_command(
|
||||
OUTPUT html
|
||||
DEPENDS ${DOC_SOURCES} ${DOCENV_DEPS} ${DOXYGEN_XML_DIR}/index.xml ${BUILD_DOC_CONFIG_FILE}
|
||||
COMMAND ${Python3_EXECUTABLE} ${LAMMPS_DOC_DIR}/utils/make-globbed-tocs.py -d ${LAMMPS_DOC_DIR}/src
|
||||
COMMAND Sphinx::sphinx-build ${SPHINX_EXTRA_OPTS} -b html -c ${DOC_BUILD_DIR} -d ${DOC_BUILD_DIR}/doctrees ${LAMMPS_DOC_DIR}/src ${DOC_BUILD_DIR}/html
|
||||
DEPENDS ${DOC_SOURCES} docenv ${DOC_BUILD_DIR}/requirements.txt ${DOXYGEN_XML_DIR}/index.xml ${BUILD_DOC_CONFIG_FILE}
|
||||
COMMAND ${DOCENV_BINARY_DIR}/sphinx-build ${SPHINX_EXTRA_OPTS} -b html -c ${DOC_BUILD_DIR} -d ${DOC_BUILD_DIR}/doctrees ${LAMMPS_DOC_DIR}/src ${DOC_BUILD_DIR}/html
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink Manual.html ${DOC_BUILD_DIR}/html/index.html
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LAMMPS_DOC_DIR}/src/PDF ${DOC_BUILD_DIR}/html/PDF
|
||||
COMMAND ${CMAKE_COMMAND} -E remove -f ${DOXYGEN_XML_DIR}/run.stamp
|
||||
|
||||
@ -1,29 +0,0 @@
|
||||
# Find sphinx-build
|
||||
find_program(Sphinx_EXECUTABLE NAMES sphinx-build
|
||||
PATH_SUFFIXES bin
|
||||
DOC "Sphinx documenation build executable")
|
||||
mark_as_advanced(Sphinx_EXECUTABLE)
|
||||
|
||||
if(Sphinx_EXECUTABLE)
|
||||
execute_process(COMMAND ${Sphinx_EXECUTABLE} --version
|
||||
OUTPUT_VARIABLE sphinx_version
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE _sphinx_version_result)
|
||||
|
||||
if(_sphinx_version_result)
|
||||
message(WARNING "Unable to determine sphinx-build verison: ${_sphinx_version_result}")
|
||||
else()
|
||||
string(REGEX REPLACE "sphinx-build ([0-9.]+).*"
|
||||
"\\1"
|
||||
Sphinx_VERSION
|
||||
"${sphinx_version}")
|
||||
endif()
|
||||
|
||||
if(NOT TARGET Sphinx::sphinx-build)
|
||||
add_executable(Sphinx::sphinx-build IMPORTED GLOBAL)
|
||||
set_target_properties(Sphinx::sphinx-build PROPERTIES IMPORTED_LOCATION "${Sphinx_EXECUTABLE}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Sphinx REQUIRED_VARS Sphinx_EXECUTABLE VERSION_VAR Sphinx_VERSION)
|
||||
@ -21,9 +21,9 @@ if(VORO_FOUND)
|
||||
set(VORO_LIBRARIES ${VORO_LIBRARY})
|
||||
set(VORO_INCLUDE_DIRS ${VORO_INCLUDE_DIR})
|
||||
|
||||
if(NOT TARGET VORO::voro++)
|
||||
add_library(VORO::voro++ UNKNOWN IMPORTED)
|
||||
set_target_properties(VORO::voro++ PROPERTIES
|
||||
if(NOT TARGET VORO::VORO)
|
||||
add_library(VORO::VORO UNKNOWN IMPORTED)
|
||||
set_target_properties(VORO::VORO PROPERTIES
|
||||
IMPORTED_LOCATION "${VORO_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${VORO_INCLUDE_DIR}")
|
||||
endif()
|
||||
|
||||
@ -34,26 +34,8 @@ if(MSVC)
|
||||
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_CXX_STANDARD)
|
||||
if(cxx_std_17 IN_LIST CMAKE_CXX_COMPILE_FEATURES)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
else()
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
endif()
|
||||
endif()
|
||||
if(CMAKE_CXX_STANDARD LESS 11)
|
||||
message(FATAL_ERROR "C++ standard must be set to at least 11")
|
||||
endif()
|
||||
if(CMAKE_CXX_STANDARD LESS 17)
|
||||
message(WARNING "Selecting C++17 standard is preferred over C++${CMAKE_CXX_STANDARD}")
|
||||
endif()
|
||||
if(PKG_KOKKOS AND (CMAKE_CXX_STANDARD LESS 17))
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
endif()
|
||||
# turn off C++17 check in lmptype.h
|
||||
if(LAMMPS_CXX11)
|
||||
add_compile_definitions(LAMMPS_CXX11)
|
||||
endif()
|
||||
# C++11 is required
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# Need -restrict with Intel compilers
|
||||
@ -62,9 +44,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
endif()
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
|
||||
|
||||
# skip over obsolete MPI-2 C++ bindings
|
||||
set(MPI_CXX_SKIP_MPICXX TRUE)
|
||||
|
||||
#######
|
||||
# helper functions from LAMMPSUtils.cmake
|
||||
function(validate_option name values)
|
||||
@ -131,7 +110,8 @@ endif()
|
||||
################################################################################
|
||||
# MPI configuration
|
||||
if(NOT CMAKE_CROSSCOMPILING)
|
||||
find_package(MPI QUIET COMPONENTS CXX)
|
||||
set(MPI_CXX_SKIP_MPICXX TRUE)
|
||||
find_package(MPI QUIET)
|
||||
option(BUILD_MPI "Build MPI version" ${MPI_FOUND})
|
||||
else()
|
||||
option(BUILD_MPI "Build MPI version" OFF)
|
||||
@ -143,38 +123,78 @@ if(BUILD_MPI)
|
||||
set(MPI_CXX_SKIP_MPICXX TRUE)
|
||||
# We use a non-standard procedure to cross-compile with MPI on Windows
|
||||
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING)
|
||||
message(STATUS "Downloading and configuring MS-MPI 10.1 for Windows cross-compilation")
|
||||
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/msmpi-win64-devel.tar.gz" CACHE STRING "URL for MS-MPI (win64) 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_MD5)
|
||||
# Download and configure MinGW compatible MPICH development files for Windows
|
||||
option(USE_MSMPI "Use Microsoft's MS-MPI SDK instead of MPICH2-1.4.1" OFF)
|
||||
if(USE_MSMPI)
|
||||
message(STATUS "Downloading and configuring MS-MPI 10.1 for Windows cross-compilation")
|
||||
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/msmpi-win64-devel.tar.gz" CACHE STRING "URL for MS-MPI (win64) 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_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/libmsmpi.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()
|
||||
message(FATAL_ERROR "Only x86 64-bit builds are supported with MS-MPI")
|
||||
# Download and configure custom MPICH files for Windows
|
||||
message(STATUS "Downloading and configuring MPICH-1.4.1 for Windows")
|
||||
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win64-devel.tar.gz" CACHE STRING "URL for MPICH2 (win64) tarball")
|
||||
set(MPICH2_WIN64_DEVEL_MD5 "4939fdb59d13182fd5dd65211e469f14" CACHE STRING "MD5 checksum of MPICH2 (win64) tarball")
|
||||
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()
|
||||
|
||||
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=1")
|
||||
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=1")
|
||||
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmsmpi.a")
|
||||
else()
|
||||
find_package(MPI REQUIRED COMPONENTS CXX)
|
||||
find_package(MPI REQUIRED)
|
||||
option(LAMMPS_LONGLONG_TO_LONG "Workaround if your system or MPI version does not recognize 'long long' data types" OFF)
|
||||
if(LAMMPS_LONGLONG_TO_LONG)
|
||||
target_compile_definitions(lammps INTERFACE -DLAMMPS_LONGLONG_TO_LONG)
|
||||
@ -222,8 +242,8 @@ endif()
|
||||
|
||||
################
|
||||
# integer size selection
|
||||
set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)")
|
||||
set(LAMMPS_SIZES_VALUES smallbig bigbig)
|
||||
set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallsmall: all 32-bit, smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)")
|
||||
set(LAMMPS_SIZES_VALUES smallbig bigbig smallsmall)
|
||||
set_property(CACHE LAMMPS_SIZES PROPERTY STRINGS ${LAMMPS_SIZES_VALUES})
|
||||
validate_option(LAMMPS_SIZES LAMMPS_SIZES_VALUES)
|
||||
string(TOUPPER ${LAMMPS_SIZES} LAMMPS_SIZES)
|
||||
|
||||
@ -30,7 +30,7 @@ function(check_omp_h_include)
|
||||
if(OpenMP_CXX_FOUND)
|
||||
set(CMAKE_REQUIRED_FLAGS ${OpenMP_CXX_FLAGS})
|
||||
set(CMAKE_REQUIRED_INCLUDES ${OpenMP_CXX_INCLUDE_DIRS})
|
||||
separate_arguments(CMAKE_REQUIRED_LINK_OPTIONS NATIVE_COMMAND ${OpenMP_CXX_FLAGS}) # needs to be a list
|
||||
set(CMAKE_REQUIRED_LINK_OPTIONS ${OpenMP_CXX_FLAGS})
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${OpenMP_CXX_LIBRARIES})
|
||||
# there are all kinds of problems with finding omp.h
|
||||
# for Clang and derived compilers so we pretend it is there.
|
||||
@ -75,25 +75,13 @@ function(get_lammps_version version_header variable)
|
||||
list(FIND MONTHS "${month}" month)
|
||||
string(LENGTH ${day} day_length)
|
||||
string(LENGTH ${month} month_length)
|
||||
# no leading zero needed for new version string with dots
|
||||
# if(day_length EQUAL 1)
|
||||
# set(day "0${day}")
|
||||
# endif()
|
||||
# if(month_length EQUAL 1)
|
||||
# set(month "0${month}")
|
||||
#endif()
|
||||
file(STRINGS ${version_header} line REGEX LAMMPS_UPDATE)
|
||||
string(REGEX REPLACE "#define LAMMPS_UPDATE \"Update ([0-9]+)\"" "\\1" tweak "${line}")
|
||||
if (line MATCHES "#define LAMMPS_UPDATE \"(Maintenance|Development)\"")
|
||||
set(tweak "99")
|
||||
if(day_length EQUAL 1)
|
||||
set(day "0${day}")
|
||||
endif()
|
||||
if(NOT tweak)
|
||||
set(tweak "0")
|
||||
if(month_length EQUAL 1)
|
||||
set(month "0${month}")
|
||||
endif()
|
||||
# new version string with dots
|
||||
set(${variable} "${year}.${month}.${day}.${tweak}" PARENT_SCOPE)
|
||||
# old version string without dots
|
||||
# set(${variable} "${year}${month}${day}" PARENT_SCOPE)
|
||||
set(${variable} "${year}${month}${day}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(check_for_autogen_files source_dir)
|
||||
|
||||
@ -1,31 +1,74 @@
|
||||
# set-up MS-MPI library for Windows with MinGW compatibility
|
||||
message(STATUS "Downloading and configuring MS-MPI 10.1 for Windows cross-compilation")
|
||||
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/msmpi-win64-devel.tar.gz" CACHE STRING "URL for MS-MPI (win64) 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_MD5)
|
||||
# Download and configure MinGW compatible MPICH development files for Windows
|
||||
option(USE_MSMPI "Use Microsoft's MS-MPI SDK instead of MPICH2-1.4.1" OFF)
|
||||
|
||||
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)
|
||||
if(USE_MSMPI)
|
||||
message(STATUS "Downloading and configuring MS-MPI 10.1 for Windows cross-compilation")
|
||||
set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/msmpi-win64-devel.tar.gz" CACHE STRING "URL for MS-MPI (win64) 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_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/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()
|
||||
message(FATAL_ERROR "Only x86 64-bit builds are supported with MS-MPI")
|
||||
message(STATUS "Downloading and configuring MPICH2-1.4.1 for Windows cross-compilation")
|
||||
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(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()
|
||||
|
||||
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=1")
|
||||
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=1")
|
||||
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmsmpi.a")
|
||||
|
||||
@ -14,6 +14,10 @@ endif()
|
||||
|
||||
add_library(colvars STATIC ${COLVARS_SOURCES})
|
||||
target_compile_definitions(colvars PRIVATE -DCOLVARS_LAMMPS)
|
||||
separate_arguments(CMAKE_TUNE_FLAGS)
|
||||
foreach(_FLAG ${CMAKE_TUNE_FLAGS})
|
||||
target_compile_options(colvars PRIVATE ${_FLAG})
|
||||
endforeach()
|
||||
set_target_properties(colvars PROPERTIES OUTPUT_NAME lammps_colvars${LAMMPS_MACHINE})
|
||||
target_include_directories(colvars PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/colvars)
|
||||
# The line below is needed to locate math_eigen_impl.h
|
||||
@ -26,10 +30,6 @@ if(BUILD_OMP)
|
||||
target_link_libraries(colvars PRIVATE OpenMP::OpenMP_CXX)
|
||||
endif()
|
||||
|
||||
if(BUILD_MPI)
|
||||
target_link_libraries(colvars PUBLIC MPI::MPI_CXX)
|
||||
endif()
|
||||
|
||||
if(COLVARS_DEBUG)
|
||||
# Need to export the define publicly to be valid in interface code
|
||||
target_compile_definitions(colvars PUBLIC -DCOLVARS_DEBUG)
|
||||
|
||||
@ -1,18 +0,0 @@
|
||||
# the geturl command needs libcurl
|
||||
|
||||
find_package(CURL QUIET)
|
||||
option(WITH_CURL "Enable libcurl support" ${CURL_FOUND})
|
||||
if(WITH_CURL)
|
||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_CURL)
|
||||
|
||||
# need to use pkgconfig for fully static bins to find custom static libs
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "LinuxMUSL")
|
||||
include(FindPkgConfig)
|
||||
pkg_check_modules(CURL IMPORTED_TARGET libcurl libssl libcrypto)
|
||||
target_link_libraries(lammps PUBLIC PkgConfig::CURL)
|
||||
else()
|
||||
find_package(CURL REQUIRED)
|
||||
target_link_libraries(lammps PRIVATE CURL::libcurl)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -72,10 +72,6 @@ if(INTEL_ARCH STREQUAL "KNL")
|
||||
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
message(FATAL_ERROR "Must use Intel compiler with INTEL for KNL architecture")
|
||||
endif()
|
||||
message(WARNING, "Support for Intel Xeon Phi accelerators and Knight's Landing CPUs "
|
||||
"will be removed from LAMMPS in Summer 2025 due to lack of available machines "
|
||||
"in labs and HPC centers and removed support in recent compilers "
|
||||
"Please contact developers@lammps.org if you have any concerns about this step.")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -xHost -qopenmp -qoffload")
|
||||
set(MIC_OPTIONS "-qoffload-option,mic,compiler,\"-fp-model fast=2 -mGLOB_default_function_attrs=\\\"gather_scatter_loop_unroll=4\\\"\"")
|
||||
target_compile_options(lammps PRIVATE -xMIC-AVX512 -qoffload -fno-alias -ansi-alias -restrict -qoverride-limits ${MIC_OPTIONS})
|
||||
|
||||
@ -7,13 +7,10 @@ endif()
|
||||
|
||||
########################################################################
|
||||
# consistency checks and Kokkos options/settings required by LAMMPS
|
||||
if(Kokkos_ENABLE_HIP)
|
||||
option(Kokkos_ENABLE_HIP_MULTIPLE_KERNEL_INSTANTIATIONS "Enable multiple kernel instantiations with HIP" ON)
|
||||
mark_as_advanced(Kokkos_ENABLE_HIP_MULTIPLE_KERNEL_INSTANTIATIONS)
|
||||
option(Kokkos_ENABLE_ROCTHRUST "Use RoCThrust library" ON)
|
||||
mark_as_advanced(Kokkos_ENABLE_ROCTHRUST)
|
||||
if(Kokkos_ENABLE_CUDA)
|
||||
message(STATUS "KOKKOS: Enabling CUDA LAMBDA function support")
|
||||
set(Kokkos_ENABLE_CUDA_LAMBDA ON CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
# Adding OpenMP compiler flags without the checks done for
|
||||
# BUILD_OMP can result in compile failures. Enforce consistency.
|
||||
if(Kokkos_ENABLE_OPENMP)
|
||||
@ -21,15 +18,6 @@ if(Kokkos_ENABLE_OPENMP)
|
||||
message(FATAL_ERROR "Must enable BUILD_OMP with Kokkos_ENABLE_OPENMP")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(Kokkos_ENABLE_SERIAL)
|
||||
if(NOT (Kokkos_ENABLE_OPENMP OR Kokkos_ENABLE_THREADS OR
|
||||
Kokkos_ENABLE_CUDA OR Kokkos_ENABLE_HIP OR Kokkos_ENABLE_SYCL
|
||||
OR Kokkos_ENABLE_OPENMPTARGET))
|
||||
option(Kokkos_ENABLE_ATOMICS_BYPASS "Disable atomics for Kokkos Serial Backend" ON)
|
||||
mark_as_advanced(Kokkos_ENABLE_ATOMICS_BYPASS)
|
||||
endif()
|
||||
endif()
|
||||
########################################################################
|
||||
|
||||
option(EXTERNAL_KOKKOS "Build against external kokkos library" OFF)
|
||||
@ -57,8 +45,8 @@ if(DOWNLOAD_KOKKOS)
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}")
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
|
||||
include(ExternalProject)
|
||||
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/4.6.02.tar.gz" CACHE STRING "URL for KOKKOS tarball")
|
||||
set(KOKKOS_MD5 "14c02fac07bfcec48a1654f88ddee9c6" CACHE STRING "MD5 checksum of KOKKOS tarball")
|
||||
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/4.3.01.tar.gz" CACHE STRING "URL for KOKKOS tarball")
|
||||
set(KOKKOS_MD5 "243de871b3dc2cf3990c1c404032df83" CACHE STRING "MD5 checksum of KOKKOS tarball")
|
||||
mark_as_advanced(KOKKOS_URL)
|
||||
mark_as_advanced(KOKKOS_MD5)
|
||||
GetFallbackURL(KOKKOS_URL KOKKOS_FALLBACK)
|
||||
@ -83,7 +71,7 @@ if(DOWNLOAD_KOKKOS)
|
||||
add_dependencies(LAMMPS::KOKKOSCORE kokkos_build)
|
||||
add_dependencies(LAMMPS::KOKKOSCONTAINERS kokkos_build)
|
||||
elseif(EXTERNAL_KOKKOS)
|
||||
find_package(Kokkos 4.6.02 REQUIRED CONFIG)
|
||||
find_package(Kokkos 4.3.01 REQUIRED CONFIG)
|
||||
target_link_libraries(lammps PRIVATE Kokkos::kokkos)
|
||||
else()
|
||||
set(LAMMPS_LIB_KOKKOS_SRC_DIR ${LAMMPS_LIB_SOURCE_DIR}/kokkos)
|
||||
@ -139,7 +127,7 @@ if(PKG_KSPACE)
|
||||
${KOKKOS_PKG_SOURCES_DIR}/grid3d_kokkos.cpp
|
||||
${KOKKOS_PKG_SOURCES_DIR}/remap_kokkos.cpp)
|
||||
set(FFT_KOKKOS "KISS" CACHE STRING "FFT library for Kokkos-enabled KSPACE package")
|
||||
set(FFT_KOKKOS_VALUES KISS FFTW3 MKL NVPL HIPFFT CUFFT MKL_GPU)
|
||||
set(FFT_KOKKOS_VALUES KISS FFTW3 MKL HIPFFT CUFFT)
|
||||
set_property(CACHE FFT_KOKKOS PROPERTY STRINGS ${FFT_KOKKOS_VALUES})
|
||||
validate_option(FFT_KOKKOS FFT_KOKKOS_VALUES)
|
||||
string(TOUPPER ${FFT_KOKKOS} FFT_KOKKOS)
|
||||
@ -149,8 +137,10 @@ if(PKG_KSPACE)
|
||||
message(FATAL_ERROR "The CUDA backend of Kokkos requires either KISS FFT or CUFFT.")
|
||||
elseif(FFT_KOKKOS STREQUAL "KISS")
|
||||
message(WARNING "Using KISS FFT with the CUDA backend of Kokkos may be sub-optimal.")
|
||||
target_compile_definitions(lammps PRIVATE -DFFT_KOKKOS_KISS)
|
||||
elseif(FFT_KOKKOS STREQUAL "CUFFT")
|
||||
find_package(CUDAToolkit REQUIRED)
|
||||
target_compile_definitions(lammps PRIVATE -DFFT_KOKKOS_CUFFT)
|
||||
target_link_libraries(lammps PRIVATE CUDA::cufft)
|
||||
endif()
|
||||
elseif(Kokkos_ENABLE_HIP)
|
||||
@ -162,21 +152,10 @@ if(PKG_KSPACE)
|
||||
elseif(FFT_KOKKOS STREQUAL "HIPFFT")
|
||||
include(DetectHIPInstallation)
|
||||
find_package(hipfft REQUIRED)
|
||||
target_compile_definitions(lammps PRIVATE -DFFT_KOKKOS_HIPFFT)
|
||||
target_link_libraries(lammps PRIVATE hip::hipfft)
|
||||
endif()
|
||||
elseif(FFT_KOKKOS STREQUAL "MKL_GPU")
|
||||
if(NOT Kokkos_ENABLE_SYCL)
|
||||
message(FATAL_ERROR "Using MKL_GPU FFT currently requires the SYCL backend of Kokkos.")
|
||||
endif()
|
||||
find_package(MKL REQUIRED)
|
||||
target_link_libraries(lammps PRIVATE mkl_sycl_dft mkl_intel_ilp64 mkl_tbb_thread mkl_core tbb)
|
||||
elseif(FFT_KOKKOS STREQUAL "MKL")
|
||||
find_package(MKL REQUIRED)
|
||||
elseif(FFT_KOKKOS STREQUAL "NVPL")
|
||||
find_package(nvpl_fft REQUIRED)
|
||||
target_link_libraries(lammps PRIVATE nvpl::fftw)
|
||||
endif()
|
||||
target_compile_definitions(lammps PRIVATE -DFFT_KOKKOS_${FFT_KOKKOS})
|
||||
endif()
|
||||
|
||||
if(PKG_ML-IAP)
|
||||
|
||||
@ -10,7 +10,7 @@ if(${FFTW}_FOUND)
|
||||
else()
|
||||
set(FFT "KISS" CACHE STRING "FFT library for KSPACE package")
|
||||
endif()
|
||||
set(FFT_VALUES KISS FFTW3 MKL NVPL)
|
||||
set(FFT_VALUES KISS FFTW3 MKL)
|
||||
set_property(CACHE FFT PROPERTY STRINGS ${FFT_VALUES})
|
||||
validate_option(FFT FFT_VALUES)
|
||||
string(TOUPPER ${FFT} FFT)
|
||||
@ -41,10 +41,6 @@ elseif(FFT STREQUAL "MKL")
|
||||
target_compile_definitions(lammps PRIVATE -DFFT_MKL_THREADS)
|
||||
endif()
|
||||
target_link_libraries(lammps PRIVATE MKL::MKL)
|
||||
elseif(FFT STREQUAL "NVPL")
|
||||
find_package(nvpl_fft REQUIRED)
|
||||
target_compile_definitions(lammps PRIVATE -DFFT_NVPL)
|
||||
target_link_libraries(lammps PRIVATE nvpl::fftw)
|
||||
else()
|
||||
# last option is KISSFFT
|
||||
target_compile_definitions(lammps PRIVATE -DFFT_KISS)
|
||||
|
||||
@ -7,23 +7,3 @@ if(NOT PKG_MANYBODY)
|
||||
list(REMOVE_ITEM LAMMPS_SOURCES ${LAMMPS_SOURCE_DIR}/MC/fix_sgcmc.cpp)
|
||||
set_property(TARGET lammps PROPERTY SOURCES "${LAMMPS_SOURCES}")
|
||||
endif()
|
||||
|
||||
# fix hmc may only be installed if also fix rigid/small from RIGID is installed
|
||||
if(NOT PKG_RIGID)
|
||||
get_property(LAMMPS_FIX_HEADERS GLOBAL PROPERTY FIX)
|
||||
list(REMOVE_ITEM LAMMPS_FIX_HEADERS ${LAMMPS_SOURCE_DIR}/MC/fix_hmc.h)
|
||||
set_property(GLOBAL PROPERTY FIX "${LAMMPS_FIX_HEADERS}")
|
||||
get_target_property(LAMMPS_SOURCES lammps SOURCES)
|
||||
list(REMOVE_ITEM LAMMPS_SOURCES ${LAMMPS_SOURCE_DIR}/MC/fix_hmc.cpp)
|
||||
set_property(TARGET lammps PROPERTY SOURCES "${LAMMPS_SOURCES}")
|
||||
endif()
|
||||
|
||||
# fix neighbor/swap may only be installed if also the VORONOI package is installed
|
||||
if(NOT PKG_VORONOI)
|
||||
get_property(LAMMPS_FIX_HEADERS GLOBAL PROPERTY FIX)
|
||||
list(REMOVE_ITEM LAMMPS_FIX_HEADERS ${LAMMPS_SOURCE_DIR}/MC/fix_neighbor_swap.h)
|
||||
set_property(GLOBAL PROPERTY FIX "${LAMMPS_FIX_HEADERS}")
|
||||
get_target_property(LAMMPS_SOURCES lammps SOURCES)
|
||||
list(REMOVE_ITEM LAMMPS_SOURCES ${LAMMPS_SOURCE_DIR}/MC/fix_neighbor_swap.cpp)
|
||||
set_property(TARGET lammps PROPERTY SOURCES "${LAMMPS_SOURCES}")
|
||||
endif()
|
||||
|
||||
@ -24,7 +24,9 @@ if(MLIAP_ENABLE_PYTHON)
|
||||
if(NOT PKG_PYTHON)
|
||||
message(FATAL_ERROR "Must enable PYTHON package for including Python support in ML-IAP")
|
||||
endif()
|
||||
# Python version check is in main CMakeLists.txt file
|
||||
if(Python_VERSION VERSION_LESS 3.6)
|
||||
message(FATAL_ERROR "Python support in ML-IAP requires Python 3.6 or later")
|
||||
endif()
|
||||
|
||||
set(MLIAP_BINARY_DIR ${CMAKE_BINARY_DIR}/cython)
|
||||
file(GLOB MLIAP_CYTHON_SRC CONFIGURE_DEPENDS ${LAMMPS_SOURCE_DIR}/ML-IAP/*.pyx)
|
||||
|
||||
@ -1,68 +1,57 @@
|
||||
# PACE library support for ML-PACE package
|
||||
find_package(pace QUIET)
|
||||
|
||||
if(pace_FOUND)
|
||||
find_package(pace)
|
||||
target_link_libraries(lammps PRIVATE pace::pace)
|
||||
else()
|
||||
# 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()
|
||||
|
||||
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2023.11.25.fix2.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
|
||||
set(PACELIB_MD5 "a53bd87cfee8b07d9f44bc17aad69c3f" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
|
||||
mark_as_advanced(PACELIB_URL)
|
||||
mark_as_advanced(PACELIB_MD5)
|
||||
GetFallbackURL(PACELIB_URL PACELIB_FALLBACK)
|
||||
|
||||
# LOCAL_ML-PACE points to top-level dir with local lammps-user-pace repo,
|
||||
# to make it easier to check local build without going through the public github releases
|
||||
if(LOCAL_ML-PACE)
|
||||
set(lib-pace "${LOCAL_ML-PACE}")
|
||||
else()
|
||||
# download library sources to build folder
|
||||
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
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory lammps-user-pace*
|
||||
COMMAND ${CMAKE_COMMAND} -E tar xzf libpace.tar.gz
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
get_newest_file(${CMAKE_BINARY_DIR}/lammps-user-pace-* lib-pace)
|
||||
endif()
|
||||
|
||||
# some preinstalled yaml-cpp versions don't provide a namespaced target
|
||||
find_package(yaml-cpp QUIET)
|
||||
if(TARGET yaml-cpp AND NOT TARGET yaml-cpp::yaml-cpp)
|
||||
add_library(yaml-cpp::yaml-cpp ALIAS yaml-cpp)
|
||||
endif()
|
||||
|
||||
# fixup yaml-cpp/emitterutils.cpp for GCC 15+ until patch is applied
|
||||
file(READ ${lib-pace}/yaml-cpp/src/emitterutils.cpp yaml_emitterutils)
|
||||
string(REPLACE "#include <sstream>" "#include <sstream>\n#include <cinttypes>" yaml_tmp_emitterutils "${yaml_emitterutils}")
|
||||
string(REPLACE "#include <cinttypes>\n#include <cinttypes>" "#include <cinttypes>" yaml_emitterutils "${yaml_tmp_emitterutils}")
|
||||
file(WRITE ${lib-pace}/yaml-cpp/src/emitterutils.cpp "${yaml_emitterutils}")
|
||||
|
||||
add_subdirectory(${lib-pace} build-pace EXCLUDE_FROM_ALL)
|
||||
set_target_properties(pace PROPERTIES CXX_EXTENSIONS ON OUTPUT_NAME lammps_pace${LAMMPS_MACHINE})
|
||||
|
||||
if(CMAKE_PROJECT_NAME STREQUAL "lammps")
|
||||
target_link_libraries(lammps PRIVATE pace)
|
||||
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()
|
||||
|
||||
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2023.11.25.fix.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
|
||||
set(PACELIB_MD5 "b45de9a633f42ed65422567e3ce56f9f" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
|
||||
mark_as_advanced(PACELIB_URL)
|
||||
mark_as_advanced(PACELIB_MD5)
|
||||
GetFallbackURL(PACELIB_URL PACELIB_FALLBACK)
|
||||
|
||||
# LOCAL_ML-PACE points to top-level dir with local lammps-user-pace repo,
|
||||
# to make it easier to check local build without going through the public github releases
|
||||
if(LOCAL_ML-PACE)
|
||||
set(lib-pace "${LOCAL_ML-PACE}")
|
||||
else()
|
||||
# download library sources to build folder
|
||||
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
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory lammps-user-pace*
|
||||
COMMAND ${CMAKE_COMMAND} -E tar xzf libpace.tar.gz
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
get_newest_file(${CMAKE_BINARY_DIR}/lammps-user-pace-* lib-pace)
|
||||
|
||||
# fixup yaml-cpp/emitterutils.cpp for GCC 15+ until patch is applied
|
||||
file(READ ${lib-pace}/yaml-cpp/src/emitterutils.cpp yaml_emitterutils)
|
||||
string(REPLACE "#include <sstream>" "#include <sstream>\n#include <cinttypes>" yaml_tmp_emitterutils "${yaml_emitterutils}")
|
||||
string(REPLACE "#include <cinttypes>\n#include <cinttypes>" "#include <cinttypes>" yaml_emitterutils "${yaml_tmp_emitterutils}")
|
||||
file(WRITE ${lib-pace}/yaml-cpp/src/emitterutils.cpp "${yaml_emitterutils}")
|
||||
|
||||
endif()
|
||||
|
||||
add_subdirectory(${lib-pace} build-pace)
|
||||
set_target_properties(pace PROPERTIES CXX_EXTENSIONS ON OUTPUT_NAME lammps_pace${LAMMPS_MACHINE})
|
||||
|
||||
if(CMAKE_PROJECT_NAME STREQUAL "lammps")
|
||||
target_link_libraries(lammps PRIVATE pace)
|
||||
endif()
|
||||
|
||||
@ -37,7 +37,7 @@ if(DOWNLOAD_QUIP)
|
||||
endforeach()
|
||||
# Fix cmake crashing when MATH_LINKOPTS not set, required for e.g. recent Cray Programming Environment
|
||||
set(temp "${temp} -L/_DUMMY_PATH_\n")
|
||||
set(temp "${temp}PYTHON=${Python_EXECUTABLE}\nPIP=pip\nEXTRA_LINKOPTS=\n")
|
||||
set(temp "${temp}PYTHON=python\nPIP=pip\nEXTRA_LINKOPTS=\n")
|
||||
set(temp "${temp}HAVE_CP2K=0\nHAVE_VASP=0\nHAVE_TB=0\nHAVE_PRECON=1\nHAVE_LOTF=0\nHAVE_ONIOM=0\n")
|
||||
set(temp "${temp}HAVE_LOCAL_E_MIX=0\nHAVE_QC=0\nHAVE_GAP=1\nHAVE_DESCRIPTORS_NONCOMMERCIAL=1\n")
|
||||
set(temp "${temp}HAVE_TURBOGAP=0\nHAVE_QR=1\nHAVE_THIRDPARTY=0\nHAVE_FX=0\nHAVE_SCME=0\nHAVE_MTP=0\n")
|
||||
|
||||
@ -32,21 +32,14 @@ endif()
|
||||
|
||||
# Note: must also adjust check for supported API versions in
|
||||
# fix_plumed.cpp when version changes from v2.n.x to v2.n+1.y
|
||||
set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.9.3/plumed-src-2.9.3.tgz"
|
||||
set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.9.1/plumed-src-2.9.1.tgz"
|
||||
CACHE STRING "URL for PLUMED tarball")
|
||||
set(PLUMED_MD5 "ee1249805fe94bccee17d10610d3f6f1" CACHE STRING "MD5 checksum of PLUMED tarball")
|
||||
set(PLUMED_MD5 "c3b2d31479c1e9ce211719d40e9efbd7" CACHE STRING "MD5 checksum of PLUMED tarball")
|
||||
|
||||
mark_as_advanced(PLUMED_URL)
|
||||
mark_as_advanced(PLUMED_MD5)
|
||||
GetFallbackURL(PLUMED_URL PLUMED_FALLBACK)
|
||||
|
||||
# adjust C++ standard support for self-compiled Plumed2
|
||||
if(CMAKE_CXX_STANDARD GREATER 11)
|
||||
set(PLUMED_CXX_STANDARD 14)
|
||||
else()
|
||||
set(PLUMED_CXX_STANDARD 11)
|
||||
endif()
|
||||
|
||||
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND (CMAKE_CROSSCOMPILING))
|
||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
||||
set(CROSS_CONFIGURE mingw64-configure)
|
||||
@ -62,7 +55,7 @@ if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND (CMAKE_CROSSCOMPILING))
|
||||
URL_MD5 ${PLUMED_MD5}
|
||||
BUILD_IN_SOURCE 1
|
||||
CONFIGURE_COMMAND ${CROSS_CONFIGURE} --disable-shared --disable-bsymbolic
|
||||
--disable-python --enable-cxx=${PLUMED_CXX_STANDARD}
|
||||
--disable-python --enable-cxx=11
|
||||
--enable-modules=-adjmat:+crystallization:-dimred:+drr:+eds:-fisst:+funnel:+logmfd:+manyrestraints:+maze:+opes:+multicolvar:-pamm:-piv:+s2cm:-sasa:-ves
|
||||
${PLUMED_CONFIG_OMP}
|
||||
${PLUMED_CONFIG_MPI}
|
||||
@ -149,7 +142,7 @@ else()
|
||||
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR>
|
||||
${CONFIGURE_REQUEST_PIC}
|
||||
--enable-modules=all
|
||||
--enable-cxx=${PLUMED_CXX_STANDARD}
|
||||
--enable-cxx=11
|
||||
--disable-python
|
||||
${PLUMED_CONFIG_MPI}
|
||||
${PLUMED_CONFIG_OMP}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
|
||||
if(NOT Python_INTERPRETER)
|
||||
# backward compatibility with older LAMMPS documentation
|
||||
# backward compatibility with CMake before 3.12 and older LAMMPS documentation
|
||||
if(PYTHON_EXECUTABLE)
|
||||
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||
endif()
|
||||
|
||||
2
cmake/Modules/Packages/RHEO.cmake
Normal file
2
cmake/Modules/Packages/RHEO.cmake
Normal file
@ -0,0 +1,2 @@
|
||||
find_package(GSL 2.6 REQUIRED)
|
||||
target_link_libraries(lammps PRIVATE GSL::gsl)
|
||||
@ -14,16 +14,27 @@ endif()
|
||||
option(DOWNLOAD_SCAFACOS "Download ScaFaCoS library instead of using an already installed one" ${DOWNLOAD_SCAFACOS_DEFAULT})
|
||||
if(DOWNLOAD_SCAFACOS)
|
||||
message(STATUS "ScaFaCoS download requested - we will build our own")
|
||||
set(SCAFACOS_URL "https://github.com/scafacos/scafacos/releases/download/v1.0.4/scafacos-1.0.4.tar.gz" CACHE STRING "URL for SCAFACOS tarball")
|
||||
set(SCAFACOS_MD5 "23867540ec32e63ce71d6ecc105278d2" CACHE STRING "MD5 checksum of SCAFACOS tarball")
|
||||
set(SCAFACOS_URL "https://github.com/scafacos/scafacos/releases/download/v1.0.1/scafacos-1.0.1.tar.gz" CACHE STRING "URL for SCAFACOS tarball")
|
||||
set(SCAFACOS_MD5 "bd46d74e3296bd8a444d731bb10c1738" CACHE STRING "MD5 checksum of SCAFACOS tarball")
|
||||
mark_as_advanced(SCAFACOS_URL)
|
||||
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.
|
||||
file(DOWNLOAD ${LAMMPS_THIRDPARTY_URL}/scafacos-1.0.1-fix.diff ${CMAKE_CURRENT_BINARY_DIR}/scafacos-1.0.1.fix.diff
|
||||
EXPECTED_HASH MD5=4baa1333bb28fcce102d505e1992d032)
|
||||
|
||||
find_program(HAVE_PATCH patch)
|
||||
if(NOT HAVE_PATCH)
|
||||
message(FATAL_ERROR "The 'patch' program is required to build the ScaFaCoS library")
|
||||
endif()
|
||||
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(scafacos_build
|
||||
URL ${SCAFACOS_URL} ${SCAFACOS_FALLBACK}
|
||||
URL_MD5 ${SCAFACOS_MD5}
|
||||
PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_BINARY_DIR}/scafacos-1.0.1.fix.diff
|
||||
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --disable-doc
|
||||
--enable-fcs-solvers=fmm,p2nfft,direct,ewald,p3m
|
||||
--with-internal-fftw --with-internal-pfft
|
||||
|
||||
@ -54,5 +54,5 @@ else()
|
||||
if(NOT VORO_FOUND)
|
||||
message(FATAL_ERROR "Voro++ library not found. Help CMake to find it by setting VORO_LIBRARY and VORO_INCLUDE_DIR, or set DOWNLOAD_VORO=ON to download it")
|
||||
endif()
|
||||
target_link_libraries(lammps PRIVATE VORO::voro++)
|
||||
target_link_libraries(lammps PRIVATE VORO::VORO)
|
||||
endif()
|
||||
|
||||
@ -21,11 +21,11 @@ if(ENABLE_TESTING)
|
||||
# also only verified with Fedora Linux > 30 and Ubuntu 18.04 or 22.04+(Ubuntu 20.04 fails)
|
||||
if((CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
AND ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")))
|
||||
if(((CMAKE_LINUX_DISTRO STREQUAL "Ubuntu") AND (CMAKE_DISTRO_VERSION VERSION_GREATER_EQUAL 22.04))
|
||||
if(((CMAKE_LINUX_DISTRO STREQUAL "Ubuntu") AND
|
||||
((CMAKE_DISTRO_VERSION VERSION_LESS_EQUAL 18.04) OR (CMAKE_DISTRO_VERSION VERSION_GREATER_EQUAL 22.04)))
|
||||
OR ((CMAKE_LINUX_DISTRO STREQUAL "Fedora") AND (CMAKE_DISTRO_VERSION VERSION_GREATER 30)))
|
||||
include(CheckCXXCompilerFlag)
|
||||
set(CMAKE_CUSTOM_LINKER_DEFAULT default)
|
||||
check_cxx_compiler_flag(--ld-path=${CMAKE_LINKER} HAVE_LD_PATH_FLAG)
|
||||
check_cxx_compiler_flag(-fuse-ld=mold HAVE_MOLD_LINKER_FLAG)
|
||||
check_cxx_compiler_flag(-fuse-ld=lld HAVE_LLD_LINKER_FLAG)
|
||||
check_cxx_compiler_flag(-fuse-ld=gold HAVE_GOLD_LINKER_FLAG)
|
||||
@ -50,17 +50,6 @@ if(ENABLE_TESTING)
|
||||
if(NOT "${CMAKE_CUSTOM_LINKER}" STREQUAL "default")
|
||||
target_link_options(lammps PUBLIC -fuse-ld=${CMAKE_CUSTOM_LINKER})
|
||||
endif()
|
||||
if(HAVE_LD_PATH_FLAG)
|
||||
if("${CMAKE_CUSTOM_LINKER}" STREQUAL "mold")
|
||||
target_link_options(lammps PUBLIC --ld-path=${HAVE_MOLD_LINKER_BIN})
|
||||
elseif("${CMAKE_CUSTOM_LINKER}" STREQUAL "lld")
|
||||
target_link_options(lammps PUBLIC --ld-path=${HAVE_LLD_LINKER_BIN})
|
||||
elseif("${CMAKE_CUSTOM_LINKER}" STREQUAL "gold")
|
||||
target_link_options(lammps PUBLIC --ld-path=${HAVE_GOLD_LINKER_BIN})
|
||||
elseif("${CMAKE_CUSTOM_LINKER}" STREQUAL "bfd")
|
||||
target_link_options(lammps PUBLIC --ld-path=${HAVE_BFD_LINKER_BIN})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@ -6,10 +6,6 @@ if(BUILD_TOOLS)
|
||||
add_executable(stl_bin2txt ${LAMMPS_TOOLS_DIR}/stl_bin2txt.cpp)
|
||||
install(TARGETS stl_bin2txt DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
add_executable(reformat-json ${LAMMPS_TOOLS_DIR}/json/reformat-json.cpp)
|
||||
target_include_directories(reformat-json PRIVATE ${LAMMPS_SOURCE_DIR})
|
||||
install(TARGETS reformat-json DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
include(CheckGeneratorSupport)
|
||||
if(CMAKE_GENERATOR_SUPPORT_FORTRAN)
|
||||
include(CheckLanguage)
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
set(ALL_PACKAGES
|
||||
ADIOS
|
||||
AMOEBA
|
||||
APIP
|
||||
ASPHERE
|
||||
ATC
|
||||
AWPMD
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
set(ALL_PACKAGES
|
||||
ADIOS
|
||||
AMOEBA
|
||||
APIP
|
||||
ASPHERE
|
||||
ATC
|
||||
AWPMD
|
||||
|
||||
@ -19,19 +19,12 @@ set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
|
||||
|
||||
set(MPI_CXX "hipcc" CACHE STRING "" FORCE)
|
||||
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
||||
set(MPI_C "hipcc" CACHE STRING "" FORCE)
|
||||
set(MPI_C_COMPILER "mpicc" CACHE STRING "" FORCE)
|
||||
|
||||
# change as needed. This is for Fedora Linux 41 and 42
|
||||
set(_libomp_root "/usr/lib/clang/18")
|
||||
# we need to explicitly specify the include dir, since hipcc will
|
||||
# compile each file twice and doesn't find omp.h the second time
|
||||
|
||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||
set(OpenMP_C "hipcc" CACHE STRING "" FORCE)
|
||||
set(OpenMP_C_FLAGS "-fopenmp=libomp -I${_libomp_root}/include" CACHE STRING "" FORCE)
|
||||
set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING "" FORCE)
|
||||
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
||||
set(OpenMP_CXX "hipcc" CACHE STRING "" FORCE)
|
||||
set(OpenMP_CXX_FLAGS "-fopenmp=libomp -I${_libomp_root}/include" 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)
|
||||
|
||||
@ -1,21 +1,22 @@
|
||||
# preset that enables KOKKOS and selects HIP compilation withOUT OpenMP.
|
||||
# Kokkos OpenMP is not compatible with the second pass of hipcc.
|
||||
# preset that enables KOKKOS and selects HIP compilation with OpenMP
|
||||
# enabled as well. Also sets some performance related compiler flags.
|
||||
set(PKG_KOKKOS ON CACHE BOOL "" FORCE)
|
||||
set(Kokkos_ENABLE_SERIAL ON CACHE BOOL "" FORCE)
|
||||
set(Kokkos_ENABLE_OPENMP OFF CACHE BOOL "" FORCE)
|
||||
set(Kokkos_ENABLE_OPENMP ON CACHE BOOL "" FORCE)
|
||||
set(Kokkos_ENABLE_CUDA OFF CACHE BOOL "" FORCE)
|
||||
set(Kokkos_ENABLE_HIP ON CACHE BOOL "" FORCE)
|
||||
set(Kokkos_ARCH_VEGA90A on CACHE BOOL "" FORCE)
|
||||
set(Kokkos_ENABLE_HIP_MULTIPLE_KERNEL_INSTANTIATIONS ON CACHE BOOL "" FORCE)
|
||||
set(BUILD_OMP ON CACHE BOOL "" FORCE)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -munsafe-fp-atomics" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_COMPILER hipcc CACHE STRING "" FORCE)
|
||||
set(CMAKE_TUNE_FLAGS "-munsafe-fp-atomics" CACHE STRING "" FORCE)
|
||||
|
||||
# If KSPACE is also enabled, use HIPFFT for FFTs
|
||||
# If KSPACE is also enabled, use CUFFT for FFTs
|
||||
set(FFT_KOKKOS "HIPFFT" CACHE STRING "" FORCE)
|
||||
|
||||
# hide deprecation warnings temporarily for stable release
|
||||
#set(Kokkos_ENABLE_DEPRECATION_WARNINGS OFF CACHE BOOL "" FORCE)
|
||||
set(Kokkos_ENABLE_DEPRECATION_WARNINGS OFF CACHE BOOL "" FORCE)
|
||||
|
||||
# these flags are needed to build with Cray MPICH on OLCF Crusher
|
||||
#-D CMAKE_CXX_FLAGS="-I/${MPICH_DIR}/include"
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
# preset that enables KOKKOS and selects SYCL compilation with OpenMP
|
||||
# enabled as well. Also sets some performance related compiler flags.
|
||||
set(PKG_KOKKOS ON CACHE BOOL "" FORCE)
|
||||
set(Kokkos_ENABLE_SERIAL ON CACHE BOOL "" FORCE)
|
||||
set(Kokkos_ENABLE_OPENMP ON CACHE BOOL "" FORCE)
|
||||
set(Kokkos_ENABLE_CUDA OFF CACHE BOOL "" FORCE)
|
||||
set(Kokkos_ENABLE_SYCL ON CACHE BOOL "" FORCE)
|
||||
|
||||
set(FFT "MKL" CACHE STRING "" FORCE)
|
||||
set(FFT_KOKKOS "MKL_GPU" CACHE STRING "" FORCE)
|
||||
|
||||
unset(USE_INTERNAL_LINALG)
|
||||
unset(USE_INTERNAL_LINALG CACHE)
|
||||
set(BLAS_VENDOR "Intel10_64_dyn")
|
||||
|
||||
# hide deprecation warnings temporarily for stable release
|
||||
set(Kokkos_ENABLE_DEPRECATION_WARNINGS OFF CACHE BOOL "" FORCE)
|
||||
|
||||
set(CMAKE_CXX_COMPILER icpx CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_COMPILER icx CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_COMPILER "" CACHE STRING "" FORCE)
|
||||
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_STANDARD 17 CACHE STRING "" FORCE)
|
||||
|
||||
# set(_intel_sycl_flags " -w -fsycl -flink-huge-device-code -fsycl-targets=spir64_gen "
|
||||
set(_intel_sycl_flags " -w -fsycl -fsycl-device-code-split=per_kernel -fsycl-targets=spir64_gen ")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_intel_sycl_flags}" CACHE STRING "" FORCE)
|
||||
|
||||
#set(CMAKE_EXE_LINKER_FLAGS "-fsycl -flink-huge-device-code -fsycl-targets=spir64_gen " CACHE STRING "" FORCE)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsycl -flink-huge-device-code " CACHE STRING "" FORCE)
|
||||
@ -14,7 +14,5 @@ set(Kokkos_ENABLE_DEPRECATION_WARNINGS OFF CACHE BOOL "" FORCE)
|
||||
set(CMAKE_CXX_COMPILER clang++ CACHE STRING "" FORCE)
|
||||
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_STANDARD 17 CACHE STRING "" FORCE)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xsycl-target-frontend -O3 " CACHE STRING "" FORCE)
|
||||
|
||||
set(_intel_sycl_flags "-fgpu-inline-threshold=100000 -Xsycl-target-frontend -O3 -Xsycl-target-frontend -ffp-contract=on -Wno-unknown-cuda-version")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_intel_sycl_flags}" CACHE STRING "" FORCE)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "-Xsycl-target-frontend -O3" CACHE STRING "" FORCE)
|
||||
set(CMAKE_TUNE_FLAGS "-fgpu-inline-threshold=100000 -Xsycl-target-frontend -O3 -Xsycl-target-frontend -ffp-contract=on -Wno-unknown-cuda-version" CACHE STRING "" FORCE)
|
||||
@ -67,7 +67,6 @@ set(WIN_PACKAGES
|
||||
REACTION
|
||||
REAXFF
|
||||
REPLICA
|
||||
RHEO
|
||||
RIGID
|
||||
SHOCK
|
||||
SMTBQ
|
||||
@ -91,7 +90,7 @@ endif()
|
||||
set(DOWNLOAD_VORO ON CACHE BOOL "" FORCE)
|
||||
set(DOWNLOAD_EIGEN3 ON CACHE BOOL "" FORCE)
|
||||
set(LAMMPS_MEMALIGN "0" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-include-dirs" CACHE STRING "" FORCE)
|
||||
set(CMAKE_TUNE_FLAGS "-Wno-missing-include-dirs" CACHE STRING "" FORCE)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--enable-stdcall-fixup,--as-needed,-lssp" CACHE STRING "" FORCE)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--enable-stdcall-fixup,--as-needed,-lssp" CACHE STRING "" FORCE)
|
||||
set(BUILD_TOOLS ON CACHE BOOL "" FORCE)
|
||||
|
||||
@ -60,7 +60,6 @@ set(ALL_PACKAGES
|
||||
REACTION
|
||||
REAXFF
|
||||
REPLICA
|
||||
RHEO
|
||||
RIGID
|
||||
SHOCK
|
||||
SPH
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
|
||||
set(PACKAGES_WITH_LIB
|
||||
ADIOS
|
||||
APIP
|
||||
ATC
|
||||
AWPMD
|
||||
COMPRESS
|
||||
|
||||
@ -3,9 +3,26 @@
|
||||
set(CMAKE_CXX_COMPILER "icpx" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_COMPILER "icx" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_COMPILER "ifx" 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_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG" 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_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
|
||||
|
||||
set(MPI_CXX "icpx" CACHE STRING "" FORCE)
|
||||
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
||||
|
||||
# force using internal BLAS/LAPCK since external ones may not be ABI compatible
|
||||
set(USE_INTERNAL_LINALG ON CACHE BOOL "" FORCE)
|
||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||
set(OpenMP_C "icx" CACHE STRING "" FORCE)
|
||||
set(OpenMP_C_FLAGS "-qopenmp;-qopenmp-simd" CACHE STRING "" FORCE)
|
||||
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
||||
set(OpenMP_CXX "icpx" CACHE STRING "" FORCE)
|
||||
set(OpenMP_CXX_FLAGS "-qopenmp;-qopenmp-simd" CACHE STRING "" FORCE)
|
||||
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
||||
set(OpenMP_Fortran_FLAGS "-qopenmp;-qopenmp-simd" CACHE STRING "" FORCE)
|
||||
set(OpenMP_omp_LIBRARY "libiomp5.so" CACHE PATH "" FORCE)
|
||||
|
||||
|
||||
@ -5,4 +5,4 @@ set(CMAKE_C_COMPILER "icx" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_COMPILER "ifx" CACHE STRING "" FORCE)
|
||||
set(INTEL_LRT_MODE "C++11" CACHE STRING "" FORCE)
|
||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-command-line-argument" CACHE STRING "" FORCE)
|
||||
set(CMAKE_TUNE_FLAGS -Wno-unused-command-line-argument)
|
||||
|
||||
@ -60,7 +60,6 @@ set(WIN_PACKAGES
|
||||
REACTION
|
||||
REAXFF
|
||||
REPLICA
|
||||
RHEO
|
||||
RIGID
|
||||
SHOCK
|
||||
SMTBQ
|
||||
|
||||
7
doc/.gitignore
vendored
7
doc/.gitignore
vendored
@ -17,10 +17,3 @@
|
||||
*.el
|
||||
/utils/sphinx-config/_static/mathjax
|
||||
/utils/sphinx-config/_static/polyfill.js
|
||||
/src/pairs.rst
|
||||
/src/bonds.rst
|
||||
/src/angles.rst
|
||||
/src/dihedrals.rst
|
||||
/src/impropers.rst
|
||||
/src/computes.rst
|
||||
/src/fixes.rst
|
||||
|
||||
75
doc/Makefile
75
doc/Makefile
@ -17,11 +17,9 @@ MATHJAXTAG = 3.2.2
|
||||
|
||||
PYTHON = $(word 3,$(shell type python3))
|
||||
DOXYGEN = $(word 3,$(shell type doxygen))
|
||||
PANDOC = $(word 3,$(shell type pandoc))
|
||||
HAS_PYTHON3 = NO
|
||||
HAS_DOXYGEN = NO
|
||||
HAS_PDFLATEX = NO
|
||||
HAS_PANDOC = NO
|
||||
|
||||
ifeq ($(shell type python3 >/dev/null 2>&1; echo $$?), 0)
|
||||
HAS_PYTHON3 = YES
|
||||
@ -33,14 +31,10 @@ endif
|
||||
|
||||
ifeq ($(shell type pdflatex >/dev/null 2>&1; echo $$?), 0)
|
||||
ifeq ($(shell type latexmk >/dev/null 2>&1; echo $$?), 0)
|
||||
HAS_PDFLATEX = YES
|
||||
HAS_PDFLATEX = YES
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(shell type pandoc >/dev/null 2>&1; echo $$?), 0)
|
||||
HAS_PANDOC = YES
|
||||
endif
|
||||
|
||||
# override settings for PIP commands
|
||||
# PIP_OPTIONS = --cert /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt --proxy http://proxy.mydomain.org
|
||||
|
||||
@ -51,9 +45,8 @@ SPHINXEXTRA = -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocess
|
||||
# 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\|\)//')
|
||||
|
||||
.PHONY: help clean-all clean clean-spelling epub mobi html pdf spelling anchor_check style_check char_check role_check xmlgen fasthtml fasthtml-init
|
||||
.PHONY: help clean-all clean clean-spelling epub mobi html pdf spelling anchor_check style_check char_check role_check xmlgen fasthtml
|
||||
|
||||
FASTHTMLFILES = $(patsubst $(RSTDIR)/%.rst,fasthtml/%.html,$(wildcard $(RSTDIR)/*rst))
|
||||
# ------------------------------------------
|
||||
|
||||
help:
|
||||
@ -90,15 +83,14 @@ $(SPHINXCONFIG)/conf.py: $(SPHINXCONFIG)/conf.py.in
|
||||
-e 's,@LAMMPS_PYTHON_DIR@,$(BUILDDIR)/../python,g' \
|
||||
-e 's,@LAMMPS_DOC_DIR@,$(BUILDDIR),g' $< > $@
|
||||
|
||||
globbed-tocs:
|
||||
$(PYTHON) $(BUILDDIR)/utils/make-globbed-tocs.py -d $(RSTDIR)
|
||||
|
||||
html: xmlgen globbed-tocs $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX)
|
||||
html: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX)
|
||||
@if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi
|
||||
@$(MAKE) $(MFLAGS) -C graphviz all
|
||||
@(\
|
||||
. $(VENV)/bin/activate ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
|
||||
sphinx-build -E $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) html ;\
|
||||
touch $(RSTDIR)/Fortran.rst ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
|
||||
sphinx-build $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) html ;\
|
||||
ln -sf Manual.html html/index.html;\
|
||||
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
|
||||
echo "############################################" ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
|
||||
@ -110,8 +102,6 @@ html: xmlgen globbed-tocs $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJ
|
||||
env LC_ALL=C grep -n ':\(ref\|doc\):[^`]' $(RSTDIR)/*.rst ;\
|
||||
env LC_ALL=C grep -n '\(ref\|doc\)`[^`]' $(RSTDIR)/*.rst ;\
|
||||
$(PYTHON) $(BUILDDIR)/utils/check-styles.py -s ../src -d src ;\
|
||||
env LC_ALL=C grep -n -E '^ *\.\. [a-z0-9]+:(\s+.*|)$$' \
|
||||
$(RSTDIR)/*.rst ../src/*.{cpp,h} ../src/*/*.{cpp,h} ;\
|
||||
echo "############################################" ;\
|
||||
deactivate ;\
|
||||
)
|
||||
@ -123,24 +113,26 @@ html: xmlgen globbed-tocs $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJ
|
||||
@rm -rf html/PDF/.[sg]*
|
||||
@echo "Build finished. The HTML pages are in doc/html."
|
||||
|
||||
fasthtml: fasthtml-init $(FASTHTMLFILES)
|
||||
fasthtml: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX)
|
||||
@if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi
|
||||
@$(MAKE) $(MFLAGS) -C graphviz all
|
||||
@mkdir -p fasthtml
|
||||
@(\
|
||||
. $(VENV)/bin/activate ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
|
||||
sphinx-build $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/fasthtml/doctrees $(RSTDIR) fasthtml ;\
|
||||
touch $(RSTDIR)/Fortran.rst ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
|
||||
sphinx-build $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/fasthtml/doctrees $(RSTDIR) fasthtml ;\
|
||||
deactivate ;\
|
||||
)
|
||||
@rm -rf fasthtml/_sources
|
||||
@rm -rf fasthtml/PDF
|
||||
@rm -rf fasthtml/USER
|
||||
@rm -rf fasthtml/JPG
|
||||
@cp -r src/PDF fasthtml/PDF
|
||||
@rm -rf fasthtml/PDF/.[sg]*
|
||||
@echo "Fast HTML build finished. The HTML pages are in doc/fasthtml."
|
||||
|
||||
fasthtml-init:
|
||||
@mkdir -p fasthtml/JPG
|
||||
@cp src/JPG/*.* fasthtml/JPG
|
||||
@cp $(RSTDIR)/accel_styles.rst $(RSTDIR)/lepton_expression.rst fasthtml/
|
||||
@cp $(BUILDDIR)/utils/pandoc.css fasthtml/
|
||||
|
||||
fasthtml/%.html: $(RSTDIR)/%.rst
|
||||
@if [ "$(HAS_PANDOC)" == "NO" ] ; then echo "Make 'fasthtml' requires the 'pandoc' software" 1>&2; exit 1; fi
|
||||
@mkdir -p fasthtml
|
||||
@echo converting $< to $@
|
||||
@sed -e 's/\\AA/\\mathring{\\mathrm{A}}/g' $< > fasthtml/$*.temp.rst
|
||||
@pandoc -s --mathml --css="pandoc.css" --template=$(BUILDDIR)/utils/pandoc.html --metadata title="$@" -o $@ fasthtml/$*.temp.rst
|
||||
@rm -f fasthtml/$*.temp.rst
|
||||
|
||||
spelling: xmlgen globbed-tocs $(SPHINXCONFIG)/conf.py $(VENV) $(SPHINXCONFIG)/false_positives.txt
|
||||
spelling: xmlgen $(SPHINXCONFIG)/conf.py $(VENV) $(SPHINXCONFIG)/false_positives.txt
|
||||
@if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi
|
||||
@(\
|
||||
. $(VENV)/bin/activate ; \
|
||||
@ -151,7 +143,7 @@ spelling: xmlgen globbed-tocs $(SPHINXCONFIG)/conf.py $(VENV) $(SPHINXCONFIG)/fa
|
||||
)
|
||||
@echo "Spell check finished."
|
||||
|
||||
epub: xmlgen globbed-tocs $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK)
|
||||
epub: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK)
|
||||
@if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi
|
||||
@$(MAKE) $(MFLAGS) -C graphviz all
|
||||
@mkdir -p epub/JPG
|
||||
@ -160,6 +152,8 @@ epub: xmlgen globbed-tocs $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK)
|
||||
@(\
|
||||
. $(VENV)/bin/activate ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
|
||||
sphinx-build -E $(SPHINXEXTRA) -b epub -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) epub ;\
|
||||
touch $(RSTDIR)/Fortran.rst ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
|
||||
sphinx-build $(SPHINXEXTRA) -b epub -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) epub ;\
|
||||
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
|
||||
deactivate ;\
|
||||
)
|
||||
@ -172,13 +166,15 @@ mobi: epub
|
||||
@ebook-convert LAMMPS.epub LAMMPS.mobi
|
||||
@echo "Conversion finished. The MOBI manual file is created."
|
||||
|
||||
pdf: xmlgen globbed-tocs $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK)
|
||||
pdf: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK)
|
||||
@if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi
|
||||
@$(MAKE) $(MFLAGS) -C graphviz all
|
||||
@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= PYTHONDONTWRITEBYTECODE=1 \
|
||||
sphinx-build -E $(SPHINXEXTRA) -b latex -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\
|
||||
touch $(RSTDIR)/Fortran.rst ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
|
||||
sphinx-build $(SPHINXEXTRA) -b latex -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\
|
||||
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
|
||||
echo "############################################" ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
|
||||
rst_anchor_check src/*.rst ;\
|
||||
@ -189,8 +185,6 @@ pdf: xmlgen globbed-tocs $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK)
|
||||
env LC_ALL=C grep -n ':\(ref\|doc\):[^`]' $(RSTDIR)/*.rst ;\
|
||||
env LC_ALL=C grep -n '\(ref\|doc\)`[^`]' $(RSTDIR)/*.rst ;\
|
||||
$(PYTHON) utils/check-styles.py -s ../src -d src ;\
|
||||
env LC_ALL=C grep -n -E '^ *\.\. [a-z0-9]+:(\s+.*|)$$' \
|
||||
$(RSTDIR)/*.rst ../src/*.{cpp,h} ../src/*/*.{cpp,h} ;\
|
||||
echo "############################################" ;\
|
||||
deactivate ;\
|
||||
)
|
||||
@ -240,8 +234,6 @@ role_check :
|
||||
@( env LC_ALL=C grep -n ' `[^`]\+<[a-z][^`]\+`[^_]' $(RSTDIR)/*.rst && exit 1 || : )
|
||||
@( env LC_ALL=C grep -n ':\(ref\|doc\):[^`]' $(RSTDIR)/*.rst && exit 1 || : )
|
||||
@( env LC_ALL=C grep -n '\(ref\|doc\)`[^`]' $(RSTDIR)/*.rst && exit 1 || : )
|
||||
@( env LC_ALL=C grep -n -E '^ *\.\. [a-z0-9]+:(\s+.*|)$$' \
|
||||
$(RSTDIR)/*.rst ../src/*.{cpp,h} ../src/*/*.{cpp,h} && exit 1 || : )
|
||||
|
||||
link_check : $(VENV) html
|
||||
@(\
|
||||
@ -250,15 +242,6 @@ link_check : $(VENV) html
|
||||
deactivate ;\
|
||||
)
|
||||
|
||||
upgrade: $(VENV)
|
||||
@(\
|
||||
. $(VENV)/bin/activate; \
|
||||
pip $(PIP_OPTIONS) install --upgrade pip; \
|
||||
pip $(PIP_OPTIONS) install --upgrade wheel; \
|
||||
pip $(PIP_OPTIONS) install --upgrade -r $(BUILDDIR)/utils/requirements.txt; \
|
||||
deactivate;\
|
||||
)
|
||||
|
||||
xmlgen : doxygen/xml/index.xml
|
||||
|
||||
doxygen/Doxyfile: doxygen/Doxyfile.in
|
||||
|
||||
20
doc/README
20
doc/README
@ -22,12 +22,12 @@ doxygen-warn.log logfile with warnings from running doxygen
|
||||
and:
|
||||
|
||||
github-development-workflow.md notes on the LAMMPS development workflow
|
||||
include-file-conventions.md notes on LAMMPS' include file conventions
|
||||
documentation_conventions.md notes on writing documentation for LAMMPS
|
||||
|
||||
If you downloaded a LAMMPS tarball from www.lammps.org, then the html
|
||||
folder and the PDF manual should be included. If you downloaded LAMMPS
|
||||
using GitHub then you either need to build them yourself or read the
|
||||
online version at https://docs.lammps.org/
|
||||
from GitHub then you either need to build them.
|
||||
|
||||
You can build the HTML and PDF files yourself, by typing "make html"
|
||||
or by "make pdf", respectively. This requires various tools and files.
|
||||
@ -39,10 +39,10 @@ environment and local folders.
|
||||
|
||||
Installing prerequisites for the documentation build
|
||||
|
||||
To run the HTML documention build toolchain, python 3.8 or later,
|
||||
doxygen 1.8.10 or later, git, and the venv python module have to be
|
||||
installed if not already available. Also internet access is initially
|
||||
required to download external files and tools.
|
||||
To run the HTML documention build toolchain, python 3.x, doxygen, git,
|
||||
and the venv python module have to be installed if not already available.
|
||||
Also internet access is initially required to download external files
|
||||
and tools.
|
||||
|
||||
Building the PDF format manual requires in addition a compatible LaTeX
|
||||
installation with support for PDFLaTeX and several add-on LaTeX packages
|
||||
@ -52,24 +52,16 @@ installed. This includes:
|
||||
- babel
|
||||
- capt-of
|
||||
- cmap
|
||||
- dvipng
|
||||
- ellipse
|
||||
- fncychap
|
||||
- fontawesom
|
||||
- framed
|
||||
- geometry
|
||||
- gyre
|
||||
- hyperref
|
||||
- hypcap
|
||||
- needspace
|
||||
- pict2e
|
||||
- times
|
||||
- tabulary
|
||||
- titlesec
|
||||
- upquote
|
||||
- wrapfig
|
||||
- xindy
|
||||
|
||||
Also the latexmk script is required to run PDFLaTeX and related tools.
|
||||
the required number of times to have self-consistent output and include
|
||||
updated bibliography and indices.
|
||||
|
||||
@ -10,7 +10,7 @@ Last change: 2022-12-30
|
||||
|
||||
In fall 2019, the LAMMPS documentation file format has changed from a
|
||||
home grown markup designed to generate HTML format files only, to
|
||||
[reStructuredText](https://docutils.sourceforge.io/rst.html>). For a
|
||||
[reStructuredText](https://docutils.sourceforge.io/rst.html>. For a
|
||||
transition period all files in the old .txt format were transparently
|
||||
converted to .rst and then processed. The `txt2rst tool` is still
|
||||
included in the distribution to obtain an initial .rst file for legacy
|
||||
@ -45,7 +45,8 @@ what kind of information and sections are needed.
|
||||
|
||||
## Formatting conventions
|
||||
|
||||
For headlines we try to follow the conventions posted [here](https://documentation-style-guide-sphinx.readthedocs.io/en/latest/style-guide.html#headings).
|
||||
For headlines we try to follow the conventions posted here:
|
||||
https://documentation-style-guide-sphinx.readthedocs.io/en/latest/style-guide.html#headings
|
||||
It seems to be sufficient to have this consistent only within
|
||||
any single file and it is not (yet) enforced strictly, but making
|
||||
this globally consistent makes it easier to move sections around.
|
||||
@ -63,7 +64,7 @@ Groups of shell commands or LAMMPS input script or C/C++/Python source
|
||||
code should be typeset into a `.. code-block::` section. A syntax
|
||||
highlighting extension for LAMMPS input scripts is provided, so `LAMMPS`
|
||||
can be used to indicate the language in the code block in addition to
|
||||
`bash`, `c`, `c++`, `console`, `csh`, `diff`, `fortran`, `json`, `make`,
|
||||
`bash`, `c`, `c++`, `console`, `csh`, `diff', `fortran`, `json`, `make`,
|
||||
`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
|
||||
@ -83,7 +84,7 @@ block can be used, followed by multiple `.. tab::` blocks, one
|
||||
for each alternative. This is only used for HTML output. For other
|
||||
outputs, the `.. tabs::` directive is transparently removed and
|
||||
the individual `.. tab::` blocks will be replaced with an
|
||||
`.. admonition::` block. Thus in PDF and ePUB output those will
|
||||
`.. admonition::`` block. Thus in PDF and ePUB output those will
|
||||
be realized as sequential and plain notes.
|
||||
|
||||
Special remarks can be highlighted with a `.. note::` block and
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = "LAMMPS Programmer's Guide"
|
||||
PROJECT_NUMBER = "19 November 2024"
|
||||
PROJECT_NUMBER = "4 May 2022"
|
||||
PROJECT_BRIEF = "Documentation of the LAMMPS library interface and Python wrapper"
|
||||
PROJECT_LOGO = lammps-logo.png
|
||||
CREATE_SUBDIRS = NO
|
||||
|
||||
@ -6,9 +6,7 @@ choices the LAMMPS developers have agreed on. Git and GitHub provide the
|
||||
tools, but do not set policies, so it is up to the developers to come to
|
||||
an agreement as to how to define and interpret policies. This document
|
||||
is likely to change as our experiences and needs change, and we try to
|
||||
adapt it accordingly.
|
||||
|
||||
Last change: 2023-02-10
|
||||
adapt it accordingly. Last change 2023-02-10.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
@ -74,7 +72,7 @@ be assigned to signal urgency to merge this pull request quickly.
|
||||
People can be assigned to review a pull request in two ways:
|
||||
|
||||
* They can be assigned manually to review a pull request
|
||||
by the submitter or a LAMMPS developer.
|
||||
by the submitter or a LAMMPS developer
|
||||
* They can be automatically assigned, because a developer's GitHub
|
||||
handle matches a file pattern in the `.github/CODEOWNERS` file,
|
||||
which associates developers with the code they contributed and
|
||||
@ -88,9 +86,9 @@ required before merging, in addition to passing all automated
|
||||
compilation and unit tests. Merging counts as implicit approval, so
|
||||
does submission of a pull request (by a LAMMPS developer). So the person
|
||||
doing the merge may not also submit an approving review. The GitHub
|
||||
feature that reviews from code owners are "hard" reviews (i.e. they
|
||||
must all approve before merging is allowed) is currently disabled.
|
||||
It is at the discretion of the merge maintainer to assess when a
|
||||
feature, that reviews from code owners are "hard" reviews (i.e. they
|
||||
must all approve before merging is allowed), is currently disabled.
|
||||
It is in the discretion of the merge maintainer to assess when a
|
||||
sufficient degree of approval has been reached, especially from external
|
||||
collaborators. Reviews may be (automatically) dismissed, when the
|
||||
reviewed code has been changed. Review may be requested a second time.
|
||||
@ -149,8 +147,7 @@ only contain bug fixes, feature additions to peripheral functionality,
|
||||
and documentation updates. In between stable releases, bug fixes and
|
||||
infrastructure updates are back-ported from the "develop" branch to the
|
||||
"maintenance" branch and occasionally merged into "stable" and published
|
||||
as update releases. Further explanation of LAMMPS versions can be found
|
||||
[in the documentation](https://docs.lammps.org/Manual_version.html).
|
||||
as update releases.
|
||||
|
||||
## Project Management
|
||||
|
||||
|
||||
@ -5,13 +5,13 @@ digraph releases {
|
||||
github -> develop [label="Merge commits"];
|
||||
{
|
||||
rank = "same";
|
||||
work [shape="none" label="Development branches:" fontname="bold"]
|
||||
work [shape="none" label="Development branches:"]
|
||||
develop [label="'develop' branch" height=0.75];
|
||||
maintenance [label="'maintenance' branch" height=0.75];
|
||||
};
|
||||
{
|
||||
rank = "same";
|
||||
upload [shape="none" label="Release branches:" fontname="bold"]
|
||||
upload [shape="none" label="Release branches:"]
|
||||
release [label="'release' branch" height=0.75];
|
||||
stable [label="'stable' branch" height=0.75];
|
||||
};
|
||||
@ -22,7 +22,7 @@ digraph releases {
|
||||
maintenance -> stable [label="Updates to stable release"];
|
||||
{
|
||||
rank = "same";
|
||||
tag [shape="none" label="Applied tags:" fontname="bold"];
|
||||
tag [shape="none" label="Applied tags:"];
|
||||
patchtag [shape="box" label="patch_<date>"];
|
||||
stabletag [shape="box" label="stable_<date>"];
|
||||
updatetag [shape="box" label="stable_<date>_update<num>"];
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
.TH LAMMPS "1" "12 June 2025" "2025-06-12"
|
||||
.TH LAMMPS "1" "29 August 2024" "2024-08-29"
|
||||
.SH NAME
|
||||
.B LAMMPS
|
||||
\- Molecular Dynamics Simulator. Version 12 June 2025
|
||||
\- Molecular Dynamics Simulator. Version 29 August 2024
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B lmp
|
||||
@ -311,7 +311,7 @@ the chapter on errors in the
|
||||
manual gives some additional information about error messages, if possible.
|
||||
|
||||
.SH COPYRIGHT
|
||||
© 2003--2025 Sandia Corporation
|
||||
© 2003--2024 Sandia Corporation
|
||||
|
||||
This package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2 as
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
.TH MSI2LMP "1" "v3.9.11" "2024-09-06"
|
||||
.TH MSI2LMP "1" "v3.9.10" "2023-03-10"
|
||||
.SH NAME
|
||||
.B MSI2LMP
|
||||
\- Converter for Materials Studio files to LAMMPS
|
||||
@ -101,7 +101,7 @@ msi2lmp decane -c 0 -f oplsaa
|
||||
|
||||
|
||||
.SH COPYRIGHT
|
||||
© 2003--2024 Sandia Corporation
|
||||
© 2003--2022 Sandia Corporation
|
||||
|
||||
This package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2 as
|
||||
|
||||
@ -1,14 +1,10 @@
|
||||
Build LAMMPS
|
||||
============
|
||||
|
||||
LAMMPS is built as a library and an executable from source code using a
|
||||
build environment generated by CMake (Unix Makefiles, Ninja, Xcode,
|
||||
Visual Studio, KDevelop, CodeBlocks and more depending on the platform).
|
||||
Using CMake is the preferred way to build LAMMPS. In addition, LAMMPS
|
||||
can be compiled using the legacy build system based on traditional
|
||||
makefiles for use with GNU make (which may require manual editing).
|
||||
Support for the legacy build system is slowly being phased out and may
|
||||
not be available for all optional features.
|
||||
LAMMPS is built as a library and an executable from source code using
|
||||
either traditional makefiles for use with GNU make (which may require
|
||||
manual editing), or using a build environment generated by CMake (Unix
|
||||
Makefiles, Ninja, Xcode, Visual Studio, KDevelop, CodeBlocks and more).
|
||||
|
||||
As an alternative, you can download a package with pre-built executables
|
||||
or automated build trees, as described in the :doc:`Install <Install>`
|
||||
@ -17,7 +13,6 @@ section of the manual.
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
Build_prerequisites
|
||||
Build_cmake
|
||||
Build_make
|
||||
Build_link
|
||||
|
||||
@ -160,7 +160,7 @@ with the OpenMP 3.1 semantics used in LAMMPS for maximal compatibility
|
||||
with compiler versions in use. If compilation with OpenMP enabled fails
|
||||
because of your compiler requiring strict OpenMP 4.0 semantics, you can
|
||||
change the behavior by adding ``-D LAMMPS_OMP_COMPAT=4`` to the
|
||||
``LMP_INC`` variable in your makefile, or add it to the command-line flags
|
||||
``LMP_INC`` variable in your makefile, or add it to the command line
|
||||
while configuring with CMake. LAMMPS will auto-detect a suitable setting
|
||||
for most GNU, Clang, and Intel compilers.
|
||||
|
||||
@ -196,23 +196,22 @@ LAMMPS.
|
||||
|
||||
.. tab:: CMake build
|
||||
|
||||
By default CMake will use the compiler it finds according to its
|
||||
By default CMake will use the compiler it finds according to
|
||||
internal preferences, and it will add optimization flags
|
||||
appropriate to that compiler and any :doc:`accelerator packages
|
||||
<Speed_packages>` you have included in the build. CMake will
|
||||
check if the detected or selected compiler is compatible with the
|
||||
C++ support requirements of LAMMPS and stop with an error, if this
|
||||
is not the case. A C++11 compatible compiler is currently
|
||||
required, but a transition to require C++17 is in progress and
|
||||
planned to be completed in Summer 2025. Currently, setting
|
||||
``-DLAMMPS_CXX11=yes`` is required when configuring with CMake while
|
||||
using a C++11 compatible compiler that does not support C++17,
|
||||
otherwise setting ``-DCMAKE_CXX_STANDARD=17`` is preferred.
|
||||
is not the case.
|
||||
|
||||
You can tell CMake to look for a specific compiler with setting
|
||||
CMake variables (listed below) during configuration. For a few
|
||||
common choices, there are also presets in the ``cmake/presets``
|
||||
folder. You may also specify the corresponding ``CMAKE_*_FLAGS``
|
||||
folder. For convenience, there is a ``CMAKE_TUNE_FLAGS`` variable
|
||||
that can be set to apply global compiler options (applied to
|
||||
compilation only), to be used for adding compiler or host specific
|
||||
optimization flags in addition to the "flags" variables listed
|
||||
below. You may also specify the corresponding ``CMAKE_*_FLAGS``
|
||||
variables individually, if you want to experiment with alternate
|
||||
optimization flags. You should specify all 3 compilers, so that
|
||||
the (few) LAMMPS source files written in C or Fortran are built
|
||||
@ -224,8 +223,6 @@ LAMMPS.
|
||||
-D CMAKE_C_COMPILER=name # name of C compiler
|
||||
-D CMAKE_Fortran_COMPILER=name # name of Fortran compiler
|
||||
|
||||
-D CMAKE_CXX_STANDARD=17 # put compiler in C++17 mode
|
||||
-D LAMMPS_CXX11=yes # enforce compilation in C++11 mode
|
||||
-D CMAKE_CXX_FLAGS=string # flags to use with C++ compiler
|
||||
-D CMAKE_C_FLAGS=string # flags to use with C compiler
|
||||
-D CMAKE_Fortran_FLAGS=string # flags to use with Fortran compiler
|
||||
@ -262,6 +259,10 @@ LAMMPS.
|
||||
``-C ../cmake/presets/pgi.cmake`` will switch the compiler to the PGI compilers,
|
||||
and ``-C ../cmake/presets/nvhpc.cmake`` will switch to the NVHPC compilers.
|
||||
|
||||
Furthermore, you can set ``CMAKE_TUNE_FLAGS`` to specifically add
|
||||
compiler flags to tune for optimal performance on given hosts.
|
||||
This variable is empty by default.
|
||||
|
||||
.. note::
|
||||
|
||||
When the cmake command completes, it prints a summary to the
|
||||
@ -320,23 +321,15 @@ LAMMPS.
|
||||
you would have to install a newer compiler that supports C++11;
|
||||
either as a binary package or through compiling from source.
|
||||
|
||||
While a C++11 compatible compiler is currently sufficient to compile
|
||||
LAMMPS, a transition to require C++17 is in progress and planned to
|
||||
be completed in Summer 2025. Currently, setting ``-DLAMMPS_CXX11``
|
||||
in the ``LMP_INC =`` line in the machine makefile is required when
|
||||
using a C++11 compatible compiler that does not support C++17.
|
||||
Otherwise, to enable C++17 support (if not enabled by default) using
|
||||
a compiler flag like ``-std=c++17`` in CCFLAGS may needed.
|
||||
|
||||
If you build LAMMPS with any :doc:`Speed_packages` included,
|
||||
there may be specific compiler or linker flags that are either
|
||||
required or recommended to enable required features and to
|
||||
achieve optimal performance. You need to include these in the
|
||||
``CCFLAGS`` and ``LINKFLAGS`` settings above. For details, see the
|
||||
documentation for the individual packages listed on the
|
||||
:doc:`Speed_packages` page. Or examine these files in the
|
||||
``src/MAKE/OPTIONS`` directory. They correspond to each of the 5
|
||||
accelerator packages and their hardware variants:
|
||||
If you build LAMMPS with any :doc:`Speed_packages` included,
|
||||
there may be specific compiler or linker flags that are either
|
||||
required or recommended to enable required features and to
|
||||
achieve optimal performance. You need to include these in the
|
||||
``CCFLAGS`` and ``LINKFLAGS`` settings above. For details, see the
|
||||
documentation for the individual packages listed on the
|
||||
:doc:`Speed_packages` page. Or examine these files in the
|
||||
``src/MAKE/OPTIONS`` directory. They correspond to each of the 5
|
||||
accelerator packages and their hardware variants:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ packages. Links to those pages on the :doc:`Build overview <Build>`
|
||||
page.
|
||||
|
||||
The following text assumes some familiarity with CMake and focuses on
|
||||
using the command-line tool ``cmake`` and what settings are supported
|
||||
using the command line tool ``cmake`` and what settings are supported
|
||||
for building LAMMPS. A more detailed tutorial on how to use CMake
|
||||
itself, the text mode or graphical user interface, to change the
|
||||
generated output files for different build tools and development
|
||||
@ -16,7 +16,7 @@ environments is on a :doc:`separate page <Howto_cmake>`.
|
||||
|
||||
.. note::
|
||||
|
||||
LAMMPS currently requires that CMake version 3.20 or later is available.
|
||||
LAMMPS currently requires that CMake version 3.16 or later is available.
|
||||
|
||||
.. warning::
|
||||
|
||||
@ -32,29 +32,29 @@ environments is on a :doc:`separate page <Howto_cmake>`.
|
||||
Advantages of using CMake
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
CMake is the preferred way of compiling LAMMPS in contrast to the legacy
|
||||
build system based on GNU make and through :doc:`(manually customized)
|
||||
makefiles <Build_make>`. Using CMake has multiple advantages that are
|
||||
specifically helpful for people with limited experience in compiling
|
||||
software or for people that want to modify or extend LAMMPS.
|
||||
CMake is an alternative to compiling LAMMPS in the traditional way
|
||||
through :doc:`(manually customized) makefiles <Build_make>`. Using
|
||||
CMake has multiple advantages that are specifically helpful for
|
||||
people with limited experience in compiling software or for people
|
||||
that want to modify or extend LAMMPS.
|
||||
|
||||
- CMake can detect available hardware, tools, features, and libraries
|
||||
and adapt the LAMMPS default build configuration accordingly.
|
||||
- CMake can generate files for different build tools and integrated
|
||||
development environments (IDE).
|
||||
- CMake supports customization of settings with a command-line, text
|
||||
- CMake supports customization of settings with a command line, text
|
||||
mode, or graphical user interface. No manual editing of files,
|
||||
knowledge of file formats or complex command-line syntax is required.
|
||||
knowledge of file formats or complex command line syntax is required.
|
||||
- All enabled components are compiled in a single build operation.
|
||||
- Automated dependency tracking for all files and configuration options.
|
||||
- Support for true out-of-source compilation. Multiple configurations
|
||||
- Support for true out-of-source compilation. Multiple configurations
|
||||
and settings with different choices of LAMMPS packages, settings, or
|
||||
compilers can be configured and built concurrently from the same
|
||||
source tree.
|
||||
- Simplified packaging of LAMMPS for Linux distributions, environment
|
||||
modules, or automated build tools like `Spack <https://spack.io>`_
|
||||
or `Homebrew <https://brew.sh/>`_.
|
||||
- Integration of automated unit and regression testing.
|
||||
modules, or automated build tools like `Homebrew <https://brew.sh/>`_.
|
||||
- Integration of automated unit and regression testing (the LAMMPS side
|
||||
of this is still under active development).
|
||||
|
||||
.. _cmake_build:
|
||||
|
||||
@ -68,7 +68,7 @@ that purpose you can use either the command-line utility ``cmake`` (or
|
||||
graphical utility ``cmake-gui``, or use them interchangeably. The
|
||||
second step is then the compilation and linking of all objects,
|
||||
libraries, and executables using the selected build tool. Here is a
|
||||
minimal example using the command-line version of CMake to build LAMMPS
|
||||
minimal example using the command line version of CMake to build LAMMPS
|
||||
with no add-on packages enabled and no customization:
|
||||
|
||||
.. code-block:: bash
|
||||
@ -119,13 +119,6 @@ configured) and additional files like LAMMPS API headers, manpages,
|
||||
potential and force field files. The location of the installation tree
|
||||
defaults to ``${HOME}/.local``.
|
||||
|
||||
.. note::
|
||||
|
||||
If you have set `-D CMAKE_INSTALL_PREFIX` to install LAMMPS into a
|
||||
system location on a Linux machine , you may also have to run (as
|
||||
root) the `ldconfig` program to update the cache file for fast lookup
|
||||
of system shared libraries.
|
||||
|
||||
.. _cmake_options:
|
||||
|
||||
Configuration and build options
|
||||
@ -138,7 +131,7 @@ file called ``CMakeLists.txt`` (for LAMMPS it is located in the
|
||||
configuration step. The cache file contains all current CMake settings.
|
||||
|
||||
To modify settings, enable or disable features, you need to set
|
||||
*variables* with either the ``-D`` command-line flag (``-D
|
||||
*variables* with either the ``-D`` command line flag (``-D
|
||||
VARIABLE1_NAME=value``) or change them in the text mode of the graphical
|
||||
user interface. The ``-D`` flag can be used several times in one command.
|
||||
|
||||
@ -148,11 +141,11 @@ a different compiler tool chain. Those are loaded with the ``-C`` flag
|
||||
(``-C ../cmake/presets/basic.cmake``). This step would only be needed
|
||||
once, as the settings from the preset files are stored in the
|
||||
``CMakeCache.txt`` file. It is also possible to customize the build
|
||||
by adding one or more ``-D`` flags to the CMake command.
|
||||
by adding one or more ``-D`` flags to the CMake command line.
|
||||
|
||||
Generating files for alternate build tools (e.g. Ninja) and project files
|
||||
for IDEs like Eclipse, CodeBlocks, or Kate can be selected using the ``-G``
|
||||
command-line flag. A list of available generator settings for your
|
||||
command line flag. A list of available generator settings for your
|
||||
specific CMake version is given when running ``cmake --help``.
|
||||
|
||||
.. _cmake_multiconfig:
|
||||
|
||||
@ -28,6 +28,28 @@ variable VERBOSE set to 1:
|
||||
|
||||
----------
|
||||
|
||||
.. _clang-tidy:
|
||||
|
||||
Enable static code analysis with clang-tidy (CMake only)
|
||||
--------------------------------------------------------
|
||||
|
||||
The `clang-tidy tool <https://clang.llvm.org/extra/clang-tidy/>`_ is a
|
||||
static code analysis tool to diagnose (and potentially fix) typical
|
||||
programming errors or coding style violations. It has a modular framework
|
||||
of tests that can be adjusted to help identifying problems before they
|
||||
become bugs and also assist in modernizing large code bases (like LAMMPS).
|
||||
It can be enabled for all C++ code with the following CMake flag
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-D ENABLE_CLANG_TIDY=value # value = no (default) or yes
|
||||
|
||||
With this flag enabled all source files will be processed twice, first to
|
||||
be compiled and then to be analyzed. Please note that the analysis can be
|
||||
significantly more time-consuming than the compilation itself.
|
||||
|
||||
----------
|
||||
|
||||
.. _iwyu_processing:
|
||||
|
||||
Report missing and unneeded '#include' statements (CMake only)
|
||||
@ -116,27 +138,12 @@ during development:
|
||||
The status of this automated testing can be viewed on `https://ci.lammps.org
|
||||
<https://ci.lammps.org>`_.
|
||||
|
||||
The scripts and inputs for integration, run, and legacy regression
|
||||
testing are maintained in a `separate repository
|
||||
<https://github.com/lammps/lammps-testing>`_ of the LAMMPS project on
|
||||
GitHub. A few tests are also run as GitHub Actions and their
|
||||
configuration files are in the ``.github/workflows/`` folder of the
|
||||
LAMMPS git tree.
|
||||
|
||||
Regression tests can also be performed locally with the :ref:`regression
|
||||
tester tool <regression>`. The tool checks if a given LAMMPS binary run
|
||||
with selected input examples produces thermo output that is consistent
|
||||
with the provided log files. The script can be run in one pass over all
|
||||
available input files, but it can also first create multiple lists of
|
||||
inputs or folders that can then be run with multiple workers
|
||||
concurrently to speed things up. Another mode allows to do a quick
|
||||
check of inputs that contain commands that have changes in the current
|
||||
checkout branch relative to a git branch. This works similar to the two
|
||||
pass mode, but will select only shorter runs and no more than 100 inputs
|
||||
that are chosen randomly. This ensures that this test runs
|
||||
significantly faster compared to the full test run. These test runs can
|
||||
also be performed with instrumented LAMMPS binaries (see previous
|
||||
section).
|
||||
The scripts and inputs for integration, run, and regression testing
|
||||
are maintained in a
|
||||
`separate repository <https://github.com/lammps/lammps-testing>`_
|
||||
of the LAMMPS project on GitHub. A few tests are also run as GitHub
|
||||
Actions and their configuration files are in the ``.github/workflows/``
|
||||
folder of the LAMMPS git tree.
|
||||
|
||||
The unit testing facility is integrated into the CMake build process of
|
||||
the LAMMPS source code distribution itself. It can be enabled by
|
||||
@ -241,9 +248,9 @@ will be skipped if prerequisite features are not available in LAMMPS.
|
||||
time. Preference is given to parts of the code base that are easy to
|
||||
test or commonly used.
|
||||
|
||||
Tests as shown by the ``ctest`` program are commands defined in the
|
||||
Tests as shown by the ``ctest`` program are command lines defined in the
|
||||
``CMakeLists.txt`` files in the ``unittest`` directory tree. A few
|
||||
tests simply execute LAMMPS with specific command-line flags and check
|
||||
tests simply execute LAMMPS with specific command line flags and check
|
||||
the output to the screen for expected content. A large number of unit
|
||||
tests are special tests programs using the `GoogleTest framework
|
||||
<https://github.com/google/googletest/>`_ and linked to the LAMMPS
|
||||
@ -398,7 +405,7 @@ during MD timestepping and manipulate per-atom properties like
|
||||
positions, velocities, and forces. For those fix styles, testing can be
|
||||
done in a very similar fashion as for force fields and thus there is a
|
||||
test program `test_fix_timestep` that shares a lot of code, properties,
|
||||
and command-line flags with the force field style testers described in
|
||||
and command line flags with the force field style testers described in
|
||||
the previous section.
|
||||
|
||||
This tester will set up a small molecular system run with verlet run
|
||||
@ -501,7 +508,7 @@ to do this to install it via pip:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
python3 -m pip install gcovr
|
||||
pip install git+https://github.com/gcovr/gcovr.git
|
||||
|
||||
After post-processing with ``gen_coverage_html`` the results are in
|
||||
a folder ``coverage_html`` and can be viewed with a web browser.
|
||||
@ -620,38 +627,14 @@ The following target are available for both, GNU make and CMake:
|
||||
|
||||
.. _gh-cli:
|
||||
|
||||
GitHub command-line interface
|
||||
GitHub command line interface
|
||||
-----------------------------
|
||||
|
||||
GitHub has developed a `command-line tool <https://cli.github.com>`_
|
||||
to interact with the GitHub website via a command called ``gh``.
|
||||
This is 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. To use ``gh`` you must be within a git
|
||||
checkout of a repository and you must obtain an authentication token
|
||||
to connect your checkout with a GitHub user. This is done with the
|
||||
command: ``gh auth login`` where you then have to follow the prompts.
|
||||
Here are some examples:
|
||||
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.
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
:widths: 34 66
|
||||
|
||||
* - Command
|
||||
- Description
|
||||
* - ``gh pr list``
|
||||
- List currently open pull requests
|
||||
* - ``gh pr checks 404``
|
||||
- Shows the status of all checks for pull request #404
|
||||
* - ``gh pr view 404``
|
||||
- Shows the description and recent comments for pull request #404
|
||||
* - ``gh co 404``
|
||||
- Check out the branch from pull request #404; set up for pushing changes
|
||||
* - ``gh issue list``
|
||||
- List currently open issues
|
||||
* - ``gh issue view 430 --comments``
|
||||
- Shows the description and all comments for issue #430
|
||||
|
||||
The capabilities of the ``gh`` command are continually expanding, so
|
||||
for more details please see the documentation at https://cli.github.com/manual/
|
||||
or use ``gh --help`` or ``gh <command> --help`` for embedded help.
|
||||
The capabilities of the ``gh`` command is continually expanding, so
|
||||
please see the documentation at https://cli.github.com/manual/
|
||||
|
||||
@ -7,8 +7,6 @@ in addition to
|
||||
.. list-table::
|
||||
:align: center
|
||||
:header-rows: 1
|
||||
:widths: 50 50
|
||||
:width: 80%
|
||||
|
||||
* - CMake build
|
||||
- Traditional make
|
||||
@ -35,7 +33,6 @@ This is the list of packages that may require additional steps.
|
||||
:columns: 6
|
||||
|
||||
* :ref:`ADIOS <adios>`
|
||||
* :ref:`APIP <apip>`
|
||||
* :ref:`ATC <atc>`
|
||||
* :ref:`AWPMD <awpmd>`
|
||||
* :ref:`COLVARS <colvar>`
|
||||
@ -49,7 +46,6 @@ This is the list of packages that may require additional steps.
|
||||
* :ref:`LEPTON <lepton>`
|
||||
* :ref:`MACHDYN <machdyn>`
|
||||
* :ref:`MDI <mdi>`
|
||||
* :ref:`MISC <misc>`
|
||||
* :ref:`ML-HDNNP <ml-hdnnp>`
|
||||
* :ref:`ML-IAP <mliap>`
|
||||
* :ref:`ML-PACE <ml-pace>`
|
||||
@ -119,7 +115,7 @@ GPU package
|
||||
|
||||
To build with this package, you must choose options for precision and
|
||||
which GPU hardware to build for. The GPU package currently supports
|
||||
three different types of back ends: OpenCL, CUDA and HIP.
|
||||
three different types of backends: OpenCL, CUDA and HIP.
|
||||
|
||||
CMake build
|
||||
^^^^^^^^^^^
|
||||
@ -209,9 +205,9 @@ necessary for ``hipcc`` and the linker to work correctly.
|
||||
.. versionadded:: 3Aug2022
|
||||
|
||||
Using the CHIP-SPV implementation of HIP is supported. It allows one to
|
||||
run HIP code on Intel GPUs via the OpenCL or Level Zero back ends. To use
|
||||
run HIP code on Intel GPUs via the OpenCL or Level Zero backends. To use
|
||||
CHIP-SPV, you must set ``-DHIP_USE_DEVICE_SORT=OFF`` in your CMake
|
||||
command-line as CHIP-SPV does not yet support hipCUB. As of Summer 2022,
|
||||
command line as CHIP-SPV does not yet support hipCUB. As of Summer 2022,
|
||||
the use of HIP for Intel GPUs is experimental. You should only use this
|
||||
option in preparations to run on Aurora system at Argonne.
|
||||
|
||||
@ -234,7 +230,7 @@ option in preparations to run on Aurora system at Argonne.
|
||||
|
||||
.. code:: bash
|
||||
|
||||
# CUDA target (not recommended, use GPU_API=cuda)
|
||||
# CUDA target (not recommended, use GPU_ARCH=cuda)
|
||||
# !!! DO NOT set CMAKE_CXX_COMPILER !!!
|
||||
export HIP_PLATFORM=nvcc
|
||||
export HIP_PATH=/path/to/HIP/install
|
||||
@ -256,10 +252,11 @@ Traditional make
|
||||
|
||||
Before building LAMMPS, you must build the GPU library in ``lib/gpu``\ .
|
||||
You can do this manually if you prefer; follow the instructions in
|
||||
``lib/gpu/README``. Note that the GPU library uses MPI calls, so you
|
||||
must use the same MPI library (or the STUBS library) settings as the
|
||||
main LAMMPS code. This also applies to the ``-DLAMMPS_BIGBIG`` or
|
||||
``-DLAMMPS_SMALLBIG`` settings in whichever Makefile you use.
|
||||
``lib/gpu/README``. Note that the GPU library uses MPI calls, so you must
|
||||
use the same MPI library (or the STUBS library) settings as the main
|
||||
LAMMPS code. This also applies to the ``-DLAMMPS_BIGBIG``\ ,
|
||||
``-DLAMMPS_SMALLBIG``\ , or ``-DLAMMPS_SMALLSMALL`` settings in whichever
|
||||
Makefile you use.
|
||||
|
||||
You can also build the library in one step from the ``lammps/src`` dir,
|
||||
using a command like these, which simply invokes the ``lib/gpu/Install.py``
|
||||
@ -422,10 +419,9 @@ minutes to hours) to build. Of course you only need to do that once.)
|
||||
cmake build system. The ``lib/kim/Install.py`` script supports a
|
||||
``CMAKE`` environment variable if the cmake executable is named other
|
||||
than ``cmake`` on your system. Additional environment variables may be
|
||||
set with the ``make`` command for use by cmake. For example, to use the
|
||||
``cmake3`` executable and tell it to use the GNU version 11 compilers
|
||||
called ``g++-11``, ``gcc-11`` and ``gfortran-11`` to build KIM, one
|
||||
could use the following command.
|
||||
provided on the command line for use by cmake. For example, to use the
|
||||
``cmake3`` executable and tell it to use the gnu version 11 compilers
|
||||
to build KIM, one could use the following command line.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -548,7 +544,16 @@ They must be specified in uppercase.
|
||||
- Local machine
|
||||
* - AMDAVX
|
||||
- HOST
|
||||
- AMD chip
|
||||
- AMD 64-bit x86 CPU (AVX 1)
|
||||
* - ZEN
|
||||
- HOST
|
||||
- AMD Zen class CPU (AVX 2)
|
||||
* - ZEN2
|
||||
- HOST
|
||||
- AMD Zen2 class CPU (AVX 2)
|
||||
* - ZEN3
|
||||
- HOST
|
||||
- AMD Zen3 class CPU (AVX 2)
|
||||
* - ARMV80
|
||||
- HOST
|
||||
- ARMv8.0 Compatible CPU
|
||||
@ -564,138 +569,105 @@ They must be specified in uppercase.
|
||||
* - A64FX
|
||||
- HOST
|
||||
- ARMv8.2 with SVE Support
|
||||
* - ARMV9_GRACE
|
||||
- HOST
|
||||
- ARMv9 NVIDIA Grace CPU
|
||||
* - SNB
|
||||
- HOST
|
||||
- Intel Sandy/Ivy Bridge CPUs
|
||||
- Intel Sandy/Ivy Bridge CPU (AVX 1)
|
||||
* - HSW
|
||||
- HOST
|
||||
- Intel Haswell CPUs
|
||||
- Intel Haswell CPU (AVX 2)
|
||||
* - BDW
|
||||
- HOST
|
||||
- Intel Broadwell Xeon E-class CPUs
|
||||
* - ICL
|
||||
- HOST
|
||||
- Intel Ice Lake Client CPUs (AVX512)
|
||||
* - ICX
|
||||
- HOST
|
||||
- Intel Ice Lake Xeon Server CPUs (AVX512)
|
||||
- Intel Broadwell Xeon E-class CPU (AVX 2 + transactional mem)
|
||||
* - SKL
|
||||
- HOST
|
||||
- Intel Skylake Client CPUs
|
||||
- Intel Skylake Client CPU
|
||||
* - SKX
|
||||
- HOST
|
||||
- Intel Skylake Xeon Server CPUs (AVX512)
|
||||
- Intel Skylake Xeon Server CPU (AVX512)
|
||||
* - ICL
|
||||
- HOST
|
||||
- Intel Ice Lake Client CPU (AVX512)
|
||||
* - ICX
|
||||
- HOST
|
||||
- Intel Ice Lake Xeon Server CPU (AVX512)
|
||||
* - SPR
|
||||
- HOST
|
||||
- Intel Sapphire Rapids Xeon Server CPU (AVX512)
|
||||
* - KNC
|
||||
- HOST
|
||||
- Intel Knights Corner Xeon Phi
|
||||
* - KNL
|
||||
- HOST
|
||||
- Intel Knights Landing Xeon Phi
|
||||
* - SPR
|
||||
- HOST
|
||||
- Intel Sapphire Rapids Xeon Server CPUs (AVX512)
|
||||
* - POWER8
|
||||
- HOST
|
||||
- IBM POWER8 CPUs
|
||||
- IBM POWER8 CPU
|
||||
* - POWER9
|
||||
- HOST
|
||||
- IBM POWER9 CPUs
|
||||
* - ZEN
|
||||
- HOST
|
||||
- AMD Zen architecture
|
||||
* - ZEN2
|
||||
- HOST
|
||||
- AMD Zen2 architecture
|
||||
* - ZEN3
|
||||
- HOST
|
||||
- AMD Zen3 architecture
|
||||
* - ZEN4
|
||||
- HOST
|
||||
- AMD Zen4 architecture
|
||||
* - ZEN5
|
||||
- HOST
|
||||
- AMD Zen5 architecture
|
||||
- IBM POWER9 CPU
|
||||
* - RISCV_SG2042
|
||||
- HOST
|
||||
- SG2042 (RISC-V) CPUs
|
||||
* - RISCV_RVA22V
|
||||
- HOST
|
||||
- RVA22V (RISC-V) CPUs
|
||||
- SG2042 (RISC-V) CPU
|
||||
* - KEPLER30
|
||||
- GPU
|
||||
- NVIDIA Kepler generation CC 3.0
|
||||
- NVIDIA Kepler generation CC 3.0 GPU
|
||||
* - KEPLER32
|
||||
- GPU
|
||||
- NVIDIA Kepler generation CC 3.2
|
||||
- NVIDIA Kepler generation CC 3.2 GPU
|
||||
* - KEPLER35
|
||||
- GPU
|
||||
- NVIDIA Kepler generation CC 3.5
|
||||
- NVIDIA Kepler generation CC 3.5 GPU
|
||||
* - KEPLER37
|
||||
- GPU
|
||||
- NVIDIA Kepler generation CC 3.7
|
||||
- NVIDIA Kepler generation CC 3.7 GPU
|
||||
* - MAXWELL50
|
||||
- GPU
|
||||
- NVIDIA Maxwell generation CC 5.0
|
||||
- NVIDIA Maxwell generation CC 5.0 GPU
|
||||
* - MAXWELL52
|
||||
- GPU
|
||||
- NVIDIA Maxwell generation CC 5.2
|
||||
- NVIDIA Maxwell generation CC 5.2 GPU
|
||||
* - MAXWELL53
|
||||
- GPU
|
||||
- NVIDIA Maxwell generation CC 5.3
|
||||
- NVIDIA Maxwell generation CC 5.3 GPU
|
||||
* - PASCAL60
|
||||
- GPU
|
||||
- NVIDIA Pascal generation CC 6.0
|
||||
- NVIDIA Pascal generation CC 6.0 GPU
|
||||
* - PASCAL61
|
||||
- GPU
|
||||
- NVIDIA Pascal generation CC 6.1
|
||||
- NVIDIA Pascal generation CC 6.1 GPU
|
||||
* - VOLTA70
|
||||
- GPU
|
||||
- NVIDIA Volta generation CC 7.0
|
||||
- NVIDIA Volta generation CC 7.0 GPU
|
||||
* - VOLTA72
|
||||
- GPU
|
||||
- NVIDIA Volta generation CC 7.2
|
||||
- NVIDIA Volta generation CC 7.2 GPU
|
||||
* - TURING75
|
||||
- GPU
|
||||
- NVIDIA Turing generation CC 7.5
|
||||
- NVIDIA Turing generation CC 7.5 GPU
|
||||
* - AMPERE80
|
||||
- GPU
|
||||
- NVIDIA Ampere generation CC 8.0
|
||||
- NVIDIA Ampere generation CC 8.0 GPU
|
||||
* - AMPERE86
|
||||
- GPU
|
||||
- NVIDIA Ampere generation CC 8.6
|
||||
- NVIDIA Ampere generation CC 8.6 GPU
|
||||
* - ADA89
|
||||
- GPU
|
||||
- NVIDIA Ada generation CC 8.9
|
||||
- NVIDIA Ada Lovelace generation CC 8.9 GPU
|
||||
* - HOPPER90
|
||||
- GPU
|
||||
- NVIDIA Hopper generation CC 9.0
|
||||
* - BLACKWELL100
|
||||
- GPU
|
||||
- NVIDIA Blackwell generation CC 10.0
|
||||
* - BLACKWELL120
|
||||
- GPU
|
||||
- NVIDIA Blackwell generation CC 12.0
|
||||
- NVIDIA Hopper generation CC 9.0 GPU
|
||||
* - AMD_GFX906
|
||||
- GPU
|
||||
- AMD GPU MI50/60
|
||||
- AMD GPU MI50/MI60
|
||||
* - AMD_GFX908
|
||||
- GPU
|
||||
- AMD GPU MI100
|
||||
* - AMD_GFX90A
|
||||
- GPU
|
||||
- AMD GPU MI200
|
||||
* - AMD_GFX940
|
||||
- GPU
|
||||
- AMD GPU MI300
|
||||
* - AMD_GFX942
|
||||
- GPU
|
||||
- AMD GPU MI300
|
||||
* - AMD_GFX942_APU
|
||||
- GPU
|
||||
- AMD APU MI300A
|
||||
* - AMD_GFX1030
|
||||
- GPU
|
||||
- AMD GPU V620/W6800
|
||||
@ -704,7 +676,7 @@ They must be specified in uppercase.
|
||||
- AMD GPU RX7900XTX
|
||||
* - AMD_GFX1103
|
||||
- GPU
|
||||
- AMD APU Phoenix
|
||||
- AMD Phoenix APU with Radeon 740M/760M/780M/880M/890M
|
||||
* - INTEL_GEN
|
||||
- GPU
|
||||
- SPIR64-based devices, e.g. Intel GPUs, using JIT
|
||||
@ -726,11 +698,8 @@ They must be specified in uppercase.
|
||||
* - INTEL_PVC
|
||||
- GPU
|
||||
- Intel GPU Ponte Vecchio
|
||||
* - INTEL_DG2
|
||||
- GPU
|
||||
- Intel GPU DG2
|
||||
|
||||
This list was last updated for version 4.6.2 of the Kokkos library.
|
||||
This list was last updated for version 4.3.0 of the Kokkos library.
|
||||
|
||||
.. tabs::
|
||||
|
||||
@ -782,27 +751,14 @@ This list was last updated for version 4.6.2 of the Kokkos library.
|
||||
platform-appropriate vendor library: rocFFT on AMD GPUs or cuFFT on
|
||||
NVIDIA GPUs.
|
||||
|
||||
For Intel GPUs using SYCL, set these variables:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-D Kokkos_ARCH_HOSTARCH=yes # HOSTARCH = HOST from list above
|
||||
-D Kokkos_ARCH_GPUARCH=yes # GPUARCH = GPU from list above
|
||||
-D Kokkos_ENABLE_SYCL=yes
|
||||
-D Kokkos_ENABLE_OPENMP=yes
|
||||
-D FFT_KOKKOS=MKL_GPU
|
||||
|
||||
This will enable FFTs on the GPU using the oneMKL library.
|
||||
|
||||
To simplify compilation, six preset files are included in the
|
||||
To simplify compilation, five preset files are included in the
|
||||
``cmake/presets`` folder, ``kokkos-serial.cmake``,
|
||||
``kokkos-openmp.cmake``, ``kokkos-cuda.cmake``,
|
||||
``kokkos-hip.cmake``, ``kokkos-sycl-nvidia.cmake``, and
|
||||
``kokkos-sycl-intel.cmake``. They will enable the KOKKOS
|
||||
package and enable some hardware choices. For GPU support those
|
||||
preset files must be customized to match the hardware used. So
|
||||
to compile with CUDA device parallelization with some common
|
||||
packages enabled, you can do the following:
|
||||
``kokkos-hip.cmake``, and ``kokkos-sycl.cmake``. They will enable
|
||||
the KOKKOS package and enable some hardware choices. For GPU
|
||||
support those preset files must be customized to match the
|
||||
hardware used. So to compile with CUDA device parallelization with
|
||||
some common packages enabled, you can do the following:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -874,18 +830,6 @@ This list was last updated for version 4.6.2 of the Kokkos library.
|
||||
FFT_INC = -DFFT_HIPFFT # enable use of hipFFT (optional)
|
||||
FFT_LIB = -lhipfft # link to hipFFT library
|
||||
|
||||
For Intel GPUs using SYCL:
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
KOKKOS_DEVICES = SYCL
|
||||
KOKKOS_ARCH = HOSTARCH,GPUARCH # HOSTARCH = HOST from list above that is
|
||||
# hosting the GPU
|
||||
# GPUARCH = GPU from list above
|
||||
FFT_INC = -DFFT_KOKKOS_MKL_GPU # enable use of oneMKL for Intel GPUs (optional)
|
||||
# link to oneMKL FFT library
|
||||
FFT_LIB = -lmkl_sycl_dft -lmkl_intel_ilp64 -lmkl_tbb_thread -mkl_core -ltbb
|
||||
|
||||
Advanced KOKKOS compilation settings
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
@ -1154,10 +1098,11 @@ POEMS package
|
||||
PYTHON package
|
||||
---------------------------
|
||||
|
||||
Building with the PYTHON package requires you have a the Python
|
||||
development headers and library available on your system, which
|
||||
needs to be Python version 3.6 or later. See ``lib/python/README``
|
||||
for additional details.
|
||||
Building with the PYTHON package requires you have a the Python development
|
||||
headers and library available on your system, which needs to be a Python 2.7
|
||||
version or a Python 3.x version. Since support for Python 2.x has ended,
|
||||
using Python 3.x is strongly recommended. See ``lib/python/README`` for
|
||||
additional details.
|
||||
|
||||
.. tabs::
|
||||
|
||||
@ -1173,7 +1118,7 @@ for additional details.
|
||||
set the Python_EXECUTABLE variable to specify which Python
|
||||
interpreter should be used. Note note that you will also need to
|
||||
have the development headers installed for this version,
|
||||
e.g. python3-devel.
|
||||
e.g. python2-devel.
|
||||
|
||||
.. tab:: Traditional make
|
||||
|
||||
@ -1285,34 +1230,6 @@ systems.
|
||||
|
||||
----------
|
||||
|
||||
.. _apip:
|
||||
|
||||
APIP package
|
||||
-----------------------------
|
||||
|
||||
The APIP package depends on the library of the
|
||||
:ref:`ML-PACE <ml-pace>` package.
|
||||
The code for the library can be found
|
||||
at: `https://github.com/ICAMS/lammps-user-pace/ <https://github.com/ICAMS/lammps-user-pace/>`_
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. tab:: CMake build
|
||||
|
||||
No additional settings are needed besides ``-D PKG_APIP=yes``
|
||||
and ``-D PKG_ML-PACE=yes``.
|
||||
One can use a local version of the ML-PACE library instead of
|
||||
automatically downloading the library as described :ref:`here <ml-pace>`.
|
||||
|
||||
|
||||
.. tab:: Traditional make
|
||||
|
||||
You need to install the ML-PACE package *first* and follow
|
||||
the instructions :ref:`here <ml-pace>` before installing
|
||||
the APIP package.
|
||||
|
||||
----------
|
||||
|
||||
.. _atc:
|
||||
|
||||
ATC package
|
||||
@ -2074,7 +1991,7 @@ TBB and MKL.
|
||||
.. _mdi:
|
||||
|
||||
MDI package
|
||||
-----------
|
||||
-----------------------------
|
||||
|
||||
.. tabs::
|
||||
|
||||
@ -2101,37 +2018,6 @@ MDI package
|
||||
|
||||
----------
|
||||
|
||||
.. _misc:
|
||||
|
||||
MISC package
|
||||
------------
|
||||
|
||||
The :doc:`fix imd <fix_imd>` style in this package can be run either
|
||||
synchronously (communication with IMD clients is done in the main
|
||||
process) or asynchronously (the fix spawns a separate thread that can
|
||||
communicate with IMD clients concurrently to the LAMMPS execution).
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. tab:: CMake build
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-D LAMMPS_ASYNC_IMD=value # Run IMD server asynchronously
|
||||
# value = no (default) or yes
|
||||
|
||||
.. tab:: Traditional make
|
||||
|
||||
To enable asynchronous mode the ``-DLAMMPS_ASYNC_IMD`` define
|
||||
needs to be added to the ``LMP_INC`` variable in the
|
||||
``Makefile.machine`` you are using. For example:
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_ASYNC_IMD -DLAMMPS_MEMALIGN=64
|
||||
|
||||
----------
|
||||
|
||||
.. _molfile:
|
||||
|
||||
MOLFILE package
|
||||
@ -2278,7 +2164,7 @@ verified to work in February 2020 with Quantum Espresso versions 6.3 to
|
||||
from the sources in the *lib* folder (including the essential
|
||||
libqmmm.a) are not included in the static LAMMPS library and
|
||||
(currently) not installed, while their code is included in the
|
||||
shared LAMMPS library. Thus a typical command to configure
|
||||
shared LAMMPS library. Thus a typical command line to configure
|
||||
building LAMMPS for QMMM would be:
|
||||
|
||||
.. code-block:: bash
|
||||
@ -2338,38 +2224,28 @@ verified to work in February 2020 with Quantum Espresso versions 6.3 to
|
||||
RHEO package
|
||||
------------
|
||||
|
||||
This package depends on the BPM package.
|
||||
To build with this package you must have the `GNU Scientific Library
|
||||
(GSL) <https://www.gnu.org/software/gsl/>` installed in locations that
|
||||
are accessible in your environment. The GSL library should be at least
|
||||
version 2.7.
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. tab:: CMake build
|
||||
|
||||
If CMake cannot find the GSL library or include files, you can set:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-D PKG_RHEO=yes # enable the package itself
|
||||
-D PKG_BPM=yes # the RHEO package requires BPM
|
||||
-D USE_INTERNAL_LINALG=value # prefer internal LAPACK if true
|
||||
|
||||
Some features in the RHEO package are dependent on code in the BPM
|
||||
package so the latter one *must* be enabled as well.
|
||||
|
||||
The RHEO package also requires LAPACK (and BLAS) and CMake
|
||||
can identify their locations and pass that info to the RHEO
|
||||
build script. But on some systems this may cause problems when
|
||||
linking or the dependency is not desired. By using the setting
|
||||
``-D USE_INTERNAL_LINALG=yes`` when running the CMake
|
||||
configuration, you will select compiling and linking the bundled
|
||||
linear algebra library and work around the limitations.
|
||||
-D GSL_ROOT_DIR=path # path to root of GSL installation
|
||||
|
||||
.. tab:: Traditional make
|
||||
|
||||
The RHEO package requires LAPACK (and BLAS) which can be either
|
||||
a system provided library or the bundled "linalg" library. This
|
||||
is a subset of LAPACK translated to C++. For that, one of the
|
||||
provided ``Makefile.lammps.<config>`` files needs to be copied
|
||||
to ``Makefile.lammps`` and edited as needed. The default file
|
||||
uses the bundled "linalg" library, which can be built by
|
||||
``make lib-linalg args='-m serial'`` in the ``src`` folder.
|
||||
LAMMPS will try to auto-detect the GSL compiler and linker flags
|
||||
from the corresponding ``pkg-config`` file (``gsl.pc``), otherwise
|
||||
you can edit the file ``lib/rheo/Makefile.lammps``
|
||||
to specify the paths and library names where indicated by comments.
|
||||
This must be done **before** the package is installed.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -8,10 +8,6 @@ Building LAMMPS with traditional makefiles requires that you have a
|
||||
for customizing your LAMMPS build with a number of global compilation
|
||||
options and features.
|
||||
|
||||
This build system is slowly being phased out and may not support all
|
||||
optional features and packages in LAMMPS. It is recommended to switch
|
||||
to the :doc:`CMake based build system <Build_cmake>`.
|
||||
|
||||
Requirements
|
||||
^^^^^^^^^^^^
|
||||
|
||||
@ -30,9 +26,9 @@ additional tools to be available and functioning.
|
||||
* A Bourne shell compatible "Unix" shell program (frequently this is ``bash``)
|
||||
* A few shell utilities: ``ls``, ``mv``, ``ln``, ``rm``, ``grep``, ``sed``, ``tr``, ``cat``, ``touch``, ``diff``, ``dirname``
|
||||
* Python (optional, required for ``make lib-<pkg>`` in the ``src``
|
||||
folder). Python scripts are currently tested with 3.6 to 3.11.
|
||||
The procedure for :doc:`building the documentation <Build_manual>`
|
||||
*requires* Python 3.8 or later.
|
||||
folder). Python scripts are currently tested with python 2.7 and
|
||||
3.6 to 3.11. The procedure for :doc:`building the documentation
|
||||
<Build_manual>` *requires* Python 3.5 or later.
|
||||
|
||||
Getting started
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
@ -57,8 +57,6 @@ Python interpreter version 3.8 or later, the ``doxygen`` tools and
|
||||
internet access to download additional files and tools are required.
|
||||
This download is usually only required once or after the documentation
|
||||
folder is returned to a pristine state with ``make clean-all``.
|
||||
You can also upgrade those packages to their latest available versions
|
||||
with ``make upgrade``.
|
||||
|
||||
For the documentation build a python virtual environment is set up in
|
||||
the folder ``doc/docenv`` and various python packages are installed into
|
||||
@ -80,11 +78,11 @@ folder. The following ``make`` commands are available:
|
||||
make epub # generate LAMMPS.epub in ePUB format using Sphinx
|
||||
make mobi # generate LAMMPS.mobi in MOBI format using ebook-convert
|
||||
|
||||
make fasthtml # generate approximate HTML in fasthtml dir using pandoc
|
||||
make fasthtml # generate approximate HTML in fasthtml dir using Sphinx
|
||||
# some Sphinx extensions do not work correctly with this
|
||||
|
||||
make clean # remove intermediate RST files created by HTML build
|
||||
make clean-all # remove entire build folder and any cached data
|
||||
make upgrade # upgrade the python packages in the virtual environment
|
||||
|
||||
make anchor_check # check for duplicate anchor labels
|
||||
make style_check # check for complete and consistent style lists
|
||||
@ -118,9 +116,9 @@ environment variable.
|
||||
Prerequisites for HTML
|
||||
----------------------
|
||||
|
||||
To run the HTML documentation build toolchain, Python 3.8 or later, git,
|
||||
doxygen, and virtualenv have to be installed locally. Here are
|
||||
instructions for common setups:
|
||||
To run the HTML documentation build toolchain, python 3, git, doxygen,
|
||||
and virtualenv have to be installed locally. Here are instructions for
|
||||
common setups:
|
||||
|
||||
.. tabs::
|
||||
|
||||
@ -130,7 +128,13 @@ instructions for common setups:
|
||||
|
||||
sudo apt-get install git doxygen
|
||||
|
||||
.. tab:: Fedora or RHEL/AlmaLinux/RockyLinux (8.x or later)
|
||||
.. tab:: RHEL or CentOS (Version 7.x)
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sudo yum install git doxygen
|
||||
|
||||
.. tab:: Fedora or RHEL/CentOS (8.x or later)
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -150,36 +154,7 @@ Prerequisites for PDF
|
||||
|
||||
In addition to the tools needed for building the HTML format manual,
|
||||
a working LaTeX installation with support for PDFLaTeX and a selection
|
||||
of LaTeX styles/packages are required. Apart from LaTeX packages that
|
||||
are usually installed by default, the following packages are required:
|
||||
|
||||
.. table_from_list::
|
||||
:columns: 11
|
||||
|
||||
- amsmath
|
||||
- anysize
|
||||
- babel
|
||||
- capt-of
|
||||
- cmap
|
||||
- dvipng
|
||||
- ellipse
|
||||
- fncychap
|
||||
- fontawesome
|
||||
- framed
|
||||
- geometry
|
||||
- gyre
|
||||
- hyperref
|
||||
- hypcap
|
||||
- needspace
|
||||
- pict2e
|
||||
- times
|
||||
- tabulary
|
||||
- titlesec
|
||||
- upquote
|
||||
- wrapfig
|
||||
- xindy
|
||||
|
||||
To run the PDFLaTeX translation
|
||||
of LaTeX styles/packages are required. To run the PDFLaTeX translation
|
||||
the ``latexmk`` script needs to be installed as well.
|
||||
|
||||
Prerequisites for ePUB and MOBI
|
||||
@ -207,42 +182,12 @@ documentation is required and either existing files in the ``src``
|
||||
folder need to be updated or new files added. These files are written in
|
||||
`reStructuredText <rst_>`_ markup for translation with the Sphinx tool.
|
||||
|
||||
Testing your contribution
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Before contributing any documentation, please check that both the HTML
|
||||
and the PDF format documentation can translate without errors and that
|
||||
there are no spelling issues. This is done with ``make html``, ``make pdf``,
|
||||
and ``make spelling``, respectively.
|
||||
|
||||
Fast and approximate translation to HTML
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Translating the full manual to HTML or PDF can take a long time. Thus
|
||||
there is a fast and approximate way to translate the reStructuredText to
|
||||
HTML as a quick-n-dirty way of checking your manual page.
|
||||
|
||||
This translation uses `Pandoc <https://pandoc.org>`_ instead of Sphinx
|
||||
and thus all special Sphinx features (cross-references, advanced tables,
|
||||
embedding of Python docstrings or doxygen documentation, and so on) will
|
||||
not render correctly. Most embedded math should render correctly. This
|
||||
is a **very fast** way to check the syntax and layout of a documentation
|
||||
file translated to HTML while writing or updating it.
|
||||
|
||||
To translate **all** manual pages, you can type ``make fasthtml`` at the
|
||||
command line. The translated HTML files are then in the ``fasthtml``
|
||||
folder. All subsequent ``make fasthtml`` commands will only translate
|
||||
``.rst`` files that have been changed. The ``make fasthtml`` command
|
||||
can be parallelized with make using the `-j` flag. You can also
|
||||
directly translate only individual pages: e.g. to translate only the
|
||||
``doc/src/pair_lj.rst`` page type ``make fasthtml/pair_lj.html``
|
||||
|
||||
After writing the documentation is completed, you will still need
|
||||
to verify with ``make html`` and ``make pdf`` that it translates
|
||||
correctly in both formats.
|
||||
|
||||
Tests for consistency, completeness, and other known issues
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
and the PDF format documentation can translate without errors. During
|
||||
testing the html translation, you may use the ``make fasthtml`` command
|
||||
which does an approximate translation (i.e. not all Sphinx features and
|
||||
extensions will work), but runs very fast because it will only translate
|
||||
files that have been changed since the last ``make fasthtml`` command.
|
||||
|
||||
Please also check the output to the console for any warnings or problems. There will
|
||||
be multiple tests run automatically:
|
||||
|
||||
@ -49,7 +49,6 @@ packages:
|
||||
* :ref:`LEPTON <lepton>`
|
||||
* :ref:`MACHDYN <machdyn>`
|
||||
* :ref:`MDI <mdi>`
|
||||
* :ref:`MISC <misc>`
|
||||
* :ref:`ML-HDNNP <ml-hdnnp>`
|
||||
* :ref:`ML-IAP <mliap>`
|
||||
* :ref:`ML-PACE <ml-pace>`
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
Which software you need to compile and use LAMMPS strongly depends on
|
||||
which :doc:`features and settings <Build_settings>` and which
|
||||
:doc:`optional packages <Packages_list>` you are trying to include.
|
||||
Common to all is that you need a C++ and C compiler, where the C++
|
||||
compiler has to support at least the C++11 standard (note that some
|
||||
compilers require command-line flag to activate C++11 support).
|
||||
Furthermore, if you are building with CMake, you need at least CMake
|
||||
version 3.20 and a compatible build tool (make or ninja-build); if you
|
||||
are building the the legacy GNU make based build system you need GNU
|
||||
make (other make variants are not going to work since the build system
|
||||
uses features unique to GNU make) and a Unix-like build environment with
|
||||
a Bourne shell, and shell tools like "sed", "grep", "touch", "test",
|
||||
"tr", "cp", "mv", "rm", "ln", "diff" and so on. Parts of LAMMPS
|
||||
interface with or use Python version 3.6 or later.
|
||||
|
||||
The LAMMPS developers aim to keep LAMMPS very portable and usable -
|
||||
at least in parts - on most operating systems commonly used for
|
||||
running MD simulations. Please see the :doc:`section on portablility
|
||||
<Intro_portability>` for more details.
|
||||
@ -8,30 +8,29 @@ Optional build settings
|
||||
LAMMPS can be built with several optional settings. Each subsection
|
||||
explains how to do this for building both with CMake and make.
|
||||
|
||||
* `C++11 and C++17 standard compliance`_ when building all of LAMMPS
|
||||
* `C++11 standard compliance`_ when building all of LAMMPS
|
||||
* `FFT library`_ for use with the :doc:`kspace_style pppm <kspace_style>` command
|
||||
* `Size of LAMMPS integer types and size limits`_
|
||||
* `Read or write compressed files`_
|
||||
* `Output of JPEG, PNG, and movie files`_ via the :doc:`dump image <dump_image>` or :doc:`dump movie <dump_image>` commands
|
||||
* `Support for downloading files from the input`_
|
||||
* `Prevent download of large potential files`_
|
||||
* `Support for downloading files`_
|
||||
* `Memory allocation alignment`_
|
||||
* `Workaround for long long integers`_
|
||||
* `Exception handling when using LAMMPS as a library`_ to capture errors
|
||||
* `Trigger selected floating-point exceptions`_
|
||||
|
||||
----------
|
||||
|
||||
.. _cxx11:
|
||||
|
||||
C++11 and C++17 standard compliance
|
||||
-----------------------------------
|
||||
C++11 standard compliance
|
||||
-------------------------
|
||||
|
||||
A C++11 standard compatible compiler is currently the minimum
|
||||
requirement for compiling LAMMPS. LAMMPS version 3 March 2020 is the
|
||||
last version compatible with the previous C++98 standard for the core
|
||||
code and most packages. Most currently used C++ compilers are compatible
|
||||
with C++11, but some older ones may need extra flags to enable C++11
|
||||
compliance. Example for GNU c++ 4.8.x:
|
||||
A C++11 standard compatible compiler is a requirement for compiling LAMMPS.
|
||||
LAMMPS version 3 March 2020 is the last version compatible with the previous
|
||||
C++98 standard for the core code and most packages. Most currently used
|
||||
C++ compilers are compatible with C++11, but some older ones may need extra
|
||||
flags to enable C++11 compliance. Example for GNU c++ 4.8.x:
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
@ -41,17 +40,6 @@ Individual packages may require compliance with a later C++ standard
|
||||
like C++14 or C++17. These requirements will be documented with the
|
||||
:doc:`individual packages <Packages_details>`.
|
||||
|
||||
.. versionchanged:: 4Feb2025
|
||||
|
||||
Starting with LAMMPS version 4 February 2025 we are starting a
|
||||
transition to require the C++17 standard. Most current compilers are
|
||||
compatible and if the C++17 standard is available by default, LAMMPS
|
||||
will enable C++17 and will compile normally. If the chosen compiler is
|
||||
not compatible with C++17, but only supports C++11, then the define
|
||||
-DLAMMPS_CXX11 is required to fall back to compiling with a C++11
|
||||
compiler. After the next stable release of LAMMPS in summer 2025, the
|
||||
LAMMPS development branch and future releases will require C++17.
|
||||
|
||||
----------
|
||||
|
||||
.. _fft:
|
||||
@ -79,10 +67,10 @@ libraries and better pipelining for packing and communication.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-D FFT=value # FFTW3 or MKL or NVPL or KISS,
|
||||
# default is FFTW3 if found, else KISS
|
||||
-D FFT_KOKKOS=value # FFTW3 or MKL or NVPL or KISS or CUFFT
|
||||
# or HIPFFT or MKL_GPU, default is KISS
|
||||
-D FFT=value # FFTW3 or MKL or KISS, default is FFTW3 if found,
|
||||
# else KISS
|
||||
-D FFT_KOKKOS=value # FFTW3 or MKL or KISS or CUFFT or HIPFFT,
|
||||
# default is KISS
|
||||
-D FFT_SINGLE=value # yes or no (default), no = double precision
|
||||
-D FFT_PACK=value # array (default) or pointer or memcpy
|
||||
-D FFT_USE_HEFFTE=value # yes or no (default), yes links to heFFTe
|
||||
@ -115,8 +103,6 @@ libraries and better pipelining for packing and communication.
|
||||
-D FFT_HEFFTE_BACKEND=value # FFTW or MKL or empty/undefined for the stock
|
||||
# heFFTe back end
|
||||
-D Heffte_ROOT=path # path to an existing heFFTe installation
|
||||
-D nvpl_fft_INCLUDE_DIR=path # path to NVPL FFT include files
|
||||
-D nvpl_fft_LIBRARY_DIR=path # path to NVPL FFT libraries
|
||||
|
||||
.. note::
|
||||
|
||||
@ -135,10 +121,9 @@ libraries and better pipelining for packing and communication.
|
||||
.. code-block:: make
|
||||
|
||||
FFT_INC = -DFFT_<NAME> # where <NAME> is KISS (default), FFTW3,
|
||||
# FFTW (same as FFTW3), NVPL, or MKL
|
||||
# FFTW (same as FFTW3), or MKL
|
||||
FFT_INC = -DFFT_KOKKOS_<NAME> # where <NAME> is KISS (default), FFTW3,
|
||||
# FFTW (same as FFTW3), NVPL, MKL, CUFFT,
|
||||
# HIPFFT, or MKL_GPU
|
||||
# FFTW (same as FFTW3), MKL, CUFFT, or HIPFFT
|
||||
FFT_INC = -DFFT_SINGLE # do not specify for double precision
|
||||
FFT_INC = -DFFT_FFTW_THREADS # enable using threaded FFTW3 libraries
|
||||
FFT_INC = -DFFT_MKL_THREADS # enable using threaded FFTs with MKL libraries
|
||||
@ -156,9 +141,6 @@ libraries and better pipelining for packing and communication.
|
||||
# cuFFT either precision
|
||||
FFT_LIB = -lcufft
|
||||
|
||||
# MKL_GPU either precision
|
||||
FFT_LIB = -lmkl_sycl_dft -lmkl_intel_ilp64 -lmkl_tbb_thread -lmkl_core -ltbb
|
||||
|
||||
# FFTW3 double precision
|
||||
FFT_LIB = -lfftw3
|
||||
|
||||
@ -183,10 +165,6 @@ libraries and better pipelining for packing and communication.
|
||||
# MKL with automatic runtime selection of interface libs
|
||||
FFT_LIB = -lmkl_rt
|
||||
|
||||
# threaded NVPL FFT
|
||||
FFT_LIB = -lnvpl_fftw
|
||||
|
||||
|
||||
As with CMake, you do not need to set paths in ``FFT_INC`` or
|
||||
``FFT_PATH``, if the compiler can find the FFT header and library
|
||||
files in its default search path. You must specify ``FFT_LIB``
|
||||
@ -240,15 +218,10 @@ The Intel MKL math library is part of the Intel compiler suite. It
|
||||
can be used with the Intel or GNU compiler (see the ``FFT_LIB`` setting
|
||||
above).
|
||||
|
||||
The NVIDIA Performance Libraries (NVPL) FFT library is optimized for NVIDIA
|
||||
Grace Armv9.0 architecture. You can download it from https://docs.nvidia.com/nvpl/
|
||||
|
||||
The cuFFT and hipFFT FFT libraries are packaged with NVIDIA's CUDA and
|
||||
AMD's HIP installations, respectively. These FFT libraries require the
|
||||
Kokkos acceleration package to be enabled and the Kokkos back end to be
|
||||
GPU-resident (i.e., HIP or CUDA). Similarly, GPU offload of FFTs on
|
||||
Intel GPUs with oneMKL currently requires the Kokkos acceleration
|
||||
package to be enabled with the SYCL back end.
|
||||
GPU-resident (i.e., HIP or CUDA).
|
||||
|
||||
Performing 3d FFTs in parallel can be time-consuming due to data access
|
||||
and required communication. This cost can be reduced by performing
|
||||
@ -315,7 +288,7 @@ large counters can become before "rolling over". The default setting of
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-D LAMMPS_SIZES=value # smallbig (default) or bigbig
|
||||
-D LAMMPS_SIZES=value # smallbig (default) or bigbig or smallsmall
|
||||
|
||||
If the variable is not set explicitly, "smallbig" is used.
|
||||
|
||||
@ -326,7 +299,7 @@ large counters can become before "rolling over". The default setting of
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_SMALLBIG # or -DLAMMPS_BIGBIG
|
||||
LMP_INC = -DLAMMPS_SMALLBIG # or -DLAMMPS_BIGBIG or -DLAMMPS_SMALLSMALL
|
||||
|
||||
The default setting is ``-DLAMMPS_SMALLBIG`` if nothing is specified
|
||||
|
||||
@ -335,27 +308,34 @@ LAMMPS system size restrictions
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
:widths: 27 36 37
|
||||
:widths: 18 27 28 27
|
||||
:align: center
|
||||
|
||||
* -
|
||||
- smallbig
|
||||
- bigbig
|
||||
- smallsmall
|
||||
* - Total atom count
|
||||
- :math:`2^{63}` atoms (= :math:`9.223 \cdot 10^{18}`)
|
||||
- :math:`2^{63}` atoms (= :math:`9.223 \cdot 10^{18}`)
|
||||
- :math:`2^{31}` atoms (= :math:`2.147 \cdot 10^9`)
|
||||
* - Total timesteps
|
||||
- :math:`2^{63}` steps (= :math:`9.223 \cdot 10^{18}`)
|
||||
- :math:`2^{63}` steps (= :math:`9.223 \cdot 10^{18}`)
|
||||
- :math:`2^{31}` steps (= :math:`2.147 \cdot 10^9`)
|
||||
* - Atom ID values
|
||||
- :math:`1 \le i \le 2^{31} (= 2.147 \cdot 10^9)`
|
||||
- :math:`1 \le i \le 2^{63} (= 9.223 \cdot 10^{18})`
|
||||
- :math:`1 \le i \le 2^{31} (= 2.147 \cdot 10^9)`
|
||||
* - Image flag values
|
||||
- :math:`-512 \le i \le 511`
|
||||
- :math:`- 1\,048\,576 \le i \le 1\,048\,575`
|
||||
- :math:`-512 \le i \le 511`
|
||||
|
||||
The "bigbig" setting increases the size of image flags and atom IDs over
|
||||
the default "smallbig" setting.
|
||||
"smallbig" and the "smallsmall" setting is only needed if your machine
|
||||
does not support 64-bit integers or incurs performance penalties when
|
||||
using them.
|
||||
|
||||
These are limits for the core of the LAMMPS code, specific features or
|
||||
some styles may impose additional limits. The :ref:`ATC
|
||||
@ -509,8 +489,8 @@ during a run.
|
||||
|
||||
.. _libcurl:
|
||||
|
||||
Support for downloading files from the input
|
||||
--------------------------------------------
|
||||
Support for downloading files
|
||||
-----------------------------
|
||||
|
||||
.. versionadded:: 29Aug2024
|
||||
|
||||
@ -553,25 +533,6 @@ LAMMPS is compiled accordingly which needs the following settings:
|
||||
|
||||
----------
|
||||
|
||||
.. _download_pot:
|
||||
|
||||
Prevent download of large potential files
|
||||
-----------------------------------------
|
||||
|
||||
.. versionadded:: 8Feb2023
|
||||
|
||||
LAMMPS bundles a selection of potential files in the ``potentials``
|
||||
folder as examples of how those kinds of potential files look like and
|
||||
for use with the provided input examples in the ``examples`` tree. To
|
||||
keep the size of the distributed LAMMPS source package small, very large
|
||||
potential files (> 5 MBytes) are not bundled, but only downloaded on
|
||||
demand when the :doc:`corresponding package <Packages_list>` is
|
||||
installed. This automatic download can be prevented when :doc:`building
|
||||
LAMMPS with CMake <Build_cmake>` by adding the setting `-D
|
||||
DOWNLOAD_POTENTIALS=off` when configuring.
|
||||
|
||||
----------
|
||||
|
||||
.. _align:
|
||||
|
||||
Memory allocation alignment
|
||||
@ -658,3 +619,40 @@ code has to be set up to *catch* exceptions thrown from within LAMMPS.
|
||||
throw an exception and thus other MPI ranks may get stuck waiting for
|
||||
messages from the ones with errors.
|
||||
|
||||
----------
|
||||
|
||||
.. _trap_fpe:
|
||||
|
||||
Trigger selected floating-point exceptions
|
||||
------------------------------------------
|
||||
|
||||
Many kinds of CPUs have the capability to detect when a calculation
|
||||
results in an invalid math operation, like a division by zero or calling
|
||||
the square root with a negative argument. The default behavior on
|
||||
most operating systems is to continue and have values for ``NaN`` (= not
|
||||
a number) or ``Inf`` (= infinity). This allows software to detect and
|
||||
recover from such conditions. This behavior can be changed, however,
|
||||
often through use of compiler flags. On Linux systems (or more general
|
||||
on systems using the GNU C library), these so-called floating-point traps
|
||||
can also be selectively enabled through library calls. LAMMPS supports
|
||||
that by setting the ``-DLAMMPS_TRAP_FPE`` pre-processor define. As it is
|
||||
done in the ``main()`` function, this applies only to the standalone
|
||||
executable, not the library.
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. tab:: CMake build
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-D CMAKE_TUNE_FLAGS=-DLAMMPS_TRAP_FPE
|
||||
|
||||
.. tab:: Traditional make
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_TRAP_FPE <other LMP_INC settings>
|
||||
|
||||
After compilation with this flag set, the LAMMPS executable will stop
|
||||
and produce a core dump when a division by zero, overflow, illegal math
|
||||
function argument or other invalid floating point operation is encountered.
|
||||
|
||||
@ -100,9 +100,9 @@ procedure.
|
||||
|
||||
It is possible to use both the integrated CMake support of the Visual
|
||||
Studio IDE or use an external CMake installation (e.g. downloaded from
|
||||
cmake.org) to create build files and compile LAMMPS from the command-line.
|
||||
cmake.org) to create build files and compile LAMMPS from the command line.
|
||||
|
||||
Compilation via command-line and unit tests are checked automatically
|
||||
Compilation via command line and unit tests are checked automatically
|
||||
for the LAMMPS development branch through
|
||||
`GitHub Actions <https://github.com/lammps/lammps/actions/workflows/compile-msvc.yml>`_.
|
||||
|
||||
@ -115,7 +115,7 @@ for the LAMMPS development branch through
|
||||
|
||||
Please note, that for either approach CMake will create a so-called
|
||||
:ref:`"multi-configuration" build environment <cmake_multiconfig>`, and
|
||||
the commands for building and testing LAMMPS must be adjusted
|
||||
the command lines for building and testing LAMMPS must be adjusted
|
||||
accordingly.
|
||||
|
||||
The LAMMPS cmake folder contains a ``CMakeSettings.json`` file with
|
||||
|
||||
@ -4,7 +4,7 @@ LAMMPS Class
|
||||
The LAMMPS class is encapsulating an MD simulation state and thus it is
|
||||
the class that needs to be created when starting a new simulation system
|
||||
state. The LAMMPS executable essentially creates one instance of this
|
||||
class and passes the command-line flags and tells it to process the
|
||||
class and passes the command line flags and tells it to process the
|
||||
provided input (a file or ``stdin``). It shuts the class down when
|
||||
control is returned to it and then exits. When using LAMMPS as a
|
||||
library from another code it is required to create an instance of this
|
||||
|
||||
@ -140,7 +140,6 @@ additional letter in parenthesis: k = KOKKOS.
|
||||
* :doc:`plugin <plugin>`
|
||||
* :doc:`prd <prd>`
|
||||
* :doc:`python <python>`
|
||||
* :doc:`region2vmd <region2vmd>`
|
||||
* :doc:`tad <tad>`
|
||||
* :doc:`temper <temper>`
|
||||
* :doc:`temper/grem <temper_grem>`
|
||||
|
||||
@ -23,7 +23,6 @@ OPT.
|
||||
*
|
||||
* :doc:`bpm/rotational <bond_bpm_rotational>`
|
||||
* :doc:`bpm/spring <bond_bpm_spring>`
|
||||
* :doc:`bpm/spring/plastic <bond_bpm_spring_plastic>`
|
||||
* :doc:`class2 (ko) <bond_class2>`
|
||||
* :doc:`fene (iko) <bond_fene>`
|
||||
* :doc:`fene/expand (o) <bond_fene_expand>`
|
||||
@ -91,7 +90,6 @@ OPT.
|
||||
* :doc:`lepton (o) <angle_lepton>`
|
||||
* :doc:`mesocnt <angle_mesocnt>`
|
||||
* :doc:`mm3 <angle_mm3>`
|
||||
* :doc:`mwlc <angle_mwlc>`
|
||||
* :doc:`quartic (o) <angle_quartic>`
|
||||
* :doc:`spica (ko) <angle_spica>`
|
||||
* :doc:`table (o) <angle_table>`
|
||||
@ -128,7 +126,7 @@ OPT.
|
||||
* :doc:`harmonic (iko) <dihedral_harmonic>`
|
||||
* :doc:`helix (o) <dihedral_helix>`
|
||||
* :doc:`lepton (o) <dihedral_lepton>`
|
||||
* :doc:`multi/harmonic (ko) <dihedral_multi_harmonic>`
|
||||
* :doc:`multi/harmonic (o) <dihedral_multi_harmonic>`
|
||||
* :doc:`nharmonic (o) <dihedral_nharmonic>`
|
||||
* :doc:`opls (iko) <dihedral_opls>`
|
||||
* :doc:`quadratic (o) <dihedral_quadratic>`
|
||||
|
||||
@ -58,7 +58,6 @@ KOKKOS, o = OPENMP, t = OPT.
|
||||
* :doc:`fep/ta <compute_fep_ta>`
|
||||
* :doc:`force/tally <compute_tally>`
|
||||
* :doc:`fragment/atom <compute_cluster_atom>`
|
||||
* :doc:`gaussian/grid/local (k) <compute_gaussian_grid_local>`
|
||||
* :doc:`global/atom <compute_global_atom>`
|
||||
* :doc:`group/group <compute_group_group>`
|
||||
* :doc:`gyration <compute_gyration>`
|
||||
@ -141,8 +140,8 @@ KOKKOS, o = OPENMP, t = OPT.
|
||||
* :doc:`smd/vol <compute_smd_vol>`
|
||||
* :doc:`snap <compute_sna_atom>`
|
||||
* :doc:`sna/atom <compute_sna_atom>`
|
||||
* :doc:`sna/grid (k) <compute_sna_atom>`
|
||||
* :doc:`sna/grid/local (k) <compute_sna_atom>`
|
||||
* :doc:`sna/grid <compute_sna_atom>`
|
||||
* :doc:`sna/grid/local <compute_sna_atom>`
|
||||
* :doc:`snad/atom <compute_sna_atom>`
|
||||
* :doc:`snav/atom <compute_sna_atom>`
|
||||
* :doc:`sph/e/atom <compute_sph_e_atom>`
|
||||
@ -178,7 +177,6 @@ KOKKOS, o = OPENMP, t = OPT.
|
||||
* :doc:`ti <compute_ti>`
|
||||
* :doc:`torque/chunk <compute_torque_chunk>`
|
||||
* :doc:`vacf <compute_vacf>`
|
||||
* :doc:`vacf/chunk <compute_vacf_chunk>`
|
||||
* :doc:`vcm/chunk <compute_vcm_chunk>`
|
||||
* :doc:`viscosity/cos <compute_viscosity_cos>`
|
||||
* :doc:`voronoi/atom <compute_voronoi_atom>`
|
||||
|
||||
@ -19,7 +19,6 @@ An alphabetic list of all LAMMPS :doc:`dump <dump>` commands.
|
||||
* :doc:`custom/gz <dump>`
|
||||
* :doc:`custom/zstd <dump>`
|
||||
* :doc:`dcd <dump>`
|
||||
* :doc:`extxyz <dump>`
|
||||
* :doc:`grid <dump>`
|
||||
* :doc:`grid/vtk <dump>`
|
||||
* :doc:`h5md <dump_h5md>`
|
||||
|
||||
@ -22,7 +22,6 @@ OPT.
|
||||
* :doc:`append/atoms <fix_append_atoms>`
|
||||
* :doc:`atc <fix_atc>`
|
||||
* :doc:`atom/swap <fix_atom_swap>`
|
||||
* :doc:`atom_weight/apip <fix_atom_weight_apip>`
|
||||
* :doc:`ave/atom <fix_ave_atom>`
|
||||
* :doc:`ave/chunk <fix_ave_chunk>`
|
||||
* :doc:`ave/correlate <fix_ave_correlate>`
|
||||
@ -30,7 +29,6 @@ OPT.
|
||||
* :doc:`ave/grid <fix_ave_grid>`
|
||||
* :doc:`ave/histo <fix_ave_histo>`
|
||||
* :doc:`ave/histo/weight <fix_ave_histo>`
|
||||
* :doc:`ave/moments <fix_ave_moments>`
|
||||
* :doc:`ave/time <fix_ave_time>`
|
||||
* :doc:`aveforce <fix_aveforce>`
|
||||
* :doc:`balance <fix_balance>`
|
||||
@ -45,7 +43,7 @@ OPT.
|
||||
* :doc:`brownian/asphere <fix_brownian>`
|
||||
* :doc:`brownian/sphere <fix_brownian>`
|
||||
* :doc:`charge/regulation <fix_charge_regulation>`
|
||||
* :doc:`cmap (k) <fix_cmap>`
|
||||
* :doc:`cmap <fix_cmap>`
|
||||
* :doc:`colvars <fix_colvars>`
|
||||
* :doc:`controller <fix_controller>`
|
||||
* :doc:`damping/cundall <fix_damping_cundall>`
|
||||
@ -60,13 +58,12 @@ OPT.
|
||||
* :doc:`dt/reset (k) <fix_dt_reset>`
|
||||
* :doc:`edpd/source <fix_dpd_source>`
|
||||
* :doc:`efield (k) <fix_efield>`
|
||||
* :doc:`efield/lepton <fix_efield_lepton>`
|
||||
* :doc:`efield/tip4p <fix_efield>`
|
||||
* :doc:`ehex <fix_ehex>`
|
||||
* :doc:`electrode/conp (i) <fix_electrode>`
|
||||
* :doc:`electrode/conq (i) <fix_electrode>`
|
||||
* :doc:`electrode/thermo (i) <fix_electrode>`
|
||||
* :doc:`electron/stopping (k) <fix_electron_stopping>`
|
||||
* :doc:`electron/stopping <fix_electron_stopping>`
|
||||
* :doc:`electron/stopping/fit <fix_electron_stopping>`
|
||||
* :doc:`enforce2d (k) <fix_enforce2d>`
|
||||
* :doc:`eos/cv <fix_eos_cv>`
|
||||
@ -79,7 +76,6 @@ OPT.
|
||||
* :doc:`flow/gauss <fix_flow_gauss>`
|
||||
* :doc:`freeze (k) <fix_freeze>`
|
||||
* :doc:`gcmc <fix_gcmc>`
|
||||
* :doc:`gjf <fix_gjf>`
|
||||
* :doc:`gld <fix_gld>`
|
||||
* :doc:`gle <fix_gle>`
|
||||
* :doc:`gravity (ko) <fix_gravity>`
|
||||
@ -87,14 +83,11 @@ OPT.
|
||||
* :doc:`halt <fix_halt>`
|
||||
* :doc:`heat <fix_heat>`
|
||||
* :doc:`heat/flow <fix_heat_flow>`
|
||||
* :doc:`hmc <fix_hmc>`
|
||||
* :doc:`hyper/global <fix_hyper_global>`
|
||||
* :doc:`hyper/local <fix_hyper_local>`
|
||||
* :doc:`imd <fix_imd>`
|
||||
* :doc:`indent <fix_indent>`
|
||||
* :doc:`ipi <fix_ipi>`
|
||||
* :doc:`lambda/apip <fix_lambda_apip>`
|
||||
* :doc:`lambda_thermostat/apip <fix_lambda_thermostat_apip>`
|
||||
* :doc:`langevin (k) <fix_langevin>`
|
||||
* :doc:`langevin/drude <fix_langevin_drude>`
|
||||
* :doc:`langevin/eff <fix_langevin_eff>`
|
||||
@ -117,7 +110,6 @@ OPT.
|
||||
* :doc:`mvv/tdpd <fix_mvv_dpd>`
|
||||
* :doc:`neb <fix_neb>`
|
||||
* :doc:`neb/spin <fix_neb_spin>`
|
||||
* :doc:`neighbor/swap <fix_neighbor_swap>`
|
||||
* :doc:`nonaffine/displacement <fix_nonaffine_displacement>`
|
||||
* :doc:`nph (ko) <fix_nh>`
|
||||
* :doc:`nph/asphere (o) <fix_nph_asphere>`
|
||||
@ -142,7 +134,7 @@ OPT.
|
||||
* :doc:`nve/dot <fix_nve_dot>`
|
||||
* :doc:`nve/dotc/langevin <fix_nve_dotc_langevin>`
|
||||
* :doc:`nve/eff <fix_nve_eff>`
|
||||
* :doc:`nve/limit (k) <fix_nve_limit>`
|
||||
* :doc:`nve/limit <fix_nve_limit>`
|
||||
* :doc:`nve/line <fix_nve_line>`
|
||||
* :doc:`nve/manifold/rattle <fix_nve_manifold_rattle>`
|
||||
* :doc:`nve/noforce <fix_nve_noforce>`
|
||||
@ -169,8 +161,6 @@ OPT.
|
||||
* :doc:`phonon <fix_phonon>`
|
||||
* :doc:`pimd/langevin <fix_pimd>`
|
||||
* :doc:`pimd/nvt <fix_pimd>`
|
||||
* :doc:`pimd/langevin/bosonic <fix_pimd>`
|
||||
* :doc:`pimd/nvt/bosonic <fix_pimd>`
|
||||
* :doc:`planeforce <fix_planeforce>`
|
||||
* :doc:`plumed <fix_plumed>`
|
||||
* :doc:`poems <fix_poems>`
|
||||
@ -188,21 +178,18 @@ OPT.
|
||||
* :doc:`python/move <fix_python_move>`
|
||||
* :doc:`qbmsst <fix_qbmsst>`
|
||||
* :doc:`qeq/comb (o) <fix_qeq_comb>`
|
||||
* :doc:`qeq/ctip <fix_qeq>`
|
||||
* :doc:`qeq/dynamic <fix_qeq>`
|
||||
* :doc:`qeq/fire <fix_qeq>`
|
||||
* :doc:`qeq/point <fix_qeq>`
|
||||
* :doc:`qeq/reaxff (ko) <fix_qeq_reaxff>`
|
||||
* :doc:`qeq/rel/reaxff <fix_qeq_rel_reaxff>`
|
||||
* :doc:`qeq/shielded <fix_qeq>`
|
||||
* :doc:`qeq/slater <fix_qeq>`
|
||||
* :doc:`qmmm <fix_qmmm>`
|
||||
* :doc:`qtb <fix_qtb>`
|
||||
* :doc:`qtpie/reaxff <fix_qtpie_reaxff>`
|
||||
* :doc:`rattle <fix_shake>`
|
||||
* :doc:`reaxff/bonds (k) <fix_reaxff_bonds>`
|
||||
* :doc:`reaxff/species (k) <fix_reaxff_species>`
|
||||
* :doc:`recenter (k) <fix_recenter>`
|
||||
* :doc:`recenter <fix_recenter>`
|
||||
* :doc:`restrain <fix_restrain>`
|
||||
* :doc:`rheo <fix_rheo>`
|
||||
* :doc:`rheo/oxidation <fix_rheo_oxidation>`
|
||||
@ -223,7 +210,6 @@ OPT.
|
||||
* :doc:`rigid/small (o) <fix_rigid>`
|
||||
* :doc:`rx (k) <fix_rx>`
|
||||
* :doc:`saed/vtk <fix_saed_vtk>`
|
||||
* :doc:`set <fix_set>`
|
||||
* :doc:`setforce (k) <fix_setforce>`
|
||||
* :doc:`setforce/spin <fix_setforce>`
|
||||
* :doc:`sgcmc <fix_sgcmc>`
|
||||
@ -281,7 +267,7 @@ OPT.
|
||||
* :doc:`wall/piston <fix_wall_piston>`
|
||||
* :doc:`wall/reflect (k) <fix_wall_reflect>`
|
||||
* :doc:`wall/reflect/stochastic <fix_wall_reflect_stochastic>`
|
||||
* :doc:`wall/region (k) <fix_wall_region>`
|
||||
* :doc:`wall/region <fix_wall_region>`
|
||||
* :doc:`wall/region/ees <fix_wall_ees>`
|
||||
* :doc:`wall/srd <fix_wall_srd>`
|
||||
* :doc:`wall/table <fix_wall>`
|
||||
|
||||
@ -69,7 +69,7 @@ WARNING message is printed. The :doc:`Errors <Errors>` page gives
|
||||
more information on what errors mean. The documentation for each
|
||||
command lists restrictions on how the command can be used.
|
||||
|
||||
You can use the :ref:`-skiprun <skiprun>` command-line flag
|
||||
You can use the :ref:`-skiprun <skiprun>` command line flag
|
||||
to have LAMMPS skip the execution of any ``run``, ``minimize``, or similar
|
||||
commands to check the entire input for correct syntax to avoid crashes
|
||||
on typos or syntax errors in long runs.
|
||||
|
||||
@ -31,5 +31,3 @@ OPT.
|
||||
* :doc:`pppm/dielectric <kspace_style>`
|
||||
* :doc:`pppm/electrode (i) <kspace_style>`
|
||||
* :doc:`scafacos <kspace_style>`
|
||||
* :doc:`zero <kspace_style>`
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ OPT.
|
||||
* :doc:`born/coul/wolf/cs (g) <pair_cs>`
|
||||
* :doc:`born/gauss <pair_born_gauss>`
|
||||
* :doc:`bpm/spring <pair_bpm_spring>`
|
||||
* :doc:`brownian (ko) <pair_brownian>`
|
||||
* :doc:`brownian (o) <pair_brownian>`
|
||||
* :doc:`brownian/poly (o) <pair_brownian>`
|
||||
* :doc:`buck (giko) <pair_buck>`
|
||||
* :doc:`buck/coul/cut (giko) <pair_buck>`
|
||||
@ -59,7 +59,6 @@ OPT.
|
||||
* :doc:`comb (o) <pair_comb>`
|
||||
* :doc:`comb3 <pair_comb>`
|
||||
* :doc:`cosine/squared <pair_cosine_squared>`
|
||||
* :doc:`coul/ctip <pair_coul>`
|
||||
* :doc:`coul/cut (gko) <pair_coul>`
|
||||
* :doc:`coul/cut/dielectric <pair_dielectric>`
|
||||
* :doc:`coul/cut/global (o) <pair_coul>`
|
||||
@ -80,7 +79,6 @@ OPT.
|
||||
* :doc:`coul/tt <pair_coul_tt>`
|
||||
* :doc:`coul/wolf (ko) <pair_coul>`
|
||||
* :doc:`coul/wolf/cs <pair_cs>`
|
||||
* :doc:`dispersion/d3 <pair_dispersion_d3>`
|
||||
* :doc:`dpd (giko) <pair_dpd>`
|
||||
* :doc:`dpd/coul/slater/long (g) <pair_dpd_coul_slater_long>`
|
||||
* :doc:`dpd/ext (ko) <pair_dpd_ext>`
|
||||
@ -96,9 +94,7 @@ OPT.
|
||||
* :doc:`eam/cd <pair_eam>`
|
||||
* :doc:`eam/cd/old <pair_eam>`
|
||||
* :doc:`eam/fs (gikot) <pair_eam>`
|
||||
* :doc:`eam/fs/apip <pair_eam_apip>`
|
||||
* :doc:`eam/he <pair_eam>`
|
||||
* :doc:`eam/apip <pair_eam_apip>`
|
||||
* :doc:`edip (o) <pair_edip>`
|
||||
* :doc:`edip/multi <pair_edip>`
|
||||
* :doc:`edpd (g) <pair_mesodpd>`
|
||||
@ -117,18 +113,13 @@ OPT.
|
||||
* :doc:`gw/zbl <pair_gw>`
|
||||
* :doc:`harmonic/cut (o) <pair_harmonic_cut>`
|
||||
* :doc:`hbond/dreiding/lj (o) <pair_hbond_dreiding>`
|
||||
* :doc:`hbond/dreiding/lj/angleoffset (o) <pair_hbond_dreiding>`
|
||||
* :doc:`hbond/dreiding/morse (o) <pair_hbond_dreiding>`
|
||||
* :doc:`hbond/dreiding/morse/angleoffset (o) <pair_hbond_dreiding>`
|
||||
* :doc:`hdnnp <pair_hdnnp>`
|
||||
* :doc:`hippo (g) <pair_amoeba>`
|
||||
* :doc:`ilp/graphene/hbn (t) <pair_ilp_graphene_hbn>`
|
||||
* :doc:`ilp/tmd (t) <pair_ilp_tmd>`
|
||||
* :doc:`kolmogorov/crespi/full <pair_kolmogorov_crespi_full>`
|
||||
* :doc:`kolmogorov/crespi/z <pair_kolmogorov_crespi_z>`
|
||||
* :doc:`lambda/input/apip <pair_lambda_input_apip>`
|
||||
* :doc:`lambda/input/csp/apip <pair_lambda_input_apip>`
|
||||
* :doc:`lambda/zone/apip <pair_lambda_zone_apip>`
|
||||
* :doc:`lcbop <pair_lcbop>`
|
||||
* :doc:`lebedeva/z <pair_lebedeva_z>`
|
||||
* :doc:`lennard/mdf <pair_mdf>`
|
||||
@ -184,7 +175,6 @@ OPT.
|
||||
* :doc:`lj/long/dipole/long <pair_dipole>`
|
||||
* :doc:`lj/long/tip4p/long (o) <pair_lj_long>`
|
||||
* :doc:`lj/mdf <pair_mdf>`
|
||||
* :doc:`lj/pirani (o) <pair_lj_pirani>`
|
||||
* :doc:`lj/relres (o) <pair_lj_relres>`
|
||||
* :doc:`lj/spica (gko) <pair_spica>`
|
||||
* :doc:`lj/spica/coul/long (gko) <pair_spica>`
|
||||
@ -242,9 +232,6 @@ OPT.
|
||||
* :doc:`oxrna2/coaxstk <pair_oxrna2>`
|
||||
* :doc:`pace (k) <pair_pace>`
|
||||
* :doc:`pace/extrapolation (k) <pair_pace>`
|
||||
* :doc:`pace/apip <pair_pace_apip>`
|
||||
* :doc:`pace/fast/apip <pair_pace_apip>`
|
||||
* :doc:`pace/precise/apip <pair_pace_apip>`
|
||||
* :doc:`pedone (o) <pair_pedone>`
|
||||
* :doc:`pod (k) <pair_pod>`
|
||||
* :doc:`peri/eps <pair_peri>`
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
Removed commands and packages
|
||||
=============================
|
||||
|
||||
.. contents::
|
||||
|
||||
------
|
||||
|
||||
This page lists LAMMPS commands and packages that have been removed from
|
||||
the distribution and provides suggestions for alternatives or
|
||||
replacements. LAMMPS has special dummy styles implemented, that will
|
||||
@ -12,106 +8,29 @@ stop LAMMPS and print a suitable error message in most cases, when a
|
||||
style/command is used that has been removed or will replace the command
|
||||
with the direct alternative (if available) and print a warning.
|
||||
|
||||
GJF formulation in fix langevin
|
||||
-------------------------------
|
||||
restart2data tool
|
||||
-----------------
|
||||
|
||||
.. deprecated:: 12Jun2025
|
||||
.. versionchanged:: 23Nov2013
|
||||
|
||||
The *gjf* keyword in fix langevin is deprecated and will be removed
|
||||
soon. The GJF functionality has been moved to its own fix style
|
||||
:doc:`fix gjf <fix_gjf>` and it is strongly recommended to use that
|
||||
fix instead.
|
||||
The functionality of the restart2data tool has been folded into the
|
||||
LAMMPS executable directly instead of having a separate tool. A
|
||||
combination of the commands :doc:`read_restart <read_restart>` and
|
||||
:doc:`write_data <write_data>` can be used to the same effect. For
|
||||
added convenience this conversion can also be triggered by
|
||||
:doc:`command line flags <Run_options>`
|
||||
|
||||
Fix ave/spatial and fix ave/spatial/sphere
|
||||
------------------------------------------
|
||||
|
||||
LAMMPS shell
|
||||
------------
|
||||
.. deprecated:: 11Dec2015
|
||||
|
||||
.. deprecated:: 29Aug2024
|
||||
|
||||
The LAMMPS shell has been removed from the LAMMPS distribution. Users
|
||||
are encouraged to use the :ref:`LAMMPS-GUI <lammps_gui>` tool instead.
|
||||
|
||||
i-PI tool
|
||||
---------
|
||||
|
||||
.. deprecated:: 27Jun2024
|
||||
|
||||
The i-PI tool has been removed from the LAMMPS distribution. Instead,
|
||||
instructions to install i-PI from PyPI via pip are provided.
|
||||
|
||||
USER-REAXC package
|
||||
------------------
|
||||
|
||||
.. deprecated:: 7Feb2024
|
||||
|
||||
The USER-REAXC package has been renamed to :ref:`REAXFF <PKG-REAXFF>`.
|
||||
In the process also the pair style and related fixes were renamed to use
|
||||
the "reaxff" string instead of "reax/c". For a while LAMMPS was maintaining
|
||||
backward compatibility by providing aliases for the styles. These have
|
||||
been removed, so using "reaxff" is now *required*.
|
||||
|
||||
MPIIO package
|
||||
-------------
|
||||
|
||||
.. deprecated:: 21Nov2023
|
||||
|
||||
The MPIIO package has been removed from LAMMPS since it was unmaintained
|
||||
for many years and thus not updated to incorporate required changes that
|
||||
had been applied to the corresponding non-MPIIO commands. As a
|
||||
consequence the MPIIO commands had become unreliable and sometimes
|
||||
crashing LAMMPS or corrupting data. Similar functionality is available
|
||||
through the :ref:`ADIOS package <PKG-ADIOS>` and the :ref:`NETCDF
|
||||
package <PKG-NETCDF>`. Also, the :doc:`dump_modify nfile or dump_modify
|
||||
fileper <dump_modify>` keywords may be used for an efficient way of
|
||||
writing out dump files when running on large numbers of processors.
|
||||
Similarly, the "nfile" and "fileper" keywords exist for restarts:
|
||||
see :doc:`restart <restart>`, :doc:`read_restart <read_restart>`,
|
||||
:doc:`write_restart <write_restart>`.
|
||||
|
||||
MSCG package
|
||||
------------
|
||||
|
||||
.. deprecated:: 21Nov2023
|
||||
|
||||
The MSCG package has been removed from LAMMPS since it was unmaintained
|
||||
for many years and instead superseded by the `OpenMSCG software
|
||||
<https://software.rcc.uchicago.edu/mscg/>`_ of the Voth group at the
|
||||
University of Chicago, which can be used independent from LAMMPS.
|
||||
|
||||
LATTE package
|
||||
-------------
|
||||
|
||||
.. deprecated:: 15Jun2023
|
||||
|
||||
The LATTE package with the fix latte command was removed from LAMMPS.
|
||||
This functionality has been superseded by :doc:`fix mdi/qm <fix_mdi_qm>`
|
||||
and :doc:`fix mdi/qmmm <fix_mdi_qmmm>` from the :ref:`MDI package
|
||||
<PKG-MDI>`. These fixes are compatible with several quantum software
|
||||
packages, including LATTE. See the ``examples/QUANTUM`` dir and the
|
||||
:doc:`MDI coupling HOWTO <Howto_mdi>` page. MDI supports running LAMMPS
|
||||
with LATTE as a plugin library (similar to the way fix latte worked), as
|
||||
well as on a different set of MPI processors.
|
||||
|
||||
Minimize style fire/old
|
||||
-----------------------
|
||||
|
||||
.. deprecated:: 8Feb2023
|
||||
|
||||
Minimize style *fire/old* has been removed. Its functionality can be
|
||||
reproduced with style *fire* with specific options. Please see the
|
||||
:doc:`min_modify command <min_modify>` documentation for details.
|
||||
|
||||
Pair style mesont/tpm, compute style mesont, atom style mesont
|
||||
--------------------------------------------------------------
|
||||
|
||||
.. deprecated:: 8Feb2023
|
||||
|
||||
Pair style *mesont/tpm*, compute style *mesont*, and atom style
|
||||
*mesont* have been removed from the :ref:`MESONT package <PKG-MESONT>`.
|
||||
The same functionality is available through
|
||||
:doc:`pair style mesocnt <pair_mesocnt>`,
|
||||
:doc:`bond style mesocnt <bond_mesocnt>` and
|
||||
:doc:`angle style mesocnt <angle_mesocnt>`.
|
||||
The fixes ave/spatial and ave/spatial/sphere have been removed from LAMMPS
|
||||
since they were superseded by the more general and extensible "chunk
|
||||
infrastructure". Here the system is partitioned in one of many possible
|
||||
ways through the :doc:`compute chunk/atom <compute_chunk_atom>` command
|
||||
and then averaging is done using :doc:`fix ave/chunk <fix_ave_chunk>`.
|
||||
Please refer to the :doc:`chunk HOWTO <Howto_chunk>` section for an overview.
|
||||
|
||||
Box command
|
||||
-----------
|
||||
@ -131,34 +50,23 @@ been folded into the :doc:`reset_atoms <reset_atoms>` command. If
|
||||
present, LAMMPS will replace the commands accordingly and print a
|
||||
warning.
|
||||
|
||||
MESSAGE package
|
||||
---------------
|
||||
LATTE package
|
||||
-------------
|
||||
|
||||
.. deprecated:: 4May2022
|
||||
.. deprecated:: 15Jun2023
|
||||
|
||||
The MESSAGE package has been removed since it was superseded by the
|
||||
:ref:`MDI package <PKG-MDI>`. MDI implements the same functionality
|
||||
and in a more general way with direct support for more applications.
|
||||
|
||||
REAX package
|
||||
------------
|
||||
|
||||
.. deprecated:: 4Jan2019
|
||||
|
||||
The REAX package has been removed since it was superseded by the
|
||||
:ref:`REAXFF package <PKG-REAXFF>`. The REAXFF package has been tested
|
||||
to yield equivalent results to the REAX package, offers better
|
||||
performance, supports OpenMP multi-threading via OPENMP, and GPU and
|
||||
threading parallelization through KOKKOS. The new pair styles are not
|
||||
syntax compatible with the removed reax pair style, so input files will
|
||||
have to be adapted. The REAXFF package was originally called
|
||||
USER-REAXC.
|
||||
The LATTE package with the fix latte command was removed from LAMMPS.
|
||||
This functionality has been superseded by :doc:`fix mdi/qm <fix_mdi_qm>`
|
||||
and :doc:`fix mdi/qmmm <fix_mdi_qmmm>` from the :ref:`MDI package
|
||||
<PKG-MDI>`. These fixes are compatible with several quantum software
|
||||
packages, including LATTE. See the ``examples/QUANTUM`` dir and the
|
||||
:doc:`MDI coupling HOWTO <Howto_mdi>` page. MDI supports running LAMMPS
|
||||
with LATTE as a plugin library (similar to the way fix latte worked), as
|
||||
well as on a different set of MPI processors.
|
||||
|
||||
MEAM package
|
||||
------------
|
||||
|
||||
.. deprecated:: 4Jan2019
|
||||
|
||||
The MEAM package in Fortran has been replaced by a C++ implementation.
|
||||
The code in the :ref:`MEAM package <PKG-MEAM>` is a translation of the
|
||||
Fortran code of MEAM into C++, which removes several restrictions
|
||||
@ -168,11 +76,82 @@ for some optimizations leading to better performance. The pair style
|
||||
period the C++ version of MEAM was called USER-MEAMC so it could
|
||||
coexist with the Fortran version.
|
||||
|
||||
Minimize style fire/old
|
||||
-----------------------
|
||||
|
||||
.. deprecated:: 8Feb2023
|
||||
|
||||
Minimize style *fire/old* has been removed. Its functionality can be
|
||||
reproduced with *fire* with specific options. Please see the
|
||||
:doc:`min_modify command <min_modify>` documentation for details.
|
||||
|
||||
Pair style mesont/tpm, compute style mesont, atom style mesont
|
||||
--------------------------------------------------------------
|
||||
|
||||
.. deprecated:: 8Feb2023
|
||||
|
||||
Pair style *mesont/tpm*, compute style *mesont*, and atom style
|
||||
*mesont* have been removed from the :ref:`MESONT package <PKG-MESONT>`.
|
||||
The same functionality is available through
|
||||
:doc:`pair style mesocnt <pair_mesocnt>`,
|
||||
:doc:`bond style mesocnt <bond_mesocnt>` and
|
||||
:doc:`angle style mesocnt <angle_mesocnt>`.
|
||||
|
||||
MPIIO package
|
||||
-------------
|
||||
|
||||
.. deprecated:: 21Nov2023
|
||||
|
||||
The MPIIO package has been removed from LAMMPS since it was unmaintained
|
||||
for many years and thus not updated to incorporate required changes that
|
||||
had been applied to the corresponding non-MPIIO commands. As a
|
||||
consequence the MPIIO commands had become unreliable and sometimes
|
||||
crashing LAMMPS or corrupting data. Similar functionality is available
|
||||
through the :ref:`ADIOS package <PKG-ADIOS>` and the :ref:`NETCDF
|
||||
package <PKG-NETCDF>`. Also, the :doc:`dump_modify nfile or dump_modify
|
||||
fileper <dump_modify>` keywords may be used for an efficient way of
|
||||
writing out dump files when running on large numbers of processors.
|
||||
Similarly, the "nfile" and "fileper" keywords exist for restarts:
|
||||
see :doc:`restart <restart>`, :doc:`read_restart <read_restart>`,
|
||||
:doc:`write_restart <write_restart>`.
|
||||
|
||||
|
||||
MSCG package
|
||||
------------
|
||||
|
||||
.. deprecated:: 21Nov2023
|
||||
|
||||
The MSCG package has been removed from LAMMPS since it was unmaintained
|
||||
for many years and instead superseded by the `OpenMSCG software
|
||||
<https://software.rcc.uchicago.edu/mscg/>`_ of the Voth group at the
|
||||
University of Chicago, which can be used independent from LAMMPS.
|
||||
|
||||
REAX package
|
||||
------------
|
||||
|
||||
The REAX package has been removed since it was superseded by the
|
||||
:ref:`REAXFF package <PKG-REAXFF>`. The REAXFF package has been tested
|
||||
to yield equivalent results to the REAX package, offers better
|
||||
performance, supports OpenMP multi-threading via OPENMP, and GPU and
|
||||
threading parallelization through KOKKOS. The new pair styles are not
|
||||
syntax compatible with the removed reax pair style, so input files will
|
||||
have to be adapted. The REAXFF package was originally called
|
||||
USER-REAXC.
|
||||
|
||||
USER-REAXC package
|
||||
------------------
|
||||
|
||||
.. deprecated:: 7Feb2024
|
||||
|
||||
The USER-REAXC package has been renamed to :ref:`REAXFF <PKG-REAXFF>`.
|
||||
In the process also the pair style and related fixes were renamed to use
|
||||
the "reaxff" string instead of "reax/c". For a while LAMMPS was maintaining
|
||||
backward compatibility by providing aliases for the styles. These have
|
||||
been removed, so using "reaxff" is now *required*.
|
||||
|
||||
USER-CUDA package
|
||||
-----------------
|
||||
|
||||
.. deprecated:: 31May2016
|
||||
|
||||
The USER-CUDA package had been removed, since it had been unmaintained
|
||||
for a long time and had known bugs and problems. Significant parts of
|
||||
the design were transferred to the
|
||||
@ -181,39 +160,19 @@ performance characteristics on NVIDIA GPUs. Both, the KOKKOS
|
||||
and the :ref:`GPU package <PKG-GPU>` are maintained
|
||||
and allow running LAMMPS with GPU acceleration.
|
||||
|
||||
Compute atom/molecule
|
||||
---------------------
|
||||
i-PI tool
|
||||
---------
|
||||
|
||||
.. deprecated:: 11 Dec2015
|
||||
.. versionchanged:: 27Jun2024
|
||||
|
||||
The atom/molecule command has been removed from LAMMPS since it was superseded
|
||||
by the more general and extensible "chunk infrastructure". Here the system is
|
||||
partitioned in one of many possible ways - including using molecule IDs -
|
||||
through the :doc:`compute chunk/atom <compute_chunk_atom>` command and then
|
||||
summing is done using :doc:`compute reduce/chunk <compute_reduce_chunk>` Please
|
||||
refer to the :doc:`chunk HOWTO <Howto_chunk>` section for an overview.
|
||||
The i-PI tool has been removed from the LAMMPS distribution. Instead,
|
||||
instructions to install i-PI from PyPI via pip are provided.
|
||||
|
||||
Fix ave/spatial and fix ave/spatial/sphere
|
||||
------------------------------------------
|
||||
LAMMPS shell
|
||||
------------
|
||||
|
||||
.. deprecated:: 11Dec2015
|
||||
.. versionchanged:: 29Aug2024
|
||||
|
||||
The fixes ave/spatial and ave/spatial/sphere have been removed from LAMMPS
|
||||
since they were superseded by the more general and extensible "chunk
|
||||
infrastructure". Here the system is partitioned in one of many possible
|
||||
ways through the :doc:`compute chunk/atom <compute_chunk_atom>` command
|
||||
and then averaging is done using :doc:`fix ave/chunk <fix_ave_chunk>`.
|
||||
Please refer to the :doc:`chunk HOWTO <Howto_chunk>` section for an overview.
|
||||
|
||||
restart2data tool
|
||||
-----------------
|
||||
|
||||
.. deprecated:: 23Nov2013
|
||||
|
||||
The functionality of the restart2data tool has been folded into the
|
||||
LAMMPS executable directly instead of having a separate tool. A
|
||||
combination of the commands :doc:`read_restart <read_restart>` and
|
||||
:doc:`write_data <write_data>` can be used to the same effect. For
|
||||
added convenience this conversion can also be triggered by
|
||||
:doc:`command-line flags <Run_options>`
|
||||
The LAMMPS shell has been removed from the LAMMPS distribution. Users
|
||||
are encouraged to use the :ref:`LAMMPS-GUI <lammps_gui>` tool instead.
|
||||
|
||||
|
||||
@ -24,5 +24,4 @@ of time and requests from the LAMMPS user community.
|
||||
Classes
|
||||
Developer_platform
|
||||
Developer_utils
|
||||
Developer_internal
|
||||
Developer_grid
|
||||
|
||||
@ -203,7 +203,6 @@ processed in the expected order before types are removed from dynamic
|
||||
dispatch.
|
||||
|
||||
.. admonition:: Important Notes
|
||||
:class: note
|
||||
|
||||
In order to be able to detect incompatibilities at compile time and
|
||||
to avoid unexpected behavior, it is crucial that all member functions
|
||||
@ -301,24 +300,18 @@ Formatting with the {fmt} library
|
||||
|
||||
The LAMMPS source code includes a copy of the `{fmt} library
|
||||
<https://fmt.dev>`_, which is preferred over formatting with the
|
||||
"printf()" family of functions. The primary reason is that it allows a
|
||||
typesafe default format for any type of supported data. This is
|
||||
"printf()" family of functions. The primary reason is that it allows
|
||||
a typesafe default format for any type of supported data. This is
|
||||
particularly useful for formatting integers of a given size (32-bit or
|
||||
64-bit) which may require different format strings depending on compile
|
||||
time settings or compilers/operating systems. Furthermore, {fmt} gives
|
||||
better performance, has more functionality, a familiar formatting syntax
|
||||
that has similarities to ``format()`` in Python, and provides a facility
|
||||
that can be used to integrate format strings and a variable number of
|
||||
arguments into custom functions in a much simpler way than the varargs
|
||||
mechanism of the C library. Finally, {fmt} has been included into the
|
||||
C++20 language standard as ``std::format()``, so changes to adopt it are
|
||||
future-proof, for as long as they are not using any extensions that are
|
||||
not (yet) included into C++.
|
||||
|
||||
The long-term plan is to switch to using ``std::format()`` instead of
|
||||
``fmt::format()`` when the minimum C++ standard required for LAMMPS will
|
||||
be set to C++20. See the :ref:`basic build instructions <compile>` for
|
||||
more details.
|
||||
64-bit) which may require different format strings depending on
|
||||
compile time settings or compilers/operating systems. Furthermore,
|
||||
{fmt} gives better performance, has more functionality, a familiar
|
||||
formatting syntax that has similarities to ``format()`` in Python, and
|
||||
provides a facility that can be used to integrate format strings and a
|
||||
variable number of arguments into custom functions in a much simpler
|
||||
way than the varargs mechanism of the C library. Finally, {fmt} has
|
||||
been included into the C++20 language standard, so changes to adopt it
|
||||
are future-proof.
|
||||
|
||||
Formatted strings are frequently created by calling the
|
||||
``fmt::format()`` function, which will return a string as a
|
||||
@ -326,13 +319,11 @@ Formatted strings are frequently created by calling the
|
||||
``printf()``, the {fmt} library uses ``{}`` to embed format descriptors.
|
||||
In the simplest case, no additional characters are needed, as {fmt} will
|
||||
choose the default format based on the data type of the argument.
|
||||
Otherwise, the :cpp:func:`utils::print() <LAMMPS_NS::utils::print>`
|
||||
function may be used instead of ``printf()`` or ``fprintf()``. In
|
||||
addition, several LAMMPS output functions, that originally accepted a
|
||||
single string as argument have been overloaded to accept a format string
|
||||
with optional arguments as well (e.g., ``Error::all()``,
|
||||
``Error::one()``, :cpp:func:`utils::logmesg()
|
||||
<LAMMPS_NS::utils::logmesg>`).
|
||||
Otherwise, the ``fmt::print()`` function may be used instead of
|
||||
``printf()`` or ``fprintf()``. In addition, several LAMMPS output
|
||||
functions, that originally accepted a single string as argument have
|
||||
been overloaded to accept a format string with optional arguments as
|
||||
well (e.g., ``Error::all()``, ``Error::one()``, ``utils::logmesg()``).
|
||||
|
||||
Summary of the {fmt} format syntax
|
||||
==================================
|
||||
|
||||
@ -79,19 +79,19 @@ containing ``double`` values. To correctly store integers that may be
|
||||
64-bit (bigint, tagint, imageint) in the buffer, you need to use the
|
||||
:ref:`ubuf union <communication_buffer_coding_with_ubuf>` construct.
|
||||
|
||||
The *Fix*, *Bond*, *Compute*, and *Dump* classes can also invoke the
|
||||
same kind of forward and reverse communication operations using the
|
||||
same *Comm* class methods. Likewise, the same pack/unpack methods and
|
||||
The *Fix*, *Compute*, and *Dump* classes can also invoke the same kind
|
||||
of forward and reverse communication operations using the same *Comm*
|
||||
class methods. Likewise, the same pack/unpack methods and
|
||||
comm_forward/comm_reverse variables must be defined by the calling
|
||||
*Fix*, *Bond*, *Compute*, or *Dump* class.
|
||||
*Fix*, *Compute*, or *Dump* class.
|
||||
|
||||
For all of these classes, there is an optional second argument to the
|
||||
For *Fix* classes, there is an optional second argument to the
|
||||
*forward_comm()* and *reverse_comm()* call which can be used when the
|
||||
class performs multiple modes of communication, with different numbers
|
||||
of values per atom. The class should set the *comm_forward* and
|
||||
fix performs multiple modes of communication, with different numbers
|
||||
of values per atom. The fix should set the *comm_forward* and
|
||||
*comm_reverse* variables to the maximum value, but can invoke the
|
||||
communication for a particular mode with a smaller value. For this
|
||||
to work, the *pack_forward_comm()*, etc. methods typically use a class
|
||||
to work, the *pack_forward_comm()*, etc methods typically use a class
|
||||
member variable to choose which values to pack/unpack into/from the
|
||||
buffer.
|
||||
|
||||
|
||||
@ -209,7 +209,7 @@ nve, nvt, npt.
|
||||
|
||||
At the end of the timestep, fixes that contain an ``end_of_step()``
|
||||
method are invoked. These typically perform a diagnostic calculation,
|
||||
e.g. the ave/time and ave/chunk fixes. The final operation of the
|
||||
e.g. the ave/time and ave/spatial fixes. The final operation of the
|
||||
timestep is to perform any requested output, via the ``write()`` method
|
||||
of the Output class. There are 3 kinds of LAMMPS output: thermodynamic
|
||||
output to the screen and log file, snapshots of atom data to a dump
|
||||
|
||||
@ -1,120 +0,0 @@
|
||||
Internal Styles
|
||||
---------------
|
||||
|
||||
LAMMPS has a number of styles that are not meant to be used in an input
|
||||
file and thus are not documented in the :doc:`LAMMPS command
|
||||
documentation <Commands_all>`. The differentiation between user
|
||||
commands and internal commands is through the case of the command name:
|
||||
user commands and styles are all lower case, internal styles are all
|
||||
upper case. Internal styles are not called from the input file, but
|
||||
their classes are instantiated by other styles. Often they are
|
||||
created by other styles to store internal data or to perform actions
|
||||
regularly at specific steps of the simulation.
|
||||
|
||||
The paragraphs below document some of those styles that have general
|
||||
utility and may be used to avoid redundant implementation.
|
||||
|
||||
DEPRECATED Styles
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
The styles called DEPRECATED (e.g. pair, bond, fix, compute, region, etc.)
|
||||
have the purpose to inform users that a specific style has been removed
|
||||
or renamed. This is achieved by creating an alias for the deprecated
|
||||
style to the corresponding class. For example, the fix style DEPRECATED
|
||||
is aliased to fix style ave/spatial and fix style ave/spatial/sphere with
|
||||
the following code:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
FixStyle(DEPRECATED,FixDeprecated);
|
||||
FixStyle(ave/spatial,FixDeprecated);
|
||||
FixStyle(ave/spatial/sphere,FixDeprecated);
|
||||
|
||||
The individual class will then determine based on the style name
|
||||
what action to perform:
|
||||
|
||||
- inform that the style has been removed and what style replaces it, if any, and then error out
|
||||
- inform that the style has been renamed and then either execute the replacement or error out
|
||||
- inform that the style is no longer required, and it is thus ignored and continue
|
||||
|
||||
There is also a section in the user's guide for :doc:`removed commands
|
||||
and packages <Commands_removed>` with additional explanations.
|
||||
|
||||
Internal fix styles
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
These provide an implementation of features that would otherwise have
|
||||
been replicated across multiple styles. The used fix ID is generally
|
||||
derived from the compute or fix ID creating the fix with some string
|
||||
appended. When needed, the fix can be looked up with
|
||||
``Modify::get_fix_by_id()``, which returns a pointer to the fix
|
||||
instance. The data managed by the fix can be accessed just as for other
|
||||
fixes that can be used in input files.
|
||||
|
||||
fix DUMMY
|
||||
"""""""""
|
||||
|
||||
Most fix classes cannot be instantiated before the simulation box has
|
||||
been created since they access data that is only available then.
|
||||
However, in some cases it is required that a fix must be at or close to
|
||||
the top of the list of all fixes. In those cases an instance of the
|
||||
DUMMY fix style may be created by calling ``Modify::add_fix()`` and then
|
||||
later replaced by the intended fix through calling ``Modify::replace_fix()``.
|
||||
|
||||
fix STORE/ATOM
|
||||
""""""""""""""
|
||||
|
||||
Fix STORE/ATOM can be used as persistent storage of per-atom data.
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
fix ID group-ID STORE/ATOM N1 N2 gflag rflag
|
||||
|
||||
* ID, group-ID are documented in :doc:`fix <fix>` command
|
||||
* STORE/ATOM = style name of this fix command
|
||||
* N1 = 1, N2 = 0 : data is per-atom vector = single value per atom
|
||||
* N1 > 1, N2 = 0 : data is per-atom array = N1 values per atom
|
||||
* N1 > 0, N2 > 0 : data is per-atom tensor = N1xN2 values per atom
|
||||
* gflag = 1 communicate per-atom values with ghost atoms, 0 do not update ghost atom data
|
||||
* rflag = 1 store per-atom value in restart file, 0 do not store data in restart
|
||||
|
||||
Similar functionality is also available through using custom per-atom
|
||||
properties with :doc:`fix property/atom <fix_property_atom>`. The
|
||||
choice between the two fixes should be based on whether the user should
|
||||
be able to access this per-atom data: if yes, then fix property/atom is
|
||||
preferred, otherwise fix STORE/ATOM.
|
||||
|
||||
fix STORE/GLOBAL
|
||||
""""""""""""""""
|
||||
|
||||
Fix STORE/GLOBAL can be used as persistent storage of global data with support for restarts
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
fix ID group-ID STORE/GLOBAL N1 N2
|
||||
|
||||
* ID, group-ID are documented in :doc:`fix <fix>` command
|
||||
* STORE/GLOBAL = style name of this fix command
|
||||
* N1 >=1 : number of global items to store
|
||||
* N2 = 1 : data is global vector of length N1
|
||||
* N2 > 1 : data is global N1xN2 array
|
||||
|
||||
fix STORE/LOCAL
|
||||
"""""""""""""""
|
||||
|
||||
Fix STORE/LOCAL can be used as persistent storage for local data
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
fix ID group-ID STORE/LOCAL Nreset Nvalues
|
||||
|
||||
* ID, group-ID are documented in :doc:`fix <fix>` command
|
||||
* STORE/LOCAL = style name of this fix command
|
||||
* Nreset = frequency at which local data is available
|
||||
* Nvalues = number of values per local item, that is the number of columns
|
||||
@ -7,7 +7,13 @@ typically document what a variable stores, what a small section of
|
||||
code does, or what a function does and its input/outputs. The topics
|
||||
on this page are intended to document code functionality at a higher level.
|
||||
|
||||
.. contents:: Available notes
|
||||
Available topics are:
|
||||
|
||||
- `Reading and parsing of text and text files`_
|
||||
- `Requesting and accessing neighbor lists`_
|
||||
- `Choosing between a custom atom style, fix property/atom, and fix STORE/ATOM`_
|
||||
- `Fix contributions to instantaneous energy, virial, and cumulative energy`_
|
||||
- `KSpace PPPM FFT grids`_
|
||||
|
||||
----
|
||||
|
||||
@ -212,149 +218,6 @@ command:
|
||||
|
||||
neighbor->add_request(this, "delete_atoms", NeighConst::REQ_FULL);
|
||||
|
||||
|
||||
Errors, warnings, and informational messages
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
LAMMPS has specialized functionality to handle errors (which should
|
||||
terminate LAMMPS), warning messages (which should indicate possible
|
||||
problems *without* terminating LAMMPS), and informational text for
|
||||
messages about the progress and chosen settings. We *strongly*
|
||||
encourage using these facilities and to *stay away* from using
|
||||
``printf()`` or ``fprintf()`` or ``std::cout`` or ``std::cerr`` and
|
||||
calling ``MPI_Abort()`` or ``exit()`` directly. Warnings and
|
||||
informational messages should be printed only on MPI rank 0 to avoid
|
||||
flooding the output when running in parallel with many MPI processes.
|
||||
|
||||
**Errors**
|
||||
|
||||
When LAMMPS encounters an error, for example a syntax error in the
|
||||
input, then a suitable error message should be printed giving a brief,
|
||||
one line remark about the reason and then call either ``Error::all()``
|
||||
or ``Error::one()``. ``Error::all()`` must be called when the failing
|
||||
code path is executed by *all* MPI processes and the error condition
|
||||
will appear for *all* MPI processes the same. If desired, each MPI
|
||||
process may set a flag to either 0 or 1 and then MPI_Allreduce()
|
||||
searching for the maximum can be used to determine if there was an error
|
||||
on *any* of the MPI processes and make this information available to
|
||||
*all*. ``Error::one()`` in contrast needs to be called when only one or
|
||||
a few MPI processes execute the code path or can have the error
|
||||
condition. ``Error::all()`` is generally the preferred option.
|
||||
|
||||
Calling these functions does not abort LAMMPS directly, but rather
|
||||
throws either a ``LAMMPSException`` (from ``Error::all()``) or a
|
||||
``LAMMPSAbortException`` (from ``Error::one()``). These exceptions are
|
||||
caught by the LAMMPS ``main()`` program and then handled accordingly.
|
||||
The reason for this approach is to support applications, especially
|
||||
graphical applications like :ref:`LAMMPS-GUI <lammps_gui>`, that are
|
||||
linked to the LAMMPS library and have a mechanism to avoid that an error
|
||||
in LAMMPS terminates the application. By catching the exceptions, the
|
||||
application can delete the failing LAMMPS class instance and create a
|
||||
new one to try again. In a similar fashion, the :doc:`LAMMPS Python
|
||||
module <Python_module>` checks for this and then re-throws corresponding
|
||||
Python exception, which in turn can be caught by the calling Python
|
||||
code.
|
||||
|
||||
There are multiple "signatures" that can be called:
|
||||
|
||||
- ``Error::all(FLERR, "Error message")``: this will abort LAMMPS with
|
||||
the error message "Error message", followed by the last line of input
|
||||
that was read and processed before the error condition happened.
|
||||
|
||||
- ``Error::all(FLERR, Error::NOLASTLINE, "Error message")``: this is the
|
||||
same as before but without the last line of input. This is preferred
|
||||
for errors that would happen *during* a :doc:`run <run>` or
|
||||
:doc:`minimization <minimize>`, since showing the "run" or "minimize"
|
||||
command would be the last line, but is unrelated to the error.
|
||||
|
||||
- ``Error::all(FLERR, idx, "Error message")``: this is for argument
|
||||
parsing where "idx" is the index (starting at 0) of the argument for a
|
||||
LAMMPS command that is causing the failure (use -1 for the command
|
||||
itself). For index 0, you need to use the constant ``Error::ARGZERO``
|
||||
to work around the inability of some compilers to disambiguate between
|
||||
a NULL pointer and an integer constant 0, even with an added type cast.
|
||||
The output may also include the last input line *before* and
|
||||
*after*, if they differ due to substituting variables. A textual
|
||||
indicator is pointing to the specific word that failed. Using the
|
||||
constant ``Error::NOPOINTER`` in place of the *idx* argument will
|
||||
suppress the marker and then the behavior is like the *idx* argument
|
||||
is not provided.
|
||||
|
||||
FLERR is a macro containing the filename and line where the Error class
|
||||
is called and that information is appended to the error message. This
|
||||
allows to quickly find the relevant source code causing the error. For
|
||||
all three signatures, the single string "Error message" may be replaced
|
||||
with a format string using '{}' placeholders and followed by a variable
|
||||
number of arguments, one for each placeholder. This format string and
|
||||
the arguments are then handed for formatting to the `{fmt} library
|
||||
<https://fmt.dev>`_ (which is bundled with LAMMPS) and thus allow
|
||||
processing similar to the "format()" functionality in Python.
|
||||
|
||||
.. note::
|
||||
|
||||
For commands like :doc:`fix ave/time <fix_ave_time>` that accept
|
||||
wildcard arguments, the :cpp:func:`utils::expand_args` function
|
||||
may be passed as an optional argument where the function will provide
|
||||
a map to the original arguments from the expanded argument indices.
|
||||
|
||||
For complex errors, that can have multiple causes and which cannot be
|
||||
explained in a single line, you can append to the error message, the
|
||||
string created by :cpp:func:`utils::errorurl`, which then provides a
|
||||
URL pointing to a paragraph of the :doc:`Errors_details` that
|
||||
corresponds to the number provided. Example:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
error->all(FLERR, "Unknown identifier in data file: {}{}", keyword, utils::errorurl(1));
|
||||
|
||||
This will output something like this:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
ERROR: Unknown identifier in data file: Massess
|
||||
For more information see https://docs.lammps.org/err0001 (src/read_data.cpp:1482)
|
||||
Last input line: read_data data.peptide
|
||||
|
||||
Where the URL points to the first paragraph with explanations on
|
||||
the :doc:`Errors_details` page in the manual.
|
||||
|
||||
**Warnings**
|
||||
|
||||
To print warnings, the ``Errors::warning()`` function should be used.
|
||||
It also requires the FLERR macros as first argument to easily identify
|
||||
the location of the warning in the source code. Same as with the error
|
||||
functions above, the function has two variants: one just taking a single
|
||||
string as final argument and a second that uses the `{fmt} library
|
||||
<https://fmt.dev>`_ to make it similar to, say, ``fprintf()``. One
|
||||
motivation to use this function is that it will output warnings with
|
||||
always the same capitalization of the leading "WARNING" string. A
|
||||
second is that it has a built in rate limiter. After a given number (by
|
||||
default 100), that can be set via the :doc:`thermo_modify command
|
||||
<thermo_modify>` no more warnings are printed. Also, warnings are
|
||||
written consistently to both screen and logfile or not, depending on the
|
||||
settings for :ref:`screen <screen>` or :doc:`logfile <log>` output.
|
||||
|
||||
.. note::
|
||||
|
||||
Unlike ``Error::all()``, the warning function will produce output on
|
||||
*every* MPI process, so it typically would be prefixed with an if
|
||||
statement testing for ``comm->me == 0``, i.e. limiting output to MPI
|
||||
rank 0.
|
||||
|
||||
**Informational messages**
|
||||
|
||||
Finally, for informational message LAMMPS has the
|
||||
:cpp:func:`utils::logmesg() convenience function
|
||||
<LAMMPS_NS::utils::logmesg>`. It also uses the `{fmt} library
|
||||
<https://fmt.dev>`_ to support using a format string followed by a
|
||||
matching number of arguments. It will output the resulting formatted
|
||||
text to both, the screen and the logfile and will honor the
|
||||
corresponding settings about whether this output is active and to which
|
||||
file it should be send. Same as for ``Error::warning()``, it would
|
||||
produce output for every MPI process and thus should usually be called
|
||||
only on MPI rank 0 to avoid flooding the output when running with many
|
||||
parallel processes.
|
||||
|
||||
Choosing between a custom atom style, fix property/atom, and fix STORE/ATOM
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
@ -94,12 +94,12 @@ represents what is generally referred to as an "instance of LAMMPS". It
|
||||
is a composite holding pointers to instances of other core classes
|
||||
providing the core functionality of the MD engine in LAMMPS and through
|
||||
them abstractions of the required operations. The constructor of the
|
||||
LAMMPS class will instantiate those instances, process the command-line
|
||||
LAMMPS class will instantiate those instances, process the command line
|
||||
flags, initialize MPI (if not already done) and set up file pointers for
|
||||
input and output. The destructor will shut everything down and free all
|
||||
associated memory. Thus code for the standalone LAMMPS executable in
|
||||
``main.cpp`` simply initializes MPI, instantiates a single instance of
|
||||
LAMMPS while passing it the command-line flags and input script. It
|
||||
LAMMPS while passing it the command line flags and input script. It
|
||||
deletes the LAMMPS instance after the method reading the input returns
|
||||
and shuts down the MPI environment before it exits the executable.
|
||||
|
||||
|
||||
@ -68,25 +68,24 @@ Members of ``lammpsplugin_t``
|
||||
* - author
|
||||
- String with the name and email of the author
|
||||
* - creator.v1
|
||||
- Pointer to factory function for pair, bond, angle, dihedral, improper, kspace, command, or minimize styles
|
||||
- Pointer to factory function for pair, bond, angle, dihedral, improper, kspace, or command styles
|
||||
* - creator.v2
|
||||
- Pointer to factory function for compute, fix, region, or run styles
|
||||
- Pointer to factory function for compute, fix, or region styles
|
||||
* - handle
|
||||
- Pointer to the open DSO file handle
|
||||
|
||||
Only one of the two alternate creator entries can be used at a time and
|
||||
which of those is determined by the style of plugin. The "creator.v1"
|
||||
element is for factory functions of supported styles computing forces
|
||||
(i.e. pair, bond, angle, dihedral, or improper styles), command styles,
|
||||
or minimize styles and the function takes as single argument the pointer
|
||||
to the LAMMPS instance. The factory function is cast to the
|
||||
``lammpsplugin_factory1`` type before assignment. The "creator.v2"
|
||||
element is for factory functions creating an instance of a fix, compute,
|
||||
region, or run style and takes three arguments: a pointer to the LAMMPS
|
||||
instance, an integer with the length of the argument list and a ``char
|
||||
**`` pointer to the list of arguments. The factory function pointer
|
||||
needs to be cast to the ``lammpsplugin_factory2`` type before
|
||||
assignment.
|
||||
(i.e. pair, bond, angle, dihedral, or improper styles) or command styles
|
||||
and the function takes as single argument the pointer to the LAMMPS
|
||||
instance. The factory function is cast to the ``lammpsplugin_factory1``
|
||||
type before assignment. The "creator.v2" element is for factory
|
||||
functions creating an instance of a fix, compute, or region style and
|
||||
takes three arguments: a pointer to the LAMMPS instance, an integer with
|
||||
the length of the argument list and a ``char **`` pointer to the list of
|
||||
arguments. The factory function pointer needs to be cast to the
|
||||
``lammpsplugin_factory2`` type before assignment.
|
||||
|
||||
Pair style example
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
@ -248,8 +247,8 @@ DSO handle. The registration function is called with a pointer to the address
|
||||
of this struct and the pointer of the LAMMPS class. The registration function
|
||||
will then add the factory function of the plugin style to the respective
|
||||
style map under the provided name. It will also make a copy of the struct
|
||||
in a global list of all loaded plugins and update the reference counter for
|
||||
loaded plugins from this specific DSO file.
|
||||
in a list of all loaded plugins and update the reference counter for loaded
|
||||
plugins from this specific DSO file.
|
||||
|
||||
The pair style itself (i.e. the PairMorse2 class in this example) can be
|
||||
written just like any other pair style that is included in LAMMPS. For
|
||||
@ -264,21 +263,6 @@ the plugin will override the existing code. This can be used to modify
|
||||
the behavior of existing styles or to debug new versions of them without
|
||||
having to re-compile or re-install all of LAMMPS.
|
||||
|
||||
.. versionchanged:: 12Jun2025
|
||||
|
||||
When using the :doc:`clear <clear>` command, plugins are not unloaded
|
||||
but restored to their respective style maps. This also applies when
|
||||
multiple LAMMPS instances are created and deleted through the library
|
||||
interface. The :doc:`plugin load <plugin>` load command may be issued
|
||||
again, but for existing plugins they will be skipped. To replace
|
||||
plugins they must be explicitly unloaded with :doc:`plugin unload
|
||||
<plugin>`. When multiple LAMMPS instances are created concurrently, any
|
||||
loaded plugins will be added to the global list of plugins, but are not
|
||||
immediately available to any LAMMPS instance that was created before
|
||||
loading the plugin. To "import" such plugins, the :doc:`plugin restore
|
||||
<plugin>` may be used. Plugins are only removed when they are explicitly
|
||||
unloaded or the LAMMPS interface is "finalized".
|
||||
|
||||
Compiling plugins
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
@ -227,12 +227,12 @@ Tests for the C-style library interface
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Tests for validating the LAMMPS C-style library interface are in the
|
||||
``unittest/c-library`` folder. They text either utility functions or
|
||||
LAMMPS commands, but use the functions implemented in
|
||||
``src/library.cpp`` as much as possible. There may be some overlap with
|
||||
other tests as far as the LAMMPS functionality is concerned, but the
|
||||
focus is on testing the C-style library API. The tests are distributed
|
||||
over multiple test programs which try to match the grouping of the
|
||||
``unittest/c-library`` folder. They are implemented either to be used
|
||||
for utility functions or for LAMMPS commands, but use the functions
|
||||
implemented in the ``src/library.cpp`` file as much as possible. There
|
||||
may be some overlap with other tests, but only in as much as is required
|
||||
to test the C-style library API. The tests are distributed over
|
||||
multiple test programs which try to match the grouping of the
|
||||
functions in the source code and :ref:`in the manual <lammps_c_api>`.
|
||||
|
||||
This group of tests also includes tests invoking LAMMPS in parallel
|
||||
@ -258,7 +258,7 @@ Tests for the Python module and package
|
||||
|
||||
The ``unittest/python`` folder contains primarily tests for classes and
|
||||
functions in the LAMMPS python module but also for commands in the
|
||||
PYTHON package. These tests are only enabled, if the necessary
|
||||
PYTHON package. These tests are only enabled if the necessary
|
||||
prerequisites are detected or enabled during configuration and
|
||||
compilation of LAMMPS (shared library build enabled, Python interpreter
|
||||
found, Python development files found).
|
||||
@ -272,30 +272,29 @@ Tests for the Fortran interface
|
||||
|
||||
Tests for using the Fortran module are in the ``unittest/fortran``
|
||||
folder. Since they are also using the GoogleTest library, they require
|
||||
test wrappers written in C++ that will call fortran functions with a C
|
||||
function interface through ISO_C_BINDINGS which will in turn call the
|
||||
functions in the LAMMPS Fortran module.
|
||||
implementing test wrappers in C++ that will call fortran functions
|
||||
which provide a C function interface through ISO_C_BINDINGS that will in
|
||||
turn call the functions in the LAMMPS Fortran module.
|
||||
|
||||
Tests for the C++-style library interface
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The tests in the ``unittest/cplusplus`` folder are somewhat similar to
|
||||
the tests for the C-style library interface, but do not need to test the
|
||||
convenience and utility functions that are only available through the
|
||||
C-style library interface. Instead they focus on the more generic
|
||||
features that are used in LAMMPS internally. This part of the unit
|
||||
tests is currently still mostly in the planning stage.
|
||||
several convenience and utility functions that are only available through
|
||||
the C-style interface. Instead it can focus on the more generic features
|
||||
that are used internally. This part of the unit tests is currently still
|
||||
mostly in the planning stage.
|
||||
|
||||
Tests for reading and writing file formats
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The ``unittest/formats`` folder contains test programs for reading and
|
||||
writing files like data files, restart files, potential files or dump
|
||||
files. This covers simple things like the file i/o convenience
|
||||
functions in the ``utils::`` namespace to complex tests of atom styles
|
||||
where creating and deleting of atoms with different properties is tested
|
||||
in different ways and through script commands or reading and writing of
|
||||
data or restart files.
|
||||
writing files like data files, restart files, potential files or dump files.
|
||||
This covers simple things like the file i/o convenience functions in the
|
||||
``utils::`` namespace to complex tests of atom styles where creating and
|
||||
deleting atoms with different properties is tested in different ways
|
||||
and through script commands or reading and writing of data or restart files.
|
||||
|
||||
Tests for styles computing or modifying forces
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -444,7 +443,7 @@ file for a style that is similar to one to be tested. The file name should
|
||||
follow the naming conventions described above and after copying the file,
|
||||
the first step is to replace the style names where needed. The coefficient
|
||||
values do not have to be meaningful, just in a reasonable range for the
|
||||
given system. It does not matter if some forces are large, for as long as
|
||||
given system. It does not matter if some forces are large, as long as
|
||||
they do not diverge.
|
||||
|
||||
The template input files define a large number of index variables at the top
|
||||
@ -477,7 +476,7 @@ the tabulated coulomb, to test both code paths. The reference results in the YA
|
||||
files then should be compared manually, if they agree well enough within the limits
|
||||
of those two approximations.
|
||||
|
||||
The ``test_pair_style`` and equivalent programs have special command-line options
|
||||
The ``test_pair_style`` and equivalent programs have special command line options
|
||||
to update the YAML files. Running a command like
|
||||
|
||||
.. code-block:: bash
|
||||
@ -532,20 +531,19 @@ Python module.
|
||||
Troubleshooting failed unit tests
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
There are by default no unit tests for newly added features (e.g. pair,
|
||||
fix, or compute styles) unless your pull request also includes tests for
|
||||
these added features. If you are modifying some existing LAMMPS
|
||||
features, you may see failures for existing tests, if your modifications
|
||||
have some unexpected side effects or your changes render the existing
|
||||
test invalid. If you are adding an accelerated version of an existing
|
||||
style, then only tests for INTEL, KOKKOS (with OpenMP only), OPENMP, and
|
||||
OPT will be run automatically. Tests for the GPU package are time
|
||||
consuming and thus are only run *after* a merge, or when a special
|
||||
label, ``gpu_unit_tests`` is added to the pull request. After the test
|
||||
has started, it is often best to remove the label since every PR
|
||||
activity will re-trigger the test (that is a limitation of triggering a
|
||||
test with a label). Support for unit tests using KOKKOS with GPU
|
||||
acceleration is currently not supported.
|
||||
The are by default no unit tests for newly added features (e.g. pair, fix,
|
||||
or compute styles) unless your pull request also includes tests for the
|
||||
added features. If you are modifying some features, you may see failures
|
||||
for existing tests, if your modifications have some unexpected side effects
|
||||
or your changes render the existing test invalid. If you are adding an
|
||||
accelerated version of an existing style, then only tests for INTEL,
|
||||
KOKKOS (with OpenMP only), OPENMP, and OPT will be run automatically.
|
||||
Tests for the GPU package are time consuming and thus are only run
|
||||
*after* a merge, or when a special label, ``gpu_unit_tests`` is added
|
||||
to the pull request. After the test has started, it is often best to
|
||||
remove the label since every PR activity will re-trigger the test (that
|
||||
is a limitation of triggering a test with a label). Support for unit
|
||||
tests when using KOKKOS with GPU acceleration is currently not supported.
|
||||
|
||||
When you see a failed build on GitHub, click on ``Details`` to be taken
|
||||
to the corresponding LAMMPS Jenkins CI web page. Click on the "Exit"
|
||||
@ -590,7 +588,7 @@ While the epsilon (relative precision) for a single, `IEEE 754 compliant
|
||||
<https://en.wikipedia.org/wiki/IEEE_754>`_, double precision floating
|
||||
point operation is at about 2.2e-16, the achievable precision for the
|
||||
tests is lower due to most numbers being sums over intermediate results
|
||||
for which the non-associativity of floating point math leads to larger
|
||||
and the non-associativity of floating point math leading to larger
|
||||
errors. As a rule of thumb, the test epsilon can often be in the range
|
||||
5.0e-14 to 1.0e-13. But for "noisy" force kernels, e.g. those a larger
|
||||
amount of arithmetic operations involving `exp()`, `log()` or `sin()`
|
||||
@ -604,14 +602,14 @@ of floating point operations or that some or most intermediate operations
|
||||
may be done using approximations or with single precision floating point
|
||||
math.
|
||||
|
||||
To rerun a failed unit test individually, change to the ``build`` directory
|
||||
To rerun the failed unit test individually, change to the ``build`` directory
|
||||
and run the test with verbose output. For example,
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
env TEST_ARGS=-v ctest -R ^MolPairStyle:lj_cut_coul_long -V
|
||||
|
||||
``ctest`` with the ``-V`` flag also shows the exact command
|
||||
``ctest`` with the ``-V`` flag also shows the exact command line
|
||||
of the test. One can then use ``gdb --args`` to further debug and
|
||||
catch exceptions with the test command, for example,
|
||||
|
||||
|
||||
@ -29,8 +29,6 @@ Available topics in mostly chronological order are:
|
||||
- `Rename of fix STORE/PERATOM to fix STORE/ATOM and change of arguments`_
|
||||
- `Use Output::get_dump_by_id() instead of Output::find_dump()`_
|
||||
- `Refactored grid communication using Grid3d/Grid2d classes instead of GridComm`_
|
||||
- `FLERR as first argument to minimum image functions in Domain class`_
|
||||
- `Use utils::logmesg() instead of error->warning()`_
|
||||
|
||||
----
|
||||
|
||||
@ -612,71 +610,3 @@ KSpace solvers which use distributed FFT grids:
|
||||
- ``src/KSPACE/pppm.cpp``
|
||||
|
||||
This change is **required** or else the code will not compile.
|
||||
|
||||
FLERR as first argument to minimum image functions in Domain class
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. versionchanged:: 12Jun2025
|
||||
|
||||
The ``Domain::minimum_image()`` and ``Domain::minimum_image_big()``
|
||||
functions were changed to take the ``FLERR`` macros as first argument.
|
||||
This way the error message indicates *where* the function was called
|
||||
instead of pointing to the implementation of the function. Example:
|
||||
|
||||
Old:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
double delx1 = x[i1][0] - x[i2][0];
|
||||
double dely1 = x[i1][1] - x[i2][1];
|
||||
double delz1 = x[i1][2] - x[i2][2];
|
||||
domain->minimum_image(delx1, dely1, delz1);
|
||||
double r1 = sqrt(delx1 * delx1 + dely1 * dely1 + delz1 * delz1);
|
||||
|
||||
double delx2 = x[i3][0] - x[i2][0];
|
||||
double dely2 = x[i3][1] - x[i2][1];
|
||||
double delz2 = x[i3][2] - x[i2][2];
|
||||
domain->minimum_image_big(delx2, dely2, delz2);
|
||||
double r2 = sqrt(delx2 * delx2 + dely2 * dely2 + delz2 * delz2);
|
||||
|
||||
New:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
double delx1 = x[i1][0] - x[i2][0];
|
||||
double dely1 = x[i1][1] - x[i2][1];
|
||||
double delz1 = x[i1][2] - x[i2][2];
|
||||
domain->minimum_image(FLERR, delx1, dely1, delz1);
|
||||
double r1 = sqrt(delx1 * delx1 + dely1 * dely1 + delz1 * delz1);
|
||||
|
||||
double delx2 = x[i3][0] - x[i2][0];
|
||||
double dely2 = x[i3][1] - x[i2][1];
|
||||
double delz2 = x[i3][2] - x[i2][2];
|
||||
domain->minimum_image_big(FLERR, delx2, dely2, delz2);
|
||||
double r2 = sqrt(delx2 * delx2 + dely2 * dely2 + delz2 * delz2);
|
||||
|
||||
This change is **required** or else the code will not compile.
|
||||
|
||||
Use utils::logmesg() instead of error->warning()
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. versionchanged:: TBD
|
||||
|
||||
The ``Error::message()`` method has been removed since its functionality
|
||||
has been superseded by the :cpp:func:`utils::logmesg` function.
|
||||
|
||||
Old:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
if (comm->me == 0) {
|
||||
error->message(FLERR, "INFO: About to read data file: {}", filename);
|
||||
}
|
||||
|
||||
New:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
if (comm->me == 0) utils::logmesg(lmp, "INFO: About to read data file: {}\n", filename);
|
||||
|
||||
This change is **required** or else the code will not compile.
|
||||
|
||||
@ -133,9 +133,6 @@ and parsing files or arguments.
|
||||
.. doxygenfunction:: trim_comment
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: strcompress
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: strip_style_suffix
|
||||
:project: progguide
|
||||
|
||||
@ -169,9 +166,6 @@ and parsing files or arguments.
|
||||
.. doxygenfunction:: split_lines
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: strsame
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: strmatch
|
||||
:project: progguide
|
||||
|
||||
@ -238,21 +232,12 @@ Convenience functions
|
||||
.. doxygenfunction:: logmesg(LAMMPS *lmp, const std::string &mesg)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: print(FILE *fp, const std::string &format, Args&&... args)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: print(FILE *fp, const std::string &mesg)
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: errorurl
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: missing_cmd_args
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: point_to_error
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: flush_buffers(LAMMPS *lmp)
|
||||
:project: progguide
|
||||
|
||||
|
||||
@ -12,4 +12,3 @@ details are provided for writing code for LAMMPS.
|
||||
|
||||
Developer_write_pair
|
||||
Developer_write_fix
|
||||
Developer_write_command
|
||||
|
||||
@ -1,348 +0,0 @@
|
||||
Writing a new command style
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Command styles allow to do system manipulations or interfaces to the
|
||||
operating system.
|
||||
|
||||
In the text below, we will discuss the implementation of one example. As
|
||||
shown on the page for :doc:`writing or extending command styles
|
||||
<Modify_command>`, in order to implement a new command style, a new class
|
||||
must be written that is either directly or indirectly derived from the
|
||||
``Command`` class. There is just one method that must be implemented:
|
||||
``Command::command()``. In addition, a custom constructor is needed to get
|
||||
access to the members of the ``LAMMPS`` class like the ``Error`` class to
|
||||
print out error messages. The ``Command::command()`` method processes the
|
||||
arguments passed to the command in the input and executes it. Any other
|
||||
methods would be for the convenience of implementation of the new command.
|
||||
|
||||
In general, new command styles should be added to the :ref:`EXTRA-COMMAND
|
||||
package <PKG-EXTRA-COMMAND>`. If you feel that your contribution should be
|
||||
added to a different package, please consult with the :doc:`LAMMPS
|
||||
developers <Intro_authors>` first. The contributed code needs to support
|
||||
the :doc:`traditional GNU make build process <Build_make>` **and** the
|
||||
:doc:`CMake build process <Build_cmake>`.
|
||||
|
||||
----
|
||||
|
||||
Case 1: Implementing the geturl command
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
In this section, we will describe the procedure of adding a simple command
|
||||
style to LAMMPS: the :doc:`geturl command <geturl>` that allows to download
|
||||
files directly without having to rely on an external program like "wget" or
|
||||
"curl". The complete implementation can be found in the files
|
||||
``src/EXTRA-COMMAND/geturl.cpp`` and ``src/EXTRA-COMMAND/geturl.h`` of the
|
||||
LAMMPS source code.
|
||||
|
||||
Interfacing the *libcurl* library
|
||||
"""""""""""""""""""""""""""""""""
|
||||
|
||||
Rather than implementing the various protocols for downloading files, we
|
||||
rely on an external library: `libcurl library <https:://curl.se/libcurl/>`_.
|
||||
This requires that the library and its headers are installed. For the
|
||||
traditional GNU make build system, this simply requires edits to the machine
|
||||
makefile to add compilation flags like for other libraries. For the CMake
|
||||
based build system, we need to add some lines to the file
|
||||
``cmake/Modules/Packages/EXTRA-COMMAND.cmake``:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
find_package(CURL QUIET COMPONENTS HTTP HTTPS)
|
||||
option(WITH_CURL "Enable libcurl support" ${CURL_FOUND})
|
||||
if(WITH_CURL)
|
||||
find_package(CURL REQUIRED COMPONENTS HTTP HTTPS)
|
||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_CURL)
|
||||
target_link_libraries(lammps PRIVATE CURL::libcurl)
|
||||
endif()
|
||||
|
||||
The first ``find_package()`` command uses a built-in CMake module to find
|
||||
an existing *libcurl* installation with development headers and support for
|
||||
using the HTTP and HTTPS protocols. The "QUIET" flag ensures that there is
|
||||
no screen output and no error if the search fails. The status of the search
|
||||
is recorded in the "${CURL_FOUND}" variable. That variable sets the default
|
||||
of the WITH_CURL option, which toggles whether support for *libcurl* is included
|
||||
or not.
|
||||
|
||||
The second ``find_package()`` uses the "REQUIRED" flag to produce an error
|
||||
if the WITH_CURL option was set to ``True``, but no suitable *libcurl*
|
||||
implementation with development support was found. This construct is used
|
||||
so that the CMake script code inside the ``if(WITH_CURL)`` and ``endif()``
|
||||
block can be expanded later to download and compile *libcurl* as part of the
|
||||
LAMMPS build process, if it is not found locally. The
|
||||
``target_compile_definitions()`` function added the define ``-DLAMMPS_CURL``
|
||||
to the compilation flags when compiling objects for the LAMMPS library.
|
||||
This allows to always compile the :doc:`geturl command <geturl>`, but use
|
||||
pre-processing to compile in the interface to *libcurl* only when it is
|
||||
present and usable and otherwise stop with an error message about the
|
||||
unavailability of *libcurl* to execute the functionality of the command.
|
||||
|
||||
Header file
|
||||
"""""""""""
|
||||
|
||||
The first segment of any LAMMPS source should be the copyright and
|
||||
license statement. Note the marker in the first line to indicate to
|
||||
editors like emacs that this file is a C++ source, even though the .h
|
||||
extension suggests a C source (this is a convention inherited from the
|
||||
very beginning of the C++ version of LAMMPS).
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
/* -*- c++ -*- ----------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
https://www.lammps.org/, Sandia National Laboratories
|
||||
LAMMPS development team: developers@lammps.org
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
Every command style must be registered in LAMMPS by including the following
|
||||
lines of code in the second part of the header after the copyright
|
||||
message and before the include guards for the class definition:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
#ifdef COMMAND_CLASS
|
||||
// clang-format off
|
||||
CommandStyle(geturl,GetURL);
|
||||
// clang-format on
|
||||
#else
|
||||
|
||||
This block between ``#ifdef COMMAND_CLASS`` and ``#else`` will be
|
||||
included by the ``Input`` class in ``input.cpp`` to build a map of
|
||||
"factory functions" that will create an instance of a Command class
|
||||
and call its ``command()`` method. The map connects the name of the
|
||||
command ``geturl`` with the name of the class ``GetURL``. During
|
||||
compilation, LAMMPS constructs a file ``style_command.h`` that contains
|
||||
``#include`` statements for all "installed" command styles. Before
|
||||
including ``style_command.h`` into ``input.cpp``, the ``COMMAND_CLASS``
|
||||
define is set and the ``CommandStyle(name,class)`` macro defined. The
|
||||
code of the macro adds the installed command styles to the "factory map"
|
||||
which enables the ``Input`` to execute the command.
|
||||
|
||||
The list of header files to include in ``style_command.h`` is automatically
|
||||
updated by the build system if there are new files, so the presence of the
|
||||
new header file in the ``src/EXTRA-COMMAND`` folder and the enabling of the
|
||||
EXTRA-COMMAND package will trigger LAMMPS to include the new command style
|
||||
when it is (re-)compiled. The "// clang-format" format comments are needed
|
||||
so that running :ref:`clang-format <clang-format>` on the file will not
|
||||
insert unwanted blanks which would break the ``CommandStyle`` macro.
|
||||
|
||||
The third part of the header file is the actual class definition of the
|
||||
``GetURL`` class. This has the custom constructor and the ``command()``
|
||||
method implemented by this command style. For the constructor there is
|
||||
nothing to do but to pass the ``lmp`` pointer to the base class. Since the
|
||||
``command()`` method is labeled "virtual" in the base class, it must be
|
||||
given the "override" property.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
#ifndef LMP_GETURL_H
|
||||
#define LMP_GETURL_H
|
||||
|
||||
#include "command.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class GetURL : public Command {
|
||||
public:
|
||||
GetURL(class LAMMPS *lmp) : Command(lmp) {};
|
||||
void command(int, char **) override;
|
||||
};
|
||||
} // namespace LAMMPS_NS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
The "override" property helps to detect unexpected mismatches because
|
||||
compilation will stop with an error in case the signature of a function
|
||||
is changed in the base class without also changing it in all derived
|
||||
classes.
|
||||
|
||||
Implementation file
|
||||
"""""""""""""""""""
|
||||
|
||||
We move on to the implementation of the ``GetURL`` class in the
|
||||
``geturl.cpp`` file. This file also starts with a LAMMPS copyright and
|
||||
license header. Below that notice is typically the space where comments may
|
||||
be added with additional information about this specific file, the
|
||||
author(s), affiliation(s), and email address(es). This way the contributing
|
||||
author(s) can be easily contacted, when there are questions about the
|
||||
implementation later. Since the file(s) may be around for a long time, it
|
||||
is beneficial to use some kind of "permanent" email address, if possible.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
https://www.lammps.org/, Sandia National Laboratories
|
||||
LAMMPS development team: developers@lammps.org
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
Contributing authors: Axel Kohlmeyer (Temple U),
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include "geturl.h"
|
||||
|
||||
#include "comm.h"
|
||||
#include "error.h"
|
||||
|
||||
#if defined(LAMMPS_CURL)
|
||||
#include <curl/curl.h>
|
||||
#endif
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
The second section of the implementation file has various include
|
||||
statements. The include file for the class header has to come first, then a
|
||||
couple of LAMMPS classes (sorted alphabetically) followed by the header for
|
||||
the *libcurl* interface. This is wrapped into an ``#ifdef`` block so that
|
||||
LAMMPS will compile this file without error when the *libcurl* header is not
|
||||
available and thus the define not set. The final statement of this segment
|
||||
imports the ``LAMMPS_NS::`` namespace globally for this file. This way, all
|
||||
LAMMPS specific functions and classes do not have to be prefixed with
|
||||
``LAMMPS_NS::``.
|
||||
|
||||
The command() function (required)
|
||||
"""""""""""""""""""""""""""""""""
|
||||
|
||||
Since the required custom constructor is trivial and implemented in the
|
||||
header, there is only one function that must be implemented for a command
|
||||
style and that is the ``command()`` function.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
void GetURL::command(int narg, char **arg)
|
||||
{
|
||||
#if !defined(LAMMPS_CURL)
|
||||
error->all(FLERR, "LAMMPS has not been compiled with libcurl support");
|
||||
#else
|
||||
if (narg < 1) utils::missing_cmd_args(FLERR, "geturl", error);
|
||||
int verify = 1;
|
||||
int overwrite = 1;
|
||||
int verbose = 0;
|
||||
|
||||
This first part also has the ``#ifdef`` block depending on the LAMMPS_CURL
|
||||
define. This way the command will simply print an error, if *libcurl* is
|
||||
not available but will not fail to compile. Furthermore, it sets the
|
||||
defaults for the following optional arguments.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
// process arguments
|
||||
|
||||
std::string url = arg[0];
|
||||
|
||||
// sanity check
|
||||
|
||||
if ((url.find(':') == std::string::npos) || (url.find('/') == std::string::npos))
|
||||
error->all(FLERR, "URL '{}' is not a supported URL", url);
|
||||
|
||||
std::string output = url.substr(url.find_last_of('/') + 1);
|
||||
if (output.empty()) error->all(FLERR, "URL '{}' must end in a file string", url);
|
||||
|
||||
This block stores the positional, i.e. non-optional argument of the URL to
|
||||
be downloaded and adds a couple of sanity checks on the string to make sure it is
|
||||
a valid URL. Also it derives the default name of the output file from the URL.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
int iarg = 1;
|
||||
while (iarg < narg) {
|
||||
if (strcmp(arg[iarg], "output") == 0) {
|
||||
if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "geturl output", error);
|
||||
output = arg[iarg + 1];
|
||||
++iarg;
|
||||
} else if (strcmp(arg[iarg], "overwrite") == 0) {
|
||||
if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "geturl overwrite", error);
|
||||
overwrite = utils::logical(FLERR, arg[iarg + 1], false, lmp);
|
||||
++iarg;
|
||||
} else if (strcmp(arg[iarg], "verify") == 0) {
|
||||
if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "geturl verify", error);
|
||||
verify = utils::logical(FLERR, arg[iarg + 1], false, lmp);
|
||||
++iarg;
|
||||
} else if (strcmp(arg[iarg], "verbose") == 0) {
|
||||
if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "geturl verbose", error);
|
||||
verbose = utils::logical(FLERR, arg[iarg + 1], false, lmp);
|
||||
++iarg;
|
||||
} else {
|
||||
error->all(FLERR, "Unknown geturl keyword: {}", arg[iarg]);
|
||||
}
|
||||
++iarg;
|
||||
}
|
||||
|
||||
This block parses the optional arguments following the URL and stops with an
|
||||
error if there are arguments missing or an unknown argument is encountered.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
// only download files from rank 0
|
||||
|
||||
if (comm->me != 0) return;
|
||||
|
||||
if (!overwrite && platform::file_is_readable(output)) return;
|
||||
|
||||
// open output file for writing
|
||||
|
||||
FILE *out = fopen(output.c_str(), "wb");
|
||||
if (!out)
|
||||
error->all(FLERR, "Cannot open output file {} for writing: {}", output, utils::getsyserror());
|
||||
|
||||
Here all MPI ranks other than 0 will return, so that the URL download will
|
||||
only happen from a single MPI rank. For that rank the output file is opened
|
||||
for writing using the C library function ``fopen()``.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
// initialize curl and perform download
|
||||
|
||||
CURL *curl;
|
||||
curl_global_init(CURL_GLOBAL_DEFAULT);
|
||||
curl = curl_easy_init();
|
||||
if (curl) {
|
||||
(void) curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
|
||||
(void) curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *) out);
|
||||
(void) curl_easy_setopt(curl, CURLOPT_FILETIME, 1L);
|
||||
(void) curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L);
|
||||
if (verbose && screen) {
|
||||
(void) curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
(void) curl_easy_setopt(curl, CURLOPT_STDERR, (void *) screen);
|
||||
}
|
||||
if (!verify) {
|
||||
(void) curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||
(void) curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
|
||||
}
|
||||
auto res = curl_easy_perform(curl);
|
||||
if (res != CURLE_OK) {
|
||||
long response = 0L;
|
||||
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response);
|
||||
error->one(FLERR, "Download of {} failed with: {} {}", output, curl_easy_strerror(res),
|
||||
response);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
|
||||
This block now implements the actual URL download with the selected options
|
||||
via the "easy" interface of *libcurl*. For the details of what these
|
||||
function calls do, please have a look at the `*libcurl documentation
|
||||
<https://curl.se/libcurl/c/allfuncs.html>`_.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
}
|
||||
curl_global_cleanup();
|
||||
fclose(out);
|
||||
#endif
|
||||
}
|
||||
|
||||
Finally, the previously opened file is closed and the command is complete.
|
||||
@ -96,8 +96,8 @@ Here the we specify which methods of the fix should be called during
|
||||
MPI_Allreduce(localAvgVel, globalAvgVel, 4, MPI_DOUBLE, MPI_SUM, world);
|
||||
scale3(1.0 / globalAvgVel[3], globalAvgVel);
|
||||
if ((comm->me == 0) && screen) {
|
||||
utils::print(screen, "{}, {}, {}\n",
|
||||
globalAvgVel[0], globalAvgVel[1], globalAvgVel[2]);
|
||||
fmt::print(screen,"{}, {}, {}\n",
|
||||
globalAvgVel[0], globalAvgVel[1], globalAvgVel[2]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -160,7 +160,7 @@ message and before the include guards for the class definition:
|
||||
|
||||
#endif
|
||||
|
||||
This block between ``#ifdef PAIR_CLASS`` and ``#else`` will be
|
||||
This block of between ``#ifdef PAIR_CLASS`` and ``#else`` will be
|
||||
included by the ``Force`` class in ``force.cpp`` to build a map of
|
||||
"factory functions" that will create an instance of these classes and
|
||||
return a pointer to it. The map connects the name of the pair style,
|
||||
@ -310,7 +310,7 @@ the constructor and the destructor.
|
||||
|
||||
Pair styles are different from most classes in LAMMPS that define a
|
||||
"style", as their constructor only uses the LAMMPS class instance
|
||||
pointer as an argument, but **not** the arguments of the
|
||||
pointer as an argument, but **not** the command line arguments of the
|
||||
:doc:`pair_style command <pair_style>`. Instead, those arguments are
|
||||
processed in the ``Pair::settings()`` function (or rather the version in
|
||||
the derived class). The constructor is the place where global defaults
|
||||
@ -891,7 +891,7 @@ originally created from mixing or not).
|
||||
These data file output functions are only useful for true pair-wise
|
||||
additive potentials, where the potential parameters can be entered
|
||||
through *multiple* :doc:`pair_coeff commands <pair_coeff>`. Pair styles
|
||||
that require a single "pair_coeff \* \*" command are not compatible
|
||||
that require a single "pair_coeff \* \*" command line are not compatible
|
||||
with reading their parameters from data files. For pair styles like
|
||||
*born/gauss* that do support writing to data files, the potential
|
||||
parameters will be read from the data file, if present, and
|
||||
@ -1122,7 +1122,7 @@ once. Thus, the ``coeff()`` function has to do three tasks, each of
|
||||
which is delegated to a function in the ``PairTersoff`` class:
|
||||
|
||||
#. map elements to atom types. Those follow the potential file name in the
|
||||
command arguments and are processed by the ``map_element2type()`` function.
|
||||
command line arguments and are processed by the ``map_element2type()`` function.
|
||||
#. read and parse the potential parameter file in the ``read_file()`` function.
|
||||
#. Build data structures where the original and derived parameters are
|
||||
indexed by all possible triples of atom types and thus can be looked
|
||||
@ -1356,8 +1356,8 @@ either 0 or 1.
|
||||
|
||||
The ``morseflag`` variable defaults to 0 and is set to 1 in the
|
||||
``PairAIREBOMorse::settings()`` function which is called by the
|
||||
:doc:`pair_style <pair_style>` command. This function delegates all
|
||||
command argument processing and setting of other parameters to the
|
||||
:doc:`pair_style <pair_style>` command. This function delegates
|
||||
all command line processing and setting of other parameters to the
|
||||
``PairAIREBO::settings()`` function of the base class.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
@ -1,149 +1,124 @@
|
||||
Common issues that are often regarded as bugs
|
||||
=============================================
|
||||
Common problems
|
||||
===============
|
||||
|
||||
The list below are some random notes on behavior of LAMMPS that is
|
||||
sometimes unexpected or even considered a bug. Most of the time, these
|
||||
are just issues of understanding how LAMMPS is implemented and
|
||||
parallelized. Please also have a look at the :doc:`Error details
|
||||
discussions page <Errors_details>` that contains recommendations for
|
||||
tracking down issues and explanations for error messages that may
|
||||
sometimes be confusing or need additional explanations.
|
||||
If two LAMMPS runs do not produce the exact same answer on different
|
||||
machines or different numbers of processors, this is typically not a
|
||||
bug. In theory you should get identical answers on any number of
|
||||
processors and on any machine. In practice, numerical round-off can
|
||||
cause slight differences and eventual divergence of molecular dynamics
|
||||
phase space trajectories within a few 100s or few 1000s of timesteps.
|
||||
However, the statistical properties of the two runs (e.g. average
|
||||
energy or temperature) should still be the same.
|
||||
|
||||
- A LAMMPS simulation typically has two stages, 1) issuing commands
|
||||
and 2) run or minimize. Most LAMMPS errors are detected in stage 1),
|
||||
others at the beginning of stage 2), and finally others like a bond
|
||||
stretching too far may or lost atoms or bonds may not occur until the
|
||||
middle of a run.
|
||||
If the :doc:`velocity <velocity>` command is used to set initial atom
|
||||
velocities, a particular atom can be assigned a different velocity
|
||||
when the problem is run on a different number of processors or on
|
||||
different machines. If this happens, the phase space trajectories of
|
||||
the two simulations will rapidly diverge. See the discussion of the
|
||||
*loop* option in the :doc:`velocity <velocity>` command for details and
|
||||
options that avoid this issue.
|
||||
|
||||
- If two LAMMPS runs do not produce the exact same answer on different
|
||||
machines or different numbers of processors, this is typically not a
|
||||
bug. In theory you should get identical answers on any number of
|
||||
processors and on any machine. In practice, numerical round-off can
|
||||
cause slight differences and eventual divergence of molecular dynamics
|
||||
phase space trajectories within a few 100s or few 1000s of timesteps.
|
||||
This can be triggered by different ordering of atoms due to different
|
||||
domain decompositions, but also through different CPU architectures,
|
||||
different operating systems, different compilers or compiler versions,
|
||||
different compiler optimization levels, different FFT libraries.
|
||||
However, the statistical properties of the two runs (e.g. average
|
||||
energy or temperature) should still be the same.
|
||||
Similarly, the :doc:`create_atoms <create_atoms>` command generates a
|
||||
lattice of atoms. For the same physical system, the ordering and
|
||||
numbering of atoms by atom ID may be different depending on the number
|
||||
of processors.
|
||||
|
||||
- If the :doc:`velocity <velocity>` command is used to set initial atom
|
||||
velocities, a particular atom can be assigned a different velocity
|
||||
when the problem is run on a different number of processors or on
|
||||
different machines. If this happens, the phase space trajectories of
|
||||
the two simulations will rapidly diverge. See the discussion of the
|
||||
*loop* option in the :doc:`velocity <velocity>` command for details
|
||||
and options that avoid this issue.
|
||||
Some commands use random number generators which may be setup to
|
||||
produce different random number streams on each processor and hence
|
||||
will produce different effects when run on different numbers of
|
||||
processors. A commonly-used example is the :doc:`fix langevin <fix_langevin>` command for thermostatting.
|
||||
|
||||
- Similarly, the :doc:`create_atoms <create_atoms>` command generates a
|
||||
lattice of atoms. For the same physical system, the ordering and
|
||||
numbering of atoms by atom ID may be different depending on the number
|
||||
of processors.
|
||||
A LAMMPS simulation typically has two stages, setup and run. Most
|
||||
LAMMPS errors are detected at setup time; others like a bond
|
||||
stretching too far may not occur until the middle of a run.
|
||||
|
||||
- Some commands use random number generators which may be setup to
|
||||
produce different random number streams on each processor and hence
|
||||
will produce different effects when run on different numbers of
|
||||
processors. A commonly-used example is the :doc:`fix langevin
|
||||
<fix_langevin>` command for thermostatting.
|
||||
LAMMPS tries to flag errors and print informative error messages so
|
||||
you can fix the problem. For most errors it will also print the last
|
||||
input script command that it was processing. Of course, LAMMPS cannot
|
||||
figure out your physics or numerical mistakes, like choosing too big a
|
||||
timestep, specifying erroneous force field coefficients, or putting 2
|
||||
atoms on top of each other! If you run into errors that LAMMPS
|
||||
does not catch that you think it should flag, please send an email to
|
||||
the `developers <https://www.lammps.org/authors.html>`_ or create an new
|
||||
topic on the dedicated `MatSci forum section <https://matsci.org/lammps/>`_.
|
||||
|
||||
- LAMMPS tries to flag errors and print informative error messages so
|
||||
you can fix the problem. For most errors it will also print the last
|
||||
input script command that it was processing or even point to the
|
||||
keyword that is causing troubles. Of course, LAMMPS cannot figure out
|
||||
your physics or numerical mistakes, like choosing too big a timestep,
|
||||
specifying erroneous force field coefficients, or putting 2 atoms on
|
||||
top of each other! Also, LAMMPS does not know what you *intend* to
|
||||
do, but very strictly applies the syntax as described in the
|
||||
documentation. If you run into errors that LAMMPS does not catch that
|
||||
you think it should flag, please send an email to the `developers
|
||||
<https://www.lammps.org/authors.html>`_ or create an new topic on the
|
||||
dedicated `MatSci forum section <https://matsci.org/lammps/>`_.
|
||||
If you get an error message about an invalid command in your input
|
||||
script, you can determine what command is causing the problem by
|
||||
looking in the log.lammps file or using the :doc:`echo command <echo>`
|
||||
to see it on the screen. If you get an error like "Invalid ...
|
||||
style", with ... being fix, compute, pair, etc, it means that you
|
||||
mistyped the style name or that the command is part of an optional
|
||||
package which was not compiled into your executable. The list of
|
||||
available styles in your executable can be listed by using
|
||||
:doc:`the -h command-line switch <Run_options>`. The installation and
|
||||
compilation of optional packages is explained on the
|
||||
:doc:`Build packages <Build_package>` doc page.
|
||||
|
||||
- If you get an error message about an invalid command in your input
|
||||
script, you can determine what command is causing the problem by
|
||||
looking in the log.lammps file or using the :doc:`echo command <echo>`
|
||||
to see it on the screen. If you get an error like "Invalid ...
|
||||
style", with ... being fix, compute, pair, etc, it means that you
|
||||
mistyped the style name or that the command is part of an optional
|
||||
package which was not compiled into your executable. The list of
|
||||
available styles in your executable can be listed by using
|
||||
:doc:`the -h command-line switch <Run_options>`. The installation and
|
||||
compilation of optional packages is explained on the :doc:`Build
|
||||
packages <Build_package>` doc page.
|
||||
For a given command, LAMMPS expects certain arguments in a specified
|
||||
order. If you mess this up, LAMMPS will often flag the error, but it
|
||||
may also simply read a bogus argument and assign a value that is
|
||||
valid, but not what you wanted. E.g. trying to read the string "abc"
|
||||
as an integer value of 0. Careful reading of the associated doc page
|
||||
for the command should allow you to fix these problems. In most cases,
|
||||
where LAMMPS expects to read a number, either integer or floating point,
|
||||
it performs a stringent test on whether the provided input actually
|
||||
is an integer or floating-point number, respectively, and reject the
|
||||
input with an error message (for instance, when an integer is required,
|
||||
but a floating-point number 1.0 is provided):
|
||||
|
||||
- For a given command, LAMMPS expects certain arguments in a specified
|
||||
order. If you mess this up, LAMMPS will often flag the error, but it
|
||||
may also simply read a bogus argument and assign a value that is
|
||||
valid, but not what you wanted. E.g. trying to read the string "abc"
|
||||
as an integer value of 0. Careful reading of the associated doc page
|
||||
for the command should allow you to fix these problems. In most cases,
|
||||
where LAMMPS expects to read a number, either integer or floating
|
||||
point, it performs a stringent test on whether the provided input
|
||||
actually is an integer or floating-point number, respectively, and
|
||||
reject the input with an error message (for instance, when an integer
|
||||
is required, but a floating-point number 1.0 is provided):
|
||||
.. parsed-literal::
|
||||
|
||||
.. parsed-literal::
|
||||
ERROR: Expected integer parameter instead of '1.0' in input script or data file
|
||||
|
||||
ERROR: Expected integer parameter instead of '1.0' in input script or data file
|
||||
Some commands allow for using variable references in place of numeric
|
||||
constants so that the value can be evaluated and may change over the
|
||||
course of a run. This is typically done with the syntax *v_name* for a
|
||||
parameter, where name is the name of the variable. On the other hand,
|
||||
immediate variable expansion with the syntax ${name} is performed while
|
||||
reading the input and before parsing commands,
|
||||
|
||||
- Some commands allow for using variable references in place of numeric
|
||||
constants so that the value can be evaluated and may change over the
|
||||
course of a run. This is typically done with the syntax *v_name* for
|
||||
a parameter, where name is the name of the variable. On the other
|
||||
hand, immediate variable expansion with the syntax ${name} is
|
||||
performed while reading the input and before parsing commands,
|
||||
.. note::
|
||||
|
||||
.. note::
|
||||
Using a variable reference (i.e. *v_name*) is only allowed if
|
||||
the documentation of the corresponding command explicitly says it is.
|
||||
Otherwise, you will receive an error message of this kind:
|
||||
|
||||
Using a variable reference (i.e. *v_name*) is only allowed if
|
||||
the documentation of the corresponding command explicitly says it is.
|
||||
Otherwise, you will receive an error message of this kind:
|
||||
.. parsed-literal::
|
||||
|
||||
.. parsed-literal::
|
||||
ERROR: Expected floating point parameter instead of 'v_name' in input script or data file
|
||||
|
||||
ERROR: Expected floating point parameter instead of 'v_name' in input script or data file
|
||||
Generally, LAMMPS will print a message to the screen and logfile and
|
||||
exit gracefully when it encounters a fatal error. Sometimes it will
|
||||
print a WARNING to the screen and logfile and continue on; you can
|
||||
decide if the WARNING is important or not. A WARNING message that is
|
||||
generated in the middle of a run is only printed to the screen, not to
|
||||
the logfile, to avoid cluttering up thermodynamic output. If LAMMPS
|
||||
crashes or hangs without spitting out an error message first then it
|
||||
could be a bug (see :doc:`this section <Errors_bugs>`) or one of the following
|
||||
cases:
|
||||
|
||||
- Generally, LAMMPS will print a message to the screen and logfile and
|
||||
exit gracefully when it encounters a fatal error. When running in
|
||||
parallel this message may be stuck in an I/O buffer and LAMMPS will be
|
||||
terminated before that buffer is printed. In that case you can try
|
||||
adding the ``-nonblock`` or ``-nb`` command-line flag to turn off that
|
||||
buffering. Please note that this should not be used for production
|
||||
runs, since turning off buffering usually has a significant negative
|
||||
impact on performance (even worse than :doc:`thermo_modify flush yes
|
||||
<thermo_modify>`). Sometimes LAMMPS will print a WARNING to the
|
||||
screen and logfile and continue on; you can decide if the WARNING is
|
||||
important or not, but as a general rule do not ignore warnings that
|
||||
you not understand. A WARNING message that is generated in the middle
|
||||
of a run is only printed to the screen, not to the logfile, to avoid
|
||||
cluttering up thermodynamic output. If LAMMPS crashes or hangs
|
||||
without generating an error message first then it could be a bug
|
||||
(see :doc:`this section <Errors_bugs>`).
|
||||
LAMMPS runs in the available memory a processor allows to be
|
||||
allocated. Most reasonable MD runs are compute limited, not memory
|
||||
limited, so this should not be a bottleneck on most platforms. Almost
|
||||
all large memory allocations in the code are done via C-style malloc's
|
||||
which will generate an error message if you run out of memory.
|
||||
Smaller chunks of memory are allocated via C++ "new" statements. If
|
||||
you are unlucky you could run out of memory just when one of these
|
||||
small requests is made, in which case the code will crash or hang (in
|
||||
parallel), since LAMMPS does not trap on those errors.
|
||||
|
||||
- LAMMPS runs in the available memory a processor allows to be
|
||||
allocated. Most reasonable MD runs are compute limited, not memory
|
||||
limited, so this should not be a bottleneck on most platforms. Almost
|
||||
all large memory allocations in the code are done via C-style malloc's
|
||||
which will generate an error message if you run out of memory.
|
||||
Smaller chunks of memory are allocated via C++ "new" statements. If
|
||||
you are unlucky you could run out of memory just when one of these
|
||||
small requests is made, in which case the code will crash or hang (in
|
||||
parallel).
|
||||
Illegal arithmetic can cause LAMMPS to run slow or crash. This is
|
||||
typically due to invalid physics and numerics that your simulation is
|
||||
computing. If you see wild thermodynamic values or NaN values in your
|
||||
LAMMPS output, something is wrong with your simulation. If you
|
||||
suspect this is happening, it is a good idea to print out
|
||||
thermodynamic info frequently (e.g. every timestep) via the
|
||||
:doc:`thermo <thermo>` so you can monitor what is happening.
|
||||
Visualizing the atom movement is also a good idea to ensure your model
|
||||
is behaving as you expect.
|
||||
|
||||
- Illegal arithmetic can cause LAMMPS to run slow or crash. This is
|
||||
typically due to invalid physics and numerics that your simulation is
|
||||
computing. If you see wild thermodynamic values or NaN values in your
|
||||
LAMMPS output, something is wrong with your simulation. If you
|
||||
suspect this is happening, it is a good idea to print out
|
||||
thermodynamic info frequently (e.g. every timestep) via the
|
||||
:doc:`thermo <thermo>` so you can monitor what is happening.
|
||||
Visualizing the atom movement is also a good idea to ensure your model
|
||||
is behaving as you expect.
|
||||
|
||||
- When running in parallel with MPI, one way LAMMPS can hang is because
|
||||
LAMMPS has come across an error condition, but only on one or a few
|
||||
MPI processes and not all of them. LAMMPS has two different "stop
|
||||
with an error message" functions and the correct one has to be called
|
||||
or else it will hang.
|
||||
In parallel, one way LAMMPS can hang is due to how different MPI
|
||||
implementations handle buffering of messages. If the code hangs
|
||||
without an error message, it may be that you need to specify an MPI
|
||||
setting or two (usually via an environment variable) to enable
|
||||
buffering or boost the sizes of messages that can be buffered.
|
||||
|
||||
@ -83,7 +83,7 @@ Run LAMMPS from within the debugger
|
||||
Running LAMMPS under the control of the debugger as shown below only
|
||||
works for a single MPI rank (for debugging a program running in parallel
|
||||
you usually need a parallel debugger program). A simple way to launch
|
||||
GDB is to prefix the LAMMPS command-line with ``gdb --args`` and then
|
||||
GDB is to prefix the LAMMPS command line with ``gdb --args`` and then
|
||||
type the command "run" at the GDB prompt. This will launch the
|
||||
debugger, load the LAMMPS executable and its debug info, and then run
|
||||
it. When it reaches the code causing the segmentation fault, it will
|
||||
@ -180,7 +180,7 @@ inspect the behavior of a compiled program by essentially emulating a
|
||||
CPU and instrumenting the program while running. This slows down
|
||||
execution quite significantly, but can also report issues that are not
|
||||
resulting in a crash. The default valgrind tool is a memory checker and
|
||||
you can use it by prefixing the normal command-line with ``valgrind``.
|
||||
you can use it by prefixing the normal command line with ``valgrind``.
|
||||
Unlike GDB, this will also work for parallel execution, but it is
|
||||
recommended to redirect the valgrind output to a file (e.g. with
|
||||
``--log-file=crash-%p.txt``, the %p will be substituted with the
|
||||
@ -235,53 +235,3 @@ from GDB. In addition you get a more specific hint about what cause the
|
||||
segmentation fault, i.e. that it is a NULL pointer dereference. To find
|
||||
out which pointer exactly was NULL, you need to use the debugger, though.
|
||||
|
||||
Debugging when LAMMPS appears to be stuck
|
||||
=========================================
|
||||
|
||||
Sometimes the LAMMPS calculation appears to be stuck, that is the LAMMPS
|
||||
process or processes are active, but there is no visible progress. This
|
||||
can have multiple reasons:
|
||||
|
||||
- The selected styles are slow and require a lot of CPU time and the
|
||||
system is large. When extrapolating the expected speed from smaller
|
||||
systems, one has to factor in that not all models scale linearly with
|
||||
system size, e.g. :doc:`kspace styles like ewald or pppm
|
||||
<kspace_style>`. There is very little that can be done in this case.
|
||||
- The output interval is not set or set to a large value with the
|
||||
:doc:`thermo <thermo>` command. I the first case, there will be output
|
||||
only at the first and last step.
|
||||
- The output is block-buffered and instead of line-buffered. The output
|
||||
will only be written to the screen after 4096 or 8192 characters of
|
||||
output have accumulated. This most often happens for files but also
|
||||
with MPI parallel executables for output to the screen, since the
|
||||
output to the screen is handled by the MPI library so that output from
|
||||
all processes can be shown. This can be suppressed by using the
|
||||
``-nonblock`` or ``-nb`` command-line flag, which turns off buffering
|
||||
for screen and logfile output.
|
||||
- An MPI parallel calculation has a bug where a collective MPI function
|
||||
is called (e.g. ``MPI_Barrier()``, ``MPI_Bcast()``,
|
||||
``MPI_Allreduce()`` and so on) before pending point-to-point
|
||||
communications are completed or when the collective function is only
|
||||
called from a subset of the MPI processes. This also applies to some
|
||||
internal LAMMPS functions like ``Error::all()`` which uses
|
||||
``MPI_Barrier()`` and thus ``Error::one()`` must be called, if the
|
||||
error condition does not happen on all MPI processes simultaneously.
|
||||
- Some function in LAMMPS has a bug where a ``for`` or ``while`` loop
|
||||
does not trigger the exit condition and thus will loop forever. This
|
||||
can happen when the wrong variable is incremented or when one value in
|
||||
a comparison becomes ``NaN`` due to an overflow.
|
||||
|
||||
In the latter two cases, further information and stack traces (see above)
|
||||
can be obtain by attaching a debugger to a running process. For that the
|
||||
process ID (PID) is needed; this can be found on Linux machines with the
|
||||
``top``, ``htop``, ``ps``, or ``pstree`` commands.
|
||||
|
||||
Then running the (GNU) debugger ``gdb`` with the ``-p`` flag followed by
|
||||
the process id will attach the process to the debugger and stop
|
||||
execution of that specific process. From there on it is possible to
|
||||
issue all debugger commands in the same way as when LAMMPS was started
|
||||
from the debugger (see above). Most importantly it is possible to
|
||||
obtain a stack trace with the ``where`` command and thus determine where
|
||||
in the execution of a timestep this process is. Also internal data can
|
||||
be printed and execution single stepped or continued. When the debugger
|
||||
is exited, the calculation will resume normally.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user