Compare commits
1546 Commits
patch_24Ma
...
stable_23J
| Author | SHA1 | Date | |
|---|---|---|---|
| 59e8b9370f | |||
| 39fa2021e2 | |||
| 83f492a195 | |||
| 933457acbe | |||
| 06f4099566 | |||
| 5624a78b17 | |||
| 47e875142f | |||
| 62c844d5ac | |||
| 263b6d4d6f | |||
| 4acca38a65 | |||
| 4cf642b526 | |||
| 52fc8f05ee | |||
| 047df9aa9e | |||
| fb3bd20dff | |||
| c7d62c4709 | |||
| b18008c58d | |||
| 9469321e3d | |||
| a4a9efeefc | |||
| 70744f10e0 | |||
| 9bea55bd77 | |||
| 73525b3bbc | |||
| 9cf67699cc | |||
| 666fe4cfbe | |||
| ed7bd50500 | |||
| d241e26d03 | |||
| 73e7163ed6 | |||
| 5a5a86684a | |||
| ae3f57e89a | |||
| fff7b2a859 | |||
| 83ba1c9d20 | |||
| ce10614cab | |||
| facbeac052 | |||
| 188ee5af15 | |||
| f176b8b14c | |||
| 2396b2feea | |||
| 4399c1b6c1 | |||
| fd046c8fd8 | |||
| 09b7694601 | |||
| df20503434 | |||
| f4aa24a36a | |||
| 007c04bc97 | |||
| 418d1e16e1 | |||
| 6471d781d0 | |||
| 97ddc5917c | |||
| a95ff20647 | |||
| 9e0a9e2601 | |||
| 8b34d65970 | |||
| 0a1c2bcccc | |||
| c9442c591c | |||
| b7d316031d | |||
| 361e9f3ea5 | |||
| 28120793b8 | |||
| f32ce8377e | |||
| 9021b8bc6a | |||
| 838fe3020d | |||
| b4d4dcbcbc | |||
| 52a892ec46 | |||
| 0ee3d9da5d | |||
| 50afb292b0 | |||
| 275ef9da17 | |||
| b6a87390a3 | |||
| 72178631c5 | |||
| f8859c5fca | |||
| 979119a29b | |||
| bc66572275 | |||
| 609231675f | |||
| d9675b5da4 | |||
| 7d32b4f42a | |||
| 697e5b15ec | |||
| ade0718c11 | |||
| 31033ff6e0 | |||
| 9a598ba5a8 | |||
| ff20448b1d | |||
| af5229ba58 | |||
| b180200c48 | |||
| 27441cf2ea | |||
| db61bf609b | |||
| 015fa4cb0a | |||
| 62f6f91146 | |||
| e163b0b1d7 | |||
| 169a886898 | |||
| cbd276c49d | |||
| 183c6c06ff | |||
| 93a46da58e | |||
| 6b6a47bd3c | |||
| 4a0a98a0fd | |||
| 369ea4fd26 | |||
| d63c002bf5 | |||
| e931d3153b | |||
| 2913c063d4 | |||
| 5606b57646 | |||
| 0fafe34008 | |||
| a9a1640d67 | |||
| 812363fb99 | |||
| b40e0be1c9 | |||
| 1be973da07 | |||
| aca2c52795 | |||
| 536b2ab7e5 | |||
| ccef293161 | |||
| 4b0de87813 | |||
| fa22aef31b | |||
| cb7544a615 | |||
| a9be4906b7 | |||
| 6f36d21a04 | |||
| c55a15c4dc | |||
| 8f01dad1a9 | |||
| db6e1aa20d | |||
| 3cee69a077 | |||
| 69ffe71595 | |||
| 16fa033111 | |||
| 8e494aa771 | |||
| d203cce8b5 | |||
| f8de1b1a75 | |||
| de89a25a25 | |||
| f982e95267 | |||
| 293d0cdb58 | |||
| 011f2651ee | |||
| a8d3c43a77 | |||
| c19641f8b3 | |||
| 6596b343ff | |||
| b6dbb0330c | |||
| 0dd138666a | |||
| 33b9fec150 | |||
| 32b020a165 | |||
| c1db230331 | |||
| 254c052ecc | |||
| 8e889dfa7c | |||
| 5b6a52a646 | |||
| 55f56deb63 | |||
| bfe127a720 | |||
| d95c8911a3 | |||
| 0380f9d854 | |||
| 71b1d60363 | |||
| 8b1f92fabd | |||
| 419af0cf28 | |||
| 9030c59932 | |||
| ee88078150 | |||
| 04451f6072 | |||
| 2364f7f08b | |||
| 7f82a58f51 | |||
| 1caf074ba1 | |||
| 34677f78c2 | |||
| e095609ac6 | |||
| 1122408957 | |||
| 5f9b78ca01 | |||
| fe138fc75c | |||
| 31c324ff61 | |||
| 30564ed8b7 | |||
| f05bfe45a8 | |||
| 88c8b6ec6f | |||
| f01e28f574 | |||
| 96627d27b1 | |||
| b3fc574a6a | |||
| 8a3f7560c9 | |||
| 8406e92a9a | |||
| 3b376b4448 | |||
| ca3b7be623 | |||
| c825c52d2f | |||
| 0ea0e4ce59 | |||
| d53d4b4d99 | |||
| b37cd14dd1 | |||
| a921a6bdc1 | |||
| 51a0345941 | |||
| 8d70960e2d | |||
| 5661703b30 | |||
| bc30304f72 | |||
| c76da483fb | |||
| 036a1e47d2 | |||
| 5430c3b592 | |||
| 9b7cb8200c | |||
| 550eedbb1f | |||
| 3a058f278d | |||
| 0f7f0b5f86 | |||
| 3de7534b84 | |||
| 7065462faf | |||
| 2e9d8e1ccb | |||
| 19b84f7cbd | |||
| 9b7c445a15 | |||
| 91e56444ce | |||
| 9b3c8c36bd | |||
| 3403520967 | |||
| d8f969f1df | |||
| 3487deccb6 | |||
| 0926fc627d | |||
| 7999778d94 | |||
| b4ef4c1ff2 | |||
| 72b08e4b87 | |||
| faa64a84e8 | |||
| 32b67fff2b | |||
| f3dbf4122d | |||
| e25ac786da | |||
| f30fba0061 | |||
| 03f319604f | |||
| 0782dab1ec | |||
| c43cce54ab | |||
| 281a368702 | |||
| f28d69b429 | |||
| e674e0c927 | |||
| eebabf99b8 | |||
| 23a19f4431 | |||
| d618b0ffc0 | |||
| ffc71b8733 | |||
| 564df78698 | |||
| 8db0b5ca39 | |||
| 79e26fe829 | |||
| 523d4b0242 | |||
| fe39a3e581 | |||
| 081cc1f992 | |||
| 53c80c2c00 | |||
| 554b64a147 | |||
| dc08dba592 | |||
| 0eaa2775cd | |||
| 852673ce41 | |||
| 8c711e405a | |||
| 25b9f95061 | |||
| ee66a6f8c1 | |||
| b694a5f582 | |||
| 7ab3fce93f | |||
| 1f9509cb6f | |||
| cad1d8ece4 | |||
| b709d75f80 | |||
| 5839909061 | |||
| 30f374de58 | |||
| 0f9fec05fb | |||
| 972a86f0ec | |||
| 7338ebfc94 | |||
| 7132152693 | |||
| c9925f64f7 | |||
| 6da523c8b8 | |||
| 0522284589 | |||
| e10a66dabc | |||
| 51dd631a76 | |||
| d37249787e | |||
| f44841de69 | |||
| 54c5337d2d | |||
| efb0e63bf6 | |||
| 13d78c3afa | |||
| f2910b1d9c | |||
| 78b22a64aa | |||
| 8bb1880c9d | |||
| e7b36c7b90 | |||
| d7804e3770 | |||
| 8d0f9695d2 | |||
| 52b2e4f364 | |||
| 41140149ea | |||
| 85e556ac8f | |||
| cd5437a7e2 | |||
| 00cc82ac94 | |||
| 20f87e3f1d | |||
| 97e34f0667 | |||
| 3e5da9b09a | |||
| a62fcca7a4 | |||
| 778d59fa6b | |||
| 3833a85d7a | |||
| 6d961ab29f | |||
| 001824e0f6 | |||
| 953d32f9b3 | |||
| edba922665 | |||
| 53806d4601 | |||
| 67597722d5 | |||
| 337794a9e9 | |||
| 5f5fb895ff | |||
| 0302d03bc6 | |||
| 0a4fef369f | |||
| 7d5fc356fe | |||
| 8103e5a18f | |||
| ae18e1e01c | |||
| ad35bbcb65 | |||
| 1099199e93 | |||
| c5999df303 | |||
| 9b8c19c1a5 | |||
| 2fb3608462 | |||
| 37f056c455 | |||
| 49331be33e | |||
| 3f6add4c40 | |||
| c0b109f715 | |||
| b0c673d856 | |||
| b0f4ef8a39 | |||
| 7d49ad5924 | |||
| e5b56b67fe | |||
| 8ffb7e5f89 | |||
| cb9ab48ce7 | |||
| 6815b27cd5 | |||
| ad20e54638 | |||
| ec46510d2e | |||
| 033af0c507 | |||
| 78129f9078 | |||
| ac615059a7 | |||
| ffc5b12c5f | |||
| 3828c857f7 | |||
| 063fc47f64 | |||
| f831a776be | |||
| b46773e398 | |||
| fe1feb58d8 | |||
| deac9f05b1 | |||
| 18f9e5836b | |||
| 21b3020a97 | |||
| dd3aab0c66 | |||
| 58152cdc68 | |||
| 04bb611bf2 | |||
| 2fc0a44ab2 | |||
| ba4cbf7055 | |||
| f75115d801 | |||
| 0a5d921f3f | |||
| cdc0b48a0b | |||
| 9840aad703 | |||
| 1403a0dd94 | |||
| 9842879db1 | |||
| 03c0b4ae27 | |||
| 728e4a5910 | |||
| cfe5025495 | |||
| 927287e3e5 | |||
| 35a48f273b | |||
| 2028c68bec | |||
| 6abb316dba | |||
| 7a64d1358e | |||
| 26dcb649bb | |||
| 423c511d7a | |||
| b44d769024 | |||
| ea48dd3019 | |||
| 0f5ae6d48c | |||
| c53e53d701 | |||
| 33f4bb525b | |||
| ef48fd2d9c | |||
| ed702aab05 | |||
| 82185046ae | |||
| ac48852b2d | |||
| 495418158a | |||
| 5d7b1f3ebb | |||
| 80727e47f4 | |||
| 9be6e2a064 | |||
| 7f1e76b7a5 | |||
| 174219383a | |||
| 1acfb78b3a | |||
| 483396c757 | |||
| 68a9db0950 | |||
| 5fca9f4d1f | |||
| b6e0d76123 | |||
| 7769a8e0de | |||
| 55fdb7f12a | |||
| 42694ba640 | |||
| d7680dd785 | |||
| 96b5a706da | |||
| 67d367e714 | |||
| 7e77b61042 | |||
| 5c68fe6e81 | |||
| 8f773be2d6 | |||
| dcbc5256fa | |||
| b338781f88 | |||
| b0d2cc3052 | |||
| 3af9546b94 | |||
| a232bd3302 | |||
| 3beb071d38 | |||
| 0dc486c90b | |||
| fa9ad10bc1 | |||
| 25c74652e3 | |||
| 587438eb30 | |||
| 7c4d77f776 | |||
| f9b5679c00 | |||
| f68247ad6a | |||
| 1ebb1cee40 | |||
| ceb9466172 | |||
| 2da61d69a1 | |||
| 31f7798720 | |||
| aad4d093b8 | |||
| ad97d18ac7 | |||
| 4913c72795 | |||
| 2a054c17be | |||
| 260a5f4d52 | |||
| 90add188cb | |||
| 9d252fe0d2 | |||
| a74f64a737 | |||
| fc468accf5 | |||
| 954700dea5 | |||
| 2742517a4f | |||
| 7a02043f18 | |||
| 04586e634e | |||
| 6c375ffade | |||
| 3a1423dc48 | |||
| 5a4688ed44 | |||
| fdc8bcfbfc | |||
| e214013a91 | |||
| 8e415f0c00 | |||
| c028dcbdf7 | |||
| e36620059d | |||
| 866391e830 | |||
| 9f021ba490 | |||
| c0bd4185f8 | |||
| 30ae7fe66b | |||
| bf9b79b734 | |||
| 4bf90988e2 | |||
| b45117655e | |||
| 217b070204 | |||
| 7d31544cc2 | |||
| 8a055fdcfa | |||
| b9b0d7207c | |||
| edea4fa9a2 | |||
| 8e9071b01f | |||
| ee6e18f08e | |||
| b85b3e1f4c | |||
| 95a979c657 | |||
| e8d9bf0507 | |||
| 3a19b1eb4b | |||
| f6fab8365a | |||
| 64d67f7604 | |||
| c1e301ac1a | |||
| a833baac80 | |||
| 187ccdd222 | |||
| 5756dedfed | |||
| ebce66389e | |||
| 8dfa4a8682 | |||
| 25f24fbab1 | |||
| 9da3dd796a | |||
| 5abb6c76af | |||
| ef6c48dad7 | |||
| b675372d99 | |||
| 234b9f180a | |||
| 3b4e698421 | |||
| 77835a4258 | |||
| 7c0c7ce93c | |||
| b8599ccb42 | |||
| de5c2629ac | |||
| 3f332ab0c1 | |||
| cc86e9e8a8 | |||
| fa79a66734 | |||
| 562cd12d82 | |||
| 90730f0d3c | |||
| 4c36c79652 | |||
| 81c327edd8 | |||
| d0edd7129c | |||
| 3615639bdd | |||
| e2dd08a93e | |||
| 5f811f852f | |||
| 886ad8359e | |||
| 0b3efa4dd6 | |||
| e91d1dba98 | |||
| cfb3d6bdf8 | |||
| 3ecb6bb54a | |||
| 49a75d576e | |||
| ab2b7a2c01 | |||
| f09e4c7583 | |||
| 587999fabb | |||
| f0f6660050 | |||
| d9b560e70b | |||
| 2a7407aa38 | |||
| 48f477e4b4 | |||
| e890e5718e | |||
| b8dfb23ede | |||
| 18c9960db0 | |||
| f9fbc7f94b | |||
| 27524742e5 | |||
| 770454cb8b | |||
| 0e114b1041 | |||
| 1cfba3d8bb | |||
| 1ae62793eb | |||
| dba9fdb1ef | |||
| 2085c10002 | |||
| f6680861a0 | |||
| 7c2a548015 | |||
| 3ee209d031 | |||
| c6c0b269ec | |||
| 1aaa9ca4ae | |||
| b66702c285 | |||
| 43b57b8aa5 | |||
| ef80bb194a | |||
| 3662d998ee | |||
| bead819070 | |||
| b461a49eee | |||
| 9f7833668a | |||
| 0069c4b562 | |||
| 46df8abe75 | |||
| 3c3c1377c8 | |||
| d905d3fbf5 | |||
| 1959cd7037 | |||
| 7d3d986d18 | |||
| cd8bef3b0b | |||
| 9a973e67fa | |||
| b407b2f239 | |||
| 93692ce308 | |||
| 007588f9cb | |||
| e3e849b266 | |||
| 18df50356e | |||
| c3ce77bc8c | |||
| 2c5ce83d59 | |||
| 7eb926c853 | |||
| 08b1034d54 | |||
| a16974ca48 | |||
| 21c2f8a74b | |||
| 814daf7f4f | |||
| bfb126ec7c | |||
| 07e93a643a | |||
| 13fc4f3588 | |||
| 36d091baeb | |||
| 4801fa00f8 | |||
| 75df9d4f2c | |||
| a9431208a2 | |||
| 7b0c7c04ed | |||
| 2138aea01f | |||
| 7e75b7bff5 | |||
| 5990241fbe | |||
| d8d6884def | |||
| eb4c1cd14f | |||
| 361e303177 | |||
| 898eda794c | |||
| 5ac8e5639a | |||
| cb2126f313 | |||
| 0c73c9307f | |||
| c0a8458d89 | |||
| b5830aae83 | |||
| 06ad119844 | |||
| fa6c81849b | |||
| d323b7817d | |||
| eb3ee96b9c | |||
| bfd6efcedb | |||
| c16f40eb7c | |||
| acbeae075a | |||
| 4f45ae2ef6 | |||
| 5559491d7b | |||
| ba0efbef31 | |||
| 7646592f05 | |||
| 02908f0468 | |||
| 6475d4b956 | |||
| f0e7101bd2 | |||
| d54f97736e | |||
| 1466620750 | |||
| baa48946e5 | |||
| e7b9d03573 | |||
| d8b37601a8 | |||
| d94bcd043b | |||
| 15a727a7ff | |||
| e94275391c | |||
| 935c9a02d7 | |||
| 55e0af930b | |||
| a5171beacd | |||
| 72209b0617 | |||
| 899764c00c | |||
| cebbd471cf | |||
| 8ffe2a206c | |||
| f9efa426a7 | |||
| ae979aca4e | |||
| 38d7fcee92 | |||
| e7d072c593 | |||
| d487ab10e2 | |||
| 853e3ae99b | |||
| dbb3e75f24 | |||
| fe4782696e | |||
| 326b833d7f | |||
| bf98df3264 | |||
| df40732343 | |||
| d32885fbe3 | |||
| 659fd82a9e | |||
| db2d5b863d | |||
| ee8a8b6cd0 | |||
| b1ba616470 | |||
| 44f3ad5620 | |||
| c0e5a03989 | |||
| f62363516c | |||
| 8e6b0425f7 | |||
| a79814793e | |||
| 1f30d3f140 | |||
| 1b552de1cd | |||
| 42a4fba390 | |||
| 173e80a970 | |||
| 55fef9a482 | |||
| 9a9bb749fa | |||
| 223aebe3fb | |||
| 168d3bdd3c | |||
| 9661711a1e | |||
| d4ea5ca49e | |||
| 2f0baa86d6 | |||
| b8a4ddc42a | |||
| 90797d53d9 | |||
| 940e88d2ca | |||
| 9c16819305 | |||
| 3782eea7c4 | |||
| 056fd8be8f | |||
| 59560c47a7 | |||
| 979f84f96f | |||
| 66abc00e3c | |||
| c41ad91a9d | |||
| 545cec1785 | |||
| 658a89e401 | |||
| 35dd5bc978 | |||
| 90e2d9e966 | |||
| 042564decd | |||
| 3eea2463a1 | |||
| d207d53fd1 | |||
| d7bad09d35 | |||
| 58093fec99 | |||
| 4077c5c8ba | |||
| 0577bb6269 | |||
| aff72c56a5 | |||
| c3a454370e | |||
| 301bd95900 | |||
| 04537c9f22 | |||
| 5ad821ca5e | |||
| 78d976bd36 | |||
| 371141f915 | |||
| 3ea249a576 | |||
| 4cc3bdd35f | |||
| 227c4853f1 | |||
| 442116b305 | |||
| ef3b90e838 | |||
| c9d350edc2 | |||
| bdbab77286 | |||
| 1220bea011 | |||
| 5760c59d83 | |||
| b6ee64dc12 | |||
| eb44cbf848 | |||
| 23e17363f9 | |||
| 6344c667a0 | |||
| 24ef021fe0 | |||
| 1660bae22a | |||
| 9ec35f0235 | |||
| e0bb27dbb2 | |||
| e9b1ca16a3 | |||
| 60b9fd2db8 | |||
| bcfb6734f3 | |||
| 6722d3fb00 | |||
| 559dc68197 | |||
| 102b61ae1b | |||
| 5d08b62622 | |||
| 4737b9efb7 | |||
| d21d9d95fa | |||
| 00bb566893 | |||
| 56e36a5df5 | |||
| 21d3de65e6 | |||
| 767f512dcf | |||
| 907bc7eaa5 | |||
| 051c243cfc | |||
| 905034893c | |||
| 6432660bc9 | |||
| 6e78269612 | |||
| 81a8b0cf85 | |||
| 613ef04357 | |||
| 5986e11d43 | |||
| 97012f2aaa | |||
| 62a819d7b6 | |||
| 3bb9c64f9e | |||
| 78f2907cbb | |||
| f3fcd16628 | |||
| 580e01535a | |||
| 8e423f07c5 | |||
| 2549b86d76 | |||
| ae73a9b7f7 | |||
| 73670dafc7 | |||
| aae44892c0 | |||
| 6ec169fa9d | |||
| a35a2441ce | |||
| abefff828d | |||
| 71185b9f98 | |||
| 8079f014bc | |||
| 773e3a87d9 | |||
| ff21142042 | |||
| bd373d6038 | |||
| 7601a5c0fb | |||
| 8ed401ce12 | |||
| 664943589e | |||
| 8dbfc0799c | |||
| 46d638af0c | |||
| ae230a33f5 | |||
| d4f212183e | |||
| 568e9c5878 | |||
| 5784fab588 | |||
| 484a7c5db0 | |||
| 7071f819d0 | |||
| 93c0f09c31 | |||
| e5e3478afd | |||
| bee7b09377 | |||
| 3b68c0ea24 | |||
| b79c0bc7b4 | |||
| 3b9389e86c | |||
| 2c95f84acc | |||
| c05af749df | |||
| 24b94551a2 | |||
| 99d4f83fa8 | |||
| 6c28b55c13 | |||
| 2b1716cb3a | |||
| bd4bbbddbe | |||
| 2aa1c6975f | |||
| e285ba43eb | |||
| 582de4f951 | |||
| dcd6c18e45 | |||
| 4c6cb8648b | |||
| 6b47d6246b | |||
| cc437c78a0 | |||
| edda6b6f70 | |||
| 803376b1b4 | |||
| e897ab7611 | |||
| ba3aa8fab5 | |||
| 81bb4bfc23 | |||
| 059c84bf41 | |||
| eec86c8038 | |||
| ad6cebb049 | |||
| 61214b9a52 | |||
| f8742d599b | |||
| d4a93ff9c7 | |||
| 517d934f7c | |||
| 87b99306ba | |||
| af32267db3 | |||
| 7fa2fe134c | |||
| 515e2928a9 | |||
| 8a5e7fa609 | |||
| ed0ee913e1 | |||
| a26fa50736 | |||
| 5d510ac7b3 | |||
| c37d5be524 | |||
| 0bedff1ce0 | |||
| e7153d30c8 | |||
| 257a070666 | |||
| bd5858019e | |||
| 4ef8ca091d | |||
| 8473bc19f5 | |||
| df77641071 | |||
| cb345870a9 | |||
| d3843dbf09 | |||
| fef6c37ea7 | |||
| 0e5a66b1cd | |||
| e51c51e7f9 | |||
| 39ee6b6a7f | |||
| 89deab6a3e | |||
| 1191d08b47 | |||
| deef9fae23 | |||
| 1b8641685a | |||
| 672c063fd8 | |||
| 2f599bace1 | |||
| f5113aa84a | |||
| 31d6af6114 | |||
| 9c45af7730 | |||
| cac9fcaf86 | |||
| 4a3bcd9230 | |||
| 87b0939fe7 | |||
| 44c4d0a4d6 | |||
| ee8d8042e6 | |||
| 514bfe77df | |||
| 5e18f15435 | |||
| d0938ce398 | |||
| 80c716b81f | |||
| f09e886fd2 | |||
| 47f62838db | |||
| 3c71c07048 | |||
| 37d2d9e013 | |||
| 3f44f8f50d | |||
| df76673bee | |||
| 2f8e708184 | |||
| 894b7810b2 | |||
| 57098f3df7 | |||
| 69a79ba082 | |||
| 641e769bde | |||
| 435f652263 | |||
| 6ced400207 | |||
| f93ac86c53 | |||
| 943cb531bf | |||
| c34efcc718 | |||
| 2292caef38 | |||
| 9c48a75c8e | |||
| b2300ba9cb | |||
| 6fb3cef39f | |||
| cb41e354b8 | |||
| 7d9cdc7ec4 | |||
| bf8f5e2f87 | |||
| a3e0e1a6eb | |||
| 2ae9ca5073 | |||
| f25b60fded | |||
| f09556018b | |||
| 04b46a9ce8 | |||
| eb5d867adf | |||
| 2f71c96bde | |||
| 09ed718c14 | |||
| cfc4dcea3d | |||
| 33a63e5cd3 | |||
| a05bdfa76c | |||
| cd3ce8459b | |||
| 74afc04580 | |||
| 233d4ad349 | |||
| 8481abda05 | |||
| 55fddf3aac | |||
| b76594e551 | |||
| 2d45e3340f | |||
| 585b14f08f | |||
| 3cfae26b84 | |||
| 3b1165ccdc | |||
| 75d42a87e5 | |||
| cdba0da780 | |||
| a3c6baad4c | |||
| 0e1f9968c1 | |||
| 6439777406 | |||
| c43bc000d9 | |||
| d857600d9c | |||
| 385f0c6c95 | |||
| 8cdbf380cf | |||
| 691ba89b6f | |||
| 1fcf82aeef | |||
| 56b4671cd8 | |||
| d8e98cb99d | |||
| 831caaa150 | |||
| 64fff417c3 | |||
| 7eb6c2652f | |||
| d04cb4ba42 | |||
| 782add6943 | |||
| 800e0a7357 | |||
| 7663fc6256 | |||
| 26278643d4 | |||
| 407f6af1ed | |||
| 192b22a6ce | |||
| 837f9040d8 | |||
| 4691ff06b5 | |||
| ba02d90bf1 | |||
| a649fa3a79 | |||
| 72011bf325 | |||
| 7aaa71d22e | |||
| 66b8ab9c6e | |||
| fdb7dfdea7 | |||
| e7a9073ccd | |||
| 65978c33b6 | |||
| bb8e953fb5 | |||
| 950b175fcd | |||
| dc605d35ee | |||
| 811e5786fe | |||
| c1146ebdcd | |||
| 8679266db8 | |||
| 2624043ab6 | |||
| 960d3faa5e | |||
| a5cd95d6c6 | |||
| 28900925f4 | |||
| 9c46acfd62 | |||
| 45de998aa9 | |||
| 6cfbd73bcd | |||
| f7e7abc908 | |||
| b4c3c479b7 | |||
| 4d1bdb4741 | |||
| 78c10bac4a | |||
| 115962db88 | |||
| ce5d8a578e | |||
| f970a9de6a | |||
| 67bcfe3b62 | |||
| b55b9f5a6a | |||
| ef51fb7dea | |||
| 8fe0231b75 | |||
| e1856dc708 | |||
| 5da6fae9f6 | |||
| 69249e84e1 | |||
| 8f019f4800 | |||
| d55e7f9e51 | |||
| b1546a725c | |||
| 113fc0a77a | |||
| 419b0f9494 | |||
| 31470819c0 | |||
| 7bfa368d8d | |||
| c17845276a | |||
| b631411985 | |||
| 26ca371d93 | |||
| 79a7d2abf6 | |||
| e49930df21 | |||
| 471c728ac4 | |||
| cbefeeb677 | |||
| 8115e8a5a4 | |||
| 9f9a5ca76f | |||
| 9be8ef09a2 | |||
| 97bfc0bb77 | |||
| cf647347c9 | |||
| 8e9cc0eb51 | |||
| 47564ab6bc | |||
| 1319cb2cf5 | |||
| aed7bafac0 | |||
| 3a5ab301b2 | |||
| 5aebd151b6 | |||
| 16dd89c641 | |||
| a90c632ae2 | |||
| 48d8094d95 | |||
| 2c71d0eea2 | |||
| 01e7530902 | |||
| 907bcd16a8 | |||
| b40e662b10 | |||
| fec5538d3c | |||
| 1568974e8e | |||
| c054edda6b | |||
| 23d39c7d02 | |||
| c0d0c84f7d | |||
| da520bf8b7 | |||
| 68d1c856b3 | |||
| 77b563a024 | |||
| b4e2e2ec34 | |||
| a6f2f04664 | |||
| 644b3f6933 | |||
| 23186da560 | |||
| 3b1021abd1 | |||
| 55a7c341af | |||
| 6d56629660 | |||
| dc4752ef63 | |||
| 079d3ea067 | |||
| 3e9f207062 | |||
| e0049a07f3 | |||
| 13664a0185 | |||
| 4de9ab85ce | |||
| 3f3c481554 | |||
| 0b6a689f3c | |||
| 6b3c868c6e | |||
| 5fd2311951 | |||
| 0b0947c167 | |||
| ea66d4e73f | |||
| 0ece11c491 | |||
| 8cb47c8504 | |||
| c6abc9e682 | |||
| 09187801c1 | |||
| 247c61c93f | |||
| 04afec7771 | |||
| 05a845fafd | |||
| 6dcafd693f | |||
| 1df430aef4 | |||
| b7a3af7bd1 | |||
| 556ad777d1 | |||
| b7d329f9b3 | |||
| 1a8ba25444 | |||
| e9eb74e13a | |||
| c07551072d | |||
| e8cacc4380 | |||
| b4b6ba91e0 | |||
| 9cac62401d | |||
| 96e22b1104 | |||
| 5242b5557f | |||
| 4544664edc | |||
| 38093ffe47 | |||
| c62e2ad4d1 | |||
| aebbd04297 | |||
| da0e0359b6 | |||
| a8e5e0e515 | |||
| 42d875a411 | |||
| bc0236d869 | |||
| a3a3354d1b | |||
| f6523851b5 | |||
| c086664c2a | |||
| 9d1d552fde | |||
| df5b1a228d | |||
| 71e96e8b7c | |||
| f40b8f5694 | |||
| 9228855257 | |||
| c820eeb118 | |||
| 7c64ff6634 | |||
| 44e4510251 | |||
| aa4787f604 | |||
| cbb4abc55c | |||
| 69d9c5187e | |||
| 4b400fb4a6 | |||
| 21f24ef572 | |||
| a0a82cad0b | |||
| e66fb6a1c1 | |||
| 64b1c45a49 | |||
| 56bfa90a69 | |||
| 20827b4105 | |||
| 111111b38b | |||
| 26f6976568 | |||
| 8b31edb102 | |||
| 81e203b5fa | |||
| 4380ed23d1 | |||
| 0cfb26799c | |||
| 5bd86a05b2 | |||
| c5565a4e02 | |||
| 5c70f45feb | |||
| 29582f09a1 | |||
| ac8d97d358 | |||
| 31178661c9 | |||
| 095c610a3f | |||
| b5eb5ac686 | |||
| 500a3426ed | |||
| 198d07e905 | |||
| b16d48aa41 | |||
| 9424c2558e | |||
| 1755d06870 | |||
| bc2b600f09 | |||
| 0946d41c3f | |||
| 30914a73fb | |||
| 44f67330e2 | |||
| 21c61a5c77 | |||
| bd6d7b9136 | |||
| c9ab5ebbf5 | |||
| 2804de8c26 | |||
| fb37c86632 | |||
| 0f1097d7e6 | |||
| 2d5fadd88f | |||
| 230bed0bc4 | |||
| 9e94722987 | |||
| ef4e41d2a2 | |||
| 467cae9436 | |||
| 09b08ecd85 | |||
| 8c153adceb | |||
| e89303c202 | |||
| 622a4a6d51 | |||
| 2998462743 | |||
| f64d405ad8 | |||
| 90a6a3c125 | |||
| 2fa99703bf | |||
| 616349c27b | |||
| f3363070e7 | |||
| ca37c01476 | |||
| e1a7ea38a9 | |||
| 929e46b5c7 | |||
| e1a2423f2e | |||
| 2ff8ac0cb2 | |||
| 12d7ef541b | |||
| 804c43b33c | |||
| ef53298f7c | |||
| 2a595713f3 | |||
| b666f7324c | |||
| b05aadf877 | |||
| 49aebf64b9 | |||
| 9d907e31b3 | |||
| 36723853c9 | |||
| 8161dff58a | |||
| ebc74d7428 | |||
| 236d275b2f | |||
| b36262cd11 | |||
| d6f7570d57 | |||
| 74f2b67b1a | |||
| 3eec2eec9a | |||
| 200b4f13c7 | |||
| 39b316729b | |||
| 6071376d42 | |||
| 413a01ade5 | |||
| 1a2d83ab01 | |||
| 591498ab31 | |||
| a9f5a1af51 | |||
| c54fe7d97d | |||
| 85b69000cd | |||
| ddf67ec42d | |||
| 2d346638fb | |||
| a620f5bd7d | |||
| 07bc76871c | |||
| 4adeb29491 | |||
| 177f9cabc1 | |||
| 4e81adaf8c | |||
| fcd3e76767 | |||
| c07b06c8d1 | |||
| 420dc969d3 | |||
| eb9af11d64 | |||
| b20c98753f | |||
| 44ccbd2184 | |||
| 06fc53ac69 | |||
| 75d87383e2 | |||
| a04c0077b9 | |||
| 8625a6d946 | |||
| ce62da1cca | |||
| 71f8e11d70 | |||
| a94fa0a840 | |||
| 23598fa658 | |||
| 7673eda947 | |||
| 6dea9fa10c | |||
| c04db4b545 | |||
| e0c4f6164e | |||
| cab6fca22e | |||
| 19b42bc726 | |||
| 8ce2ce8fd4 | |||
| a71bf4cae5 | |||
| 8dce9f7a60 | |||
| 6c87962551 | |||
| 674d2a6788 | |||
| 8b53ff9383 | |||
| 22122092e4 | |||
| d0d4bbf5ae | |||
| 5ff42d8993 | |||
| 81933b7972 | |||
| f3685fa8de | |||
| 375062d02c | |||
| 093667799d | |||
| 1cc913d006 | |||
| 8cdce34b27 | |||
| 6849356d63 | |||
| 530d8c007d | |||
| 521d45dcc6 | |||
| fbc55937fe | |||
| dff3bc5656 | |||
| fc24cf15ce | |||
| b24d01fae6 | |||
| d0edc48a65 | |||
| f405c7acc9 | |||
| ef7c6a580e | |||
| 2c509d96a6 | |||
| 07aecb3678 | |||
| bfaa1e9ed0 | |||
| a7ccb16aa8 | |||
| 33798b99a4 | |||
| caa977e869 | |||
| f8ec0365c6 | |||
| d99b1258e3 | |||
| b73437aa63 | |||
| 4efdfaa8f3 | |||
| bd4d92c76d | |||
| 77565add6e | |||
| ab0e5d5568 | |||
| 792ae5dae5 | |||
| f40180f7fb | |||
| adef9b7747 | |||
| 40aa146624 | |||
| 0b6aa59621 | |||
| e2f25a96e1 | |||
| ddb6350fe8 | |||
| 9b969648d5 | |||
| 2956aee8dc | |||
| 4f67f586d0 | |||
| fdf59e6a03 | |||
| f5add95083 | |||
| 8a6e6fe523 | |||
| 3970942028 | |||
| 0e8e1171c6 | |||
| 59fa0be35f | |||
| 98b908387f | |||
| 601bdadf44 | |||
| 082254455b | |||
| 58ecf03e5d | |||
| 348ee5299e | |||
| e944ecd1c2 | |||
| 207b34ae12 | |||
| b1e92c9ec6 | |||
| 4bd28cf920 | |||
| 2b8b916cba | |||
| cd7f08a8e7 | |||
| 387b0df554 | |||
| b4cc158981 | |||
| e4f62cae9a | |||
| 4ad8af629d | |||
| f89a08985e | |||
| 607ecf595b | |||
| 8744627059 | |||
| efa7116b58 | |||
| cd0b921ed2 | |||
| 65be564cd6 | |||
| 22392d226a | |||
| a5139d7100 | |||
| 288c154290 | |||
| c274146358 | |||
| 3eb7194619 | |||
| 3e01bc48d4 | |||
| 134c77a5c6 | |||
| fd80b1bd9b | |||
| 776dc34411 | |||
| f42635a40d | |||
| 4fadf4c830 | |||
| b4fc86e467 | |||
| 02f972292c | |||
| 5d4ec45534 | |||
| d89ff310c1 | |||
| a0b15c2d04 | |||
| 63a841e300 | |||
| 3ed011dcfb | |||
| 028beb8da4 | |||
| db00b49a50 | |||
| e5a01026a7 | |||
| c9d0889f25 | |||
| 584b166823 | |||
| 93c67a3c07 | |||
| 8e838c1424 | |||
| 49abd0d269 | |||
| fb9316701b | |||
| dab640220c | |||
| ea9e3c0860 | |||
| 2f895d63a6 | |||
| fb76cb9a5c | |||
| 294dcc5f93 | |||
| 68f27bb4cd | |||
| ce67cb0ca1 | |||
| 9c0934e82c | |||
| c470c204d4 | |||
| 4042a52db1 | |||
| 4437f16e08 | |||
| 335b78b4f2 | |||
| e3611c5d73 | |||
| 19a6eecfbb | |||
| 4dc4d74056 | |||
| ad4701f4f7 | |||
| 72874376f0 | |||
| 79fcf18013 | |||
| 229f0af537 | |||
| df05bbb72b | |||
| 28976b8c92 | |||
| 12ddc4ad12 | |||
| 52b563a83e | |||
| 33b6466611 | |||
| b97c30e6e7 | |||
| acd9c7950e | |||
| b64e90dfe0 | |||
| 1c9dc9c0d9 | |||
| 65a083c83d | |||
| 993441b25a | |||
| c7a9a3e2f6 | |||
| f3fa04ae0a | |||
| c4729b39b4 | |||
| 14f54aae40 | |||
| 5003c35963 | |||
| ddf93eb7ba | |||
| 69d32f286b | |||
| 2517d1fb55 | |||
| 9aad583c7d | |||
| 999c880dfd | |||
| ff3ac64b7e | |||
| faacf575b5 | |||
| b92d117524 | |||
| 385b7a77e6 | |||
| 2a35ec2d85 | |||
| d9880273e3 | |||
| b8c7a6153d | |||
| bfe361c576 | |||
| 5ea526728e | |||
| 88ff2db715 | |||
| 6f1fac1c59 | |||
| c28504961d | |||
| dcd6bea172 | |||
| 27d2fab951 | |||
| da61b6871a | |||
| db5e4e05a8 | |||
| 0bebe6c428 | |||
| 015257889d | |||
| b211f97efa | |||
| 333e3b0491 | |||
| 3ba7b8c24c | |||
| 82d0a55862 | |||
| 6407745781 | |||
| a60e1546b2 | |||
| 60e2b84e09 | |||
| 1a3c6d3dbc | |||
| d80fe166d1 | |||
| 438cba3604 | |||
| 88c075ba90 | |||
| 48332c3b18 | |||
| 94645ae720 | |||
| 63caa8bb44 | |||
| 120c080fc2 | |||
| 9920b22509 | |||
| cd8cdc711c | |||
| 540cf9b6d7 | |||
| 51c41f09bf | |||
| af4afb7e03 | |||
| ebf2b1e706 | |||
| d7f95da8f3 | |||
| 4545954385 | |||
| 13228ca29a | |||
| c52bffda9c | |||
| cf17fd2306 | |||
| 603136a93b | |||
| 7c333b8e07 | |||
| ff107315cb | |||
| 980b6cada7 | |||
| 36444a1db1 | |||
| 356091e1e0 | |||
| 2e84700224 | |||
| dc668ed0df | |||
| 55d3edef2f | |||
| d710d19aef | |||
| 4d037376af | |||
| 0c1516b34d | |||
| 055fefc542 | |||
| d648247b80 | |||
| d131223161 | |||
| 9f0eb2ea1a | |||
| b14086f3f9 | |||
| a5e22c07c7 | |||
| 01abeda9ef | |||
| e2e046c452 | |||
| 17b35878ea | |||
| c3f4dac7dc | |||
| 6dae6198a2 | |||
| 2279b28df2 | |||
| 8e9b508c88 | |||
| 274db39aa5 | |||
| 29ada4e263 | |||
| 2ae448d9d0 | |||
| 58f59197ff | |||
| 5663a9c38b | |||
| 4e180bc237 | |||
| 6fd8b2b177 | |||
| dad8fb8b06 | |||
| 6edaf42b3d | |||
| 79c047487d | |||
| ac5acb9abf | |||
| 87fbbd3b13 | |||
| 8ac0ec6473 | |||
| 6e959b6f43 | |||
| 66f97ef6bc | |||
| a4018dbb4b | |||
| 92a968a8a9 | |||
| 42dd772455 | |||
| 9417e41676 | |||
| c4425a1b0e | |||
| ace6c67697 | |||
| 8acba74c4d | |||
| 34bcbdf41d | |||
| 1ee40f8f8f | |||
| 194751e800 | |||
| eb44b6b1fa | |||
| 6555c7302d | |||
| 2e539918c1 | |||
| 862e4ba67a | |||
| d519ca0213 | |||
| 6f2c09c187 | |||
| a392e8dc09 | |||
| a4d4f77bc2 | |||
| 83a8f72d83 | |||
| 3c54b56cfe | |||
| 30966dfed0 | |||
| e12e06198c | |||
| ff1a08f148 | |||
| cf06f71514 | |||
| 396a95f7af | |||
| d49c27e362 | |||
| 5a53b0fc03 | |||
| afc634eef2 | |||
| e550600ebe | |||
| 7cb13be52a | |||
| 7215939a89 | |||
| 8d341e0714 | |||
| 99fa769800 | |||
| 2a171cf2a2 | |||
| 636f00276e | |||
| 1a04eabb5e | |||
| 8ba4e7e897 | |||
| ab56d7ecd7 | |||
| 1249c713f0 | |||
| 9742817ba3 | |||
| 67a7764086 | |||
| bd6ac3ee6d | |||
| 4c57b8f1db | |||
| 0edda42eee | |||
| 09e544cb8c | |||
| cd9d3ae5d3 | |||
| 27ca0a8f41 | |||
| f688b9b6b5 | |||
| 27c1ed86fa | |||
| d26f953a0a | |||
| 16c61b3cc0 | |||
| 6e74d0a09a | |||
| fb480f22fc | |||
| d0507559a4 | |||
| 58eb331b08 | |||
| 313d850dd2 | |||
| a9c7d47072 | |||
| 1dae118419 | |||
| 67ffef094d | |||
| f205567fa6 | |||
| e4027ba98a | |||
| c1dfd944af | |||
| 60a6747c0e | |||
| bd48c49c2b | |||
| 7d79a7822b | |||
| a3c6d19599 | |||
| c04f4a913f | |||
| bc8d1e0f84 | |||
| 407df3127b | |||
| 4ca5441cf1 | |||
| 61377f41ad | |||
| f1f2cebf98 | |||
| c8ae3c45ac | |||
| 335fa2e742 | |||
| 39f8ccdb42 | |||
| 642b1e25f6 | |||
| 5a95b35fb3 | |||
| c68015ca87 | |||
| 583c22d6e0 | |||
| ae72356961 | |||
| 2f281b3184 | |||
| 374a172246 | |||
| 563f98b898 | |||
| 58a4694d92 | |||
| 397889e697 | |||
| 97cf345528 | |||
| 0658abbdd4 | |||
| 72026a58bf | |||
| 7152231a10 | |||
| 8fe8a667b6 | |||
| 560c543e69 | |||
| c5e6650924 | |||
| 10373ea5c9 | |||
| 4f36dad942 | |||
| efa5db4c58 | |||
| 4d6fcb3a8b | |||
| 9ed13157eb | |||
| 9833e5bc66 | |||
| 78cf0365e6 | |||
| ba89ad546a | |||
| b6822a18f7 | |||
| a110b1d475 | |||
| 4de02c7f2f | |||
| 652ff43f64 | |||
| ea0b4f0f33 | |||
| 7cd9975e29 | |||
| 330dd6a7a8 | |||
| b06d4a3300 | |||
| 1da12feafc | |||
| 1b6f850d42 | |||
| b7c8ab639c | |||
| 7a14cf765f | |||
| c09e3c0890 | |||
| fb2f7f1b99 | |||
| d79a96caae | |||
| cc9c578006 | |||
| 0f85809acf | |||
| 992b1cf582 | |||
| 1505f3de06 | |||
| fc13c95c85 | |||
| 86ee1f5a1f | |||
| 5142934a26 | |||
| 78ed631877 | |||
| fa88dacd7b | |||
| 5db5322902 | |||
| 3ff1902b57 | |||
| 8531622966 | |||
| f420bce07e | |||
| 566efe04f2 | |||
| c17eb14739 | |||
| 524d86605a | |||
| 19abc5d329 | |||
| 7586adbb6a | |||
| 69d6ddccc5 | |||
| 5ae496dcef | |||
| bc5d742623 | |||
| 882e699163 | |||
| 9c725d79d6 | |||
| 79fbf437a3 | |||
| d130aa4289 | |||
| 5d8b83a251 | |||
| 5a2548a83d | |||
| a85b310e1f | |||
| 744e615dbb | |||
| 668d7805d6 | |||
| 439853c4a8 | |||
| e51fd40547 | |||
| 455cb09cf4 | |||
| 62f271658b | |||
| 0aa742934f | |||
| a26a709a7b | |||
| f3eac179e6 | |||
| 40258f8b9a | |||
| 7113334f99 | |||
| 5fa185bfda | |||
| 027293d285 | |||
| f7d049ac2d | |||
| ea0ff1c8f7 | |||
| 5c1bb5f13a | |||
| 47f3f9d44a | |||
| c918b6fbcc | |||
| 8faa750f21 | |||
| 4646671e70 | |||
| a759987515 | |||
| a5df494176 | |||
| b06a70c33c | |||
| 24d9b4b611 | |||
| a0e75c9006 | |||
| 2435b953e1 | |||
| c042e12323 | |||
| e9efe46db9 | |||
| ecc14b7308 | |||
| 0152fe5cdf | |||
| 892d17af22 | |||
| 2cca00203e | |||
| 9f4626a62a | |||
| 7a914c84d7 | |||
| 0eb227e7de | |||
| fe5f00bbea | |||
| bfc34023b1 | |||
| cfe08ba55f | |||
| c488e912e6 | |||
| 80efc8839a | |||
| bdc4f7fb18 | |||
| 1c0e6578b6 | |||
| 4f4b18ab7e | |||
| e890a0b45e | |||
| acb1c8e7f2 | |||
| 68223f0385 | |||
| 1291a88bff | |||
| d9b687450a | |||
| bd950b37d7 | |||
| f5626a2b9d | |||
| 679132b607 | |||
| 21fcdf8c56 | |||
| d7f7835069 | |||
| e3c9d7936b | |||
| f05807f38e | |||
| 3d2a97b4a9 | |||
| 7e08525ce3 | |||
| 6b400fb4bf | |||
| d982298ab2 | |||
| 765fd7f763 | |||
| ae3e6e423a | |||
| 2ca7dcb853 | |||
| 2d52821cf5 | |||
| 0325047c01 | |||
| 647380a357 | |||
| 2dce8923ee | |||
| 8d1ba074be | |||
| 4675a3b560 | |||
| 8999b1f69f | |||
| 6c2b19c11b | |||
| a425334928 | |||
| db2faf2789 | |||
| fdbb7d0da4 | |||
| 52cd99918f | |||
| a3e6a95ffb | |||
| 5b65169997 | |||
| 5f3bf69e30 | |||
| 01d96fc684 | |||
| d97e55d54a | |||
| 23cd143aae | |||
| 17316f92c7 | |||
| 507c02b9af | |||
| b7fe47ba48 | |||
| 69e600c404 | |||
| 7dfd11da4b | |||
| 97ba95f30e | |||
| c1945b4ec9 | |||
| c4291a4b8e | |||
| 5b5dfa86c5 | |||
| 3ca3f6959f | |||
| f7b7bfa406 | |||
| 3d2f29c92d | |||
| faf9c1532a | |||
| 0f2bebdb9b | |||
| be17d775e0 | |||
| c855c6f0ab | |||
| 8b69b232a8 | |||
| dcfdddf83f | |||
| 18f0d2e1b5 | |||
| 0029ed106b | |||
| 1e26fe2d6f | |||
| 5e0c754d04 | |||
| f9a972220e | |||
| 0e72aae0a3 | |||
| 6193ebaba7 | |||
| 481d6128c7 | |||
| a8a97962d2 | |||
| 75cb6fc51b | |||
| 55f20288b1 | |||
| 328e730c8f | |||
| d2984d2615 | |||
| bb720626e3 | |||
| 64d7b73d7c | |||
| 35aeadfdd4 | |||
| f8ebcff078 | |||
| 8761ae65a3 | |||
| 41d7038c1e | |||
| a3e204a99d | |||
| 97f90f1146 | |||
| 471cfa8ac3 | |||
| aad0a9a0f3 | |||
| b1b7f7a248 | |||
| 5e4dd5321c | |||
| c643389ec4 | |||
| ab07427339 | |||
| 2e2b1b3687 |
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -3,6 +3,7 @@
|
|||||||
.github export-ignore
|
.github export-ignore
|
||||||
.lgtm.yml export-ignore
|
.lgtm.yml export-ignore
|
||||||
SECURITY.md export-ignore
|
SECURITY.md export-ignore
|
||||||
|
CITATION.cff export-ignore
|
||||||
* text=auto
|
* text=auto
|
||||||
*.jpg -text
|
*.jpg -text
|
||||||
*.pdf -text
|
*.pdf -text
|
||||||
|
|||||||
66
.github/CODEOWNERS
vendored
66
.github/CODEOWNERS
vendored
@ -13,39 +13,44 @@ lib/kim/* @ellio167
|
|||||||
lib/mesont/* @iafoss
|
lib/mesont/* @iafoss
|
||||||
|
|
||||||
# whole packages
|
# whole packages
|
||||||
src/COMPRESS/* @rbberger
|
src/ADIOS/* @pnorbert
|
||||||
src/GPU/* @ndtrung81
|
src/AMOEBA/* @sjplimp
|
||||||
src/KOKKOS/* @stanmoore1
|
src/BPM/* @jtclemm
|
||||||
src/KIM/* @ellio167
|
|
||||||
src/LATTE/* @cnegre
|
|
||||||
src/MESSAGE/* @sjplimp
|
|
||||||
src/MLIAP/* @athomps
|
|
||||||
src/SNAP/* @athomps
|
|
||||||
src/SPIN/* @julient31
|
|
||||||
src/BROWNIAN/* @samueljmcameron
|
src/BROWNIAN/* @samueljmcameron
|
||||||
src/CG-DNA/* @ohenrich
|
src/CG-DNA/* @ohenrich
|
||||||
src/CG-SDK/* @akohlmey
|
src/CG-SDK/* @yskmiyazaki
|
||||||
src/COLVARS/* @giacomofiorin
|
src/COLVARS/* @giacomofiorin
|
||||||
|
src/COMPRESS/* @rbberger
|
||||||
src/DIELECTRIC/* @ndtrung81
|
src/DIELECTRIC/* @ndtrung81
|
||||||
|
src/ELECTRODE/* @ludwig-ahrens
|
||||||
src/FEP/* @agiliopadua
|
src/FEP/* @agiliopadua
|
||||||
src/ML-HDNNP/* @singraber
|
src/GPU/* @ndtrung81
|
||||||
|
src/GRANULAR/* @jtclemm @dsbolin
|
||||||
src/INTEL/* @wmbrownintel
|
src/INTEL/* @wmbrownintel
|
||||||
|
src/KIM/* @ellio167
|
||||||
|
src/KOKKOS/* @stanmoore1
|
||||||
|
src/LATTE/* @cnegre
|
||||||
src/MANIFOLD/* @Pakketeretet2
|
src/MANIFOLD/* @Pakketeretet2
|
||||||
src/MDI/* @taylor-a-barnes
|
src/MDI/* @taylor-a-barnes @sjplimp
|
||||||
src/MEAM/* @martok
|
src/MEAM/* @martok
|
||||||
src/MESONT/* @iafoss
|
src/MESONT/* @iafoss
|
||||||
|
src/ML-HDNNP/* @singraber
|
||||||
|
src/ML-IAP/* @athomps
|
||||||
|
src/ML-PACE/* @yury-lysogorskiy
|
||||||
src/MOFFF/* @hheenen
|
src/MOFFF/* @hheenen
|
||||||
src/MOLFILE/* @akohlmey
|
src/MOLFILE/* @akohlmey
|
||||||
src/NETCDF/* @pastewka
|
src/NETCDF/* @pastewka
|
||||||
src/ML-PACE/* @yury-lysogorskiy
|
|
||||||
src/PLUMED/* @gtribello
|
|
||||||
src/PHONON/* @lingtikong
|
|
||||||
src/PTM/* @pmla
|
|
||||||
src/OPENMP/* @akohlmey
|
src/OPENMP/* @akohlmey
|
||||||
|
src/PHONON/* @lingtikong
|
||||||
|
src/PLUGIN/* @akohlmey
|
||||||
|
src/PLUMED/* @gtribello
|
||||||
|
src/PTM/* @pmla
|
||||||
src/QMMM/* @akohlmey
|
src/QMMM/* @akohlmey
|
||||||
src/REAXFF/* @hasanmetin @stanmoore1
|
|
||||||
src/REACTION/* @jrgissing
|
src/REACTION/* @jrgissing
|
||||||
|
src/REAXFF/* @hasanmetin @stanmoore1
|
||||||
src/SCAFACOS/* @rhalver
|
src/SCAFACOS/* @rhalver
|
||||||
|
src/SNAP/* @athomps
|
||||||
|
src/SPIN/* @julient31
|
||||||
src/TALLY/* @akohlmey
|
src/TALLY/* @akohlmey
|
||||||
src/UEF/* @danicholson
|
src/UEF/* @danicholson
|
||||||
src/VTK/* @rbberger
|
src/VTK/* @rbberger
|
||||||
@ -119,26 +124,32 @@ src/dump_movie.* @akohlmey
|
|||||||
src/exceptions.h @rbberger
|
src/exceptions.h @rbberger
|
||||||
src/fix_nh.* @athomps
|
src/fix_nh.* @athomps
|
||||||
src/info.* @akohlmey @rbberger
|
src/info.* @akohlmey @rbberger
|
||||||
src/timer.* @akohlmey
|
|
||||||
src/min* @sjplimp @stanmoore1
|
src/min* @sjplimp @stanmoore1
|
||||||
|
src/platform.* @akohlmey
|
||||||
|
src/timer.* @akohlmey
|
||||||
src/utils.* @akohlmey @rbberger
|
src/utils.* @akohlmey @rbberger
|
||||||
src/verlet.* @sjplimp @stanmoore1
|
src/verlet.* @sjplimp @stanmoore1
|
||||||
src/math_eigen_impl.h @jewettaij
|
src/math_eigen_impl.h @jewettaij
|
||||||
|
|
||||||
# tools
|
# tools
|
||||||
tools/msi2lmp/* @akohlmey
|
tools/coding_standard/* @akohlmey @rbberger
|
||||||
tools/emacs/* @HaoZeke
|
tools/emacs/* @HaoZeke
|
||||||
tools/singularity/* @akohlmey @rbberger
|
tools/lammps-shell/* @akohlmey
|
||||||
tools/coding_standard/* @rbberger
|
tools/msi2lmp/* @akohlmey
|
||||||
tools/valgrind/* @akohlmey
|
|
||||||
tools/swig/* @akohlmey
|
|
||||||
tools/offline/* @rbberger
|
tools/offline/* @rbberger
|
||||||
|
tools/singularity/* @akohlmey @rbberger
|
||||||
|
tools/swig/* @akohlmey
|
||||||
|
tools/valgrind/* @akohlmey
|
||||||
|
tools/vim/* @hammondkd
|
||||||
|
|
||||||
# tests
|
# tests
|
||||||
unittest/* @akohlmey @rbberger
|
unittest/* @akohlmey
|
||||||
|
|
||||||
# cmake
|
# cmake
|
||||||
cmake/* @junghans @rbberger
|
cmake/* @junghans @rbberger
|
||||||
|
cmake/Modules/LAMMPSInterfacePlugin.cmake @akohlmey
|
||||||
|
cmake/Modules/MPI4WIN.cmake @akohlmey
|
||||||
|
cmake/Modules/OpenCLLoader.cmake @akohlmey
|
||||||
cmake/Modules/Packages/COLVARS.cmake @junghans @rbberger @giacomofiorin
|
cmake/Modules/Packages/COLVARS.cmake @junghans @rbberger @giacomofiorin
|
||||||
cmake/Modules/Packages/KIM.cmake @junghans @rbberger @ellio167
|
cmake/Modules/Packages/KIM.cmake @junghans @rbberger @ellio167
|
||||||
cmake/presets/*.cmake @akohlmey
|
cmake/presets/*.cmake @akohlmey
|
||||||
@ -147,13 +158,12 @@ cmake/presets/*.cmake @akohlmey
|
|||||||
python/* @rbberger
|
python/* @rbberger
|
||||||
|
|
||||||
# fortran
|
# fortran
|
||||||
fortran/* @akohlmey
|
fortran/* @akohlmey @hammondkd
|
||||||
|
|
||||||
# docs
|
# docs
|
||||||
doc/utils/*/* @rbberger
|
doc/* @akohlmey
|
||||||
doc/Makefile @rbberger
|
|
||||||
doc/README @rbberger
|
|
||||||
examples/plugin/* @akohlmey
|
examples/plugin/* @akohlmey
|
||||||
|
examples/PACKAGES/pace/plugin/* @akohlmey
|
||||||
|
|
||||||
# for releases
|
# for releases
|
||||||
src/version.h @sjplimp
|
src/version.h @sjplimp
|
||||||
|
|||||||
4
.github/CONTRIBUTING.md
vendored
4
.github/CONTRIBUTING.md
vendored
@ -5,8 +5,8 @@ Thank your for considering to contribute to the LAMMPS software project.
|
|||||||
The following is a set of guidelines as well as explanations of policies and work flows for contributing to the LAMMPS molecular dynamics software project. These guidelines focus on submitting issues or pull requests on the LAMMPS GitHub project.
|
The following is a set of guidelines as well as explanations of policies and work flows for contributing to the LAMMPS molecular dynamics software project. These guidelines focus on submitting issues or pull requests on the LAMMPS GitHub project.
|
||||||
|
|
||||||
Thus please also have a look at:
|
Thus please also have a look at:
|
||||||
* [The guide for submitting new features in the LAMMPS manual](https://lammps.sandia.gov/doc/Modify_contribute.html)
|
* [The guide for submitting new features in the LAMMPS manual](https://www.lammps.org/doc/Modify_contribute.html)
|
||||||
* [The guide on programming style and requirement in the LAMMPS manual](https://lammps.sandia.gov/doc/Modify_contribute.html)
|
* [The guide on programming style and requirement in the LAMMPS manual](https://www.lammps.org/doc/Modify_style.html)
|
||||||
* [The GitHub tutorial in the LAMMPS manual](http://lammps.sandia.gov/doc/Howto_github.html)
|
* [The GitHub tutorial in the LAMMPS manual](http://lammps.sandia.gov/doc/Howto_github.html)
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|||||||
7
.github/ISSUE_TEMPLATE/help_request.md
vendored
7
.github/ISSUE_TEMPLATE/help_request.md
vendored
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: Request for Help
|
name: Request for Help
|
||||||
about: "Don't post help requests here, email the lammps-users mailing list"
|
about: "Don't post help requests here, post in the LAMMPS forum"
|
||||||
title: ""
|
title: ""
|
||||||
labels: invalid
|
labels: invalid
|
||||||
assignees: ''
|
assignees: ''
|
||||||
@ -8,8 +8,9 @@ assignees: ''
|
|||||||
---
|
---
|
||||||
|
|
||||||
Please **do not** post requests for help (e.g. with installing or using LAMMPS) here.
|
Please **do not** post requests for help (e.g. with installing or using LAMMPS) here.
|
||||||
Instead send an e-mail to the lammps-users mailing list.
|
Instead, you can post to the LAMMPS category in the Materials Science Community
|
||||||
|
Discourse forum at: https://matsci.org/lammps/
|
||||||
|
|
||||||
This issue tracker is for tracking LAMMPS development related issues only.
|
This issue tracker is for tracking LAMMPS development related issues only.
|
||||||
|
|
||||||
Thanks for your cooperation.
|
Thank you in advance for your cooperation.
|
||||||
|
|||||||
6
.github/codecov.yml
vendored
6
.github/codecov.yml
vendored
@ -7,7 +7,7 @@ coverage:
|
|||||||
threshold: 10%
|
threshold: 10%
|
||||||
only_pulls: false
|
only_pulls: false
|
||||||
branches:
|
branches:
|
||||||
- "master"
|
- "develop"
|
||||||
flags:
|
flags:
|
||||||
- "unit"
|
- "unit"
|
||||||
paths:
|
paths:
|
||||||
@ -16,14 +16,14 @@ coverage:
|
|||||||
project:
|
project:
|
||||||
default:
|
default:
|
||||||
branches:
|
branches:
|
||||||
- "master"
|
- "develop"
|
||||||
paths:
|
paths:
|
||||||
- "src"
|
- "src"
|
||||||
informational: true
|
informational: true
|
||||||
patch:
|
patch:
|
||||||
default:
|
default:
|
||||||
branches:
|
branches:
|
||||||
- "master"
|
- "develop"
|
||||||
paths:
|
paths:
|
||||||
- "src"
|
- "src"
|
||||||
informational: true
|
informational: true
|
||||||
|
|||||||
6
.github/dependabot.yml
vendored
Normal file
6
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
15
.github/workflows/codeql-analysis.yml
vendored
15
.github/workflows/codeql-analysis.yml
vendored
@ -5,12 +5,19 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: [develop]
|
branches: [develop]
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
analyze:
|
analyze:
|
||||||
name: Analyze
|
name: Analyze
|
||||||
if: ${{ github.repository == 'lammps/lammps' }}
|
if: ${{ github.repository == 'lammps/lammps' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
security-events: write
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@ -18,17 +25,17 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v1
|
uses: github/codeql-action/init@v2
|
||||||
with:
|
with:
|
||||||
languages: ${{ matrix.language }}
|
languages: ${{ matrix.language }}
|
||||||
config-file: ./.github/codeql/${{ matrix.language }}.yml
|
config-file: ./.github/codeql/${{ matrix.language }}.yml
|
||||||
@ -46,4 +53,4 @@ jobs:
|
|||||||
cmake --build . --parallel 2
|
cmake --build . --parallel 2
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v1
|
uses: github/codeql-action/analyze@v2
|
||||||
|
|||||||
21
.github/workflows/compile-msvc.yml
vendored
21
.github/workflows/compile-msvc.yml
vendored
@ -3,7 +3,13 @@ name: "Native Windows Compilation and Unit Tests"
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [develop]
|
branches:
|
||||||
|
- develop
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- develop
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -13,21 +19,26 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
|
|
||||||
- name: Select Python version
|
- name: Select Python version
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
python-version: '3.11'
|
||||||
|
|
||||||
- name: Building LAMMPS via CMake
|
- name: Building LAMMPS via CMake
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install numpy
|
python3 -m pip install numpy
|
||||||
|
python3 -m pip install pyyaml
|
||||||
|
nuget install MSMPIsdk
|
||||||
|
nuget install MSMPIDIST
|
||||||
cmake -C cmake/presets/windows.cmake \
|
cmake -C cmake/presets/windows.cmake \
|
||||||
-D PKG_PYTHON=on \
|
-D PKG_PYTHON=on \
|
||||||
|
-D WITH_PNG=off \
|
||||||
|
-D WITH_JPEG=off \
|
||||||
-S cmake -B build \
|
-S cmake -B build \
|
||||||
-D BUILD_SHARED_LIBS=on \
|
-D BUILD_SHARED_LIBS=on \
|
||||||
-D LAMMPS_EXCEPTIONS=on \
|
-D LAMMPS_EXCEPTIONS=on \
|
||||||
@ -43,4 +54,4 @@ jobs:
|
|||||||
- name: Run Unit Tests
|
- name: Run Unit Tests
|
||||||
working-directory: build
|
working-directory: build
|
||||||
shell: bash
|
shell: bash
|
||||||
run: ctest -V -C Release
|
run: ctest -V -C Release -E FixTimestep:python_move_nve
|
||||||
|
|||||||
14
.github/workflows/unittest-macos.yml
vendored
14
.github/workflows/unittest-macos.yml
vendored
@ -3,7 +3,13 @@ name: "Unittest for MacOS"
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [develop]
|
branches:
|
||||||
|
- develop
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- develop
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -15,7 +21,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
|
|
||||||
@ -26,7 +32,7 @@ jobs:
|
|||||||
run: mkdir build
|
run: mkdir build
|
||||||
|
|
||||||
- name: Set up ccache
|
- name: Set up ccache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ${{ env.CCACHE_DIR }}
|
path: ${{ env.CCACHE_DIR }}
|
||||||
key: macos-ccache-${{ github.sha }}
|
key: macos-ccache-${{ github.sha }}
|
||||||
@ -37,6 +43,8 @@ jobs:
|
|||||||
working-directory: build
|
working-directory: build
|
||||||
run: |
|
run: |
|
||||||
ccache -z
|
ccache -z
|
||||||
|
python3 -m pip install numpy
|
||||||
|
python3 -m pip install pyyaml
|
||||||
cmake -C ../cmake/presets/clang.cmake \
|
cmake -C ../cmake/presets/clang.cmake \
|
||||||
-C ../cmake/presets/most.cmake \
|
-C ../cmake/presets/most.cmake \
|
||||||
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||||
|
|||||||
91
CITATION.cff
Normal file
91
CITATION.cff
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
# YAML 1.2
|
||||||
|
---
|
||||||
|
cff-version: 1.2.0
|
||||||
|
title: "LAMMPS: Large-scale Atomic/Molecular Massively Parallel Simulator"
|
||||||
|
type: software
|
||||||
|
authors:
|
||||||
|
- family-names: "Plimpton"
|
||||||
|
given-names: "Steven J."
|
||||||
|
- family-names: "Kohlmeyer"
|
||||||
|
given-names: "Axel"
|
||||||
|
orcid: "https://orcid.org/0000-0001-6204-6475"
|
||||||
|
- family-names: "Thompson"
|
||||||
|
given-names: "Aidan P."
|
||||||
|
orcid: "https://orcid.org/0000-0002-0324-9114"
|
||||||
|
- family-names: "Moore"
|
||||||
|
given-names: "Stan G."
|
||||||
|
- family-names: "Berger"
|
||||||
|
given-names: "Richard"
|
||||||
|
orcid: "https://orcid.org/0000-0002-3044-8266"
|
||||||
|
doi: 10.5281/zenodo.3726416
|
||||||
|
license: GPL-2.0-only
|
||||||
|
url: https://www.lammps.org
|
||||||
|
repository-code: https://github.com/lammps/lammps/
|
||||||
|
keywords:
|
||||||
|
- "Molecular Dynamics"
|
||||||
|
- "Materials Modeling"
|
||||||
|
message: "If you are referencing LAMMPS in a publication, please cite the paper below."
|
||||||
|
preferred-citation:
|
||||||
|
type: article
|
||||||
|
doi: "10.1016/j.cpc.2021.108171"
|
||||||
|
url: "https://www.sciencedirect.com/science/article/pii/S0010465521002836"
|
||||||
|
authors:
|
||||||
|
- family-names: "Thompson"
|
||||||
|
given-names: "Aidan P."
|
||||||
|
orcid: "https://orcid.org/0000-0002-0324-9114"
|
||||||
|
- family-names: "Aktulga"
|
||||||
|
given-names: "H. Metin"
|
||||||
|
- family-names: "Berger"
|
||||||
|
given-names: "Richard"
|
||||||
|
orcid: "https://orcid.org/0000-0002-3044-8266"
|
||||||
|
- family-names: "Bolintineanu"
|
||||||
|
given-names: "Dan S."
|
||||||
|
- family-names: "Brown"
|
||||||
|
given-names: "W. Michael"
|
||||||
|
- family-names: "Crozier"
|
||||||
|
given-names: "Paul S."
|
||||||
|
- family-names: "in 't Veld"
|
||||||
|
given-names: "Pieter J."
|
||||||
|
- family-names: "Kohlmeyer"
|
||||||
|
given-names: "Axel"
|
||||||
|
orcid: "https://orcid.org/0000-0001-6204-6475"
|
||||||
|
- family-names: "Moore"
|
||||||
|
given-names: "Stan G."
|
||||||
|
- family-names: "Nguyen"
|
||||||
|
given-names: "Trung Dac"
|
||||||
|
- family-names: "Shan"
|
||||||
|
given-names: "Ray"
|
||||||
|
- family-names: "Stevens"
|
||||||
|
given-names: "Mark J."
|
||||||
|
- family-names: "Tranchida"
|
||||||
|
given-names: "Julien"
|
||||||
|
- family-names: "Trott"
|
||||||
|
given-names: "Christian"
|
||||||
|
- family-names: "Plimpton"
|
||||||
|
given-names: "Steven J."
|
||||||
|
title: "LAMMPS - a flexible simulation tool for particle-based materials modeling at the atomic, meso, and continuum scales"
|
||||||
|
journal: "Computer Physics Communications"
|
||||||
|
keywords:
|
||||||
|
- Molecular dynamics
|
||||||
|
- Materials modeling
|
||||||
|
- Parallel algorithms
|
||||||
|
- LAMMPS
|
||||||
|
month: 2
|
||||||
|
volume: 271
|
||||||
|
issn: 0010-4655
|
||||||
|
pages: 108171
|
||||||
|
year: 2022
|
||||||
|
references:
|
||||||
|
- title: "Fast Parallel Algorithms for Short-Range Molecular Dynamics"
|
||||||
|
type: article
|
||||||
|
journal: Journal of Computational Physics
|
||||||
|
volume: 117
|
||||||
|
number: 1
|
||||||
|
pages: "1-19"
|
||||||
|
year: 1995
|
||||||
|
issn: 0021-9991
|
||||||
|
doi: 10.1006/jcph.1995.1039
|
||||||
|
url: https://www.sciencedirect.com/science/article/pii/S002199918571039X
|
||||||
|
authors:
|
||||||
|
- family-names: "Plimpton"
|
||||||
|
given-names: "Steve"
|
||||||
4
README
4
README
@ -16,8 +16,8 @@ National Laboratories, a US Department of Energy facility, with
|
|||||||
funding from the DOE. It is an open-source code, distributed freely
|
funding from the DOE. It is an open-source code, distributed freely
|
||||||
under the terms of the GNU Public License (GPL) version 2.
|
under the terms of the GNU Public License (GPL) version 2.
|
||||||
|
|
||||||
The primary author of the code is Steve Plimpton, who can be emailed
|
The code is maintained by the LAMMPS development team who can be emailed
|
||||||
at sjplimp@sandia.gov. The LAMMPS WWW Site at www.lammps.org has
|
at developers@lammps.org. The LAMMPS WWW Site at www.lammps.org has
|
||||||
more information about the code and its uses.
|
more information about the code and its uses.
|
||||||
|
|
||||||
The LAMMPS distribution includes the following files and directories:
|
The LAMMPS distribution includes the following files and directories:
|
||||||
|
|||||||
29
SECURITY.md
29
SECURITY.md
@ -19,9 +19,9 @@ kinds of filesystem manipulations. And because of that LAMMPS should
|
|||||||
"administrator" account directly or indirectly via "sudo" or "su".
|
"administrator" account directly or indirectly via "sudo" or "su".
|
||||||
|
|
||||||
Therefore what could be seen as a security vulnerability is usually
|
Therefore what could be seen as a security vulnerability is usually
|
||||||
either a user mistake or a bug in the code. Bugs can be reported in
|
either a user mistake or a bug in the code. Bugs can be reported in the
|
||||||
the LAMMPS project
|
LAMMPS project [issue tracker on
|
||||||
[issue tracker on GitHub](https://github.com/lammps/lammps/issues).
|
GitHub](https://github.com/lammps/lammps/issues).
|
||||||
|
|
||||||
To mitigate issues with using homoglyphs or bidirectional reordering in
|
To mitigate issues with using homoglyphs or bidirectional reordering in
|
||||||
unicode, which have been demonstrated as a vector to obfuscate and hide
|
unicode, which have been demonstrated as a vector to obfuscate and hide
|
||||||
@ -30,10 +30,19 @@ for unicode characters and only all-ASCII source code is accepted.
|
|||||||
|
|
||||||
# Version Updates
|
# Version Updates
|
||||||
|
|
||||||
LAMMPS follows continuous release development model. We aim to keep all
|
LAMMPS follows a continuous release development model. We aim to keep
|
||||||
release versions (stable or patch) fully functional and employ a variety
|
the development version (`develop` branch) always fully functional and
|
||||||
of automatic testing procedures to detect failures of existing
|
employ a variety of automatic testing procedures to detect failures
|
||||||
functionality from adding new features before releases are made. Thus
|
of existing functionality from adding or modifying features. Most of
|
||||||
bugfixes and updates are only integrated into the current development
|
those tests are run on pull requests *before* merging to the `develop`
|
||||||
branch and thus the next (patch) release and users are recommended to
|
branch. The `develop` branch is protected, so all changes *must* be
|
||||||
update regularly.
|
submitted as a pull request and thus cannot avoid the automated tests.
|
||||||
|
|
||||||
|
Additional tests are run *after* merging. Before releases are made
|
||||||
|
*all* tests must have cleared. Then a release tag is applied and the
|
||||||
|
`release` branch is fast-forwarded to that tag. This is often referred
|
||||||
|
to as a patch release. Bug fixes and updates are
|
||||||
|
applied first to the `develop` branch. Later, they appear in the `release`
|
||||||
|
branch when the next patch release occurs.
|
||||||
|
For stable releases, selected bug fixes, updates, and new functionality
|
||||||
|
are pushed to the `stable` branch and a new stable tag is applied.
|
||||||
|
|||||||
@ -4,10 +4,8 @@ This directory contains 5 benchmark problems which are discussed in
|
|||||||
the Benchmark section of the LAMMPS documentation, and on the
|
the Benchmark section of the LAMMPS documentation, and on the
|
||||||
Benchmark page of the LAMMPS WWW site (https://www.lammps.org/bench.html).
|
Benchmark page of the LAMMPS WWW site (https://www.lammps.org/bench.html).
|
||||||
|
|
||||||
This directory also has several sub-directories:
|
This directory also has one sub-directories:
|
||||||
|
|
||||||
FERMI benchmark scripts for desktop machine with Fermi GPUs (Tesla)
|
|
||||||
KEPLER benchmark scripts for GPU cluster with Kepler GPUs
|
|
||||||
POTENTIALS benchmarks scripts for various potentials in LAMMPS
|
POTENTIALS benchmarks scripts for various potentials in LAMMPS
|
||||||
|
|
||||||
The results for all of these benchmarks are displayed and discussed on
|
The results for all of these benchmarks are displayed and discussed on
|
||||||
|
|||||||
615
cmake/CMakeLists.jpeg
Normal file
615
cmake/CMakeLists.jpeg
Normal file
@ -0,0 +1,615 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
# When using CMake 3.4 and later, don't export symbols from executables unless
|
||||||
|
# the CMAKE_ENABLE_EXPORTS variable is set.
|
||||||
|
if(POLICY CMP0065)
|
||||||
|
cmake_policy(SET CMP0065 NEW)
|
||||||
|
endif()
|
||||||
|
if (POLICY CMP0077)
|
||||||
|
cmake_policy(SET CMP0077 NEW)
|
||||||
|
endif()
|
||||||
|
if(CMAKE_EXECUTABLE_SUFFIX)
|
||||||
|
set(CMAKE_EXECUTABLE_SUFFIX_TMP ${CMAKE_EXECUTABLE_SUFFIX})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
project(libjpeg-turbo C)
|
||||||
|
set(VERSION 2.1.3)
|
||||||
|
set(COPYRIGHT_YEAR "1991-2022")
|
||||||
|
string(REPLACE "." ";" VERSION_TRIPLET ${VERSION})
|
||||||
|
list(GET VERSION_TRIPLET 0 VERSION_MAJOR)
|
||||||
|
list(GET VERSION_TRIPLET 1 VERSION_MINOR)
|
||||||
|
list(GET VERSION_TRIPLET 2 VERSION_REVISION)
|
||||||
|
function(pad_number NUMBER OUTPUT_LEN)
|
||||||
|
string(LENGTH "${${NUMBER}}" INPUT_LEN)
|
||||||
|
if(INPUT_LEN LESS OUTPUT_LEN)
|
||||||
|
math(EXPR ZEROES "${OUTPUT_LEN} - ${INPUT_LEN} - 1")
|
||||||
|
set(NUM ${${NUMBER}})
|
||||||
|
foreach(C RANGE ${ZEROES})
|
||||||
|
set(NUM "0${NUM}")
|
||||||
|
endforeach()
|
||||||
|
set(${NUMBER} ${NUM} PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
pad_number(VERSION_MINOR 3)
|
||||||
|
pad_number(VERSION_REVISION 3)
|
||||||
|
set(LIBJPEG_TURBO_VERSION_NUMBER ${VERSION_MAJOR}${VERSION_MINOR}${VERSION_REVISION})
|
||||||
|
|
||||||
|
# CMake 3.14 and later sets CMAKE_MACOSX_BUNDLE to TRUE by default when
|
||||||
|
# CMAKE_SYSTEM_NAME is iOS, tvOS, or watchOS, which breaks the libjpeg-turbo
|
||||||
|
# build. (Specifically, when CMAKE_MACOSX_BUNDLE is TRUE, executables for
|
||||||
|
# Apple platforms are built as application bundles, which causes CMake to
|
||||||
|
# complain that our install() directives for executables do not specify a
|
||||||
|
# BUNDLE DESTINATION. Even if CMake did not complain, building executables as
|
||||||
|
# application bundles would break our iOS packages.)
|
||||||
|
set(CMAKE_MACOSX_BUNDLE FALSE)
|
||||||
|
|
||||||
|
string(TIMESTAMP DEFAULT_BUILD "%Y%m%d")
|
||||||
|
set(BUILD ${DEFAULT_BUILD} CACHE STRING "Build string (default: ${DEFAULT_BUILD})")
|
||||||
|
|
||||||
|
# NOTE: On Windows, this does nothing except when using MinGW or Cygwin.
|
||||||
|
# CMAKE_BUILD_TYPE has no meaning in Visual Studio, and it always defaults to
|
||||||
|
# Debug when using NMake.
|
||||||
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
|
set(CMAKE_BUILD_TYPE Release)
|
||||||
|
endif()
|
||||||
|
message(STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}")
|
||||||
|
|
||||||
|
message(STATUS "VERSION = ${VERSION}, BUILD = ${BUILD}")
|
||||||
|
|
||||||
|
include(cmakescripts/PackageInfo.cmake)
|
||||||
|
|
||||||
|
# Detect CPU type and whether we're building 64-bit or 32-bit code
|
||||||
|
math(EXPR BITS "${CMAKE_SIZEOF_VOID_P} * 8")
|
||||||
|
string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} CMAKE_SYSTEM_PROCESSOR_LC)
|
||||||
|
set(COUNT 1)
|
||||||
|
foreach(ARCH ${CMAKE_OSX_ARCHITECTURES})
|
||||||
|
if(COUNT GREATER 1)
|
||||||
|
message(FATAL_ERROR "The libjpeg-turbo build system does not support multiple values in CMAKE_OSX_ARCHITECTURES.")
|
||||||
|
endif()
|
||||||
|
math(EXPR COUNT "${COUNT}+1")
|
||||||
|
endforeach()
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR_LC MATCHES "x86_64" OR
|
||||||
|
CMAKE_SYSTEM_PROCESSOR_LC MATCHES "amd64" OR
|
||||||
|
CMAKE_SYSTEM_PROCESSOR_LC MATCHES "i[0-9]86" OR
|
||||||
|
CMAKE_SYSTEM_PROCESSOR_LC MATCHES "x86" OR
|
||||||
|
CMAKE_SYSTEM_PROCESSOR_LC MATCHES "ia32")
|
||||||
|
if(BITS EQUAL 64 OR CMAKE_C_COMPILER_ABI MATCHES "ELF X32")
|
||||||
|
set(CPU_TYPE x86_64)
|
||||||
|
else()
|
||||||
|
set(CPU_TYPE i386)
|
||||||
|
endif()
|
||||||
|
if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL ${CPU_TYPE})
|
||||||
|
set(CMAKE_SYSTEM_PROCESSOR ${CPU_TYPE})
|
||||||
|
endif()
|
||||||
|
elseif(CMAKE_SYSTEM_PROCESSOR_LC STREQUAL "aarch64" OR
|
||||||
|
CMAKE_SYSTEM_PROCESSOR_LC MATCHES "^arm")
|
||||||
|
if(BITS EQUAL 64)
|
||||||
|
set(CPU_TYPE arm64)
|
||||||
|
else()
|
||||||
|
set(CPU_TYPE arm)
|
||||||
|
endif()
|
||||||
|
elseif(CMAKE_SYSTEM_PROCESSOR_LC MATCHES "^ppc" OR
|
||||||
|
CMAKE_SYSTEM_PROCESSOR_LC MATCHES "^powerpc")
|
||||||
|
set(CPU_TYPE powerpc)
|
||||||
|
else()
|
||||||
|
set(CPU_TYPE ${CMAKE_SYSTEM_PROCESSOR_LC})
|
||||||
|
endif()
|
||||||
|
if(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR
|
||||||
|
CMAKE_OSX_ARCHITECTURES MATCHES "arm64" OR
|
||||||
|
CMAKE_OSX_ARCHITECTURES MATCHES "i386")
|
||||||
|
set(CPU_TYPE ${CMAKE_OSX_ARCHITECTURES})
|
||||||
|
endif()
|
||||||
|
if(CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
|
||||||
|
set(CPU_TYPE powerpc)
|
||||||
|
endif()
|
||||||
|
if(MSVC_IDE AND CMAKE_GENERATOR_PLATFORM MATCHES "arm64")
|
||||||
|
set(CPU_TYPE arm64)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message(STATUS "${BITS}-bit build (${CPU_TYPE})")
|
||||||
|
|
||||||
|
macro(report_directory var)
|
||||||
|
if(CMAKE_INSTALL_${var} STREQUAL CMAKE_INSTALL_FULL_${var})
|
||||||
|
message(STATUS "CMAKE_INSTALL_${var} = ${CMAKE_INSTALL_${var}}")
|
||||||
|
else()
|
||||||
|
message(STATUS "CMAKE_INSTALL_${var} = ${CMAKE_INSTALL_${var}} (${CMAKE_INSTALL_FULL_${var}})")
|
||||||
|
endif()
|
||||||
|
mark_as_advanced(CLEAR CMAKE_INSTALL_${var})
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
set(DIRLIST "BINDIR;DATAROOTDIR;DOCDIR;INCLUDEDIR;LIBDIR")
|
||||||
|
if(UNIX)
|
||||||
|
list(APPEND DIRLIST "MANDIR")
|
||||||
|
endif()
|
||||||
|
foreach(dir ${DIRLIST})
|
||||||
|
report_directory(${dir})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# CONFIGURATION OPTIONS
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
macro(boolean_number var)
|
||||||
|
if(${var})
|
||||||
|
set(${var} 1 ${ARGN})
|
||||||
|
else()
|
||||||
|
set(${var} 0 ${ARGN})
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
option(ENABLE_SHARED "Build shared libraries" FALSE)
|
||||||
|
boolean_number(ENABLE_SHARED)
|
||||||
|
option(ENABLE_STATIC "Build static libraries" TRUE)
|
||||||
|
boolean_number(ENABLE_STATIC)
|
||||||
|
option(REQUIRE_SIMD "Generate a fatal error if SIMD extensions are not available for this platform (default is to fall back to a non-SIMD build)" FALSE)
|
||||||
|
boolean_number(REQUIRE_SIMD)
|
||||||
|
option(WITH_12BIT "Encode/decode JPEG images with 12-bit samples (implies WITH_ARITH_DEC=0 WITH_ARITH_ENC=0 WITH_JAVA=0 WITH_SIMD=0 WITH_TURBOJPEG=0 )" FALSE)
|
||||||
|
boolean_number(WITH_12BIT)
|
||||||
|
option(WITH_ARITH_DEC "Include arithmetic decoding support when emulating the libjpeg v6b API/ABI" TRUE)
|
||||||
|
boolean_number(WITH_ARITH_DEC)
|
||||||
|
option(WITH_ARITH_ENC "Include arithmetic encoding support when emulating the libjpeg v6b API/ABI" TRUE)
|
||||||
|
boolean_number(WITH_ARITH_ENC)
|
||||||
|
if(CMAKE_C_COMPILER_ABI MATCHES "ELF X32")
|
||||||
|
set(WITH_JAVA 0)
|
||||||
|
else()
|
||||||
|
option(WITH_JAVA "Build Java wrapper for the TurboJPEG API library (implies ENABLE_SHARED=1)" FALSE)
|
||||||
|
boolean_number(WITH_JAVA)
|
||||||
|
endif()
|
||||||
|
option(WITH_JPEG7 "Emulate libjpeg v7 API/ABI (this makes ${CMAKE_PROJECT_NAME} backward-incompatible with libjpeg v6b)" FALSE)
|
||||||
|
boolean_number(WITH_JPEG7)
|
||||||
|
option(WITH_JPEG8 "Emulate libjpeg v8 API/ABI (this makes ${CMAKE_PROJECT_NAME} backward-incompatible with libjpeg v6b)" FALSE)
|
||||||
|
boolean_number(WITH_JPEG8)
|
||||||
|
option(WITH_MEM_SRCDST "Include in-memory source/destination manager functions when emulating the libjpeg v6b or v7 API/ABI" TRUE)
|
||||||
|
boolean_number(WITH_MEM_SRCDST)
|
||||||
|
option(WITH_SIMD "Include SIMD extensions, if available for this platform" FALSE)
|
||||||
|
boolean_number(WITH_SIMD)
|
||||||
|
option(WITH_TURBOJPEG "Include the TurboJPEG API library and associated test programs" FALSE)
|
||||||
|
boolean_number(WITH_TURBOJPEG)
|
||||||
|
option(WITH_FUZZ "Build fuzz targets" FALSE)
|
||||||
|
|
||||||
|
macro(report_option var desc)
|
||||||
|
if(${var})
|
||||||
|
message(STATUS "${desc} enabled (${var} = ${${var}})")
|
||||||
|
else()
|
||||||
|
message(STATUS "${desc} disabled (${var} = ${${var}})")
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
if(WITH_JAVA)
|
||||||
|
set(ENABLE_SHARED 1)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Explicitly setting CMAKE_POSITION_INDEPENDENT_CODE=FALSE disables PIC for all
|
||||||
|
# targets, which will cause the shared library builds to fail. Thus, if shared
|
||||||
|
# libraries are enabled and CMAKE_POSITION_INDEPENDENT_CODE is explicitly set
|
||||||
|
# to FALSE, we need to unset it, thus restoring the default behavior
|
||||||
|
# (automatically using PIC for shared library targets.)
|
||||||
|
if(DEFINED CMAKE_POSITION_INDEPENDENT_CODE AND
|
||||||
|
NOT CMAKE_POSITION_INDEPENDENT_CODE AND ENABLE_SHARED)
|
||||||
|
unset(CMAKE_POSITION_INDEPENDENT_CODE CACHE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
report_option(ENABLE_SHARED "Shared libraries")
|
||||||
|
report_option(ENABLE_STATIC "Static libraries")
|
||||||
|
|
||||||
|
if(ENABLE_SHARED)
|
||||||
|
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WITH_JPEG8 OR WITH_JPEG7)
|
||||||
|
set(WITH_ARITH_ENC 1)
|
||||||
|
set(WITH_ARITH_DEC 1)
|
||||||
|
endif()
|
||||||
|
if(WITH_JPEG8)
|
||||||
|
set(WITH_MEM_SRCDST 0)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WITH_12BIT)
|
||||||
|
set(WITH_ARITH_DEC 0)
|
||||||
|
set(WITH_ARITH_ENC 0)
|
||||||
|
set(WITH_JAVA 0)
|
||||||
|
set(WITH_SIMD 0)
|
||||||
|
set(WITH_TURBOJPEG 0)
|
||||||
|
set(BITS_IN_JSAMPLE 12)
|
||||||
|
else()
|
||||||
|
set(BITS_IN_JSAMPLE 8)
|
||||||
|
endif()
|
||||||
|
report_option(WITH_12BIT "12-bit JPEG support")
|
||||||
|
|
||||||
|
if(WITH_ARITH_DEC)
|
||||||
|
set(D_ARITH_CODING_SUPPORTED 1)
|
||||||
|
endif()
|
||||||
|
if(NOT WITH_12BIT)
|
||||||
|
report_option(WITH_ARITH_DEC "Arithmetic decoding support")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WITH_ARITH_ENC)
|
||||||
|
set(C_ARITH_CODING_SUPPORTED 1)
|
||||||
|
endif()
|
||||||
|
if(NOT WITH_12BIT)
|
||||||
|
report_option(WITH_ARITH_ENC "Arithmetic encoding support")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT WITH_12BIT)
|
||||||
|
report_option(WITH_TURBOJPEG "TurboJPEG API library")
|
||||||
|
report_option(WITH_JAVA "TurboJPEG Java wrapper")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WITH_MEM_SRCDST)
|
||||||
|
set(MEM_SRCDST_SUPPORTED 1)
|
||||||
|
set(MEM_SRCDST_FUNCTIONS "global: jpeg_mem_dest; jpeg_mem_src;")
|
||||||
|
endif()
|
||||||
|
if(NOT WITH_JPEG8)
|
||||||
|
report_option(WITH_MEM_SRCDST "In-memory source/destination managers")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(SO_AGE 2)
|
||||||
|
if(WITH_MEM_SRCDST)
|
||||||
|
set(SO_AGE 3)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WITH_JPEG8)
|
||||||
|
set(JPEG_LIB_VERSION 80)
|
||||||
|
elseif(WITH_JPEG7)
|
||||||
|
set(JPEG_LIB_VERSION 70)
|
||||||
|
else()
|
||||||
|
set(JPEG_LIB_VERSION 62)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
math(EXPR JPEG_LIB_VERSION_DIV10 "${JPEG_LIB_VERSION} / 10")
|
||||||
|
math(EXPR JPEG_LIB_VERSION_MOD10 "${JPEG_LIB_VERSION} % 10")
|
||||||
|
if(JPEG_LIB_VERSION STREQUAL "62")
|
||||||
|
set(DEFAULT_SO_MAJOR_VERSION ${JPEG_LIB_VERSION})
|
||||||
|
else()
|
||||||
|
set(DEFAULT_SO_MAJOR_VERSION ${JPEG_LIB_VERSION_DIV10})
|
||||||
|
endif()
|
||||||
|
if(JPEG_LIB_VERSION STREQUAL "80")
|
||||||
|
set(DEFAULT_SO_MINOR_VERSION 2)
|
||||||
|
else()
|
||||||
|
set(DEFAULT_SO_MINOR_VERSION 0)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# This causes SO_MAJOR_VERSION/SO_MINOR_VERSION to reset to defaults if
|
||||||
|
# WITH_JPEG7 or WITH_JPEG8 has changed.
|
||||||
|
if((DEFINED WITH_JPEG7_INT AND NOT WITH_JPEG7 EQUAL WITH_JPEG7_INT) OR
|
||||||
|
(DEFINED WITH_JPEG8_INT AND NOT WITH_JPEG8 EQUAL WITH_JPEG8_INT))
|
||||||
|
set(FORCE_SO_VERSION "FORCE")
|
||||||
|
endif()
|
||||||
|
set(WITH_JPEG7_INT ${WITH_JPEG7} CACHE INTERNAL "")
|
||||||
|
set(WITH_JPEG8_INT ${WITH_JPEG8} CACHE INTERNAL "")
|
||||||
|
|
||||||
|
set(SO_MAJOR_VERSION ${DEFAULT_SO_MAJOR_VERSION} CACHE STRING
|
||||||
|
"Major version of the libjpeg API shared library (default: ${DEFAULT_SO_MAJOR_VERSION})"
|
||||||
|
${FORCE_SO_VERSION})
|
||||||
|
set(SO_MINOR_VERSION ${DEFAULT_SO_MINOR_VERSION} CACHE STRING
|
||||||
|
"Minor version of the libjpeg API shared library (default: ${DEFAULT_SO_MINOR_VERSION})"
|
||||||
|
${FORCE_SO_VERSION})
|
||||||
|
|
||||||
|
set(JPEG_LIB_VERSION_DECIMAL "${JPEG_LIB_VERSION_DIV10}.${JPEG_LIB_VERSION_MOD10}")
|
||||||
|
message(STATUS "Emulating libjpeg API/ABI v${JPEG_LIB_VERSION_DECIMAL} (WITH_JPEG7 = ${WITH_JPEG7}, WITH_JPEG8 = ${WITH_JPEG8})")
|
||||||
|
message(STATUS "libjpeg API shared library version = ${SO_MAJOR_VERSION}.${SO_AGE}.${SO_MINOR_VERSION}")
|
||||||
|
|
||||||
|
# Because the TurboJPEG API library uses versioned symbols and changes the
|
||||||
|
# names of functions whenever they are modified in a backward-incompatible
|
||||||
|
# manner, it is always backward-ABI-compatible with itself, so the major and
|
||||||
|
# minor SO versions don't change. However, we increase the middle number (the
|
||||||
|
# SO "age") whenever functions are added to the API.
|
||||||
|
set(TURBOJPEG_SO_MAJOR_VERSION 0)
|
||||||
|
set(TURBOJPEG_SO_AGE 2)
|
||||||
|
set(TURBOJPEG_SO_VERSION 0.${TURBOJPEG_SO_AGE}.0)
|
||||||
|
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# COMPILER SETTINGS
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
option(WITH_CRT_DLL
|
||||||
|
"Link all ${CMAKE_PROJECT_NAME} libraries and executables with the C run-time DLL (msvcr*.dll) instead of the static C run-time library (libcmt*.lib.) The default is to use the C run-time DLL only with the libraries and executables that need it."
|
||||||
|
FALSE)
|
||||||
|
if(NOT WITH_CRT_DLL)
|
||||||
|
# Use the static C library for all build types
|
||||||
|
foreach(var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
|
||||||
|
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
|
||||||
|
if(${var} MATCHES "/MD")
|
||||||
|
string(REGEX REPLACE "/MD" "/MT" ${var} "${${var}}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
add_definitions(-D_CRT_NONSTDC_NO_WARNINGS)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||||
|
# Use the maximum optimization level for release builds
|
||||||
|
foreach(var CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO)
|
||||||
|
if(${var} MATCHES "-O2")
|
||||||
|
string(REGEX REPLACE "-O2" "-O3" ${var} "${${var}}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
||||||
|
if(CMAKE_C_COMPILER_ID MATCHES "SunPro")
|
||||||
|
# Use the maximum optimization level for release builds
|
||||||
|
foreach(var CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO)
|
||||||
|
if(${var} MATCHES "-xO3")
|
||||||
|
string(REGEX REPLACE "-xO3" "-xO5" ${var} "${${var}}")
|
||||||
|
endif()
|
||||||
|
if(${var} MATCHES "-xO2")
|
||||||
|
string(REGEX REPLACE "-xO2" "-xO5" ${var} "${${var}}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UC)
|
||||||
|
|
||||||
|
set(EFFECTIVE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UC}}")
|
||||||
|
message(STATUS "Compiler flags = ${EFFECTIVE_C_FLAGS}")
|
||||||
|
|
||||||
|
set(EFFECTIVE_LD_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE_UC}}")
|
||||||
|
message(STATUS "Linker flags = ${EFFECTIVE_LD_FLAGS}")
|
||||||
|
|
||||||
|
include(CheckCSourceCompiles)
|
||||||
|
include(CheckIncludeFiles)
|
||||||
|
include(CheckTypeSize)
|
||||||
|
|
||||||
|
check_type_size("size_t" SIZE_T)
|
||||||
|
check_type_size("unsigned long" UNSIGNED_LONG)
|
||||||
|
|
||||||
|
if(SIZE_T EQUAL UNSIGNED_LONG)
|
||||||
|
check_c_source_compiles("int main(int argc, char **argv) { unsigned long a = argc; return __builtin_ctzl(a); }"
|
||||||
|
HAVE_BUILTIN_CTZL)
|
||||||
|
endif()
|
||||||
|
if(MSVC)
|
||||||
|
check_include_files("intrin.h" HAVE_INTRIN_H)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(UNIX)
|
||||||
|
if(CMAKE_CROSSCOMPILING)
|
||||||
|
set(RIGHT_SHIFT_IS_UNSIGNED 0)
|
||||||
|
else()
|
||||||
|
include(CheckCSourceRuns)
|
||||||
|
check_c_source_runs("
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
int is_shifting_signed (long arg) {
|
||||||
|
long res = arg >> 4;
|
||||||
|
if (res == -0x7F7E80CL)
|
||||||
|
return 1; /* right shift is signed */
|
||||||
|
/* see if unsigned-shift hack will fix it. */
|
||||||
|
/* we can't just test exact value since it depends on width of long... */
|
||||||
|
res |= (~0L) << (32-4);
|
||||||
|
if (res == -0x7F7E80CL)
|
||||||
|
return 0; /* right shift is unsigned */
|
||||||
|
printf(\"Right shift isn't acting as I expect it to.\\\\n\");
|
||||||
|
printf(\"I fear the JPEG software will not work at all.\\\\n\\\\n\");
|
||||||
|
return 0; /* try it with unsigned anyway */
|
||||||
|
}
|
||||||
|
int main (void) {
|
||||||
|
exit(is_shifting_signed(-0x7F7E80B1L));
|
||||||
|
}" RIGHT_SHIFT_IS_UNSIGNED)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
set(INLINE_OPTIONS "__inline;inline")
|
||||||
|
else()
|
||||||
|
set(INLINE_OPTIONS "__inline__;inline")
|
||||||
|
endif()
|
||||||
|
option(FORCE_INLINE "Force function inlining" TRUE)
|
||||||
|
boolean_number(FORCE_INLINE)
|
||||||
|
if(FORCE_INLINE)
|
||||||
|
if(MSVC)
|
||||||
|
list(INSERT INLINE_OPTIONS 0 "__forceinline")
|
||||||
|
else()
|
||||||
|
list(INSERT INLINE_OPTIONS 0 "inline __attribute__((always_inline))")
|
||||||
|
list(INSERT INLINE_OPTIONS 0 "__inline__ __attribute__((always_inline))")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
foreach(inline ${INLINE_OPTIONS})
|
||||||
|
check_c_source_compiles("${inline} static int foo(void) { return 0; } int main(void) { return foo(); }"
|
||||||
|
INLINE_WORKS)
|
||||||
|
if(INLINE_WORKS)
|
||||||
|
set(INLINE ${inline})
|
||||||
|
break()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
if(NOT INLINE_WORKS)
|
||||||
|
message(FATAL_ERROR "Could not determine how to inline functions.")
|
||||||
|
endif()
|
||||||
|
message(STATUS "INLINE = ${INLINE} (FORCE_INLINE = ${FORCE_INLINE})")
|
||||||
|
|
||||||
|
if(WITH_TURBOJPEG)
|
||||||
|
if(MSVC)
|
||||||
|
set(THREAD_LOCAL "__declspec(thread)")
|
||||||
|
else()
|
||||||
|
set(THREAD_LOCAL "__thread")
|
||||||
|
endif()
|
||||||
|
check_c_source_compiles("${THREAD_LOCAL} int i; int main(void) { i = 0; return i; }" HAVE_THREAD_LOCAL)
|
||||||
|
if(HAVE_THREAD_LOCAL)
|
||||||
|
message(STATUS "THREAD_LOCAL = ${THREAD_LOCAL}")
|
||||||
|
else()
|
||||||
|
message(WARNING "Thread-local storage is not available. The TurboJPEG API library's global error handler will not be thread-safe.")
|
||||||
|
unset(THREAD_LOCAL)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(UNIX AND NOT APPLE)
|
||||||
|
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/conftest.map "VERS_1 { global: *; };")
|
||||||
|
set(CMAKE_REQUIRED_FLAGS
|
||||||
|
"-Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
|
||||||
|
check_c_source_compiles("int main(void) { return 0; }" HAVE_VERSION_SCRIPT)
|
||||||
|
set(CMAKE_REQUIRED_FLAGS)
|
||||||
|
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/conftest.map)
|
||||||
|
if(HAVE_VERSION_SCRIPT)
|
||||||
|
message(STATUS "Linker supports GNU-style version scripts")
|
||||||
|
set(MAPFLAG "-Wl,--version-script,")
|
||||||
|
set(TJMAPFLAG "-Wl,--version-script,")
|
||||||
|
else()
|
||||||
|
message(STATUS "Linker does not support GNU-style version scripts")
|
||||||
|
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
||||||
|
# The Solaris linker doesn't like our version script for the libjpeg API
|
||||||
|
# library, but the version script for the TurboJPEG API library should
|
||||||
|
# still work.
|
||||||
|
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/conftest.map
|
||||||
|
"VERS_1 { global: foo; local: *; }; VERS_2 { global: foo2; } VERS_1;")
|
||||||
|
set(CMAKE_REQUIRED_FLAGS "-Wl,-M,${CMAKE_CURRENT_BINARY_DIR}/conftest.map -shared")
|
||||||
|
check_c_source_compiles("int foo() { return 0; } int foo2() { return 2; }"
|
||||||
|
HAVE_MAPFILE)
|
||||||
|
set(CMAKE_REQUIRED_FLAGS)
|
||||||
|
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/conftest.map)
|
||||||
|
if(HAVE_MAPFILE)
|
||||||
|
message(STATUS "Linker supports mapfiles")
|
||||||
|
set(TJMAPFLAG "-Wl,-M,")
|
||||||
|
else()
|
||||||
|
message(STATUS "Linker does not support mapfiles")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Generate files
|
||||||
|
if(WIN32)
|
||||||
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/win/jconfig.h.in jconfig.h)
|
||||||
|
else()
|
||||||
|
configure_file(jconfig.h.in jconfig.h)
|
||||||
|
endif()
|
||||||
|
configure_file(jconfigint.h.in jconfigint.h)
|
||||||
|
configure_file(jversion.h.in jversion.h)
|
||||||
|
if(UNIX)
|
||||||
|
configure_file(libjpeg.map.in libjpeg.map)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Include directories and compiler definitions
|
||||||
|
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# TARGETS
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
if(CMAKE_EXECUTABLE_SUFFIX_TMP)
|
||||||
|
set(CMAKE_EXECUTABLE_SUFFIX ${CMAKE_EXECUTABLE_SUFFIX_TMP})
|
||||||
|
endif()
|
||||||
|
message(STATUS "CMAKE_EXECUTABLE_SUFFIX = ${CMAKE_EXECUTABLE_SUFFIX}")
|
||||||
|
|
||||||
|
set(JPEG_SOURCES jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c
|
||||||
|
jcicc.c jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c
|
||||||
|
jcphuff.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c jdatadst.c
|
||||||
|
jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdicc.c jdinput.c
|
||||||
|
jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c
|
||||||
|
jdtrans.c jerror.c jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c
|
||||||
|
jidctint.c jidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c)
|
||||||
|
|
||||||
|
if(WITH_ARITH_ENC OR WITH_ARITH_DEC)
|
||||||
|
set(JPEG_SOURCES ${JPEG_SOURCES} jaricom.c)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WITH_ARITH_ENC)
|
||||||
|
set(JPEG_SOURCES ${JPEG_SOURCES} jcarith.c)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WITH_ARITH_DEC)
|
||||||
|
set(JPEG_SOURCES ${JPEG_SOURCES} jdarith.c)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WITH_SIMD)
|
||||||
|
add_subdirectory(simd)
|
||||||
|
if(NEON_INTRINSICS)
|
||||||
|
add_definitions(-DNEON_INTRINSICS)
|
||||||
|
endif()
|
||||||
|
elseif(NOT WITH_12BIT)
|
||||||
|
message(STATUS "SIMD extensions: None (WITH_SIMD = ${WITH_SIMD})")
|
||||||
|
endif()
|
||||||
|
if(WITH_SIMD)
|
||||||
|
message(STATUS "SIMD extensions: ${CPU_TYPE} (WITH_SIMD = ${WITH_SIMD})")
|
||||||
|
if(MSVC_IDE OR XCODE)
|
||||||
|
set_source_files_properties(${SIMD_OBJS} PROPERTIES GENERATED 1)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
add_library(simd OBJECT jsimd_none.c)
|
||||||
|
if(NOT WIN32 AND (CMAKE_POSITION_INDEPENDENT_CODE OR ENABLE_SHARED))
|
||||||
|
set_target_properties(simd PROPERTIES POSITION_INDEPENDENT_CODE 1)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WITH_JAVA)
|
||||||
|
add_subdirectory(java)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_SHARED)
|
||||||
|
add_subdirectory(sharedlib)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_STATIC)
|
||||||
|
add_library(jpeg-static STATIC ${JPEG_SOURCES} $<TARGET_OBJECTS:simd>
|
||||||
|
${SIMD_OBJS})
|
||||||
|
if(NOT MSVC)
|
||||||
|
set_target_properties(jpeg-static PROPERTIES OUTPUT_NAME jpeg)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WITH_TURBOJPEG)
|
||||||
|
if(ENABLE_SHARED)
|
||||||
|
set(TURBOJPEG_SOURCES ${JPEG_SOURCES} $<TARGET_OBJECTS:simd> ${SIMD_OBJS}
|
||||||
|
turbojpeg.c transupp.c jdatadst-tj.c jdatasrc-tj.c rdbmp.c rdppm.c
|
||||||
|
wrbmp.c wrppm.c)
|
||||||
|
set(TJMAPFILE ${CMAKE_CURRENT_SOURCE_DIR}/turbojpeg-mapfile)
|
||||||
|
if(WITH_JAVA)
|
||||||
|
set(TURBOJPEG_SOURCES ${TURBOJPEG_SOURCES} turbojpeg-jni.c)
|
||||||
|
include_directories(${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
|
||||||
|
set(TJMAPFILE ${CMAKE_CURRENT_SOURCE_DIR}/turbojpeg-mapfile.jni)
|
||||||
|
endif()
|
||||||
|
if(MSVC)
|
||||||
|
configure_file(${CMAKE_SOURCE_DIR}/win/turbojpeg.rc.in
|
||||||
|
${CMAKE_BINARY_DIR}/win/turbojpeg.rc)
|
||||||
|
set(TURBOJPEG_SOURCES ${TURBOJPEG_SOURCES}
|
||||||
|
${CMAKE_BINARY_DIR}/win/turbojpeg.rc)
|
||||||
|
endif()
|
||||||
|
add_library(turbojpeg SHARED ${TURBOJPEG_SOURCES})
|
||||||
|
set_property(TARGET turbojpeg PROPERTY COMPILE_FLAGS
|
||||||
|
"-DBMP_SUPPORTED -DPPM_SUPPORTED")
|
||||||
|
if(WIN32)
|
||||||
|
set_target_properties(turbojpeg PROPERTIES DEFINE_SYMBOL DLLDEFINE)
|
||||||
|
endif()
|
||||||
|
if(MINGW)
|
||||||
|
set_target_properties(turbojpeg PROPERTIES LINK_FLAGS -Wl,--kill-at)
|
||||||
|
endif()
|
||||||
|
if(APPLE AND (NOT CMAKE_OSX_DEPLOYMENT_TARGET OR
|
||||||
|
CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER 10.4))
|
||||||
|
if(NOT CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG)
|
||||||
|
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
|
||||||
|
endif()
|
||||||
|
set_target_properties(turbojpeg PROPERTIES MACOSX_RPATH 1)
|
||||||
|
endif()
|
||||||
|
set_target_properties(turbojpeg PROPERTIES
|
||||||
|
SOVERSION ${TURBOJPEG_SO_MAJOR_VERSION} VERSION ${TURBOJPEG_SO_VERSION})
|
||||||
|
if(TJMAPFLAG)
|
||||||
|
set_target_properties(turbojpeg PROPERTIES
|
||||||
|
LINK_FLAGS "${TJMAPFLAG}${TJMAPFILE}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_STATIC)
|
||||||
|
add_library(turbojpeg-static STATIC ${JPEG_SOURCES} $<TARGET_OBJECTS:simd>
|
||||||
|
${SIMD_OBJS} turbojpeg.c transupp.c jdatadst-tj.c jdatasrc-tj.c rdbmp.c
|
||||||
|
rdppm.c wrbmp.c wrppm.c)
|
||||||
|
set_property(TARGET turbojpeg-static PROPERTY COMPILE_FLAGS
|
||||||
|
"-DBMP_SUPPORTED -DPPM_SUPPORTED")
|
||||||
|
if(NOT MSVC)
|
||||||
|
set_target_properties(turbojpeg-static PROPERTIES OUTPUT_NAME turbojpeg)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set(USE_SETMODE "-DUSE_SETMODE")
|
||||||
|
endif()
|
||||||
|
if(WITH_12BIT)
|
||||||
|
set(COMPILE_FLAGS "-DGIF_SUPPORTED -DPPM_SUPPORTED ${USE_SETMODE}")
|
||||||
|
else()
|
||||||
|
set(COMPILE_FLAGS "-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED ${USE_SETMODE}")
|
||||||
|
set(CJPEG_BMP_SOURCES rdbmp.c rdtarga.c)
|
||||||
|
set(DJPEG_BMP_SOURCES wrbmp.c wrtarga.c)
|
||||||
|
endif()
|
||||||
741
cmake/CMakeLists.png
Normal file
741
cmake/CMakeLists.png
Normal file
@ -0,0 +1,741 @@
|
|||||||
|
# CMakeLists.txt
|
||||||
|
|
||||||
|
# Copyright (C) 2018 Cosmin Truta
|
||||||
|
# Copyright (C) 2007,2009-2018 Glenn Randers-Pehrson
|
||||||
|
# Written by Christian Ehrlicher, 2007
|
||||||
|
# Revised by Roger Lowman, 2009-2010
|
||||||
|
# Revised by Clifford Yapp, 2011-2012,2017
|
||||||
|
# Revised by Roger Leigh, 2016
|
||||||
|
# Revised by Andreas Franek, 2016
|
||||||
|
# Revised by Sam Serrels, 2017
|
||||||
|
# Revised by Vadim Barkov, 2017
|
||||||
|
# Revised by Vicky Pfau, 2018
|
||||||
|
# Revised by Cameron Cawley, 2018
|
||||||
|
# Revised by Cosmin Truta, 2018
|
||||||
|
# Revised by Kyle Bentley, 2018
|
||||||
|
|
||||||
|
# This code is released under the libpng license.
|
||||||
|
# For conditions of distribution and use, see the disclaimer
|
||||||
|
# and license in png.h
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
cmake_policy(VERSION 3.1)
|
||||||
|
# When using CMake 3.4 and later, don't export symbols from executables unless
|
||||||
|
# the CMAKE_ENABLE_EXPORTS variable is set.
|
||||||
|
if(POLICY CMP0065)
|
||||||
|
cmake_policy(SET CMP0065 NEW)
|
||||||
|
endif()
|
||||||
|
if (POLICY CMP0077)
|
||||||
|
cmake_policy(SET CMP0077 NEW)
|
||||||
|
endif()
|
||||||
|
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
|
||||||
|
|
||||||
|
project(libpng C ASM)
|
||||||
|
enable_testing()
|
||||||
|
|
||||||
|
set(PNGLIB_MAJOR 1)
|
||||||
|
set(PNGLIB_MINOR 6)
|
||||||
|
set(PNGLIB_RELEASE 37)
|
||||||
|
set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR})
|
||||||
|
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE})
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
|
# needed packages
|
||||||
|
|
||||||
|
# Allow users to specify location of Zlib.
|
||||||
|
# Useful if zlib is being built alongside this as a sub-project.
|
||||||
|
option(PNG_BUILD_ZLIB "Custom zlib Location, else find_package is used" ON)
|
||||||
|
|
||||||
|
if(NOT PNG_BUILD_ZLIB)
|
||||||
|
find_package(ZLIB REQUIRED)
|
||||||
|
include_directories(${ZLIB_INCLUDE_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU)
|
||||||
|
find_library(M_LIBRARY m)
|
||||||
|
else()
|
||||||
|
# libm is not needed and/or not available
|
||||||
|
set(M_LIBRARY "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# COMMAND LINE OPTIONS
|
||||||
|
option(PNG_SHARED "Build shared lib" OFF)
|
||||||
|
option(PNG_STATIC "Build static lib" ON)
|
||||||
|
option(PNG_TESTS "Build libpng tests" OFF)
|
||||||
|
|
||||||
|
# Many more configuration options could be added here
|
||||||
|
option(PNG_FRAMEWORK "Build OS X framework" OFF)
|
||||||
|
option(PNG_DEBUG "Build with debug output" OFF)
|
||||||
|
option(PNG_HARDWARE_OPTIMIZATIONS "Enable hardware optimizations" OFF)
|
||||||
|
|
||||||
|
set(PNG_PREFIX "" CACHE STRING "Prefix to add to the API function names")
|
||||||
|
set(DFA_XTRA "" CACHE FILEPATH "File containing extra configuration settings")
|
||||||
|
|
||||||
|
if(PNG_HARDWARE_OPTIMIZATIONS)
|
||||||
|
|
||||||
|
# set definitions and sources for arm
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" OR
|
||||||
|
CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64")
|
||||||
|
set(PNG_ARM_NEON_POSSIBLE_VALUES check on off)
|
||||||
|
set(PNG_ARM_NEON "check" CACHE STRING "Enable ARM NEON optimizations:
|
||||||
|
check: (default) use internal checking code;
|
||||||
|
off: disable the optimizations;
|
||||||
|
on: turn on unconditionally.")
|
||||||
|
set_property(CACHE PNG_ARM_NEON PROPERTY STRINGS
|
||||||
|
${PNG_ARM_NEON_POSSIBLE_VALUES})
|
||||||
|
list(FIND PNG_ARM_NEON_POSSIBLE_VALUES ${PNG_ARM_NEON} index)
|
||||||
|
if(index EQUAL -1)
|
||||||
|
message(FATAL_ERROR
|
||||||
|
"PNG_ARM_NEON must be one of [${PNG_ARM_NEON_POSSIBLE_VALUES}]")
|
||||||
|
elseif(NOT ${PNG_ARM_NEON} STREQUAL "off")
|
||||||
|
set(libpng_arm_sources
|
||||||
|
arm/arm_init.c
|
||||||
|
arm/filter_neon.S
|
||||||
|
arm/filter_neon_intrinsics.c
|
||||||
|
arm/palette_neon_intrinsics.c)
|
||||||
|
|
||||||
|
if(${PNG_ARM_NEON} STREQUAL "on")
|
||||||
|
add_definitions(-DPNG_ARM_NEON_OPT=2)
|
||||||
|
elseif(${PNG_ARM_NEON} STREQUAL "check")
|
||||||
|
add_definitions(-DPNG_ARM_NEON_CHECK_SUPPORTED)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
add_definitions(-DPNG_ARM_NEON_OPT=0)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# set definitions and sources for powerpc
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^powerpc*" OR
|
||||||
|
CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc64*")
|
||||||
|
set(PNG_POWERPC_VSX_POSSIBLE_VALUES on off)
|
||||||
|
set(PNG_POWERPC_VSX "on" CACHE STRING "Enable POWERPC VSX optimizations:
|
||||||
|
off: disable the optimizations.")
|
||||||
|
set_property(CACHE PNG_POWERPC_VSX PROPERTY STRINGS
|
||||||
|
${PNG_POWERPC_VSX_POSSIBLE_VALUES})
|
||||||
|
list(FIND PNG_POWERPC_VSX_POSSIBLE_VALUES ${PNG_POWERPC_VSX} index)
|
||||||
|
if(index EQUAL -1)
|
||||||
|
message(FATAL_ERROR
|
||||||
|
"PNG_POWERPC_VSX must be one of [${PNG_POWERPC_VSX_POSSIBLE_VALUES}]")
|
||||||
|
elseif(NOT ${PNG_POWERPC_VSX} STREQUAL "off")
|
||||||
|
set(libpng_powerpc_sources
|
||||||
|
powerpc/powerpc_init.c
|
||||||
|
powerpc/filter_vsx_intrinsics.c)
|
||||||
|
if(${PNG_POWERPC_VSX} STREQUAL "on")
|
||||||
|
add_definitions(-DPNG_POWERPC_VSX_OPT=2)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
add_definitions(-DPNG_POWERPC_VSX_OPT=0)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# set definitions and sources for intel
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i?86" OR
|
||||||
|
CMAKE_SYSTEM_PROCESSOR MATCHES "^x86_64*")
|
||||||
|
set(PNG_INTEL_SSE_POSSIBLE_VALUES on off)
|
||||||
|
set(PNG_INTEL_SSE "on" CACHE STRING "Enable INTEL_SSE optimizations:
|
||||||
|
off: disable the optimizations")
|
||||||
|
set_property(CACHE PNG_INTEL_SSE PROPERTY STRINGS
|
||||||
|
${PNG_INTEL_SSE_POSSIBLE_VALUES})
|
||||||
|
list(FIND PNG_INTEL_SSE_POSSIBLE_VALUES ${PNG_INTEL_SSE} index)
|
||||||
|
if(index EQUAL -1)
|
||||||
|
message(FATAL_ERROR
|
||||||
|
"PNG_INTEL_SSE must be one of [${PNG_INTEL_SSE_POSSIBLE_VALUES}]")
|
||||||
|
elseif(NOT ${PNG_INTEL_SSE} STREQUAL "off")
|
||||||
|
set(libpng_intel_sources
|
||||||
|
intel/intel_init.c
|
||||||
|
intel/filter_sse2_intrinsics.c)
|
||||||
|
if(${PNG_INTEL_SSE} STREQUAL "on")
|
||||||
|
add_definitions(-DPNG_INTEL_SSE_OPT=1)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
add_definitions(-DPNG_INTEL_SSE_OPT=0)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# set definitions and sources for MIPS
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "mipsel*" OR
|
||||||
|
CMAKE_SYSTEM_PROCESSOR MATCHES "mips64el*")
|
||||||
|
set(PNG_MIPS_MSA_POSSIBLE_VALUES on off)
|
||||||
|
set(PNG_MIPS_MSA "on" CACHE STRING "Enable MIPS_MSA optimizations:
|
||||||
|
off: disable the optimizations")
|
||||||
|
set_property(CACHE PNG_MIPS_MSA PROPERTY STRINGS
|
||||||
|
${PNG_MIPS_MSA_POSSIBLE_VALUES})
|
||||||
|
list(FIND PNG_MIPS_MSA_POSSIBLE_VALUES ${PNG_MIPS_MSA} index)
|
||||||
|
if(index EQUAL -1)
|
||||||
|
message(FATAL_ERROR
|
||||||
|
"PNG_MIPS_MSA must be one of [${PNG_MIPS_MSA_POSSIBLE_VALUES}]")
|
||||||
|
elseif(NOT ${PNG_MIPS_MSA} STREQUAL "off")
|
||||||
|
set(libpng_mips_sources
|
||||||
|
mips/mips_init.c
|
||||||
|
mips/filter_msa_intrinsics.c)
|
||||||
|
if(${PNG_MIPS_MSA} STREQUAL "on")
|
||||||
|
add_definitions(-DPNG_MIPS_MSA_OPT=2)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
add_definitions(-DPNG_MIPS_MSA_OPT=0)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
else(PNG_HARDWARE_OPTIMIZATIONS)
|
||||||
|
|
||||||
|
# set definitions and sources for arm
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" OR
|
||||||
|
CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64")
|
||||||
|
add_definitions(-DPNG_ARM_NEON_OPT=0)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# set definitions and sources for powerpc
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^powerpc*" OR
|
||||||
|
CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc64*")
|
||||||
|
add_definitions(-DPNG_POWERPC_VSX_OPT=0)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# set definitions and sources for intel
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i?86" OR
|
||||||
|
CMAKE_SYSTEM_PROCESSOR MATCHES "^x86_64*")
|
||||||
|
add_definitions(-DPNG_INTEL_SSE_OPT=0)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# set definitions and sources for MIPS
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "mipsel*" OR
|
||||||
|
CMAKE_SYSTEM_PROCESSOR MATCHES "mips64el*")
|
||||||
|
add_definitions(-DPNG_MIPS_MSA_OPT=0)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
endif(PNG_HARDWARE_OPTIMIZATIONS)
|
||||||
|
|
||||||
|
# SET LIBNAME
|
||||||
|
set(PNG_LIB_NAME png${PNGLIB_MAJOR}${PNGLIB_MINOR})
|
||||||
|
|
||||||
|
# to distinguish between debug and release lib
|
||||||
|
set(CMAKE_DEBUG_POSTFIX "d")
|
||||||
|
|
||||||
|
include(CheckCSourceCompiles)
|
||||||
|
option(ld-version-script "Enable linker version script" ON)
|
||||||
|
if(ld-version-script AND NOT APPLE)
|
||||||
|
# Check if LD supports linker scripts.
|
||||||
|
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map" "VERS_1 {
|
||||||
|
global: sym;
|
||||||
|
local: *;
|
||||||
|
};
|
||||||
|
|
||||||
|
VERS_2 {
|
||||||
|
global: sym2;
|
||||||
|
main;
|
||||||
|
} VERS_1;
|
||||||
|
")
|
||||||
|
set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
|
||||||
|
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/conftest.map'")
|
||||||
|
check_c_source_compiles("void sym(void) {}
|
||||||
|
void sym2(void) {}
|
||||||
|
int main(void) {return 0;}
|
||||||
|
" HAVE_LD_VERSION_SCRIPT)
|
||||||
|
if(NOT HAVE_LD_VERSION_SCRIPT)
|
||||||
|
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE} "-Wl,-M -Wl,${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
|
||||||
|
check_c_source_compiles("void sym(void) {}
|
||||||
|
void sym2(void) {}
|
||||||
|
int main(void) {return 0;}
|
||||||
|
" HAVE_SOLARIS_LD_VERSION_SCRIPT)
|
||||||
|
endif()
|
||||||
|
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE})
|
||||||
|
file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Find symbol prefix. Likely obsolete and unnecessary with recent
|
||||||
|
# toolchains (it's not done in many other projects).
|
||||||
|
function(symbol_prefix)
|
||||||
|
set(SYMBOL_PREFIX)
|
||||||
|
|
||||||
|
execute_process(COMMAND "${CMAKE_C_COMPILER}" "-E" "-"
|
||||||
|
INPUT_FILE /dev/null
|
||||||
|
OUTPUT_VARIABLE OUT
|
||||||
|
RESULT_VARIABLE STATUS)
|
||||||
|
|
||||||
|
if(CPP_FAIL)
|
||||||
|
message(WARNING "Failed to run the C preprocessor")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
string(REPLACE "\n" ";" OUT "${OUT}")
|
||||||
|
foreach(line ${OUT})
|
||||||
|
string(REGEX MATCH "^PREFIX=" found_match "${line}")
|
||||||
|
if(found_match)
|
||||||
|
string(REGEX REPLACE "^PREFIX=(.*\)" "\\1" prefix "${line}")
|
||||||
|
string(REGEX MATCH "__USER_LABEL_PREFIX__" found_match "${prefix}")
|
||||||
|
if(found_match)
|
||||||
|
string(REGEX REPLACE "(.*)__USER_LABEL_PREFIX__(.*)" "\\1\\2" prefix "${prefix}")
|
||||||
|
endif()
|
||||||
|
set(SYMBOL_PREFIX "${prefix}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
message(STATUS "Symbol prefix: ${SYMBOL_PREFIX}")
|
||||||
|
set(SYMBOL_PREFIX "${SYMBOL_PREFIX}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
if(UNIX)
|
||||||
|
symbol_prefix()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_program(AWK NAMES gawk awk)
|
||||||
|
|
||||||
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
|
if(NOT AWK OR ANDROID)
|
||||||
|
# No awk available to generate sources; use pre-built pnglibconf.h
|
||||||
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h)
|
||||||
|
add_custom_target(genfiles) # Dummy
|
||||||
|
else()
|
||||||
|
include(CMakeParseArguments)
|
||||||
|
# Generate .chk from .out with awk
|
||||||
|
# generate_chk(INPUT inputfile OUTPUT outputfile [DEPENDS dep1 [dep2...]])
|
||||||
|
function(generate_chk)
|
||||||
|
set(options)
|
||||||
|
set(oneValueArgs INPUT OUTPUT)
|
||||||
|
set(multiValueArgs DEPENDS)
|
||||||
|
cmake_parse_arguments(_GC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||||
|
if(NOT _GC_INPUT)
|
||||||
|
message(FATAL_ERROR "generate_chk: Missing INPUT argument")
|
||||||
|
endif()
|
||||||
|
if(NOT _GC_OUTPUT)
|
||||||
|
message(FATAL_ERROR "generate_chk: Missing OUTPUT argument")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_custom_command(OUTPUT "${_GC_OUTPUT}"
|
||||||
|
COMMAND "${CMAKE_COMMAND}"
|
||||||
|
"-DINPUT=${_GC_INPUT}"
|
||||||
|
"-DOUTPUT=${_GC_OUTPUT}"
|
||||||
|
-P "${CMAKE_CURRENT_BINARY_DIR}/scripts/genchk.cmake"
|
||||||
|
DEPENDS "${_GC_INPUT}" ${_GC_DEPENDS}
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# Generate .out from .c with awk
|
||||||
|
# generate_out(INPUT inputfile OUTPUT outputfile [DEPENDS dep1 [dep2...]])
|
||||||
|
function(generate_out)
|
||||||
|
set(options)
|
||||||
|
set(oneValueArgs INPUT OUTPUT)
|
||||||
|
set(multiValueArgs DEPENDS)
|
||||||
|
cmake_parse_arguments(_GO "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||||
|
if(NOT _GO_INPUT)
|
||||||
|
message(FATAL_ERROR "generate_out: Missing INPUT argument")
|
||||||
|
endif()
|
||||||
|
if(NOT _GO_OUTPUT)
|
||||||
|
message(FATAL_ERROR "generate_out: Missing OUTPUT argument")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_custom_command(OUTPUT "${_GO_OUTPUT}"
|
||||||
|
COMMAND "${CMAKE_COMMAND}"
|
||||||
|
"-DINPUT=${_GO_INPUT}"
|
||||||
|
"-DOUTPUT=${_GO_OUTPUT}"
|
||||||
|
-P "${CMAKE_CURRENT_BINARY_DIR}/scripts/genout.cmake"
|
||||||
|
DEPENDS "${_GO_INPUT}" ${_GO_DEPENDS}
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# Generate specific source file with awk
|
||||||
|
# generate_source(OUTPUT outputfile [DEPENDS dep1 [dep2...]])
|
||||||
|
function(generate_source)
|
||||||
|
set(options)
|
||||||
|
set(oneValueArgs OUTPUT)
|
||||||
|
set(multiValueArgs DEPENDS)
|
||||||
|
cmake_parse_arguments(_GSO "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||||
|
if(NOT _GSO_OUTPUT)
|
||||||
|
message(FATAL_ERROR "generate_source: Missing OUTPUT argument")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_GSO_OUTPUT}"
|
||||||
|
COMMAND "${CMAKE_COMMAND}"
|
||||||
|
"-DOUTPUT=${_GSO_OUTPUT}"
|
||||||
|
-P "${CMAKE_CURRENT_BINARY_DIR}/scripts/gensrc.cmake"
|
||||||
|
DEPENDS ${_GSO_DEPENDS}
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# Copy file
|
||||||
|
function(generate_copy source destination)
|
||||||
|
add_custom_command(OUTPUT "${destination}"
|
||||||
|
COMMAND "${CMAKE_COMMAND}" -E remove "${destination}"
|
||||||
|
COMMAND "${CMAKE_COMMAND}" -E copy "${source}"
|
||||||
|
"${destination}"
|
||||||
|
DEPENDS "${source}")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# Generate scripts/pnglibconf.h
|
||||||
|
generate_source(OUTPUT "scripts/pnglibconf.c"
|
||||||
|
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.dfa"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/options.awk"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h")
|
||||||
|
|
||||||
|
# Generate pnglibconf.c
|
||||||
|
generate_source(OUTPUT "pnglibconf.c"
|
||||||
|
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.dfa"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/options.awk"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h")
|
||||||
|
|
||||||
|
if(PNG_PREFIX)
|
||||||
|
set(PNGLIBCONF_H_EXTRA_DEPENDS
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/macro.lst")
|
||||||
|
set(PNGPREFIX_H_EXTRA_DEPENDS
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
generate_out(INPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c"
|
||||||
|
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out")
|
||||||
|
|
||||||
|
# Generate pnglibconf.h
|
||||||
|
generate_source(OUTPUT "pnglibconf.h"
|
||||||
|
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
|
||||||
|
${PNGLIBCONF_H_EXTRA_DEPENDS})
|
||||||
|
|
||||||
|
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/intprefix.c"
|
||||||
|
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out"
|
||||||
|
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
|
||||||
|
|
||||||
|
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/prefix.c"
|
||||||
|
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out"
|
||||||
|
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out")
|
||||||
|
|
||||||
|
# Generate pngprefix.h
|
||||||
|
generate_source(OUTPUT "pngprefix.h"
|
||||||
|
DEPENDS ${PNGPREFIX_H_EXTRA_DEPENDS})
|
||||||
|
|
||||||
|
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/sym.c"
|
||||||
|
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
|
||||||
|
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
|
||||||
|
|
||||||
|
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/symbols.c"
|
||||||
|
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out"
|
||||||
|
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt")
|
||||||
|
|
||||||
|
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/vers.c"
|
||||||
|
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out"
|
||||||
|
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
|
||||||
|
|
||||||
|
generate_chk(INPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out"
|
||||||
|
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk"
|
||||||
|
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/checksym.awk"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/symbols.def")
|
||||||
|
|
||||||
|
add_custom_target(symbol-check DEPENDS
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk")
|
||||||
|
|
||||||
|
generate_copy("${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/libpng.sym")
|
||||||
|
generate_copy("${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/libpng.vers")
|
||||||
|
|
||||||
|
add_custom_target(genvers DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.vers")
|
||||||
|
add_custom_target(gensym DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym")
|
||||||
|
|
||||||
|
add_custom_target("genprebuilt"
|
||||||
|
COMMAND "${CMAKE_COMMAND}"
|
||||||
|
"-DOUTPUT=scripts/pnglibconf.h.prebuilt"
|
||||||
|
-P "${CMAKE_CURRENT_BINARY_DIR}/scripts/gensrc.cmake"
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
|
|
||||||
|
# A single target handles generation of all generated files. If
|
||||||
|
# they are depended upon separately by multiple targets, this
|
||||||
|
# confuses parallel make (it would require a separate top-level
|
||||||
|
# target for each file to track the dependencies properly).
|
||||||
|
add_custom_target(genfiles DEPENDS
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/libpng.sym"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/libpng.vers"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/scripts/pnglibconf.c"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out")
|
||||||
|
endif(NOT AWK OR ANDROID)
|
||||||
|
|
||||||
|
# OUR SOURCES
|
||||||
|
set(libpng_public_hdrs
|
||||||
|
png.h
|
||||||
|
pngconf.h
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
|
||||||
|
)
|
||||||
|
set(libpng_private_hdrs
|
||||||
|
pngpriv.h
|
||||||
|
pngdebug.h
|
||||||
|
pnginfo.h
|
||||||
|
pngstruct.h
|
||||||
|
)
|
||||||
|
if(AWK AND NOT ANDROID)
|
||||||
|
list(APPEND libpng_private_hdrs "${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h")
|
||||||
|
endif()
|
||||||
|
set(libpng_sources
|
||||||
|
${libpng_public_hdrs}
|
||||||
|
${libpng_private_hdrs}
|
||||||
|
png.c
|
||||||
|
pngerror.c
|
||||||
|
pngget.c
|
||||||
|
pngmem.c
|
||||||
|
pngpread.c
|
||||||
|
pngread.c
|
||||||
|
pngrio.c
|
||||||
|
pngrtran.c
|
||||||
|
pngrutil.c
|
||||||
|
pngset.c
|
||||||
|
pngtrans.c
|
||||||
|
pngwio.c
|
||||||
|
pngwrite.c
|
||||||
|
pngwtran.c
|
||||||
|
pngwutil.c
|
||||||
|
${libpng_arm_sources}
|
||||||
|
${libpng_intel_sources}
|
||||||
|
${libpng_mips_sources}
|
||||||
|
${libpng_powerpc_sources}
|
||||||
|
)
|
||||||
|
set(pngtest_sources
|
||||||
|
pngtest.c
|
||||||
|
)
|
||||||
|
set(pngvalid_sources
|
||||||
|
contrib/libtests/pngvalid.c
|
||||||
|
)
|
||||||
|
set(pngstest_sources
|
||||||
|
contrib/libtests/pngstest.c
|
||||||
|
)
|
||||||
|
set(pngunknown_sources
|
||||||
|
contrib/libtests/pngunknown.c
|
||||||
|
)
|
||||||
|
set(pngimage_sources
|
||||||
|
contrib/libtests/pngimage.c
|
||||||
|
)
|
||||||
|
set(pngfix_sources
|
||||||
|
contrib/tools/pngfix.c
|
||||||
|
)
|
||||||
|
set(png_fix_itxt_sources
|
||||||
|
contrib/tools/png-fix-itxt.c
|
||||||
|
)
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(PNG_DEBUG)
|
||||||
|
add_definitions(-DPNG_DEBUG)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# NOW BUILD OUR TARGET
|
||||||
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIR})
|
||||||
|
|
||||||
|
unset(PNG_LIB_TARGETS)
|
||||||
|
|
||||||
|
if(PNG_STATIC)
|
||||||
|
# does not work without changing name
|
||||||
|
set(PNG_LIB_NAME_STATIC png_static)
|
||||||
|
add_library(png_static STATIC ${libpng_sources})
|
||||||
|
add_dependencies(png_static genfiles)
|
||||||
|
# MSVC doesn't use a different file extension for shared vs. static
|
||||||
|
# libs. We are able to change OUTPUT_NAME to remove the _static
|
||||||
|
# for all other platforms.
|
||||||
|
if(NOT MSVC)
|
||||||
|
set_target_properties(png_static PROPERTIES
|
||||||
|
OUTPUT_NAME "${PNG_LIB_NAME}"
|
||||||
|
CLEAN_DIRECT_OUTPUT 1)
|
||||||
|
else()
|
||||||
|
set_target_properties(png_static PROPERTIES
|
||||||
|
OUTPUT_NAME "${PNG_LIB_NAME}_static"
|
||||||
|
CLEAN_DIRECT_OUTPUT 1)
|
||||||
|
endif()
|
||||||
|
list(APPEND PNG_LIB_TARGETS png_static)
|
||||||
|
if(MSVC)
|
||||||
|
# msvc does not append 'lib' - do it here to have consistent name
|
||||||
|
set_target_properties(png_static PROPERTIES PREFIX "lib")
|
||||||
|
endif()
|
||||||
|
target_link_libraries(png_static ${M_LIBRARY})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT PNG_LIB_TARGETS)
|
||||||
|
message(SEND_ERROR
|
||||||
|
"No library variant selected to build. "
|
||||||
|
"Please enable at least one of the following options: "
|
||||||
|
"PNG_STATIC, PNG_SHARED, PNG_FRAMEWORK")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Set a variable with CMake code which:
|
||||||
|
# Creates a symlink from src to dest (if possible) or alternatively
|
||||||
|
# copies if different.
|
||||||
|
include(CMakeParseArguments)
|
||||||
|
|
||||||
|
function(create_symlink DEST_FILE)
|
||||||
|
|
||||||
|
cmake_parse_arguments(S "" "FILE;TARGET" "" ${ARGN})
|
||||||
|
|
||||||
|
if(NOT S_TARGET AND NOT S_FILE)
|
||||||
|
message(FATAL_ERROR "create_symlink: Missing TARGET or FILE argument")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(S_TARGET AND S_FILE)
|
||||||
|
message(FATAL_ERROR "create_symlink: Both source file ${S_FILE} and build target ${S_TARGET} arguments are present; can only have one.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(S_FILE)
|
||||||
|
# If we don't need to symlink something that's coming from a build target,
|
||||||
|
# we can go ahead and symlink/copy at configure time.
|
||||||
|
if(CMAKE_HOST_WIN32 AND NOT CYGWIN)
|
||||||
|
execute_process(
|
||||||
|
COMMAND "${CMAKE_COMMAND}" -E copy_if_different ${S_FILE} ${DEST_FILE}
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
|
else()
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E create_symlink ${S_FILE} ${DEST_FILE}
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(S_TARGET)
|
||||||
|
# We need to use generator expressions, which can be a bit tricky, so for
|
||||||
|
# simplicity make the symlink a POST_BUILD step and use the TARGET
|
||||||
|
# signature of add_custom_command.
|
||||||
|
if(CMAKE_HOST_WIN32 AND NOT CYGWIN)
|
||||||
|
add_custom_command(TARGET ${S_TARGET} POST_BUILD
|
||||||
|
COMMAND "${CMAKE_COMMAND}" -E copy_if_different $<TARGET_LINKER_FILE_NAME:${S_TARGET}> $<TARGET_LINKER_FILE_DIR:${S_TARGET}>/${DEST_FILE})
|
||||||
|
else()
|
||||||
|
add_custom_command(TARGET ${S_TARGET} POST_BUILD
|
||||||
|
COMMAND "${CMAKE_COMMAND}" -E create_symlink $<TARGET_LINKER_FILE_NAME:${S_TARGET}> $<TARGET_LINKER_FILE_DIR:${S_TARGET}>/${DEST_FILE})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# Create source generation scripts.
|
||||||
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/genchk.cmake.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/scripts/genchk.cmake @ONLY)
|
||||||
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/genout.cmake.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/scripts/genout.cmake @ONLY)
|
||||||
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/gensrc.cmake.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/scripts/gensrc.cmake @ONLY)
|
||||||
|
|
||||||
|
# libpng is a library so default to 'lib'
|
||||||
|
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
|
||||||
|
set(CMAKE_INSTALL_LIBDIR lib)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# CREATE PKGCONFIG FILES
|
||||||
|
# We use the same files like ./configure, so we have to set its vars.
|
||||||
|
# Only do this on Windows for Cygwin - the files don't make much sense outside
|
||||||
|
# of a UNIX look-alike.
|
||||||
|
if(NOT WIN32 OR CYGWIN OR MINGW)
|
||||||
|
set(prefix ${CMAKE_INSTALL_PREFIX})
|
||||||
|
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
|
||||||
|
set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
|
||||||
|
set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
|
||||||
|
set(LIBS "-lz -lm")
|
||||||
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc @ONLY)
|
||||||
|
create_symlink(libpng.pc FILE ${PNGLIB_NAME}.pc)
|
||||||
|
|
||||||
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config @ONLY)
|
||||||
|
create_symlink(libpng-config FILE ${PNGLIB_NAME}-config)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# SET UP LINKS
|
||||||
|
if(PNG_SHARED)
|
||||||
|
set_target_properties(png PROPERTIES
|
||||||
|
# VERSION 16.${PNGLIB_RELEASE}.1.6.37
|
||||||
|
VERSION 16.${PNGLIB_RELEASE}.0
|
||||||
|
SOVERSION 16
|
||||||
|
CLEAN_DIRECT_OUTPUT 1)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# INSTALL
|
||||||
|
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
|
||||||
|
install(TARGETS ${PNG_LIB_TARGETS}
|
||||||
|
EXPORT libpng
|
||||||
|
RUNTIME DESTINATION bin
|
||||||
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
|
||||||
|
if(PNG_SHARED)
|
||||||
|
# Create a symlink for libpng.dll.a => libpng16.dll.a on Cygwin
|
||||||
|
if(CYGWIN OR MINGW)
|
||||||
|
create_symlink(libpng${CMAKE_IMPORT_LIBRARY_SUFFIX} TARGET png)
|
||||||
|
install(FILES $<TARGET_LINKER_FILE_DIR:png>/libpng${CMAKE_IMPORT_LIBRARY_SUFFIX}
|
||||||
|
DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT WIN32)
|
||||||
|
create_symlink(libpng${CMAKE_SHARED_LIBRARY_SUFFIX} TARGET png)
|
||||||
|
install(FILES $<TARGET_LINKER_FILE_DIR:png>/libpng${CMAKE_SHARED_LIBRARY_SUFFIX}
|
||||||
|
DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(PNG_STATIC)
|
||||||
|
if(NOT WIN32 OR CYGWIN OR MINGW)
|
||||||
|
create_symlink(libpng${CMAKE_STATIC_LIBRARY_SUFFIX} TARGET png_static)
|
||||||
|
install(FILES $<TARGET_LINKER_FILE_DIR:png_static>/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||||
|
DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL)
|
||||||
|
install(FILES ${libpng_public_hdrs} DESTINATION include)
|
||||||
|
install(FILES ${libpng_public_hdrs} DESTINATION include/${PNGLIB_NAME})
|
||||||
|
endif()
|
||||||
|
if(NOT SKIP_INSTALL_EXECUTABLES AND NOT SKIP_INSTALL_ALL)
|
||||||
|
if(NOT WIN32 OR CYGWIN OR MINGW)
|
||||||
|
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng-config DESTINATION bin)
|
||||||
|
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config DESTINATION bin)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT SKIP_INSTALL_PROGRAMS AND NOT SKIP_INSTALL_ALL)
|
||||||
|
install(TARGETS ${PNG_BIN_TARGETS}
|
||||||
|
RUNTIME DESTINATION bin)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL)
|
||||||
|
# Install man pages
|
||||||
|
if(NOT PNG_MAN_DIR)
|
||||||
|
set(PNG_MAN_DIR "share/man")
|
||||||
|
endif()
|
||||||
|
install(FILES libpng.3 libpngpf.3 DESTINATION ${PNG_MAN_DIR}/man3)
|
||||||
|
install(FILES png.5 DESTINATION ${PNG_MAN_DIR}/man5)
|
||||||
|
# Install pkg-config files
|
||||||
|
if(NOT CMAKE_HOST_WIN32 OR CYGWIN OR MINGW)
|
||||||
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng.pc
|
||||||
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||||
|
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng-config
|
||||||
|
DESTINATION bin)
|
||||||
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc
|
||||||
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||||
|
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config
|
||||||
|
DESTINATION bin)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Create an export file that CMake users can include() to import our targets.
|
||||||
|
if(NOT SKIP_INSTALL_EXPORT AND NOT SKIP_INSTALL_ALL)
|
||||||
|
install(EXPORT libpng DESTINATION lib/libpng FILE lib${PNG_LIB_NAME}.cmake)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# what's with libpng-manual.txt and all the extra files?
|
||||||
|
|
||||||
|
# UNINSTALL
|
||||||
|
# do we need this?
|
||||||
|
|
||||||
|
# DIST
|
||||||
|
# do we need this?
|
||||||
|
|
||||||
|
# to create msvc import lib for mingw compiled shared lib
|
||||||
|
# pexports libpng.dll > libpng.def
|
||||||
|
# lib /def:libpng.def /machine:x86
|
||||||
@ -3,15 +3,31 @@
|
|||||||
# This file is part of LAMMPS
|
# This file is part of LAMMPS
|
||||||
# Created by Christoph Junghans and Richard Berger
|
# Created by Christoph Junghans and Richard Berger
|
||||||
cmake_minimum_required(VERSION 3.10)
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
########################################
|
||||||
# set policy to silence warnings about ignoring <PackageName>_ROOT but use it
|
# set policy to silence warnings about ignoring <PackageName>_ROOT but use it
|
||||||
if(POLICY CMP0074)
|
if(POLICY CMP0074)
|
||||||
cmake_policy(SET CMP0074 NEW)
|
cmake_policy(SET CMP0074 NEW)
|
||||||
endif()
|
endif()
|
||||||
|
# set policy to silence warnings about ignoring ${CMAKE_REQUIRED_LIBRARIES} but use it
|
||||||
|
if(POLICY CMP0075)
|
||||||
|
cmake_policy(SET CMP0075 NEW)
|
||||||
|
endif()
|
||||||
# set policy to silence warnings about missing executable permissions in
|
# set policy to silence warnings about missing executable permissions in
|
||||||
# pythonx.y-config when cross-compiling. review occasionally if it may be set to NEW
|
# pythonx.y-config when cross-compiling. review occasionally if it may be set to NEW
|
||||||
if(POLICY CMP0109)
|
if(POLICY CMP0109)
|
||||||
cmake_policy(SET CMP0109 OLD)
|
cmake_policy(SET CMP0109 OLD)
|
||||||
endif()
|
endif()
|
||||||
|
# set policy to silence warnings about timestamps of downloaded files. review occasionally if it may be set to NEW
|
||||||
|
if(POLICY CMP0135)
|
||||||
|
cmake_policy(SET CMP0135 OLD)
|
||||||
|
endif()
|
||||||
|
########################################
|
||||||
|
# Use CONFIGURE_DEPENDS as option for file(GLOB...) when available
|
||||||
|
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||||
|
unset(CONFIGURE_DEPENDS)
|
||||||
|
else()
|
||||||
|
set(CONFIGURE_DEPENDS CONFIGURE_DEPENDS)
|
||||||
|
endif()
|
||||||
########################################
|
########################################
|
||||||
|
|
||||||
project(lammps CXX)
|
project(lammps CXX)
|
||||||
@ -100,13 +116,33 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
|||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4)
|
||||||
set(CMAKE_TUNE_DEFAULT "-xCOMMON-AVX512")
|
set(CMAKE_TUNE_DEFAULT "-xCOMMON-AVX512")
|
||||||
else()
|
else()
|
||||||
set(CMAKE_TUNE_DEFAULT "-xHost")
|
set(CMAKE_TUNE_DEFAULT "-xHost -fp-model fast=2 -no-prec-div -qoverride-limits -diag-disable=10441 -diag-disable=2196")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# silence excessive warnings for new Intel Compilers
|
||||||
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
|
||||||
|
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_TUNE_DEFAULT "-Minform=severe")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# silence nvcc warnings
|
||||||
|
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. Kokkos requires at least C++14 (currently)
|
# we require C++11 without extensions. Kokkos requires at least C++14 (currently)
|
||||||
|
if(NOT CMAKE_CXX_STANDARD)
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
endif()
|
||||||
|
if(CMAKE_CXX_STANDARD LESS 11)
|
||||||
|
message(FATAL_ERROR "C++ standard must be set to at least 11")
|
||||||
|
endif()
|
||||||
if(PKG_KOKKOS AND (CMAKE_CXX_STANDARD LESS 14))
|
if(PKG_KOKKOS AND (CMAKE_CXX_STANDARD LESS 14))
|
||||||
set(CMAKE_CXX_STANDARD 14)
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
endif()
|
endif()
|
||||||
@ -115,9 +151,12 @@ set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "Use compiler extensions")
|
|||||||
# ugly hacks for MSVC which by default always reports an old C++ standard in the __cplusplus macro
|
# ugly hacks for MSVC which by default always reports an old C++ standard in the __cplusplus macro
|
||||||
# and prints lots of pointless warnings about "unsafe" functions
|
# and prints lots of pointless warnings about "unsafe" functions
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
|
if((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Intel"))
|
||||||
add_compile_options(/Zc:__cplusplus)
|
add_compile_options(/Zc:__cplusplus)
|
||||||
add_compile_options(/wd4244)
|
add_compile_options(/wd4244)
|
||||||
add_compile_options(/wd4267)
|
add_compile_options(/wd4267)
|
||||||
|
add_compile_options(/EHsc)
|
||||||
|
endif()
|
||||||
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -129,6 +168,19 @@ endif()
|
|||||||
########################################################################
|
########################################################################
|
||||||
# User input options #
|
# User input options #
|
||||||
########################################################################
|
########################################################################
|
||||||
|
# set path to python interpreter and thus enforcing python version when
|
||||||
|
# in a virtual environment and PYTHON_EXECUTABLE is not set on command line
|
||||||
|
if(DEFINED ENV{VIRTUAL_ENV} AND NOT PYTHON_EXECUTABLE)
|
||||||
|
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
|
||||||
|
set(PYTHON_EXECUTABLE "$ENV{VIRTUAL_ENV}/Scripts/python.exe")
|
||||||
|
else()
|
||||||
|
set(PYTHON_EXECUTABLE "$ENV{VIRTUAL_ENV}/bin/python")
|
||||||
|
endif()
|
||||||
|
set(Python_EXECUTABLE "${PYTHON_EXECUTABLE}")
|
||||||
|
message(STATUS "Running in virtual environment: $ENV{VIRTUAL_ENV}\n"
|
||||||
|
" Setting Python interpreter to: ${PYTHON_EXECUTABLE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(LAMMPS_MACHINE "" CACHE STRING "Suffix to append to lmp binary (WON'T enable any features automatically")
|
set(LAMMPS_MACHINE "" CACHE STRING "Suffix to append to lmp binary (WON'T enable any features automatically")
|
||||||
mark_as_advanced(LAMMPS_MACHINE)
|
mark_as_advanced(LAMMPS_MACHINE)
|
||||||
if(LAMMPS_MACHINE)
|
if(LAMMPS_MACHINE)
|
||||||
@ -141,15 +193,17 @@ 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_TOOLS "Build and install LAMMPS tools (msi2lmp, binary2txt, chain)" OFF)
|
||||||
option(BUILD_LAMMPS_SHELL "Build and install the LAMMPS shell" OFF)
|
option(BUILD_LAMMPS_SHELL "Build and install the LAMMPS shell" OFF)
|
||||||
|
|
||||||
# allow enabling clang-tidy for C++ files
|
# Support using clang-tidy for C++ files with selected options
|
||||||
set(ENABLE_CLANG_TIDY OFF CACHE BOOL "Include clang-tidy processing when compiling")
|
set(ENABLE_CLANG_TIDY OFF CACHE BOOL "Include clang-tidy processing when compiling")
|
||||||
if(ENABLE_CLANG_TIDY)
|
if(ENABLE_CLANG_TIDY)
|
||||||
set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-checks=*-header-filter=.*" CACHE STRING "")
|
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,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()
|
endif()
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
file(GLOB ALL_SOURCES ${LAMMPS_SOURCE_DIR}/[^.]*.cpp)
|
file(GLOB ALL_SOURCES ${CONFIGURE_DEPENDS} ${LAMMPS_SOURCE_DIR}/[^.]*.cpp)
|
||||||
file(GLOB MAIN_SOURCES ${LAMMPS_SOURCE_DIR}/main.cpp)
|
file(GLOB MAIN_SOURCES ${CONFIGURE_DEPENDS} ${LAMMPS_SOURCE_DIR}/main.cpp)
|
||||||
list(REMOVE_ITEM ALL_SOURCES ${MAIN_SOURCES})
|
list(REMOVE_ITEM ALL_SOURCES ${MAIN_SOURCES})
|
||||||
add_library(lammps ${ALL_SOURCES})
|
add_library(lammps ${ALL_SOURCES})
|
||||||
|
|
||||||
@ -172,6 +226,7 @@ set(STANDARD_PACKAGES
|
|||||||
AWPMD
|
AWPMD
|
||||||
BOCS
|
BOCS
|
||||||
BODY
|
BODY
|
||||||
|
BPM
|
||||||
BROWNIAN
|
BROWNIAN
|
||||||
CG-DNA
|
CG-DNA
|
||||||
CG-SDK
|
CG-SDK
|
||||||
@ -188,6 +243,7 @@ set(STANDARD_PACKAGES
|
|||||||
DPD-SMOOTH
|
DPD-SMOOTH
|
||||||
DRUDE
|
DRUDE
|
||||||
EFF
|
EFF
|
||||||
|
ELECTRODE
|
||||||
EXTRA-COMPUTE
|
EXTRA-COMPUTE
|
||||||
EXTRA-DUMP
|
EXTRA-DUMP
|
||||||
EXTRA-FIX
|
EXTRA-FIX
|
||||||
@ -208,7 +264,6 @@ set(STANDARD_PACKAGES
|
|||||||
MDI
|
MDI
|
||||||
MEAM
|
MEAM
|
||||||
MESONT
|
MESONT
|
||||||
MESSAGE
|
|
||||||
MGPT
|
MGPT
|
||||||
MISC
|
MISC
|
||||||
ML-HDNNP
|
ML-HDNNP
|
||||||
@ -267,6 +322,15 @@ if(PKG_ADIOS)
|
|||||||
# script that defines the MPI::MPI_C target
|
# script that defines the MPI::MPI_C target
|
||||||
enable_language(C)
|
enable_language(C)
|
||||||
find_package(ADIOS2 REQUIRED)
|
find_package(ADIOS2 REQUIRED)
|
||||||
|
if(BUILD_MPI)
|
||||||
|
if(NOT ADIOS2_HAVE_MPI)
|
||||||
|
message(FATAL_ERROR "ADIOS2 must be built with MPI support when LAMMPS has MPI enabled")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
if(ADIOS2_HAVE_MPI)
|
||||||
|
message(FATAL_ERROR "ADIOS2 must be built without MPI support when LAMMPS has MPI disabled")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
target_link_libraries(lammps PRIVATE adios2::adios2)
|
target_link_libraries(lammps PRIVATE adios2::adios2)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -307,7 +371,9 @@ string(TOUPPER ${LAMMPS_SIZES} LAMMPS_SIZES)
|
|||||||
target_compile_definitions(lammps PUBLIC -DLAMMPS_${LAMMPS_SIZES})
|
target_compile_definitions(lammps PUBLIC -DLAMMPS_${LAMMPS_SIZES})
|
||||||
|
|
||||||
# posix_memalign is not available on Windows
|
# posix_memalign is not available on Windows
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
# with INTEL package and Intel compilers we use TBB's aligned malloc
|
||||||
|
if((CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
|
AND NOT (PKG_INTEL AND ((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") OR (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM"))))
|
||||||
set(LAMMPS_MEMALIGN "0" CACHE STRING "posix_memalign() is not available on Windows" FORCE)
|
set(LAMMPS_MEMALIGN "0" CACHE STRING "posix_memalign() is not available on Windows" FORCE)
|
||||||
else()
|
else()
|
||||||
set(LAMMPS_MEMALIGN "64" CACHE STRING "enables the use of the posix_memalign() call instead of malloc() when large chunks or memory are allocated by LAMMPS. Set to 0 to disable")
|
set(LAMMPS_MEMALIGN "64" CACHE STRING "enables the use of the posix_memalign() call instead of malloc() when large chunks or memory are allocated by LAMMPS. Set to 0 to disable")
|
||||||
@ -332,12 +398,14 @@ pkg_depends(DIELECTRIC KSPACE)
|
|||||||
pkg_depends(DIELECTRIC EXTRA-PAIR)
|
pkg_depends(DIELECTRIC EXTRA-PAIR)
|
||||||
pkg_depends(CG-DNA MOLECULE)
|
pkg_depends(CG-DNA MOLECULE)
|
||||||
pkg_depends(CG-DNA ASPHERE)
|
pkg_depends(CG-DNA ASPHERE)
|
||||||
|
pkg_depends(ELECTRODE KSPACE)
|
||||||
|
pkg_depends(EXTRA-MOLECULE MOLECULE)
|
||||||
|
|
||||||
# detect if we may enable OpenMP support by default
|
# detect if we may enable OpenMP support by default
|
||||||
set(BUILD_OMP_DEFAULT OFF)
|
set(BUILD_OMP_DEFAULT OFF)
|
||||||
find_package(OpenMP QUIET)
|
find_package(OpenMP COMPONENTS CXX QUIET)
|
||||||
if(OpenMP_FOUND)
|
if(OpenMP_CXX_FOUND)
|
||||||
check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE)
|
check_omp_h_include()
|
||||||
if(HAVE_OMP_H_INCLUDE)
|
if(HAVE_OMP_H_INCLUDE)
|
||||||
set(BUILD_OMP_DEFAULT ON)
|
set(BUILD_OMP_DEFAULT ON)
|
||||||
endif()
|
endif()
|
||||||
@ -346,8 +414,8 @@ endif()
|
|||||||
option(BUILD_OMP "Build with OpenMP support" ${BUILD_OMP_DEFAULT})
|
option(BUILD_OMP "Build with OpenMP support" ${BUILD_OMP_DEFAULT})
|
||||||
|
|
||||||
if(BUILD_OMP)
|
if(BUILD_OMP)
|
||||||
find_package(OpenMP REQUIRED)
|
find_package(OpenMP COMPONENTS CXX REQUIRED)
|
||||||
check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE)
|
check_omp_h_include()
|
||||||
if(NOT HAVE_OMP_H_INCLUDE)
|
if(NOT HAVE_OMP_H_INCLUDE)
|
||||||
message(FATAL_ERROR "Cannot find the 'omp.h' header file required for full OpenMP support")
|
message(FATAL_ERROR "Cannot find the 'omp.h' header file required for full OpenMP support")
|
||||||
endif()
|
endif()
|
||||||
@ -369,7 +437,7 @@ if(BUILD_OMP)
|
|||||||
target_link_libraries(lmp PRIVATE OpenMP::OpenMP_CXX)
|
target_link_libraries(lmp PRIVATE OpenMP::OpenMP_CXX)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(PKG_MSCG OR PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_LATTE)
|
if(PKG_MSCG OR PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_LATTE OR PKG_ELECTRODE)
|
||||||
enable_language(C)
|
enable_language(C)
|
||||||
find_package(LAPACK)
|
find_package(LAPACK)
|
||||||
find_package(BLAS)
|
find_package(BLAS)
|
||||||
@ -379,8 +447,8 @@ if(PKG_MSCG OR PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_LATTE)
|
|||||||
status(FATAL_ERROR "Cannot build internal linear algebra library as CMake build tool lacks Fortran support")
|
status(FATAL_ERROR "Cannot build internal linear algebra library as CMake build tool lacks Fortran support")
|
||||||
endif()
|
endif()
|
||||||
enable_language(Fortran)
|
enable_language(Fortran)
|
||||||
file(GLOB LAPACK_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/linalg/[^.]*.[fF])
|
file(GLOB LINALG_SOURCES ${CONFIGURE_DEPENDS} ${LAMMPS_LIB_SOURCE_DIR}/linalg/[^.]*.[fF])
|
||||||
add_library(linalg STATIC ${LAPACK_SOURCES})
|
add_library(linalg STATIC ${LINALG_SOURCES})
|
||||||
set_target_properties(linalg PROPERTIES OUTPUT_NAME lammps_linalg${LAMMPS_MACHINE})
|
set_target_properties(linalg PROPERTIES OUTPUT_NAME lammps_linalg${LAMMPS_MACHINE})
|
||||||
set(BLAS_LIBRARIES "$<TARGET_FILE:linalg>")
|
set(BLAS_LIBRARIES "$<TARGET_FILE:linalg>")
|
||||||
set(LAPACK_LIBRARIES "$<TARGET_FILE:linalg>")
|
set(LAPACK_LIBRARIES "$<TARGET_FILE:linalg>")
|
||||||
@ -451,7 +519,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
foreach(PKG_WITH_INCL KSPACE PYTHON ML-IAP VORONOI COLVARS ML-HDNNP MDI MOLFILE NETCDF
|
foreach(PKG_WITH_INCL KSPACE PYTHON ML-IAP VORONOI COLVARS ML-HDNNP MDI MOLFILE NETCDF
|
||||||
PLUMED QMMM ML-QUIP SCAFACOS MACHDYN VTK KIM LATTE MESSAGE MSCG COMPRESS ML-PACE)
|
PLUMED QMMM ML-QUIP SCAFACOS MACHDYN VTK KIM LATTE MSCG COMPRESS ML-PACE)
|
||||||
if(PKG_${PKG_WITH_INCL})
|
if(PKG_${PKG_WITH_INCL})
|
||||||
include(Packages/${PKG_WITH_INCL})
|
include(Packages/${PKG_WITH_INCL})
|
||||||
endif()
|
endif()
|
||||||
@ -468,6 +536,7 @@ set(CMAKE_TUNE_FLAGS "${CMAKE_TUNE_DEFAULT}" CACHE STRING "Compiler and machine
|
|||||||
separate_arguments(CMAKE_TUNE_FLAGS)
|
separate_arguments(CMAKE_TUNE_FLAGS)
|
||||||
foreach(_FLAG ${CMAKE_TUNE_FLAGS})
|
foreach(_FLAG ${CMAKE_TUNE_FLAGS})
|
||||||
target_compile_options(lammps PRIVATE ${_FLAG})
|
target_compile_options(lammps PRIVATE ${_FLAG})
|
||||||
|
target_compile_options(lmp PRIVATE ${_FLAG})
|
||||||
endforeach()
|
endforeach()
|
||||||
########################################################################
|
########################################################################
|
||||||
# Basic system tests (standard libraries, headers, functions, types) #
|
# Basic system tests (standard libraries, headers, functions, types) #
|
||||||
@ -507,8 +576,8 @@ endforeach()
|
|||||||
foreach(PKG ${STANDARD_PACKAGES})
|
foreach(PKG ${STANDARD_PACKAGES})
|
||||||
set(${PKG}_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/${PKG})
|
set(${PKG}_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/${PKG})
|
||||||
|
|
||||||
file(GLOB ${PKG}_SOURCES ${${PKG}_SOURCES_DIR}/[^.]*.cpp)
|
file(GLOB ${PKG}_SOURCES ${CONFIGURE_DEPENDS} ${${PKG}_SOURCES_DIR}/[^.]*.cpp)
|
||||||
file(GLOB ${PKG}_HEADERS ${${PKG}_SOURCES_DIR}/[^.]*.h)
|
file(GLOB ${PKG}_HEADERS ${CONFIGURE_DEPENDS} ${${PKG}_SOURCES_DIR}/[^.]*.h)
|
||||||
|
|
||||||
# check for package files in src directory due to old make system
|
# check for package files in src directory due to old make system
|
||||||
DetectBuildSystemConflict(${LAMMPS_SOURCE_DIR} ${${PKG}_SOURCES} ${${PKG}_HEADERS})
|
DetectBuildSystemConflict(${LAMMPS_SOURCE_DIR} ${${PKG}_SOURCES} ${${PKG}_HEADERS})
|
||||||
@ -535,8 +604,8 @@ endforeach()
|
|||||||
foreach(PKG ${SUFFIX_PACKAGES})
|
foreach(PKG ${SUFFIX_PACKAGES})
|
||||||
set(${PKG}_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/${PKG})
|
set(${PKG}_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/${PKG})
|
||||||
|
|
||||||
file(GLOB ${PKG}_SOURCES ${${PKG}_SOURCES_DIR}/[^.]*.cpp)
|
file(GLOB ${PKG}_SOURCES ${CONFIGURE_DEPENDS} ${${PKG}_SOURCES_DIR}/[^.]*.cpp)
|
||||||
file(GLOB ${PKG}_HEADERS ${${PKG}_SOURCES_DIR}/[^.]*.h)
|
file(GLOB ${PKG}_HEADERS ${CONFIGURE_DEPENDS} ${${PKG}_SOURCES_DIR}/[^.]*.h)
|
||||||
|
|
||||||
# check for package files in src directory due to old make system
|
# check for package files in src directory due to old make system
|
||||||
DetectBuildSystemConflict(${LAMMPS_SOURCE_DIR} ${${PKG}_SOURCES} ${${PKG}_HEADERS})
|
DetectBuildSystemConflict(${LAMMPS_SOURCE_DIR} ${${PKG}_SOURCES} ${${PKG}_HEADERS})
|
||||||
@ -552,10 +621,10 @@ foreach(PKG_LIB POEMS ATC AWPMD H5MD MESONT)
|
|||||||
string(TOLOWER "${PKG_LIB}" PKG_LIB)
|
string(TOLOWER "${PKG_LIB}" PKG_LIB)
|
||||||
if(PKG_LIB STREQUAL "mesont")
|
if(PKG_LIB STREQUAL "mesont")
|
||||||
enable_language(Fortran)
|
enable_language(Fortran)
|
||||||
file(GLOB_RECURSE ${PKG_LIB}_SOURCES
|
file(GLOB_RECURSE ${PKG_LIB}_SOURCES ${CONFIGURE_DEPENDS}
|
||||||
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.f90)
|
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.f90)
|
||||||
else()
|
else()
|
||||||
file(GLOB_RECURSE ${PKG_LIB}_SOURCES
|
file(GLOB_RECURSE ${PKG_LIB}_SOURCES ${CONFIGURE_DEPENDS}
|
||||||
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.c
|
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.c
|
||||||
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.cpp)
|
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.cpp)
|
||||||
endif()
|
endif()
|
||||||
@ -572,6 +641,10 @@ foreach(PKG_LIB POEMS ATC AWPMD H5MD MESONT)
|
|||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
if(PKG_ELECTRODE)
|
||||||
|
target_link_libraries(lammps PRIVATE ${LAPACK_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
if(PKG_AWPMD)
|
if(PKG_AWPMD)
|
||||||
target_link_libraries(awpmd PRIVATE ${LAPACK_LIBRARIES})
|
target_link_libraries(awpmd PRIVATE ${LAPACK_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
@ -670,18 +743,17 @@ list(FIND LANGUAGES "Fortran" _index)
|
|||||||
if(_index GREATER -1)
|
if(_index GREATER -1)
|
||||||
target_link_libraries(lammps PRIVATE ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES})
|
target_link_libraries(lammps PRIVATE ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
set(LAMMPS_CXX_HEADERS angle.h atom.h bond.h citeme.h comm.h compute.h dihedral.h domain.h error.h fix.h force.h group.h improper.h
|
set(LAMMPS_CXX_HEADERS angle.h atom.h bond.h citeme.h comm.h command.h compute.h dihedral.h domain.h
|
||||||
input.h info.h kspace.h lammps.h lattice.h library.h lmppython.h lmptype.h memory.h modify.h neighbor.h neigh_list.h output.h
|
error.h exceptions.h fix.h force.h group.h improper.h input.h info.h kspace.h lammps.h lattice.h
|
||||||
pair.h pointers.h region.h timer.h universe.h update.h utils.h variable.h)
|
library.h lmppython.h lmptype.h memory.h modify.h neighbor.h neigh_list.h output.h pair.h
|
||||||
if(LAMMPS_EXCEPTIONS)
|
platform.h pointers.h region.h timer.h universe.h update.h utils.h variable.h)
|
||||||
list(APPEND LAMMPS_CXX_HEADERS exceptions.h)
|
set(LAMMPS_FMT_HEADERS core.h format.h)
|
||||||
endif()
|
|
||||||
|
|
||||||
set_target_properties(lammps PROPERTIES OUTPUT_NAME lammps${LAMMPS_MACHINE})
|
set_target_properties(lammps PROPERTIES OUTPUT_NAME lammps${LAMMPS_MACHINE})
|
||||||
set_target_properties(lammps PROPERTIES SOVERSION ${SOVERSION})
|
set_target_properties(lammps PROPERTIES SOVERSION ${SOVERSION})
|
||||||
set_target_properties(lammps PROPERTIES PREFIX "lib")
|
set_target_properties(lammps PROPERTIES PREFIX "lib")
|
||||||
target_include_directories(lammps PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/lammps>)
|
target_include_directories(lammps PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/lammps>)
|
||||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps)
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/fmt)
|
||||||
foreach(_HEADER ${LAMMPS_CXX_HEADERS})
|
foreach(_HEADER ${LAMMPS_CXX_HEADERS})
|
||||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LAMMPS_SOURCE_DIR}/${_HEADER} ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER} DEPENDS ${LAMMPS_SOURCE_DIR}/${_HEADER})
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LAMMPS_SOURCE_DIR}/${_HEADER} ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER} DEPENDS ${LAMMPS_SOURCE_DIR}/${_HEADER})
|
||||||
add_custom_target(${_HEADER} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER})
|
add_custom_target(${_HEADER} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/${_HEADER})
|
||||||
@ -690,6 +762,14 @@ foreach(_HEADER ${LAMMPS_CXX_HEADERS})
|
|||||||
install(FILES ${LAMMPS_SOURCE_DIR}/${_HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps)
|
install(FILES ${LAMMPS_SOURCE_DIR}/${_HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps)
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
foreach(_HEADER ${LAMMPS_FMT_HEADERS})
|
||||||
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/fmt/${_HEADER} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LAMMPS_SOURCE_DIR}/fmt/${_HEADER} ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/fmt/${_HEADER} DEPENDS ${LAMMPS_SOURCE_DIR}/fmt/${_HEADER})
|
||||||
|
add_custom_target(fmt_${_HEADER} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps/fmt/${_HEADER})
|
||||||
|
add_dependencies(lammps fmt_${_HEADER})
|
||||||
|
if(BUILD_SHARED_LIBS)
|
||||||
|
install(FILES ${LAMMPS_SOURCE_DIR}/fmt/${_HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps/fmt)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
target_include_directories(lammps INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/includes>)
|
target_include_directories(lammps INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/includes>)
|
||||||
add_library(LAMMPS::lammps ALIAS lammps)
|
add_library(LAMMPS::lammps ALIAS lammps)
|
||||||
get_target_property(LAMMPS_DEFINES lammps INTERFACE_COMPILE_DEFINITIONS)
|
get_target_property(LAMMPS_DEFINES lammps INTERFACE_COMPILE_DEFINITIONS)
|
||||||
@ -747,17 +827,23 @@ if(BUILD_SHARED_LIBS)
|
|||||||
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
|
# backward compatibility
|
||||||
|
if(PYTHON_EXECUTABLE)
|
||||||
|
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||||
|
endif()
|
||||||
find_package(Python COMPONENTS Interpreter)
|
find_package(Python COMPONENTS Interpreter)
|
||||||
endif()
|
endif()
|
||||||
if(BUILD_IS_MULTI_CONFIG)
|
if(BUILD_IS_MULTI_CONFIG)
|
||||||
set(LIBLAMMPS_SHARED_BINARY ${CMAKE_BINARY_DIR}/$<CONFIG>/liblammps${LAMMPS_MACHINE}${CMAKE_SHARED_LIBRARY_SUFFIX})
|
set(MY_BUILD_DIR ${CMAKE_BINARY_DIR}/$<CONFIG>)
|
||||||
else()
|
else()
|
||||||
set(LIBLAMMPS_SHARED_BINARY ${CMAKE_BINARY_DIR}/liblammps${LAMMPS_MACHINE}${CMAKE_SHARED_LIBRARY_SUFFIX})
|
set(MY_BUILD_DIR ${CMAKE_BINARY_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
set(LIBLAMMPS_SHARED_BINARY ${MY_BUILD_DIR}/liblammps${LAMMPS_MACHINE}${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||||
if(Python_EXECUTABLE)
|
if(Python_EXECUTABLE)
|
||||||
add_custom_target(
|
add_custom_target(
|
||||||
install-python ${CMAKE_COMMAND} -E remove_directory build
|
install-python ${CMAKE_COMMAND} -E remove_directory build
|
||||||
COMMAND ${Python_EXECUTABLE} ${LAMMPS_PYTHON_DIR}/install.py -p ${LAMMPS_PYTHON_DIR}/lammps -l ${LIBLAMMPS_SHARED_BINARY}
|
COMMAND ${Python_EXECUTABLE} ${LAMMPS_PYTHON_DIR}/install.py -p ${LAMMPS_PYTHON_DIR}/lammps
|
||||||
|
-l ${LIBLAMMPS_SHARED_BINARY} -w ${MY_BUILD_DIR}
|
||||||
COMMENT "Installing LAMMPS Python module")
|
COMMENT "Installing LAMMPS Python module")
|
||||||
else()
|
else()
|
||||||
add_custom_target(
|
add_custom_target(
|
||||||
@ -777,16 +863,25 @@ endif()
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
if(BUILD_SHARED_LIBS OR PKG_PYTHON)
|
if(BUILD_SHARED_LIBS OR PKG_PYTHON)
|
||||||
if(CMAKE_VERSION VERSION_LESS 3.12)
|
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||||
|
# adjust so we find Python 3 versions before Python 2 on old systems with old CMake
|
||||||
|
set(Python_ADDITIONAL_VERSIONS 3.12 3.11 3.10 3.9 3.8 3.7 3.6)
|
||||||
find_package(PythonInterp) # Deprecated since version 3.12
|
find_package(PythonInterp) # Deprecated since version 3.12
|
||||||
if(PYTHONINTERP_FOUND)
|
if(PYTHONINTERP_FOUND)
|
||||||
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
|
# backward compatibility
|
||||||
|
if(PYTHON_EXECUTABLE)
|
||||||
|
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||||
|
endif()
|
||||||
find_package(Python COMPONENTS Interpreter)
|
find_package(Python COMPONENTS Interpreter)
|
||||||
endif()
|
endif()
|
||||||
if(Python_EXECUTABLE)
|
if(Python_EXECUTABLE)
|
||||||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/python)
|
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/python/lib)
|
||||||
install(CODE "execute_process(COMMAND ${Python_EXECUTABLE} setup.py build -b ${CMAKE_BINARY_DIR}/python install --prefix=${CMAKE_INSTALL_PREFIX} --root=\$ENV{DESTDIR}/ WORKING_DIRECTORY ${LAMMPS_PYTHON_DIR})")
|
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/python/src)
|
||||||
|
file(COPY ${LAMMPS_SOURCE_DIR}/version.h DESTINATION ${CMAKE_BINARY_DIR}/python/src)
|
||||||
|
file(COPY ${LAMMPS_PYTHON_DIR}/README ${LAMMPS_PYTHON_DIR}/pyproject.toml ${LAMMPS_PYTHON_DIR}/setup.py ${LAMMPS_PYTHON_DIR}/lammps DESTINATION ${CMAKE_BINARY_DIR}/python/lib)
|
||||||
|
install(CODE "if(\"\$ENV{DESTDIR}\" STREQUAL \"\")\n execute_process(COMMAND ${Python_EXECUTABLE} -m pip install -v ${CMAKE_BINARY_DIR}/python/lib --prefix=${CMAKE_INSTALL_PREFIX})\n else()\n execute_process(COMMAND ${Python_EXECUTABLE} -m pip install -v ${CMAKE_BINARY_DIR}/python/lib --prefix=${CMAKE_INSTALL_PREFIX} --root=\$ENV{DESTDIR})\n endif()")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -801,6 +896,23 @@ if(ClangFormat_FOUND)
|
|||||||
WORKING_DIRECTORY ${LAMMPS_SOURCE_DIR})
|
WORKING_DIRECTORY ${LAMMPS_SOURCE_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# extract Kokkos compilation settings
|
||||||
|
get_cmake_property(_allvars VARIABLES)
|
||||||
|
foreach(_var ${_allvars})
|
||||||
|
if(${_var})
|
||||||
|
string(REGEX MATCH "Kokkos_ENABLE_(SERIAL|THREADS|OPENMP|CUDA|HIP|SYCL|OPENMPTARGET|HPX)" _match ${_var})
|
||||||
|
if(_match)
|
||||||
|
string(REGEX REPLACE "Kokkos_ENABLE_(OPENMP|SERIAL|CUDA|HIP|SYCL)" "\\1" _match ${_var})
|
||||||
|
list(APPEND KOKKOS_DEVICE ${_match})
|
||||||
|
endif()
|
||||||
|
string(REGEX MATCH "Kokkos_ARCH" _match ${_var})
|
||||||
|
if(_match)
|
||||||
|
string(REGEX REPLACE "Kokkos_ARCH_(.*)" "\\1" _match ${_var})
|
||||||
|
list(APPEND KOKKOS_ARCH ${_match})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
get_target_property(DEFINES lammps COMPILE_DEFINITIONS)
|
get_target_property(DEFINES lammps COMPILE_DEFINITIONS)
|
||||||
if(BUILD_IS_MULTI_CONFIG)
|
if(BUILD_IS_MULTI_CONFIG)
|
||||||
set(LAMMPS_BUILD_TYPE "Multi-Config")
|
set(LAMMPS_BUILD_TYPE "Multi-Config")
|
||||||
@ -810,7 +922,9 @@ endif()
|
|||||||
include(FeatureSummary)
|
include(FeatureSummary)
|
||||||
feature_summary(DESCRIPTION "The following tools and libraries have been found and configured:" WHAT PACKAGES_FOUND)
|
feature_summary(DESCRIPTION "The following tools and libraries have been found and configured:" WHAT PACKAGES_FOUND)
|
||||||
message(STATUS "<<< Build configuration >>>
|
message(STATUS "<<< Build configuration >>>
|
||||||
|
LAMMPS Version: ${PROJECT_VERSION}
|
||||||
Operating System: ${CMAKE_SYSTEM_NAME} ${CMAKE_LINUX_DISTRO} ${CMAKE_DISTRO_VERSION}
|
Operating System: ${CMAKE_SYSTEM_NAME} ${CMAKE_LINUX_DISTRO} ${CMAKE_DISTRO_VERSION}
|
||||||
|
CMake Version: ${CMAKE_VERSION}
|
||||||
Build type: ${LAMMPS_BUILD_TYPE}
|
Build type: ${LAMMPS_BUILD_TYPE}
|
||||||
Install path: ${CMAKE_INSTALL_PREFIX}
|
Install path: ${CMAKE_INSTALL_PREFIX}
|
||||||
Generator: ${CMAKE_GENERATOR} using ${CMAKE_MAKE_PROGRAM}")
|
Generator: ${CMAKE_GENERATOR} using ${CMAKE_MAKE_PROGRAM}")
|
||||||
@ -897,7 +1011,10 @@ if(PKG_GPU)
|
|||||||
message(STATUS "GPU precision: ${GPU_PREC}")
|
message(STATUS "GPU precision: ${GPU_PREC}")
|
||||||
endif()
|
endif()
|
||||||
if(PKG_KOKKOS)
|
if(PKG_KOKKOS)
|
||||||
message(STATUS "Kokkos Arch: ${KOKKOS_ARCH}")
|
message(STATUS "Kokkos Devices: ${KOKKOS_DEVICE}")
|
||||||
|
if(KOKKOS_ARCH)
|
||||||
|
message(STATUS "Kokkos Architecture: ${KOKKOS_ARCH}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(PKG_KSPACE)
|
if(PKG_KSPACE)
|
||||||
message(STATUS "<<< FFT settings >>>
|
message(STATUS "<<< FFT settings >>>
|
||||||
@ -919,6 +1036,12 @@ if(PKG_KSPACE)
|
|||||||
else()
|
else()
|
||||||
message(STATUS "Kokkos FFT: cuFFT")
|
message(STATUS "Kokkos FFT: cuFFT")
|
||||||
endif()
|
endif()
|
||||||
|
elseif(Kokkos_ENABLE_HIP)
|
||||||
|
if(FFT STREQUAL "KISS")
|
||||||
|
message(STATUS "Kokkos FFT: KISS")
|
||||||
|
else()
|
||||||
|
message(STATUS "Kokkos FFT: hipFFT")
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
message(STATUS "Kokkos FFT: ${FFT}")
|
message(STATUS "Kokkos FFT: ${FFT}")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
195
cmake/CMakeLists.zlib
Normal file
195
cmake/CMakeLists.zlib
Normal file
@ -0,0 +1,195 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
# When using CMake 3.4 and later, don't export symbols from executables unless
|
||||||
|
# the CMAKE_ENABLE_EXPORTS variable is set.
|
||||||
|
if(POLICY CMP0065)
|
||||||
|
cmake_policy(SET CMP0065 NEW)
|
||||||
|
endif()
|
||||||
|
if (POLICY CMP0077)
|
||||||
|
cmake_policy(SET CMP0077 NEW)
|
||||||
|
endif()
|
||||||
|
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
|
||||||
|
|
||||||
|
project(zlib C)
|
||||||
|
|
||||||
|
set(VERSION "1.2.11")
|
||||||
|
|
||||||
|
option(ASM686 "Enable building i686 assembly implementation" OFF)
|
||||||
|
option(AMD64 "Enable building amd64 assembly implementation" OFF)
|
||||||
|
|
||||||
|
set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
|
||||||
|
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
|
||||||
|
set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers")
|
||||||
|
set(INSTALL_MAN_DIR "${CMAKE_INSTALL_PREFIX}/share/man" CACHE PATH "Installation directory for manual pages")
|
||||||
|
set(INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/share/pkgconfig" CACHE PATH "Installation directory for pkgconfig (.pc) files")
|
||||||
|
|
||||||
|
include(CheckTypeSize)
|
||||||
|
include(CheckFunctionExists)
|
||||||
|
include(CheckIncludeFile)
|
||||||
|
include(CheckCSourceCompiles)
|
||||||
|
|
||||||
|
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
|
||||||
|
check_include_file(stdint.h HAVE_STDINT_H)
|
||||||
|
check_include_file(stddef.h HAVE_STDDEF_H)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check to see if we have large file support
|
||||||
|
#
|
||||||
|
set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
|
||||||
|
# We add these other definitions here because CheckTypeSize.cmake
|
||||||
|
# in CMake 2.4.x does not automatically do so and we want
|
||||||
|
# compatibility with CMake 2.4.x.
|
||||||
|
if(HAVE_SYS_TYPES_H)
|
||||||
|
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H)
|
||||||
|
endif()
|
||||||
|
if(HAVE_STDINT_H)
|
||||||
|
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H)
|
||||||
|
endif()
|
||||||
|
if(HAVE_STDDEF_H)
|
||||||
|
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H)
|
||||||
|
endif()
|
||||||
|
check_type_size(off64_t OFF64_T)
|
||||||
|
check_type_size(off64_t OFF64_T)
|
||||||
|
if(HAVE_OFF64_T)
|
||||||
|
add_definitions(-D_LARGEFILE64_SOURCE=1)
|
||||||
|
endif()
|
||||||
|
set(CMAKE_REQUIRED_DEFINITIONS) # clear variable
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check for fseeko
|
||||||
|
#
|
||||||
|
check_function_exists(fseeko HAVE_FSEEKO)
|
||||||
|
if(NOT HAVE_FSEEKO)
|
||||||
|
add_definitions(-DNO_FSEEKO)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check for unistd.h
|
||||||
|
#
|
||||||
|
check_include_file(unistd.h Z_HAVE_UNISTD_H)
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
set(CMAKE_DEBUG_POSTFIX "d")
|
||||||
|
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
||||||
|
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
|
||||||
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
|
||||||
|
# If we're doing an out of source build and the user has a zconf.h
|
||||||
|
# in their source tree...
|
||||||
|
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h)
|
||||||
|
file(RENAME ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.included)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(ZLIB_PC ${CMAKE_CURRENT_BINARY_DIR}/zlib.pc)
|
||||||
|
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zlib.pc.cmakein
|
||||||
|
${ZLIB_PC} @ONLY)
|
||||||
|
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY)
|
||||||
|
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR})
|
||||||
|
|
||||||
|
|
||||||
|
#============================================================================
|
||||||
|
# zlib
|
||||||
|
#============================================================================
|
||||||
|
|
||||||
|
set(ZLIB_PUBLIC_HDRS
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/zconf.h
|
||||||
|
zlib.h
|
||||||
|
)
|
||||||
|
set(ZLIB_PRIVATE_HDRS
|
||||||
|
crc32.h
|
||||||
|
deflate.h
|
||||||
|
gzguts.h
|
||||||
|
inffast.h
|
||||||
|
inffixed.h
|
||||||
|
inflate.h
|
||||||
|
inftrees.h
|
||||||
|
trees.h
|
||||||
|
zutil.h
|
||||||
|
)
|
||||||
|
set(ZLIB_SRCS
|
||||||
|
adler32.c
|
||||||
|
compress.c
|
||||||
|
crc32.c
|
||||||
|
deflate.c
|
||||||
|
gzclose.c
|
||||||
|
gzlib.c
|
||||||
|
gzread.c
|
||||||
|
gzwrite.c
|
||||||
|
inflate.c
|
||||||
|
infback.c
|
||||||
|
inftrees.c
|
||||||
|
inffast.c
|
||||||
|
trees.c
|
||||||
|
uncompr.c
|
||||||
|
zutil.c
|
||||||
|
)
|
||||||
|
|
||||||
|
if(NOT MINGW)
|
||||||
|
set(ZLIB_DLL_SRCS
|
||||||
|
win32/zlib1.rc # If present will override custom build rule below.
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_COMPILER_IS_GNUCC)
|
||||||
|
if(ASM686)
|
||||||
|
set(ZLIB_ASMS contrib/asm686/match.S)
|
||||||
|
elseif (AMD64)
|
||||||
|
set(ZLIB_ASMS contrib/amd64/amd64-match.S)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if(ZLIB_ASMS)
|
||||||
|
add_definitions(-DASMV)
|
||||||
|
set_source_files_properties(${ZLIB_ASMS} PROPERTIES LANGUAGE C COMPILE_FLAGS -DNO_UNDERLINE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
if(ASM686)
|
||||||
|
ENABLE_LANGUAGE(ASM_MASM)
|
||||||
|
set(ZLIB_ASMS
|
||||||
|
contrib/masmx86/inffas32.asm
|
||||||
|
contrib/masmx86/match686.asm
|
||||||
|
)
|
||||||
|
elseif (AMD64)
|
||||||
|
ENABLE_LANGUAGE(ASM_MASM)
|
||||||
|
set(ZLIB_ASMS
|
||||||
|
contrib/masmx64/gvmat64.asm
|
||||||
|
contrib/masmx64/inffasx64.asm
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(ZLIB_ASMS)
|
||||||
|
add_definitions(-DASMV -DASMINF)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# parse the full version number from zlib.h and include in ZLIB_FULL_VERSION
|
||||||
|
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents)
|
||||||
|
string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*"
|
||||||
|
"\\1" ZLIB_FULL_VERSION ${_zlib_h_contents})
|
||||||
|
|
||||||
|
if(MINGW)
|
||||||
|
# This gets us DLL resource information when compiling on MinGW.
|
||||||
|
if(NOT CMAKE_RC_COMPILER)
|
||||||
|
set(CMAKE_RC_COMPILER windres.exe)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
|
||||||
|
COMMAND ${CMAKE_RC_COMPILER}
|
||||||
|
-D GCC_WINDRES
|
||||||
|
-I ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
-I ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
-o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
|
||||||
|
-i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc)
|
||||||
|
set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
|
||||||
|
endif(MINGW)
|
||||||
|
|
||||||
|
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
|
||||||
|
|
||||||
|
if(UNIX)
|
||||||
|
# On unix-like platforms the library is almost always called libz
|
||||||
|
set_target_properties(zlibstatic PROPERTIES OUTPUT_NAME z)
|
||||||
|
endif()
|
||||||
@ -8,7 +8,7 @@
|
|||||||
"installRoot": "${workspaceRoot}\\install\\${name}",
|
"installRoot": "${workspaceRoot}\\install\\${name}",
|
||||||
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
|
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
|
||||||
"buildCommandArgs": "",
|
"buildCommandArgs": "",
|
||||||
"ctestCommandArgs": "",
|
"ctestCommandArgs": "-V",
|
||||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||||
"variables": [
|
"variables": [
|
||||||
{
|
{
|
||||||
@ -26,11 +26,6 @@
|
|||||||
"value": "True",
|
"value": "True",
|
||||||
"type": "BOOL"
|
"type": "BOOL"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "PKG_PYTHON",
|
|
||||||
"value": "True",
|
|
||||||
"type": "BOOL"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "ENABLE_TESTING",
|
"name": "ENABLE_TESTING",
|
||||||
"value": "True",
|
"value": "True",
|
||||||
@ -46,7 +41,7 @@
|
|||||||
"installRoot": "${workspaceRoot}\\install\\${name}",
|
"installRoot": "${workspaceRoot}\\install\\${name}",
|
||||||
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
|
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
|
||||||
"buildCommandArgs": "",
|
"buildCommandArgs": "",
|
||||||
"ctestCommandArgs": "",
|
"ctestCommandArgs": "-V",
|
||||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||||
"variables": [
|
"variables": [
|
||||||
{
|
{
|
||||||
@ -64,11 +59,6 @@
|
|||||||
"value": "True",
|
"value": "True",
|
||||||
"type": "BOOL"
|
"type": "BOOL"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "PKG_PYTHON",
|
|
||||||
"value": "True",
|
|
||||||
"type": "BOOL"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "ENABLE_TESTING",
|
"name": "ENABLE_TESTING",
|
||||||
"value": "True",
|
"value": "True",
|
||||||
@ -82,7 +72,7 @@
|
|||||||
"configurationType": "Debug",
|
"configurationType": "Debug",
|
||||||
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
||||||
"installRoot": "${workspaceRoot}\\install\\${name}",
|
"installRoot": "${workspaceRoot}\\install\\${name}",
|
||||||
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe",
|
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe -DBUILD_MPI=off",
|
||||||
"buildCommandArgs": "",
|
"buildCommandArgs": "",
|
||||||
"ctestCommandArgs": "",
|
"ctestCommandArgs": "",
|
||||||
"inheritEnvironments": [ "clang_cl_x64" ],
|
"inheritEnvironments": [ "clang_cl_x64" ],
|
||||||
@ -102,11 +92,6 @@
|
|||||||
"value": "True",
|
"value": "True",
|
||||||
"type": "BOOL"
|
"type": "BOOL"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "PKG_PYTHON",
|
|
||||||
"value": "True",
|
|
||||||
"type": "BOOL"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "ENABLE_TESTING",
|
"name": "ENABLE_TESTING",
|
||||||
"value": "True",
|
"value": "True",
|
||||||
@ -120,9 +105,9 @@
|
|||||||
"configurationType": "Release",
|
"configurationType": "Release",
|
||||||
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
||||||
"installRoot": "${workspaceRoot}\\install\\${name}",
|
"installRoot": "${workspaceRoot}\\install\\${name}",
|
||||||
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe",
|
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows.cmake -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe -DBUILD_MPI=off",
|
||||||
"buildCommandArgs": "",
|
"buildCommandArgs": "",
|
||||||
"ctestCommandArgs": "",
|
"ctestCommandArgs": "-V",
|
||||||
"inheritEnvironments": [ "clang_cl_x64" ],
|
"inheritEnvironments": [ "clang_cl_x64" ],
|
||||||
"variables": [
|
"variables": [
|
||||||
{
|
{
|
||||||
@ -141,7 +126,40 @@
|
|||||||
"type": "BOOL"
|
"type": "BOOL"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "PKG_PYTHON",
|
"name": "ENABLE_TESTING",
|
||||||
|
"value": "True",
|
||||||
|
"type": "BOOL"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "x64-Debug-IntelLLVM",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"configurationType": "Debug",
|
||||||
|
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
||||||
|
"installRoot": "${workspaceRoot}\\install\\${name}",
|
||||||
|
"buildCommandArgs": "",
|
||||||
|
"ctestCommandArgs": "-V",
|
||||||
|
"inheritEnvironments": [],
|
||||||
|
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows-intel-llvm.cmake -C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
|
||||||
|
"variables": [
|
||||||
|
{
|
||||||
|
"name": "PKG_ELECTRODE",
|
||||||
|
"value": "True",
|
||||||
|
"type": "BOOL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "BUILD_SHARED_LIBS",
|
||||||
|
"value": "True",
|
||||||
|
"type": "BOOL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "BUILD_TOOLS",
|
||||||
|
"value": "True",
|
||||||
|
"type": "BOOL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "LAMMPS_EXCEPTIONS",
|
||||||
"value": "True",
|
"value": "True",
|
||||||
"type": "BOOL"
|
"type": "BOOL"
|
||||||
},
|
},
|
||||||
@ -149,6 +167,140 @@
|
|||||||
"name": "ENABLE_TESTING",
|
"name": "ENABLE_TESTING",
|
||||||
"value": "True",
|
"value": "True",
|
||||||
"type": "BOOL"
|
"type": "BOOL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "FFT",
|
||||||
|
"value": "MKL",
|
||||||
|
"type": "STRING"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "x64-Release-IntelLLVM",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"configurationType": "Release",
|
||||||
|
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
||||||
|
"installRoot": "${workspaceRoot}\\install\\${name}",
|
||||||
|
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows-intel-llvm.cmake -C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
|
||||||
|
"buildCommandArgs": "",
|
||||||
|
"ctestCommandArgs": "-V",
|
||||||
|
"inheritEnvironments": [],
|
||||||
|
"variables": [
|
||||||
|
{
|
||||||
|
"name": "PKG_ELECTRODE",
|
||||||
|
"value": "True",
|
||||||
|
"type": "BOOL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "BUILD_SHARED_LIBS",
|
||||||
|
"value": "True",
|
||||||
|
"type": "BOOL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "BUILD_TOOLS",
|
||||||
|
"value": "True",
|
||||||
|
"type": "BOOL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "LAMMPS_EXCEPTIONS",
|
||||||
|
"value": "True",
|
||||||
|
"type": "BOOL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ENABLE_TESTING",
|
||||||
|
"value": "True",
|
||||||
|
"type": "BOOL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "FFT",
|
||||||
|
"value": "MKL",
|
||||||
|
"type": "STRING"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "x64-Debug-Intel-Classic",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"configurationType": "Debug",
|
||||||
|
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
||||||
|
"installRoot": "${workspaceRoot}\\install\\${name}",
|
||||||
|
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows-intel-classic.cmake -C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
|
||||||
|
"buildCommandArgs": "",
|
||||||
|
"ctestCommandArgs": "-V",
|
||||||
|
"inheritEnvironments": [],
|
||||||
|
"variables": [
|
||||||
|
{
|
||||||
|
"name": "PKG_ELECTRODE",
|
||||||
|
"value": "True",
|
||||||
|
"type": "BOOL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "BUILD_SHARED_LIBS",
|
||||||
|
"value": "True",
|
||||||
|
"type": "BOOL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "BUILD_TOOLS",
|
||||||
|
"value": "True",
|
||||||
|
"type": "BOOL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "LAMMPS_EXCEPTIONS",
|
||||||
|
"value": "True",
|
||||||
|
"type": "BOOL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ENABLE_TESTING",
|
||||||
|
"value": "False",
|
||||||
|
"type": "BOOL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "FFT",
|
||||||
|
"value": "MKL",
|
||||||
|
"type": "STRING"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "x64-Release-Intel-Classic",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"configurationType": "Release",
|
||||||
|
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
||||||
|
"installRoot": "${workspaceRoot}\\install\\${name}",
|
||||||
|
"cmakeCommandArgs": "-C ${workspaceRoot}\\cmake\\presets\\windows-intel-classic.cmake -C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
|
||||||
|
"buildCommandArgs": "",
|
||||||
|
"ctestCommandArgs": "-V",
|
||||||
|
"inheritEnvironments": [],
|
||||||
|
"variables": [
|
||||||
|
{
|
||||||
|
"name": "PKG_ELECTRODE",
|
||||||
|
"value": "True",
|
||||||
|
"type": "BOOL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "BUILD_SHARED_LIBS",
|
||||||
|
"value": "True",
|
||||||
|
"type": "BOOL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "BUILD_TOOLS",
|
||||||
|
"value": "True",
|
||||||
|
"type": "BOOL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "LAMMPS_EXCEPTIONS",
|
||||||
|
"value": "True",
|
||||||
|
"type": "BOOL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ENABLE_TESTING",
|
||||||
|
"value": "False",
|
||||||
|
"type": "BOOL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "FFT",
|
||||||
|
"value": "MKL",
|
||||||
|
"type": "STRING"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,17 +7,17 @@ if(BUILD_DOC)
|
|||||||
# Sphinx 3.x requires at least Python 3.5
|
# Sphinx 3.x requires at least Python 3.5
|
||||||
if(CMAKE_VERSION VERSION_LESS 3.12)
|
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||||
find_package(PythonInterp 3.5 REQUIRED)
|
find_package(PythonInterp 3.5 REQUIRED)
|
||||||
set(VIRTUALENV ${PYTHON_EXECUTABLE} -m virtualenv -p ${PYTHON_EXECUTABLE})
|
set(VIRTUALENV ${PYTHON_EXECUTABLE} -m venv)
|
||||||
else()
|
else()
|
||||||
find_package(Python3 REQUIRED COMPONENTS Interpreter)
|
find_package(Python3 REQUIRED COMPONENTS Interpreter)
|
||||||
if(Python3_VERSION VERSION_LESS 3.5)
|
if(Python3_VERSION VERSION_LESS 3.5)
|
||||||
message(FATAL_ERROR "Python 3.5 and up is required to build the HTML documentation")
|
message(FATAL_ERROR "Python 3.5 and up is required to build the HTML documentation")
|
||||||
endif()
|
endif()
|
||||||
set(VIRTUALENV ${Python3_EXECUTABLE} -m virtualenv -p ${Python3_EXECUTABLE})
|
set(VIRTUALENV ${Python3_EXECUTABLE} -m venv)
|
||||||
endif()
|
endif()
|
||||||
find_package(Doxygen 1.8.10 REQUIRED)
|
find_package(Doxygen 1.8.10 REQUIRED)
|
||||||
|
|
||||||
file(GLOB DOC_SOURCES ${LAMMPS_DOC_DIR}/src/[^.]*.rst)
|
file(GLOB DOC_SOURCES ${CONFIGURE_DEPENDS} ${LAMMPS_DOC_DIR}/src/[^.]*.rst)
|
||||||
|
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
@ -56,16 +56,27 @@ if(BUILD_DOC)
|
|||||||
)
|
)
|
||||||
|
|
||||||
set(MATHJAX_URL "https://github.com/mathjax/MathJax/archive/3.1.3.tar.gz" CACHE STRING "URL for MathJax tarball")
|
set(MATHJAX_URL "https://github.com/mathjax/MathJax/archive/3.1.3.tar.gz" CACHE STRING "URL for MathJax tarball")
|
||||||
set(MATHJAX_MD5 "d1c98c746888bfd52ca8ebc10704f92f" CACHE STRING "MD5 checksum of MathJax tarball")
|
set(MATHJAX_MD5 "b81661c6e6ba06278e6ae37b30b0c492" CACHE STRING "MD5 checksum of MathJax tarball")
|
||||||
mark_as_advanced(MATHJAX_URL)
|
mark_as_advanced(MATHJAX_URL)
|
||||||
|
GetFallbackURL(MATHJAX_URL MATHJAX_FALLBACK)
|
||||||
|
|
||||||
# download mathjax distribution and unpack to folder "mathjax"
|
# download mathjax distribution and unpack to folder "mathjax"
|
||||||
if(NOT EXISTS ${DOC_BUILD_STATIC_DIR}/mathjax/es5)
|
if(NOT EXISTS ${DOC_BUILD_STATIC_DIR}/mathjax/es5)
|
||||||
file(DOWNLOAD ${MATHJAX_URL}
|
if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/mathjax.tar.gz)
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/mathjax.tar.gz"
|
file(MD5 ${CMAKE_CURRENT_BINARY_DIR}/mathjax.tar.gz)
|
||||||
EXPECTED_MD5 ${MATHJAX_MD5})
|
endif()
|
||||||
|
if(NOT "${DL_MD5}" STREQUAL "${MATHJAX_MD5}")
|
||||||
|
file(DOWNLOAD ${MATHJAX_URL} "${CMAKE_CURRENT_BINARY_DIR}/mathjax.tar.gz" STATUS DL_STATUS SHOW_PROGRESS)
|
||||||
|
file(MD5 ${CMAKE_CURRENT_BINARY_DIR}/mathjax.tar.gz DL_MD5)
|
||||||
|
if((NOT DL_STATUS EQUAL 0) OR (NOT "${DL_MD5}" STREQUAL "${MATHJAX_MD5}"))
|
||||||
|
message(WARNING "Download from primary URL ${MATHJAX_URL} failed\nTrying fallback URL ${MATHJAX_FALLBACK}")
|
||||||
|
file(DOWNLOAD ${MATHJAX_FALLBACK} ${CMAKE_BINARY_DIR}/libpace.tar.gz EXPECTED_HASH MD5=${MATHJAX_MD5} SHOW_PROGRESS)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(STATUS "Using already downloaded archive ${CMAKE_BINARY_DIR}/libpace.tar.gz")
|
||||||
|
endif()
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf mathjax.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf mathjax.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
file(GLOB MATHJAX_VERSION_DIR ${CMAKE_CURRENT_BINARY_DIR}/MathJax-*)
|
file(GLOB MATHJAX_VERSION_DIR ${CONFIGURE_DEPENDS} ${CMAKE_CURRENT_BINARY_DIR}/MathJax-*)
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E rename ${MATHJAX_VERSION_DIR} ${DOC_BUILD_STATIC_DIR}/mathjax)
|
execute_process(COMMAND ${CMAKE_COMMAND} -E rename ${MATHJAX_VERSION_DIR} ${DOC_BUILD_STATIC_DIR}/mathjax)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@ -9,8 +9,22 @@ function(ExternalCMakeProject target url hash basedir cmakedir cmakefile)
|
|||||||
|
|
||||||
get_filename_component(archive ${url} NAME)
|
get_filename_component(archive ${url} NAME)
|
||||||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/_deps/src)
|
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/_deps/src)
|
||||||
|
if(EXISTS ${CMAKE_BINARY_DIR}/_deps/${archive})
|
||||||
|
file(MD5 ${CMAKE_BINARY_DIR}/_deps/${archive} DL_MD5)
|
||||||
|
endif()
|
||||||
|
if(NOT "${DL_MD5}" STREQUAL "${hash}")
|
||||||
message(STATUS "Downloading ${url}")
|
message(STATUS "Downloading ${url}")
|
||||||
file(DOWNLOAD ${url} ${CMAKE_BINARY_DIR}/_deps/${archive} EXPECTED_HASH MD5=${hash} SHOW_PROGRESS)
|
file(DOWNLOAD ${url} ${CMAKE_BINARY_DIR}/_deps/${archive} STATUS DL_STATUS SHOW_PROGRESS)
|
||||||
|
file(MD5 ${CMAKE_BINARY_DIR}/_deps/${archive} DL_MD5)
|
||||||
|
if((NOT DL_STATUS EQUAL 0) OR (NOT "${DL_MD5}" STREQUAL "${hash}"))
|
||||||
|
set(${target}_URL ${url})
|
||||||
|
GetFallbackURL(${target}_URL fallback)
|
||||||
|
message(WARNING "Download from primary URL ${url} failed\nTrying fallback URL ${fallback}")
|
||||||
|
file(DOWNLOAD ${fallback} ${CMAKE_BINARY_DIR}/_deps/${archive} EXPECTED_HASH MD5=${hash} SHOW_PROGRESS)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(STATUS "Using already downloaded archive ${CMAKE_BINARY_DIR}/_deps/${archive}")
|
||||||
|
endif()
|
||||||
message(STATUS "Unpacking and configuring ${archive}")
|
message(STATUS "Unpacking and configuring ${archive}")
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_BINARY_DIR}/_deps/${archive}
|
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_BINARY_DIR}/_deps/${archive}
|
||||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/_deps/src)
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/_deps/src)
|
||||||
|
|||||||
@ -1,5 +1,10 @@
|
|||||||
# Find clang-format
|
# Find clang-format
|
||||||
find_program(ClangFormat_EXECUTABLE NAMES clang-format
|
find_program(ClangFormat_EXECUTABLE NAMES clang-format
|
||||||
|
clang-format-15.0
|
||||||
|
clang-format-14.0
|
||||||
|
clang-format-13.0
|
||||||
|
clang-format-12.0
|
||||||
|
clang-format-11.0
|
||||||
clang-format-10.0
|
clang-format-10.0
|
||||||
clang-format-9.0
|
clang-format-9.0
|
||||||
clang-format-8.0
|
clang-format-8.0
|
||||||
@ -14,19 +19,27 @@ if(ClangFormat_EXECUTABLE)
|
|||||||
OUTPUT_VARIABLE clang_format_version
|
OUTPUT_VARIABLE clang_format_version
|
||||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
|
if(clang_format_version MATCHES "^(Ubuntu |)clang-format version .*")
|
||||||
if(clang_format_version MATCHES "^clang-format version .*")
|
# Arch Linux output:
|
||||||
# Arch Linux
|
|
||||||
# clang-format version 10.0.0
|
# clang-format version 10.0.0
|
||||||
|
#
|
||||||
# Ubuntu 18.04 LTS Output
|
# Ubuntu 18.04 LTS output:
|
||||||
# clang-format version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
|
# clang-format version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
|
||||||
string(REGEX REPLACE "clang-format version ([0-9.]+).*"
|
#
|
||||||
"\\1"
|
# Ubuntu 20.04 LTS output:
|
||||||
|
# clang-format version 10.0.0-4ubuntu1
|
||||||
|
#
|
||||||
|
# Ubuntu 22.04 LTS output:
|
||||||
|
# Ubuntu clang-format version 14.0.0-1ubuntu1
|
||||||
|
#
|
||||||
|
# Fedora 36 output:
|
||||||
|
# clang-format version 14.0.5 (Fedora 14.0.5-1.fc36)
|
||||||
|
string(REGEX REPLACE "^(Ubuntu |)clang-format version ([0-9.]+).*"
|
||||||
|
"\\2"
|
||||||
ClangFormat_VERSION
|
ClangFormat_VERSION
|
||||||
"${clang_format_version}")
|
"${clang_format_version}")
|
||||||
elseif(clang_format_version MATCHES ".*LLVM version .*")
|
elseif(clang_format_version MATCHES ".*LLVM version .*")
|
||||||
# CentOS 7 Output
|
# CentOS 7 output:
|
||||||
# LLVM (http://llvm.org/):
|
# LLVM (http://llvm.org/):
|
||||||
# LLVM version 3.4.2
|
# LLVM version 3.4.2
|
||||||
# Optimized build.
|
# Optimized build.
|
||||||
|
|||||||
@ -22,7 +22,7 @@ endif()
|
|||||||
if(Python_EXECUTABLE)
|
if(Python_EXECUTABLE)
|
||||||
get_filename_component(_python_path ${Python_EXECUTABLE} PATH)
|
get_filename_component(_python_path ${Python_EXECUTABLE} PATH)
|
||||||
find_program(Cythonize_EXECUTABLE
|
find_program(Cythonize_EXECUTABLE
|
||||||
NAMES cythonize3 cythonize cythonize.bat
|
NAMES cythonize-${Python_VERSION_MAJOR}.${Python_VERSION_MINOR} cythonize3 cythonize cythonize.bat
|
||||||
HINTS ${_python_path})
|
HINTS ${_python_path})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@ -1,19 +0,0 @@
|
|||||||
find_path(ZMQ_INCLUDE_DIR zmq.h)
|
|
||||||
find_library(ZMQ_LIBRARY NAMES zmq)
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
find_package_handle_standard_args(ZMQ DEFAULT_MSG ZMQ_LIBRARY ZMQ_INCLUDE_DIR)
|
|
||||||
|
|
||||||
# Copy the results to the output variables and target.
|
|
||||||
if(ZMQ_FOUND)
|
|
||||||
set(ZMQ_LIBRARIES ${ZMQ_LIBRARY})
|
|
||||||
set(ZMQ_INCLUDE_DIRS ${ZMQ_INCLUDE_DIR})
|
|
||||||
|
|
||||||
if(NOT TARGET ZMQ::ZMQ)
|
|
||||||
add_library(ZMQ::ZMQ UNKNOWN IMPORTED)
|
|
||||||
set_target_properties(ZMQ::ZMQ PROPERTIES
|
|
||||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
|
||||||
IMPORTED_LOCATION "${ZMQ_LIBRARY}"
|
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${ZMQ_INCLUDE_DIR}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
251
cmake/Modules/LAMMPSInterfacePlugin.cmake
Normal file
251
cmake/Modules/LAMMPSInterfacePlugin.cmake
Normal file
@ -0,0 +1,251 @@
|
|||||||
|
# CMake script code to define LAMMPS settings required for building LAMMPS plugins
|
||||||
|
|
||||||
|
# enforce out-of-source build
|
||||||
|
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||||
|
message(FATAL_ERROR "In-source builds are not allowed. You must create and use a build directory. "
|
||||||
|
"Please remove CMakeCache.txt and CMakeFiles first.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(LAMMPS_THIRDPARTY_URL "https://download.lammps.org/thirdparty"
|
||||||
|
CACHE STRING "URL for thirdparty package downloads")
|
||||||
|
|
||||||
|
# global LAMMPS/plugin build settings
|
||||||
|
set(LAMMPS_SOURCE_DIR "" CACHE PATH "Location of LAMMPS sources folder")
|
||||||
|
if(NOT LAMMPS_SOURCE_DIR)
|
||||||
|
message(FATAL_ERROR "Must set LAMMPS_SOURCE_DIR")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# by default, install into $HOME/.local (not /usr/local),
|
||||||
|
# so that no root access (and sudo) is needed
|
||||||
|
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||||
|
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local" CACHE PATH "Default install path" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# ugly hacks for MSVC which by default always reports an old C++ standard in the __cplusplus macro
|
||||||
|
# and prints lots of pointless warnings about "unsafe" functions
|
||||||
|
if(MSVC)
|
||||||
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||||
|
add_compile_options(/Zc:__cplusplus)
|
||||||
|
add_compile_options(/wd4244)
|
||||||
|
add_compile_options(/wd4267)
|
||||||
|
if(LAMMPS_EXCEPTIONS)
|
||||||
|
add_compile_options(/EHsc)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# C++11 is required
|
||||||
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
# Need -restrict with Intel compilers
|
||||||
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -restrict")
|
||||||
|
endif()
|
||||||
|
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
|
||||||
|
|
||||||
|
#######
|
||||||
|
# helper functions from LAMMPSUtils.cmake
|
||||||
|
function(validate_option name values)
|
||||||
|
string(TOLOWER ${${name}} needle_lower)
|
||||||
|
string(TOUPPER ${${name}} needle_upper)
|
||||||
|
list(FIND ${values} ${needle_lower} IDX_LOWER)
|
||||||
|
list(FIND ${values} ${needle_upper} IDX_UPPER)
|
||||||
|
if(${IDX_LOWER} LESS 0 AND ${IDX_UPPER} LESS 0)
|
||||||
|
list_to_bulletpoints(POSSIBLE_VALUE_LIST ${${values}})
|
||||||
|
message(FATAL_ERROR "\n########################################################################\n"
|
||||||
|
"Invalid value '${${name}}' for option ${name}\n"
|
||||||
|
"\n"
|
||||||
|
"Possible values are:\n"
|
||||||
|
"${POSSIBLE_VALUE_LIST}"
|
||||||
|
"########################################################################")
|
||||||
|
endif()
|
||||||
|
endfunction(validate_option)
|
||||||
|
|
||||||
|
# helper function for getting the most recently modified file or folder from a glob pattern
|
||||||
|
function(get_newest_file path variable)
|
||||||
|
file(GLOB _dirs ${CONFIGURE_DEPENDS} ${path})
|
||||||
|
set(_besttime 2000-01-01T00:00:00)
|
||||||
|
set(_bestfile "<unknown>")
|
||||||
|
foreach(_dir ${_dirs})
|
||||||
|
file(TIMESTAMP ${_dir} _newtime)
|
||||||
|
if(_newtime IS_NEWER_THAN _besttime)
|
||||||
|
set(_bestfile ${_dir})
|
||||||
|
set(_besttime ${_newtime})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
if(_bestfile STREQUAL "<unknown>")
|
||||||
|
message(FATAL_ERROR "Could not find valid path at: ${path}")
|
||||||
|
endif()
|
||||||
|
set(${variable} ${_bestfile} PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# get LAMMPS version date
|
||||||
|
function(get_lammps_version version_header variable)
|
||||||
|
file(STRINGS ${version_header} line REGEX LAMMPS_VERSION)
|
||||||
|
string(REGEX REPLACE "#define LAMMPS_VERSION \"([0-9]+) ([A-Za-z]+) ([0-9]+)\"" "\\1\\2\\3" date "${line}")
|
||||||
|
set(${variable} "${date}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# determine canonical URL for downloading backup copy from download.lammps.org/thirdparty
|
||||||
|
function(GetFallbackURL input output)
|
||||||
|
string(REPLACE "_URL" "" _tmp ${input})
|
||||||
|
string(TOLOWER ${_tmp} libname)
|
||||||
|
string(REGEX REPLACE "^https://.*/([^/]+gz)" "${LAMMPS_THIRDPARTY_URL}/${libname}-\\1" newurl "${${input}}")
|
||||||
|
if ("${newurl}" STREQUAL "${${input}}")
|
||||||
|
set(${output} "" PARENT_SCOPE)
|
||||||
|
else()
|
||||||
|
set(${output} ${newurl} PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endfunction(GetFallbackURL)
|
||||||
|
|
||||||
|
#################################################################################
|
||||||
|
# LAMMPS C++ interface. We only need the header related parts except on windows.
|
||||||
|
add_library(lammps INTERFACE)
|
||||||
|
target_include_directories(lammps INTERFACE ${LAMMPS_SOURCE_DIR})
|
||||||
|
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING)
|
||||||
|
target_link_libraries(lammps INTERFACE ${CMAKE_BINARY_DIR}/../liblammps.dll.a)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# MPI configuration
|
||||||
|
if(NOT CMAKE_CROSSCOMPILING)
|
||||||
|
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)
|
||||||
|
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)
|
||||||
|
# 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)
|
||||||
|
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()
|
||||||
|
# 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()
|
||||||
|
else()
|
||||||
|
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)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
target_link_libraries(lammps INTERFACE MPI::MPI_CXX)
|
||||||
|
else()
|
||||||
|
add_library(mpi_stubs INTERFACE)
|
||||||
|
target_include_directories(mpi_stubs INTERFACE $<BUILD_INTERFACE:${LAMMPS_SOURCE_DIR}/STUBS>)
|
||||||
|
target_link_libraries(lammps INTERFACE mpi_stubs)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# detect if we may enable OpenMP support by default
|
||||||
|
set(BUILD_OMP_DEFAULT OFF)
|
||||||
|
find_package(OpenMP QUIET)
|
||||||
|
if(OpenMP_FOUND)
|
||||||
|
check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE)
|
||||||
|
if(HAVE_OMP_H_INCLUDE)
|
||||||
|
set(BUILD_OMP_DEFAULT ON)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
option(BUILD_OMP "Build with OpenMP support" ${BUILD_OMP_DEFAULT})
|
||||||
|
|
||||||
|
if(BUILD_OMP)
|
||||||
|
find_package(OpenMP REQUIRED)
|
||||||
|
check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE)
|
||||||
|
if(NOT HAVE_OMP_H_INCLUDE)
|
||||||
|
message(FATAL_ERROR "Cannot find the 'omp.h' header file required for full OpenMP support")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0)) OR
|
||||||
|
(CMAKE_CXX_COMPILER_ID STREQUAL "PGI") OR
|
||||||
|
((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)) OR
|
||||||
|
((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0)))
|
||||||
|
# GCC 9.x and later plus Clang 10.x and later implement strict OpenMP 4.0 semantics for consts.
|
||||||
|
# Intel 18.0 was tested to support both, so we switch to OpenMP 4+ from 19.x onward to be safe.
|
||||||
|
target_compile_definitions(lammps INTERFACE -DLAMMPS_OMP_COMPAT=4)
|
||||||
|
else()
|
||||||
|
target_compile_definitions(lammps INTERFACE -DLAMMPS_OMP_COMPAT=3)
|
||||||
|
endif()
|
||||||
|
target_link_libraries(lammps INTERFACE OpenMP::OpenMP_CXX)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
################
|
||||||
|
# integer size selection
|
||||||
|
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)
|
||||||
|
target_compile_definitions(lammps INTERFACE -DLAMMPS_${LAMMPS_SIZES})
|
||||||
@ -24,6 +24,39 @@ function(validate_option name values)
|
|||||||
endif()
|
endif()
|
||||||
endfunction(validate_option)
|
endfunction(validate_option)
|
||||||
|
|
||||||
|
# helper function to check for usable omp.h header
|
||||||
|
function(check_omp_h_include)
|
||||||
|
find_package(OpenMP COMPONENTS CXX QUIET)
|
||||||
|
if(OpenMP_CXX_FOUND)
|
||||||
|
set(CMAKE_REQUIRED_FLAGS ${OpenMP_CXX_FLAGS})
|
||||||
|
set(CMAKE_REQUIRED_INCLUDES ${OpenMP_CXX_INCLUDE_DIRS})
|
||||||
|
set(CMAKE_REQUIRED_LINK_OPTIONS ${OpenMP_CXX_FLAGS})
|
||||||
|
set(CMAKE_REQUIRED_LIBRARIES ${OpenMP_CXX_LIBRARIES})
|
||||||
|
check_include_file_cxx(omp.h _have_omp_h)
|
||||||
|
else()
|
||||||
|
set(_have_omp_h FALSE)
|
||||||
|
endif()
|
||||||
|
set(HAVE_OMP_H_INCLUDE ${_have_omp_h} PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# helper function for getting the most recently modified file or folder from a glob pattern
|
||||||
|
function(get_newest_file path variable)
|
||||||
|
file(GLOB _dirs ${CONFIGURE_DEPENDS} ${path})
|
||||||
|
set(_besttime 2000-01-01T00:00:00)
|
||||||
|
set(_bestfile "<unknown>")
|
||||||
|
foreach(_dir ${_dirs})
|
||||||
|
file(TIMESTAMP ${_dir} _newtime)
|
||||||
|
if(_newtime IS_NEWER_THAN _besttime)
|
||||||
|
set(_bestfile ${_dir})
|
||||||
|
set(_besttime ${_newtime})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
if(_bestfile STREQUAL "<unknown>")
|
||||||
|
message(FATAL_ERROR "Could not find valid path at: ${path}")
|
||||||
|
endif()
|
||||||
|
set(${variable} ${_bestfile} PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
function(get_lammps_version version_header variable)
|
function(get_lammps_version version_header variable)
|
||||||
file(STRINGS ${version_header} line REGEX LAMMPS_VERSION)
|
file(STRINGS ${version_header} line REGEX LAMMPS_VERSION)
|
||||||
set(MONTHS x Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)
|
set(MONTHS x Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)
|
||||||
@ -47,8 +80,8 @@ endfunction()
|
|||||||
|
|
||||||
function(check_for_autogen_files source_dir)
|
function(check_for_autogen_files source_dir)
|
||||||
message(STATUS "Running check for auto-generated files from make-based build system")
|
message(STATUS "Running check for auto-generated files from make-based build system")
|
||||||
file(GLOB SRC_AUTOGEN_FILES ${source_dir}/style_*.h)
|
file(GLOB SRC_AUTOGEN_FILES ${CONFIGURE_DEPENDS} ${source_dir}/style_*.h)
|
||||||
file(GLOB SRC_AUTOGEN_PACKAGES ${source_dir}/packages_*.h)
|
file(GLOB SRC_AUTOGEN_PACKAGES ${CONFIGURE_DEPENDS} ${source_dir}/packages_*.h)
|
||||||
list(APPEND SRC_AUTOGEN_FILES ${SRC_AUTOGEN_PACKAGES} ${source_dir}/lmpinstalledpkgs.h ${source_dir}/lmpgitversion.h)
|
list(APPEND SRC_AUTOGEN_FILES ${SRC_AUTOGEN_PACKAGES} ${source_dir}/lmpinstalledpkgs.h ${source_dir}/lmpgitversion.h)
|
||||||
list(APPEND SRC_AUTOGEN_FILES ${SRC_AUTOGEN_PACKAGES} ${source_dir}/mliap_model_python_couple.h ${source_dir}/mliap_model_python_couple.cpp)
|
list(APPEND SRC_AUTOGEN_FILES ${SRC_AUTOGEN_PACKAGES} ${source_dir}/mliap_model_python_couple.h ${source_dir}/mliap_model_python_couple.cpp)
|
||||||
foreach(_SRC ${SRC_AUTOGEN_FILES})
|
foreach(_SRC ${SRC_AUTOGEN_FILES})
|
||||||
@ -67,7 +100,7 @@ endfunction()
|
|||||||
|
|
||||||
macro(pkg_depends PKG1 PKG2)
|
macro(pkg_depends PKG1 PKG2)
|
||||||
if(PKG_${PKG1} AND NOT (PKG_${PKG2} OR BUILD_${PKG2}))
|
if(PKG_${PKG1} AND NOT (PKG_${PKG2} OR BUILD_${PKG2}))
|
||||||
message(FATAL_ERROR "The ${PKG1} package needs LAMMPS to be build with the ${PKG2} package")
|
message(FATAL_ERROR "The ${PKG1} package needs LAMMPS to be built with the ${PKG2} package")
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
@ -92,14 +125,16 @@ function(FetchPotentials pkgfolder potfolder)
|
|||||||
math(EXPR plusone "${blank}+1")
|
math(EXPR plusone "${blank}+1")
|
||||||
string(SUBSTRING ${line} 0 ${blank} pot)
|
string(SUBSTRING ${line} 0 ${blank} pot)
|
||||||
string(SUBSTRING ${line} ${plusone} -1 sum)
|
string(SUBSTRING ${line} ${plusone} -1 sum)
|
||||||
if(EXISTS ${LAMMPS_POTENTIALS_DIR}/${pot})
|
if(EXISTS "${LAMMPS_POTENTIALS_DIR}/${pot}")
|
||||||
file(MD5 "${LAMMPS_POTENTIALS_DIR}/${pot}" oldsum)
|
file(MD5 "${LAMMPS_POTENTIALS_DIR}/${pot}" oldsum)
|
||||||
endif()
|
endif()
|
||||||
if(NOT sum STREQUAL oldsum)
|
if(NOT sum STREQUAL oldsum)
|
||||||
message(STATUS "Checking external potential ${pot} from ${LAMMPS_POTENTIALS_URL}")
|
message(STATUS "Downloading external potential ${pot} from ${LAMMPS_POTENTIALS_URL}")
|
||||||
file(DOWNLOAD "${LAMMPS_POTENTIALS_URL}/${pot}.${sum}" "${CMAKE_BINARY_DIR}/${pot}"
|
string(MD5 TMP_EXT "${CMAKE_BINARY_DIR}")
|
||||||
|
file(DOWNLOAD "${LAMMPS_POTENTIALS_URL}/${pot}.${sum}" "${CMAKE_BINARY_DIR}/${pot}.${TMP_EXT}"
|
||||||
EXPECTED_HASH MD5=${sum} SHOW_PROGRESS)
|
EXPECTED_HASH MD5=${sum} SHOW_PROGRESS)
|
||||||
file(COPY "${CMAKE_BINARY_DIR}/${pot}" DESTINATION ${LAMMPS_POTENTIALS_DIR})
|
file(COPY "${CMAKE_BINARY_DIR}/${pot}.${TMP_EXT}" DESTINATION "${LAMMPS_POTENTIALS_DIR}")
|
||||||
|
file(RENAME "${LAMMPS_POTENTIALS_DIR}/${pot}.${TMP_EXT}" "${LAMMPS_POTENTIALS_DIR}/${pot}")
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
@ -114,3 +149,15 @@ if((CMAKE_SYSTEM_NAME STREQUAL "Linux") AND (EXISTS /etc/os-release))
|
|||||||
set(CMAKE_LINUX_DISTRO ${distro})
|
set(CMAKE_LINUX_DISTRO ${distro})
|
||||||
set(CMAKE_DISTRO_VERSION ${disversion})
|
set(CMAKE_DISTRO_VERSION ${disversion})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# determine canonical URL for downloading backup copy from download.lammps.org/thirdparty
|
||||||
|
function(GetFallbackURL input output)
|
||||||
|
string(REPLACE "_URL" "" _tmp ${input})
|
||||||
|
string(TOLOWER ${_tmp} libname)
|
||||||
|
string(REGEX REPLACE "^https://.*/([^/]+gz)" "${LAMMPS_THIRDPARTY_URL}/${libname}-\\1" newurl "${${input}}")
|
||||||
|
if ("${newurl}" STREQUAL "${${input}}")
|
||||||
|
set(${output} "" PARENT_SCOPE)
|
||||||
|
else()
|
||||||
|
set(${output} ${newurl} PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endfunction(GetFallbackURL)
|
||||||
|
|||||||
@ -1,5 +1,39 @@
|
|||||||
# Download and configure custom MPICH files for Windows
|
# Download and configure MinGW compatible MPICH development files for Windows
|
||||||
message(STATUS "Downloading and configuring MPICH-1.4.1 for Windows")
|
option(USE_MSMPI "Use Microsoft's MS-MPI SDK instead of MPICH2-1.4.1" OFF)
|
||||||
|
|
||||||
|
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(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_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_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_WIN64_DEVEL_MD5 "4939fdb59d13182fd5dd65211e469f14" CACHE STRING "MD5 checksum of MPICH2 (win64) tarball")
|
||||||
@ -37,3 +71,4 @@ add_dependencies(MPI::MPI_CXX mpi4win_build)
|
|||||||
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
|
set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include")
|
||||||
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
||||||
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a")
|
set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a")
|
||||||
|
endif()
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
set(COLVARS_SOURCE_DIR ${LAMMPS_LIB_SOURCE_DIR}/colvars)
|
set(COLVARS_SOURCE_DIR ${LAMMPS_LIB_SOURCE_DIR}/colvars)
|
||||||
|
|
||||||
file(GLOB COLVARS_SOURCES ${COLVARS_SOURCE_DIR}/[^.]*.cpp)
|
file(GLOB COLVARS_SOURCES ${CONFIGURE_DEPENDS} ${COLVARS_SOURCE_DIR}/[^.]*.cpp)
|
||||||
|
|
||||||
option(COLVARS_DEBUG "Debugging messages for Colvars (quite verbose)" OFF)
|
option(COLVARS_DEBUG "Debugging messages for Colvars (quite verbose)" OFF)
|
||||||
|
|
||||||
@ -9,7 +9,7 @@ option(COLVARS_LEPTON "Build and link the Lepton library" ON)
|
|||||||
|
|
||||||
if(COLVARS_LEPTON)
|
if(COLVARS_LEPTON)
|
||||||
set(LEPTON_DIR ${LAMMPS_LIB_SOURCE_DIR}/colvars/lepton)
|
set(LEPTON_DIR ${LAMMPS_LIB_SOURCE_DIR}/colvars/lepton)
|
||||||
file(GLOB LEPTON_SOURCES ${LEPTON_DIR}/src/[^.]*.cpp)
|
file(GLOB LEPTON_SOURCES ${CONFIGURE_DEPENDS} ${LEPTON_DIR}/src/[^.]*.cpp)
|
||||||
add_library(lepton STATIC ${LEPTON_SOURCES})
|
add_library(lepton STATIC ${LEPTON_SOURCES})
|
||||||
# Change the define below to LEPTON_BUILDING_SHARED_LIBRARY when linking Lepton as a DLL with MSVC
|
# Change the define below to LEPTON_BUILDING_SHARED_LIBRARY when linking Lepton as a DLL with MSVC
|
||||||
target_compile_definitions(lepton PRIVATE -DLEPTON_BUILDING_STATIC_LIBRARY)
|
target_compile_definitions(lepton PRIVATE -DLEPTON_BUILDING_STATIC_LIBRARY)
|
||||||
@ -19,6 +19,10 @@ endif()
|
|||||||
|
|
||||||
add_library(colvars STATIC ${COLVARS_SOURCES})
|
add_library(colvars STATIC ${COLVARS_SOURCES})
|
||||||
target_compile_definitions(colvars PRIVATE -DCOLVARS_LAMMPS)
|
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})
|
set_target_properties(colvars PROPERTIES OUTPUT_NAME lammps_colvars${LAMMPS_MACHINE})
|
||||||
target_include_directories(colvars PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/colvars)
|
target_include_directories(colvars PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/colvars)
|
||||||
# The line below is needed to locate math_eigen_impl.h
|
# The line below is needed to locate math_eigen_impl.h
|
||||||
|
|||||||
@ -1,4 +1,9 @@
|
|||||||
find_package(ZLIB REQUIRED)
|
find_package(ZLIB)
|
||||||
|
if(NOT ZLIB_FOUND)
|
||||||
|
message(WARNING "No Zlib development support found. Disabling COMPRESS package...")
|
||||||
|
set(PKG_COMPRESS OFF CACHE BOOL "" FORCE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
target_link_libraries(lammps PRIVATE ZLIB::ZLIB)
|
target_link_libraries(lammps PRIVATE ZLIB::ZLIB)
|
||||||
|
|
||||||
find_package(PkgConfig QUIET)
|
find_package(PkgConfig QUIET)
|
||||||
|
|||||||
@ -26,7 +26,10 @@ elseif(GPU_PREC STREQUAL "SINGLE")
|
|||||||
set(GPU_PREC_SETTING "SINGLE_SINGLE")
|
set(GPU_PREC_SETTING "SINGLE_SINGLE")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
file(GLOB GPU_LIB_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cpp)
|
option(GPU_DEBUG "Enable debugging code of the GPU package" OFF)
|
||||||
|
mark_as_advanced(GPU_DEBUG)
|
||||||
|
|
||||||
|
file(GLOB GPU_LIB_SOURCES ${CONFIGURE_DEPENDS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cpp)
|
||||||
file(MAKE_DIRECTORY ${LAMMPS_LIB_BINARY_DIR}/gpu)
|
file(MAKE_DIRECTORY ${LAMMPS_LIB_BINARY_DIR}/gpu)
|
||||||
|
|
||||||
if(GPU_API STREQUAL "CUDA")
|
if(GPU_API STREQUAL "CUDA")
|
||||||
@ -55,7 +58,7 @@ if(GPU_API STREQUAL "CUDA")
|
|||||||
set(GPU_ARCH "sm_50" CACHE STRING "LAMMPS GPU CUDA SM primary architecture (e.g. sm_60)")
|
set(GPU_ARCH "sm_50" CACHE STRING "LAMMPS GPU CUDA SM primary architecture (e.g. sm_60)")
|
||||||
|
|
||||||
# ensure that no *cubin.h files exist from a compile in the lib/gpu folder
|
# ensure that no *cubin.h files exist from a compile in the lib/gpu folder
|
||||||
file(GLOB GPU_LIB_OLD_CUBIN_HEADERS ${LAMMPS_LIB_SOURCE_DIR}/gpu/*_cubin.h)
|
file(GLOB GPU_LIB_OLD_CUBIN_HEADERS ${CONFIGURE_DEPENDS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/*_cubin.h)
|
||||||
if(GPU_LIB_OLD_CUBIN_HEADERS)
|
if(GPU_LIB_OLD_CUBIN_HEADERS)
|
||||||
message(FATAL_ERROR "########################################################################\n"
|
message(FATAL_ERROR "########################################################################\n"
|
||||||
"Found file(s) generated by the make-based build system in lib/gpu\n"
|
"Found file(s) generated by the make-based build system in lib/gpu\n"
|
||||||
@ -65,29 +68,32 @@ if(GPU_API STREQUAL "CUDA")
|
|||||||
"########################################################################")
|
"########################################################################")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu ${CMAKE_CURRENT_SOURCE_DIR}/gpu/[^.]*.cu)
|
file(GLOB GPU_LIB_CU ${CONFIGURE_DEPENDS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu ${CMAKE_CURRENT_SOURCE_DIR}/gpu/[^.]*.cu)
|
||||||
list(REMOVE_ITEM GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_pppm.cu)
|
list(REMOVE_ITEM GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_pppm.cu)
|
||||||
|
|
||||||
cuda_include_directories(${LAMMPS_LIB_SOURCE_DIR}/gpu ${LAMMPS_LIB_BINARY_DIR}/gpu)
|
cuda_include_directories(${LAMMPS_LIB_SOURCE_DIR}/gpu ${LAMMPS_LIB_BINARY_DIR}/gpu)
|
||||||
|
|
||||||
if(CUDPP_OPT)
|
if(CUDPP_OPT)
|
||||||
cuda_include_directories(${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini)
|
cuda_include_directories(${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini)
|
||||||
file(GLOB GPU_LIB_CUDPP_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini/[^.]*.cpp)
|
file(GLOB GPU_LIB_CUDPP_SOURCES ${CONFIGURE_DEPENDS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini/[^.]*.cpp)
|
||||||
file(GLOB GPU_LIB_CUDPP_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini/[^.]*.cu)
|
file(GLOB GPU_LIB_CUDPP_CU ${CONFIGURE_DEPENDS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini/[^.]*.cu)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# build arch/gencode commands for nvcc based on CUDA toolkit version and use choice
|
# build arch/gencode commands for nvcc based on CUDA toolkit version and use choice
|
||||||
# --arch translates directly instead of JIT, so this should be for the preferred or most common architecture
|
# --arch translates directly instead of JIT, so this should be for the preferred or most common architecture
|
||||||
set(GPU_CUDA_GENCODE "-arch=${GPU_ARCH}")
|
set(GPU_CUDA_GENCODE "-arch=${GPU_ARCH}")
|
||||||
|
|
||||||
# apply the following to build "fat" CUDA binaries only for known CUDA toolkits
|
# apply the following to build "fat" CUDA binaries only for known CUDA toolkits since version 8.0
|
||||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
|
# only the Kepler achitecture and beyond is supported
|
||||||
message(WARNING "Untested CUDA Toolkit version. Use at your own risk")
|
# comparison chart according to: https://en.wikipedia.org/wiki/CUDA#GPUs_supported
|
||||||
|
if(CUDA_VERSION VERSION_LESS 8.0)
|
||||||
|
message(FATAL_ERROR "CUDA Toolkit version 8.0 or later is required")
|
||||||
|
elseif(CUDA_VERSION VERSION_GREATER_EQUAL "13.0")
|
||||||
|
message(WARNING "Untested CUDA Toolkit version ${CUDA_VERSION}. Use at your own risk")
|
||||||
|
set(GPU_CUDA_GENCODE "-arch=all")
|
||||||
|
elseif(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
|
||||||
|
set(GPU_CUDA_GENCODE "-arch=all")
|
||||||
else()
|
else()
|
||||||
# Fermi (GPU Arch 2.x) is supported by CUDA 3.2 to CUDA 8.0
|
|
||||||
if((CUDA_VERSION VERSION_GREATER_EQUAL "3.2") AND (CUDA_VERSION VERSION_LESS "9.0"))
|
|
||||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_20,code=[sm_20,compute_20] ")
|
|
||||||
endif()
|
|
||||||
# Kepler (GPU Arch 3.0) is supported by CUDA 5 to CUDA 10.2
|
# Kepler (GPU Arch 3.0) is supported by CUDA 5 to CUDA 10.2
|
||||||
if((CUDA_VERSION VERSION_GREATER_EQUAL "5.0") AND (CUDA_VERSION VERSION_LESS "11.0"))
|
if((CUDA_VERSION VERSION_GREATER_EQUAL "5.0") AND (CUDA_VERSION VERSION_LESS "11.0"))
|
||||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_30,code=[sm_30,compute_30] ")
|
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_30,code=[sm_30,compute_30] ")
|
||||||
@ -120,6 +126,14 @@ if(GPU_API STREQUAL "CUDA")
|
|||||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.1")
|
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.1")
|
||||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_86,code=[sm_86,compute_86]")
|
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_86,code=[sm_86,compute_86]")
|
||||||
endif()
|
endif()
|
||||||
|
# Lovelace (GPU Arch 8.9) is supported by CUDA 11.8 and later
|
||||||
|
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.8")
|
||||||
|
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_90,code=[sm_90,compute_90]")
|
||||||
|
endif()
|
||||||
|
# Hopper (GPU Arch 9.0) is supported by CUDA 12.0 and later
|
||||||
|
if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
|
||||||
|
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_90,code=[sm_90,compute_90]")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
cuda_compile_fatbin(GPU_GEN_OBJS ${GPU_LIB_CU} OPTIONS ${CUDA_REQUEST_PIC}
|
cuda_compile_fatbin(GPU_GEN_OBJS ${GPU_LIB_CU} OPTIONS ${CUDA_REQUEST_PIC}
|
||||||
@ -142,14 +156,17 @@ if(GPU_API STREQUAL "CUDA")
|
|||||||
add_library(gpu STATIC ${GPU_LIB_SOURCES} ${GPU_LIB_CUDPP_SOURCES} ${GPU_OBJS})
|
add_library(gpu STATIC ${GPU_LIB_SOURCES} ${GPU_LIB_CUDPP_SOURCES} ${GPU_OBJS})
|
||||||
target_link_libraries(gpu PRIVATE ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY})
|
target_link_libraries(gpu PRIVATE ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY})
|
||||||
target_include_directories(gpu PRIVATE ${LAMMPS_LIB_BINARY_DIR}/gpu ${CUDA_INCLUDE_DIRS})
|
target_include_directories(gpu PRIVATE ${LAMMPS_LIB_BINARY_DIR}/gpu ${CUDA_INCLUDE_DIRS})
|
||||||
target_compile_definitions(gpu PRIVATE -DUSE_CUDA -D_${GPU_PREC_SETTING} -DMPI_GERYON -DUCL_NO_EXIT ${GPU_CUDA_MPS_FLAGS})
|
target_compile_definitions(gpu PRIVATE -DUSE_CUDA -D_${GPU_PREC_SETTING} ${GPU_CUDA_MPS_FLAGS})
|
||||||
|
if(GPU_DEBUG)
|
||||||
|
target_compile_definitions(gpu PRIVATE -DUCL_DEBUG -DGERYON_KERNEL_DUMP)
|
||||||
|
else()
|
||||||
|
target_compile_definitions(gpu PRIVATE -DMPI_GERYON -DUCL_NO_EXIT)
|
||||||
|
endif()
|
||||||
if(CUDPP_OPT)
|
if(CUDPP_OPT)
|
||||||
target_include_directories(gpu PRIVATE ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini)
|
target_include_directories(gpu PRIVATE ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini)
|
||||||
target_compile_definitions(gpu PRIVATE -DUSE_CUDPP)
|
target_compile_definitions(gpu PRIVATE -DUSE_CUDPP)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(lammps PRIVATE gpu)
|
|
||||||
|
|
||||||
add_executable(nvc_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp)
|
add_executable(nvc_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp)
|
||||||
target_compile_definitions(nvc_get_devices PRIVATE -DUCL_CUDADR)
|
target_compile_definitions(nvc_get_devices PRIVATE -DUCL_CUDADR)
|
||||||
target_link_libraries(nvc_get_devices PRIVATE ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY})
|
target_link_libraries(nvc_get_devices PRIVATE ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY})
|
||||||
@ -174,7 +191,7 @@ elseif(GPU_API STREQUAL "OPENCL")
|
|||||||
include(OpenCLUtils)
|
include(OpenCLUtils)
|
||||||
set(OCL_COMMON_HEADERS ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_preprocessor.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_aux_fun1.h)
|
set(OCL_COMMON_HEADERS ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_preprocessor.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_aux_fun1.h)
|
||||||
|
|
||||||
file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu)
|
file(GLOB GPU_LIB_CU ${CONFIGURE_DEPENDS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu)
|
||||||
list(REMOVE_ITEM GPU_LIB_CU
|
list(REMOVE_ITEM GPU_LIB_CU
|
||||||
${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_gayberne.cu
|
${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_gayberne.cu
|
||||||
${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_gayberne_lj.cu
|
${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_gayberne_lj.cu
|
||||||
@ -213,19 +230,23 @@ elseif(GPU_API STREQUAL "OPENCL")
|
|||||||
add_library(gpu STATIC ${GPU_LIB_SOURCES})
|
add_library(gpu STATIC ${GPU_LIB_SOURCES})
|
||||||
target_link_libraries(gpu PRIVATE OpenCL::OpenCL)
|
target_link_libraries(gpu PRIVATE OpenCL::OpenCL)
|
||||||
target_include_directories(gpu PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/gpu)
|
target_include_directories(gpu PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/gpu)
|
||||||
target_compile_definitions(gpu PRIVATE -D_${GPU_PREC_SETTING} -DMPI_GERYON -DGERYON_NUMA_FISSION -DUCL_NO_EXIT)
|
target_compile_definitions(gpu PRIVATE -DUSE_OPENCL -D_${GPU_PREC_SETTING})
|
||||||
target_compile_definitions(gpu PRIVATE -DUSE_OPENCL)
|
if(GPU_DEBUG)
|
||||||
|
target_compile_definitions(gpu PRIVATE -DUCL_DEBUG -DGERYON_KERNEL_DUMP)
|
||||||
target_link_libraries(lammps PRIVATE gpu)
|
else()
|
||||||
|
target_compile_definitions(gpu PRIVATE -DMPI_GERYON -DGERYON_NUMA_FISSION -DUCL_NO_EXIT)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_executable(ocl_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp)
|
add_executable(ocl_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp)
|
||||||
target_compile_definitions(ocl_get_devices PRIVATE -DUCL_OPENCL)
|
target_compile_definitions(ocl_get_devices PRIVATE -DUCL_OPENCL)
|
||||||
target_link_libraries(ocl_get_devices PRIVATE OpenCL::OpenCL)
|
target_link_libraries(ocl_get_devices PRIVATE OpenCL::OpenCL)
|
||||||
add_dependencies(ocl_get_devices OpenCL::OpenCL)
|
add_dependencies(ocl_get_devices OpenCL::OpenCL)
|
||||||
|
|
||||||
elseif(GPU_API STREQUAL "HIP")
|
elseif(GPU_API STREQUAL "HIP")
|
||||||
if(NOT DEFINED HIP_PATH)
|
if(NOT DEFINED HIP_PATH)
|
||||||
if(NOT DEFINED ENV{HIP_PATH})
|
if(NOT DEFINED ENV{HIP_PATH})
|
||||||
set(HIP_PATH "/opt/rocm/hip" CACHE PATH "Path to HIP installation")
|
message(FATAL_ERROR "GPU_API=HIP requires HIP_PATH to be defined.\n"
|
||||||
|
"Either pass the HIP_PATH as a CMake option via -DHIP_PATH=... or set the HIP_PATH environment variable.")
|
||||||
else()
|
else()
|
||||||
set(HIP_PATH $ENV{HIP_PATH} CACHE PATH "Path to HIP installation")
|
set(HIP_PATH $ENV{HIP_PATH} CACHE PATH "Path to HIP installation")
|
||||||
endif()
|
endif()
|
||||||
@ -253,17 +274,22 @@ elseif(GPU_API STREQUAL "HIP")
|
|||||||
|
|
||||||
if(HIP_PLATFORM STREQUAL "hcc" OR HIP_PLATFORM STREQUAL "amd")
|
if(HIP_PLATFORM STREQUAL "hcc" OR HIP_PLATFORM STREQUAL "amd")
|
||||||
set(HIP_ARCH "gfx906" CACHE STRING "HIP target architecture")
|
set(HIP_ARCH "gfx906" CACHE STRING "HIP target architecture")
|
||||||
|
elseif(HIP_PLATFORM STREQUAL "spirv")
|
||||||
|
set(HIP_ARCH "spirv" CACHE STRING "HIP target architecture")
|
||||||
elseif(HIP_PLATFORM STREQUAL "nvcc")
|
elseif(HIP_PLATFORM STREQUAL "nvcc")
|
||||||
find_package(CUDA REQUIRED)
|
find_package(CUDA REQUIRED)
|
||||||
set(HIP_ARCH "sm_50" CACHE STRING "HIP primary CUDA architecture (e.g. sm_60)")
|
set(HIP_ARCH "sm_50" CACHE STRING "HIP primary CUDA architecture (e.g. sm_60)")
|
||||||
|
|
||||||
|
if(CUDA_VERSION VERSION_LESS 8.0)
|
||||||
|
message(FATAL_ERROR "CUDA Toolkit version 8.0 or later is required")
|
||||||
|
elseif(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
|
||||||
|
message(WARNING "Untested CUDA Toolkit version ${CUDA_VERSION}. Use at your own risk")
|
||||||
|
set(HIP_CUDA_GENCODE "-arch=all")
|
||||||
|
else()
|
||||||
# build arch/gencode commands for nvcc based on CUDA toolkit version and use choice
|
# build arch/gencode commands for nvcc based on CUDA toolkit version and use choice
|
||||||
# --arch translates directly instead of JIT, so this should be for the preferred or most common architecture
|
# --arch translates directly instead of JIT, so this should be for the preferred or most common architecture
|
||||||
|
# comparison chart according to: https://en.wikipedia.org/wiki/CUDA#GPUs_supported
|
||||||
set(HIP_CUDA_GENCODE "-arch=${HIP_ARCH}")
|
set(HIP_CUDA_GENCODE "-arch=${HIP_ARCH}")
|
||||||
# Fermi (GPU Arch 2.x) is supported by CUDA 3.2 to CUDA 8.0
|
|
||||||
if((CUDA_VERSION VERSION_GREATER_EQUAL "3.2") AND (CUDA_VERSION VERSION_LESS "9.0"))
|
|
||||||
string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_20,code=[sm_20,compute_20]")
|
|
||||||
endif()
|
|
||||||
# Kepler (GPU Arch 3.0) is supported by CUDA 5 to CUDA 10.2
|
# Kepler (GPU Arch 3.0) is supported by CUDA 5 to CUDA 10.2
|
||||||
if((CUDA_VERSION VERSION_GREATER_EQUAL "5.0") AND (CUDA_VERSION VERSION_LESS "11.0"))
|
if((CUDA_VERSION VERSION_GREATER_EQUAL "5.0") AND (CUDA_VERSION VERSION_LESS "11.0"))
|
||||||
string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_30,code=[sm_30,compute_30]")
|
string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_30,code=[sm_30,compute_30]")
|
||||||
@ -292,12 +318,22 @@ elseif(GPU_API STREQUAL "HIP")
|
|||||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0")
|
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0")
|
||||||
string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_80,code=[sm_80,compute_80]")
|
string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_80,code=[sm_80,compute_80]")
|
||||||
endif()
|
endif()
|
||||||
|
# Ampere (GPU Arch 8.6) is supported by CUDA 11.1 and later
|
||||||
|
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.1")
|
||||||
|
string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_86,code=[sm_86,compute_86]")
|
||||||
|
endif()
|
||||||
|
# Lovelace (GPU Arch 8.9) is supported by CUDA 11.8 and later
|
||||||
|
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.8")
|
||||||
|
string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_90,code=[sm_90,compute_90]")
|
||||||
|
endif()
|
||||||
|
# Hopper (GPU Arch 9.0) is supported by CUDA 12.0 and later
|
||||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
|
if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
|
||||||
message(WARNING "Unsupported CUDA version. Use at your own risk.")
|
string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_90,code=[sm_90,compute_90]")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu ${CMAKE_CURRENT_SOURCE_DIR}/gpu/[^.]*.cu)
|
file(GLOB GPU_LIB_CU ${CONFIGURE_DEPENDS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu ${CMAKE_CURRENT_SOURCE_DIR}/gpu/[^.]*.cu)
|
||||||
list(REMOVE_ITEM GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_pppm.cu)
|
list(REMOVE_ITEM GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_pppm.cu)
|
||||||
|
|
||||||
set(GPU_LIB_CU_HIP "")
|
set(GPU_LIB_CU_HIP "")
|
||||||
@ -328,6 +364,13 @@ elseif(GPU_API STREQUAL "HIP")
|
|||||||
VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} --fatbin --use_fast_math -DUSE_HIP -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES} ${HIP_CUDA_GENCODE} -I${LAMMPS_LIB_SOURCE_DIR}/gpu -o ${CUBIN_FILE} ${CU_FILE}
|
VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} --fatbin --use_fast_math -DUSE_HIP -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES} ${HIP_CUDA_GENCODE} -I${LAMMPS_LIB_SOURCE_DIR}/gpu -o ${CUBIN_FILE} ${CU_FILE}
|
||||||
DEPENDS ${CU_FILE}
|
DEPENDS ${CU_FILE}
|
||||||
COMMENT "Generating ${CU_NAME}.cubin")
|
COMMENT "Generating ${CU_NAME}.cubin")
|
||||||
|
elseif(HIP_PLATFORM STREQUAL "spirv")
|
||||||
|
configure_file(${CU_FILE} ${CU_CPP_FILE} COPYONLY)
|
||||||
|
|
||||||
|
add_custom_command(OUTPUT ${CUBIN_FILE}
|
||||||
|
VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} -c -O3 -DUSE_HIP -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES} -I${LAMMPS_LIB_SOURCE_DIR}/gpu -o ${CUBIN_FILE} ${CU_CPP_FILE}
|
||||||
|
DEPENDS ${CU_CPP_FILE}
|
||||||
|
COMMENT "Gerating ${CU_NAME}.cubin")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_custom_command(OUTPUT ${CUBIN_H_FILE}
|
add_custom_command(OUTPUT ${CUBIN_H_FILE}
|
||||||
@ -342,11 +385,19 @@ elseif(GPU_API STREQUAL "HIP")
|
|||||||
|
|
||||||
add_library(gpu STATIC ${GPU_LIB_SOURCES})
|
add_library(gpu STATIC ${GPU_LIB_SOURCES})
|
||||||
target_include_directories(gpu PRIVATE ${LAMMPS_LIB_BINARY_DIR}/gpu)
|
target_include_directories(gpu PRIVATE ${LAMMPS_LIB_BINARY_DIR}/gpu)
|
||||||
target_compile_definitions(gpu PRIVATE -D_${GPU_PREC_SETTING} -DMPI_GERYON -DUCL_NO_EXIT)
|
target_compile_definitions(gpu PRIVATE -DUSE_HIP -D_${GPU_PREC_SETTING})
|
||||||
target_compile_definitions(gpu PRIVATE -DUSE_HIP)
|
if(GPU_DEBUG)
|
||||||
|
target_compile_definitions(gpu PRIVATE -DUCL_DEBUG -DGERYON_KERNEL_DUMP)
|
||||||
|
else()
|
||||||
|
target_compile_definitions(gpu PRIVATE -DMPI_GERYON -DUCL_NO_EXIT)
|
||||||
|
endif()
|
||||||
target_link_libraries(gpu PRIVATE hip::host)
|
target_link_libraries(gpu PRIVATE hip::host)
|
||||||
|
|
||||||
if(HIP_USE_DEVICE_SORT)
|
if(HIP_USE_DEVICE_SORT)
|
||||||
|
if(HIP_PLATFORM STREQUAL "amd")
|
||||||
|
# newer version of ROCm (5.1+) require c++14 for rocprim
|
||||||
|
set_property(TARGET gpu PROPERTY CXX_STANDARD 14)
|
||||||
|
endif()
|
||||||
# add hipCUB
|
# add hipCUB
|
||||||
target_include_directories(gpu PRIVATE ${HIP_ROOT_DIR}/../include)
|
target_include_directories(gpu PRIVATE ${HIP_ROOT_DIR}/../include)
|
||||||
target_compile_definitions(gpu PRIVATE -DUSE_HIP_DEVICE_SORT)
|
target_compile_definitions(gpu PRIVATE -DUSE_HIP_DEVICE_SORT)
|
||||||
@ -364,15 +415,17 @@ elseif(GPU_API STREQUAL "HIP")
|
|||||||
|
|
||||||
if(DOWNLOAD_CUB)
|
if(DOWNLOAD_CUB)
|
||||||
message(STATUS "CUB download requested")
|
message(STATUS "CUB download requested")
|
||||||
set(CUB_URL "https://github.com/NVlabs/cub/archive/1.12.0.tar.gz" CACHE STRING "URL for CUB tarball")
|
# TODO: test update to current version 1.17.2
|
||||||
|
set(CUB_URL "https://github.com/nvidia/cub/archive/1.12.0.tar.gz" CACHE STRING "URL for CUB tarball")
|
||||||
set(CUB_MD5 "1cf595beacafff104700921bac8519f3" CACHE STRING "MD5 checksum of CUB tarball")
|
set(CUB_MD5 "1cf595beacafff104700921bac8519f3" CACHE STRING "MD5 checksum of CUB tarball")
|
||||||
mark_as_advanced(CUB_URL)
|
mark_as_advanced(CUB_URL)
|
||||||
mark_as_advanced(CUB_MD5)
|
mark_as_advanced(CUB_MD5)
|
||||||
|
GetFallbackURL(CUB_URL CUB_FALLBACK)
|
||||||
|
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
|
|
||||||
ExternalProject_Add(CUB
|
ExternalProject_Add(CUB
|
||||||
URL ${CUB_URL}
|
URL ${CUB_URL} ${CUB_FALLBACK}
|
||||||
URL_MD5 ${CUB_MD5}
|
URL_MD5 ${CUB_MD5}
|
||||||
PREFIX "${CMAKE_CURRENT_BINARY_DIR}"
|
PREFIX "${CMAKE_CURRENT_BINARY_DIR}"
|
||||||
CONFIGURE_COMMAND ""
|
CONFIGURE_COMMAND ""
|
||||||
@ -395,7 +448,7 @@ elseif(GPU_API STREQUAL "HIP")
|
|||||||
|
|
||||||
add_executable(hip_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp)
|
add_executable(hip_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp)
|
||||||
target_compile_definitions(hip_get_devices PRIVATE -DUCL_HIP)
|
target_compile_definitions(hip_get_devices PRIVATE -DUCL_HIP)
|
||||||
target_link_libraries(hip_get_devices hip::host)
|
target_link_libraries(hip_get_devices PRIVATE hip::host)
|
||||||
|
|
||||||
if(HIP_PLATFORM STREQUAL "nvcc")
|
if(HIP_PLATFORM STREQUAL "nvcc")
|
||||||
target_compile_definitions(gpu PRIVATE -D__HIP_PLATFORM_NVCC__)
|
target_compile_definitions(gpu PRIVATE -D__HIP_PLATFORM_NVCC__)
|
||||||
@ -420,10 +473,14 @@ elseif(GPU_API STREQUAL "HIP")
|
|||||||
target_compile_definitions(hip_get_devices PRIVATE -D__HIP_PLATFORM_AMD__)
|
target_compile_definitions(hip_get_devices PRIVATE -D__HIP_PLATFORM_AMD__)
|
||||||
target_include_directories(hip_get_devices PRIVATE ${HIP_ROOT_DIR}/../include)
|
target_include_directories(hip_get_devices PRIVATE ${HIP_ROOT_DIR}/../include)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(lammps PRIVATE gpu)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(BUILD_OMP)
|
||||||
|
find_package(OpenMP COMPONENTS CXX REQUIRED)
|
||||||
|
target_link_libraries(gpu PRIVATE OpenMP::OpenMP_CXX)
|
||||||
|
endif()
|
||||||
|
target_link_libraries(lammps PRIVATE gpu)
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY "GPU_SOURCES" "${GPU_SOURCES}")
|
set_property(GLOBAL PROPERTY "GPU_SOURCES" "${GPU_SOURCES}")
|
||||||
# detect styles which have a GPU version
|
# detect styles which have a GPU version
|
||||||
RegisterStylesExt(${GPU_SOURCES_DIR} gpu GPU_SOURCES)
|
RegisterStylesExt(${GPU_SOURCES_DIR} gpu GPU_SOURCES)
|
||||||
|
|||||||
@ -1,5 +1,14 @@
|
|||||||
enable_language(C)
|
enable_language(C)
|
||||||
|
|
||||||
|
# we don't use the parallel i/o interface.
|
||||||
|
set(HDF5_PREFER_PARALLEL FALSE)
|
||||||
|
|
||||||
find_package(HDF5 REQUIRED)
|
find_package(HDF5 REQUIRED)
|
||||||
|
|
||||||
|
# parallel HDF5 will import incompatible MPI headers with a serial build
|
||||||
|
if((NOT BUILD_MPI) AND HDF5_IS_PARALLEL)
|
||||||
|
message(FATAL_ERROR "Serial LAMMPS build and parallel HDF5 library are not compatible")
|
||||||
|
endif()
|
||||||
|
|
||||||
target_link_libraries(h5md PRIVATE ${HDF5_LIBRARIES})
|
target_link_libraries(h5md PRIVATE ${HDF5_LIBRARIES})
|
||||||
target_include_directories(h5md PUBLIC ${HDF5_INCLUDE_DIRS})
|
target_include_directories(h5md PUBLIC ${HDF5_INCLUDE_DIRS})
|
||||||
|
|||||||
@ -38,7 +38,7 @@ if(INTEL_LRT_MODE STREQUAL "C++11")
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
if((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") OR (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM"))
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16)
|
||||||
message(FATAL_ERROR "INTEL needs at least a 2016 Intel compiler, found ${CMAKE_CXX_COMPILER_VERSION}")
|
message(FATAL_ERROR "INTEL needs at least a 2016 Intel compiler, found ${CMAKE_CXX_COMPILER_VERSION}")
|
||||||
endif()
|
endif()
|
||||||
@ -46,12 +46,12 @@ else()
|
|||||||
message(WARNING "INTEL gives best performance with Intel compilers")
|
message(WARNING "INTEL gives best performance with Intel compilers")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(TBB_MALLOC QUIET)
|
find_package(TBB_MALLOC)
|
||||||
if(TBB_MALLOC_FOUND)
|
if(TBB_MALLOC_FOUND)
|
||||||
target_link_libraries(lammps PRIVATE TBB::TBB_MALLOC)
|
target_link_libraries(lammps PRIVATE TBB::TBB_MALLOC)
|
||||||
else()
|
else()
|
||||||
target_compile_definitions(lammps PRIVATE -DLMP_INTEL_NO_TBB)
|
target_compile_definitions(lammps PRIVATE -DLMP_INTEL_NO_TBB)
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
if((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") OR (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM"))
|
||||||
message(WARNING "INTEL with Intel compilers should use TBB malloc libraries")
|
message(WARNING "INTEL with Intel compilers should use TBB malloc libraries")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -112,5 +112,9 @@ if(PKG_KSPACE)
|
|||||||
RegisterIntegrateStyle(${INTEL_SOURCES_DIR}/verlet_lrt_intel.h)
|
RegisterIntegrateStyle(${INTEL_SOURCES_DIR}/verlet_lrt_intel.h)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(PKG_ELECTRODE)
|
||||||
|
list(APPEND INTEL_SOURCES ${INTEL_SOURCES_DIR}/electrode_accel_intel.cpp)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_sources(lammps PRIVATE ${INTEL_SOURCES})
|
target_sources(lammps PRIVATE ${INTEL_SOURCES})
|
||||||
target_include_directories(lammps PRIVATE ${INTEL_SOURCES_DIR})
|
target_include_directories(lammps PRIVATE ${INTEL_SOURCES_DIR})
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
if(CMAKE_CXX_STANDARD LESS 14)
|
if(CMAKE_CXX_STANDARD LESS 14)
|
||||||
message(FATAL_ERROR "The KOKKOS package requires the C++ standard to be set to at least C++14")
|
message(FATAL_ERROR "The KOKKOS package requires the C++ standard to be set to at least C++14")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# consistency checks and Kokkos options/settings required by LAMMPS
|
# consistency checks and Kokkos options/settings required by LAMMPS
|
||||||
if(Kokkos_ENABLE_CUDA)
|
if(Kokkos_ENABLE_CUDA)
|
||||||
@ -15,8 +16,9 @@ if(Kokkos_ENABLE_OPENMP)
|
|||||||
if(NOT BUILD_OMP)
|
if(NOT BUILD_OMP)
|
||||||
message(FATAL_ERROR "Must enable BUILD_OMP with Kokkos_ENABLE_OPENMP")
|
message(FATAL_ERROR "Must enable BUILD_OMP with Kokkos_ENABLE_OPENMP")
|
||||||
else()
|
else()
|
||||||
if(LAMMPS_OMP_COMPAT_LEVEL LESS 4)
|
# NVHPC does not seem to provide a detectable OpenMP version, but is far beyond version 3.1
|
||||||
message(FATAL_ERROR "Compiler must support OpenMP 4.0 or later with Kokkos_ENABLE_OPENMP")
|
if((OpenMP_CXX_VERSION VERSION_LESS 3.1) AND NOT (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC"))
|
||||||
|
message(FATAL_ERROR "Compiler must support OpenMP 3.1 or later with Kokkos_ENABLE_OPENMP")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -47,12 +49,14 @@ if(DOWNLOAD_KOKKOS)
|
|||||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}")
|
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}")
|
||||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
|
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/3.5.00.tar.gz" CACHE STRING "URL for KOKKOS tarball")
|
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/3.6.01.tar.gz" CACHE STRING "URL for KOKKOS tarball")
|
||||||
set(KOKKOS_MD5 "079323d973ae0e1c38c0a54a150c674e" CACHE STRING "MD5 checksum of KOKKOS tarball")
|
set(KOKKOS_MD5 "0ec97fc0c356dd65bd2487defe81a7bf" CACHE STRING "MD5 checksum of KOKKOS tarball")
|
||||||
mark_as_advanced(KOKKOS_URL)
|
mark_as_advanced(KOKKOS_URL)
|
||||||
mark_as_advanced(KOKKOS_MD5)
|
mark_as_advanced(KOKKOS_MD5)
|
||||||
|
GetFallbackURL(KOKKOS_URL KOKKOS_FALLBACK)
|
||||||
|
|
||||||
ExternalProject_Add(kokkos_build
|
ExternalProject_Add(kokkos_build
|
||||||
URL ${KOKKOS_URL}
|
URL ${KOKKOS_URL} ${KOKKOS_FALLBACK}
|
||||||
URL_MD5 ${KOKKOS_MD5}
|
URL_MD5 ${KOKKOS_MD5}
|
||||||
CMAKE_ARGS ${KOKKOS_LIB_BUILD_ARGS}
|
CMAKE_ARGS ${KOKKOS_LIB_BUILD_ARGS}
|
||||||
BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libkokkoscore.a <INSTALL_DIR>/lib/libkokkoscontainers.a
|
BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libkokkoscore.a <INSTALL_DIR>/lib/libkokkoscontainers.a
|
||||||
@ -72,7 +76,7 @@ if(DOWNLOAD_KOKKOS)
|
|||||||
add_dependencies(LAMMPS::KOKKOSCORE kokkos_build)
|
add_dependencies(LAMMPS::KOKKOSCORE kokkos_build)
|
||||||
add_dependencies(LAMMPS::KOKKOSCONTAINERS kokkos_build)
|
add_dependencies(LAMMPS::KOKKOSCONTAINERS kokkos_build)
|
||||||
elseif(EXTERNAL_KOKKOS)
|
elseif(EXTERNAL_KOKKOS)
|
||||||
find_package(Kokkos 3.5.00 REQUIRED CONFIG)
|
find_package(Kokkos 3.6.01 REQUIRED CONFIG)
|
||||||
target_link_libraries(lammps PRIVATE Kokkos::kokkos)
|
target_link_libraries(lammps PRIVATE Kokkos::kokkos)
|
||||||
target_link_libraries(lmp PRIVATE Kokkos::kokkos)
|
target_link_libraries(lmp PRIVATE Kokkos::kokkos)
|
||||||
else()
|
else()
|
||||||
@ -130,6 +134,11 @@ if(PKG_KSPACE)
|
|||||||
target_compile_definitions(lammps PRIVATE -DFFT_CUFFT)
|
target_compile_definitions(lammps PRIVATE -DFFT_CUFFT)
|
||||||
target_link_libraries(lammps PRIVATE cufft)
|
target_link_libraries(lammps PRIVATE cufft)
|
||||||
endif()
|
endif()
|
||||||
|
elseif(Kokkos_ENABLE_HIP)
|
||||||
|
if(NOT (FFT STREQUAL "KISS"))
|
||||||
|
target_compile_definitions(lammps PRIVATE -DFFT_HIPFFT)
|
||||||
|
target_link_libraries(lammps PRIVATE hipfft)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@ -19,17 +19,19 @@ if(DOWNLOAD_LATTE)
|
|||||||
set(LATTE_MD5 "820e73a457ced178c08c71389a385de7" CACHE STRING "MD5 checksum of LATTE tarball")
|
set(LATTE_MD5 "820e73a457ced178c08c71389a385de7" CACHE STRING "MD5 checksum of LATTE tarball")
|
||||||
mark_as_advanced(LATTE_URL)
|
mark_as_advanced(LATTE_URL)
|
||||||
mark_as_advanced(LATTE_MD5)
|
mark_as_advanced(LATTE_MD5)
|
||||||
|
GetFallbackURL(LATTE_URL LATTE_FALLBACK)
|
||||||
|
|
||||||
# CMake cannot pass BLAS or LAPACK library variable to external project if they are a list
|
# CMake cannot pass BLAS or LAPACK library variable to external project if they are a list
|
||||||
list(LENGTH BLAS_LIBRARIES} NUM_BLAS)
|
list(LENGTH BLAS_LIBRARIES} NUM_BLAS)
|
||||||
list(LENGTH LAPACK_LIBRARIES NUM_LAPACK)
|
list(LENGTH LAPACK_LIBRARIES NUM_LAPACK)
|
||||||
if((NUM_BLAS GREATER 1) OR (NUM_LAPACK GREATER 1))
|
if((NUM_BLAS GREATER 1) OR (NUM_LAPACK GREATER 1) AND NOT USE_INTERNAL_LINALG)
|
||||||
message(FATAL_ERROR "Cannot compile downloaded LATTE library due to a technical limitation")
|
message(FATAL_ERROR "Cannot compile downloaded LATTE library due to a technical limitation. "
|
||||||
|
"Try to configure LAMMPS with '-D USE_INTERNAL_LINALG=on' added as a workaround.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
ExternalProject_Add(latte_build
|
ExternalProject_Add(latte_build
|
||||||
URL ${LATTE_URL}
|
URL ${LATTE_URL} ${LATTE_FALLBACK}
|
||||||
URL_MD5 ${LATTE_MD5}
|
URL_MD5 ${LATTE_MD5}
|
||||||
SOURCE_SUBDIR cmake
|
SOURCE_SUBDIR cmake
|
||||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> ${CMAKE_REQUEST_PIC} -DCMAKE_INSTALL_LIBDIR=lib
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> ${CMAKE_REQUEST_PIC} -DCMAKE_INSTALL_LIBDIR=lib
|
||||||
|
|||||||
@ -36,3 +36,5 @@ endif()
|
|||||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "PGI") OR (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC"))
|
if((CMAKE_CXX_COMPILER_ID STREQUAL "PGI") OR (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC"))
|
||||||
target_compile_definitions(lammps PRIVATE -DEIGEN_DONT_VECTORIZE)
|
target_compile_definitions(lammps PRIVATE -DEIGEN_DONT_VECTORIZE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
target_compile_definitions(lammps PRIVATE -DEIGEN_NO_CUDA)
|
||||||
|
|||||||
@ -8,10 +8,11 @@ option(DOWNLOAD_MDI "Download and compile the MDI library instead of using an al
|
|||||||
|
|
||||||
if(DOWNLOAD_MDI)
|
if(DOWNLOAD_MDI)
|
||||||
message(STATUS "MDI download requested - we will build our own")
|
message(STATUS "MDI download requested - we will build our own")
|
||||||
set(MDI_URL "https://github.com/MolSSI-MDI/MDI_Library/archive/v1.2.9.tar.gz" CACHE STRING "URL for MDI tarball")
|
set(MDI_URL "https://github.com/MolSSI-MDI/MDI_Library/archive/v1.3.2.tar.gz" CACHE STRING "URL for MDI tarball")
|
||||||
set(MDI_MD5 "ddfa46d6ee15b4e59cfd527ec7212184" CACHE STRING "MD5 checksum for MDI tarball")
|
set(MDI_MD5 "836f5da400d8cff0f0e4435640f9454f" CACHE STRING "MD5 checksum for MDI tarball")
|
||||||
mark_as_advanced(MDI_URL)
|
mark_as_advanced(MDI_URL)
|
||||||
mark_as_advanced(MDI_MD5)
|
mark_as_advanced(MDI_MD5)
|
||||||
|
GetFallbackURL(MDI_URL MDI_FALLBACK)
|
||||||
enable_language(C)
|
enable_language(C)
|
||||||
|
|
||||||
# only ON/OFF are allowed for "mpi" flag when building MDI library
|
# only ON/OFF are allowed for "mpi" flag when building MDI library
|
||||||
@ -42,7 +43,7 @@ if(DOWNLOAD_MDI)
|
|||||||
# support cross-compilation and ninja-build
|
# support cross-compilation and ninja-build
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
ExternalProject_Add(mdi_build
|
ExternalProject_Add(mdi_build
|
||||||
URL ${MDI_URL}
|
URL ${MDI_URL} ${MDI_FALLBACK}
|
||||||
URL_MD5 ${MDI_MD5}
|
URL_MD5 ${MDI_MD5}
|
||||||
CMAKE_ARGS ${CMAKE_REQUEST_PIC}
|
CMAKE_ARGS ${CMAKE_REQUEST_PIC}
|
||||||
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
||||||
@ -50,6 +51,7 @@ if(DOWNLOAD_MDI)
|
|||||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||||
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
||||||
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
||||||
|
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||||
-Dlanguage=C
|
-Dlanguage=C
|
||||||
-Dlibtype=STATIC
|
-Dlibtype=STATIC
|
||||||
-Dmpi=${MDI_USE_MPI}
|
-Dmpi=${MDI_USE_MPI}
|
||||||
|
|||||||
@ -1,31 +0,0 @@
|
|||||||
if(LAMMPS_SIZES STREQUAL "BIGBIG")
|
|
||||||
message(FATAL_ERROR "The MESSAGE Package is not compatible with -DLAMMPS_BIGBIG")
|
|
||||||
endif()
|
|
||||||
option(MESSAGE_ZMQ "Use ZeroMQ in MESSAGE package" OFF)
|
|
||||||
file(GLOB_RECURSE cslib_SOURCES
|
|
||||||
${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.cpp)
|
|
||||||
|
|
||||||
add_library(cslib STATIC ${cslib_SOURCES})
|
|
||||||
target_compile_definitions(cslib PRIVATE -DLAMMPS_${LAMMPS_SIZES})
|
|
||||||
set_target_properties(cslib PROPERTIES OUTPUT_NAME lammps_cslib${LAMMPS_MACHINE})
|
|
||||||
if(BUILD_MPI)
|
|
||||||
target_compile_definitions(cslib PRIVATE -DMPI_YES)
|
|
||||||
set_target_properties(cslib PROPERTIES OUTPUT_NAME "csmpi")
|
|
||||||
target_link_libraries(cslib PRIVATE MPI::MPI_CXX)
|
|
||||||
else()
|
|
||||||
target_compile_definitions(cslib PRIVATE -DMPI_NO)
|
|
||||||
target_include_directories(cslib PRIVATE ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/src/STUBS_MPI)
|
|
||||||
set_target_properties(cslib PROPERTIES OUTPUT_NAME "csnompi")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(MESSAGE_ZMQ)
|
|
||||||
target_compile_definitions(cslib PRIVATE -DZMQ_YES)
|
|
||||||
find_package(ZMQ REQUIRED)
|
|
||||||
target_link_libraries(cslib PUBLIC ZMQ::ZMQ)
|
|
||||||
else()
|
|
||||||
target_compile_definitions(cslib PRIVATE -DZMQ_NO)
|
|
||||||
target_include_directories(cslib PRIVATE ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/src/STUBS_ZMQ)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_link_libraries(lammps PRIVATE cslib)
|
|
||||||
target_include_directories(lammps PRIVATE ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/src)
|
|
||||||
@ -6,10 +6,11 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
option(DOWNLOAD_N2P2 "Download n2p2 library instead of using an already installed one)" ${DOWNLOAD_N2P2_DEFAULT})
|
option(DOWNLOAD_N2P2 "Download n2p2 library instead of using an already installed one)" ${DOWNLOAD_N2P2_DEFAULT})
|
||||||
if(DOWNLOAD_N2P2)
|
if(DOWNLOAD_N2P2)
|
||||||
set(N2P2_URL "https://github.com/CompPhysVienna/n2p2/archive/v2.1.4.tar.gz" CACHE STRING "URL for n2p2 tarball")
|
set(N2P2_URL "https://github.com/CompPhysVienna/n2p2/archive/v2.2.0.tar.gz" CACHE STRING "URL for n2p2 tarball")
|
||||||
set(N2P2_MD5 "9595b066636cd6b90b0fef93398297a5" CACHE STRING "MD5 checksum of N2P2 tarball")
|
set(N2P2_MD5 "a2d9ab7f676b3a74a324fc1eda0a911d" CACHE STRING "MD5 checksum of N2P2 tarball")
|
||||||
mark_as_advanced(N2P2_URL)
|
mark_as_advanced(N2P2_URL)
|
||||||
mark_as_advanced(N2P2_MD5)
|
mark_as_advanced(N2P2_MD5)
|
||||||
|
GetFallbackURL(N2P2_URL N2P2_FALLBACK)
|
||||||
|
|
||||||
# adjust settings from detected compiler to compiler platform in n2p2 library
|
# adjust settings from detected compiler to compiler platform in n2p2 library
|
||||||
# set compiler specific flag to turn on C++11 syntax (required on macOS and CentOS 7)
|
# set compiler specific flag to turn on C++11 syntax (required on macOS and CentOS 7)
|
||||||
@ -42,15 +43,11 @@ if(DOWNLOAD_N2P2)
|
|||||||
if(NOT BUILD_MPI)
|
if(NOT BUILD_MPI)
|
||||||
set(N2P2_PROJECT_OPTIONS "-DN2P2_NO_MPI")
|
set(N2P2_PROJECT_OPTIONS "-DN2P2_NO_MPI")
|
||||||
else()
|
else()
|
||||||
# get path to MPI include directory when cross-compiling to windows
|
# get path to MPI include directory
|
||||||
if((CMAKE_SYSTEM_NAME STREQUAL Windows) AND CMAKE_CROSSCOMPILING)
|
|
||||||
get_target_property(N2P2_MPI_INCLUDE MPI::MPI_CXX INTERFACE_INCLUDE_DIRECTORIES)
|
get_target_property(N2P2_MPI_INCLUDE MPI::MPI_CXX INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
set(N2P2_PROJECT_OPTIONS "-I${N2P2_MPI_INCLUDE}")
|
foreach (_INCL ${N2P2_MPI_INCLUDE})
|
||||||
endif()
|
set(N2P2_PROJECT_OPTIONS "${N2P2_PROJECT_OPTIONS} -I${_INCL}")
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
endforeach()
|
||||||
get_target_property(N2P2_MPI_INCLUDE MPI::MPI_CXX INTERFACE_INCLUDE_DIRECTORIES)
|
|
||||||
set(N2P2_PROJECT_OPTIONS "-I${N2P2_MPI_INCLUDE}")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# prefer GNU make, if available. N2P2 lib seems to need it.
|
# prefer GNU make, if available. N2P2 lib seems to need it.
|
||||||
@ -76,12 +73,12 @@ if(DOWNLOAD_N2P2)
|
|||||||
# download compile n2p2 library. much patch MPI calls in LAMMPS interface to accommodate MPI-2 (e.g. for cross-compiling)
|
# download compile n2p2 library. much patch MPI calls in LAMMPS interface to accommodate MPI-2 (e.g. for cross-compiling)
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
ExternalProject_Add(n2p2_build
|
ExternalProject_Add(n2p2_build
|
||||||
URL ${N2P2_URL}
|
URL ${N2P2_URL} ${N2P2_FALLBACK}
|
||||||
URL_MD5 ${N2P2_MD5}
|
URL_MD5 ${N2P2_MD5}
|
||||||
UPDATE_COMMAND ""
|
UPDATE_COMMAND ""
|
||||||
CONFIGURE_COMMAND ""
|
CONFIGURE_COMMAND ""
|
||||||
PATCH_COMMAND sed -i -e "s/\\(MPI_\\(P\\|Unp\\)ack(\\)/\\1(void *) /" src/libnnpif/LAMMPS/InterfaceLammps.cpp
|
PATCH_COMMAND sed -i -e "s/\\(MPI_\\(P\\|Unp\\)ack(\\)/\\1(void *) /" src/libnnpif/LAMMPS/InterfaceLammps.cpp
|
||||||
BUILD_COMMAND ${N2P2_MAKE} -f makefile libnnpif ${N2P2_BUILD_OPTIONS}
|
BUILD_COMMAND ${N2P2_MAKE} -C <SOURCE_DIR>/src -f makefile libnnpif ${N2P2_BUILD_OPTIONS}
|
||||||
BUILD_ALWAYS YES
|
BUILD_ALWAYS YES
|
||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ""
|
||||||
BUILD_IN_SOURCE 1
|
BUILD_IN_SOURCE 1
|
||||||
|
|||||||
@ -2,7 +2,13 @@
|
|||||||
set(MLIAP_ENABLE_PYTHON_DEFAULT OFF)
|
set(MLIAP_ENABLE_PYTHON_DEFAULT OFF)
|
||||||
if(PKG_PYTHON)
|
if(PKG_PYTHON)
|
||||||
find_package(Cythonize QUIET)
|
find_package(Cythonize QUIET)
|
||||||
if(Cythonize_FOUND)
|
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.14)
|
||||||
|
find_package(Python COMPONENTS NumPy QUIET)
|
||||||
|
else()
|
||||||
|
# assume we have NumPy
|
||||||
|
set(Python_NumPy_FOUND ON)
|
||||||
|
endif()
|
||||||
|
if(Cythonize_FOUND AND Python_NumPy_FOUND)
|
||||||
set(MLIAP_ENABLE_PYTHON_DEFAULT ON)
|
set(MLIAP_ENABLE_PYTHON_DEFAULT ON)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -11,6 +17,9 @@ option(MLIAP_ENABLE_PYTHON "Build ML-IAP package with Python support" ${MLIAP_EN
|
|||||||
|
|
||||||
if(MLIAP_ENABLE_PYTHON)
|
if(MLIAP_ENABLE_PYTHON)
|
||||||
find_package(Cythonize REQUIRED)
|
find_package(Cythonize REQUIRED)
|
||||||
|
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.14)
|
||||||
|
find_package(Python COMPONENTS NumPy REQUIRED)
|
||||||
|
endif()
|
||||||
if(NOT PKG_PYTHON)
|
if(NOT PKG_PYTHON)
|
||||||
message(FATAL_ERROR "Must enable PYTHON package for including Python support in ML-IAP")
|
message(FATAL_ERROR "Must enable PYTHON package for including Python support in ML-IAP")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@ -1,11 +1,25 @@
|
|||||||
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2021.10.25.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
|
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2021.10.25.fix2.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
|
||||||
|
|
||||||
set(PACELIB_MD5 "a2ac3315c41a1a4a5c912bcb1bc9c5cc" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
|
set(PACELIB_MD5 "32394d799bc282bb57696c78c456e64f" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
|
||||||
mark_as_advanced(PACELIB_URL)
|
mark_as_advanced(PACELIB_URL)
|
||||||
mark_as_advanced(PACELIB_MD5)
|
mark_as_advanced(PACELIB_MD5)
|
||||||
|
GetFallbackURL(PACELIB_URL PACELIB_FALLBACK)
|
||||||
|
|
||||||
# download library sources to build folder
|
# download library sources to build folder
|
||||||
file(DOWNLOAD ${PACELIB_URL} ${CMAKE_BINARY_DIR}/libpace.tar.gz EXPECTED_HASH MD5=${PACELIB_MD5}) #SHOW_PROGRESS
|
if(EXISTS ${CMAKE_BINARY_DIR}/libpace.tar.gz)
|
||||||
|
file(MD5 ${CMAKE_BINARY_DIR}/libpace.tar.gz DL_MD5)
|
||||||
|
endif()
|
||||||
|
if(NOT "${DL_MD5}" STREQUAL "${PACELIB_MD5}")
|
||||||
|
message(STATUS "Downloading ${PACELIB_URL}")
|
||||||
|
file(DOWNLOAD ${PACELIB_URL} ${CMAKE_BINARY_DIR}/libpace.tar.gz STATUS DL_STATUS SHOW_PROGRESS)
|
||||||
|
file(MD5 ${CMAKE_BINARY_DIR}/libpace.tar.gz DL_MD5)
|
||||||
|
if((NOT DL_STATUS EQUAL 0) OR (NOT "${DL_MD5}" STREQUAL "${PACELIB_MD5}"))
|
||||||
|
message(WARNING "Download from primary URL ${PACELIB_URL} failed\nTrying fallback URL ${PACELIB_FALLBACK}")
|
||||||
|
file(DOWNLOAD ${PACELIB_FALLBACK} ${CMAKE_BINARY_DIR}/libpace.tar.gz EXPECTED_HASH MD5=${PACELIB_MD5} SHOW_PROGRESS)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(STATUS "Using already downloaded archive ${CMAKE_BINARY_DIR}/libpace.tar.gz")
|
||||||
|
endif()
|
||||||
|
|
||||||
# uncompress downloaded sources
|
# uncompress downloaded sources
|
||||||
execute_process(
|
execute_process(
|
||||||
@ -13,13 +27,17 @@ execute_process(
|
|||||||
COMMAND ${CMAKE_COMMAND} -E tar xzf libpace.tar.gz
|
COMMAND ${CMAKE_COMMAND} -E tar xzf libpace.tar.gz
|
||||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||||
)
|
)
|
||||||
|
get_newest_file(${CMAKE_BINARY_DIR}/lammps-user-pace-* lib-pace)
|
||||||
|
|
||||||
file(GLOB lib-pace ${CMAKE_BINARY_DIR}/lammps-user-pace-*)
|
# enforce building libyaml-cpp as static library and turn off optional features
|
||||||
|
set(YAML_BUILD_SHARED_LIBS OFF)
|
||||||
|
set(YAML_CPP_BUILD_CONTRIB OFF)
|
||||||
|
set(YAML_CPP_BUILD_TOOLS OFF)
|
||||||
add_subdirectory(${lib-pace}/yaml-cpp build-yaml-cpp)
|
add_subdirectory(${lib-pace}/yaml-cpp build-yaml-cpp)
|
||||||
set(YAML_CPP_INCLUDE_DIR ${lib-pace}/yaml-cpp/include)
|
set(YAML_CPP_INCLUDE_DIR ${lib-pace}/yaml-cpp/include)
|
||||||
|
|
||||||
file(GLOB PACE_EVALUATOR_INCLUDE_DIR ${lib-pace}/ML-PACE)
|
file(GLOB PACE_EVALUATOR_INCLUDE_DIR ${CONFIGURE_DEPENDS} ${lib-pace}/ML-PACE)
|
||||||
file(GLOB PACE_EVALUATOR_SOURCES ${lib-pace}/ML-PACE/*.cpp)
|
file(GLOB PACE_EVALUATOR_SOURCES ${CONFIGURE_DEPENDS} ${lib-pace}/ML-PACE/*.cpp)
|
||||||
list(FILTER PACE_EVALUATOR_SOURCES EXCLUDE REGEX pair_pace.cpp)
|
list(FILTER PACE_EVALUATOR_SOURCES EXCLUDE REGEX pair_pace.cpp)
|
||||||
|
|
||||||
add_library(pace STATIC ${PACE_EVALUATOR_SOURCES})
|
add_library(pace STATIC ${PACE_EVALUATOR_SOURCES})
|
||||||
@ -28,5 +46,6 @@ target_include_directories(pace PUBLIC ${PACE_EVALUATOR_INCLUDE_DIR} ${YAML_CPP_
|
|||||||
|
|
||||||
|
|
||||||
target_link_libraries(pace PRIVATE yaml-cpp-pace)
|
target_link_libraries(pace PRIVATE yaml-cpp-pace)
|
||||||
|
if(CMAKE_PROJECT_NAME STREQUAL "lammps")
|
||||||
target_link_libraries(lammps PRIVATE pace)
|
target_link_libraries(lammps PRIVATE pace)
|
||||||
|
endif()
|
||||||
|
|||||||
@ -16,6 +16,7 @@ if(DOWNLOAD_QUIP)
|
|||||||
set(temp "${temp}DEFINES += -DGETARG_F2003 -DFORTRAN_UNDERSCORE\n")
|
set(temp "${temp}DEFINES += -DGETARG_F2003 -DFORTRAN_UNDERSCORE\n")
|
||||||
set(temp "${temp}F95FLAGS += -fpp -free -fPIC\n")
|
set(temp "${temp}F95FLAGS += -fpp -free -fPIC\n")
|
||||||
set(temp "${temp}F77FLAGS += -fpp -fixed -fPIC\n")
|
set(temp "${temp}F77FLAGS += -fpp -fixed -fPIC\n")
|
||||||
|
set(temp "${temp}F95_PRE_FILENAME_FLAG = -Tf\n")
|
||||||
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
|
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
|
||||||
set(temp "${temp}FPP=${CMAKE_Fortran_COMPILER} -E -x f95-cpp-input\nOPTIM=${CMAKE_Fortran_FLAGS_${BTYPE}}\n")
|
set(temp "${temp}FPP=${CMAKE_Fortran_COMPILER} -E -x f95-cpp-input\nOPTIM=${CMAKE_Fortran_FLAGS_${BTYPE}}\n")
|
||||||
set(temp "${temp}DEFINES += -DGETARG_F2003 -DGETENV_F2003 -DGFORTRAN -DFORTRAN_UNDERSCORE\n")
|
set(temp "${temp}DEFINES += -DGETARG_F2003 -DGETENV_F2003 -DGFORTRAN -DFORTRAN_UNDERSCORE\n")
|
||||||
@ -43,6 +44,7 @@ if(DOWNLOAD_QUIP)
|
|||||||
file(WRITE ${CMAKE_BINARY_DIR}/quip.config "${temp}")
|
file(WRITE ${CMAKE_BINARY_DIR}/quip.config "${temp}")
|
||||||
|
|
||||||
message(STATUS "QUIP download via git requested - we will build our own")
|
message(STATUS "QUIP download via git requested - we will build our own")
|
||||||
|
set(CMAKE_EP_GIT_REMOTE_UPDATE_STRATEGY CHECKOUT)
|
||||||
# QUIP has no releases (except for a tag marking the end of Python 2 support). We use the current "public" branch
|
# QUIP has no releases (except for a tag marking the end of Python 2 support). We use the current "public" branch
|
||||||
# The LAMMPS interface wrapper has a compatibility constant that is being checked at runtime.
|
# The LAMMPS interface wrapper has a compatibility constant that is being checked at runtime.
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
@ -57,12 +59,12 @@ if(DOWNLOAD_QUIP)
|
|||||||
BUILD_COMMAND env QUIP_ARCH=lammps make libquip
|
BUILD_COMMAND env QUIP_ARCH=lammps make libquip
|
||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ""
|
||||||
BUILD_IN_SOURCE YES
|
BUILD_IN_SOURCE YES
|
||||||
BUILD_BYPRODUCTS <SOURCE_DIR>/build/lammps/libquip.a
|
BUILD_BYPRODUCTS <SOURCE_DIR>/build/lammps/${CMAKE_STATIC_LIBRARY_PREFIX}quip${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||||
)
|
)
|
||||||
ExternalProject_get_property(quip_build SOURCE_DIR)
|
ExternalProject_get_property(quip_build SOURCE_DIR)
|
||||||
add_library(LAMMPS::QUIP UNKNOWN IMPORTED)
|
add_library(LAMMPS::QUIP UNKNOWN IMPORTED)
|
||||||
set_target_properties(LAMMPS::QUIP PROPERTIES
|
set_target_properties(LAMMPS::QUIP PROPERTIES
|
||||||
IMPORTED_LOCATION "${SOURCE_DIR}/build/lammps/libquip.a"
|
IMPORTED_LOCATION "${SOURCE_DIR}/build/lammps/${CMAKE_STATIC_LIBRARY_PREFIX}quip${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||||
INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}")
|
INTERFACE_LINK_LIBRARIES "${LAPACK_LIBRARIES}")
|
||||||
target_link_libraries(lammps PRIVATE LAMMPS::QUIP)
|
target_link_libraries(lammps PRIVATE LAMMPS::QUIP)
|
||||||
add_dependencies(LAMMPS::QUIP quip_build)
|
add_dependencies(LAMMPS::QUIP quip_build)
|
||||||
|
|||||||
@ -7,8 +7,8 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
option(DOWNLOAD_MSCG "Download MSCG library instead of using an already installed one)" ${DOWNLOAD_MSCG_DEFAULT})
|
option(DOWNLOAD_MSCG "Download MSCG library instead of using an already installed one)" ${DOWNLOAD_MSCG_DEFAULT})
|
||||||
if(DOWNLOAD_MSCG)
|
if(DOWNLOAD_MSCG)
|
||||||
set(MSCG_URL "https://github.com/uchicago-voth/MSCG-release/archive/1.7.3.1.tar.gz" CACHE STRING "URL for MSCG tarball")
|
set(MSCG_URL "https://github.com/uchicago-voth/MSCG-release/archive/491270a73539e3f6951e76f7dbe84e258b3ebb45.tar.gz" CACHE STRING "URL for MSCG tarball")
|
||||||
set(MSCG_MD5 "8c45e269ee13f60b303edd7823866a91" CACHE STRING "MD5 checksum of MSCG tarball")
|
set(MSCG_MD5 "7ea50748fba5c3a372e0266bd31d2f11" CACHE STRING "MD5 checksum of MSCG tarball")
|
||||||
mark_as_advanced(MSCG_URL)
|
mark_as_advanced(MSCG_URL)
|
||||||
mark_as_advanced(MSCG_MD5)
|
mark_as_advanced(MSCG_MD5)
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,83 @@
|
|||||||
|
# Plumed2 support for PLUMED package
|
||||||
|
|
||||||
|
if(BUILD_MPI)
|
||||||
|
set(PLUMED_CONFIG_MPI "--enable-mpi")
|
||||||
|
set(PLUMED_CONFIG_CC ${CMAKE_MPI_C_COMPILER})
|
||||||
|
set(PLUMED_CONFIG_CXX ${CMAKE_MPI_CXX_COMPILER})
|
||||||
|
set(PLUMED_CONFIG_CPP "-I ${MPI_CXX_INCLUDE_PATH}")
|
||||||
|
set(PLUMED_CONFIG_LIB "${MPI_CXX_LIBRARIES}")
|
||||||
|
set(PLUMED_CONFIG_DEP "mpi4win_build")
|
||||||
|
else()
|
||||||
|
set(PLUMED_CONFIG_MPI "--disable-mpi")
|
||||||
|
set(PLUMED_CONFIG_CC ${CMAKE_C_COMPILER})
|
||||||
|
set(PLUMED_CONFIG_CXX ${CMAKE_CXX_COMPILER})
|
||||||
|
set(PLUMED_CONFIG_CPP "")
|
||||||
|
set(PLUMED_CONFIG_LIB "")
|
||||||
|
set(PLUMED_CONFIG_DEP "")
|
||||||
|
endif()
|
||||||
|
if(BUILD_OMP)
|
||||||
|
set(PLUMED_CONFIG_OMP "--enable-openmp")
|
||||||
|
else()
|
||||||
|
set(PLUMED_CONFIG_OMP "--disable-openmp")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.8.2/plumed-src-2.8.2.tgz"
|
||||||
|
CACHE STRING "URL for PLUMED tarball")
|
||||||
|
set(PLUMED_MD5 "599092b6a0aa6fff992612537ad98994" CACHE STRING "MD5 checksum of PLUMED tarball")
|
||||||
|
|
||||||
|
mark_as_advanced(PLUMED_URL)
|
||||||
|
mark_as_advanced(PLUMED_MD5)
|
||||||
|
GetFallbackURL(PLUMED_URL PLUMED_FALLBACK)
|
||||||
|
|
||||||
|
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND (CMAKE_CROSSCOMPILING))
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
||||||
|
set(CROSS_CONFIGURE mingw64-configure)
|
||||||
|
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
|
||||||
|
set(CROSS_CONFIGURE mingw32-configure)
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Unsupported target system: ${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR}")
|
||||||
|
endif()
|
||||||
|
message(STATUS "Downloading and cross-compiling Plumed2 for ${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR} with ${CROSS_CONFIGURE}")
|
||||||
|
include(ExternalProject)
|
||||||
|
ExternalProject_Add(plumed_build
|
||||||
|
URL ${PLUMED_URL} ${PLUMED_FALLBACK}
|
||||||
|
URL_MD5 ${PLUMED_MD5}
|
||||||
|
BUILD_IN_SOURCE 1
|
||||||
|
CONFIGURE_COMMAND ${CROSS_CONFIGURE} --disable-shared --disable-bsymbolic
|
||||||
|
--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}
|
||||||
|
CXX=${PLUMED_CONFIG_CXX}
|
||||||
|
CC=${PLUMED_CONFIG_CC}
|
||||||
|
CPPFLAGS=${PLUMED_CONFIG_CPP}
|
||||||
|
LIBS=${PLUMED_CONFIG_LIB}
|
||||||
|
INSTALL_COMMAND ""
|
||||||
|
BUILD_BYPRODUCTS "<SOURCE_DIR>/src/lib/install/libplumed.a" "<SOURCE_DIR>/src/lib/install/plumed.exe"
|
||||||
|
DEPENDS "${PLUMED_MPI_CONFIG_DEP}"
|
||||||
|
)
|
||||||
|
ExternalProject_Get_Property(plumed_build SOURCE_DIR)
|
||||||
|
set(PLUMED_BUILD_DIR ${SOURCE_DIR})
|
||||||
|
set(PLUMED_INSTALL_DIR ${PLUMED_BUILD_DIR}/src/lib/install)
|
||||||
|
file(MAKE_DIRECTORY ${PLUMED_BUILD_DIR}/src/include)
|
||||||
|
|
||||||
|
add_library(LAMMPS::PLUMED UNKNOWN IMPORTED)
|
||||||
|
add_dependencies(LAMMPS::PLUMED plumed_build)
|
||||||
|
set_target_properties(LAMMPS::PLUMED PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${PLUMED_INSTALL_DIR}/libplumed.a"
|
||||||
|
INTERFACE_LINK_LIBRARIES "-Wl,--image-base -Wl,0x10000000 -lfftw3 -lz -fstack-protector -lssp -fopenmp"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${PLUMED_BUILD_DIR}/src/include")
|
||||||
|
|
||||||
|
add_custom_target(plumed_copy ALL ${CMAKE_COMMAND} -E rm -rf ${CMAKE_BINARY_DIR}/plumed.exe ${CMAKE_BINARY_DIR}/plumed_patches
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy ${PLUMED_INSTALL_DIR}/plumed.exe ${CMAKE_BINARY_DIR}/plumed.exe
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PLUMED_BUILD_DIR}/patches ${CMAKE_BINARY_DIR}/patches
|
||||||
|
BYPRODUCTS ${CMAKE_BINARY_DIR}/plumed.exe ${CMAKE_BINARY_DIR}/patches
|
||||||
|
DEPENDS plumed_build
|
||||||
|
COMMENT "Copying Plumed files"
|
||||||
|
)
|
||||||
|
|
||||||
|
else()
|
||||||
|
|
||||||
set(PLUMED_MODE "static" CACHE STRING "Linkage mode for Plumed2 library")
|
set(PLUMED_MODE "static" CACHE STRING "Linkage mode for Plumed2 library")
|
||||||
set(PLUMED_MODE_VALUES static shared runtime)
|
set(PLUMED_MODE_VALUES static shared runtime)
|
||||||
set_property(CACHE PLUMED_MODE PROPERTY STRINGS ${PLUMED_MODE_VALUES})
|
set_property(CACHE PLUMED_MODE PROPERTY STRINGS ${PLUMED_MODE_VALUES})
|
||||||
@ -31,43 +111,25 @@ endif()
|
|||||||
|
|
||||||
option(DOWNLOAD_PLUMED "Download Plumed package instead of using an already installed one" ${DOWNLOAD_PLUMED_DEFAULT})
|
option(DOWNLOAD_PLUMED "Download Plumed package instead of using an already installed one" ${DOWNLOAD_PLUMED_DEFAULT})
|
||||||
if(DOWNLOAD_PLUMED)
|
if(DOWNLOAD_PLUMED)
|
||||||
if(BUILD_MPI)
|
|
||||||
set(PLUMED_CONFIG_MPI "--enable-mpi")
|
|
||||||
set(PLUMED_CONFIG_CC ${CMAKE_MPI_C_COMPILER})
|
|
||||||
set(PLUMED_CONFIG_CXX ${CMAKE_MPI_CXX_COMPILER})
|
|
||||||
else()
|
|
||||||
set(PLUMED_CONFIG_MPI "--disable-mpi")
|
|
||||||
set(PLUMED_CONFIG_CC ${CMAKE_C_COMPILER})
|
|
||||||
set(PLUMED_CONFIG_CXX ${CMAKE_CXX_COMPILER})
|
|
||||||
endif()
|
|
||||||
if(BUILD_OMP)
|
|
||||||
set(PLUMED_CONFIG_OMP "--enable-openmp")
|
|
||||||
else()
|
|
||||||
set(PLUMED_CONFIG_OMP "--disable-openmp")
|
|
||||||
endif()
|
|
||||||
message(STATUS "PLUMED download requested - we will build our own")
|
message(STATUS "PLUMED download requested - we will build our own")
|
||||||
if(PLUMED_MODE STREQUAL "STATIC")
|
if(PLUMED_MODE STREQUAL "STATIC")
|
||||||
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/libplumed.a")
|
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/${CMAKE_STATIC_LIBRARY_PREFIX}plumed${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||||
elseif(PLUMED_MODE STREQUAL "SHARED")
|
elseif(PLUMED_MODE STREQUAL "SHARED")
|
||||||
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/libplumed${CMAKE_SHARED_LIBRARY_SUFFIX};<INSTALL_DIR>/lib/libplumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/${CMAKE_SHARED_LIBRARY_PREFIX}plumed${CMAKE_SHARED_LIBRARY_SUFFIX};<INSTALL_DIR>/lib/${CMAKE_SHARED_LIBRARY_PREFIX}plumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||||
elseif(PLUMED_MODE STREQUAL "RUNTIME")
|
elseif(PLUMED_MODE STREQUAL "RUNTIME")
|
||||||
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/libplumedWrapper.a")
|
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/${CMAKE_STATIC_LIBRARY_PREFIX}plumedWrapper${CMAKE_STATIC_LIBRARY_PREFIX}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.7.4/plumed-src-2.7.4.tgz" CACHE STRING "URL for PLUMED tarball")
|
|
||||||
set(PLUMED_MD5 "858e0b6aed173748fc85b6bc8a9dcb3e" CACHE STRING "MD5 checksum of PLUMED tarball")
|
|
||||||
|
|
||||||
mark_as_advanced(PLUMED_URL)
|
|
||||||
mark_as_advanced(PLUMED_MD5)
|
|
||||||
|
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
ExternalProject_Add(plumed_build
|
ExternalProject_Add(plumed_build
|
||||||
URL ${PLUMED_URL}
|
URL ${PLUMED_URL} ${PLUMED_FALLBACK}
|
||||||
URL_MD5 ${PLUMED_MD5}
|
URL_MD5 ${PLUMED_MD5}
|
||||||
BUILD_IN_SOURCE 1
|
BUILD_IN_SOURCE 1
|
||||||
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR>
|
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR>
|
||||||
${CONFIGURE_REQUEST_PIC}
|
${CONFIGURE_REQUEST_PIC}
|
||||||
--enable-modules=all
|
--enable-modules=all
|
||||||
|
--enable-cxx=11
|
||||||
|
--disable-python
|
||||||
${PLUMED_CONFIG_MPI}
|
${PLUMED_CONFIG_MPI}
|
||||||
${PLUMED_CONFIG_OMP}
|
${PLUMED_CONFIG_OMP}
|
||||||
CXX=${PLUMED_CONFIG_CXX}
|
CXX=${PLUMED_CONFIG_CXX}
|
||||||
@ -78,12 +140,12 @@ if(DOWNLOAD_PLUMED)
|
|||||||
add_library(LAMMPS::PLUMED UNKNOWN IMPORTED)
|
add_library(LAMMPS::PLUMED UNKNOWN IMPORTED)
|
||||||
add_dependencies(LAMMPS::PLUMED plumed_build)
|
add_dependencies(LAMMPS::PLUMED plumed_build)
|
||||||
if(PLUMED_MODE STREQUAL "STATIC")
|
if(PLUMED_MODE STREQUAL "STATIC")
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/libplumed.a INTERFACE_LINK_LIBRARIES "${PLUMED_LINK_LIBS};${CMAKE_DL_LIBS}")
|
set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}plumed${CMAKE_STATIC_LIBRARY_SUFFIX} INTERFACE_LINK_LIBRARIES "${PLUMED_LINK_LIBS};${CMAKE_DL_LIBS}")
|
||||||
elseif(PLUMED_MODE STREQUAL "SHARED")
|
elseif(PLUMED_MODE STREQUAL "SHARED")
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/libplumed${CMAKE_SHARED_LIBRARY_SUFFIX} INTERFACE_LINK_LIBRARIES "${INSTALL_DIR}/lib/libplumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX};${CMAKE_DL_LIBS}")
|
set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}plumed${CMAKE_SHARED_LIBRARY_SUFFIX} INTERFACE_LINK_LIBRARIES "${INSTALL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}plumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX};${CMAKE_DL_LIBS}")
|
||||||
elseif(PLUMED_MODE STREQUAL "RUNTIME")
|
elseif(PLUMED_MODE STREQUAL "RUNTIME")
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_COMPILE_DEFINITIONS "__PLUMED_DEFAULT_KERNEL=${INSTALL_DIR}/lib/libplumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_COMPILE_DEFINITIONS "__PLUMED_DEFAULT_KERNEL=${INSTALL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}plumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/libplumedWrapper.a INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS}")
|
set_target_properties(LAMMPS::PLUMED PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}plumedWrapper${CMAKE_STATIC_LIBRARY_SUFFIX} INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS}")
|
||||||
endif()
|
endif()
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/include)
|
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/include)
|
||||||
file(MAKE_DIRECTORY ${INSTALL_DIR}/include)
|
file(MAKE_DIRECTORY ${INSTALL_DIR}/include)
|
||||||
@ -96,10 +158,12 @@ else()
|
|||||||
elseif(PLUMED_MODE STREQUAL "SHARED")
|
elseif(PLUMED_MODE STREQUAL "SHARED")
|
||||||
include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.shared)
|
include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.shared)
|
||||||
elseif(PLUMED_MODE STREQUAL "RUNTIME")
|
elseif(PLUMED_MODE STREQUAL "RUNTIME")
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_COMPILE_DEFINITIONS "__PLUMED_DEFAULT_KERNEL=${PLUMED_LIBDIR}/libplumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_COMPILE_DEFINITIONS "__PLUMED_DEFAULT_KERNEL=${PLUMED_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}plumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||||
include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.runtime)
|
include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.runtime)
|
||||||
endif()
|
endif()
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_LINK_LIBRARIES "${PLUMED_LOAD}")
|
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_LINK_LIBRARIES "${PLUMED_LOAD}")
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${PLUMED_INCLUDE_DIRS}")
|
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${PLUMED_INCLUDE_DIRS}")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
target_link_libraries(lammps PRIVATE LAMMPS::PLUMED)
|
target_link_libraries(lammps PRIVATE LAMMPS::PLUMED)
|
||||||
|
|||||||
@ -1,8 +1,28 @@
|
|||||||
if(CMAKE_VERSION VERSION_LESS 3.12)
|
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||||
|
if(NOT PYTHON_VERSION_STRING)
|
||||||
|
set(Python_ADDITIONAL_VERSIONS 3.12 3.11 3.10 3.9 3.8 3.7 3.6)
|
||||||
|
# search for interpreter first, so we have a consistent library
|
||||||
|
find_package(PythonInterp) # Deprecated since version 3.12
|
||||||
|
if(PYTHONINTERP_FOUND)
|
||||||
|
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
# search for the library matching the selected interpreter
|
||||||
|
set(Python_ADDITIONAL_VERSIONS ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
|
||||||
find_package(PythonLibs REQUIRED) # Deprecated since version 3.12
|
find_package(PythonLibs REQUIRED) # Deprecated since version 3.12
|
||||||
|
if(NOT (PYTHON_VERSION_STRING STREQUAL PYTHONLIBS_VERSION_STRING))
|
||||||
|
message(FATAL_ERROR "Python Library version ${PYTHONLIBS_VERSION_STRING} does not match Interpreter version ${PYTHON_VERSION_STRING}")
|
||||||
|
endif()
|
||||||
target_include_directories(lammps PRIVATE ${PYTHON_INCLUDE_DIRS})
|
target_include_directories(lammps PRIVATE ${PYTHON_INCLUDE_DIRS})
|
||||||
target_link_libraries(lammps PRIVATE ${PYTHON_LIBRARIES})
|
target_link_libraries(lammps PRIVATE ${PYTHON_LIBRARIES})
|
||||||
else()
|
else()
|
||||||
|
if(NOT Python_INTERPRETER)
|
||||||
|
# backward compatibility
|
||||||
|
if(PYTHON_EXECUTABLE)
|
||||||
|
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||||
|
endif()
|
||||||
|
find_package(Python COMPONENTS Interpreter)
|
||||||
|
endif()
|
||||||
find_package(Python REQUIRED COMPONENTS Interpreter Development)
|
find_package(Python REQUIRED COMPONENTS Interpreter Development)
|
||||||
target_link_libraries(lammps PRIVATE Python::Python)
|
target_link_libraries(lammps PRIVATE Python::Python)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@ -18,6 +18,8 @@ if(DOWNLOAD_SCAFACOS)
|
|||||||
set(SCAFACOS_MD5 "bd46d74e3296bd8a444d731bb10c1738" CACHE STRING "MD5 checksum of SCAFACOS tarball")
|
set(SCAFACOS_MD5 "bd46d74e3296bd8a444d731bb10c1738" CACHE STRING "MD5 checksum of SCAFACOS tarball")
|
||||||
mark_as_advanced(SCAFACOS_URL)
|
mark_as_advanced(SCAFACOS_URL)
|
||||||
mark_as_advanced(SCAFACOS_MD5)
|
mark_as_advanced(SCAFACOS_MD5)
|
||||||
|
GetFallbackURL(SCAFACOS_URL SCAFACOS_FALLBACK)
|
||||||
|
|
||||||
|
|
||||||
# version 1.0.1 needs a patch to compile and linke cleanly with GCC 10 and later.
|
# version 1.0.1 needs a patch to compile and linke cleanly with GCC 10 and later.
|
||||||
file(DOWNLOAD ${LAMMPS_THIRDPARTY_URL}/scafacos-1.0.1-fix.diff ${CMAKE_CURRENT_BINARY_DIR}/scafacos-1.0.1.fix.diff
|
file(DOWNLOAD ${LAMMPS_THIRDPARTY_URL}/scafacos-1.0.1-fix.diff ${CMAKE_CURRENT_BINARY_DIR}/scafacos-1.0.1.fix.diff
|
||||||
@ -30,7 +32,7 @@ if(DOWNLOAD_SCAFACOS)
|
|||||||
|
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
ExternalProject_Add(scafacos_build
|
ExternalProject_Add(scafacos_build
|
||||||
URL ${SCAFACOS_URL}
|
URL ${SCAFACOS_URL} ${SCAFACOS_FALLBACK}
|
||||||
URL_MD5 ${SCAFACOS_MD5}
|
URL_MD5 ${SCAFACOS_MD5}
|
||||||
PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_BINARY_DIR}/scafacos-1.0.1.fix.diff
|
PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_BINARY_DIR}/scafacos-1.0.1.fix.diff
|
||||||
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --disable-doc
|
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --disable-doc
|
||||||
|
|||||||
@ -1,4 +1,9 @@
|
|||||||
find_package(VTK REQUIRED NO_MODULE)
|
find_package(VTK REQUIRED NO_MODULE)
|
||||||
include(${VTK_USE_FILE})
|
|
||||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_VTK)
|
target_compile_definitions(lammps PRIVATE -DLAMMPS_VTK)
|
||||||
|
if (VTK_MAJOR_VERSION VERSION_LESS 9.0)
|
||||||
|
include(${VTK_USE_FILE})
|
||||||
target_link_libraries(lammps PRIVATE ${VTK_LIBRARIES})
|
target_link_libraries(lammps PRIVATE ${VTK_LIBRARIES})
|
||||||
|
else()
|
||||||
|
target_link_libraries(lammps PRIVATE VTK::CommonCore VTK::IOCore VTK::CommonDataModel VTK::IOXML VTK::IOLegacy VTK::IOParallelXML)
|
||||||
|
vtk_module_autoinit(TARGETS lammps MODULES VTK::CommonCore VTK::IOCore VTK::CommonDataModel VTK::IOXML VTK::IOLegacy VTK::IOParallelXML)
|
||||||
|
endif()
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
function(FindStyleHeaders path style_class file_pattern headers)
|
function(FindStyleHeaders path style_class file_pattern headers)
|
||||||
file(GLOB files "${path}/${file_pattern}*.h")
|
file(GLOB files ${CONFIGURE_DEPENDS} "${path}/${file_pattern}*.h")
|
||||||
get_property(hlist GLOBAL PROPERTY ${headers})
|
get_property(hlist GLOBAL PROPERTY ${headers})
|
||||||
|
|
||||||
foreach(file_name ${files})
|
foreach(file_name ${files})
|
||||||
@ -184,7 +184,7 @@ endfunction(DetectBuildSystemConflict)
|
|||||||
|
|
||||||
|
|
||||||
function(FindPackagesHeaders path style_class file_pattern headers)
|
function(FindPackagesHeaders path style_class file_pattern headers)
|
||||||
file(GLOB files "${path}/${file_pattern}*.h")
|
file(GLOB files ${CONFIGURE_DEPENDS} "${path}/${file_pattern}*.h")
|
||||||
get_property(plist GLOBAL PROPERTY ${headers})
|
get_property(plist GLOBAL PROPERTY ${headers})
|
||||||
|
|
||||||
foreach(file_name ${files})
|
foreach(file_name ${files})
|
||||||
|
|||||||
@ -6,7 +6,7 @@ if(ENABLE_TESTING)
|
|||||||
find_program(VALGRIND_BINARY NAMES valgrind)
|
find_program(VALGRIND_BINARY NAMES valgrind)
|
||||||
# generate custom suppression file
|
# generate custom suppression file
|
||||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/lammps.supp "\n")
|
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/lammps.supp "\n")
|
||||||
file(GLOB VALGRIND_SUPPRESSION_FILES ${LAMMPS_TOOLS_DIR}/valgrind/[^.]*.supp)
|
file(GLOB VALGRIND_SUPPRESSION_FILES ${CONFIGURE_DEPENDS} ${LAMMPS_TOOLS_DIR}/valgrind/[^.]*.supp)
|
||||||
foreach(SUPP ${VALGRIND_SUPPRESSION_FILES})
|
foreach(SUPP ${VALGRIND_SUPPRESSION_FILES})
|
||||||
file(READ ${SUPP} SUPPRESSIONS)
|
file(READ ${SUPP} SUPPRESSIONS)
|
||||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/lammps.supp "${SUPPRESSIONS}")
|
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/lammps.supp "${SUPPRESSIONS}")
|
||||||
|
|||||||
@ -3,6 +3,9 @@ if(BUILD_TOOLS)
|
|||||||
target_compile_definitions(binary2txt PRIVATE -DLAMMPS_${LAMMPS_SIZES})
|
target_compile_definitions(binary2txt PRIVATE -DLAMMPS_${LAMMPS_SIZES})
|
||||||
install(TARGETS binary2txt DESTINATION ${CMAKE_INSTALL_BINDIR})
|
install(TARGETS binary2txt DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
|
|
||||||
|
add_executable(stl_bin2txt ${LAMMPS_TOOLS_DIR}/stl_bin2txt.cpp)
|
||||||
|
install(TARGETS stl_bin2txt DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
|
|
||||||
include(CheckGeneratorSupport)
|
include(CheckGeneratorSupport)
|
||||||
if(CMAKE_GENERATOR_SUPPORT_FORTRAN)
|
if(CMAKE_GENERATOR_SUPPORT_FORTRAN)
|
||||||
include(CheckLanguage)
|
include(CheckLanguage)
|
||||||
@ -23,7 +26,7 @@ if(BUILD_TOOLS)
|
|||||||
|
|
||||||
enable_language(C)
|
enable_language(C)
|
||||||
get_filename_component(MSI2LMP_SOURCE_DIR ${LAMMPS_TOOLS_DIR}/msi2lmp/src ABSOLUTE)
|
get_filename_component(MSI2LMP_SOURCE_DIR ${LAMMPS_TOOLS_DIR}/msi2lmp/src ABSOLUTE)
|
||||||
file(GLOB MSI2LMP_SOURCES ${MSI2LMP_SOURCE_DIR}/[^.]*.c)
|
file(GLOB MSI2LMP_SOURCES ${CONFIGURE_DEPENDS} ${MSI2LMP_SOURCE_DIR}/[^.]*.c)
|
||||||
add_executable(msi2lmp ${MSI2LMP_SOURCES})
|
add_executable(msi2lmp ${MSI2LMP_SOURCES})
|
||||||
if(STANDARD_MATH_LIB)
|
if(STANDARD_MATH_LIB)
|
||||||
target_link_libraries(msi2lmp PRIVATE ${STANDARD_MATH_LIB})
|
target_link_libraries(msi2lmp PRIVATE ${STANDARD_MATH_LIB})
|
||||||
@ -47,12 +50,16 @@ if(BUILD_LAMMPS_SHELL)
|
|||||||
|
|
||||||
add_executable(lammps-shell ${LAMMPS_TOOLS_DIR}/lammps-shell/lammps-shell.cpp ${ICON_RC_FILE})
|
add_executable(lammps-shell ${LAMMPS_TOOLS_DIR}/lammps-shell/lammps-shell.cpp ${ICON_RC_FILE})
|
||||||
target_include_directories(lammps-shell PRIVATE ${LAMMPS_TOOLS_DIR}/lammps-shell)
|
target_include_directories(lammps-shell PRIVATE ${LAMMPS_TOOLS_DIR}/lammps-shell)
|
||||||
|
target_link_libraries(lammps-shell PRIVATE lammps PkgConfig::READLINE)
|
||||||
|
|
||||||
# workaround for broken readline pkg-config file on FreeBSD
|
# workaround for broken readline pkg-config file on FreeBSD
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
||||||
target_include_directories(lammps-shell PRIVATE /usr/local/include)
|
target_include_directories(lammps-shell PRIVATE /usr/local/include)
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(lammps-shell PRIVATE lammps PkgConfig::READLINE)
|
if(CMAKE_SYSTEM_NAME STREQUAL "LinuxMUSL")
|
||||||
|
pkg_check_modules(TERMCAP IMPORTED_TARGET REQUIRED termcap)
|
||||||
|
target_link_libraries(lammps-shell PRIVATE lammps PkgConfig::TERMCAP)
|
||||||
|
endif()
|
||||||
install(TARGETS lammps-shell EXPORT LAMMPS_Targets DESTINATION ${CMAKE_INSTALL_BINDIR})
|
install(TARGETS lammps-shell EXPORT LAMMPS_Targets DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
install(DIRECTORY ${LAMMPS_TOOLS_DIR}/lammps-shell/icons DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/)
|
install(DIRECTORY ${LAMMPS_TOOLS_DIR}/lammps-shell/icons DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/)
|
||||||
install(FILES ${LAMMPS_TOOLS_DIR}/lammps-shell/lammps-shell.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications/)
|
install(FILES ${LAMMPS_TOOLS_DIR}/lammps-shell/lammps-shell.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications/)
|
||||||
|
|||||||
@ -31,5 +31,7 @@ set(temp "${temp}const char *LAMMPS_NS::LAMMPS::git_descriptor() { return \"${te
|
|||||||
set(temp "${temp}#endif\n\n")
|
set(temp "${temp}#endif\n\n")
|
||||||
|
|
||||||
message(STATUS "Generating lmpgitversion.h...")
|
message(STATUS "Generating lmpgitversion.h...")
|
||||||
file(WRITE "${LAMMPS_STYLE_HEADERS_DIR}/lmpgitversion.h.tmp" "${temp}" )
|
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${LAMMPS_STYLE_HEADERS_DIR}/lmpgitversion.h.tmp" "${LAMMPS_STYLE_HEADERS_DIR}/lmpgitversion.h")
|
string(REPLACE "\\ " " " LAMMPS_GIT_HEADER "${LAMMPS_STYLE_HEADERS_DIR}/lmpgitversion.h")
|
||||||
|
file(WRITE "${LAMMPS_GIT_HEADER}.tmp" "${temp}" )
|
||||||
|
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${LAMMPS_GIT_HEADER}.tmp" "${LAMMPS_GIT_HEADER}")
|
||||||
|
|||||||
@ -8,6 +8,7 @@ set(ALL_PACKAGES
|
|||||||
AWPMD
|
AWPMD
|
||||||
BOCS
|
BOCS
|
||||||
BODY
|
BODY
|
||||||
|
BPM
|
||||||
BROWNIAN
|
BROWNIAN
|
||||||
CG-DNA
|
CG-DNA
|
||||||
CG-SDK
|
CG-SDK
|
||||||
@ -24,6 +25,7 @@ set(ALL_PACKAGES
|
|||||||
DPD-REACT
|
DPD-REACT
|
||||||
DPD-SMOOTH
|
DPD-SMOOTH
|
||||||
DRUDE
|
DRUDE
|
||||||
|
ELECTRODE
|
||||||
EFF
|
EFF
|
||||||
EXTRA-COMPUTE
|
EXTRA-COMPUTE
|
||||||
EXTRA-DUMP
|
EXTRA-DUMP
|
||||||
@ -48,7 +50,6 @@ set(ALL_PACKAGES
|
|||||||
MDI
|
MDI
|
||||||
MEAM
|
MEAM
|
||||||
MESONT
|
MESONT
|
||||||
MESSAGE
|
|
||||||
MGPT
|
MGPT
|
||||||
MISC
|
MISC
|
||||||
ML-HDNNP
|
ML-HDNNP
|
||||||
|
|||||||
@ -10,6 +10,7 @@ set(ALL_PACKAGES
|
|||||||
AWPMD
|
AWPMD
|
||||||
BOCS
|
BOCS
|
||||||
BODY
|
BODY
|
||||||
|
BPM
|
||||||
BROWNIAN
|
BROWNIAN
|
||||||
CG-DNA
|
CG-DNA
|
||||||
CG-SDK
|
CG-SDK
|
||||||
@ -26,6 +27,7 @@ set(ALL_PACKAGES
|
|||||||
DPD-REACT
|
DPD-REACT
|
||||||
DPD-SMOOTH
|
DPD-SMOOTH
|
||||||
DRUDE
|
DRUDE
|
||||||
|
ELECTRODE
|
||||||
EFF
|
EFF
|
||||||
EXTRA-COMPUTE
|
EXTRA-COMPUTE
|
||||||
EXTRA-DUMP
|
EXTRA-DUMP
|
||||||
@ -50,7 +52,6 @@ set(ALL_PACKAGES
|
|||||||
MDI
|
MDI
|
||||||
MEAM
|
MEAM
|
||||||
MESONT
|
MESONT
|
||||||
MESSAGE
|
|
||||||
MGPT
|
MGPT
|
||||||
MISC
|
MISC
|
||||||
ML-HDNNP
|
ML-HDNNP
|
||||||
|
|||||||
@ -3,6 +3,13 @@
|
|||||||
# prefer flang over gfortran, if available
|
# prefer flang over gfortran, if available
|
||||||
find_program(CLANG_FORTRAN NAMES flang gfortran f95)
|
find_program(CLANG_FORTRAN NAMES flang gfortran f95)
|
||||||
set(ENV{OMPI_FC} ${CLANG_FORTRAN})
|
set(ENV{OMPI_FC} ${CLANG_FORTRAN})
|
||||||
|
get_filename_component(_tmp_fc ${CLANG_FORTRAN} NAME)
|
||||||
|
if (_tmp_fc STREQUAL "flang")
|
||||||
|
set(FC_STD_VERSION "-std=f2018")
|
||||||
|
set(BUILD_MPI OFF)
|
||||||
|
else()
|
||||||
|
set(FC_STD_VERSION "-std=f2003")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(CMAKE_CXX_COMPILER "clang++" CACHE STRING "" FORCE)
|
set(CMAKE_CXX_COMPILER "clang++" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_C_COMPILER "clang" CACHE STRING "" FORCE)
|
set(CMAKE_C_COMPILER "clang" CACHE STRING "" FORCE)
|
||||||
@ -10,9 +17,9 @@ set(CMAKE_Fortran_COMPILER ${CLANG_FORTRAN} CACHE STRING "" FORCE)
|
|||||||
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE)
|
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE)
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
|
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Wextra -g -std=f2003" CACHE STRING "" FORCE)
|
set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Wextra -g ${FC_STD_VERSION}" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
|
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG ${FC_STD_VERSION}" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
|
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG ${FC_STD_VERSION}" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_C_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE)
|
set(CMAKE_C_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE)
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
|
set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
|
||||||
@ -21,10 +28,3 @@ set(MPI_CXX "clang++" CACHE STRING "" FORCE)
|
|||||||
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
||||||
|
|
||||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||||
set(OpenMP_C "clang" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX "clang++" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_FLAGS "-fopenmp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_omp_LIBRARY "libomp.so" CACHE PATH "" FORCE)
|
|
||||||
|
|||||||
@ -19,11 +19,3 @@ set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Og -g -std=f2003" CACHE STRING "" FORCE)
|
|||||||
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
|
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
|
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
|
||||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||||
|
|
||||||
set(OpenMP_C "gcc" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_LIB_NAMES "gomp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX "g++" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_FLAGS "-fopenmp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_LIB_NAMES "gomp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_omp_LIBRARY "libgomp.so" CACHE PATH "" FORCE)
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# preset that will enable Intel compilers with support for MPI and OpenMP (on Linux boxes)
|
# preset that will enable the classic Intel compilers with support for MPI and OpenMP (on Linux boxes)
|
||||||
|
|
||||||
set(CMAKE_CXX_COMPILER "icpc" CACHE STRING "" FORCE)
|
set(CMAKE_CXX_COMPILER "icpc" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_C_COMPILER "icc" CACHE STRING "" FORCE)
|
set(CMAKE_C_COMPILER "icc" CACHE STRING "" FORCE)
|
||||||
@ -18,11 +18,11 @@ set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
|||||||
|
|
||||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||||
set(OpenMP_C "icc" CACHE STRING "" FORCE)
|
set(OpenMP_C "icc" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_C_FLAGS "-qopenmp" CACHE STRING "" FORCE)
|
set(OpenMP_C_FLAGS "-qopenmp -qopenmp-simd" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_CXX "icpc" CACHE STRING "" FORCE)
|
set(OpenMP_CXX "icpc" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_CXX_FLAGS "-qopenmp" CACHE STRING "" FORCE)
|
set(OpenMP_CXX_FLAGS "-qopenmp -qopenmp-simd" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_Fortran_FLAGS "-qopenmp" CACHE STRING "" FORCE)
|
set(OpenMP_Fortran_FLAGS "-qopenmp -qopenmp-simd" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_omp_LIBRARY "libiomp5.so" CACHE PATH "" FORCE)
|
set(OpenMP_omp_LIBRARY "libiomp5.so" CACHE PATH "" FORCE)
|
||||||
|
|
||||||
|
|||||||
@ -3,9 +3,9 @@
|
|||||||
# that is compatible with all higher CC, but not the default CC 3.5
|
# that is compatible with all higher CC, but not the default CC 3.5
|
||||||
set(PKG_KOKKOS ON CACHE BOOL "" FORCE)
|
set(PKG_KOKKOS ON CACHE BOOL "" FORCE)
|
||||||
set(Kokkos_ENABLE_SERIAL ON CACHE BOOL "" FORCE)
|
set(Kokkos_ENABLE_SERIAL ON CACHE BOOL "" FORCE)
|
||||||
set(Kokkos_ENABLE_OPENMP ON CACHE BOOL "" FORCE)
|
|
||||||
set(Kokkos_ENABLE_CUDA ON CACHE BOOL "" FORCE)
|
set(Kokkos_ENABLE_CUDA ON CACHE BOOL "" FORCE)
|
||||||
set(Kokkos_ARCH_MAXWELL50 on CACHE BOOL "" FORCE)
|
set(Kokkos_ARCH_PASCAL60 ON CACHE BOOL "" FORCE)
|
||||||
set(BUILD_OMP ON CACHE BOOL "" FORCE)
|
set(BUILD_OMP ON CACHE BOOL "" FORCE)
|
||||||
get_filename_component(NVCC_WRAPPER_CMD ${CMAKE_CURRENT_SOURCE_DIR}/../lib/kokkos/bin/nvcc_wrapper ABSOLUTE)
|
|
||||||
set(CMAKE_CXX_COMPILER ${NVCC_WRAPPER_CMD} CACHE FILEPATH "" FORCE)
|
# hide deprecation warnings temporarily for stable release
|
||||||
|
set(Kokkos_ENABLE_DEPRECATION_WARNINGS OFF CACHE BOOL "" FORCE)
|
||||||
|
|||||||
20
cmake/presets/kokkos-hip.cmake
Normal file
20
cmake/presets/kokkos-hip.cmake
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# 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 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_COMPILER hipcc CACHE STRING "" FORCE)
|
||||||
|
set(CMAKE_TUNE_FLAGS "-munsafe-fp-atomics" CACHE STRING "" FORCE)
|
||||||
|
|
||||||
|
# hide deprecation warnings temporarily for stable release
|
||||||
|
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"
|
||||||
|
#-D MPI_CXX_LIBRARIES="-L${MPICH_DIR}/lib -lmpi -L${CRAY_MPICH_ROOTDIR}/gtl/lib -lmpi_gtl_hsa"
|
||||||
@ -4,3 +4,6 @@ set(Kokkos_ENABLE_SERIAL ON CACHE BOOL "" FORCE)
|
|||||||
set(Kokkos_ENABLE_OPENMP ON CACHE BOOL "" FORCE)
|
set(Kokkos_ENABLE_OPENMP ON CACHE BOOL "" FORCE)
|
||||||
set(Kokkos_ENABLE_CUDA OFF CACHE BOOL "" FORCE)
|
set(Kokkos_ENABLE_CUDA OFF CACHE BOOL "" FORCE)
|
||||||
set(BUILD_OMP ON CACHE BOOL "" FORCE)
|
set(BUILD_OMP ON CACHE BOOL "" FORCE)
|
||||||
|
|
||||||
|
# hide deprecation warnings temporarily for stable release
|
||||||
|
set(Kokkos_ENABLE_DEPRECATION_WARNINGS OFF CACHE BOOL "" FORCE)
|
||||||
|
|||||||
@ -3,3 +3,6 @@ set(PKG_KOKKOS ON CACHE BOOL "" FORCE)
|
|||||||
set(Kokkos_ENABLE_SERIAL ON CACHE BOOL "" FORCE)
|
set(Kokkos_ENABLE_SERIAL ON CACHE BOOL "" FORCE)
|
||||||
set(Kokkos_ENABLE_OPENMP OFF CACHE BOOL "" FORCE)
|
set(Kokkos_ENABLE_OPENMP OFF CACHE BOOL "" FORCE)
|
||||||
set(Kokkos_ENABLE_CUDA OFF CACHE BOOL "" FORCE)
|
set(Kokkos_ENABLE_CUDA OFF CACHE BOOL "" FORCE)
|
||||||
|
|
||||||
|
# hide deprecation warnings temporarily for stable release
|
||||||
|
set(Kokkos_ENABLE_DEPRECATION_WARNINGS OFF CACHE BOOL "" FORCE)
|
||||||
|
|||||||
18
cmake/presets/kokkos-sycl.cmake
Normal file
18
cmake/presets/kokkos-sycl.cmake
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# 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(Kokkos_ARCH_MAXWELL50 on CACHE BOOL "" FORCE)
|
||||||
|
set(BUILD_OMP ON CACHE BOOL "" FORCE)
|
||||||
|
|
||||||
|
# hide deprecation warnings temporarily for stable release
|
||||||
|
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 "-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)
|
||||||
@ -4,6 +4,7 @@ set(WIN_PACKAGES
|
|||||||
AWPMD
|
AWPMD
|
||||||
BOCS
|
BOCS
|
||||||
BODY
|
BODY
|
||||||
|
BPM
|
||||||
BROWNIAN
|
BROWNIAN
|
||||||
CG-DNA
|
CG-DNA
|
||||||
CG-SDK
|
CG-SDK
|
||||||
@ -20,6 +21,7 @@ set(WIN_PACKAGES
|
|||||||
DPD-REACT
|
DPD-REACT
|
||||||
DPD-SMOOTH
|
DPD-SMOOTH
|
||||||
DRUDE
|
DRUDE
|
||||||
|
ELECTRODE
|
||||||
EFF
|
EFF
|
||||||
EXTRA-COMPUTE
|
EXTRA-COMPUTE
|
||||||
EXTRA-DUMP
|
EXTRA-DUMP
|
||||||
@ -44,8 +46,8 @@ set(WIN_PACKAGES
|
|||||||
MISC
|
MISC
|
||||||
ML-HDNNP
|
ML-HDNNP
|
||||||
ML-IAP
|
ML-IAP
|
||||||
ML-SNAP
|
|
||||||
ML-RANN
|
ML-RANN
|
||||||
|
ML-SNAP
|
||||||
MOFFF
|
MOFFF
|
||||||
MOLECULE
|
MOLECULE
|
||||||
MOLFILE
|
MOLFILE
|
||||||
@ -54,6 +56,7 @@ set(WIN_PACKAGES
|
|||||||
ORIENT
|
ORIENT
|
||||||
PERI
|
PERI
|
||||||
PHONON
|
PHONON
|
||||||
|
PLUGIN
|
||||||
POEMS
|
POEMS
|
||||||
PTM
|
PTM
|
||||||
QEQ
|
QEQ
|
||||||
|
|||||||
@ -6,6 +6,7 @@ set(ALL_PACKAGES
|
|||||||
ASPHERE
|
ASPHERE
|
||||||
BOCS
|
BOCS
|
||||||
BODY
|
BODY
|
||||||
|
BPM
|
||||||
BROWNIAN
|
BROWNIAN
|
||||||
CG-DNA
|
CG-DNA
|
||||||
CG-SDK
|
CG-SDK
|
||||||
@ -22,6 +23,7 @@ set(ALL_PACKAGES
|
|||||||
DPD-REACT
|
DPD-REACT
|
||||||
DPD-SMOOTH
|
DPD-SMOOTH
|
||||||
DRUDE
|
DRUDE
|
||||||
|
ELECTRODE
|
||||||
EFF
|
EFF
|
||||||
EXTRA-COMPUTE
|
EXTRA-COMPUTE
|
||||||
EXTRA-DUMP
|
EXTRA-DUMP
|
||||||
|
|||||||
@ -6,6 +6,7 @@ set(PACKAGES_WITH_LIB
|
|||||||
ATC
|
ATC
|
||||||
AWPMD
|
AWPMD
|
||||||
COMPRESS
|
COMPRESS
|
||||||
|
ELECTRODE
|
||||||
GPU
|
GPU
|
||||||
H5MD
|
H5MD
|
||||||
KIM
|
KIM
|
||||||
@ -15,7 +16,6 @@ set(PACKAGES_WITH_LIB
|
|||||||
MACHDYN
|
MACHDYN
|
||||||
MDI
|
MDI
|
||||||
MESONT
|
MESONT
|
||||||
MESSAGE
|
|
||||||
ML-HDNNP
|
ML-HDNNP
|
||||||
ML-PACE
|
ML-PACE
|
||||||
ML-QUIP
|
ML-QUIP
|
||||||
|
|||||||
9
cmake/presets/nvhpc.cmake
Normal file
9
cmake/presets/nvhpc.cmake
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# preset that will enable Nvidia HPC SDK compilers with support for MPI and OpenMP (on Linux boxes)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_COMPILER "nvc++" CACHE STRING "" FORCE)
|
||||||
|
set(CMAKE_C_COMPILER "nvc" CACHE STRING "" FORCE)
|
||||||
|
set(CMAKE_Fortran_COMPILER "nvfortran" CACHE STRING "" FORCE)
|
||||||
|
set(MPI_CXX "nvc++" CACHE STRING "" FORCE)
|
||||||
|
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
||||||
|
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||||
|
|
||||||
@ -18,11 +18,11 @@ set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
|||||||
|
|
||||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||||
set(OpenMP_C "icx" CACHE STRING "" FORCE)
|
set(OpenMP_C "icx" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_C_FLAGS "-qopenmp" CACHE STRING "" FORCE)
|
set(OpenMP_C_FLAGS "-qopenmp -qopenmp-simd" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_CXX "icpx" CACHE STRING "" FORCE)
|
set(OpenMP_CXX "icpx" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_CXX_FLAGS "-qopenmp" CACHE STRING "" FORCE)
|
set(OpenMP_CXX_FLAGS "-qopenmp -qopenmp-simd" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_Fortran_FLAGS "-qopenmp" CACHE STRING "" FORCE)
|
set(OpenMP_Fortran_FLAGS "-qopenmp -qopenmp-simd" CACHE STRING "" FORCE)
|
||||||
set(OpenMP_omp_LIBRARY "libiomp5.so" CACHE PATH "" FORCE)
|
set(OpenMP_omp_LIBRARY "libiomp5.so" CACHE PATH "" FORCE)
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# preset that will restore gcc/g++ with support for MPI and OpenMP (on Linux boxes)
|
# preset that will set gcc/g++ with extra warnings enabled and support for MPI and OpenMP (on Linux boxes)
|
||||||
|
|
||||||
set(CMAKE_CXX_COMPILER "g++" CACHE STRING "" FORCE)
|
set(CMAKE_CXX_COMPILER "g++" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_C_COMPILER "gcc" CACHE STRING "" FORCE)
|
set(CMAKE_C_COMPILER "gcc" CACHE STRING "" FORCE)
|
||||||
@ -17,10 +17,3 @@ set(MPI_Fortran "gfortran" CACHE STRING "" FORCE)
|
|||||||
set(MPI_Fortran_COMPILER "mpifort" CACHE STRING "" FORCE)
|
set(MPI_Fortran_COMPILER "mpifort" CACHE STRING "" FORCE)
|
||||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||||
|
|
||||||
set(OpenMP_C "gcc" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_LIB_NAMES "gomp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX "g++" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_FLAGS "-fopenmp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_LIB_NAMES "gomp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_omp_LIBRARY "libgomp.so" CACHE PATH "" FORCE)
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# preset that will enable clang/clang++ with support for MPI and OpenMP (on Linux boxes)
|
# preset that will enable PGI (Nvidia) compilers with support for MPI and OpenMP (on Linux boxes)
|
||||||
|
|
||||||
set(CMAKE_CXX_COMPILER "pgc++" CACHE STRING "" FORCE)
|
set(CMAKE_CXX_COMPILER "pgc++" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_C_COMPILER "pgcc" CACHE STRING "" FORCE)
|
set(CMAKE_C_COMPILER "pgcc" CACHE STRING "" FORCE)
|
||||||
@ -7,10 +7,3 @@ set(MPI_CXX "pgc++" CACHE STRING "" FORCE)
|
|||||||
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
||||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||||
|
|
||||||
set(OpenMP_C "pgcc" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_FLAGS "-mp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX "pgc++" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_FLAGS "-mp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
|
||||||
set(OpenMP_omp_LIBRARY "libomp.so" CACHE PATH "" FORCE)
|
|
||||||
|
|||||||
8
cmake/presets/windows-intel-classic.cmake
Normal file
8
cmake/presets/windows-intel-classic.cmake
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# preset that will enable Intel compilers with support for MPI and OpenMP (on Linux boxes)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_COMPILER "icl" CACHE STRING "" FORCE)
|
||||||
|
set(CMAKE_C_COMPILER "icl" CACHE STRING "" FORCE)
|
||||||
|
set(CMAKE_Fortran_COMPILER "ifort" CACHE STRING "" FORCE)
|
||||||
|
|
||||||
|
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||||
|
|
||||||
8
cmake/presets/windows-intel-llvm.cmake
Normal file
8
cmake/presets/windows-intel-llvm.cmake
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# preset that will enable Intel compilers with support for MPI and OpenMP (on Linux boxes)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_COMPILER "icx" CACHE STRING "" FORCE)
|
||||||
|
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_TUNE_FLAGS -Wno-unused-command-line-argument)
|
||||||
@ -2,6 +2,7 @@ set(WIN_PACKAGES
|
|||||||
ASPHERE
|
ASPHERE
|
||||||
BOCS
|
BOCS
|
||||||
BODY
|
BODY
|
||||||
|
BPM
|
||||||
BROWNIAN
|
BROWNIAN
|
||||||
CG-DNA
|
CG-DNA
|
||||||
CG-SDK
|
CG-SDK
|
||||||
@ -42,6 +43,7 @@ set(WIN_PACKAGES
|
|||||||
PERI
|
PERI
|
||||||
PHONON
|
PHONON
|
||||||
POEMS
|
POEMS
|
||||||
|
PLUGIN
|
||||||
PTM
|
PTM
|
||||||
QEQ
|
QEQ
|
||||||
QTB
|
QTB
|
||||||
|
|||||||
2
doc/.gitignore
vendored
2
doc/.gitignore
vendored
@ -1,6 +1,6 @@
|
|||||||
/old
|
/old
|
||||||
/html
|
/html
|
||||||
/html-offline
|
/fasthtml
|
||||||
/epub
|
/epub
|
||||||
/latex
|
/latex
|
||||||
/mathjax
|
/mathjax
|
||||||
|
|||||||
75
doc/Makefile
75
doc/Makefile
@ -13,35 +13,24 @@ VENV = $(BUILDDIR)/docenv
|
|||||||
ANCHORCHECK = $(VENV)/bin/rst_anchor_check
|
ANCHORCHECK = $(VENV)/bin/rst_anchor_check
|
||||||
SPHINXCONFIG = $(BUILDDIR)/utils/sphinx-config
|
SPHINXCONFIG = $(BUILDDIR)/utils/sphinx-config
|
||||||
MATHJAX = $(SPHINXCONFIG)/_static/mathjax
|
MATHJAX = $(SPHINXCONFIG)/_static/mathjax
|
||||||
|
MATHJAXTAG = 3.2.2
|
||||||
|
|
||||||
PYTHON = $(shell which python3)
|
PYTHON = $(word 3,$(shell type python3))
|
||||||
DOXYGEN = $(shell which doxygen)
|
DOXYGEN = $(word 3,$(shell type doxygen))
|
||||||
VIRTUALENV = virtualenv
|
|
||||||
HAS_PYTHON3 = NO
|
HAS_PYTHON3 = NO
|
||||||
HAS_VIRTUALENV = NO
|
|
||||||
HAS_DOXYGEN = NO
|
HAS_DOXYGEN = NO
|
||||||
HAS_PDFLATEX = NO
|
HAS_PDFLATEX = NO
|
||||||
|
|
||||||
ifeq ($(shell which python3 >/dev/null 2>&1; echo $$?), 0)
|
ifeq ($(shell type python3 >/dev/null 2>&1; echo $$?), 0)
|
||||||
HAS_PYTHON3 = YES
|
HAS_PYTHON3 = YES
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(shell which doxygen >/dev/null 2>&1; echo $$?), 0)
|
ifeq ($(shell type doxygen >/dev/null 2>&1; echo $$?), 0)
|
||||||
HAS_DOXYGEN = YES
|
HAS_DOXYGEN = YES
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(shell which virtualenv-3 >/dev/null 2>&1; echo $$?), 0)
|
ifeq ($(shell type pdflatex >/dev/null 2>&1; echo $$?), 0)
|
||||||
VIRTUALENV = virtualenv-3
|
ifeq ($(shell type latexmk >/dev/null 2>&1; echo $$?), 0)
|
||||||
HAS_VIRTUALENV = YES
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(shell which virtualenv >/dev/null 2>&1; echo $$?), 0)
|
|
||||||
VIRTUALENV = virtualenv
|
|
||||||
HAS_VIRTUALENV = YES
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(shell which pdflatex >/dev/null 2>&1; echo $$?), 0)
|
|
||||||
ifeq ($(shell which latexmk >/dev/null 2>&1; echo $$?), 0)
|
|
||||||
HAS_PDFLATEX = YES
|
HAS_PDFLATEX = YES
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@ -49,16 +38,14 @@ endif
|
|||||||
# override settings for PIP commands
|
# override settings for PIP commands
|
||||||
# PIP_OPTIONS = --cert /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt --proxy http://proxy.mydomain.org
|
# PIP_OPTIONS = --cert /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt --proxy http://proxy.mydomain.org
|
||||||
|
|
||||||
#SPHINXEXTRA = -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocessing.cpu_count())') $(shell test -f $(BUILDDIR)/doxygen/xml/run.stamp && printf -- "-E")
|
|
||||||
|
|
||||||
# temporarily disable caching so that the hack for the sphinx-tabs extensions to get proper non-html output works
|
# temporarily disable caching so that the hack for the sphinx-tabs extensions to get proper non-html output works
|
||||||
SPHINXEXTRA = -E -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocessing.cpu_count())')
|
SPHINXEXTRA = -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocessing.cpu_count())')
|
||||||
|
|
||||||
# grab list of sources from doxygen config file.
|
# grab list of sources from doxygen config file.
|
||||||
# we only want to use explicitly listed files.
|
# we only want to use explicitly listed files.
|
||||||
DOXYFILES = $(shell sed -n -e 's/\#.*$$//' -e '/^ *INPUT \+=/,/^[A-Z_]\+ \+=/p' doxygen/Doxyfile.in | sed -e 's/@LAMMPS_SOURCE_DIR@/..\/src/g' -e 's/\\//g' -e 's/ \+/ /' -e 's/[A-Z_]\+ \+= *\(YES\|NO\|\)//')
|
DOXYFILES = $(shell sed -n -e 's/\#.*$$//' -e '/^ *INPUT \+=/,/^[A-Z_]\+ \+=/p' doxygen/Doxyfile.in | sed -e 's/@LAMMPS_SOURCE_DIR@/..\/src/g' -e 's/\\//g' -e 's/ \+/ /' -e 's/[A-Z_]\+ \+= *\(YES\|NO\|\)//')
|
||||||
|
|
||||||
.PHONY: help clean-all clean clean-spelling epub mobi rst html pdf spelling anchor_check style_check char_check xmlgen
|
.PHONY: help clean-all clean clean-spelling epub mobi html pdf spelling anchor_check style_check char_check role_check xmlgen fasthtml
|
||||||
|
|
||||||
# ------------------------------------------
|
# ------------------------------------------
|
||||||
|
|
||||||
@ -70,7 +57,8 @@ help:
|
|||||||
@echo " epub create ePUB format manual for e-book readers"
|
@echo " epub create ePUB format manual for e-book readers"
|
||||||
@echo " mobi convert ePUB to MOBI format manual for e-book readers (e.g. Kindle)"
|
@echo " mobi convert ePUB to MOBI format manual for e-book readers (e.g. Kindle)"
|
||||||
@echo " (requires ebook-convert tool from calibre)"
|
@echo " (requires ebook-convert tool from calibre)"
|
||||||
@echo " clean remove all intermediate RST files"
|
@echo " fasthtml approximate HTML page creation in fasthtml dir (for development)"
|
||||||
|
@echo " clean remove all intermediate files"
|
||||||
@echo " clean-all reset the entire build environment"
|
@echo " clean-all reset the entire build environment"
|
||||||
@echo " anchor_check scan for duplicate anchor labels"
|
@echo " anchor_check scan for duplicate anchor labels"
|
||||||
@echo " style_check check for complete and consistent style lists"
|
@echo " style_check check for complete and consistent style lists"
|
||||||
@ -83,7 +71,7 @@ clean-all: clean
|
|||||||
rm -rf $(BUILDDIR)/docenv $(MATHJAX) $(BUILDDIR)/LAMMPS.mobi $(BUILDDIR)/LAMMPS.epub $(BUILDDIR)/Manual.pdf
|
rm -rf $(BUILDDIR)/docenv $(MATHJAX) $(BUILDDIR)/LAMMPS.mobi $(BUILDDIR)/LAMMPS.epub $(BUILDDIR)/Manual.pdf
|
||||||
|
|
||||||
clean: clean-spelling
|
clean: clean-spelling
|
||||||
rm -rf $(BUILDDIR)/html $(BUILDDIR)/epub $(BUILDDIR)/latex $(BUILDDIR)/doctrees $(BUILDDIR)/doxygen/xml $(BUILDDIR)/doxygen-warn.log $(BUILDDIR)/doxygen/Doxyfile $(SPHINXCONFIG)/conf.py
|
rm -rf $(BUILDDIR)/html $(BUILDDIR)/epub $(BUILDDIR)/latex $(BUILDDIR)/doctrees $(BUILDDIR)/doxygen/xml $(BUILDDIR)/doxygen-warn.log $(BUILDDIR)/doxygen/Doxyfile $(SPHINXCONFIG)/conf.py $(BUILDDIR)/fasthtml
|
||||||
|
|
||||||
clean-spelling:
|
clean-spelling:
|
||||||
rm -rf $(BUILDDIR)/spelling
|
rm -rf $(BUILDDIR)/spelling
|
||||||
@ -99,6 +87,8 @@ html: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX)
|
|||||||
@$(MAKE) $(MFLAGS) -C graphviz all
|
@$(MAKE) $(MFLAGS) -C graphviz all
|
||||||
@(\
|
@(\
|
||||||
. $(VENV)/bin/activate ; env PYTHONWARNINGS= \
|
. $(VENV)/bin/activate ; env PYTHONWARNINGS= \
|
||||||
|
sphinx-build -E $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) html ;\
|
||||||
|
touch $(RSTDIR)/Fortran.rst ;\
|
||||||
sphinx-build $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) html ;\
|
sphinx-build $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) html ;\
|
||||||
ln -sf Manual.html html/index.html;\
|
ln -sf Manual.html html/index.html;\
|
||||||
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
|
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
|
||||||
@ -106,6 +96,7 @@ html: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX)
|
|||||||
rst_anchor_check src/*.rst ;\
|
rst_anchor_check src/*.rst ;\
|
||||||
python $(BUILDDIR)/utils/check-packages.py -s ../src -d src ;\
|
python $(BUILDDIR)/utils/check-packages.py -s ../src -d src ;\
|
||||||
env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\
|
env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\
|
||||||
|
env LC_ALL=C grep -n ' :[a-z]\+`' $(RSTDIR)/*.rst ;\
|
||||||
python $(BUILDDIR)/utils/check-styles.py -s ../src -d src ;\
|
python $(BUILDDIR)/utils/check-styles.py -s ../src -d src ;\
|
||||||
echo "############################################" ;\
|
echo "############################################" ;\
|
||||||
deactivate ;\
|
deactivate ;\
|
||||||
@ -118,6 +109,25 @@ html: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX)
|
|||||||
@rm -rf html/PDF/.[sg]*
|
@rm -rf html/PDF/.[sg]*
|
||||||
@echo "Build finished. The HTML pages are in doc/html."
|
@echo "Build finished. The HTML pages are in doc/html."
|
||||||
|
|
||||||
|
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= \
|
||||||
|
sphinx-build $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/fasthtml/doctrees $(RSTDIR) fasthtml ;\
|
||||||
|
touch $(RSTDIR)/Fortran.rst ;\
|
||||||
|
sphinx-build $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/fasthtml/doctrees $(RSTDIR) fasthtml ;\
|
||||||
|
deactivate ;\
|
||||||
|
)
|
||||||
|
@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."
|
||||||
|
|
||||||
spelling: xmlgen $(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
|
@if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi
|
||||||
@(\
|
@(\
|
||||||
@ -137,6 +147,8 @@ epub: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK)
|
|||||||
@cp src/JPG/*.* epub/JPG
|
@cp src/JPG/*.* epub/JPG
|
||||||
@(\
|
@(\
|
||||||
. $(VENV)/bin/activate ;\
|
. $(VENV)/bin/activate ;\
|
||||||
|
sphinx-build -E $(SPHINXEXTRA) -b epub -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) epub ;\
|
||||||
|
touch $(RSTDIR)/Fortran.rst ;\
|
||||||
sphinx-build $(SPHINXEXTRA) -b epub -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) epub ;\
|
sphinx-build $(SPHINXEXTRA) -b epub -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) epub ;\
|
||||||
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
|
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
|
||||||
deactivate ;\
|
deactivate ;\
|
||||||
@ -156,12 +168,15 @@ pdf: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK)
|
|||||||
@if [ "$(HAS_PDFLATEX)" == "NO" ] ; then echo "PDFLaTeX or latexmk were not found! Please check README for further instructions" 1>&2; exit 1; fi
|
@if [ "$(HAS_PDFLATEX)" == "NO" ] ; then echo "PDFLaTeX or latexmk were not found! Please check README for further instructions" 1>&2; exit 1; fi
|
||||||
@(\
|
@(\
|
||||||
. $(VENV)/bin/activate ; env PYTHONWARNINGS= \
|
. $(VENV)/bin/activate ; env PYTHONWARNINGS= \
|
||||||
|
sphinx-build -E $(SPHINXEXTRA) -b latex -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\
|
||||||
|
touch $(RSTDIR)/Fortran.rst ;\
|
||||||
sphinx-build $(SPHINXEXTRA) -b latex -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\
|
sphinx-build $(SPHINXEXTRA) -b latex -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\
|
||||||
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
|
rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\
|
||||||
echo "############################################" ;\
|
echo "############################################" ;\
|
||||||
rst_anchor_check src/*.rst ;\
|
rst_anchor_check src/*.rst ;\
|
||||||
python utils/check-packages.py -s ../src -d src ;\
|
python utils/check-packages.py -s ../src -d src ;\
|
||||||
env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\
|
env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\
|
||||||
|
env LC_ALL=C grep -n ' :[a-z]\+`' $(RSTDIR)/*.rst ;\
|
||||||
python utils/check-styles.py -s ../src -d src ;\
|
python utils/check-styles.py -s ../src -d src ;\
|
||||||
echo "############################################" ;\
|
echo "############################################" ;\
|
||||||
deactivate ;\
|
deactivate ;\
|
||||||
@ -207,6 +222,9 @@ package_check : $(VENV)
|
|||||||
char_check :
|
char_check :
|
||||||
@( env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst && exit 1 || : )
|
@( env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst && exit 1 || : )
|
||||||
|
|
||||||
|
role_check :
|
||||||
|
@( env LC_ALL=C grep -n ' :[a-z]\+`' $(RSTDIR)/*.rst && exit 1 || : )
|
||||||
|
|
||||||
xmlgen : doxygen/xml/index.xml
|
xmlgen : doxygen/xml/index.xml
|
||||||
|
|
||||||
doxygen/Doxyfile: doxygen/Doxyfile.in
|
doxygen/Doxyfile: doxygen/Doxyfile.in
|
||||||
@ -220,22 +238,21 @@ $(VENV):
|
|||||||
@if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi
|
@if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi
|
||||||
@if [ "$(HAS_PYTHON3)" == "NO" ] ; then echo "python3 was not found! Please see README for further instructions" 1>&2; exit 1; fi
|
@if [ "$(HAS_PYTHON3)" == "NO" ] ; then echo "python3 was not found! Please see README for further instructions" 1>&2; exit 1; fi
|
||||||
@if [ "$(HAS_DOXYGEN)" == "NO" ] ; then echo "doxygen was not found! Please see README for further instructions" 1>&2; exit 1; fi
|
@if [ "$(HAS_DOXYGEN)" == "NO" ] ; then echo "doxygen was not found! Please see README for further instructions" 1>&2; exit 1; fi
|
||||||
@if [ "$(HAS_VIRTUALENV)" == "NO" ] ; then echo "virtualenv was not found! Please see README for further instructions" 1>&2; exit 1; fi
|
|
||||||
@( \
|
@( \
|
||||||
$(VIRTUALENV) -p $(PYTHON) $(VENV); \
|
$(PYTHON) -m venv $(VENV); \
|
||||||
. $(VENV)/bin/activate; \
|
. $(VENV)/bin/activate; \
|
||||||
pip $(PIP_OPTIONS) install --upgrade pip; \
|
pip $(PIP_OPTIONS) install --upgrade pip; \
|
||||||
|
pip $(PIP_OPTIONS) install --upgrade wheel; \
|
||||||
pip $(PIP_OPTIONS) install -r $(BUILDDIR)/utils/requirements.txt; \
|
pip $(PIP_OPTIONS) install -r $(BUILDDIR)/utils/requirements.txt; \
|
||||||
deactivate;\
|
deactivate;\
|
||||||
)
|
)
|
||||||
|
|
||||||
$(MATHJAX):
|
$(MATHJAX):
|
||||||
@git clone -b 3.2.0 -c advice.detachedHead=0 --depth 1 https://github.com/mathjax/MathJax.git $@
|
@git clone -b $(MATHJAXTAG) -c advice.detachedHead=0 --depth 1 https://github.com/mathjax/MathJax.git $@
|
||||||
|
|
||||||
$(ANCHORCHECK): $(VENV)
|
$(ANCHORCHECK): $(VENV)
|
||||||
@( \
|
@( \
|
||||||
. $(VENV)/bin/activate; \
|
. $(VENV)/bin/activate; \
|
||||||
(cd utils/converters;\
|
pip $(PIP_OPTIONS) install -e utils/converters;\
|
||||||
python setup.py develop);\
|
|
||||||
deactivate;\
|
deactivate;\
|
||||||
)
|
)
|
||||||
|
|||||||
@ -40,8 +40,9 @@ environment and local folders.
|
|||||||
Installing prerequisites for the documentation build
|
Installing prerequisites for the documentation build
|
||||||
|
|
||||||
To run the HTML documention build toolchain, python 3.x, doxygen, git,
|
To run the HTML documention build toolchain, python 3.x, doxygen, git,
|
||||||
and virtualenv have to be installed. Also internet access is initially
|
and the venv python module have to be installed if not already available.
|
||||||
required to download external files and tools.
|
Also internet access is initially required to download external files
|
||||||
|
and tools.
|
||||||
|
|
||||||
Building the PDF format manual requires in addition a compatible LaTeX
|
Building the PDF format manual requires in addition a compatible LaTeX
|
||||||
installation with support for PDFLaTeX and several add-on LaTeX packages
|
installation with support for PDFLaTeX and several add-on LaTeX packages
|
||||||
|
|||||||
@ -4,45 +4,44 @@ This purpose of this document is to provide a point of reference
|
|||||||
for LAMMPS developers and contributors as to what conventions
|
for LAMMPS developers and contributors as to what conventions
|
||||||
should be used to structure and format files in the LAMMPS manual.
|
should be used to structure and format files in the LAMMPS manual.
|
||||||
|
|
||||||
Last change: 2020-04-23
|
Last change: 2022-12-30
|
||||||
|
|
||||||
## File format and tools
|
## File format and tools
|
||||||
|
|
||||||
In fall 2019, the LAMMPS documentation file format has changed from
|
In fall 2019, the LAMMPS documentation file format has changed from a
|
||||||
a home grown minimal markup designed to generate HTML format files
|
home grown markup designed to generate HTML format files only, to
|
||||||
from a mostly plain text format to using the reStructuredText file
|
[reStructuredText](https://docutils.sourceforge.io/rst.html>. For a
|
||||||
format. For a transition period all files in the old .txt format
|
transition period all files in the old .txt format were transparently
|
||||||
were transparently converted to .rst and then processed. The txt2rst
|
converted to .rst and then processed. The `txt2rst tool` is still
|
||||||
tool is still included in the distribution to obtain an initial .rst
|
included in the distribution to obtain an initial .rst file for legacy
|
||||||
file for integration into the manual. Since the transition to
|
integration into the manual. Since that transition to reStructured
|
||||||
reStructured text as source format, many of the artifacts or the
|
text, many of the artifacts of the translation have been removed though,
|
||||||
translation have been removed though and parts of the documentation
|
and parts of the documentation refactored and expanded to take advantage
|
||||||
refactored and expanded to take advantage of the capabilities
|
of the capabilities reStructuredText and associated tools. The
|
||||||
reStructuredText and associated tools. The conversion from the
|
conversion from the source to the final formats (HTML, PDF, and
|
||||||
source to the final formats (HTML, PDF, and optionally e-book
|
optionally e-book reader formats ePUB and MOBI) is mostly automated and
|
||||||
reader formats ePUB and MOBI) is mostly automated and controlled
|
controlled by a Makefile in the `doc` folder. This makefile assumes that
|
||||||
by a Makefile in the `doc` folder. This makefile assumes that the
|
the processing is done on a Unix-like machine and Python 3.5 or later
|
||||||
processing is done on a Unix-like machine and Python 3.5 or later
|
and a matching venv module are available. Additional Python
|
||||||
and a matching virtualenv module are available. Additional Python
|
packages (like the Sphinx tool and several extensions) are transparently
|
||||||
packages (like the Sphinx tool and several extensions) are
|
installed into a virtual environment over the internet using the `pip`
|
||||||
transparently installed into a virtual environment over the
|
package manager. Further requirements and details are discussed in the
|
||||||
internet using the `pip` package manager. Further requirements
|
manual.
|
||||||
and details are discussed in the manual.
|
|
||||||
|
|
||||||
## Work in progress
|
## Work in progress
|
||||||
|
|
||||||
The refactoring and improving of the documentation is an ongoing
|
The refactoring and improving of the documentation is an ongoing
|
||||||
process, so statements in this document may not always be fully
|
process, so statements in this document may not always be fully
|
||||||
up-to-date. If in doubt, contact the LAMMPS developers.
|
up-to-date. When in doubt, contact the LAMMPS developers.
|
||||||
|
|
||||||
## General structure
|
## General structure
|
||||||
|
|
||||||
The layout and formatting of added files should follow the example
|
The layout and formatting of added files should follow the example of
|
||||||
of the existing files. Since those are directly derived from their
|
the existing files. Since many of those were initially derived from
|
||||||
former .txt format versions and the manual has been maintained in
|
their former .txt format versions and the manual has been maintained in
|
||||||
that format for many years, there is a large degree of consistency
|
that format for many years, there is a large degree of consistency
|
||||||
already, so comparison with similar files should give you a good
|
already, so comparison with similar files should give you a good idea
|
||||||
idea what kind of information and sections are needed.
|
what kind of information and sections are needed.
|
||||||
|
|
||||||
## Formatting conventions
|
## Formatting conventions
|
||||||
|
|
||||||
@ -59,14 +58,20 @@ double backward quotes bracketing the item: \`\`path/to/some/file\`\`
|
|||||||
Keywords and options are formatted in italics: \*option\*
|
Keywords and options are formatted in italics: \*option\*
|
||||||
|
|
||||||
Mathematical expressions, equations, symbols are typeset using
|
Mathematical expressions, equations, symbols are typeset using
|
||||||
either a `.. math:`` block or the `:math:` role.
|
either a `.. math:` block or the `:math:` role.
|
||||||
|
|
||||||
Groups of shell commands or LAMMPS input script or C/C++ source
|
Groups of shell commands or LAMMPS input script or C/C++/Python source
|
||||||
code should be typeset into a `.. code-block::` section. A syntax
|
code should be typeset into a `.. code-block::` section. A syntax
|
||||||
highlighting extension for LAMMPS input scripts is provided, so
|
highlighting extension for LAMMPS input scripts is provided, so `LAMMPS`
|
||||||
`LAMMPS` can be used to indicate the language in the code block
|
can be used to indicate the language in the code block in addition to
|
||||||
in addition to `bash`, `c`, or `python`. When no syntax style
|
`bash`, `c`, `c++`, `console`, `csh`, `diff', `fortran`, `json`, `make`,
|
||||||
is indicated, no syntax highlighting is performed.
|
`perl`, `powershell`, `python`, `sh`, or `tcl`, `text`, or `yaml`. When
|
||||||
|
no syntax style is indicated, no syntax highlighting is performed. When
|
||||||
|
typesetting commands executed on the shell, please do not prefix
|
||||||
|
commands with a shell prompt and use `bash` highlighting, except when
|
||||||
|
the block also shows the output from that command. In the latter case,
|
||||||
|
please use a dollar sign as the shell prompt and `console` for syntax
|
||||||
|
highlighting.
|
||||||
|
|
||||||
As an alternative, e.g. to typeset the syntax of file formats
|
As an alternative, e.g. to typeset the syntax of file formats
|
||||||
a `.. parsed-literal::` block can be used, which allows some
|
a `.. parsed-literal::` block can be used, which allows some
|
||||||
@ -89,22 +94,30 @@ by ` :class: note`.
|
|||||||
|
|
||||||
## Required steps when adding a custom style to LAMMPS
|
## Required steps when adding a custom style to LAMMPS
|
||||||
|
|
||||||
When adding a new style (e.g. pair style or a compute or a fix)
|
When adding a new style (e.g. pair style or a compute or a fix) or a new
|
||||||
or a new command, it is **required** to include the corresponding
|
command, it is **required** to include the **corresponding documentation**
|
||||||
documentation. Those are often new files that need to be added.
|
in [reStructuredText format](https://docutils.sourceforge.io/rst.html).
|
||||||
In order to be included in the documentation, those new files
|
Those are often new files that need to be added. In order to be
|
||||||
need to be reference in a `.. toctree::` block. Most of those
|
included in the documentation, those new files need to be referenced in a
|
||||||
use patterns with wildcards, so the addition will be automatic.
|
`.. toctree::` block. Most of those use patterns with wild cards, so the
|
||||||
However, those additions also need to be added to some lists of
|
addition will be automatic. However, those additions also need to be
|
||||||
styles or commands. The `make style\_check` command will perform
|
added to some lists of styles or commands. The `make style\_check`
|
||||||
a test and report any missing entries and list the affected files.
|
command when executed in the `doc` folder will perform a test and report
|
||||||
Any references defined with `.. \_refname:` have to be unique
|
any missing entries and list the affected files. Any references defined
|
||||||
across all documentation files and this can be checked for with
|
with `.. \_refname:` have to be unique across all documentation files
|
||||||
`make anchor\_check`. Finally, a spell-check should be done,
|
and this can be checked for with `make anchor\_check`. Finally, a
|
||||||
which is triggered via `make spelling`. Any offenses need to
|
spell-check should be done, which is triggered via `make spelling`. Any
|
||||||
be corrected and false positives should be added to the file
|
offenses need to be corrected and false positives should be added to the
|
||||||
`utils/sphinx-config/false\_positives.txt`.
|
file `utils/sphinx-config/false\_positives.txt`.
|
||||||
|
|
||||||
## Required additional steps when adding a new package to LAMMPS
|
## Required additional steps when adding a new package to LAMMPS
|
||||||
|
|
||||||
TODO
|
When adding a new package, the package must be added to the list of
|
||||||
|
packages in the `Packages_list.rst` file. If additional build instructions
|
||||||
|
need to be followed, a corresponding section should be added to the
|
||||||
|
`Build_extras.rst` file and linked from the list at the top of the
|
||||||
|
file as well as the equivalent list in the `Build_packages.rst` file.
|
||||||
|
|
||||||
|
A detailed description of the package and pointers to configuration,
|
||||||
|
included commands and examples, external pages, author information and
|
||||||
|
more should be added to the `Packages_details.rst` file.
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
DOXYFILE_ENCODING = UTF-8
|
DOXYFILE_ENCODING = UTF-8
|
||||||
PROJECT_NAME = "LAMMPS Programmer's Guide"
|
PROJECT_NAME = "LAMMPS Programmer's Guide"
|
||||||
PROJECT_NUMBER = "24 August 2020"
|
PROJECT_NUMBER = "4 May 2022"
|
||||||
PROJECT_BRIEF = "Documentation of the LAMMPS library interface and Python wrapper"
|
PROJECT_BRIEF = "Documentation of the LAMMPS library interface and Python wrapper"
|
||||||
PROJECT_LOGO = lammps-logo.png
|
PROJECT_LOGO = lammps-logo.png
|
||||||
CREATE_SUBDIRS = NO
|
CREATE_SUBDIRS = NO
|
||||||
@ -437,6 +437,8 @@ INPUT = @LAMMPS_SOURCE_DIR@/utils.cpp \
|
|||||||
@LAMMPS_SOURCE_DIR@/math_eigen.h \
|
@LAMMPS_SOURCE_DIR@/math_eigen.h \
|
||||||
@LAMMPS_SOURCE_DIR@/platform.h \
|
@LAMMPS_SOURCE_DIR@/platform.h \
|
||||||
@LAMMPS_SOURCE_DIR@/platform.cpp \
|
@LAMMPS_SOURCE_DIR@/platform.cpp \
|
||||||
|
@LAMMPS_SOURCE_DIR@/math_special.h \
|
||||||
|
@LAMMPS_SOURCE_DIR@/math_special.cpp \
|
||||||
|
|
||||||
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
|
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
|
||||||
# directories that are symbolic links (a Unix file system feature) are excluded
|
# directories that are symbolic links (a Unix file system feature) are excluded
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
.TH LAMMPS "1" "24 March 2022" "2022-3-24"
|
.TH LAMMPS "1" "23 June 2022 - Update 4" "2022-6-23"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
.B LAMMPS
|
.B LAMMPS
|
||||||
\- Molecular Dynamics Simulator. Version 24 March 2022
|
\- Molecular Dynamics Simulator. Version 23 June 2022 - Update 4
|
||||||
|
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B lmp
|
.B lmp
|
||||||
@ -161,7 +161,7 @@ list references for specific cite-able features used during a
|
|||||||
run.
|
run.
|
||||||
.TP
|
.TP
|
||||||
\fB\-pk <style> [options]\fR or \fB\-package <style> [options]\fR
|
\fB\-pk <style> [options]\fR or \fB\-package <style> [options]\fR
|
||||||
Invoke the \fBpackage\R command with <style> and optional arguments.
|
Invoke the \fBpackage\fR command with <style> and optional arguments.
|
||||||
The syntax is the same as if the command appeared in an input script.
|
The syntax is the same as if the command appeared in an input script.
|
||||||
For example "-pk gpu 2" is the same as "package gpu 2" in the input
|
For example "-pk gpu 2" is the same as "package gpu 2" in the input
|
||||||
script. The possible styles and options are discussed in the
|
script. The possible styles and options are discussed in the
|
||||||
|
|||||||
@ -98,7 +98,7 @@ msi2lmp decane -c 0 -f oplsaa
|
|||||||
|
|
||||||
|
|
||||||
.SH COPYRIGHT
|
.SH COPYRIGHT
|
||||||
© 2003--2021 Sandia Corporation
|
© 2003--2022 Sandia Corporation
|
||||||
|
|
||||||
This package is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License version 2 as
|
||||||
|
|||||||
@ -368,7 +368,7 @@ Bibliography
|
|||||||
Frenkel and Smit, Understanding Molecular Simulation, Academic Press, London, 2002.
|
Frenkel and Smit, Understanding Molecular Simulation, Academic Press, London, 2002.
|
||||||
|
|
||||||
**(GLE4MD)**
|
**(GLE4MD)**
|
||||||
`http://gle4md.org/ <http://gle4md.org/>`_
|
`https://gle4md.org/ <https://gle4md.org/>`_
|
||||||
|
|
||||||
**(Gao)**
|
**(Gao)**
|
||||||
Gao and Weber, Nuclear Instruments and Methods in Physics Research B 191 (2012) 504.
|
Gao and Weber, Nuclear Instruments and Methods in Physics Research B 191 (2012) 504.
|
||||||
@ -407,7 +407,7 @@ Bibliography
|
|||||||
Guenole, Noehring, Vaid, Houlle, Xie, Prakash, Bitzek, Comput Mater Sci, 175, 109584 (2020).
|
Guenole, Noehring, Vaid, Houlle, Xie, Prakash, Bitzek, Comput Mater Sci, 175, 109584 (2020).
|
||||||
|
|
||||||
**(Gullet)**
|
**(Gullet)**
|
||||||
Gullet, Wagner, Slepoy, SANDIA Report 2003-8782 (2003).
|
Gullet, Wagner, Slepoy, SANDIA Report 2003-8782 (2003). DOI:10.2172/918395
|
||||||
|
|
||||||
**(Guo)**
|
**(Guo)**
|
||||||
Guo and Thirumalai, Journal of Molecular Biology, 263, 323-43 (1996).
|
Guo and Thirumalai, Journal of Molecular Biology, 263, 323-43 (1996).
|
||||||
@ -461,7 +461,7 @@ Bibliography
|
|||||||
Hunt, Mol Simul, 42, 347 (2016).
|
Hunt, Mol Simul, 42, 347 (2016).
|
||||||
|
|
||||||
**(IPI)**
|
**(IPI)**
|
||||||
`http://epfl-cosmo.github.io/gle4md/index.html?page=ipi <http://epfl-cosmo.github.io/gle4md/index.html?page=ipi>`_
|
`https://ipi-code.org/ <https://ipi-code.org/>`
|
||||||
|
|
||||||
**(IPI-CPC)**
|
**(IPI-CPC)**
|
||||||
Ceriotti, More and Manolopoulos, Comp Phys Comm, 185, 1019-1026 (2014).
|
Ceriotti, More and Manolopoulos, Comp Phys Comm, 185, 1019-1026 (2014).
|
||||||
@ -733,8 +733,8 @@ Bibliography
|
|||||||
**(Mishin)**
|
**(Mishin)**
|
||||||
Mishin, Mehl, and Papaconstantopoulos, Acta Mater, 53, 4029 (2005).
|
Mishin, Mehl, and Papaconstantopoulos, Acta Mater, 53, 4029 (2005).
|
||||||
|
|
||||||
**(Mitchell and Finchham)**
|
**(Mitchell and Fincham)**
|
||||||
Mitchell, Finchham, J Phys Condensed Matter, 5, 1031-1038 (1993).
|
Mitchell, Fincham, J Phys Condensed Matter, 5, 1031-1038 (1993).
|
||||||
|
|
||||||
**(Mitchell2011)**
|
**(Mitchell2011)**
|
||||||
Mitchell. A non-local, ordinary-state-based viscoelasticity model for peridynamics. Sandia National Lab Report, 8064:1-28 (2011).
|
Mitchell. A non-local, ordinary-state-based viscoelasticity model for peridynamics. Sandia National Lab Report, 8064:1-28 (2011).
|
||||||
@ -875,7 +875,7 @@ Bibliography
|
|||||||
G.A. Tribello, M. Bonomi, D. Branduardi, C. Camilloni and G. Bussi, Comp. Phys. Comm 185, 604 (2014)
|
G.A. Tribello, M. Bonomi, D. Branduardi, C. Camilloni and G. Bussi, Comp. Phys. Comm 185, 604 (2014)
|
||||||
|
|
||||||
**(Paquay)**
|
**(Paquay)**
|
||||||
Paquay and Kusters, Biophys. J., 110, 6, (2016). preprint available at `arXiv:1411.3019 <http://arxiv.org/abs/1411.3019/>`_.
|
Paquay and Kusters, Biophys. J., 110, 6, (2016). preprint available at `arXiv:1411.3019 <https://arxiv.org/abs/1411.3019/>`_.
|
||||||
|
|
||||||
**(Park)**
|
**(Park)**
|
||||||
Park, Schulten, J. Chem. Phys. 120 (13), 5946 (2004)
|
Park, Schulten, J. Chem. Phys. 120 (13), 5946 (2004)
|
||||||
@ -1373,7 +1373,7 @@ Bibliography
|
|||||||
Zhu, Tajkhorshid, and Schulten, Biophys. J. 83, 154 (2002).
|
Zhu, Tajkhorshid, and Schulten, Biophys. J. 83, 154 (2002).
|
||||||
|
|
||||||
**(Ziegler)**
|
**(Ziegler)**
|
||||||
J.F. Ziegler, J. P. Biersack and U. Littmark, "The Stopping and Range of Ions in Matter," Volume 1, Pergamon, 1985.
|
J.F. Ziegler, J. P. Biersack and U. Littmark, "The Stopping and Range of Ions in Matter", Volume 1, Pergamon, 1985.
|
||||||
|
|
||||||
**(Zimmerman2004)**
|
**(Zimmerman2004)**
|
||||||
Zimmerman, JA; Webb, EB; Hoyt, JJ;. Jones, RE; Klein, PA; Bammann, DJ, "Calculation of stress in atomistic simulation." Special Issue of Modelling and Simulation in Materials Science and Engineering (2004),12:S319.
|
Zimmerman, JA; Webb, EB; Hoyt, JJ;. Jones, RE; Klein, PA; Bammann, DJ, "Calculation of stress in atomistic simulation." Special Issue of Modelling and Simulation in Materials Science and Engineering (2004),12:S319.
|
||||||
|
|||||||
@ -276,7 +276,7 @@ LAMMPS.
|
|||||||
|
|
||||||
Parallel build (see ``src/MAKE/Makefile.mpi``):
|
Parallel build (see ``src/MAKE/Makefile.mpi``):
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: make
|
||||||
|
|
||||||
CC = mpicxx
|
CC = mpicxx
|
||||||
CCFLAGS = -g -O3
|
CCFLAGS = -g -O3
|
||||||
@ -296,7 +296,7 @@ LAMMPS.
|
|||||||
|
|
||||||
If compilation stops with a message like the following:
|
If compilation stops with a message like the following:
|
||||||
|
|
||||||
.. code-block::
|
.. code-block:: output
|
||||||
|
|
||||||
g++ -g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -I../STUBS -c ../main.cpp
|
g++ -g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -I../STUBS -c ../main.cpp
|
||||||
In file included from ../pointers.h:24:0,
|
In file included from ../pointers.h:24:0,
|
||||||
|
|||||||
@ -140,36 +140,62 @@ of the LAMMPS project on GitHub.
|
|||||||
The unit testing facility is integrated into the CMake build process
|
The unit testing facility is integrated into the CMake build process
|
||||||
of the LAMMPS source code distribution itself. It can be enabled by
|
of the LAMMPS source code distribution itself. It can be enabled by
|
||||||
setting ``-D ENABLE_TESTING=on`` during the CMake configuration step.
|
setting ``-D ENABLE_TESTING=on`` during the CMake configuration step.
|
||||||
It requires the `YAML <http://pyyaml.org/>`_ library and development
|
It requires the `YAML <https://pyyaml.org/>`_ library and development
|
||||||
headers (if those are not found locally a recent version will be
|
headers (if those are not found locally a recent version will be
|
||||||
downloaded and compiled along with LAMMPS and the test program) to
|
downloaded and compiled along with LAMMPS and the test program) to
|
||||||
compile and will download and compile a specific recent version of the
|
compile and will download and compile a specific recent version of the
|
||||||
`Googletest <https://github.com/google/googletest/>`_ C++ test framework
|
`Googletest <https://github.com/google/googletest/>`_ C++ test framework
|
||||||
for implementing the tests.
|
for implementing the tests.
|
||||||
|
|
||||||
|
.. admonition:: Software version requirements for testing
|
||||||
|
:class: note
|
||||||
|
|
||||||
|
The compiler and library version requirements for the testing
|
||||||
|
framework are more strict than for the main part of LAMMPS. For
|
||||||
|
example the default GNU C++ and Fortran compilers of RHEL/CentOS 7.x
|
||||||
|
(version 4.8.x) are not sufficient. The CMake configuration will try
|
||||||
|
to detect incompatible versions and either skip incompatible tests or
|
||||||
|
stop with an error. Also the number of tests will depend on
|
||||||
|
installed LAMMPS packages, development environment, operating system,
|
||||||
|
and configuration settings.
|
||||||
|
|
||||||
After compilation is complete, the unit testing is started in the build
|
After compilation is complete, the unit testing is started in the build
|
||||||
folder using the ``ctest`` command, which is part of the CMake software.
|
folder using the ``ctest`` command, which is part of the CMake software.
|
||||||
The output of this command will be looking something like this::
|
The output of this command will be looking something like this:
|
||||||
|
|
||||||
[...]$ ctest
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ ctest
|
||||||
Test project /home/akohlmey/compile/lammps/build-testing
|
Test project /home/akohlmey/compile/lammps/build-testing
|
||||||
Start 1: MolPairStyle:hybrid-overlay
|
Start 1: RunLammps
|
||||||
1/109 Test #1: MolPairStyle:hybrid-overlay ......... Passed 0.02 sec
|
1/563 Test #1: RunLammps .......................................... Passed 0.28 sec
|
||||||
Start 2: MolPairStyle:hybrid
|
Start 2: HelpMessage
|
||||||
2/109 Test #2: MolPairStyle:hybrid ................. Passed 0.01 sec
|
2/563 Test #2: HelpMessage ........................................ Passed 0.06 sec
|
||||||
Start 3: MolPairStyle:lj_class2
|
Start 3: InvalidFlag
|
||||||
|
3/563 Test #3: InvalidFlag ........................................ Passed 0.06 sec
|
||||||
|
Start 4: Tokenizer
|
||||||
|
4/563 Test #4: Tokenizer .......................................... Passed 0.05 sec
|
||||||
|
Start 5: MemPool
|
||||||
|
5/563 Test #5: MemPool ............................................ Passed 0.05 sec
|
||||||
|
Start 6: ArgUtils
|
||||||
|
6/563 Test #6: ArgUtils ........................................... Passed 0.05 sec
|
||||||
[...]
|
[...]
|
||||||
Start 107: PotentialFileReader
|
Start 561: ImproperStyle:zero
|
||||||
107/109 Test #107: PotentialFileReader ................ Passed 0.04 sec
|
561/563 Test #561: ImproperStyle:zero ................................. Passed 0.07 sec
|
||||||
Start 108: EIMPotentialFileReader
|
Start 562: TestMliapPyUnified
|
||||||
108/109 Test #108: EIMPotentialFileReader ............. Passed 0.03 sec
|
562/563 Test #562: TestMliapPyUnified ................................. Passed 0.16 sec
|
||||||
Start 109: TestSimpleCommands
|
Start 563: TestPairList
|
||||||
109/109 Test #109: TestSimpleCommands ................. Passed 0.02 sec
|
563/563 Test #563: TestPairList ....................................... Passed 0.06 sec
|
||||||
|
|
||||||
100% tests passed, 0 tests failed out of 26
|
100% tests passed, 0 tests failed out of 563
|
||||||
|
|
||||||
Total Test time (real) = 25.57 sec
|
Label Time Summary:
|
||||||
|
generated = 0.85 sec*proc (3 tests)
|
||||||
|
noWindows = 4.16 sec*proc (2 tests)
|
||||||
|
slow = 78.33 sec*proc (67 tests)
|
||||||
|
unstable = 28.23 sec*proc (34 tests)
|
||||||
|
|
||||||
|
Total Test time (real) = 132.34 sec
|
||||||
|
|
||||||
The ``ctest`` command has many options, the most important ones are:
|
The ``ctest`` command has many options, the most important ones are:
|
||||||
|
|
||||||
@ -200,11 +226,13 @@ Fortran) and testing different aspects of the LAMMPS software and its features.
|
|||||||
The tests will adapt to the compilation settings of LAMMPS, so that tests
|
The tests will adapt to the compilation settings of LAMMPS, so that tests
|
||||||
will be skipped if prerequisite features are not available in LAMMPS.
|
will be skipped if prerequisite features are not available in LAMMPS.
|
||||||
|
|
||||||
.. note::
|
.. admonition:: Work in Progress
|
||||||
|
:class: note
|
||||||
|
|
||||||
The unit test framework was added in spring 2020 and is under active
|
The unit test framework was added in spring 2020 and is under active
|
||||||
development. The coverage is not complete and will be expanded over
|
development. The coverage is not complete and will be expanded over
|
||||||
time.
|
time. Preference is given to parts of the code base that are easy to
|
||||||
|
test or commonly used.
|
||||||
|
|
||||||
Tests for styles of the same kind of style (e.g. pair styles or bond
|
Tests for styles of the same kind of style (e.g. pair styles or bond
|
||||||
styles) are performed with the same test executable using different
|
styles) are performed with the same test executable using different
|
||||||
@ -238,9 +266,9 @@ the CMake option ``-D BUILD_MPI=off`` can significantly speed up testing,
|
|||||||
since this will skip the MPI initialization for each test run.
|
since this will skip the MPI initialization for each test run.
|
||||||
Below is an example command and output:
|
Below is an example command and output:
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: console
|
||||||
|
|
||||||
[tests]$ test_pair_style mol-pair-lj_cut.yaml
|
$ test_pair_style mol-pair-lj_cut.yaml
|
||||||
[==========] Running 6 tests from 1 test suite.
|
[==========] Running 6 tests from 1 test suite.
|
||||||
[----------] Global test environment set-up.
|
[----------] Global test environment set-up.
|
||||||
[----------] 6 tests from PairStyle
|
[----------] 6 tests from PairStyle
|
||||||
@ -486,14 +514,14 @@ The following options are available.
|
|||||||
make fix-whitespace # correct whitespace issues in files
|
make fix-whitespace # correct whitespace issues in files
|
||||||
make check-homepage # search for files with old LAMMPS homepage URLs
|
make check-homepage # search for files with old LAMMPS homepage URLs
|
||||||
make fix-homepage # correct LAMMPS homepage URLs in files
|
make fix-homepage # correct LAMMPS homepage URLs in files
|
||||||
|
make check-errordocs # search for deprecated error docs in header files
|
||||||
|
make fix-errordocs # remove error docs in header files
|
||||||
make check-permissions # search for files with permissions issues
|
make check-permissions # search for files with permissions issues
|
||||||
make fix-permissions # correct permissions issues in files
|
make fix-permissions # correct permissions issues in files
|
||||||
|
make check # run all check targets from above
|
||||||
|
|
||||||
These should help to replace all TAB characters with blanks and remove
|
These should help to make source and documentation files conforming
|
||||||
any trailing whitespace. Also all LAMMPS homepage URL references can be
|
to some the coding style preferences of the LAMMPS developers.
|
||||||
updated to the location change from Sandia to the lammps.org domain.
|
|
||||||
And the permission check can remove executable permissions from non-executable
|
|
||||||
files (like source code).
|
|
||||||
|
|
||||||
Clang-format support
|
Clang-format support
|
||||||
--------------------
|
--------------------
|
||||||
@ -520,7 +548,7 @@ commands like the following:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ clang-format -i some_file.cpp
|
clang-format -i some_file.cpp
|
||||||
|
|
||||||
|
|
||||||
The following target are available for both, GNU make and CMake:
|
The following target are available for both, GNU make and CMake:
|
||||||
@ -529,3 +557,19 @@ The following target are available for both, GNU make and CMake:
|
|||||||
|
|
||||||
make format-src # apply clang-format to all files in src and the package folders
|
make format-src # apply clang-format to all files in src and the package folders
|
||||||
make format-tests # apply clang-format to all files in the unittest tree
|
make format-tests # apply clang-format to all files in the unittest tree
|
||||||
|
|
||||||
|
----------
|
||||||
|
|
||||||
|
.. _gh-cli:
|
||||||
|
|
||||||
|
GitHub command line interface
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
GitHub is developing a `tool for the command line
|
||||||
|
<https://cli.github.com>`_ that interacts with the GitHub website via a
|
||||||
|
command called ``gh``. This can be extremely convenient when working
|
||||||
|
with a Git repository hosted on GitHub (like LAMMPS). It is thus highly
|
||||||
|
recommended to install it when doing LAMMPS development.
|
||||||
|
|
||||||
|
The capabilities of the ``gh`` command is continually expanding, so
|
||||||
|
please see the documentation at https://cli.github.com/manual/
|
||||||
|
|||||||
@ -12,11 +12,11 @@ in addition to
|
|||||||
- Traditional make
|
- Traditional make
|
||||||
* - .. code-block:: bash
|
* - .. code-block:: bash
|
||||||
|
|
||||||
$ cmake -D PKG_NAME=yes
|
cmake -D PKG_NAME=yes
|
||||||
|
|
||||||
- .. code-block:: bash
|
- .. code-block:: console
|
||||||
|
|
||||||
$ make yes-name
|
make yes-name
|
||||||
|
|
||||||
as described on the :doc:`Build_package <Build_package>` page.
|
as described on the :doc:`Build_package <Build_package>` page.
|
||||||
|
|
||||||
@ -28,14 +28,16 @@ You may need to tell LAMMPS where it is found on your system.
|
|||||||
|
|
||||||
This is the list of packages that may require additional steps.
|
This is the list of packages that may require additional steps.
|
||||||
|
|
||||||
|
.. this list must be kept in sync with its counterpart in Build_package.rst
|
||||||
.. table_from_list::
|
.. table_from_list::
|
||||||
:columns: 6
|
:columns: 6
|
||||||
|
|
||||||
* :ref:`ADIOS <adios>`
|
* :ref:`ADIOS <adios>`
|
||||||
* :ref:`ATC <atc>`
|
* :ref:`ATC <atc>`
|
||||||
* :ref:`AWPMD <awpmd>`
|
* :ref:`AWPMD <awpmd>`
|
||||||
* :ref:`COLVARS <colvars>`
|
* :ref:`COLVARS <colvar>`
|
||||||
* :ref:`COMPRESS <compress>`
|
* :ref:`COMPRESS <compress>`
|
||||||
|
* :ref:`ELECTRODE <electrode>`
|
||||||
* :ref:`GPU <gpu>`
|
* :ref:`GPU <gpu>`
|
||||||
* :ref:`H5MD <h5md>`
|
* :ref:`H5MD <h5md>`
|
||||||
* :ref:`INTEL <intel>`
|
* :ref:`INTEL <intel>`
|
||||||
@ -45,7 +47,6 @@ This is the list of packages that may require additional steps.
|
|||||||
* :ref:`MACHDYN <machdyn>`
|
* :ref:`MACHDYN <machdyn>`
|
||||||
* :ref:`MDI <mdi>`
|
* :ref:`MDI <mdi>`
|
||||||
* :ref:`MESONT <mesont>`
|
* :ref:`MESONT <mesont>`
|
||||||
* :ref:`MESSAGE <message>`
|
|
||||||
* :ref:`ML-HDNNP <ml-hdnnp>`
|
* :ref:`ML-HDNNP <ml-hdnnp>`
|
||||||
* :ref:`ML-IAP <mliap>`
|
* :ref:`ML-IAP <mliap>`
|
||||||
* :ref:`ML-PACE <ml-pace>`
|
* :ref:`ML-PACE <ml-pace>`
|
||||||
@ -124,6 +125,7 @@ CMake build
|
|||||||
-D GPU_API=value # value = opencl (default) or cuda or hip
|
-D GPU_API=value # value = opencl (default) or cuda or hip
|
||||||
-D GPU_PREC=value # precision setting
|
-D GPU_PREC=value # precision setting
|
||||||
# value = double or mixed (default) or single
|
# value = double or mixed (default) or single
|
||||||
|
-D HIP_PATH # path to HIP installation. Must be set if GPU_API=HIP
|
||||||
-D GPU_ARCH=value # primary GPU hardware choice for GPU_API=cuda
|
-D GPU_ARCH=value # primary GPU hardware choice for GPU_API=cuda
|
||||||
# value = sm_XX, see below
|
# value = sm_XX, see below
|
||||||
# default is sm_50
|
# default is sm_50
|
||||||
@ -142,15 +144,15 @@ CMake build
|
|||||||
|
|
||||||
:code:`GPU_ARCH` settings for different GPU hardware is as follows:
|
:code:`GPU_ARCH` settings for different GPU hardware is as follows:
|
||||||
|
|
||||||
* sm_12 or sm_13 for GT200 (supported by CUDA 3.2 until CUDA 6.5)
|
|
||||||
* sm_20 or sm_21 for Fermi (supported by CUDA 3.2 until CUDA 7.5)
|
|
||||||
* sm_30 for Kepler (supported since CUDA 5 and until CUDA 10.x)
|
* sm_30 for Kepler (supported since CUDA 5 and until CUDA 10.x)
|
||||||
* sm_35 or sm_37 for Kepler (supported since CUDA 5 and until CUDA 11.x)
|
* sm_35 or sm_37 for Kepler (supported since CUDA 5 and until CUDA 11.x)
|
||||||
* sm_50 or sm_52 for Maxwell (supported since CUDA 6)
|
* sm_50 or sm_52 for Maxwell (supported since CUDA 6)
|
||||||
* sm_60 or sm_61 for Pascal (supported since CUDA 8)
|
* sm_60 or sm_61 for Pascal (supported since CUDA 8)
|
||||||
* sm_70 for Volta (supported since CUDA 9)
|
* sm_70 for Volta (supported since CUDA 9)
|
||||||
* sm_75 for Turing (supported since CUDA 10)
|
* sm_75 for Turing (supported since CUDA 10)
|
||||||
* sm_80 for Ampere (supported since CUDA 11)
|
* sm_80 or sm_86 for Ampere (supported since CUDA 11, sm_86 since CUDA 11.1)
|
||||||
|
* sm_89 for Lovelace (supported since CUDA 11.8)
|
||||||
|
* sm_90 for Hopper (supported since CUDA 12.0)
|
||||||
|
|
||||||
A more detailed list can be found, for example,
|
A more detailed list can be found, for example,
|
||||||
at `Wikipedia's CUDA article <https://en.wikipedia.org/wiki/CUDA#GPUs_supported>`_
|
at `Wikipedia's CUDA article <https://en.wikipedia.org/wiki/CUDA#GPUs_supported>`_
|
||||||
@ -161,6 +163,12 @@ Thus the GPU_ARCH setting is merely an optimization, to have code for
|
|||||||
the preferred GPU architecture directly included rather than having to wait
|
the preferred GPU architecture directly included rather than having to wait
|
||||||
for the JIT compiler of the CUDA driver to translate it.
|
for the JIT compiler of the CUDA driver to translate it.
|
||||||
|
|
||||||
|
When compiling for CUDA or HIP with CUDA, version 8.0 or later of the CUDA toolkit
|
||||||
|
is required and a GPU architecture of Kepler or later, which must *also* be
|
||||||
|
supported by the CUDA toolkit in use **and** the CUDA driver in use.
|
||||||
|
When compiling for OpenCL, OpenCL version 1.2 or later is required and the
|
||||||
|
GPU must be supported by the GPU driver and OpenCL runtime bundled with the driver.
|
||||||
|
|
||||||
When building with CMake, you **must NOT** build the GPU library in ``lib/gpu``
|
When building with CMake, you **must NOT** build the GPU library in ``lib/gpu``
|
||||||
using the traditional build procedure. CMake will detect files generated by that
|
using the traditional build procedure. CMake will detect files generated by that
|
||||||
process and will terminate with an error and a suggestion for how to remove them.
|
process and will terminate with an error and a suggestion for how to remove them.
|
||||||
@ -212,15 +220,15 @@ LAMMPS code. This also applies to the ``-DLAMMPS_BIGBIG``\ ,
|
|||||||
Makefile you use.
|
Makefile you use.
|
||||||
|
|
||||||
You can also build the library in one step from the ``lammps/src`` dir,
|
You can also build the library in one step from the ``lammps/src`` dir,
|
||||||
using a command like these, which simply invoke the ``lib/gpu/Install.py``
|
using a command like these, which simply invokes the ``lib/gpu/Install.py``
|
||||||
script with the specified args:
|
script with the specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-gpu # print help message
|
make lib-gpu # print help message
|
||||||
$ make lib-gpu args="-b" # build GPU library with default Makefile.linux
|
make lib-gpu args="-b" # build GPU library with default Makefile.linux
|
||||||
$ make lib-gpu args="-m xk7 -p single -o xk7.single" # create new Makefile.xk7.single, altered for single-precision
|
make lib-gpu args="-m xk7 -p single -o xk7.single" # create new Makefile.xk7.single, altered for single-precision
|
||||||
$ make lib-gpu args="-m mpi -a sm_60 -p mixed -b" # build GPU library with mixed precision and P100 using other settings in Makefile.mpi
|
make lib-gpu args="-m mpi -a sm_60 -p mixed -b" # build GPU library with mixed precision and P100 using other settings in Makefile.mpi
|
||||||
|
|
||||||
Note that this procedure starts with a Makefile.machine in lib/gpu, as
|
Note that this procedure starts with a Makefile.machine in lib/gpu, as
|
||||||
specified by the "-m" switch. For your convenience, machine makefiles
|
specified by the "-m" switch. For your convenience, machine makefiles
|
||||||
@ -292,7 +300,7 @@ detailed information is available at:
|
|||||||
|
|
||||||
In addition to installing the KIM API, it is also necessary to install the
|
In addition to installing the KIM API, it is also necessary to install the
|
||||||
library of KIM models (interatomic potentials).
|
library of KIM models (interatomic potentials).
|
||||||
See `Obtaining KIM Models <http://openkim.org/doc/usage/obtaining-models>`_ to
|
See `Obtaining KIM Models <https://openkim.org/doc/usage/obtaining-models>`_ to
|
||||||
learn how to install a pre-build binary of the OpenKIM Repository of Models.
|
learn how to install a pre-build binary of the OpenKIM Repository of Models.
|
||||||
See the list of all KIM models here: https://openkim.org/browse/models
|
See the list of all KIM models here: https://openkim.org/browse/models
|
||||||
|
|
||||||
@ -328,18 +336,18 @@ minutes to hours) to build. Of course you only need to do that once.)
|
|||||||
You can download and build the KIM library manually if you prefer;
|
You can download and build the KIM library manually if you prefer;
|
||||||
follow the instructions in ``lib/kim/README``. You can also do
|
follow the instructions in ``lib/kim/README``. You can also do
|
||||||
this in one step from the lammps/src directory, using a command like
|
this in one step from the lammps/src directory, using a command like
|
||||||
these, which simply invoke the ``lib/kim/Install.py`` script with
|
these, which simply invokes the ``lib/kim/Install.py`` script with
|
||||||
the specified args.
|
the specified args.
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-kim # print help message
|
make lib-kim # print help message
|
||||||
$ make lib-kim args="-b " # (re-)install KIM API lib with only example models
|
make lib-kim args="-b " # (re-)install KIM API lib with only example models
|
||||||
$ make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # ditto plus one model
|
make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # ditto plus one model
|
||||||
$ make lib-kim args="-b -a everything" # install KIM API lib with all models
|
make lib-kim args="-b -a everything" # install KIM API lib with all models
|
||||||
$ make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # add one model or model driver
|
make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # add one model or model driver
|
||||||
$ make lib-kim args="-p /usr/local" # use an existing KIM API installation at the provided location
|
make lib-kim args="-p /usr/local" # use an existing KIM API installation at the provided location
|
||||||
$ make lib-kim args="-p /usr/local -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver
|
make lib-kim args="-p /usr/local -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver
|
||||||
|
|
||||||
When using the "-b " option, the KIM library is built using its native
|
When using the "-b " option, the KIM library is built using its native
|
||||||
cmake build system. The ``lib/kim/Install.py`` script supports a
|
cmake build system. The ``lib/kim/Install.py`` script supports a
|
||||||
@ -351,7 +359,7 @@ minutes to hours) to build. Of course you only need to do that once.)
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ CMAKE=cmake3 CXX=g++-11 CC=gcc-11 FC=gfortran-11 make lib-kim args="-b " # (re-)install KIM API lib using cmake3 and gnu v11 compilers with only example models
|
CMAKE=cmake3 CXX=g++-11 CC=gcc-11 FC=gfortran-11 make lib-kim args="-b " # (re-)install KIM API lib using cmake3 and gnu v11 compilers with only example models
|
||||||
|
|
||||||
Settings for debugging OpenKIM web queries discussed below need to
|
Settings for debugging OpenKIM web queries discussed below need to
|
||||||
be applied by adding them to the ``LMP_INC`` variable through
|
be applied by adding them to the ``LMP_INC`` variable through
|
||||||
@ -410,7 +418,7 @@ Enabling the extra unit tests have some requirements,
|
|||||||
``EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000``,
|
``EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000``,
|
||||||
``EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005``, and
|
``EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005``, and
|
||||||
``LennardJones612_UniversalShifted__MO_959249795837_003`` KIM models.
|
``LennardJones612_UniversalShifted__MO_959249795837_003`` KIM models.
|
||||||
See `Obtaining KIM Models <http://openkim.org/doc/usage/obtaining-models>`_
|
See `Obtaining KIM Models <https://openkim.org/doc/usage/obtaining-models>`_
|
||||||
to learn how to install a pre-built binary of the OpenKIM Repository of
|
to learn how to install a pre-built binary of the OpenKIM Repository of
|
||||||
Models or see
|
Models or see
|
||||||
`Installing KIM Models <https://openkim.org/doc/usage/obtaining-models/#installing_models>`_
|
`Installing KIM Models <https://openkim.org/doc/usage/obtaining-models/#installing_models>`_
|
||||||
@ -638,13 +646,27 @@ This list was last updated for version 3.5.0 of the Kokkos library.
|
|||||||
|
|
||||||
-D CMAKE_CXX_COMPILER=${HOME}/lammps/lib/kokkos/bin/nvcc_wrapper
|
-D CMAKE_CXX_COMPILER=${HOME}/lammps/lib/kokkos/bin/nvcc_wrapper
|
||||||
|
|
||||||
To simplify compilation, three preset files are included in the
|
For AMD or NVIDIA GPUs using HIP, 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_HIP=yes
|
||||||
|
-D Kokkos_ENABLE_OPENMP=yes
|
||||||
|
|
||||||
|
This will enable FFTs on the GPU, either by the internal KISSFFT library
|
||||||
|
or with the hipFFT wrapper library, which will call out to the
|
||||||
|
platform-appropriate vendor library: rocFFT on AMD GPUs or cuFFT on
|
||||||
|
NVIDIA GPUs.
|
||||||
|
|
||||||
|
To simplify compilation, five preset files are included in the
|
||||||
``cmake/presets`` folder, ``kokkos-serial.cmake``,
|
``cmake/presets`` folder, ``kokkos-serial.cmake``,
|
||||||
``kokkos-openmp.cmake``, and ``kokkos-cuda.cmake``. They will
|
``kokkos-openmp.cmake``, ``kokkos-cuda.cmake``,
|
||||||
enable the KOKKOS package and enable some hardware choice. So to
|
``kokkos-hip.cmake``, and ``kokkos-sycl.cmake``. They will enable
|
||||||
compile with OpenMP host parallelization, CUDA device
|
the KOKKOS package and enable some hardware choice. So to compile
|
||||||
parallelization (for GPUs with CC 5.0 and up) with some common
|
with CUDA device parallelization (for GPUs with CC 5.0 and up)
|
||||||
packages enabled, you can do the following:
|
with some common packages enabled, you can do the following:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
@ -703,6 +725,15 @@ This list was last updated for version 3.5.0 of the Kokkos library.
|
|||||||
KOKKOS_ABSOLUTE_PATH = $(shell cd $(KOKKOS_PATH); pwd)
|
KOKKOS_ABSOLUTE_PATH = $(shell cd $(KOKKOS_PATH); pwd)
|
||||||
CC = mpicxx -cxx=$(KOKKOS_ABSOLUTE_PATH)/config/nvcc_wrapper
|
CC = mpicxx -cxx=$(KOKKOS_ABSOLUTE_PATH)/config/nvcc_wrapper
|
||||||
|
|
||||||
|
For AMD or NVIDIA GPUs using HIP:
|
||||||
|
|
||||||
|
.. code-block:: make
|
||||||
|
|
||||||
|
KOKKOS_DEVICES = HIP
|
||||||
|
KOKKOS_ARCH = HOSTARCH,GPUARCH # HOSTARCH = HOST from list above that is hosting the GPU
|
||||||
|
# GPUARCH = GPU from list above
|
||||||
|
FFT_INC = -DFFT_HIPFFT # enable use of hipFFT (optional)
|
||||||
|
FFT_LIB = -lhipfft # link to hipFFT library
|
||||||
|
|
||||||
Advanced KOKKOS compilation settings
|
Advanced KOKKOS compilation settings
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@ -781,10 +812,10 @@ library.
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-latte # print help message
|
make lib-latte # print help message
|
||||||
$ make lib-latte args="-b" # download and build in lib/latte/LATTE-master
|
make lib-latte args="-b" # download and build in lib/latte/LATTE-master
|
||||||
$ make lib-latte args="-p $HOME/latte" # use existing LATTE installation in $HOME/latte
|
make lib-latte args="-p $HOME/latte" # use existing LATTE installation in $HOME/latte
|
||||||
$ make lib-latte args="-b -m gfortran" # download and build in lib/latte and
|
make lib-latte args="-b -m gfortran" # download and build in lib/latte and
|
||||||
# copy Makefile.lammps.gfortran to Makefile.lammps
|
# copy Makefile.lammps.gfortran to Makefile.lammps
|
||||||
|
|
||||||
Note that 3 symbolic (soft) links, ``includelink`` and ``liblink``
|
Note that 3 symbolic (soft) links, ``includelink`` and ``liblink``
|
||||||
@ -796,47 +827,6 @@ library.
|
|||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
.. _message:
|
|
||||||
|
|
||||||
MESSAGE package
|
|
||||||
-----------------------------
|
|
||||||
|
|
||||||
This package can optionally include support for messaging via sockets,
|
|
||||||
using the open-source `ZeroMQ library <http://zeromq.org>`_, which must
|
|
||||||
be installed on your system.
|
|
||||||
|
|
||||||
.. tabs::
|
|
||||||
|
|
||||||
.. tab:: CMake build
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
-D MESSAGE_ZMQ=value # build with ZeroMQ support, value = no (default) or yes
|
|
||||||
-D ZMQ_LIBRARY=path # ZMQ library file (only needed if a custom location)
|
|
||||||
-D ZMQ_INCLUDE_DIR=path # ZMQ include directory (only needed if a custom location)
|
|
||||||
|
|
||||||
.. tab:: Traditional make
|
|
||||||
|
|
||||||
Before building LAMMPS, you must build the CSlib library in
|
|
||||||
``lib/message``\ . You can build the CSlib library manually if
|
|
||||||
you prefer; follow the instructions in ``lib/message/README``\ .
|
|
||||||
You can also do it in one step from the ``lammps/src`` dir, using
|
|
||||||
a command like these, which simply invoke the
|
|
||||||
``lib/message/Install.py`` script with the specified args:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
$ make lib-message # print help message
|
|
||||||
$ make lib-message args="-m -z" # build with MPI and socket (ZMQ) support
|
|
||||||
$ make lib-message args="-s" # build as serial lib with no ZMQ support
|
|
||||||
|
|
||||||
The build should produce two files: ``lib/message/cslib/src/libmessage.a``
|
|
||||||
and ``lib/message/Makefile.lammps``. The latter is copied from an
|
|
||||||
existing ``Makefile.lammps.*`` and has settings to link with the ZeroMQ
|
|
||||||
library if requested in the build.
|
|
||||||
|
|
||||||
----------
|
|
||||||
|
|
||||||
.. _mliap:
|
.. _mliap:
|
||||||
|
|
||||||
ML-IAP package
|
ML-IAP package
|
||||||
@ -920,17 +910,17 @@ more details.
|
|||||||
You can download and build the MS-CG library manually if you
|
You can download and build the MS-CG library manually if you
|
||||||
prefer; follow the instructions in ``lib/mscg/README``\ . You can
|
prefer; follow the instructions in ``lib/mscg/README``\ . You can
|
||||||
also do it in one step from the ``lammps/src`` dir, using a
|
also do it in one step from the ``lammps/src`` dir, using a
|
||||||
command like these, which simply invoke the
|
command like these, which simply invokes the
|
||||||
``lib/mscg/Install.py`` script with the specified args:
|
``lib/mscg/Install.py`` script with the specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-mscg # print help message
|
make lib-mscg # print help message
|
||||||
$ make lib-mscg args="-b -m serial" # download and build in lib/mscg/MSCG-release-master
|
make lib-mscg args="-b -m serial" # download and build in lib/mscg/MSCG-release-master
|
||||||
# with the settings compatible with "make serial"
|
# with the settings compatible with "make serial"
|
||||||
$ make lib-mscg args="-b -m mpi" # download and build in lib/mscg/MSCG-release-master
|
make lib-mscg args="-b -m mpi" # download and build in lib/mscg/MSCG-release-master
|
||||||
# with the settings compatible with "make mpi"
|
# with the settings compatible with "make mpi"
|
||||||
$ make lib-mscg args="-p /usr/local/mscg-release" # use the existing MS-CG installation in /usr/local/mscg-release
|
make lib-mscg args="-p /usr/local/mscg-release" # use the existing MS-CG installation in /usr/local/mscg-release
|
||||||
|
|
||||||
Note that 2 symbolic (soft) links, ``includelink`` and ``liblink``,
|
Note that 2 symbolic (soft) links, ``includelink`` and ``liblink``,
|
||||||
will be created in ``lib/mscg`` to point to the MS-CG
|
will be created in ``lib/mscg`` to point to the MS-CG
|
||||||
@ -977,15 +967,15 @@ POEMS package
|
|||||||
``lib/poems``\ . You can do this manually if you prefer; follow
|
``lib/poems``\ . You can do this manually if you prefer; follow
|
||||||
the instructions in ``lib/poems/README``\ . You can also do it in
|
the instructions in ``lib/poems/README``\ . You can also do it in
|
||||||
one step from the ``lammps/src`` dir, using a command like these,
|
one step from the ``lammps/src`` dir, using a command like these,
|
||||||
which simply invoke the ``lib/poems/Install.py`` script with the
|
which simply invokes the ``lib/poems/Install.py`` script with the
|
||||||
specified args:
|
specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-poems # print help message
|
make lib-poems # print help message
|
||||||
$ make lib-poems args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
|
make lib-poems args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
|
||||||
$ make lib-poems args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
|
make lib-poems args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
|
||||||
$ make lib-poems args="-m icc" # build with Intel icc compiler
|
make lib-poems args="-m icc" # build with Intel icc compiler
|
||||||
|
|
||||||
The build should produce two files: ``lib/poems/libpoems.a`` and
|
The build should produce two files: ``lib/poems/libpoems.a`` and
|
||||||
``lib/poems/Makefile.lammps``. The latter is copied from an
|
``lib/poems/Makefile.lammps``. The latter is copied from an
|
||||||
@ -1040,7 +1030,7 @@ VORONOI package
|
|||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
To build with this package, you must download and build the
|
To build with this package, you must download and build the
|
||||||
`Voro++ library <http://math.lbl.gov/voro++>`_ or install a
|
`Voro++ library <https://math.lbl.gov/voro++>`_ or install a
|
||||||
binary package provided by your operating system.
|
binary package provided by your operating system.
|
||||||
|
|
||||||
.. tabs::
|
.. tabs::
|
||||||
@ -1066,15 +1056,15 @@ binary package provided by your operating system.
|
|||||||
You can download and build the Voro++ library manually if you
|
You can download and build the Voro++ library manually if you
|
||||||
prefer; follow the instructions in ``lib/voronoi/README``. You
|
prefer; follow the instructions in ``lib/voronoi/README``. You
|
||||||
can also do it in one step from the ``lammps/src`` dir, using a
|
can also do it in one step from the ``lammps/src`` dir, using a
|
||||||
command like these, which simply invoke the
|
command like these, which simply invokes the
|
||||||
``lib/voronoi/Install.py`` script with the specified args:
|
``lib/voronoi/Install.py`` script with the specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-voronoi # print help message
|
make lib-voronoi # print help message
|
||||||
$ make lib-voronoi args="-b" # download and build the default version in lib/voronoi/voro++-<version>
|
make lib-voronoi args="-b" # download and build the default version in lib/voronoi/voro++-<version>
|
||||||
$ make lib-voronoi args="-p $HOME/voro++" # use existing Voro++ installation in $HOME/voro++
|
make lib-voronoi args="-p $HOME/voro++" # use existing Voro++ installation in $HOME/voro++
|
||||||
$ make lib-voronoi args="-b -v voro++0.4.6" # download and build the 0.4.6 version in lib/voronoi/voro++-0.4.6
|
make lib-voronoi args="-b -v voro++0.4.6" # download and build the 0.4.6 version in lib/voronoi/voro++-0.4.6
|
||||||
|
|
||||||
Note that 2 symbolic (soft) links, ``includelink`` and
|
Note that 2 symbolic (soft) links, ``includelink`` and
|
||||||
``liblink``, are created in lib/voronoi to point to the Voro++
|
``liblink``, are created in lib/voronoi to point to the Voro++
|
||||||
@ -1115,13 +1105,13 @@ systems.
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make yes-adios
|
make yes-adios
|
||||||
|
|
||||||
otherwise, set ADIOS2_DIR environment variable when turning on the package:
|
otherwise, set ADIOS2_DIR environment variable when turning on the package:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ ADIOS2_DIR=path make yes-adios # path is where ADIOS 2.x is installed
|
ADIOS2_DIR=path make yes-adios # path is where ADIOS 2.x is installed
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
@ -1145,15 +1135,15 @@ The ATC package requires the MANYBODY package also be installed.
|
|||||||
``lib/atc``. You can do this manually if you prefer; follow the
|
``lib/atc``. You can do this manually if you prefer; follow the
|
||||||
instructions in ``lib/atc/README``. You can also do it in one
|
instructions in ``lib/atc/README``. You can also do it in one
|
||||||
step from the ``lammps/src`` dir, using a command like these,
|
step from the ``lammps/src`` dir, using a command like these,
|
||||||
which simply invoke the ``lib/atc/Install.py`` script with the
|
which simply invokes the ``lib/atc/Install.py`` script with the
|
||||||
specified args:
|
specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-atc # print help message
|
make lib-atc # print help message
|
||||||
$ make lib-atc args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
|
make lib-atc args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
|
||||||
$ make lib-atc args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
make lib-atc args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
||||||
$ make lib-atc args="-m icc" # build with Intel icc compiler
|
make lib-atc args="-m icc" # build with Intel icc compiler
|
||||||
|
|
||||||
The build should produce two files: ``lib/atc/libatc.a`` and
|
The build should produce two files: ``lib/atc/libatc.a`` and
|
||||||
``lib/atc/Makefile.lammps``. The latter is copied from an
|
``lib/atc/Makefile.lammps``. The latter is copied from an
|
||||||
@ -1172,17 +1162,17 @@ The ATC package requires the MANYBODY package also be installed.
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-linalg # print help message
|
make lib-linalg # print help message
|
||||||
$ make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
|
make lib-linalg args="-m serial" # build with GNU C++ compiler (settings as with "make serial")
|
||||||
$ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
|
make lib-linalg args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
|
||||||
$ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
|
make lib-linalg args="-m g++" # build with GNU Fortran compiler
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
.. _awpmd:
|
.. _awpmd:
|
||||||
|
|
||||||
AWPMD package
|
AWPMD package
|
||||||
------------------
|
-------------
|
||||||
|
|
||||||
.. tabs::
|
.. tabs::
|
||||||
|
|
||||||
@ -1196,15 +1186,15 @@ AWPMD package
|
|||||||
``lib/awpmd``. You can do this manually if you prefer; follow the
|
``lib/awpmd``. You can do this manually if you prefer; follow the
|
||||||
instructions in ``lib/awpmd/README``. You can also do it in one
|
instructions in ``lib/awpmd/README``. You can also do it in one
|
||||||
step from the ``lammps/src`` dir, using a command like these,
|
step from the ``lammps/src`` dir, using a command like these,
|
||||||
which simply invoke the ``lib/awpmd/Install.py`` script with the
|
which simply invokes the ``lib/awpmd/Install.py`` script with the
|
||||||
specified args:
|
specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-awpmd # print help message
|
make lib-awpmd # print help message
|
||||||
$ make lib-awpmd args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
|
make lib-awpmd args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
|
||||||
$ make lib-awpmd args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
make lib-awpmd args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
||||||
$ make lib-awpmd args="-m icc" # build with Intel icc compiler
|
make lib-awpmd args="-m icc" # build with Intel icc compiler
|
||||||
|
|
||||||
The build should produce two files: ``lib/awpmd/libawpmd.a`` and
|
The build should produce two files: ``lib/awpmd/libawpmd.a`` and
|
||||||
``lib/awpmd/Makefile.lammps``. The latter is copied from an
|
``lib/awpmd/Makefile.lammps``. The latter is copied from an
|
||||||
@ -1223,21 +1213,20 @@ AWPMD package
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-linalg # print help message
|
make lib-linalg # print help message
|
||||||
$ make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
|
make lib-linalg args="-m serial" # build with GNU C++ compiler (settings as with "make serial")
|
||||||
$ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
|
make lib-linalg args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
|
||||||
$ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
|
make lib-linalg args="-m g++" # build with GNU C++ compiler
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
.. _colvars:
|
.. _colvar:
|
||||||
|
|
||||||
COLVARS package
|
COLVARS package
|
||||||
---------------------------------------
|
---------------
|
||||||
|
|
||||||
This package includes the `Colvars library
|
This package enables the use of the `Colvars <https://colvars.github.io/>`_
|
||||||
<https://colvars.github.io/>`_ into the LAMMPS distribution, which can
|
module included in the LAMMPS source distribution.
|
||||||
be built for the most part with all major versions of the C++ language.
|
|
||||||
|
|
||||||
|
|
||||||
.. tabs::
|
.. tabs::
|
||||||
@ -1259,15 +1248,15 @@ be built for the most part with all major versions of the C++ language.
|
|||||||
|
|
||||||
In general, it is safer to use build setting consistent with the
|
In general, it is safer to use build setting consistent with the
|
||||||
rest of LAMMPS. This is best carried out from the LAMMPS src
|
rest of LAMMPS. This is best carried out from the LAMMPS src
|
||||||
directory using a command like these, which simply invoke the
|
directory using a command like these, which simply invokes the
|
||||||
``lib/colvars/Install.py`` script with the specified args:
|
``lib/colvars/Install.py`` script with the specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-colvars # print help message
|
make lib-colvars # print help message
|
||||||
$ make lib-colvars args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
|
make lib-colvars args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
|
||||||
$ make lib-colvars args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
make lib-colvars args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
||||||
$ make lib-colvars args="-m g++-debug" # build with GNU g++ compiler and colvars debugging enabled
|
make lib-colvars args="-m g++-debug" # build with GNU g++ compiler and colvars debugging enabled
|
||||||
|
|
||||||
The "machine" argument of the "-m" flag is used to find a
|
The "machine" argument of the "-m" flag is used to find a
|
||||||
Makefile.machine to use as build recipe. If it does not already
|
Makefile.machine to use as build recipe. If it does not already
|
||||||
@ -1279,8 +1268,8 @@ be built for the most part with all major versions of the C++ language.
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ COLVARS_DEBUG=yes make lib-colvars args="-m machine" # Build with debug code (much slower)
|
COLVARS_DEBUG=yes make lib-colvars args="-m machine" # Build with debug code (much slower)
|
||||||
$ COLVARS_LEPTON=no make lib-colvars args="-m machine" # Build without Lepton (included otherwise)
|
COLVARS_LEPTON=no make lib-colvars args="-m machine" # Build without Lepton (included otherwise)
|
||||||
|
|
||||||
The build should produce two files: the library ``lib/colvars/libcolvars.a``
|
The build should produce two files: the library ``lib/colvars/libcolvars.a``
|
||||||
(which also includes Lepton objects if enabled) and the specification file
|
(which also includes Lepton objects if enabled) and the specification file
|
||||||
@ -1289,6 +1278,54 @@ be built for the most part with all major versions of the C++ language.
|
|||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
.. _electrode:
|
||||||
|
|
||||||
|
ELECTRODE package
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
This package depends on the KSPACE package.
|
||||||
|
|
||||||
|
.. tabs::
|
||||||
|
|
||||||
|
.. tab:: CMake build
|
||||||
|
|
||||||
|
No additional settings are needed besides ``-D PKG_KSPACE=yes`` and
|
||||||
|
``-D PKG_ELECTRODE=yes``.
|
||||||
|
|
||||||
|
.. tab:: Traditional make
|
||||||
|
|
||||||
|
Before building LAMMPS, you must configure the ELECTRODE support
|
||||||
|
libraries and settings in ``lib/electrode``. You can do this
|
||||||
|
manually, if you prefer, or do it in one step from the
|
||||||
|
``lammps/src`` dir, using a command like these, which simply
|
||||||
|
invokes the ``lib/electrode/Install.py`` script with the specified
|
||||||
|
args:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
make lib-electrode # print help message
|
||||||
|
make lib-electrode args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
|
||||||
|
make lib-electrode args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
||||||
|
|
||||||
|
|
||||||
|
Note that the ``Makefile.lammps`` file has settings for the BLAS
|
||||||
|
and LAPACK linear algebra libraries. These can either exist on
|
||||||
|
your system, or you can use the files provided in ``lib/linalg``.
|
||||||
|
In the latter case you also need to build the library in
|
||||||
|
``lib/linalg`` with a command like these:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
make lib-linalg # print help message
|
||||||
|
make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
|
||||||
|
make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
|
||||||
|
make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
|
||||||
|
|
||||||
|
The package itself is activated with ``make yes-KSPACE`` and
|
||||||
|
``make yes-ELECTRODE``
|
||||||
|
|
||||||
|
----------
|
||||||
|
|
||||||
.. _ml-pace:
|
.. _ml-pace:
|
||||||
|
|
||||||
ML-PACE package
|
ML-PACE package
|
||||||
@ -1322,8 +1359,8 @@ at: `https://github.com/ICAMS/lammps-user-pace/ <https://github.com/ICAMS/lammps
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-pace # print help message
|
make lib-pace # print help message
|
||||||
$ make lib-pace args="-b" # download and build the default version in lib/pace
|
make lib-pace args="-b" # download and build the default version in lib/pace
|
||||||
|
|
||||||
You should not need to edit the ``lib/pace/Makefile.lammps`` file.
|
You should not need to edit the ``lib/pace/Makefile.lammps`` file.
|
||||||
|
|
||||||
@ -1422,10 +1459,10 @@ LAMMPS build.
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-plumed # print help message
|
make lib-plumed # print help message
|
||||||
$ make lib-plumed args="-b" # download and build PLUMED in lib/plumed/plumed2
|
make lib-plumed args="-b" # download and build PLUMED in lib/plumed/plumed2
|
||||||
$ make lib-plumed args="-p $HOME/.local" # use existing PLUMED installation in $HOME/.local
|
make lib-plumed args="-p $HOME/.local" # use existing PLUMED installation in $HOME/.local
|
||||||
$ make lib-plumed args="-p /usr/local -m shared" # use existing PLUMED installation in
|
make lib-plumed args="-p /usr/local -m shared" # use existing PLUMED installation in
|
||||||
# /usr/local and use shared linkage mode
|
# /usr/local and use shared linkage mode
|
||||||
|
|
||||||
Note that 2 symbolic (soft) links, ``includelink`` and ``liblink``
|
Note that 2 symbolic (soft) links, ``includelink`` and ``liblink``
|
||||||
@ -1438,8 +1475,8 @@ LAMMPS build.
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make yes-plumed
|
make yes-plumed
|
||||||
$ make machine
|
make machine
|
||||||
|
|
||||||
Once this compilation completes you should be able to run LAMMPS
|
Once this compilation completes you should be able to run LAMMPS
|
||||||
in the usual way. For shared linkage mode, libplumed.so must be
|
in the usual way. For shared linkage mode, libplumed.so must be
|
||||||
@ -1486,13 +1523,13 @@ the HDF5 library.
|
|||||||
``lib/h5md``. You can do this manually if you prefer; follow the
|
``lib/h5md``. You can do this manually if you prefer; follow the
|
||||||
instructions in ``lib/h5md/README``. You can also do it in one
|
instructions in ``lib/h5md/README``. You can also do it in one
|
||||||
step from the ``lammps/src`` dir, using a command like these,
|
step from the ``lammps/src`` dir, using a command like these,
|
||||||
which simply invoke the ``lib/h5md/Install.py`` script with the
|
which simply invokes the ``lib/h5md/Install.py`` script with the
|
||||||
specified args:
|
specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-h5md # print help message
|
make lib-h5md # print help message
|
||||||
$ make lib-h5md args="-m h5cc" # build with h5cc compiler
|
make lib-h5md args="-m h5cc" # build with h5cc compiler
|
||||||
|
|
||||||
The build should produce two files: ``lib/h5md/libch5md.a`` and
|
The build should produce two files: ``lib/h5md/libch5md.a`` and
|
||||||
``lib/h5md/Makefile.lammps``. The latter is copied from an
|
``lib/h5md/Makefile.lammps``. The latter is copied from an
|
||||||
@ -1542,14 +1579,14 @@ details please see ``lib/hdnnp/README`` and the `n2p2 build documentation
|
|||||||
You can download and build the *n2p2* library manually if you prefer;
|
You can download and build the *n2p2* library manually if you prefer;
|
||||||
follow the instructions in ``lib/hdnnp/README``\ . You can also do it in
|
follow the instructions in ``lib/hdnnp/README``\ . You can also do it in
|
||||||
one step from the ``lammps/src`` dir, using a command like these, which
|
one step from the ``lammps/src`` dir, using a command like these, which
|
||||||
simply invoke the ``lib/hdnnp/Install.py`` script with the specified args:
|
simply invokes the ``lib/hdnnp/Install.py`` script with the specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-hdnnp # print help message
|
make lib-hdnnp # print help message
|
||||||
$ make lib-hdnnp args="-b" # download and build in lib/hdnnp/n2p2-...
|
make lib-hdnnp args="-b" # download and build in lib/hdnnp/n2p2-...
|
||||||
$ make lib-hdnnp args="-b -v 2.1.4" # download and build specific version
|
make lib-hdnnp args="-b -v 2.1.4" # download and build specific version
|
||||||
$ make lib-hdnnp args="-p /usr/local/n2p2" # use the existing n2p2 installation in /usr/local/n2p2
|
make lib-hdnnp args="-p /usr/local/n2p2" # use the existing n2p2 installation in /usr/local/n2p2
|
||||||
|
|
||||||
Note that 3 symbolic (soft) links, ``includelink``, ``liblink`` and
|
Note that 3 symbolic (soft) links, ``includelink``, ``liblink`` and
|
||||||
``Makefile.lammps``, will be created in ``lib/hdnnp`` to point to
|
``Makefile.lammps``, will be created in ``lib/hdnnp`` to point to
|
||||||
@ -1649,8 +1686,8 @@ MDI package
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ python Install.py -m gcc # build using gcc compiler
|
python Install.py -m gcc # build using gcc compiler
|
||||||
$ python Install.py -m icc # build using icc compiler
|
python Install.py -m icc # build using icc compiler
|
||||||
|
|
||||||
The build should produce two files: ``lib/mdi/includelink/mdi.h``
|
The build should produce two files: ``lib/mdi/includelink/mdi.h``
|
||||||
and ``lib/mdi/liblink/libmdi.so``\ .
|
and ``lib/mdi/liblink/libmdi.so``\ .
|
||||||
@ -1679,14 +1716,14 @@ they will be downloaded the first time this package is installed.
|
|||||||
Before building LAMMPS, you must build the *mesont* library in
|
Before building LAMMPS, you must build the *mesont* library in
|
||||||
``lib/mesont``\ . You can also do it in one step from the
|
``lib/mesont``\ . You can also do it in one step from the
|
||||||
``lammps/src`` dir, using a command like these, which simply
|
``lammps/src`` dir, using a command like these, which simply
|
||||||
invoke the ``lib/mesont/Install.py`` script with the specified
|
invokes the ``lib/mesont/Install.py`` script with the specified
|
||||||
args:
|
args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-mesont # print help message
|
make lib-mesont # print help message
|
||||||
$ make lib-mesont args="-m gfortran" # build with GNU g++ compiler (settings as with "make serial")
|
make lib-mesont args="-m gfortran" # build with GNU g++ compiler (settings as with "make serial")
|
||||||
$ make lib-mesont args="-m ifort" # build with Intel icc compiler
|
make lib-mesont args="-m ifort" # build with Intel icc compiler
|
||||||
|
|
||||||
The build should produce two files: ``lib/mesont/libmesont.a`` and
|
The build should produce two files: ``lib/mesont/libmesont.a`` and
|
||||||
``lib/mesont/Makefile.lammps``\ . The latter is copied from an
|
``lib/mesont/Makefile.lammps``\ . The latter is copied from an
|
||||||
@ -1799,6 +1836,22 @@ OPENMP package
|
|||||||
For other platforms and compilers, please consult the
|
For other platforms and compilers, please consult the
|
||||||
documentation about OpenMP support for your compiler.
|
documentation about OpenMP support for your compiler.
|
||||||
|
|
||||||
|
.. admonition:: Adding OpenMP support on macOS
|
||||||
|
:class: note
|
||||||
|
|
||||||
|
Apple offers the `Xcode package and IDE
|
||||||
|
<https://developer.apple.com/xcode/>`_ for compiling software on
|
||||||
|
macOS, so you have likely installed it to compile LAMMPS. Their
|
||||||
|
compiler is based on `Clang <https://clang.llvm.org/>`, but while it
|
||||||
|
is capable of processing OpenMP directives, the necessary header
|
||||||
|
files and OpenMP runtime library are missing. The `R developers
|
||||||
|
<https://www.r-project.org/>` have figured out a way to build those
|
||||||
|
in a compatible fashion. One can download them from
|
||||||
|
`https://mac.r-project.org/openmp/
|
||||||
|
<https://mac.r-project.org/openmp/>`_. Simply adding those files as
|
||||||
|
instructed enables the Xcode C++ compiler to compile LAMMPS with ``-D
|
||||||
|
BUILD_OMP=yes``.
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
.. _qmmm:
|
.. _qmmm:
|
||||||
@ -1848,15 +1901,15 @@ verified to work in February 2020 with Quantum Espresso versions 6.3 to
|
|||||||
``lib/qmmm``. You can do this manually if you prefer; follow the
|
``lib/qmmm``. You can do this manually if you prefer; follow the
|
||||||
first two steps explained in ``lib/qmmm/README``. You can also do
|
first two steps explained in ``lib/qmmm/README``. You can also do
|
||||||
it in one step from the ``lammps/src`` dir, using a command like
|
it in one step from the ``lammps/src`` dir, using a command like
|
||||||
these, which simply invoke the ``lib/qmmm/Install.py`` script with
|
these, which simply invokes the ``lib/qmmm/Install.py`` script with
|
||||||
the specified args:
|
the specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-qmmm # print help message
|
make lib-qmmm # print help message
|
||||||
$ make lib-qmmm args="-m serial" # build with GNU Fortran compiler (settings as in "make serial")
|
make lib-qmmm args="-m serial" # build with GNU Fortran compiler (settings as in "make serial")
|
||||||
$ make lib-qmmm args="-m mpi" # build with default MPI compiler (settings as in "make mpi")
|
make lib-qmmm args="-m mpi" # build with default MPI compiler (settings as in "make mpi")
|
||||||
$ make lib-qmmm args="-m gfortran" # build with GNU Fortran compiler
|
make lib-qmmm args="-m gfortran" # build with GNU Fortran compiler
|
||||||
|
|
||||||
The build should produce two files: ``lib/qmmm/libqmmm.a`` and
|
The build should produce two files: ``lib/qmmm/libqmmm.a`` and
|
||||||
``lib/qmmm/Makefile.lammps``. The latter is copied from an
|
``lib/qmmm/Makefile.lammps``. The latter is copied from an
|
||||||
@ -1893,7 +1946,7 @@ within CMake will download the non-commercial use version.
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
-D DOWNLOAD_QUIP=value # download OpenKIM API v2 for build, value = no (default) or yes
|
-D DOWNLOAD_QUIP=value # download QUIP library for build, value = no (default) or yes
|
||||||
-D QUIP_LIBRARY=path # path to libquip.a (only needed if a custom location)
|
-D QUIP_LIBRARY=path # path to libquip.a (only needed if a custom location)
|
||||||
|
|
||||||
CMake will try to download and build the QUIP library from GitHub, if it is not
|
CMake will try to download and build the QUIP library from GitHub, if it is not
|
||||||
@ -1945,7 +1998,7 @@ To build with this package, you must download and build the
|
|||||||
You can download and build the ScaFaCoS library manually if you
|
You can download and build the ScaFaCoS library manually if you
|
||||||
prefer; follow the instructions in ``lib/scafacos/README``. You
|
prefer; follow the instructions in ``lib/scafacos/README``. You
|
||||||
can also do it in one step from the ``lammps/src`` dir, using a
|
can also do it in one step from the ``lammps/src`` dir, using a
|
||||||
command like these, which simply invoke the
|
command like these, which simply invokes the
|
||||||
``lib/scafacos/Install.py`` script with the specified args:
|
``lib/scafacos/Install.py`` script with the specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
@ -1989,14 +2042,14 @@ Eigen3 is a template library, so you do not need to build it.
|
|||||||
You can download the Eigen3 library manually if you prefer; follow
|
You can download the Eigen3 library manually if you prefer; follow
|
||||||
the instructions in ``lib/smd/README``. You can also do it in one
|
the instructions in ``lib/smd/README``. You can also do it in one
|
||||||
step from the ``lammps/src`` dir, using a command like these,
|
step from the ``lammps/src`` dir, using a command like these,
|
||||||
which simply invoke the ``lib/smd/Install.py`` script with the
|
which simply invokes the ``lib/smd/Install.py`` script with the
|
||||||
specified args:
|
specified args:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ make lib-smd # print help message
|
make lib-smd # print help message
|
||||||
$ make lib-smd args="-b" # download to lib/smd/eigen3
|
make lib-smd args="-b" # download to lib/smd/eigen3
|
||||||
$ make lib-smd args="-p /usr/include/eigen3" # use existing Eigen installation in /usr/include/eigen3
|
make lib-smd args="-p /usr/include/eigen3" # use existing Eigen installation in /usr/include/eigen3
|
||||||
|
|
||||||
Note that a symbolic (soft) link named ``includelink`` is created
|
Note that a symbolic (soft) link named ``includelink`` is created
|
||||||
in ``lib/smd`` to point to the Eigen dir. When LAMMPS builds it
|
in ``lib/smd`` to point to the Eigen dir. When LAMMPS builds it
|
||||||
|
|||||||
@ -209,7 +209,7 @@ You can verify whether all required shared libraries are found with the
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ LD_LIBRARY_PATH=/home/user/lammps/src ldd caller
|
LD_LIBRARY_PATH=/home/user/lammps/src ldd caller
|
||||||
linux-vdso.so.1 (0x00007ffe729e0000)
|
linux-vdso.so.1 (0x00007ffe729e0000)
|
||||||
liblammps.so => /home/user/lammps/src/liblammps.so (0x00007fc91bb9e000)
|
liblammps.so => /home/user/lammps/src/liblammps.so (0x00007fc91bb9e000)
|
||||||
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fc91b984000)
|
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fc91b984000)
|
||||||
@ -222,7 +222,7 @@ If a required library is missing, you would get a 'not found' entry:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ ldd caller
|
ldd caller
|
||||||
linux-vdso.so.1 (0x00007ffd672fe000)
|
linux-vdso.so.1 (0x00007ffd672fe000)
|
||||||
liblammps.so => not found
|
liblammps.so => not found
|
||||||
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fb7c7e86000)
|
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fb7c7e86000)
|
||||||
|
|||||||
@ -48,18 +48,15 @@ Build using GNU make
|
|||||||
|
|
||||||
The LAMMPS manual is written in `reStructuredText <rst_>`_ format which
|
The LAMMPS manual is written in `reStructuredText <rst_>`_ format which
|
||||||
can be translated to different output format using the `Sphinx
|
can be translated to different output format using the `Sphinx
|
||||||
<sphinx_>`_ document generator tool. It also incorporates programmer
|
<https://sphinx-doc.org>`_ document generator tool. It also
|
||||||
documentation extracted from the LAMMPS C++ sources through the `Doxygen
|
incorporates programmer documentation extracted from the LAMMPS C++
|
||||||
<https://doxygen.nl>`_ program. Currently the translation to HTML, PDF
|
sources through the `Doxygen <https://doxygen.nl>`_ program. Currently
|
||||||
(via LaTeX), ePUB (for many e-book readers) and MOBI (for Amazon Kindle
|
the translation to HTML, PDF (via LaTeX), ePUB (for many e-book readers)
|
||||||
readers) are supported. For that to work a Python 3 interpreter, the
|
and MOBI (for Amazon Kindle readers) are supported. For that to work a
|
||||||
``doxygen`` tools and internet access to download additional files and
|
Python 3 interpreter, the ``doxygen`` tools and internet access to
|
||||||
tools are required. This download is usually only required once or
|
download additional files and tools are required. This download is
|
||||||
after the documentation folder is returned to a pristine state with
|
usually only required once or after the documentation folder is returned
|
||||||
``make clean-all``.
|
to a pristine state with ``make clean-all``.
|
||||||
|
|
||||||
.. _rst: https://docutils.readthedocs.io/en/sphinx-docs/user/rst/quickstart.html
|
|
||||||
.. _sphinx: https://www.sphinx-doc.org
|
|
||||||
|
|
||||||
For the documentation build a python virtual environment is set up in
|
For the documentation build a python virtual environment is set up in
|
||||||
the folder ``doc/docenv`` and various python packages are installed into
|
the folder ``doc/docenv`` and various python packages are installed into
|
||||||
@ -78,11 +75,12 @@ folder. The following ``make`` commands are available:
|
|||||||
|
|
||||||
make html # generate HTML in html dir using Sphinx
|
make html # generate HTML in html dir using Sphinx
|
||||||
make pdf # generate PDF as Manual.pdf using Sphinx and PDFLaTeX
|
make pdf # generate PDF as Manual.pdf using Sphinx and PDFLaTeX
|
||||||
make fetch # fetch HTML pages and PDF files from LAMMPS website
|
|
||||||
# and unpack into the html_www folder and Manual_www.pdf
|
|
||||||
make epub # generate LAMMPS.epub in ePUB format using Sphinx
|
make epub # generate LAMMPS.epub in ePUB format using Sphinx
|
||||||
make mobi # generate LAMMPS.mobi in MOBI format using ebook-convert
|
make mobi # generate LAMMPS.mobi in MOBI format using ebook-convert
|
||||||
|
|
||||||
|
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 # remove intermediate RST files created by HTML build
|
||||||
make clean-all # remove entire build folder and any cached data
|
make clean-all # remove entire build folder and any cached data
|
||||||
|
|
||||||
@ -127,38 +125,29 @@ common setups:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
sudo apt-get install python-virtualenv git doxygen
|
sudo apt-get install git doxygen
|
||||||
|
|
||||||
.. tab:: RHEL or CentOS (Version 7.x)
|
.. tab:: RHEL or CentOS (Version 7.x)
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
sudo yum install python3-virtualenv git doxygen
|
sudo yum install git doxygen
|
||||||
|
|
||||||
.. tab:: Fedora or RHEL/CentOS (8.x or later)
|
.. tab:: Fedora or RHEL/CentOS (8.x or later)
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
sudo dnf install python3-virtualenv git doxygen
|
sudo dnf install git doxygen
|
||||||
|
|
||||||
.. tab:: MacOS X
|
.. tab:: macOS
|
||||||
|
|
||||||
*Python 3*
|
*Python 3*
|
||||||
|
|
||||||
Download the latest Python 3 MacOS X package from
|
If Python 3 is not available on your macOS system, you can
|
||||||
|
download the latest Python 3 macOS package from
|
||||||
`https://www.python.org <https://www.python.org>`_ and install it.
|
`https://www.python.org <https://www.python.org>`_ and install it.
|
||||||
This will install both Python 3 and pip3.
|
This will install both Python 3 and pip3.
|
||||||
|
|
||||||
*virtualenv*
|
|
||||||
|
|
||||||
Once Python 3 is installed, open a Terminal and type
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
pip3 install virtualenv
|
|
||||||
|
|
||||||
This will install virtualenv from the Python Package Index.
|
|
||||||
|
|
||||||
Prerequisites for PDF
|
Prerequisites for PDF
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
@ -178,7 +167,7 @@ math expressions transparently into embedded images.
|
|||||||
For converting the generated ePUB file to a MOBI format file (for e-book
|
For converting the generated ePUB file to a MOBI format file (for e-book
|
||||||
readers, like Kindle, that cannot read ePUB), you also need to have the
|
readers, like Kindle, that cannot read ePUB), you also need to have the
|
||||||
``ebook-convert`` tool from the "calibre" software
|
``ebook-convert`` tool from the "calibre" software
|
||||||
installed. `http://calibre-ebook.com/ <http://calibre-ebook.com/>`_
|
installed. `https://calibre-ebook.com/ <https://calibre-ebook.com/>`_
|
||||||
Typing ``make mobi`` will first create the ePUB file and then convert
|
Typing ``make mobi`` will first create the ePUB file and then convert
|
||||||
it. On the Kindle readers in particular, you also have support for PDF
|
it. On the Kindle readers in particular, you also have support for PDF
|
||||||
files, so you could download and view the PDF version as an alternative.
|
files, so you could download and view the PDF version as an alternative.
|
||||||
@ -193,8 +182,13 @@ folder need to be updated or new files added. These files are written in
|
|||||||
`reStructuredText <rst_>`_ markup for translation with the Sphinx tool.
|
`reStructuredText <rst_>`_ markup for translation with the Sphinx tool.
|
||||||
|
|
||||||
Before contributing any documentation, please check that both the HTML
|
Before contributing any documentation, please check that both the HTML
|
||||||
and the PDF format documentation can translate without errors. Please also
|
and the PDF format documentation can translate without errors. During
|
||||||
check the output to the console for any warnings or problems. There will
|
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:
|
be multiple tests run automatically:
|
||||||
|
|
||||||
- A test for correctness of all anchor labels and their references
|
- A test for correctness of all anchor labels and their references
|
||||||
@ -213,9 +207,20 @@ be multiple tests run automatically:
|
|||||||
- A test that only standard, printable ASCII text characters are used.
|
- A test that only standard, printable ASCII text characters are used.
|
||||||
This runs the command ``env LC_ALL=C grep -n '[^ -~]' src/*.rst`` and
|
This runs the command ``env LC_ALL=C grep -n '[^ -~]' src/*.rst`` and
|
||||||
thus prints all offending lines with filename and line number
|
thus prints all offending lines with filename and line number
|
||||||
prepended to the screen. Special characters like the Angstrom
|
prepended to the screen. Special characters like Greek letters
|
||||||
:math:`\mathrm{\mathring{A}}` should be typeset with embedded math
|
(:math:`\alpha~~\sigma~~\epsilon`), super- or subscripts
|
||||||
(like this ``:math:`\mathrm{\mathring{A}}```\ ).
|
(:math:`x^2~~\mathrm{U}_{LJ}`), mathematical expressions
|
||||||
|
(:math:`\frac{1}{2}\mathrm{N}~~x\to\infty`), or the Angstrom symbol
|
||||||
|
(:math:`\AA`) should be typeset with embedded LaTeX (like this
|
||||||
|
``:math:`\alpha \sigma \epsilon```, ``:math:`x^2 \mathrm{E}_{LJ}```,
|
||||||
|
``:math:`\frac{1}{2}\mathrm{N} x\to\infty```, or ``:math:`\AA```\ ).
|
||||||
|
|
||||||
|
- Embedded LaTeX is rendered in HTML output with `MathJax
|
||||||
|
<https://www.mathjax.org/>`_ and in PDF output by passing the embedded
|
||||||
|
text to LaTeX. Some care has to be taken, though, since there are
|
||||||
|
limitations which macros and features can be used in either mode, so
|
||||||
|
it is recommended to always check whether any new or changed
|
||||||
|
documentation does translate and render correctly with either output.
|
||||||
|
|
||||||
- A test whether all styles are documented and listed in their
|
- A test whether all styles are documented and listed in their
|
||||||
respective overview pages. A typical output with warnings looks like this:
|
respective overview pages. A typical output with warnings looks like this:
|
||||||
@ -246,6 +251,5 @@ manual with ``make spelling``. This requires `a library called enchant
|
|||||||
positives* (e.g. keywords, names, abbreviations) those can be added to
|
positives* (e.g. keywords, names, abbreviations) those can be added to
|
||||||
the file ``lammps/doc/utils/sphinx-config/false_positives.txt``.
|
the file ``lammps/doc/utils/sphinx-config/false_positives.txt``.
|
||||||
|
|
||||||
.. _rst: https://docutils.readthedocs.io/en/sphinx-docs/user/rst/quickstart.html
|
|
||||||
|
|
||||||
.. _lws: https://www.lammps.org
|
.. _lws: https://www.lammps.org
|
||||||
|
.. _rst: https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html
|
||||||
|
|||||||
@ -30,14 +30,16 @@ steps, as explained on the :doc:`Build extras <Build_extras>` page.
|
|||||||
These links take you to the extra instructions for those select
|
These links take you to the extra instructions for those select
|
||||||
packages:
|
packages:
|
||||||
|
|
||||||
|
.. this list must be kept in sync with its counterpart in Build_extras.rst
|
||||||
.. table_from_list::
|
.. table_from_list::
|
||||||
:columns: 6
|
:columns: 6
|
||||||
|
|
||||||
* :ref:`ADIOS <adios>`
|
* :ref:`ADIOS <adios>`
|
||||||
* :ref:`ATC <atc>`
|
* :ref:`ATC <atc>`
|
||||||
* :ref:`AWPMD <awpmd>`
|
* :ref:`AWPMD <awpmd>`
|
||||||
* :ref:`COLVARS <colvars>`
|
* :ref:`COLVARS <colvar>`
|
||||||
* :ref:`COMPRESS <compress>`
|
* :ref:`COMPRESS <compress>`
|
||||||
|
* :ref:`ELECTRODE <electrode>`
|
||||||
* :ref:`GPU <gpu>`
|
* :ref:`GPU <gpu>`
|
||||||
* :ref:`H5MD <h5md>`
|
* :ref:`H5MD <h5md>`
|
||||||
* :ref:`INTEL <intel>`
|
* :ref:`INTEL <intel>`
|
||||||
@ -45,8 +47,10 @@ packages:
|
|||||||
* :ref:`KOKKOS <kokkos>`
|
* :ref:`KOKKOS <kokkos>`
|
||||||
* :ref:`LATTE <latte>`
|
* :ref:`LATTE <latte>`
|
||||||
* :ref:`MACHDYN <machdyn>`
|
* :ref:`MACHDYN <machdyn>`
|
||||||
* :ref:`MESSAGE <message>`
|
* :ref:`MDI <mdi>`
|
||||||
|
* :ref:`MESONT <mesont>`
|
||||||
* :ref:`ML-HDNNP <ml-hdnnp>`
|
* :ref:`ML-HDNNP <ml-hdnnp>`
|
||||||
|
* :ref:`ML-IAP <mliap>`
|
||||||
* :ref:`ML-PACE <ml-pace>`
|
* :ref:`ML-PACE <ml-pace>`
|
||||||
* :ref:`ML-QUIP <ml-quip>`
|
* :ref:`ML-QUIP <ml-quip>`
|
||||||
* :ref:`MOLFILE <molfile>`
|
* :ref:`MOLFILE <molfile>`
|
||||||
@ -151,7 +155,7 @@ other files dependent on that package are also excluded.
|
|||||||
.. _cmake_presets:
|
.. _cmake_presets:
|
||||||
|
|
||||||
CMake presets for installing many packages
|
CMake presets for installing many packages
|
||||||
""""""""""""""""""""""""""""""""""""""""""
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
Instead of specifying all the CMake options via the command-line,
|
Instead of specifying all the CMake options via the command-line,
|
||||||
CMake allows initializing its settings cache using script files.
|
CMake allows initializing its settings cache using script files.
|
||||||
@ -179,6 +183,11 @@ one of them as a starting point and customize it to your needs.
|
|||||||
cmake -C ../cmake/presets/all_off.cmake [OPTIONS] ../cmake # disable all packages
|
cmake -C ../cmake/presets/all_off.cmake [OPTIONS] ../cmake # disable all packages
|
||||||
mingw64-cmake -C ../cmake/presets/mingw-cross.cmake [OPTIONS] ../cmake # compile with MinGW cross compilers
|
mingw64-cmake -C ../cmake/presets/mingw-cross.cmake [OPTIONS] ../cmake # compile with MinGW cross compilers
|
||||||
|
|
||||||
|
Presets that have names starting with "windows" are specifically for
|
||||||
|
compiling LAMMPS :doc:`natively on Windows <Build_windows>` and
|
||||||
|
presets that have names starting with "kokkos" are specifically for
|
||||||
|
selecting configurations for compiling LAMMPS with :ref:`KOKKOS <kokkos>`.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
Running cmake this way manipulates the CMake settings cache in your
|
Running cmake this way manipulates the CMake settings cache in your
|
||||||
@ -221,7 +230,8 @@ These commands install/un-install sets of packages:
|
|||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
make yes-all # install all packages
|
make yes-all # install all packages
|
||||||
make no-all # uninstall all packages
|
make no-all # check for changes and uninstall all packages
|
||||||
|
make no-installed # only check and uninstall installed packages
|
||||||
make yes-basic # install a few commonly used packages'
|
make yes-basic # install a few commonly used packages'
|
||||||
make no-basic # remove a few commonly used packages'
|
make no-basic # remove a few commonly used packages'
|
||||||
make yes-most # install most packages w/o libs'
|
make yes-most # install most packages w/o libs'
|
||||||
|
|||||||
@ -111,26 +111,25 @@ LAMMPS can use them if they are available on your system.
|
|||||||
files in its default search path. You must specify ``FFT_LIB``
|
files in its default search path. You must specify ``FFT_LIB``
|
||||||
with the appropriate FFT libraries to include in the link.
|
with the appropriate FFT libraries to include in the link.
|
||||||
|
|
||||||
The `KISS FFT library <http://kissfft.sf.net>`_ is included in the LAMMPS
|
The `KISS FFT library <https://github.com/mborgerding/kissfft>`_ is
|
||||||
distribution. It is portable across all platforms. Depending on the size
|
included in the LAMMPS distribution. It is portable across all
|
||||||
of the FFTs and the number of processors used, the other libraries listed
|
platforms. Depending on the size of the FFTs and the number of
|
||||||
here can be faster.
|
processors used, the other libraries listed here can be faster.
|
||||||
|
|
||||||
However, note that long-range Coulombics are only a portion of the
|
However, note that long-range Coulombics are only a portion of the
|
||||||
per-timestep CPU cost, FFTs are only a portion of long-range
|
per-timestep CPU cost, FFTs are only a portion of long-range Coulombics,
|
||||||
Coulombics, and 1d FFTs are only a portion of the FFT cost (parallel
|
and 1d FFTs are only a portion of the FFT cost (parallel communication
|
||||||
communication can be costly). A breakdown of these timings is printed
|
can be costly). A breakdown of these timings is printed to the screen
|
||||||
to the screen at the end of a run when using the
|
at the end of a run when using the :doc:`kspace_style pppm
|
||||||
:doc:`kspace_style pppm <kspace_style>` command. The
|
<kspace_style>` command. The :doc:`Screen and logfile output
|
||||||
:doc:`Screen and logfile output <Run_output>`
|
<Run_output>` page gives more details. A more detailed (and time
|
||||||
page gives more details. A more detailed (and time consuming)
|
consuming) report of the FFT performance is generated with the
|
||||||
report of the FFT performance is generated with the
|
|
||||||
:doc:`kspace_modify fftbench yes <kspace_modify>` command.
|
:doc:`kspace_modify fftbench yes <kspace_modify>` command.
|
||||||
|
|
||||||
FFTW is a fast, portable FFT library that should also work on any
|
FFTW is a fast, portable FFT library that should also work on any
|
||||||
platform and can be faster than the KISS FFT library. You can
|
platform and can be faster than the KISS FFT library. You can download
|
||||||
download it from `www.fftw.org <http://www.fftw.org>`_. LAMMPS requires
|
it from `www.fftw.org <https://www.fftw.org>`_. LAMMPS requires version
|
||||||
version 3.X; the legacy version 2.1.X is no longer supported.
|
3.X; the legacy version 2.1.X is no longer supported.
|
||||||
|
|
||||||
Building FFTW for your box should be as simple as ``./configure; make;
|
Building FFTW for your box should be as simple as ``./configure; make;
|
||||||
make install``. The install command typically requires root privileges
|
make install``. The install command typically requires root privileges
|
||||||
@ -287,8 +286,8 @@ Output of JPG, PNG, and movie files
|
|||||||
|
|
||||||
The :doc:`dump image <dump_image>` command has options to output JPEG or
|
The :doc:`dump image <dump_image>` command has options to output JPEG or
|
||||||
PNG image files. Likewise the :doc:`dump movie <dump_image>` command
|
PNG image files. Likewise the :doc:`dump movie <dump_image>` command
|
||||||
outputs movie files in MPEG format. Using these options requires the
|
outputs movie files in a variety of movie formats. Using these options
|
||||||
following settings:
|
requires the following settings:
|
||||||
|
|
||||||
.. tabs::
|
.. tabs::
|
||||||
|
|
||||||
@ -328,11 +327,12 @@ following settings:
|
|||||||
JPG_LIB = -ljpeg -lpng -lz # library names
|
JPG_LIB = -ljpeg -lpng -lz # library names
|
||||||
|
|
||||||
As with CMake, you do not need to set ``JPG_INC`` or ``JPG_PATH``,
|
As with CMake, you do not need to set ``JPG_INC`` or ``JPG_PATH``,
|
||||||
if make can find the graphics header and library files. You must
|
if make can find the graphics header and library files in their
|
||||||
specify ``JPG_LIB`` with a list of graphics libraries to include
|
default system locations. You must specify ``JPG_LIB`` with a
|
||||||
in the link. You must insure ffmpeg is in a directory where
|
list of graphics libraries to include in the link. You must make
|
||||||
LAMMPS can find it at runtime, that is a directory in your PATH
|
certain that the ffmpeg executable (or ffmpeg.exe on Windows) is
|
||||||
environment variable.
|
in a directory where LAMMPS can find it at runtime; that is
|
||||||
|
usually a directory list in your ``PATH`` environment variable.
|
||||||
|
|
||||||
Using ``ffmpeg`` to output movie files requires that your machine
|
Using ``ffmpeg`` to output movie files requires that your machine
|
||||||
supports the "popen" function in the standard runtime library.
|
supports the "popen" function in the standard runtime library.
|
||||||
|
|||||||
@ -5,6 +5,7 @@ Notes for building LAMMPS on Windows
|
|||||||
* :ref:`Running Linux on Windows <linux>`
|
* :ref:`Running Linux on Windows <linux>`
|
||||||
* :ref:`Using GNU GCC ported to Windows <gnu>`
|
* :ref:`Using GNU GCC ported to Windows <gnu>`
|
||||||
* :ref:`Using Visual Studio <msvc>`
|
* :ref:`Using Visual Studio <msvc>`
|
||||||
|
* :ref:`Using Intel oneAPI compilers and libraries <oneapi>`
|
||||||
* :ref:`Using a cross-compiler <cross>`
|
* :ref:`Using a cross-compiler <cross>`
|
||||||
|
|
||||||
----------
|
----------
|
||||||
@ -25,8 +26,10 @@ assistance in resolving portability issues. This is particularly true
|
|||||||
for compiling LAMMPS on Windows, since this platform has significant
|
for compiling LAMMPS on Windows, since this platform has significant
|
||||||
differences in some low-level functionality. As of LAMMPS version 14
|
differences in some low-level functionality. As of LAMMPS version 14
|
||||||
December 2021, large parts of LAMMPS can be compiled natively with the
|
December 2021, large parts of LAMMPS can be compiled natively with the
|
||||||
Microsoft Visual C++ Compilers. This is largely facilitated by using
|
Microsoft Visual C++ Compilers. As of LAMMPS version 31 May 2022, also
|
||||||
the :doc:`Developer_platform` in the ``platform`` namespace.
|
the Intel oneAPI compilers can compile large parts of LAMMPS natively on
|
||||||
|
Windows. This is mostly facilitated by using the
|
||||||
|
:doc:`Developer_platform` in the ``platform`` namespace and CMake.
|
||||||
|
|
||||||
Before trying to build LAMMPS on Windows yourself, please consider the
|
Before trying to build LAMMPS on Windows yourself, please consider the
|
||||||
`pre-compiled Windows installer packages <https://packages.lammps.org/windows.html>`_
|
`pre-compiled Windows installer packages <https://packages.lammps.org/windows.html>`_
|
||||||
@ -73,8 +76,9 @@ configuration should set this up automatically, but is untested.
|
|||||||
In case of problems, you are recommended to contact somebody with
|
In case of problems, you are recommended to contact somebody with
|
||||||
experience in using Cygwin. If you do come across portability problems
|
experience in using Cygwin. If you do come across portability problems
|
||||||
requiring changes to the LAMMPS source code, or figure out corrections
|
requiring changes to the LAMMPS source code, or figure out corrections
|
||||||
yourself, please report them on the lammps-users mailing list, or file
|
yourself, please report them on the
|
||||||
them as an issue or pull request on the LAMMPS GitHub project.
|
`LAMMPS forum at MatSci <https://matsci.org/c/lammps/lammps-development/>`_,
|
||||||
|
or file them as an issue or pull request on the LAMMPS GitHub project.
|
||||||
|
|
||||||
.. _msvc:
|
.. _msvc:
|
||||||
|
|
||||||
@ -98,6 +102,10 @@ 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
|
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
|
||||||
|
for the LAMMPS development branch through
|
||||||
|
`GitHub Actions <https://github.com/lammps/lammps/actions/workflows/compile-msvc.yml>`_.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
Versions of Visual Studio before version 17.1 may scan the entire
|
Versions of Visual Studio before version 17.1 may scan the entire
|
||||||
@ -110,6 +118,10 @@ Please note, that for either approach CMake will create a so-called
|
|||||||
the command lines for building and testing LAMMPS must be adjusted
|
the command lines for building and testing LAMMPS must be adjusted
|
||||||
accordingly.
|
accordingly.
|
||||||
|
|
||||||
|
The LAMMPS cmake folder contains a ``CMakeSettings.json`` file with
|
||||||
|
build configurations for MSVC compilers and the MS provided Clang
|
||||||
|
compiler package in Debug and Release mode.
|
||||||
|
|
||||||
To support running in parallel you can compile with OpenMP enabled using
|
To support running in parallel you can compile with OpenMP enabled using
|
||||||
the OPENMP package or install Microsoft MPI (including the SDK) and compile
|
the OPENMP package or install Microsoft MPI (including the SDK) and compile
|
||||||
LAMMPS with MPI enabled.
|
LAMMPS with MPI enabled.
|
||||||
@ -117,8 +129,55 @@ LAMMPS with MPI enabled.
|
|||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
This is work in progress and you should contact the LAMMPS developers
|
This is work in progress and you should contact the LAMMPS developers
|
||||||
via GitHub, the forum, or the mailing list, if you have questions or
|
via GitHub or the `LAMMPS forum at MatSci <https://matsci.org/c/lammps/lammps-development/>`_,
|
||||||
LAMMPS specific problems.
|
if you have questions or LAMMPS specific problems.
|
||||||
|
|
||||||
|
.. _oneapi:
|
||||||
|
|
||||||
|
Using Intel oneAPI Compilers and Libraries
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. versionadded:: 31May2022
|
||||||
|
|
||||||
|
After installing the `Intel oneAPI
|
||||||
|
<https://www.intel.com/content/www/us/en/developer/tools/oneapi/toolkits.html>`_
|
||||||
|
base toolkit and the HPC toolkit, it is also possible to compile large
|
||||||
|
parts of LAMMPS natively on Windows using Intel compilers. The HPC
|
||||||
|
toolkit provides two sets of C/C++ and Fortran compilers: the so-called
|
||||||
|
"classic" compilers (``icl.exe`` and ``ifort.exe``) and newer, LLVM
|
||||||
|
based compilers (``icx.exe`` and ``ifx.exe``). In addition to the
|
||||||
|
compilers and their dependent modules, also the thread building blocks
|
||||||
|
(TBB) and the math kernel library (MKL) need to be installed. Two
|
||||||
|
presets (``cmake/presets/windows-intel-llvm.cmake`` and
|
||||||
|
``cmake/presets/windows-intel-classic.cmake``) are provided for
|
||||||
|
selecting the LLVM based or classic compilers, respectively. The preset
|
||||||
|
``cmake/presets/windows.cmake`` enables compatible packages that are not
|
||||||
|
dependent on additional features or libraries. You **must** use the
|
||||||
|
CMake based build procedure and use Ninja as build tool. For compiling
|
||||||
|
from the command prompt, thus both `CMake <https://cmake.org>`_ and
|
||||||
|
`Ninja-build <https://ninja-build.org>`_ binaries must be installed. It
|
||||||
|
is also possible to use Visual Studio, if it is started (``devenv.exe``)
|
||||||
|
from a command prompt that has the Intel oneAPI compilers enabled. The
|
||||||
|
Visual Studio settings file in the ``cmake`` folder contains
|
||||||
|
configurations for both compiler variants in debug and release settings.
|
||||||
|
Those will use the CMake and Ninja binaries bundled with Visual Studio,
|
||||||
|
thus a separate installation is not required.
|
||||||
|
|
||||||
|
.. admonition:: Known Limitations
|
||||||
|
:class: note
|
||||||
|
|
||||||
|
In addition to portability issues with several packages and external
|
||||||
|
libraries, the classic Intel compilers are currently not able to
|
||||||
|
compile the googletest libraries and thus enabling the ``-DENABLE_TESTING``
|
||||||
|
option will result in compilation failure. The LLVM based compilers
|
||||||
|
are compatible.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
This is work in progress and you should contact the LAMMPS developers
|
||||||
|
via GitHub or the `LAMMPS forum at MatSci <https://matsci.org/c/lammps/lammps-development/>`_,
|
||||||
|
if you have questions or LAMMPS specific problems.
|
||||||
|
|
||||||
|
|
||||||
.. _cross:
|
.. _cross:
|
||||||
|
|
||||||
@ -144,14 +203,3 @@ LAMMPS developers. We instead rely on the feedback of the users
|
|||||||
of these pre-compiled LAMMPS packages for Windows. We will try to resolve
|
of these pre-compiled LAMMPS packages for Windows. We will try to resolve
|
||||||
issues to the best of our abilities if we become aware of them. However
|
issues to the best of our abilities if we become aware of them. However
|
||||||
this is subject to time constraints and focus on HPC platforms.
|
this is subject to time constraints and focus on HPC platforms.
|
||||||
|
|
||||||
.. _native:
|
|
||||||
|
|
||||||
Native Visual C++ support
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
Support for the Visual C++ compilers is currently not available. The
|
|
||||||
CMake build system is capable of creating suitable a Visual Studio
|
|
||||||
style build environment, but the LAMMPS source code itself is not
|
|
||||||
ported to fully support Visual C++. Volunteers to take on this task
|
|
||||||
are welcome.
|
|
||||||
|
|||||||
@ -14,7 +14,9 @@
|
|||||||
General commands
|
General commands
|
||||||
================
|
================
|
||||||
|
|
||||||
An alphabetic list of all general LAMMPS commands.
|
An alphabetic list of general LAMMPS commands. Note that style
|
||||||
|
commands with many variants, can be more easily accessed via the small
|
||||||
|
table above.
|
||||||
|
|
||||||
.. table_from_list::
|
.. table_from_list::
|
||||||
:columns: 5
|
:columns: 5
|
||||||
@ -47,36 +49,26 @@ An alphabetic list of all general LAMMPS commands.
|
|||||||
* :doc:`displace_atoms <displace_atoms>`
|
* :doc:`displace_atoms <displace_atoms>`
|
||||||
* :doc:`dump <dump>`
|
* :doc:`dump <dump>`
|
||||||
* :doc:`dump_modify <dump_modify>`
|
* :doc:`dump_modify <dump_modify>`
|
||||||
* :doc:`dynamical_matrix (k) <dynamical_matrix>`
|
|
||||||
* :doc:`echo <echo>`
|
* :doc:`echo <echo>`
|
||||||
* :doc:`fix <fix>`
|
* :doc:`fix <fix>`
|
||||||
* :doc:`fix_modify <fix_modify>`
|
* :doc:`fix_modify <fix_modify>`
|
||||||
* :doc:`group <group>`
|
* :doc:`group <group>`
|
||||||
* :doc:`group2ndx <group2ndx>`
|
|
||||||
* :doc:`hyper <hyper>`
|
|
||||||
* :doc:`if <if>`
|
* :doc:`if <if>`
|
||||||
* :doc:`improper_coeff <improper_coeff>`
|
* :doc:`improper_coeff <improper_coeff>`
|
||||||
* :doc:`improper_style <improper_style>`
|
* :doc:`improper_style <improper_style>`
|
||||||
* :doc:`include <include>`
|
* :doc:`include <include>`
|
||||||
* :doc:`info <info>`
|
* :doc:`info <info>`
|
||||||
* :doc:`jump <jump>`
|
* :doc:`jump <jump>`
|
||||||
* :doc:`kim <kim_commands>`
|
|
||||||
* :doc:`kspace_modify <kspace_modify>`
|
* :doc:`kspace_modify <kspace_modify>`
|
||||||
* :doc:`kspace_style <kspace_style>`
|
* :doc:`kspace_style <kspace_style>`
|
||||||
* :doc:`label <label>`
|
* :doc:`label <label>`
|
||||||
* :doc:`lattice <lattice>`
|
* :doc:`lattice <lattice>`
|
||||||
* :doc:`log <log>`
|
* :doc:`log <log>`
|
||||||
* :doc:`mass <mass>`
|
* :doc:`mass <mass>`
|
||||||
* :doc:`mdi/engine <mdi_engine>`
|
|
||||||
* :doc:`message <message>`
|
|
||||||
* :doc:`minimize <minimize>`
|
* :doc:`minimize <minimize>`
|
||||||
* :doc:`min_modify <min_modify>`
|
* :doc:`min_modify <min_modify>`
|
||||||
* :doc:`min_style <min_style>`
|
* :doc:`min_style <min_style>`
|
||||||
* :doc:`min_style spin <min_spin>`
|
|
||||||
* :doc:`molecule <molecule>`
|
* :doc:`molecule <molecule>`
|
||||||
* :doc:`ndx2group <group2ndx>`
|
|
||||||
* :doc:`neb <neb>`
|
|
||||||
* :doc:`neb/spin <neb_spin>`
|
|
||||||
* :doc:`neigh_modify <neigh_modify>`
|
* :doc:`neigh_modify <neigh_modify>`
|
||||||
* :doc:`neighbor <neighbor>`
|
* :doc:`neighbor <neighbor>`
|
||||||
* :doc:`newton <newton>`
|
* :doc:`newton <newton>`
|
||||||
@ -87,11 +79,8 @@ An alphabetic list of all general LAMMPS commands.
|
|||||||
* :doc:`pair_style <pair_style>`
|
* :doc:`pair_style <pair_style>`
|
||||||
* :doc:`pair_write <pair_write>`
|
* :doc:`pair_write <pair_write>`
|
||||||
* :doc:`partition <partition>`
|
* :doc:`partition <partition>`
|
||||||
* :doc:`plugin <plugin>`
|
|
||||||
* :doc:`prd <prd>`
|
|
||||||
* :doc:`print <print>`
|
* :doc:`print <print>`
|
||||||
* :doc:`processors <processors>`
|
* :doc:`processors <processors>`
|
||||||
* :doc:`python <python>`
|
|
||||||
* :doc:`quit <quit>`
|
* :doc:`quit <quit>`
|
||||||
* :doc:`read_data <read_data>`
|
* :doc:`read_data <read_data>`
|
||||||
* :doc:`read_dump <read_dump>`
|
* :doc:`read_dump <read_dump>`
|
||||||
@ -105,19 +94,13 @@ An alphabetic list of all general LAMMPS commands.
|
|||||||
* :doc:`restart <restart>`
|
* :doc:`restart <restart>`
|
||||||
* :doc:`run <run>`
|
* :doc:`run <run>`
|
||||||
* :doc:`run_style <run_style>`
|
* :doc:`run_style <run_style>`
|
||||||
* :doc:`server <server>`
|
|
||||||
* :doc:`set <set>`
|
* :doc:`set <set>`
|
||||||
* :doc:`shell <shell>`
|
* :doc:`shell <shell>`
|
||||||
* :doc:`special_bonds <special_bonds>`
|
* :doc:`special_bonds <special_bonds>`
|
||||||
* :doc:`suffix <suffix>`
|
* :doc:`suffix <suffix>`
|
||||||
* :doc:`tad <tad>`
|
|
||||||
* :doc:`temper <temper>`
|
|
||||||
* :doc:`temper/grem <temper_grem>`
|
|
||||||
* :doc:`temper/npt <temper_npt>`
|
|
||||||
* :doc:`thermo <thermo>`
|
* :doc:`thermo <thermo>`
|
||||||
* :doc:`thermo_modify <thermo_modify>`
|
* :doc:`thermo_modify <thermo_modify>`
|
||||||
* :doc:`thermo_style <thermo_style>`
|
* :doc:`thermo_style <thermo_style>`
|
||||||
* :doc:`third_order (k) <third_order>`
|
|
||||||
* :doc:`timer <timer>`
|
* :doc:`timer <timer>`
|
||||||
* :doc:`timestep <timestep>`
|
* :doc:`timestep <timestep>`
|
||||||
* :doc:`uncompute <uncompute>`
|
* :doc:`uncompute <uncompute>`
|
||||||
@ -130,3 +113,27 @@ An alphabetic list of all general LAMMPS commands.
|
|||||||
* :doc:`write_data <write_data>`
|
* :doc:`write_data <write_data>`
|
||||||
* :doc:`write_dump <write_dump>`
|
* :doc:`write_dump <write_dump>`
|
||||||
* :doc:`write_restart <write_restart>`
|
* :doc:`write_restart <write_restart>`
|
||||||
|
|
||||||
|
Additional general LAMMPS commands provided by packages. A few
|
||||||
|
commands have accelerated versions. This is indicated by an
|
||||||
|
additional letter in parenthesis: k = KOKKOS.
|
||||||
|
|
||||||
|
.. table_from_list::
|
||||||
|
:columns: 5
|
||||||
|
|
||||||
|
* :doc:`dynamical_matrix (k) <dynamical_matrix>`
|
||||||
|
* :doc:`group2ndx <group2ndx>`
|
||||||
|
* :doc:`hyper <hyper>`
|
||||||
|
* :doc:`kim <kim_commands>`
|
||||||
|
* :doc:`mdi <mdi>`
|
||||||
|
* :doc:`ndx2group <group2ndx>`
|
||||||
|
* :doc:`neb <neb>`
|
||||||
|
* :doc:`neb/spin <neb_spin>`
|
||||||
|
* :doc:`plugin <plugin>`
|
||||||
|
* :doc:`prd <prd>`
|
||||||
|
* :doc:`python <python>`
|
||||||
|
* :doc:`tad <tad>`
|
||||||
|
* :doc:`temper <temper>`
|
||||||
|
* :doc:`temper/grem <temper_grem>`
|
||||||
|
* :doc:`temper/npt <temper_npt>`
|
||||||
|
* :doc:`third_order (k) <third_order>`
|
||||||
|
|||||||
@ -32,6 +32,8 @@ OPT.
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
* :doc:`bpm/rotational <bond_bpm_rotational>`
|
||||||
|
* :doc:`bpm/spring <bond_bpm_spring>`
|
||||||
* :doc:`class2 (ko) <bond_class2>`
|
* :doc:`class2 (ko) <bond_class2>`
|
||||||
* :doc:`fene (iko) <bond_fene>`
|
* :doc:`fene (iko) <bond_fene>`
|
||||||
* :doc:`fene/expand (o) <bond_fene_expand>`
|
* :doc:`fene/expand (o) <bond_fene_expand>`
|
||||||
@ -86,7 +88,7 @@ OPT.
|
|||||||
* :doc:`dipole (o) <angle_dipole>`
|
* :doc:`dipole (o) <angle_dipole>`
|
||||||
* :doc:`fourier (o) <angle_fourier>`
|
* :doc:`fourier (o) <angle_fourier>`
|
||||||
* :doc:`fourier/simple (o) <angle_fourier_simple>`
|
* :doc:`fourier/simple (o) <angle_fourier_simple>`
|
||||||
* :doc:`gaussian <angle_gaussian>` - multicentered Gaussian-based angle potential
|
* :doc:`gaussian <angle_gaussian>`
|
||||||
* :doc:`harmonic (iko) <angle_harmonic>`
|
* :doc:`harmonic (iko) <angle_harmonic>`
|
||||||
* :doc:`mm3 <angle_mm3>`
|
* :doc:`mm3 <angle_mm3>`
|
||||||
* :doc:`quartic (o) <angle_quartic>`
|
* :doc:`quartic (o) <angle_quartic>`
|
||||||
|
|||||||
@ -33,6 +33,7 @@ KOKKOS, o = OPENMP, t = OPT.
|
|||||||
* :doc:`body/local <compute_body_local>`
|
* :doc:`body/local <compute_body_local>`
|
||||||
* :doc:`bond <compute_bond>`
|
* :doc:`bond <compute_bond>`
|
||||||
* :doc:`bond/local <compute_bond_local>`
|
* :doc:`bond/local <compute_bond_local>`
|
||||||
|
* :doc:`born/matrix <compute_born_matrix>`
|
||||||
* :doc:`centro/atom <compute_centro_atom>`
|
* :doc:`centro/atom <compute_centro_atom>`
|
||||||
* :doc:`centroid/stress/atom <compute_stress_atom>`
|
* :doc:`centroid/stress/atom <compute_stress_atom>`
|
||||||
* :doc:`chunk/atom <compute_chunk_atom>`
|
* :doc:`chunk/atom <compute_chunk_atom>`
|
||||||
@ -63,6 +64,7 @@ KOKKOS, o = OPENMP, t = OPT.
|
|||||||
* :doc:`event/displace <compute_event_displace>`
|
* :doc:`event/displace <compute_event_displace>`
|
||||||
* :doc:`fabric <compute_fabric>`
|
* :doc:`fabric <compute_fabric>`
|
||||||
* :doc:`fep <compute_fep>`
|
* :doc:`fep <compute_fep>`
|
||||||
|
* :doc:`fep/ta <compute_fep_ta>`
|
||||||
* :doc:`force/tally <compute_tally>`
|
* :doc:`force/tally <compute_tally>`
|
||||||
* :doc:`fragment/atom <compute_cluster_atom>`
|
* :doc:`fragment/atom <compute_cluster_atom>`
|
||||||
* :doc:`global/atom <compute_global_atom>`
|
* :doc:`global/atom <compute_global_atom>`
|
||||||
@ -90,6 +92,7 @@ KOKKOS, o = OPENMP, t = OPT.
|
|||||||
* :doc:`msd <compute_msd>`
|
* :doc:`msd <compute_msd>`
|
||||||
* :doc:`msd/chunk <compute_msd_chunk>`
|
* :doc:`msd/chunk <compute_msd_chunk>`
|
||||||
* :doc:`msd/nongauss <compute_msd_nongauss>`
|
* :doc:`msd/nongauss <compute_msd_nongauss>`
|
||||||
|
* :doc:`nbond/atom <compute_nbond_atom>`
|
||||||
* :doc:`omega/chunk <compute_omega_chunk>`
|
* :doc:`omega/chunk <compute_omega_chunk>`
|
||||||
* :doc:`orientorder/atom (k) <compute_orientorder_atom>`
|
* :doc:`orientorder/atom (k) <compute_orientorder_atom>`
|
||||||
* :doc:`pair <compute_pair>`
|
* :doc:`pair <compute_pair>`
|
||||||
|
|||||||
@ -40,9 +40,6 @@ OPT.
|
|||||||
* :doc:`ave/time <fix_ave_time>`
|
* :doc:`ave/time <fix_ave_time>`
|
||||||
* :doc:`aveforce <fix_aveforce>`
|
* :doc:`aveforce <fix_aveforce>`
|
||||||
* :doc:`balance <fix_balance>`
|
* :doc:`balance <fix_balance>`
|
||||||
* :doc:`brownian <fix_brownian>`
|
|
||||||
* :doc:`brownian/asphere <fix_brownian>`
|
|
||||||
* :doc:`brownian/sphere <fix_brownian>`
|
|
||||||
* :doc:`bocs <fix_bocs>`
|
* :doc:`bocs <fix_bocs>`
|
||||||
* :doc:`bond/break <fix_bond_break>`
|
* :doc:`bond/break <fix_bond_break>`
|
||||||
* :doc:`bond/create <fix_bond_create>`
|
* :doc:`bond/create <fix_bond_create>`
|
||||||
@ -50,8 +47,10 @@ OPT.
|
|||||||
* :doc:`bond/react <fix_bond_react>`
|
* :doc:`bond/react <fix_bond_react>`
|
||||||
* :doc:`bond/swap <fix_bond_swap>`
|
* :doc:`bond/swap <fix_bond_swap>`
|
||||||
* :doc:`box/relax <fix_box_relax>`
|
* :doc:`box/relax <fix_box_relax>`
|
||||||
|
* :doc:`brownian <fix_brownian>`
|
||||||
|
* :doc:`brownian/asphere <fix_brownian>`
|
||||||
|
* :doc:`brownian/sphere <fix_brownian>`
|
||||||
* :doc:`charge/regulation <fix_charge_regulation>`
|
* :doc:`charge/regulation <fix_charge_regulation>`
|
||||||
* :doc:`client/md <fix_client_md>`
|
|
||||||
* :doc:`cmap <fix_cmap>`
|
* :doc:`cmap <fix_cmap>`
|
||||||
* :doc:`colvars <fix_colvars>`
|
* :doc:`colvars <fix_colvars>`
|
||||||
* :doc:`controller <fix_controller>`
|
* :doc:`controller <fix_controller>`
|
||||||
@ -67,6 +66,9 @@ OPT.
|
|||||||
* :doc:`edpd/source <fix_dpd_source>`
|
* :doc:`edpd/source <fix_dpd_source>`
|
||||||
* :doc:`efield <fix_efield>`
|
* :doc:`efield <fix_efield>`
|
||||||
* :doc:`ehex <fix_ehex>`
|
* :doc:`ehex <fix_ehex>`
|
||||||
|
* :doc:`electrode/conp (i) <fix_electrode_conp>`
|
||||||
|
* :doc:`electrode/conq (i) <fix_electrode_conp>`
|
||||||
|
* :doc:`electrode/thermo (i) <fix_electrode_conp>`
|
||||||
* :doc:`electron/stopping <fix_electron_stopping>`
|
* :doc:`electron/stopping <fix_electron_stopping>`
|
||||||
* :doc:`electron/stopping/fit <fix_electron_stopping>`
|
* :doc:`electron/stopping/fit <fix_electron_stopping>`
|
||||||
* :doc:`enforce2d (k) <fix_enforce2d>`
|
* :doc:`enforce2d (k) <fix_enforce2d>`
|
||||||
@ -101,7 +103,7 @@ OPT.
|
|||||||
* :doc:`lb/viscous <fix_lb_viscous>`
|
* :doc:`lb/viscous <fix_lb_viscous>`
|
||||||
* :doc:`lineforce <fix_lineforce>`
|
* :doc:`lineforce <fix_lineforce>`
|
||||||
* :doc:`manifoldforce <fix_manifoldforce>`
|
* :doc:`manifoldforce <fix_manifoldforce>`
|
||||||
* :doc:`mdi/engine <fix_mdi_engine>`
|
* :doc:`mdi/aimd <fix_mdi_aimd>`
|
||||||
* :doc:`meso/move <fix_meso_move>`
|
* :doc:`meso/move <fix_meso_move>`
|
||||||
* :doc:`mol/swap <fix_mol_swap>`
|
* :doc:`mol/swap <fix_mol_swap>`
|
||||||
* :doc:`momentum (k) <fix_momentum>`
|
* :doc:`momentum (k) <fix_momentum>`
|
||||||
@ -142,6 +144,7 @@ OPT.
|
|||||||
* :doc:`nve/manifold/rattle <fix_nve_manifold_rattle>`
|
* :doc:`nve/manifold/rattle <fix_nve_manifold_rattle>`
|
||||||
* :doc:`nve/noforce <fix_nve_noforce>`
|
* :doc:`nve/noforce <fix_nve_noforce>`
|
||||||
* :doc:`nve/sphere (ko) <fix_nve_sphere>`
|
* :doc:`nve/sphere (ko) <fix_nve_sphere>`
|
||||||
|
* :doc:`nve/bpm/sphere <fix_nve_bpm_sphere>`
|
||||||
* :doc:`nve/spin <fix_nve_spin>`
|
* :doc:`nve/spin <fix_nve_spin>`
|
||||||
* :doc:`nve/tri <fix_nve_tri>`
|
* :doc:`nve/tri <fix_nve_tri>`
|
||||||
* :doc:`nvk <fix_nvk>`
|
* :doc:`nvk <fix_nvk>`
|
||||||
@ -159,7 +162,6 @@ OPT.
|
|||||||
* :doc:`orient/fcc <fix_orient>`
|
* :doc:`orient/fcc <fix_orient>`
|
||||||
* :doc:`orient/eco <fix_orient_eco>`
|
* :doc:`orient/eco <fix_orient_eco>`
|
||||||
* :doc:`pafi <fix_pafi>`
|
* :doc:`pafi <fix_pafi>`
|
||||||
* :doc:`pair/tracker <fix_pair_tracker>`
|
|
||||||
* :doc:`phonon <fix_phonon>`
|
* :doc:`phonon <fix_phonon>`
|
||||||
* :doc:`pimd <fix_pimd>`
|
* :doc:`pimd <fix_pimd>`
|
||||||
* :doc:`planeforce <fix_planeforce>`
|
* :doc:`planeforce <fix_planeforce>`
|
||||||
|
|||||||
@ -27,6 +27,7 @@ OPT.
|
|||||||
* :doc:`ewald/disp/dipole <kspace_style>`
|
* :doc:`ewald/disp/dipole <kspace_style>`
|
||||||
* :doc:`ewald/dipole <kspace_style>`
|
* :doc:`ewald/dipole <kspace_style>`
|
||||||
* :doc:`ewald/dipole/spin <kspace_style>`
|
* :doc:`ewald/dipole/spin <kspace_style>`
|
||||||
|
* :doc:`ewald/electrode <kspace_style>`
|
||||||
* :doc:`msm (o) <kspace_style>`
|
* :doc:`msm (o) <kspace_style>`
|
||||||
* :doc:`msm/cg (o) <kspace_style>`
|
* :doc:`msm/cg (o) <kspace_style>`
|
||||||
* :doc:`msm/dielectric <kspace_style>`
|
* :doc:`msm/dielectric <kspace_style>`
|
||||||
@ -41,4 +42,5 @@ OPT.
|
|||||||
* :doc:`pppm/stagger <kspace_style>`
|
* :doc:`pppm/stagger <kspace_style>`
|
||||||
* :doc:`pppm/tip4p (o) <kspace_style>`
|
* :doc:`pppm/tip4p (o) <kspace_style>`
|
||||||
* :doc:`pppm/dielectric <kspace_style>`
|
* :doc:`pppm/dielectric <kspace_style>`
|
||||||
|
* :doc:`pppm/electrode (i) <kspace_style>`
|
||||||
* :doc:`scafacos <kspace_style>`
|
* :doc:`scafacos <kspace_style>`
|
||||||
|
|||||||
@ -34,7 +34,7 @@ OPT.
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* :doc:`adp (o) <pair_adp>`
|
* :doc:`adp (ko) <pair_adp>`
|
||||||
* :doc:`agni (o) <pair_agni>`
|
* :doc:`agni (o) <pair_agni>`
|
||||||
* :doc:`airebo (io) <pair_airebo>`
|
* :doc:`airebo (io) <pair_airebo>`
|
||||||
* :doc:`airebo/morse (io) <pair_airebo>`
|
* :doc:`airebo/morse (io) <pair_airebo>`
|
||||||
@ -53,6 +53,7 @@ OPT.
|
|||||||
* :doc:`born/coul/msm (o) <pair_born>`
|
* :doc:`born/coul/msm (o) <pair_born>`
|
||||||
* :doc:`born/coul/wolf (go) <pair_born>`
|
* :doc:`born/coul/wolf (go) <pair_born>`
|
||||||
* :doc:`born/coul/wolf/cs (g) <pair_cs>`
|
* :doc:`born/coul/wolf/cs (g) <pair_cs>`
|
||||||
|
* :doc:`bpm/spring <pair_bpm_spring>`
|
||||||
* :doc:`brownian (o) <pair_brownian>`
|
* :doc:`brownian (o) <pair_brownian>`
|
||||||
* :doc:`brownian/poly (o) <pair_brownian>`
|
* :doc:`brownian/poly (o) <pair_brownian>`
|
||||||
* :doc:`buck (giko) <pair_buck>`
|
* :doc:`buck (giko) <pair_buck>`
|
||||||
@ -88,12 +89,12 @@ OPT.
|
|||||||
* :doc:`coul/tt <pair_coul_tt>`
|
* :doc:`coul/tt <pair_coul_tt>`
|
||||||
* :doc:`coul/wolf (ko) <pair_coul>`
|
* :doc:`coul/wolf (ko) <pair_coul>`
|
||||||
* :doc:`coul/wolf/cs <pair_cs>`
|
* :doc:`coul/wolf/cs <pair_cs>`
|
||||||
* :doc:`dpd (gio) <pair_dpd>`
|
* :doc:`dpd (giko) <pair_dpd>`
|
||||||
* :doc:`dpd/fdt <pair_dpd_fdt>`
|
* :doc:`dpd/fdt <pair_dpd_fdt>`
|
||||||
* :doc:`dpd/ext <pair_dpd_ext>`
|
* :doc:`dpd/ext (ko) <pair_dpd_ext>`
|
||||||
* :doc:`dpd/ext/tstat <pair_dpd_ext>`
|
* :doc:`dpd/ext/tstat (ko) <pair_dpd_ext>`
|
||||||
* :doc:`dpd/fdt/energy (k) <pair_dpd_fdt>`
|
* :doc:`dpd/fdt/energy (k) <pair_dpd_fdt>`
|
||||||
* :doc:`dpd/tstat (go) <pair_dpd>`
|
* :doc:`dpd/tstat (gko) <pair_dpd>`
|
||||||
* :doc:`dsmc <pair_dsmc>`
|
* :doc:`dsmc <pair_dsmc>`
|
||||||
* :doc:`e3b <pair_e3b>`
|
* :doc:`e3b <pair_e3b>`
|
||||||
* :doc:`drip <pair_drip>`
|
* :doc:`drip <pair_drip>`
|
||||||
@ -123,8 +124,8 @@ OPT.
|
|||||||
* :doc:`hbond/dreiding/lj (o) <pair_hbond_dreiding>`
|
* :doc:`hbond/dreiding/lj (o) <pair_hbond_dreiding>`
|
||||||
* :doc:`hbond/dreiding/morse (o) <pair_hbond_dreiding>`
|
* :doc:`hbond/dreiding/morse (o) <pair_hbond_dreiding>`
|
||||||
* :doc:`hdnnp <pair_hdnnp>`
|
* :doc:`hdnnp <pair_hdnnp>`
|
||||||
* :doc:`ilp/graphene/hbn <pair_ilp_graphene_hbn>`
|
* :doc:`ilp/graphene/hbn (t) <pair_ilp_graphene_hbn>`
|
||||||
* :doc:`ilp/tmd <pair_ilp_tmd>`
|
* :doc:`ilp/tmd (t) <pair_ilp_tmd>`
|
||||||
* :doc:`kolmogorov/crespi/full <pair_kolmogorov_crespi_full>`
|
* :doc:`kolmogorov/crespi/full <pair_kolmogorov_crespi_full>`
|
||||||
* :doc:`kolmogorov/crespi/z <pair_kolmogorov_crespi_z>`
|
* :doc:`kolmogorov/crespi/z <pair_kolmogorov_crespi_z>`
|
||||||
* :doc:`lcbop <pair_lcbop>`
|
* :doc:`lcbop <pair_lcbop>`
|
||||||
@ -151,7 +152,7 @@ OPT.
|
|||||||
* :doc:`lj/cut/coul/cut/dielectric (o) <pair_dielectric>`
|
* :doc:`lj/cut/coul/cut/dielectric (o) <pair_dielectric>`
|
||||||
* :doc:`lj/cut/coul/cut/soft (o) <pair_fep_soft>`
|
* :doc:`lj/cut/coul/cut/soft (o) <pair_fep_soft>`
|
||||||
* :doc:`lj/cut/coul/debye (gko) <pair_lj_cut_coul>`
|
* :doc:`lj/cut/coul/debye (gko) <pair_lj_cut_coul>`
|
||||||
* :doc:`lj/cut/coul/debye/dielectric <pair_dielectric>`
|
* :doc:`lj/cut/coul/debye/dielectric (o) <pair_dielectric>`
|
||||||
* :doc:`lj/cut/coul/dsf (gko) <pair_lj_cut_coul>`
|
* :doc:`lj/cut/coul/dsf (gko) <pair_lj_cut_coul>`
|
||||||
* :doc:`lj/cut/coul/long (gikot) <pair_lj_cut_coul>`
|
* :doc:`lj/cut/coul/long (gikot) <pair_lj_cut_coul>`
|
||||||
* :doc:`lj/cut/coul/long/cs <pair_cs>`
|
* :doc:`lj/cut/coul/long/cs <pair_cs>`
|
||||||
@ -230,7 +231,7 @@ OPT.
|
|||||||
* :doc:`oxrna2/stk <pair_oxrna2>`
|
* :doc:`oxrna2/stk <pair_oxrna2>`
|
||||||
* :doc:`oxrna2/xstk <pair_oxrna2>`
|
* :doc:`oxrna2/xstk <pair_oxrna2>`
|
||||||
* :doc:`oxrna2/coaxstk <pair_oxrna2>`
|
* :doc:`oxrna2/coaxstk <pair_oxrna2>`
|
||||||
* :doc:`pace <pair_pace>`
|
* :doc:`pace (k) <pair_pace>`
|
||||||
* :doc:`peri/eps <pair_peri>`
|
* :doc:`peri/eps <pair_peri>`
|
||||||
* :doc:`peri/lps (o) <pair_peri>`
|
* :doc:`peri/lps (o) <pair_peri>`
|
||||||
* :doc:`peri/pmb (o) <pair_peri>`
|
* :doc:`peri/pmb (o) <pair_peri>`
|
||||||
@ -242,8 +243,10 @@ OPT.
|
|||||||
* :doc:`reaxff (ko) <pair_reaxff>`
|
* :doc:`reaxff (ko) <pair_reaxff>`
|
||||||
* :doc:`rebo (io) <pair_airebo>`
|
* :doc:`rebo (io) <pair_airebo>`
|
||||||
* :doc:`resquared (go) <pair_resquared>`
|
* :doc:`resquared (go) <pair_resquared>`
|
||||||
* :doc:`saip/metal <pair_saip_metal>`
|
* :doc:`saip/metal (t) <pair_saip_metal>`
|
||||||
* :doc:`sdpd/taitwater/isothermal <pair_sdpd_taitwater_isothermal>`
|
* :doc:`sdpd/taitwater/isothermal <pair_sdpd_taitwater_isothermal>`
|
||||||
|
* :doc:`smatb <pair_smatb>`
|
||||||
|
* :doc:`smatb/single <pair_smatb>`
|
||||||
* :doc:`smd/hertz <pair_smd_hertz>`
|
* :doc:`smd/hertz <pair_smd_hertz>`
|
||||||
* :doc:`smd/tlsph <pair_smd_tlsph>`
|
* :doc:`smd/tlsph <pair_smd_tlsph>`
|
||||||
* :doc:`smd/tri_surface <pair_smd_triangulated_surface>`
|
* :doc:`smd/tri_surface <pair_smd_triangulated_surface>`
|
||||||
@ -266,6 +269,7 @@ OPT.
|
|||||||
* :doc:`spin/neel <pair_spin_neel>`
|
* :doc:`spin/neel <pair_spin_neel>`
|
||||||
* :doc:`srp <pair_srp>`
|
* :doc:`srp <pair_srp>`
|
||||||
* :doc:`sw (giko) <pair_sw>`
|
* :doc:`sw (giko) <pair_sw>`
|
||||||
|
* :doc:`sw/angle/table <pair_sw_angle_table>`
|
||||||
* :doc:`sw/mod (o) <pair_sw>`
|
* :doc:`sw/mod (o) <pair_sw>`
|
||||||
* :doc:`table (gko) <pair_table>`
|
* :doc:`table (gko) <pair_table>`
|
||||||
* :doc:`table/rx (k) <pair_table_rx>`
|
* :doc:`table/rx (k) <pair_table_rx>`
|
||||||
@ -276,6 +280,7 @@ OPT.
|
|||||||
* :doc:`tersoff/table (o) <pair_tersoff>`
|
* :doc:`tersoff/table (o) <pair_tersoff>`
|
||||||
* :doc:`tersoff/zbl (gko) <pair_tersoff_zbl>`
|
* :doc:`tersoff/zbl (gko) <pair_tersoff_zbl>`
|
||||||
* :doc:`thole <pair_thole>`
|
* :doc:`thole <pair_thole>`
|
||||||
|
* :doc:`threebody/table <pair_threebody_table>`
|
||||||
* :doc:`tip4p/cut (o) <pair_coul>`
|
* :doc:`tip4p/cut (o) <pair_coul>`
|
||||||
* :doc:`tip4p/long (o) <pair_coul>`
|
* :doc:`tip4p/long (o) <pair_coul>`
|
||||||
* :doc:`tip4p/long/soft (o) <pair_fep_soft>`
|
* :doc:`tip4p/long/soft (o) <pair_fep_soft>`
|
||||||
|
|||||||
@ -77,18 +77,19 @@ LAMMPS:
|
|||||||
so that you do not have to define (or discard) a temporary variable,
|
so that you do not have to define (or discard) a temporary variable,
|
||||||
"X" in this case.
|
"X" in this case.
|
||||||
|
|
||||||
Additionally, the "immediate" variable expression may be followed by
|
Additionally, the entire "immediate" variable expression may be
|
||||||
a colon, followed by a C-style format string, e.g. ":%f" or ":%.10g".
|
followed by a colon, followed by a C-style format string,
|
||||||
The format string must be appropriate for a double-precision
|
e.g. ":%f" or ":%.10g". The format string must be appropriate for
|
||||||
floating-point value. The format string is used to output the result
|
a double-precision floating-point value. The format string is used
|
||||||
of the variable expression evaluation. If a format string is not
|
to output the result of the variable expression evaluation. If a
|
||||||
specified a high-precision "%.20g" is used as the default.
|
format string is not specified, a high-precision "%.20g" is used as
|
||||||
|
the default format.
|
||||||
|
|
||||||
This can be useful for formatting print output to a desired precision:
|
This can be useful for formatting print output to a desired precision:
|
||||||
|
|
||||||
.. code-block:: LAMMPS
|
.. code-block:: LAMMPS
|
||||||
|
|
||||||
print "Final energy per atom: $(pe/atoms:%10.3f) eV/atom"
|
print "Final energy per atom: $(v_ke_per_atom+v_pe_per_atom:%10.3f) eV/atom"
|
||||||
|
|
||||||
Note that neither the curly-bracket or immediate form of variables
|
Note that neither the curly-bracket or immediate form of variables
|
||||||
can contain nested $ characters for other variables to substitute
|
can contain nested $ characters for other variables to substitute
|
||||||
@ -122,14 +123,15 @@ LAMMPS:
|
|||||||
.. _six:
|
.. _six:
|
||||||
|
|
||||||
6. If you want text with spaces to be treated as a single argument, it
|
6. If you want text with spaces to be treated as a single argument, it
|
||||||
can be enclosed in either single or double or triple quotes. A long
|
can be enclosed in either single (') or double (") or triple (""")
|
||||||
single argument enclosed in single or double quotes can span multiple
|
quotes. A long single argument enclosed in single or double quotes
|
||||||
lines if the "&" character is used, as described above. When the
|
can span multiple lines if the "&" character is used, as described
|
||||||
lines are concatenated together (and the "&" characters and line
|
in :ref:`1 <one>` above. When the lines are concatenated together
|
||||||
breaks removed), the text will become a single line. If you want
|
by LAMMPS (and the "&" characters and line breaks removed), the
|
||||||
multiple lines of an argument to retain their line breaks, the text
|
combined text will become a single line. If you want multiple lines
|
||||||
can be enclosed in triple quotes, in which case "&" characters are
|
of an argument to retain their line breaks, the text can be enclosed
|
||||||
not needed. For example:
|
in triple quotes, in which case "&" characters are not needed and do
|
||||||
|
not function as line continuation character. For example:
|
||||||
|
|
||||||
.. code-block:: LAMMPS
|
.. code-block:: LAMMPS
|
||||||
|
|
||||||
@ -143,8 +145,9 @@ LAMMPS:
|
|||||||
System temperature = $t
|
System temperature = $t
|
||||||
"""
|
"""
|
||||||
|
|
||||||
In each case, the single, double, or triple quotes are removed when
|
In each of these cases, the single, double, or triple quotes are
|
||||||
the single argument they enclose is stored internally.
|
removed and the enclosed text stored internally as a single
|
||||||
|
argument.
|
||||||
|
|
||||||
See the :doc:`dump modify format <dump_modify>`, :doc:`print
|
See the :doc:`dump modify format <dump_modify>`, :doc:`print
|
||||||
<print>`, :doc:`if <if>`, and :doc:`python <python>` commands for
|
<print>`, :doc:`if <if>`, and :doc:`python <python>` commands for
|
||||||
|
|||||||
@ -2,14 +2,17 @@ Removed commands and packages
|
|||||||
=============================
|
=============================
|
||||||
|
|
||||||
This page lists LAMMPS commands and packages that have been removed from
|
This page lists LAMMPS commands and packages that have been removed from
|
||||||
the distribution and provides suggestions for alternatives or replacements.
|
the distribution and provides suggestions for alternatives or
|
||||||
LAMMPS has special dummy styles implemented, that will stop LAMMPS and
|
replacements. LAMMPS has special dummy styles implemented, that will
|
||||||
print a suitable error message in most cases, when a style/command is used
|
stop LAMMPS and print a suitable error message in most cases, when a
|
||||||
that has been removed.
|
style/command is used that has been removed or will replace the command
|
||||||
|
with the direct alternative (if available) and print a warning.
|
||||||
|
|
||||||
Fix ave/spatial and fix ave/spatial/sphere
|
Fix ave/spatial and fix ave/spatial/sphere
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
|
|
||||||
|
.. deprecated:: 11Dec2015
|
||||||
|
|
||||||
The fixes ave/spatial and ave/spatial/sphere have been removed from LAMMPS
|
The fixes ave/spatial and ave/spatial/sphere have been removed from LAMMPS
|
||||||
since they were superseded by the more general and extensible "chunk
|
since they were superseded by the more general and extensible "chunk
|
||||||
infrastructure". Here the system is partitioned in one of many possible
|
infrastructure". Here the system is partitioned in one of many possible
|
||||||
@ -30,18 +33,21 @@ The code in the :ref:`MEAM package <PKG-MEAM>` is a translation of the
|
|||||||
Fortran code of MEAM into C++, which removes several restrictions
|
Fortran code of MEAM into C++, which removes several restrictions
|
||||||
(e.g. there can be multiple instances in hybrid pair styles) and allows
|
(e.g. there can be multiple instances in hybrid pair styles) and allows
|
||||||
for some optimizations leading to better performance. The pair style
|
for some optimizations leading to better performance. The pair style
|
||||||
:doc:`meam <pair_meam>` has the exact same syntax.
|
:doc:`meam <pair_meam>` has the exact same syntax. For a transition
|
||||||
|
period the C++ version of MEAM was called USER-MEAMC so it could
|
||||||
|
coexist with the Fortran version.
|
||||||
|
|
||||||
REAX package
|
REAX package
|
||||||
------------
|
------------
|
||||||
|
|
||||||
The REAX package has been removed since it was superseded by the
|
The REAX package has been removed since it was superseded by the
|
||||||
:ref:`REAXFF package <PKG-REAXFF>`. The REAXFF
|
:ref:`REAXFF package <PKG-REAXFF>`. The REAXFF package has been tested
|
||||||
package has been tested to yield equivalent results to the REAX package,
|
to yield equivalent results to the REAX package, offers better
|
||||||
offers better performance, supports OpenMP multi-threading via OPENMP,
|
performance, supports OpenMP multi-threading via OPENMP, and GPU and
|
||||||
and GPU and threading parallelization through KOKKOS. The new pair styles
|
threading parallelization through KOKKOS. The new pair styles are not
|
||||||
are not syntax compatible with the removed reax pair style, so input
|
syntax compatible with the removed reax pair style, so input files will
|
||||||
files will have to be adapted.
|
have to be adapted. The REAXFF package was originally called
|
||||||
|
USER-REAXC.
|
||||||
|
|
||||||
USER-CUDA package
|
USER-CUDA package
|
||||||
-----------------
|
-----------------
|
||||||
@ -60,5 +66,6 @@ restart2data tool
|
|||||||
The functionality of the restart2data tool has been folded into the
|
The functionality of the restart2data tool has been folded into the
|
||||||
LAMMPS executable directly instead of having a separate tool. A
|
LAMMPS executable directly instead of having a separate tool. A
|
||||||
combination of the commands :doc:`read_restart <read_restart>` and
|
combination of the commands :doc:`read_restart <read_restart>` and
|
||||||
:doc:`write_data <write_data>` can be used to the same effect. For added
|
:doc:`write_data <write_data>` can be used to the same effect. For
|
||||||
convenience this conversion can also be triggered by :doc:`command line flags <Run_options>`
|
added convenience this conversion can also be triggered by
|
||||||
|
:doc:`command line flags <Run_options>`
|
||||||
|
|||||||
@ -17,6 +17,7 @@ of time and requests from the LAMMPS user community.
|
|||||||
Developer_flow
|
Developer_flow
|
||||||
Developer_write
|
Developer_write
|
||||||
Developer_notes
|
Developer_notes
|
||||||
|
Developer_updating
|
||||||
Developer_plugins
|
Developer_plugins
|
||||||
Developer_unittest
|
Developer_unittest
|
||||||
Classes
|
Classes
|
||||||
|
|||||||
@ -50,7 +50,7 @@ parallel each MPI process creates such an instance. This can be seen
|
|||||||
in the ``main.cpp`` file where the core steps of running a LAMMPS
|
in the ``main.cpp`` file where the core steps of running a LAMMPS
|
||||||
simulation are the following 3 lines of code:
|
simulation are the following 3 lines of code:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
LAMMPS *lammps = new LAMMPS(argc, argv, lammps_comm);
|
LAMMPS *lammps = new LAMMPS(argc, argv, lammps_comm);
|
||||||
lammps->input->file();
|
lammps->input->file();
|
||||||
@ -78,7 +78,7 @@ LAMMPS makes extensive use of the object oriented programming (OOP)
|
|||||||
principles of *compositing* and *inheritance*. Classes like the
|
principles of *compositing* and *inheritance*. Classes like the
|
||||||
``LAMMPS`` class are a **composite** containing pointers to instances
|
``LAMMPS`` class are a **composite** containing pointers to instances
|
||||||
of other classes like ``Atom``, ``Comm``, ``Force``, ``Neighbor``,
|
of other classes like ``Atom``, ``Comm``, ``Force``, ``Neighbor``,
|
||||||
``Modify``, and so on. Each of these classes implement certain
|
``Modify``, and so on. Each of these classes implements certain
|
||||||
functionality by storing and manipulating data related to the
|
functionality by storing and manipulating data related to the
|
||||||
simulation and providing member functions that trigger certain
|
simulation and providing member functions that trigger certain
|
||||||
actions. Some of those classes like ``Force`` are themselves
|
actions. Some of those classes like ``Force`` are themselves
|
||||||
@ -87,9 +87,9 @@ interactions. Similarly the ``Modify`` class contains a list of
|
|||||||
``Fix`` and ``Compute`` classes. If the input commands that
|
``Fix`` and ``Compute`` classes. If the input commands that
|
||||||
correspond to these classes include the word *style*, then LAMMPS
|
correspond to these classes include the word *style*, then LAMMPS
|
||||||
stores only a single instance of that class. E.g. *atom_style*,
|
stores only a single instance of that class. E.g. *atom_style*,
|
||||||
*comm_style*, *pair_style*, *bond_style*. It the input command does
|
*comm_style*, *pair_style*, *bond_style*. If the input command does
|
||||||
not include the word *style*, there can be many instances of that
|
**not** include the word *style*, then there may be many instances of
|
||||||
class defined. E.g. *region*, *fix*, *compute*, *dump*.
|
that class defined, for example *region*, *fix*, *compute*, *dump*.
|
||||||
|
|
||||||
**Inheritance** enables creation of *derived* classes that can share
|
**Inheritance** enables creation of *derived* classes that can share
|
||||||
common functionality in their base class while providing a consistent
|
common functionality in their base class while providing a consistent
|
||||||
@ -232,7 +232,7 @@ macro ``PairStyle()`` will associate the style name "lj/cut"
|
|||||||
with a factory function creating an instance of the ``PairLJCut``
|
with a factory function creating an instance of the ``PairLJCut``
|
||||||
class.
|
class.
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
// from force.h
|
// from force.h
|
||||||
typedef Pair *(*PairCreator)(LAMMPS *);
|
typedef Pair *(*PairCreator)(LAMMPS *);
|
||||||
@ -360,7 +360,7 @@ characters; "{:<8}" would do this as left aligned, "{:^8}" as centered,
|
|||||||
argument type must be compatible or else the {fmt} formatting code will
|
argument type must be compatible or else the {fmt} formatting code will
|
||||||
throw an exception. Some format string examples are given below:
|
throw an exception. Some format string examples are given below:
|
||||||
|
|
||||||
.. code-block:: C
|
.. code-block:: c++
|
||||||
|
|
||||||
auto mesg = fmt::format(" CPU time: {:4d}:{:02d}:{:02d}\n", cpuh, cpum, cpus);
|
auto mesg = fmt::format(" CPU time: {:4d}:{:02d}:{:02d}\n", cpuh, cpum, cpus);
|
||||||
mesg = fmt::format("{:<8s}| {:<10.5g} | {:<10.5g} | {:<10.5g} |{:6.1f} |{:6.2f}\n",
|
mesg = fmt::format("{:<8s}| {:<10.5g} | {:<10.5g} | {:<10.5g} |{:6.1f} |{:6.2f}\n",
|
||||||
|
|||||||
@ -105,7 +105,7 @@ list, where each pair of atoms is listed only once (except when the
|
|||||||
pairs straddling sub-domains or periodic boundaries will be listed twice).
|
pairs straddling sub-domains or periodic boundaries will be listed twice).
|
||||||
Thus these are the default settings when a neighbor list request is created in:
|
Thus these are the default settings when a neighbor list request is created in:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
void Pair::init_style()
|
void Pair::init_style()
|
||||||
{
|
{
|
||||||
@ -129,7 +129,7 @@ neighbor list request to the specific needs of a style an additional
|
|||||||
request flag is needed. The :doc:`tersoff <pair_tersoff>` pair style,
|
request flag is needed. The :doc:`tersoff <pair_tersoff>` pair style,
|
||||||
for example, needs a "full" neighbor list:
|
for example, needs a "full" neighbor list:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
void PairTersoff::init_style()
|
void PairTersoff::init_style()
|
||||||
{
|
{
|
||||||
@ -141,7 +141,7 @@ When a pair style supports r-RESPA time integration with different cutoff region
|
|||||||
the request flag may depend on the corresponding r-RESPA settings. Here an example
|
the request flag may depend on the corresponding r-RESPA settings. Here an example
|
||||||
from pair style lj/cut:
|
from pair style lj/cut:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
void PairLJCut::init_style()
|
void PairLJCut::init_style()
|
||||||
{
|
{
|
||||||
@ -160,7 +160,7 @@ Granular pair styles need neighbor lists based on particle sizes and not cutoff
|
|||||||
and also may require to have the list of previous neighbors available ("history").
|
and also may require to have the list of previous neighbors available ("history").
|
||||||
For example with:
|
For example with:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
if (use_history) neighbor->add_request(this, NeighConst::REQ_SIZE | NeighConst::REQ_HISTORY);
|
if (use_history) neighbor->add_request(this, NeighConst::REQ_SIZE | NeighConst::REQ_HISTORY);
|
||||||
else neighbor->add_request(this, NeighConst::REQ_SIZE);
|
else neighbor->add_request(this, NeighConst::REQ_SIZE);
|
||||||
@ -170,7 +170,7 @@ settings each request can set an id which is then used in the corresponding
|
|||||||
``init_list()`` function to assign it to the suitable pointer variable. This is
|
``init_list()`` function to assign it to the suitable pointer variable. This is
|
||||||
done for example by the :doc:`pair style meam <pair_meam>`:
|
done for example by the :doc:`pair style meam <pair_meam>`:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
void PairMEAM::init_style()
|
void PairMEAM::init_style()
|
||||||
{
|
{
|
||||||
@ -189,7 +189,7 @@ just once) and this can also be indicated by a flag. As an example here
|
|||||||
is the request from the ``FixPeriNeigh`` class which is created
|
is the request from the ``FixPeriNeigh`` class which is created
|
||||||
internally by :doc:`Peridynamics pair styles <pair_peri>`:
|
internally by :doc:`Peridynamics pair styles <pair_peri>`:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
neighbor->add_request(this, NeighConst::REQ_FULL | NeighConst::REQ_OCCASIONAL);
|
neighbor->add_request(this, NeighConst::REQ_FULL | NeighConst::REQ_OCCASIONAL);
|
||||||
|
|
||||||
@ -198,7 +198,7 @@ than what is usually inferred from the pair style settings (largest cutoff of
|
|||||||
all pair styles plus neighbor list skin). The following is used in the
|
all pair styles plus neighbor list skin). The following is used in the
|
||||||
:doc:`compute rdf <compute_rdf>` command implementation:
|
:doc:`compute rdf <compute_rdf>` command implementation:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
if (cutflag)
|
if (cutflag)
|
||||||
neighbor->add_request(this, NeighConst::REQ_OCCASIONAL)->set_cutoff(mycutneigh);
|
neighbor->add_request(this, NeighConst::REQ_OCCASIONAL)->set_cutoff(mycutneigh);
|
||||||
@ -212,7 +212,7 @@ for printing the neighbor list summary the name of the requesting command
|
|||||||
should be set. Below is the request from the :doc:`delete atoms <delete_atoms>`
|
should be set. Below is the request from the :doc:`delete atoms <delete_atoms>`
|
||||||
command:
|
command:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
neighbor->add_request(this, "delete_atoms", NeighConst::REQ_FULL);
|
neighbor->add_request(this, "delete_atoms", NeighConst::REQ_FULL);
|
||||||
|
|
||||||
|
|||||||
@ -3,9 +3,9 @@ Parallel algorithms
|
|||||||
|
|
||||||
LAMMPS is designed to enable running simulations in parallel using the
|
LAMMPS is designed to enable running simulations in parallel using the
|
||||||
MPI parallel communication standard with distributed data via domain
|
MPI parallel communication standard with distributed data via domain
|
||||||
decomposition. The parallelization aims to be efficient result in good
|
decomposition. The parallelization aims to be efficient, and resulting
|
||||||
strong scaling (= good speedup for the same system) and good weak
|
in good strong scaling (= good speedup for the same system) and good
|
||||||
scaling (= the computational cost of enlarging the system is
|
weak scaling (= the computational cost of enlarging the system is
|
||||||
proportional to the system size). Additional parallelization using GPUs
|
proportional to the system size). Additional parallelization using GPUs
|
||||||
or OpenMP can also be applied within the sub-domain assigned to an MPI
|
or OpenMP can also be applied within the sub-domain assigned to an MPI
|
||||||
process. For clarity, most of the following illustrations show the 2d
|
process. For clarity, most of the following illustrations show the 2d
|
||||||
|
|||||||
@ -68,7 +68,7 @@ Members of ``lammpsplugin_t``
|
|||||||
* - author
|
* - author
|
||||||
- String with the name and email of the author
|
- String with the name and email of the author
|
||||||
* - creator.v1
|
* - creator.v1
|
||||||
- Pointer to factory function for pair, bond, angle, dihedral, improper or command styles
|
- Pointer to factory function for pair, bond, angle, dihedral, improper, kspace, or command styles
|
||||||
* - creator.v2
|
* - creator.v2
|
||||||
- Pointer to factory function for compute, fix, or region styles
|
- Pointer to factory function for compute, fix, or region styles
|
||||||
* - handle
|
* - handle
|
||||||
@ -95,7 +95,7 @@ a class ``PairMorse2`` in the files ``pair_morse2.h`` and
|
|||||||
``pair_morse2.cpp`` with the factory function and initialization
|
``pair_morse2.cpp`` with the factory function and initialization
|
||||||
function would look like this:
|
function would look like this:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
#include "lammpsplugin.h"
|
#include "lammpsplugin.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
@ -141,7 +141,7 @@ list of argument strings), then the pointer type is ``lammpsplugin_factory2``
|
|||||||
and it must be assigned to the *creator.v2* member of the plugin struct.
|
and it must be assigned to the *creator.v2* member of the plugin struct.
|
||||||
Below is an example for that:
|
Below is an example for that:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
#include "lammpsplugin.h"
|
#include "lammpsplugin.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
@ -176,7 +176,7 @@ demonstrated in the following example, which also shows that the
|
|||||||
implementation of the plugin class may be within the same source
|
implementation of the plugin class may be within the same source
|
||||||
file as the plugin interface code:
|
file as the plugin interface code:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
#include "lammpsplugin.h"
|
#include "lammpsplugin.h"
|
||||||
|
|
||||||
@ -262,3 +262,41 @@ A plugin may be registered under an existing style name. In that case
|
|||||||
the plugin will override the existing code. This can be used to modify
|
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
|
the behavior of existing styles or to debug new versions of them without
|
||||||
having to re-compile or re-install all of LAMMPS.
|
having to re-compile or re-install all of LAMMPS.
|
||||||
|
|
||||||
|
Compiling plugins
|
||||||
|
^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
Plugins need to be compiled with the same compilers and libraries
|
||||||
|
(e.g. MPI) and compilation settings (MPI on/off, OpenMP, integer sizes)
|
||||||
|
as the LAMMPS executable and library. Otherwise the plugin will likely
|
||||||
|
not load due to mismatches in the function signatures (LAMMPS is C++ so
|
||||||
|
scope, type, and number of arguments are encoded into the symbol names
|
||||||
|
and thus differences in them will lead to failed plugin load commands.
|
||||||
|
Compilation of the plugin can be managed via both, CMake or traditional
|
||||||
|
GNU makefiles. Some examples that can be used as a template are in the
|
||||||
|
``examples/plugins`` folder. The CMake script code has some small
|
||||||
|
adjustments to allow building the plugins for running unit tests with
|
||||||
|
them.
|
||||||
|
|
||||||
|
Another example that converts the KIM package into a plugin can be found
|
||||||
|
in the ``examples/kim/plugin`` folder. No changes to the sources of the
|
||||||
|
KIM package themselves are needed; only the plugin interface and loader
|
||||||
|
code needs to be added. This example only supports building with CMake,
|
||||||
|
but is probably a more typical example. To compile you need to run CMake
|
||||||
|
with -DLAMMPS_SOURCE_DIR=<path/to/lammps/src/folder>. Other
|
||||||
|
configuration setting are identical to those for compiling LAMMPS.
|
||||||
|
|
||||||
|
A second example for a plugin from a package is in the
|
||||||
|
``examples/PACKAGES/pace/plugin`` folder that will create a plugin from
|
||||||
|
the ML-PACE package. In this case the bulk of the code is in a static
|
||||||
|
external library that is being downloaded and compiled first and then
|
||||||
|
combined with the pair style wrapper and the plugin loader. This
|
||||||
|
example also contains a NSIS script that can be used to create an
|
||||||
|
Installer package for Windows (the mutual licensing terms of the
|
||||||
|
external library and LAMMPS conflict when distributing binaries, so the
|
||||||
|
ML-PACE package cannot be linked statically, but the LAMMPS headers
|
||||||
|
required to build the plugin are also available under a less restrictive
|
||||||
|
license). This will automatically set the required environment variable
|
||||||
|
and launching a (compatible) LAMMPS binary will load and register the
|
||||||
|
plugin and the ML-PACE package can then be used as it was linked into
|
||||||
|
LAMMPS.
|
||||||
|
|||||||
@ -194,7 +194,7 @@ macro. These tests operate by capturing the screen output when executing
|
|||||||
the failing command and then comparing that with a provided regular
|
the failing command and then comparing that with a provided regular
|
||||||
expression string pattern. Example:
|
expression string pattern. Example:
|
||||||
|
|
||||||
.. code-block:: C++
|
.. code-block:: c++
|
||||||
|
|
||||||
TEST_F(SimpleCommandsTest, UnknownCommand)
|
TEST_F(SimpleCommandsTest, UnknownCommand)
|
||||||
{
|
{
|
||||||
@ -249,7 +249,7 @@ MPI support. These include tests where LAMMPS is run in multi-partition
|
|||||||
mode or only on a subset of the MPI world communicator. The CMake
|
mode or only on a subset of the MPI world communicator. The CMake
|
||||||
script code for adding this kind of test looks like this:
|
script code for adding this kind of test looks like this:
|
||||||
|
|
||||||
.. code-block:: CMake
|
.. code-block:: cmake
|
||||||
|
|
||||||
if (BUILD_MPI)
|
if (BUILD_MPI)
|
||||||
add_executable(test_library_mpi test_library_mpi.cpp)
|
add_executable(test_library_mpi test_library_mpi.cpp)
|
||||||
@ -489,7 +489,7 @@ to update the YAML files. Running a command like
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ test_pair_style mol-pair-lennard_mdf.yaml -g new.yaml
|
test_pair_style mol-pair-lennard_mdf.yaml -g new.yaml
|
||||||
|
|
||||||
will read the settings from the ``mol-pair-lennard_mdf.yaml`` file and then compute
|
will read the settings from the ``mol-pair-lennard_mdf.yaml`` file and then compute
|
||||||
the reference data and write a new file with to ``new.yaml``. If this step fails,
|
the reference data and write a new file with to ``new.yaml``. If this step fails,
|
||||||
@ -500,13 +500,13 @@ It is also possible to do an update in place with:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ test_pair_style mol-pair-lennard_mdf.yaml -u
|
test_pair_style mol-pair-lennard_mdf.yaml -u
|
||||||
|
|
||||||
And one can finally run the full set of tests with:
|
And one can finally run the full set of tests with:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ test_pair_style mol-pair-lennard_mdf.yaml
|
test_pair_style mol-pair-lennard_mdf.yaml
|
||||||
|
|
||||||
This will just print a summary of the groups of tests. When using the "-v" flag
|
This will just print a summary of the groups of tests. When using the "-v" flag
|
||||||
the test will also keep any LAMMPS output and when using the "-s" flag, there
|
the test will also keep any LAMMPS output and when using the "-s" flag, there
|
||||||
|
|||||||
425
doc/src/Developer_updating.rst
Normal file
425
doc/src/Developer_updating.rst
Normal file
@ -0,0 +1,425 @@
|
|||||||
|
Notes for updating code written for older LAMMPS versions
|
||||||
|
---------------------------------------------------------
|
||||||
|
|
||||||
|
This section documents how C++ source files that are available *outside
|
||||||
|
of the LAMMPS source distribution* (e.g. in external USER packages or as
|
||||||
|
source files provided as a supplement to a publication) that are written
|
||||||
|
for an older version of LAMMPS and thus need to be updated to be
|
||||||
|
compatible with the current version of LAMMPS. Due to the active
|
||||||
|
development of LAMMPS it is likely to always be incomplete. Please
|
||||||
|
contact developers@lammps.org in case you run across an issue that is not
|
||||||
|
(yet) listed here. Please also review the latest information about the
|
||||||
|
LAMMPS :doc:`programming style conventions <Modify_style>`, especially
|
||||||
|
if you are considering to submit the updated version for inclusion into
|
||||||
|
the LAMMPS distribution.
|
||||||
|
|
||||||
|
Available topics in mostly chronological order are:
|
||||||
|
|
||||||
|
- `Setting flags in the constructor`_
|
||||||
|
- `Rename of pack/unpack_comm() to pack/unpack_forward_comm()`_
|
||||||
|
- `Use ev_init() to initialize variables derived from eflag and vflag`_
|
||||||
|
- `Use utils::numeric() functions instead of force->numeric()`_
|
||||||
|
- `Use utils::open_potential() function to open potential files`_
|
||||||
|
- `Simplify customized error messages`_
|
||||||
|
- `Use of "override" instead of "virtual"`_
|
||||||
|
- `Simplified and more compact neighbor list requests`_
|
||||||
|
- `Split of fix STORE into fix STORE/GLOBAL and fix STORE/PERATOM`_
|
||||||
|
- `Use Output::get_dump_by_id() instead of Output::find_dump()`_
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
Setting flags in the constructor
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
As LAMMPS gains additional functionality, new flags may need to be set
|
||||||
|
in the constructor or a class to signal compatibility with such features.
|
||||||
|
Most of the time the defaults are chosen conservatively, but sometimes
|
||||||
|
the conservative choice is the uncommon choice, and then those settings
|
||||||
|
need to be made when updating code.
|
||||||
|
|
||||||
|
Pair styles:
|
||||||
|
|
||||||
|
- ``manybody_flag``: set to 1 if your pair style is not pair-wise additive
|
||||||
|
- ``restartinfo``: set to 0 if your pair style does not store data in restart files
|
||||||
|
|
||||||
|
|
||||||
|
Rename of pack/unpack_comm() to pack/unpack_forward_comm()
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. versionchanged:: 8Aug2014
|
||||||
|
|
||||||
|
In this change set the functions to pack data into communication buffers
|
||||||
|
and to unpack data from communication buffers for :doc:`forward
|
||||||
|
communications <Developer_comm_ops>` were renamed from ``pack_comm()``
|
||||||
|
and ``unpack_comm()`` to ``pack_forward_comm()`` and
|
||||||
|
``unpack_forward_comm()``, respectively. Also the meaning of the return
|
||||||
|
value of these functions was changed: rather than returning the number
|
||||||
|
of items per atom stored in the buffer, now the total number of items
|
||||||
|
added (or unpacked) needs to be returned. Here is an example from the
|
||||||
|
`PairEAM` class. Of course the member function declaration in corresponding
|
||||||
|
header file needs to be updated accordingly.
|
||||||
|
|
||||||
|
Old:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
int PairEAM::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
|
||||||
|
{
|
||||||
|
int m = 0;
|
||||||
|
for (int i = 0; i < n; i++) {
|
||||||
|
int j = list[i];
|
||||||
|
buf[m++] = fp[j];
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
New:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
int PairEAM::pack_forward_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
|
||||||
|
{
|
||||||
|
int m = 0;
|
||||||
|
for (int i = 0; i < n; i++) {
|
||||||
|
int j = list[i];
|
||||||
|
buf[m++] = fp[j];
|
||||||
|
}
|
||||||
|
return m;
|
||||||
|
}
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
Because the various "pack" and "unpack" functions are defined in the
|
||||||
|
respective base classes as dummy functions doing nothing, and because
|
||||||
|
of the the name mismatch the custom versions in the derived class
|
||||||
|
will no longer be called, there will be no compilation error when
|
||||||
|
this change is not applied. Only calculations will suddenly produce
|
||||||
|
incorrect results because the required forward communication calls
|
||||||
|
will cease to function correctly.
|
||||||
|
|
||||||
|
Use ev_init() to initialize variables derived from eflag and vflag
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. versionchanged:: 29Mar2019
|
||||||
|
|
||||||
|
There are several variables that need to be initialized based on
|
||||||
|
the values of the "eflag" and "vflag" variables and since sometimes
|
||||||
|
there are new bits added and new variables need to be set to 1 or 0.
|
||||||
|
To make this consistent, across all styles, there is now an inline
|
||||||
|
function ``ev_init(eflag, vflag)`` that makes those settings
|
||||||
|
consistently and calls either ``ev_setup()`` or ``ev_unset()``.
|
||||||
|
Example from a pair style:
|
||||||
|
|
||||||
|
Old:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
if (eflag || vflag) ev_setup(eflag, vflag);
|
||||||
|
else evflag = vflag_fdotr = eflag_global = eflag_atom = 0;
|
||||||
|
|
||||||
|
New:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
ev_init(eflag, vflag);
|
||||||
|
|
||||||
|
Not applying this change will not cause a compilation error, but
|
||||||
|
can lead to inconsistent behavior and incorrect tallying of
|
||||||
|
energy or virial.
|
||||||
|
|
||||||
|
Use utils::numeric() functions instead of force->numeric()
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. versionchanged:: 18Sep2020
|
||||||
|
|
||||||
|
The "numeric()" conversion functions (including "inumeric()",
|
||||||
|
"bnumeric()", and "tnumeric()") have been moved from the Force class to
|
||||||
|
the utils namespace. Also they take an additional argument that selects
|
||||||
|
whether the ``Error::all()`` or ``Error::one()`` function should be
|
||||||
|
called in case of an error. The former should be used when *all* MPI
|
||||||
|
processes call the conversion function and the latter *must* be used
|
||||||
|
when they are called from only one or a subset of the MPI processes.
|
||||||
|
|
||||||
|
Old:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
val = force->numeric(FLERR, arg[1]);
|
||||||
|
num = force->inumeric(FLERR, arg[2]);
|
||||||
|
|
||||||
|
New:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
val = utils::numeric(FLERR, true, arg[1], lmp);
|
||||||
|
num = utils::inumeric(FLERR, false, arg[2], lmp);
|
||||||
|
|
||||||
|
.. seealso::
|
||||||
|
|
||||||
|
:cpp:func:`utils::numeric() <LAMMPS_NS::utils::numeric>`,
|
||||||
|
:cpp:func:`utils::inumeric() <LAMMPS_NS::utils::inumeric>`,
|
||||||
|
:cpp:func:`utils::bnumeric() <LAMMPS_NS::utils::bnumeric>`,
|
||||||
|
:cpp:func:`utils::tnumeric() <LAMMPS_NS::utils::tnumeric>`
|
||||||
|
|
||||||
|
Use utils::open_potential() function to open potential files
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. versionchanged:: 18Sep2020
|
||||||
|
|
||||||
|
The :cpp:func:`utils::open_potential()
|
||||||
|
<LAMMPS_NS::utils::open_potential>` function must be used to replace
|
||||||
|
calls to ``force->open_potential()`` and should be used to replace
|
||||||
|
``fopen()`` for opening potential files for reading. The custom
|
||||||
|
function does three additional steps compared to ``fopen()``: 1) it will
|
||||||
|
try to parse the ``UNITS:`` and ``DATE:`` metadata will stop with an
|
||||||
|
error on a units mismatch and will print the date info, if present, in
|
||||||
|
the log file; 2) for pair styles that support it, it will set up
|
||||||
|
possible automatic unit conversions based on the embedded unit
|
||||||
|
information and LAMMPS' current units setting; 3) it will not only try
|
||||||
|
to open a potential file at the given path, but will also search in the
|
||||||
|
folders listed in the ``LAMMPS_POTENTIALS`` environment variable. This
|
||||||
|
allows to keep potential files in a common location instead of having to
|
||||||
|
copy them around for simulations.
|
||||||
|
|
||||||
|
Old:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
fp = force->open_potential(filename);
|
||||||
|
fp = fopen(filename, "r");
|
||||||
|
|
||||||
|
New:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
fp = utils::open_potential(filename, lmp);
|
||||||
|
|
||||||
|
Simplify customized error messages
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. versionchanged:: 14May2021
|
||||||
|
|
||||||
|
Aided by features of the bundled {fmt} library, error messages now
|
||||||
|
can have a variable number of arguments and the string will be interpreted
|
||||||
|
as a {fmt} style format string so that custom error messages can be
|
||||||
|
easily customized without having to use temporary buffers and ``sprintf()``.
|
||||||
|
Example:
|
||||||
|
|
||||||
|
Old:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
if (fptr == NULL) {
|
||||||
|
char str[128];
|
||||||
|
sprintf(str,"Cannot open AEAM potential file %s",filename);
|
||||||
|
error->one(FLERR,str);
|
||||||
|
}
|
||||||
|
|
||||||
|
New:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
if (fptr == nullptr)
|
||||||
|
error->one(FLERR, "Cannot open AEAM potential file {}: {}", filename, utils::getsyserror());
|
||||||
|
|
||||||
|
Use of "override" instead of "virtual"
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. versionchanged:: 17Feb2022
|
||||||
|
|
||||||
|
Since LAMMPS requires C++11 we switched to use the "override" keyword
|
||||||
|
instead of "virtual" to indicate polymorphism in derived classes. This
|
||||||
|
allows the C++ compiler to better detect inconsistencies when an
|
||||||
|
override is intended or not. Please note that "override" has to be
|
||||||
|
added to **all** polymorph functions in derived classes and "virtual"
|
||||||
|
*only* to the function in the base class (or the destructor). Here is
|
||||||
|
an example from the ``FixWallReflect`` class:
|
||||||
|
|
||||||
|
Old:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
FixWallReflect(class LAMMPS *, int, char **);
|
||||||
|
virtual ~FixWallReflect();
|
||||||
|
int setmask();
|
||||||
|
void init();
|
||||||
|
void post_integrate();
|
||||||
|
|
||||||
|
New:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
FixWallReflect(class LAMMPS *, int, char **);
|
||||||
|
~FixWallReflect() override;
|
||||||
|
int setmask() override;
|
||||||
|
void init() override;
|
||||||
|
void post_integrate() override;
|
||||||
|
|
||||||
|
This change set will neither cause a compilation failure, nor will it
|
||||||
|
change functionality, but if you plan to submit the updated code for
|
||||||
|
inclusion into the LAMMPS distribution, it will be requested for achieve
|
||||||
|
a consistent :doc:`programming style <Modify_style>`.
|
||||||
|
|
||||||
|
Simplified function names for forward and reverse communication
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. versionchanged:: 24Mar2022
|
||||||
|
|
||||||
|
Rather then using the function name to distinguish between the different
|
||||||
|
forward and reverse communication functions for styles, LAMMPS now uses
|
||||||
|
the type of the "this" pointer argument.
|
||||||
|
|
||||||
|
Old:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
comm->forward_comm_pair(this);
|
||||||
|
comm->forward_comm_fix(this);
|
||||||
|
comm->forward_comm_compute(this);
|
||||||
|
comm->forward_comm_dump(this);
|
||||||
|
comm->reverse_comm_pair(this);
|
||||||
|
comm->reverse_comm_fix(this);
|
||||||
|
comm->reverse_comm_compute(this);
|
||||||
|
comm->reverse_comm_dump(this);
|
||||||
|
|
||||||
|
New:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
comm->forward_comm(this);
|
||||||
|
comm->reverse_comm(this);
|
||||||
|
|
||||||
|
This change is **required** or else the code will not compile.
|
||||||
|
|
||||||
|
Simplified and more compact neighbor list requests
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. versionchanged:: 24Mar2022
|
||||||
|
|
||||||
|
This change set reduces the amount of code required to request a
|
||||||
|
neighbor list. It enforces consistency and no longer requires to change
|
||||||
|
internal data of the request. More information on neighbor list
|
||||||
|
requests can be :doc:`found here <Developer_notes>`. Example from the
|
||||||
|
``ComputeRDF`` class:
|
||||||
|
|
||||||
|
Old:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
int irequest = neighbor->request(this,instance_me);
|
||||||
|
neighbor->requests[irequest]->pair = 0;
|
||||||
|
neighbor->requests[irequest]->compute = 1;
|
||||||
|
neighbor->requests[irequest]->occasional = 1;
|
||||||
|
if (cutflag) {
|
||||||
|
neighbor->requests[irequest]->cut = 1;
|
||||||
|
neighbor->requests[irequest]->cutoff = mycutneigh;
|
||||||
|
}
|
||||||
|
|
||||||
|
New:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
auto req = neighbor->add_request(this, NeighConst::REQ_OCCASIONAL);
|
||||||
|
if (cutflag) req->set_cutoff(mycutneigh);
|
||||||
|
|
||||||
|
Public access to the ``NeighRequest`` class data members has been
|
||||||
|
removed so this update is **required** to avoid compilation failure.
|
||||||
|
|
||||||
|
Split of fix STORE into fix STORE/GLOBAL and fix STORE/PERATOM
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. versionchanged:: 15Sep2022
|
||||||
|
|
||||||
|
This change splits the GLOBAL and PERATOM modes of fix STORE into two
|
||||||
|
separate fixes STORE/GLOBAL and STORE/PERATOM. There was very little
|
||||||
|
shared code between the two fix STORE modes and the two different code
|
||||||
|
paths had to be prefixed with if statements. Furthermore, some flags
|
||||||
|
were used differently in the two modes leading to confusion. Splitting
|
||||||
|
the code into two fix styles, makes it more easily maintainable. Since
|
||||||
|
these are internal fixes, there is no user visible change.
|
||||||
|
|
||||||
|
Old:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
#include "fix_store.h"
|
||||||
|
|
||||||
|
FixStore *fix = dynamic_cast<FixStore *>(
|
||||||
|
modify->add_fix(fmt::format("{} {} STORE peratom 1 13",id_pole,group->names[0]));
|
||||||
|
|
||||||
|
FixStore *fix = dynamic_cast<FixStore *>(modify->get_fix_by_id(id_pole));
|
||||||
|
|
||||||
|
New:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
#include "fix_store_peratom.h"
|
||||||
|
|
||||||
|
FixStorePeratom *fix = dynamic_cast<FixStorePeratom *>(
|
||||||
|
modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 13",id_pole,group->names[0]));
|
||||||
|
|
||||||
|
FixStorePeratom *fix = dynamic_cast<FixStorePeratom *>(modify->get_fix_by_id(id_pole));
|
||||||
|
|
||||||
|
Old:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
#include "fix_store.h"
|
||||||
|
|
||||||
|
FixStore *fix = dynamic_cast<FixStore *>(
|
||||||
|
modify->add_fix(fmt::format("{} {} STORE global 1 1",id_fix,group->names[igroup]));
|
||||||
|
|
||||||
|
FixStore *fix = dynamic_cast<FixStore *>(modify->get_fix_by_id(id_fix));
|
||||||
|
|
||||||
|
New:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
#include "fix_store_global.h"
|
||||||
|
|
||||||
|
FixStoreGlobal *fix = dynamic_cast<FixStoreGlobal *>(
|
||||||
|
modify->add_fix(fmt::format("{} {} STORE/GLOBAL 1 1",id_fix,group->names[igroup]));
|
||||||
|
|
||||||
|
FixStoreGlobal *fix = dynamic_cast<FixStoreGlobal *>(modify->get_fix_by_id(id_fix));
|
||||||
|
|
||||||
|
This change is **required** or else the code will not compile.
|
||||||
|
|
||||||
|
Use Output::get_dump_by_id() instead of Output::find_dump()
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. versionchanged:: 15Sep2022
|
||||||
|
|
||||||
|
The accessor function to individual dump style instances has been changed
|
||||||
|
from ``Output::find_dump()`` returning the index of the dump instance in
|
||||||
|
the list of dumps to ``Output::get_dump_by_id()`` returning a pointer to
|
||||||
|
the dump directly. Example:
|
||||||
|
|
||||||
|
Old:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
int idump = output->find_dump(arg[iarg+1]);
|
||||||
|
if (idump < 0)
|
||||||
|
error->all(FLERR,"Dump ID in hyper command does not exist");
|
||||||
|
memory->grow(dumplist,ndump+1,"hyper:dumplist");
|
||||||
|
dumplist[ndump++] = idump;
|
||||||
|
|
||||||
|
[...]
|
||||||
|
|
||||||
|
if (dumpflag)
|
||||||
|
for (int idump = 0; idump < ndump; idump++)
|
||||||
|
output->dump[dumplist[idump]]->write();
|
||||||
|
|
||||||
|
New:
|
||||||
|
|
||||||
|
.. code-block:: c++
|
||||||
|
|
||||||
|
auto idump = output->get_dump_by_id(arg[iarg+1]);
|
||||||
|
if (!idump) error->all(FLERR,"Dump ID {} in hyper command does not exist", arg[iarg+1]);
|
||||||
|
dumplist.emplace_back(idump);
|
||||||
|
|
||||||
|
[...]
|
||||||
|
|
||||||
|
if (dumpflag) for (auto idump : dumplist) idump->write();
|
||||||
|
|
||||||
|
This change is **required** or else the code will not compile.
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user