Compare commits

...

1546 Commits

Author SHA1 Message Date
59e8b9370f plug memory leak in FixNHIntel class 2023-04-24 20:58:33 -04:00
39fa2021e2 avoid 32-bit integer overflow when allocating memory for neighbor list copy 2023-04-24 20:45:49 -04:00
83f492a195 must initialize vest_temp to null to avoid segfaults 2023-04-24 20:44:44 -04:00
933457acbe Templated functions calling math libraries should use type-aware calls 2023-04-24 19:55:39 -04:00
06f4099566 Vector masking is part of AVX512, not limited to Intel compiler 2023-04-24 19:54:19 -04:00
5624a78b17 Fix uninitialized memebr 2023-04-24 19:53:57 -04:00
47e875142f update version string 2023-04-22 18:37:52 -04:00
62c844d5ac update version string for stable release update 2023-04-22 14:56:44 -04:00
263b6d4d6f compilation fix for Fedora 38 from upstream 2023-04-22 14:32:11 -04:00
4acca38a65 remove text that only applies to newer LAMMPS versions 2023-04-22 12:19:37 -04:00
4cf642b526 correct docs for fix edpd/source and fix tdpd/source 2023-04-22 12:12:38 -04:00
52fc8f05ee update CMake script for PLUMED package to support cross-compilation to Windows 2023-04-10 09:23:19 -04:00
047df9aa9e mark as maintenance branch version 2023-03-31 09:52:58 -04:00
fb3bd20dff update fmtlib to version 9.1.0 to avoid compilation issues with PGI/NVHPC compilers 2023-03-23 18:34:42 -04:00
c7d62c4709 fix ids once bug in compute chunk/atom 2023-03-22 22:21:13 -04:00
b18008c58d add useful comments 2023-03-22 22:18:29 -04:00
9469321e3d Fixed bug in fep tools 2023-03-22 22:18:04 -04:00
a4a9efeefc Fixed bug in fep tools 2023-03-22 22:17:55 -04:00
70744f10e0 backport fix property/atom bugfix for KOKKOS 2023-03-22 22:17:10 -04:00
9bea55bd77 update fix mscg example 2023-03-16 14:55:20 -04:00
73525b3bbc Download the latest MSCG snapshot to address bug in library. 2023-03-16 14:55:05 -04:00
9cf67699cc include fixes and updates from upstream 2023-03-16 12:44:18 -04:00
666fe4cfbe fix two bugs in the ndx2group command 2023-03-16 12:35:53 -04:00
ed7bd50500 must recompile main.o when MDI package is installed/uninstalled 2023-03-12 22:31:06 -04:00
d241e26d03 allow dynamic groups with fix oneway 2023-02-25 12:03:40 -05:00
73e7163ed6 don't store topology information with ghost atoms. they will be ignored. 2023-02-24 22:56:17 -05:00
5a5a86684a Fix the adios2::ADIOS constructor calls that were deprecated in adios 2.8 and removed in 2.9. The fix is backward compatible with older adios2 versions as well. 2023-02-23 15:39:01 -05:00
ae3f57e89a fix bug in fix wall/morse that was computing forces incorrectly 2023-02-23 15:38:20 -05:00
fff7b2a859 update unit test for correct fix wall/morse 2023-02-23 15:37:58 -05:00
83ba1c9d20 Merge pull request #3645 from akohlmey/more-backports-to-stable
More backports of fixes to stable release
2023-02-17 16:27:13 -05:00
ce10614cab backport region check move to init() function for fix gcmc and fix widom 2023-02-17 12:44:58 -05:00
facbeac052 move definition of MAXBIGINT_DOUBLE to variable.cpp 2023-02-17 12:29:17 -05:00
188ee5af15 use MAXBIGINT_DOUBLE which does not overflow when casting back to bigint 2023-02-12 04:08:11 -05:00
f176b8b14c consistently support special_bonds settings in pair style gauss 2023-02-10 05:09:58 -05:00
2396b2feea Fixed bugs with gauss/gpu in bonded systems, including factor_lj in forces and energies 2023-02-10 05:02:43 -05:00
4399c1b6c1 Merge pull request #3593 from akohlmey/maintenance-2022-06-23
Third round of maintenance fixes and backports for the stable release
2023-02-09 22:53:11 -05:00
fd046c8fd8 Merge branch 'maintenance' into maintenance-2022-06-23 2023-02-09 20:17:06 -05:00
09b7694601 Merge pull request #3595 from akohlmey/maintenance-many-files
Additional non-functional maintenance changes for the stable version
2023-02-09 20:09:28 -05:00
df20503434 make fallback url function available to plugin compilations 2023-02-09 08:14:23 -05:00
f4aa24a36a roll back changes for vec3_scale() and vec3_scaleadd() and use temporary vector 2023-02-08 20:33:38 -05:00
007c04bc97 correct preprocessor logic for non-Linux machines 2023-02-08 16:45:48 -05:00
418d1e16e1 recover compilation of tersoff kernels with CUDA 2023-02-08 11:17:09 -05:00
6471d781d0 recover kernel failure for tersoff with mixed and single precision 2023-02-08 09:14:37 -05:00
97ddc5917c another OpenCL bugfix attempt from Trung 2023-02-08 08:26:22 -05:00
a95ff20647 swap nvcc default arch from Maxwell to Pascal
This is to avoid deprecation warnings with CUDA 11.6 and later
2023-02-07 08:34:01 -05:00
9e0a9e2601 correct logic 2023-02-07 00:00:17 -05:00
8b34d65970 add download fallback handling 2023-02-07 00:00:07 -05:00
0a1c2bcccc fix failing unit tests with OpenCL 2023-02-06 18:40:07 -05:00
c9442c591c re-enable new neighbor lists for CUDA 12.0 and later 2023-02-05 03:01:46 -05:00
b7d316031d nullify freed pointers in list of dump data 2023-02-03 20:39:47 -05:00
361e9f3ea5 avoid illegal memory access in destructor after variables have been deleted 2023-02-03 20:26:42 -05:00
28120793b8 backport PR #3631 2023-02-02 22:21:15 -05:00
f32ce8377e change default arch in nvcc_wrapper, so it can still run with cuda 12 2023-02-01 11:35:59 -05:00
9021b8bc6a implement download fallback for traditional make build 2023-02-01 06:53:53 -05:00
838fe3020d add support for building a static lammps-shell executable with Linux/MUSL 2023-01-31 22:23:41 -05:00
b4d4dcbcbc simplify 2023-01-31 20:35:18 -05:00
52a892ec46 simplify 2023-01-31 20:32:41 -05:00
0ee3d9da5d port triclinic region vs box check from fix gcmc to fix widom 2023-01-31 20:29:18 -05:00
50afb292b0 compare region extent with box bounds for triclinic 2023-01-31 20:28:25 -05:00
275ef9da17 update n2p2 lib version for traditional make, too. 2023-01-31 20:28:15 -05:00
b6a87390a3 revert MD5 hash to current value after GitHub reversed its change 2023-01-31 20:28:04 -05:00
72178631c5 update N2P2 library to version 2.2.0 2023-01-31 20:27:57 -05:00
f8859c5fca implement download fallback URLs pointing to download.lammps.org for CMake 2023-01-31 20:22:06 -05:00
979119a29b backport fixes to KOKKOS and REAXFF from PR #3621 2023-01-31 20:18:38 -05:00
bc66572275 Fix out of bounds access in pair_vashishta_kokkos with skip list 2023-01-31 20:00:45 -05:00
609231675f Allow neighbor class to set newton flag in Kokkos neigh list 2023-01-31 19:55:07 -05:00
d9675b5da4 Fix QUIP compilation with Intel compilers. 2023-01-30 08:11:52 -05:00
7d32b4f42a make Kokkos lib compatible with musl-libc
Note: this was adapted from https://github.com/kokkos/kokkos/pull/5678
to be usable without requiring C++17
2023-01-27 12:21:39 -05:00
697e5b15ec forcibly disable COMPRESS package is zlib is not found 2023-01-27 07:29:25 -05:00
ade0718c11 make compatible to non-glibc Linux 2023-01-27 07:26:23 -05:00
31033ff6e0 must initialize "np" in constructor 2023-01-26 18:34:21 -05:00
9a598ba5a8 backport fix pimd bugfix from develop 2023-01-26 15:59:26 -05:00
ff20448b1d add image to the cover page of the PDF version of the manual 2023-01-26 11:23:46 -05:00
af5229ba58 swap constexpr back to const 2023-01-26 09:58:26 -05:00
b180200c48 check if variable value is a valid number before converting it 2023-01-26 07:10:50 -05:00
27441cf2ea update developer contact info in a few more files 2023-01-25 22:24:22 -05:00
db61bf609b plug memory leaks in couple examples 2023-01-25 21:48:29 -05:00
015fa4cb0a update embedded docs 2023-01-25 21:44:04 -05:00
62f6f91146 minor typo and rewording 2023-01-25 21:42:37 -05:00
e163b0b1d7 portability improvements for Solaris/OpenIndiana 2023-01-25 21:40:23 -05:00
169a886898 cannot test PYTHON package if it is not installed 2023-01-25 21:37:22 -05:00
cbd276c49d correct prototype for documentation 2023-01-25 21:32:03 -05:00
183c6c06ff small tweaks to the "breadcrumbs" part of the theme to avoid double inserting a separation character 2023-01-25 21:28:18 -05:00
93a46da58e add image to the cover page of the PDF version of the manual 2023-01-25 21:24:27 -05:00
6b6a47bd3c Small tweaks 2023-01-25 21:21:08 -05:00
4a0a98a0fd Small bugfixes for Kokkos 2023-01-25 21:20:59 -05:00
369ea4fd26 Add this 2023-01-25 21:17:30 -05:00
d63c002bf5 Use group for Kokkos nvt temp compute 2023-01-25 21:17:22 -05:00
e931d3153b small improvements from upstream 2023-01-13 17:52:28 -05:00
2913c063d4 whitespace 2023-01-13 14:51:21 -05:00
5606b57646 Update SECURITY.md
I found the overlapping meanings of release/update/patch a bit confusing, especially when sometimes referring to a branch name and sometimes used as a general description.  So I reworked it, trying to preserve meaning. I deleted the last sentence, because I did not understand it, it may need to be added again.
2023-01-13 11:30:07 -07:00
0fafe34008 import updates to library plugin loader from upstream 2023-01-13 05:21:33 -05:00
a9a1640d67 reorder 2023-01-12 18:28:17 -05:00
812363fb99 lammpsplugin bugfix from Stan 2023-01-12 18:24:04 -05:00
b40e0be1c9 reset to current state of the library interface and remove parts from upstream that have crept in 2023-01-12 12:08:00 -05:00
1be973da07 update from upstream 2023-01-11 22:31:06 -05:00
aca2c52795 update LAMMPS developer contact info 2023-01-11 22:25:25 -05:00
536b2ab7e5 restore accidentally deleted file 2023-01-11 22:16:31 -05:00
ccef293161 remove obsolete comment 2023-01-11 22:11:53 -05:00
4b0de87813 silence compiler warning 2023-01-11 21:59:35 -05:00
fa22aef31b Fix obscure bug in Kokkos neigh list build 2023-01-11 21:53:16 -05:00
cb7544a615 import modernization from upstream 2023-01-11 21:41:58 -05:00
a9be4906b7 import safer ghost cutoff determination for manybody GPU styles from upstream 2023-01-11 21:41:43 -05:00
6f36d21a04 GPU library updates 2023-01-11 21:34:42 -05:00
c55a15c4dc make AWPMD compatible with MSVC and c++-linalg on Windows 2023-01-11 21:23:03 -05:00
8f01dad1a9 add tools/tabulate 2023-01-11 21:21:51 -05:00
db6e1aa20d some more documentation updates 2023-01-11 21:21:03 -05:00
3cee69a077 correct Kokkos device/arch info ouput in CMake summary 2023-01-11 18:15:56 -05:00
69ffe71595 update unit tests for code corrections 2023-01-11 07:45:50 -05:00
16fa033111 fix issues with bundled meam/spline potentials 2023-01-11 06:40:54 -05:00
8e494aa771 updates and bugfixes for liblammpsplugin plugin loader for LAMMPS shared lib 2023-01-11 06:11:46 -05:00
d203cce8b5 documentation updates from upstream 2023-01-11 06:07:19 -05:00
f8de1b1a75 use official API for utils::logmesg(), stricter/consistent checking for integer and floats 2023-01-11 05:54:35 -05:00
de89a25a25 final CMake sync with upstream 2023-01-11 05:03:00 -05:00
f982e95267 update developer info in unittest tree 2023-01-11 01:28:52 -05:00
293d0cdb58 fix typo 2023-01-11 01:26:54 -05:00
011f2651ee update 2023-01-11 01:26:48 -05:00
a8d3c43a77 update version 2023-01-11 01:26:35 -05:00
c19641f8b3 synchronize CMake scripting with upstream 2023-01-11 01:04:32 -05:00
6596b343ff sync docs with fire minimizer code features 2023-01-10 21:55:56 -05:00
b6dbb0330c update list of commands in pygments LAMMPS lexer 2023-01-10 21:55:56 -05:00
0dd138666a update for accelerated versions 2023-01-10 21:55:56 -05:00
33b9fec150 synchronize sphinx configuration with upstream 2023-01-10 21:55:56 -05:00
32b020a165 Increase communication cutoff for TIP4P pair styles, if needed
This avoids error of H atom not found when the O atom is a ghost.
2023-01-10 21:55:56 -05:00
c1db230331 Fix bug in Kokkos ReaxFF on GPUs 2023-01-10 21:55:56 -05:00
254c052ecc Fix GPU tag issues in other Kokkos styles 2023-01-10 21:55:56 -05:00
8e889dfa7c offset is not used (by construction of the potential) 2023-01-10 21:55:55 -05:00
5b6a52a646 correct suffix handling with compute fep 2023-01-10 21:55:55 -05:00
55f56deb63 bugfix for minimization with KOKKOS when using fix box/relax 2023-01-10 21:55:55 -05:00
bfe127a720 cosmetic 2023-01-10 21:55:55 -05:00
d95c8911a3 tweak intel compiler settings 2023-01-10 21:55:55 -05:00
0380f9d854 consistently prefix deep_copy() with Kokkos:: 2023-01-10 21:55:55 -05:00
71b1d60363 bugfix for gaussian bond/angle styles to avoid premature truncation of potential 2023-01-10 21:55:55 -05:00
8b1f92fabd better error handling when reading table files 2023-01-10 21:55:55 -05:00
419af0cf28 dead code removal 2023-01-10 21:55:45 -05:00
9030c59932 bugfix for nm/cut argument parsing 2023-01-10 21:55:21 -05:00
ee88078150 bugfix for DPD with exclusions other than 0.0 or 1.0 2023-01-10 21:55:21 -05:00
04451f6072 recover compilation 2023-01-10 21:55:21 -05:00
2364f7f08b bugfix for incorrect stress tally in dihedral style table 2023-01-10 21:55:21 -05:00
7f82a58f51 auto loop optimizations 2023-01-10 21:55:21 -05:00
1caf074ba1 avoid excess string copy in auto loops 2023-01-10 21:55:20 -05:00
34677f78c2 initialize ADIOS dumps only the first time when used in multiple runs 2023-01-10 21:55:20 -05:00
e095609ac6 update lammps theme base theme from read-the-docs version 1.0.0 to 1.1.1 2023-01-10 21:54:35 -05:00
1122408957 dynamic cast whitespace 2023-01-10 21:53:53 -05:00
5f9b78ca01 update developer reference text 2023-01-10 21:53:09 -05:00
fe138fc75c add support for building/using the ADIOS package without MPI
This needs the ADIOS2 installation being configured accordingly.
2023-01-10 12:38:20 -05:00
31c324ff61 remove references to long obsolete .d dependency files 2023-01-10 12:32:22 -05:00
30564ed8b7 import traditional build system updates and fixes from develop branch 2023-01-10 12:16:59 -05:00
f05bfe45a8 Synchronize GitHub related files and settings with develop branch 2023-01-10 11:50:49 -05:00
88c8b6ec6f Merge pull request #3460 from akohlmey/maintenance-2022-06-23
Second round of maintenance fixes and backports for the stable release
2022-11-03 12:21:59 -04:00
f01e28f574 add missing parts to ELECTRODE package docs for traditional make. sync with upstream. 2022-10-27 16:29:28 -04:00
96627d27b1 add support to detect the BuildID of Windows 10 22H2 2022-10-27 12:56:30 -04:00
b3fc574a6a use googletest aliased targets consistently 2022-10-26 22:46:31 -04:00
8a3f7560c9 drop special OpenMP flags from presets. Will be detected by FindOpenMP. 2022-10-26 22:46:21 -04:00
8406e92a9a downgrade KOKKOS OpenMP check to version 3.1
need to apply special exception for NVHPC/PGI compilers
2022-10-26 22:46:13 -04:00
3b376b4448 modernize OpenMP detection and check for omp.h in CMake 2022-10-26 22:46:03 -04:00
ca3b7be623 add compatibility to VTK version 9.0 and above 2022-10-24 16:25:25 -04:00
c825c52d2f update required version 2022-10-23 03:45:57 -04:00
0ea0e4ce59 modernize calls to access the list of fixes in the Modify class 2022-10-23 03:16:26 -04:00
d53d4b4d99 use inline insertion sort for short array 2022-10-23 03:16:13 -04:00
b37cd14dd1 avoid superfluous calls to utils::strdup and improve error messages 2022-10-23 03:15:58 -04:00
a921a6bdc1 silence compiler warning about not copying the final null byte 2022-10-23 03:15:47 -04:00
51a0345941 Update fix_bond_react.rst 2022-10-23 03:15:35 -04:00
8d70960e2d bond/react: create atoms error check
check that post-reaction template has 'Coords' section if it has 'CreateIDs' section
2022-10-23 03:15:12 -04:00
5661703b30 Update pair_threebody_table.cpp
Correcting for hard coded ntheta = 79 in the extreme case that theta is exactly equal to 180.0 degrees.
2022-10-23 03:13:50 -04:00
bc30304f72 update plumed package version to 2.8.1 2022-10-22 23:01:47 -04:00
c76da483fb must bootstrap centos 7 from dockerhub now 2022-10-22 22:59:52 -04:00
036a1e47d2 replace one more suffix 2022-10-22 22:28:35 -04:00
5430c3b592 add workaround for missing links to fortran functions in sphinx output 2022-10-21 19:01:31 -04:00
9b7cb8200c small sphinx tweaks. require sphinx 5.2 or later. 2022-10-21 19:01:24 -04:00
550eedbb1f make Linux behavior default for loading Python shared lib
This adds portability to platforms like FreeBSD
2022-10-21 15:52:26 -04:00
3a058f278d Python support in ML-IAP requires NumPy. Check for it if CMake supports it. 2022-10-21 15:50:08 -04:00
0f7f0b5f86 find cythonize executable on recent FreeBSD versions 2022-10-21 11:39:02 -04:00
3de7534b84 try to make more portable (in case this ever gets ported to windows) 2022-10-21 11:38:50 -04:00
7065462faf add md5sums for plumed 2.7.5 and 2.8.1, update default version to 2.8.1 2022-10-21 11:38:40 -04:00
2e9d8e1ccb preserve pair/only package setting during clear command 2022-10-19 14:50:27 -04:00
19b84f7cbd delete atomfile variables when using the clear command 2022-10-19 14:44:10 -04:00
9b7c445a15 include non-buffered flag 2022-10-19 14:44:04 -04:00
91e56444ce add CMake check that will refuse compilation of unit tests or skip tests
This is mainly because the default compilers on RHEL/CentOS 7.x are
not sufficient to compile googletest. Also some Fortran module test
requires a working F90 module and others are more recent Fortran compiler.
2022-10-17 18:12:21 -04:00
9b3c8c36bd update version 2022-10-14 21:35:16 -04:00
3403520967 Fix issue with KSpace slab correction energy with non-neutral systems 2022-10-11 16:37:45 -04:00
d8f969f1df update python package requirements for building the manual 2022-09-30 20:18:05 -04:00
3487deccb6 update broken URLs 2022-09-27 08:03:11 -04:00
0926fc627d step update counter 2022-09-25 09:04:45 -04:00
7999778d94 initialize sllod fixes consistently 2022-09-25 07:02:35 -04:00
b4ef4c1ff2 correct indentation 2022-09-25 07:02:35 -04:00
72b08e4b87 backport dump fixes from develop 2022-09-25 07:02:28 -04:00
faa64a84e8 bugfixes and updates to the DIELECTRIC package from upstream 2022-09-09 19:42:01 -04:00
32b67fff2b print an error if the filename before '*' is too long for the regex matcher 2022-09-07 21:06:19 -04:00
f3dbf4122d extend the length to which the regex matcher checks strings to 256 chars. 2022-09-07 20:47:16 -04:00
e25ac786da must apply bond/angle offsets when determining shake bond/angle types 2022-09-05 10:52:06 -04:00
f30fba0061 support paths with blanks and avoid race condition when updating potentials 2022-09-02 21:33:30 -04:00
03f319604f recover dump_modify every behavior 2022-08-31 17:26:09 -04:00
0782dab1ec properly initialize result storage for per-chunk arrays 2022-08-29 13:04:40 -04:00
c43cce54ab re-initialize neighbor lists at end to clear out the occasional list entry 2022-08-28 11:47:27 -04:00
281a368702 correct pair coeff mixing diagnostic for CLASS2 pair styles 2022-08-28 05:51:38 -04:00
f28d69b429 bugfix for writing data files with atom style dielectric 2022-08-19 16:18:38 -04:00
e674e0c927 correctly handle the case where there are no atoms in the fix group 2022-08-14 03:53:02 -04:00
eebabf99b8 adjust location of local ref targets for recent sphinx versions 2022-08-05 22:09:01 -04:00
23a19f4431 need new CSS hack to hide duplicate headers derived from the navigation bar 2022-08-05 21:46:38 -04:00
d618b0ffc0 Merge pull request #3324 from akohlmey/maintenance-2022-06-23
First round of maintenance fixes for the stable release
2022-08-05 16:57:43 -04:00
ffc71b8733 energy is not an array 2022-08-05 08:23:23 -04:00
564df78698 fix typo 2022-08-05 08:22:59 -04:00
8db0b5ca39 fix index copy-n-paste error 2022-08-05 08:22:09 -04:00
79e26fe829 correct bond style bpm/rotational example 2022-08-05 03:24:29 -04:00
523d4b0242 correct issues in fix adapt and fix adapt/fep related to using fix STORE 2022-08-04 10:19:26 -04:00
fe39a3e581 Documentation updates for simulations including dipoles 2022-08-03 16:47:29 -04:00
081cc1f992 clarification on what constituets single, double, and triple quotes. 2022-08-03 01:51:43 -04:00
53c80c2c00 match pow(0,0) = 1.0 behavior in powint() 2022-07-31 18:52:08 -04:00
554b64a147 avoid deprecation warning and update PyPy package requirements 2022-07-30 17:37:35 -04:00
dc08dba592 update embedded search box 2022-07-28 18:58:58 -04:00
0eaa2775cd document missing call 2022-07-27 22:13:33 -04:00
852673ce41 fix off-by-one bug 2022-07-27 21:44:22 -04:00
8c711e405a correct make command line example 2022-07-27 08:38:37 -04:00
25b9f95061 add check on extracting elements twice from the library to avoid opaque error later 2022-07-26 15:01:03 -04:00
ee66a6f8c1 correct formatting 2022-07-26 12:34:05 -04:00
b694a5f582 add reference 2022-07-26 12:33:57 -04:00
7ab3fce93f correct typos 2022-07-26 12:33:48 -04:00
1f9509cb6f strip off -pendantic-errors flag when compiling with nvcc_wrapper to fix error compiling ML-PACE 2022-07-18 14:00:53 -04:00
cad1d8ece4 correct unit tests for dump local 2022-07-17 12:16:01 -04:00
b709d75f80 add support for dump_modify colname to dump local 2022-07-17 11:52:15 -04:00
5839909061 fix cut-n-paste error and improve error message 2022-07-17 11:46:51 -04:00
30f374de58 clarify 2022-07-16 06:42:19 -04:00
0f9fec05fb disallow use of variable functions vdisplace(), swiggle(), and cwiggle() with fix dt/reset 2022-07-16 06:42:11 -04:00
972a86f0ec fix cut-n-paste typo 2022-07-15 19:06:14 -04:00
7338ebfc94 Update Errors_warnings.rst 2022-07-15 12:28:07 -04:00
7132152693 Update Errors_messages.rst 2022-07-15 12:27:57 -04:00
c9925f64f7 cosmetic changes, silence warnings, avoid temporary char buffers 2022-07-15 12:27:48 -04:00
6da523c8b8 very-small-templates bugfix 2022-07-15 12:27:36 -04:00
0522284589 bugfix: specials update corner case 2022-07-15 12:27:26 -04:00
e10a66dabc allow ramp(x,y) to be used in between runs (returning x) and avoid division by zero on run 0 2022-07-15 05:41:12 -04:00
51dd631a76 Fix bug in vtk dump 2022-07-15 04:29:54 -04:00
d37249787e work around issues with Intel compilers compiling the GPU package 2022-07-12 00:38:51 -04:00
f44841de69 update unit test 2022-07-07 10:32:47 -04:00
54c5337d2d apply clang-format 2022-07-07 10:32:32 -04:00
efb0e63bf6 correct force and energy for excluded pairs 2022-07-07 10:32:20 -04:00
13d78c3afa Update Kokkos version in CMake 2022-07-04 10:49:03 -04:00
f2910b1d9c Update Kokkos library in LAMMPS to v3.6.1 2022-07-04 10:48:51 -04:00
78b22a64aa formatting corrections and minor tweaks to the Argon viscosity howto 2022-07-01 09:27:43 -04:00
8bb1880c9d Fixed temperature in argon GK example 2022-07-01 09:27:36 -04:00
e7b36c7b90 make certain to switch to the expected source folder when building n2p2 lib 2022-07-01 05:49:07 -04:00
d7804e3770 MPI may need to include multiple folders (e.g. on Ubuntu with OpenMPI) 2022-06-30 23:53:57 -04:00
8d0f9695d2 update googletest to version 1.12.1 2022-06-30 14:57:22 -04:00
52b2e4f364 add Update 1 string to version info 2022-06-29 17:44:29 -04:00
41140149ea whitespace 2022-06-29 17:06:11 -04:00
85e556ac8f add more unit tests for boolean expressions 2022-06-29 17:05:37 -04:00
cd5437a7e2 fix bug in recent bugfix 2022-06-29 17:05:27 -04:00
00cc82ac94 update and expand unit tests for if() command boolean evaluation 2022-06-29 17:04:49 -04:00
20f87e3f1d change boolean = single string to an error 2022-06-29 17:04:34 -04:00
97e34f0667 better error strings 2022-06-29 17:04:23 -04:00
3e5da9b09a more consistency checks 2022-06-29 17:04:12 -04:00
a62fcca7a4 Boolean expression corner case 2022-06-29 17:04:01 -04:00
778d59fa6b whitespace 2022-06-29 05:19:10 -04:00
3833a85d7a Add missing grow to Kokkos unpack_exchange 2022-06-29 05:17:55 -04:00
6d961ab29f Fix small memory leak in SNAP 2022-06-29 05:17:46 -04:00
001824e0f6 Small tweaks 2022-06-29 05:17:36 -04:00
953d32f9b3 Prevent view bounds error when a proc has no atoms 2022-06-29 05:17:26 -04:00
edba922665 Add missing GPU <--> CPU data transfer in minimize Kokkos 2022-06-29 05:17:17 -04:00
53806d4601 Add more missing Kokkos data movement 2022-06-29 05:17:06 -04:00
67597722d5 intergrate references to dump cfg/uef into the dump command docs 2022-06-25 06:19:04 -04:00
337794a9e9 add crosscompiling with MPI support to plugins package 2022-06-24 06:52:08 -04:00
5f5fb895ff add "package" target to support building a windows installer with NSIS 2022-06-24 01:25:54 -04:00
0302d03bc6 must set thirdparty download URL variable for downloading MPICH4Win 2022-06-23 23:20:49 -04:00
0a4fef369f may check for MPI library Fortran support only if MPI is enabled 2022-06-23 15:57:54 -04:00
7d5fc356fe Merge pull request #3311 from akohlmey/next-stable-release
Update stable branch to next stable release
2022-06-22 17:33:34 -04:00
8103e5a18f Merge branch 'release' into next-stable-release 2022-06-22 16:29:19 -04:00
ae18e1e01c Merge pull request #3310 from akohlmey/next_patch_release
Update version strings for the next patch release
2022-06-22 16:26:46 -04:00
ad35bbcb65 Merge pull request #3309 from akohlmey/collected-small-fixes
More fixes and small changes for the stable release
2022-06-22 15:16:01 -04:00
1099199e93 remove any remap related documentation. add paragraph about file compatibility 2022-06-22 14:22:23 -04:00
c5999df303 remove dead code and silence compiler warning about it 2022-06-22 10:32:03 -04:00
9b8c19c1a5 correct docs about how to get synchronized timings 2022-06-22 10:24:56 -04:00
2fb3608462 update/correct contact info 2022-06-22 07:06:16 -04:00
37f056c455 get array and vector sizes from the avaiable APIs 2022-06-22 07:06:00 -04:00
49331be33e simplify 2022-06-22 07:05:30 -04:00
3f6add4c40 Merge branch 'fortran2_updates' of github.com:hammondkd/lammps into collected-small-fixes
# Conflicts:
#	examples/COUPLE/fortran2/LAMMPS-wrapper.cpp
#	examples/COUPLE/fortran2/LAMMPS-wrapper.h
2022-06-22 06:41:37 -04:00
c0b109f715 Fixed some typos and updated e-mail addresses in examples/COUPLE/fortran2 2022-06-21 20:53:45 -05:00
b0c673d856 updates from Karl Hammond to adjust his email and correct an error message 2022-06-21 20:37:20 -04:00
b0f4ef8a39 update docs for noremap option to read_restart 2022-06-21 20:19:13 -04:00
7d49ad5924 enable remap for restarting by default, add noremap option 2022-06-21 19:42:17 -04:00
e5b56b67fe Merge branch 'next_patch_release' into next-stable-release 2022-06-21 09:00:40 -04:00
8ffb7e5f89 Merge branch 'collected-small-fixes' into next-stable-release 2022-06-21 09:00:31 -04:00
cb9ab48ce7 Merge branch 'develop' into next-stable-release 2022-06-21 09:00:12 -04:00
6815b27cd5 step version strings for the next patch release 2022-06-21 08:52:11 -04:00
ad20e54638 fix typos 2022-06-20 23:19:00 -04:00
ec46510d2e add local extract_compute() tests 2022-06-20 23:07:01 -04:00
033af0c507 add unit test for extracting local vector and array via numpy 2022-06-20 18:48:50 -04:00
78129f9078 update embedded docs for LMP_SIZE_VECTOR update for extract_compute() 2022-06-20 18:23:20 -04:00
ac615059a7 update some linewraps for 100 col limit 2022-06-20 18:15:02 -04:00
ffc5b12c5f correct handling data of local computes which always needs to check rows and cols 2022-06-20 18:10:57 -04:00
3828c857f7 accept LMP_SIZE_VECTOR as alias for LMP_SIZE_ROWS with local computes 2022-06-20 18:10:19 -04:00
063fc47f64 tweak to avoid test failure on FreeBSD 2022-06-19 06:38:14 -04:00
f831a776be correct python example 2022-06-18 22:25:32 -04:00
b46773e398 add support for writing a dump file footer 2022-06-17 15:53:04 -04:00
fe1feb58d8 Merge pull request #3306 from akohlmey/makewheel-fix
Fix issues with building a wheel file during 'make install-python'
2022-06-17 11:58:18 -04:00
deac9f05b1 move the created wheel to the build folder at the end 2022-06-17 08:05:28 -04:00
18f9e5836b support installing the built wheel into virtual environment, if active 2022-06-17 06:52:25 -04:00
21b3020a97 make the "makewheel.py" script independent from the activate_this.py script
The "activate_this.py" script only seems to be included in virtualenv,
but not venv. Now we implement its effect directly.
2022-06-17 00:10:06 -04:00
dd3aab0c66 Merge pull request #3300 from lammps/doc-package-update
Update package affiliation for Zhen Li
2022-06-16 18:04:45 -04:00
58152cdc68 Merge pull request #3304 from lammps/dependabot/github_actions/actions/cache-3
Bump actions/cache from 2 to 3
2022-06-16 17:48:30 -04:00
04bb611bf2 Merge pull request #3303 from lammps/dependabot/github_actions/actions/setup-python-4
Bump actions/setup-python from 2 to 4
2022-06-16 17:21:53 -04:00
2fc0a44ab2 Bump actions/cache from 2 to 3
Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-16 19:41:23 +00:00
ba4cbf7055 Bump actions/setup-python from 2 to 4
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 4.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-16 19:41:20 +00:00
f75115d801 Merge pull request #3301 from turrisxyz/Dependabot-GitHub-Actions
Included githubactions in the dependabot config
2022-06-16 15:40:59 -04:00
0a5d921f3f update affiliation in source code as well 2022-06-16 15:37:55 -04:00
cdc0b48a0b chore: Included githubactions in the dependabot config
This should help with keeping the GitHub actions updated on new releases. This will also help with keeping it secure.

Dependabot helps in keeping the supply chain secure https://docs.github.com/en/code-security/dependabot

GitHub actions up to date https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot

https://github.com/ossf/scorecard/blob/main/docs/checks.md#dependency-update-tool
Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
2022-06-16 01:33:01 +00:00
9840aad703 Merge pull request #3299 from akohlmey/fix-codeql-workflow
Update GitHub workflow files
2022-06-15 10:49:58 -04:00
1403a0dd94 update affilication for Zhen Li 2022-06-15 08:22:59 -06:00
9842879db1 fix typos 2022-06-15 08:14:53 -04:00
03c0b4ae27 upgrade action versions 2022-06-14 19:08:28 -04:00
728e4a5910 add permissions for codeql action 2022-06-14 19:08:01 -04:00
cfe5025495 Merge pull request #3296 from akohlmey/collected-small-changes
Collected small changes for the next release
2022-06-14 18:18:28 -04:00
927287e3e5 fixes from clang-tidy 2022-06-14 14:06:11 -04:00
35a48f273b rename local variable shadowing a global one 2022-06-14 10:45:31 -04:00
2028c68bec remove unused imports 2022-06-14 10:45:05 -04:00
6abb316dba avoid resource leak 2022-06-14 10:36:21 -04:00
7a64d1358e remove unused module 2022-06-14 10:36:11 -04:00
26dcb649bb remove redundant check 2022-06-13 22:10:51 -04:00
423c511d7a use explicit scoping in destructor 2022-06-13 22:10:43 -04:00
b44d769024 Merge branch 'collected-small-changes' of https://github.com/akohlmey/lammps into collected-small-changes 2022-06-13 22:01:54 -04:00
ea48dd3019 avoid file pointer leakage in dump reader base class. 2022-06-13 22:01:30 -04:00
0f5ae6d48c remove references to "plugin" options from fix mdi/aimd 2022-06-13 22:00:36 -04:00
c53e53d701 must set suffix variable only when suffixflag is true 2022-06-13 17:47:20 -04:00
33f4bb525b remove redundant condition 2022-06-13 17:43:40 -04:00
ef48fd2d9c remove unused imports 2022-06-12 23:36:43 -04:00
ed702aab05 update for renamed style names 2022-06-10 13:00:36 -04:00
82185046ae Merge pull request #3293 from stanmoore1/compute_ave_sphere_atom
Fix issues in compute ave/sphere/atom
2022-06-10 12:57:35 -04:00
ac48852b2d edits to 1st paragraph of description 2022-06-10 08:30:23 -06:00
495418158a Clarify doc page 2022-06-09 15:51:31 -06:00
5d7b1f3ebb fix small issues 2022-06-09 15:36:17 -06:00
80727e47f4 Add attribution 2022-06-09 15:31:48 -06:00
9be6e2a064 Use COM velocity 2022-06-09 15:29:40 -06:00
7f1e76b7a5 Don't compute count twice 2022-06-09 14:53:44 -06:00
174219383a Merge pull request #3290 from akohlmey/collected-small-changes
Collected small bugfixes and changes and plugin building improvements
2022-06-08 20:13:22 -04:00
1acfb78b3a Merge pull request #3295 from stanmoore1/kk_reax_tagint
Fix int32 overflow in Kokkos ReaxFF
2022-06-08 18:29:59 -04:00
483396c757 Merge branch 'collected-small-changes' of https://github.com/akohlmey/lammps into collected-small-changes 2022-06-08 18:06:59 -04:00
68a9db0950 fix typos 2022-06-08 17:07:08 -04:00
5fca9f4d1f update mathjax version with bugfix release 2022-06-08 17:04:26 -04:00
b6e0d76123 fix some docs formatting issues 2022-06-08 12:47:30 -04:00
7769a8e0de update ROCm to version 5.1.3 consistently 2022-06-08 12:18:17 -04:00
55fdb7f12a update GPU container definitions for CUDA 11.7 and singularity -> apptainer 2022-06-08 08:19:54 -04:00
42694ba640 reduce warnings when compiling with KOKKOS 2022-06-07 19:39:36 -04:00
d7680dd785 Fix int32 overflow in Kokkos ReaxFF 2022-06-07 10:11:39 -06:00
96b5a706da apply clang-format 2022-06-06 21:39:10 -04:00
67d367e714 Fix copy/paste bug 2022-06-06 15:28:40 -07:00
7e77b61042 simplify 2022-06-06 15:23:03 -07:00
5c68fe6e81 Fix issues in compute ave/sphere/atom 2022-06-06 15:15:47 -07:00
8f773be2d6 must open files for xtc dump in binary mode 2022-06-06 15:01:25 -04:00
dcbc5256fa additional OpenMP suppressions for newer GCC 2022-06-05 12:37:03 -04:00
b338781f88 cosmetic 2022-06-05 06:52:15 -04:00
b0d2cc3052 we can build a plugin instead 2022-06-04 19:23:32 -04:00
3af9546b94 provide README files with pointers to the developer info for plugins
also add a paragraph with information about the ML-PACE plugin to the
plugin developer info docs.
2022-06-04 11:49:33 -04:00
a232bd3302 refactor LAMMPS plugin building to share more code and to add a demo for ML-PACE 2022-06-04 10:59:25 -04:00
3beb071d38 make plugin compilation settings with MSVC consistent and more compile specific 2022-06-04 05:15:14 -04:00
0dc486c90b fix bug introduced during stringification 2022-06-04 05:00:28 -04:00
fa9ad10bc1 add missing line to read_data docs about atom style dielectric 2022-06-04 05:00:12 -04:00
25c74652e3 remove bogus tags 2022-06-04 04:25:13 -04:00
587438eb30 fix typo in read_data add merge example 2022-06-03 09:14:34 -04:00
7c4d77f776 tweak epsilon for portability 2022-06-03 07:36:25 -04:00
f9b5679c00 remove unused function arguments 2022-06-03 07:16:19 -04:00
f68247ad6a add ML-PACE and PLUGIN packages to be compiled with MinGW cross-compilers 2022-06-03 05:10:00 -04:00
1ebb1cee40 Merge branch 'release' into next-stable-release 2022-06-02 21:49:47 -04:00
ceb9466172 Merge pull request #3283 from akohlmey/next_patch_release
Step version strings for next patch release
2022-06-02 21:22:16 -04:00
2da61d69a1 Merge pull request #3289 from akohlmey/collected-small-changes
A few last minutes updates and fixes for the next patch release
2022-06-02 20:16:39 -04:00
31f7798720 Merge pull request #3278 from yury-lysogorskiy/feature/ml-pace-multispecies
ML_PACE package hybrid support and small updates
2022-06-02 19:27:53 -04:00
aad4d093b8 correctly handle the situation that the build folder may have multiple libs downloaded 2022-06-02 18:18:32 -04:00
ad97d18ac7 Merge pull request #3286 from Colvars/update-colvars-lepton
Update Colvars to 2022-05-24 and copy of Lepton library
2022-06-02 18:09:05 -04:00
4913c72795 Merge pull request #3288 from olavgal/clean_stress_cartesian
Clean stress cartesian
2022-06-02 17:19:19 -04:00
2a054c17be - set species type for NULL atom type to -1. species_type=-1 value will not reach ACE Evaluator::compute_atom, but if it will ,then error will be thrown there
- updating lib pace MD5SUM (for both make and cmake installation scenario), but use same tag name v.2021.10.25.fix2 (add override keyword to ACERadialFunctions, add check for species_type==-1, fix yaml_cpp CMakeLists.txt)
2022-06-02 23:01:54 +02:00
260a5f4d52 update false positives 2022-06-02 14:39:08 -04:00
90add188cb Merge pull request #3279 from schererc/develop
Addition of two new MANYBODY pair styles (sw/angle/table and threebody/table)
2022-06-02 14:24:44 -04:00
9d252fe0d2 remove error docs and apply clang-format 2022-06-02 12:57:45 -04:00
a74f64a737 do not allow per-atom arrays to shrink 2022-06-02 12:55:47 -04:00
fc468accf5 clang-format and removed more unused variables 2022-06-02 18:34:48 +02:00
954700dea5 Updated memory calculation and removed unused variables 2022-06-02 18:28:04 +02:00
2742517a4f Clean up of stress/cartesian 2022-06-02 18:26:09 +02:00
7a02043f18 update docs to list examples and include links to the tutorials 2022-06-02 12:11:10 -04:00
04586e634e Remove trailing whitespace from Lepton per suggestion from @akohlmey 2022-06-02 11:52:39 -04:00
6c375ffade Update PDF Colvars manual 2022-06-02 11:48:19 -04:00
3a1423dc48 Update Colvars to 2022-05-24 and copy of Lepton library
One bugfix for the Colvars library in the ABF method, and update of the copy
of the Lepton library as per the OpenMM repository.

List of relevant PR.

- 483 Update Lepton via patching procedure
  https://github.com/Colvars/colvars/pull/483 (@giacomofiorin)

- 482 Fix integer overflow in log_gradient_finite_diff and gradient_finite_diff
  https://github.com/Colvars/colvars/pull/482 (@HanatoK)
2022-06-02 11:24:04 -04:00
5a4688ed44 Update pair_pace.cpp 2022-06-02 09:05:15 -06:00
fdc8bcfbfc I removed the comment attributed to me, it is now outdated. 2022-06-02 09:03:16 -06:00
e214013a91 tweak epsilon to avoid failure on FreeBSD 2022-06-02 07:53:41 -04:00
8e415f0c00 try to enforce QUIP submodule update strategy 2022-06-01 22:26:35 -04:00
c028dcbdf7 small tweak 2022-06-01 22:14:04 -04:00
e36620059d simplify, apply clang-format 2022-06-01 22:08:35 -04:00
866391e830 modify so pair style pace will work as pair style hybrid substyle 2022-06-01 21:56:13 -04:00
9f021ba490 whitespace 2022-06-01 21:54:33 -04:00
c0bd4185f8 Merge branch 'develop' into feature/ml-pace-multispecies 2022-06-01 21:10:59 -04:00
30ae7fe66b Merge pull request #3285 from akohlmey/clang-format-clang-tidy
Apply clang-tidy and clang-format to update/modernize/simplify recently modified code
2022-06-01 19:04:43 -04:00
bf9b79b734 Merge pull request #3284 from stanmoore1/kk_3280
Port changes in #3280 to Kokkos
2022-06-01 18:54:58 -04:00
4bf90988e2 Fix bug when comparing equal tags 2022-06-01 14:52:07 -06:00
b45117655e move patch release date 2022-06-01 16:13:45 -04:00
217b070204 add unit tests 2022-06-01 15:31:49 -04:00
7d31544cc2 simplify and avoid memory access and leak issues in parallel 2022-06-01 15:04:28 -04:00
8a055fdcfa merge with third manybody table example and provide updated log files 2022-06-01 15:04:07 -04:00
b9b0d7207c apply clang-format 2022-06-01 14:24:23 -04:00
edea4fa9a2 fix memory allocation/communication issues. avoid memory leaks. 2022-06-01 14:23:30 -04:00
8e9071b01f move and update threebody/table examples 2022-06-01 14:22:53 -04:00
ee6e18f08e Merge branch 'develop' into schererc/develop 2022-06-01 12:07:06 -04:00
b85b3e1f4c fix doc file names and links 2022-06-01 12:06:56 -04:00
95a979c657 examples/PACKAGES: rename pair_sw_3b_table to pair_sw_angle_table
including all input and documentation files
2022-06-01 16:34:10 +02:00
e8d9bf0507 examples/PACKAGES: renamed pair_3b_table to pair_threebody_table
including all input and documentation files
2022-06-01 16:30:37 +02:00
3a19b1eb4b Update pair_style.rst
pair_style.rst: update due to name changes from 3b/table to threebody/table and sw/3b/table to sw/angle/table
2022-06-01 16:16:13 +02:00
f6fab8365a Update Commands_pair.rst
Commands_pair.rst: update due to name change from 3b/table to threebody/table and sw/3b/table to sw/angle/table
2022-06-01 16:14:37 +02:00
64d67f7604 Update pair_sw_angle_table.rst
pair_sw_angle_table.rst: minor correction
2022-06-01 16:12:13 +02:00
c1e301ac1a Update pair_3b_table.rst
changed documentation and file name from pair style 3b/table to threebody/table
2022-06-01 16:11:47 +02:00
a833baac80 Update pair_sw_angle_table.cpp
Minor correction in pair_sw_angle_table.cpp
2022-06-01 16:04:09 +02:00
187ccdd222 Update and rename pair_3b_table.cpp to pair_threebody_table.cpp
changed pair 3b/table to pair threebody/table including name of .cpp file
2022-06-01 16:03:06 +02:00
5756dedfed Update and rename pair_3b_table.h to pair_threebody_table.h
changed pair style and file name of header file from 3b/table to threebody/table
2022-06-01 15:52:46 +02:00
ebce66389e Update and rename pair_sw_3b_table.rst to pair_sw_angle_table.rst
changed documentation and file name from sw/3b/table to sw/angle/table
2022-06-01 14:24:40 +02:00
8dfa4a8682 Update and rename pair_sw_3b_table.cpp to pair_sw_angle_table.cpp
Changed .cpp file for pair style sw/3b/table to sw/angle/table
2022-06-01 14:20:30 +02:00
25f24fbab1 Update and rename pair_sw_3b_table.h to pair_sw_angle_table.h
Renamed header file from sw/3b/table to sw/angle/table
2022-06-01 14:11:32 +02:00
9da3dd796a delete undesired default members instead of making them inaccessible 2022-06-01 02:30:25 -04:00
5abb6c76af small tweak 2022-06-01 02:13:02 -04:00
ef6c48dad7 Whack tabs 2022-05-31 14:53:17 -06:00
b675372d99 Use MIN_SINE and add comment 2022-05-31 14:44:18 -06:00
234b9f180a use clang-tidy and clang-format to update/modernize/simplify code 2022-05-31 14:46:57 -04:00
3b4e698421 Merge branch 'develop' of github.com:lammps/lammps into kk_3280 2022-05-31 12:38:03 -06:00
77835a4258 Port changes in #3280 to Kokkos 2022-05-31 12:36:04 -06:00
7c0c7ce93c Merge pull request #3281 from akohlmey/collected-small-changes
Collected small changes for the next patch release
2022-05-31 13:10:35 -04:00
b8599ccb42 fix small local vs. ghost atom access inconsistency in pair style bop 2022-05-31 11:52:16 -04:00
de5c2629ac small tweak 2022-05-31 06:53:19 -04:00
3f332ab0c1 step version strings for next patch release 2022-05-31 06:51:13 -04:00
cc86e9e8a8 remove windows+gcc test (for now) 2022-05-29 19:56:39 -04:00
fa79a66734 feof() returns non-zero not necessarily 1 2022-05-29 19:53:11 -04:00
562cd12d82 revert github action build to LAMMPS repo and develop branch 2022-05-29 15:04:41 -04:00
90730f0d3c update windows version history 2022-05-29 02:01:21 -04:00
4c36c79652 remove feature for automatic jpeg/png/zlib library download and build
this is a post-stable feature and would require a general rewrite of offline processing
2022-05-28 15:20:22 -04:00
81c327edd8 add missing override. remove redundant functionality and disable warnings differently
this removes an inconsistent overload due to mismatch of arguments
2022-05-28 11:56:26 -04:00
d0edd7129c update workflows 2022-05-28 04:55:27 -04:00
3615639bdd Check for a working internet connection.
With this check we only do automatic downloads if the check passes
2022-05-28 04:55:10 -04:00
e2dd08a93e Better handle file- or path-names with spaces 2022-05-28 04:55:10 -04:00
5f811f852f stop with detailed parser error message with incorrect potential tables 2022-05-28 04:45:52 -04:00
886ad8359e use venv instead of virtualenv 2022-05-28 04:45:52 -04:00
0b3efa4dd6 set masses from BOP potential files, update unit tests accordingly 2022-05-28 04:45:52 -04:00
e91d1dba98 Merge pull request #3280 from athomps/reaxff-torsion-zero-sine
Eliminated bad torsion forces for sin(theta) = 0
2022-05-27 12:11:46 -04:00
cfb3d6bdf8 simplify, remove inactive code, plug memory leaks 2022-05-27 07:48:00 -04:00
3ecb6bb54a Update pair_3b_table.cpp
Added (forgotten) line "u=pm->mltable->efile[itable];" to compute energy due to read in table values
2022-05-27 12:34:53 +02:00
49a75d576e Eliminated bad torsion forces when when sin(theta) is zero 2022-05-26 17:28:05 -06:00
ab2b7a2c01 Merge pull request #3275 from akohlmey/collected-small-changes
Collected small changes and fixes
2022-05-26 18:07:43 -04:00
f09e4c7583 remove check on box size from pair style bop 2022-05-26 16:56:43 -04:00
587999fabb mention that MSM does not support shrink-wrap 2022-05-26 15:33:23 -04:00
f0f6660050 join lines 2022-05-26 12:15:27 -04:00
d9b560e70b properly integrate into manual 2022-05-26 12:08:21 -04:00
2a7407aa38 programming style updates 2022-05-26 11:41:51 -04:00
48f477e4b4 Update pair_sw_3b_table.rst
Small correction
2022-05-26 15:19:41 +02:00
e890e5718e examples/PACKAGES/pair_3b_table: added example for new pair style 3b/table 2022-05-26 14:45:22 +02:00
b8dfb23ede examples/PACKAGES/pair_sw_3b_table/README: corrections in the text 2022-05-26 14:32:12 +02:00
18c9960db0 examples/pair_sw_3b_table/README: minor correction 2022-05-26 14:25:24 +02:00
f9fbc7f94b doc/src/pair_3b_table.rst: documentation for added pair style 3b/table 2022-05-26 14:17:36 +02:00
27524742e5 src/MANYBODY/pair_3b_table.h, src/MANYBODY/pair_3b_table.cpp: added pair style for generic fully tabulated three-body forces which has been developed for simulations with Kernel-based machine learning potentials. 2022-05-26 14:16:26 +02:00
770454cb8b examples/PACKAGES/pair_sw_3b_table: added example for new pair style sw/3b/table 2022-05-26 14:00:06 +02:00
0e114b1041 doc/src/pair_sw_3b_table.rst: documentation for added pair style sw/3b/table 2022-05-26 13:35:40 +02:00
1cfba3d8bb src/MANYBODY/pair_sw_3b_table.h, src/MANYBODY/pair_sw_3b_table.cpp: added pair style sw/3b/table which is a modification of the SW pair style with tabulated angular potentials 2022-05-26 13:21:47 +02:00
1ae62793eb src/MANYBODY/pair_sw.h: made read_file(char *) virtual to allow overriding 2022-05-26 13:17:45 +02:00
dba9fdb1ef Merge branch 'develop' into collected-small-changes 2022-05-26 06:37:24 -04:00
2085c10002 update version of lib-pace to v.2021.10.25.fix2 2022-05-25 17:56:24 +02:00
f6680861a0 BUGFIX: bad array length: initialize maximum number of neighbours with max_jnum=0 2022-05-25 17:27:12 +02:00
7c2a548015 Merge pull request #3277 from erozic/feature-pylammps-verbose
Verbose object-level option for PyLammps
2022-05-25 10:57:58 -04:00
3ee209d031 update singularity definition for ubuntu22.04LTS
This now has the changes required to include the openkim-api package
2022-05-25 06:35:08 -04:00
c6c0b269ec Merge pull request #3276 from shankar1729/develop
Fixed TIP4P handling in PPPM slab correction.
2022-05-24 17:20:42 -04:00
1aaa9ca4ae Added documentation for verbose option 2022-05-24 12:02:34 +02:00
b66702c285 Added verbose class option + removed empty output lines 2022-05-24 11:37:44 +02:00
43b57b8aa5 update unit test reference data 2022-05-23 20:14:10 -04:00
ef80bb194a Fixed TIP4P handling in PPPM slab correction.
Overridded the slabcorr() function to handle the charge being on the TIP4P "M" site in the dipole calculation (and corresponding force correction). This is important for any long-range electrostatics in aqueous interfaces with the TIP4P model.
2022-05-23 17:28:32 -04:00
3662d998ee fix typo + cut-n-paste error 2022-05-23 11:53:58 -04:00
bead819070 changes missing from the previous commit 2022-05-23 11:37:00 -04:00
b461a49eee use _EXECUTABLE consistently instead of _BINARY 2022-05-23 11:14:17 -04:00
9f7833668a whitespace 2022-05-22 18:15:10 -04:00
0069c4b562 update docs for automatic jpeg/png/zlib library download and build with CMake 2022-05-22 18:10:26 -04:00
46df8abe75 rename jpeg cmake file for consistency 2022-05-22 17:49:54 -04:00
3c3c1377c8 Merge branch 'collected-small-changes' of github.com:akohlmey/lammps into collected-small-changes 2022-05-22 17:47:58 -04:00
d905d3fbf5 reorganize build settings and presets 2022-05-22 17:46:12 -04:00
1959cd7037 download, build, and link missing png and zlib libraries with CMake 2022-05-22 17:45:42 -04:00
7d3d986d18 download, build, and link a missing jpeg library with CMake 2022-05-22 14:03:20 -04:00
cd8bef3b0b enable and apply clang-format 2022-05-22 07:04:35 -04:00
9a973e67fa enable and apply clang-format 2022-05-22 06:46:24 -04:00
b407b2f239 apply clang-format 2022-05-21 23:35:47 -04:00
93692ce308 Improved Windows and Visual Studio version detection
This now uses the CurrentBuild key to detect the Windows version and only falls back to product name, if that fails.
This is needed because Windows 11 reports itself as Windows 10 in the product name key.
2022-05-21 23:33:13 -04:00
007588f9cb use GZIP executable variable name consistently 2022-05-21 18:56:58 -04:00
e3e849b266 skip compressed file format tests if gzip executable is not found 2022-05-21 07:37:25 -04:00
18df50356e Merge pull request #3273 from stanmoore1/kk_mem
Initial refactor of view allocation in Kokkos package
2022-05-20 16:34:28 -04:00
c3ce77bc8c improve energy scaling sanity checks 2022-05-20 16:33:46 -04:00
2c5ce83d59 must set Output::next_dump_any to current step with rerun 2022-05-20 09:27:16 -04:00
7eb926c853 clarify the description of pair style none
explain that pair style none is effectively deleting any existing
pair style and that communication and neighbor list cutoff are affected.
update those explanations for changes to LAMMPS that allow adjusting
those not just with the neighbor list skin.
Also add that pair_coeff must not be used.
2022-05-20 07:14:05 -04:00
08b1034d54 enable and apply clang-format 2022-05-20 07:12:25 -04:00
a16974ca48 enable and apply clang-format 2022-05-20 06:51:36 -04:00
21c2f8a74b fix miscalculated example 2022-05-20 01:06:21 -04:00
814daf7f4f fix cut-n-paste error 2022-05-20 01:06:09 -04:00
bfb126ec7c make neighbor list searches optionally check for the request ID 2022-05-19 23:37:55 -04:00
07e93a643a spelling 2022-05-19 23:36:54 -04:00
13fc4f3588 must install wheel package before all other packages 2022-05-19 23:07:12 -04:00
36d091baeb fix underline 2022-05-19 23:06:54 -04:00
4801fa00f8 update MathJax to latest bugfix release 2022-05-19 22:53:48 -04:00
75df9d4f2c Merge pull request #3271 from akohlmey/collected-small-changes
Collected small changes and fixes
2022-05-19 13:27:28 -04:00
a9431208a2 Use c++11 variadic magic, suggested by @weinbe2 2022-05-19 10:35:10 -06:00
7b0c7c04ed address sphinx issues and make command list consistently list all min styles 2022-05-19 12:21:06 -04:00
2138aea01f Merge branch 'two-command-tables' into collected-small-changes 2022-05-19 12:16:37 -04:00
7e75b7bff5 whitespace 2022-05-19 12:16:31 -04:00
5990241fbe refactor min_style spin doc page 2022-05-19 09:13:47 -06:00
d8d6884def Remove use_count check, reduce memory use in ReaxFF 2022-05-19 09:10:20 -06:00
eb4c1cd14f update attempt to hide hwloc pci bus warnings 2022-05-19 07:28:57 -04:00
361e303177 fix cut-n-paste error 2022-05-19 04:14:31 -04:00
898eda794c minor updates 2022-05-19 00:06:11 -04:00
5ac8e5639a more information about compiling LAMMPS on windows 2022-05-19 00:06:00 -04:00
cb2126f313 Merge branch 'collected-small-changes' of github.com:akohlmey/lammps into collected-small-changes 2022-05-18 23:21:52 -04:00
0c73c9307f Add configurations for Intel Compilers on Windows 2022-05-18 23:20:57 -04:00
c0a8458d89 remove unused class members 2022-05-18 22:06:31 -04:00
b5830aae83 suppress excessive warnings and undesired aborts with Intel LLVM compiler 2022-05-18 21:43:09 -04:00
06ad119844 Initial refactor of view allocation in Kokkos package 2022-05-18 17:15:36 -06:00
fa6c81849b split Command table into two tables 2022-05-18 16:26:58 -06:00
d323b7817d put back some whitespace 2022-05-18 14:59:15 -04:00
eb3ee96b9c also apply 2 atom minimum to balance() and packing atom IDs 2022-05-18 14:22:43 -04:00
bfd6efcedb no need to sort dump if there are less than 2 atoms 2022-05-18 13:48:06 -04:00
c16f40eb7c don't enable OpenMP together with CUDA for KOKKOS by default 2022-05-18 12:23:38 -04:00
acbeae075a no need to suppress nvcc warnings about pragmas with Clang as host compiler 2022-05-18 12:17:06 -04:00
4f45ae2ef6 improve support for intel compilers on windows 2022-05-18 09:14:18 -04:00
5559491d7b add missing overrides 2022-05-18 09:13:52 -04:00
ba0efbef31 include presets for intel compiler names on windows 2022-05-18 09:13:37 -04:00
7646592f05 recognize the new LLVM based intel compiler as intel compiler 2022-05-18 08:54:26 -04:00
02908f0468 modernize MKL FFT interface 2022-05-18 08:42:40 -04:00
6475d4b956 Skip Fortran unittests if no Fortran MPI support is found 2022-05-18 07:16:16 -04:00
f0e7101bd2 Merge branch 'develop' into next-stable-release 2022-05-18 06:35:57 -04:00
d54f97736e whitespace 2022-05-18 06:32:52 -04:00
1466620750 update googletest to the latest github commit 2022-05-18 06:09:42 -04:00
baa48946e5 add comment to please CodeQL 2022-05-18 00:56:10 -04:00
e7b9d03573 crank up epsilon for tip4p/cut styles some more 2022-05-18 00:28:42 -04:00
d8b37601a8 Merge pull request #3262 from akohlmey/collected-small-changes
Collected small changes and fixes
2022-05-18 00:11:05 -04:00
d94bcd043b enforce using a single thread with Kokkos and SNAP or PACE 2022-05-17 23:42:24 -04:00
15a727a7ff avoid segfaults with Kokkos threads 2022-05-17 23:41:46 -04:00
e94275391c Merge branch 'develop' into collected-small-changes 2022-05-17 22:10:15 -04:00
935c9a02d7 Merge pull request #3267 from athomps/born-rotated
Added Python wrapper that handles rotations to and from LAMMPS frame
2022-05-17 19:52:52 -04:00
55e0af930b Merge pull request #3269 from yury-lysogorskiy/master
Update ML-PACE installation to v.2021.10.25.fix version
2022-05-17 19:50:49 -04:00
a5171beacd make lammps-shell test compatible with MULTI-CONFIG CMake builders 2022-05-17 18:26:27 -04:00
72209b0617 Merge pull request #3258 from akohlmey/create-atoms-mesh
Create atoms from STL mesh
2022-05-17 18:11:41 -04:00
899764c00c Merge pull request #3268 from akohlmey/update-kappa-example
Update KAPPA example
2022-05-17 17:18:45 -04:00
cebbd471cf tweak unit test epsilon for portability to MacOS /w ARM 2022-05-17 17:15:42 -04:00
8ffe2a206c Update ML-PACE installation to v.2021.10.25.fix version 2022-05-17 22:41:43 +02:00
f9efa426a7 Merge pull request #3256 from lammps/delete-atoms-exact
Delete atoms exactly by fraction or count
2022-05-17 16:25:21 -04:00
ae979aca4e consistently use prefactor instead of pre-factor (the former was more common) 2022-05-17 16:20:10 -04:00
38d7fcee92 correct and update create_atoms mesh documentation 2022-05-17 16:16:32 -04:00
e7d072c593 add sanity check on radscale value, set radius also for quasi-random mode 2022-05-17 16:15:46 -04:00
d487ab10e2 doc page and unittest tweaks 2022-05-17 12:00:40 -06:00
853e3ae99b fix typo and clarify error message 2022-05-17 13:52:29 -04:00
dbb3e75f24 change partial to random 2022-05-17 11:02:42 -06:00
fe4782696e silence compiler warnings 2022-05-17 06:03:01 -04:00
326b833d7f (temporarily) disable Kokkos deprecation warnings in CMake presets in preparation for stable release 2022-05-17 06:02:50 -04:00
bf98df3264 silence compiler warnings 2022-05-16 23:20:04 -04:00
df40732343 Make cast to double explicit 2022-05-16 15:00:13 -04:00
d32885fbe3 Fix compiler warnings 2022-05-16 14:48:02 -04:00
659fd82a9e Fix compiler warnings 2022-05-16 14:35:24 -04:00
db2d5b863d Improved MPI portability and added reference log files 2022-05-16 08:22:45 -06:00
ee8a8b6cd0 Added Python wrapper that handles rotations to and from LAMMPS frame 2022-05-15 17:43:18 -06:00
b1ba616470 update KAPPA example for current code, to use thermo_modify colname, and compute kappa in input 2022-05-15 18:58:50 -04:00
44f3ad5620 update singularity image descriptions for newer versions of cuda and rocm 2022-05-15 08:11:50 -04:00
c0e5a03989 update tests for delete_atoms 2022-05-15 01:56:59 -04:00
f62363516c streamline the refactored interface for delete_atoms partial some more 2022-05-15 01:56:45 -04:00
8e6b0425f7 apply clang-format 2022-05-14 18:01:34 -04:00
a79814793e improve handling of hybrid styles and their arguments and errors 2022-05-14 17:56:44 -04:00
1f30d3f140 programming style 2022-05-14 17:56:12 -04:00
1b552de1cd make default settings() functions for bonded interactions error out with arguments 2022-05-14 17:55:56 -04:00
42a4fba390 implement better checking for atom_style arguments and remove redundant code 2022-05-14 15:43:11 -04:00
173e80a970 Merge pull request #71 from jtclemm/create-atoms-mesh
Fixing typos and cleaning up quasirandom comments
2022-05-14 15:13:27 -04:00
55fef9a482 Fixing typos and cleaning up quasirandom comments 2022-05-14 11:39:20 -06:00
9a9bb749fa Merge remote-tracking branch 'github/develop' into collected-small-changes 2022-05-14 10:39:18 -04:00
223aebe3fb Merge pull request #3251 from stanmoore1/kk_update_3.6.0
Update Kokkos library in LAMMPS to v3.6.0
2022-05-14 10:38:41 -04:00
168d3bdd3c Correctly handle the case that the YAML python module is not installed 2022-05-14 10:15:40 -04:00
9661711a1e avoid out-of-bounds access in dump style cfg, update docs with simpler semantic 2022-05-14 09:39:50 -04:00
d4ea5ca49e more clang-tidy fixes after re-running it with added settings 2022-05-14 07:18:05 -04:00
2f0baa86d6 configure desired clang-tidy settings explicitly, must unset variable to turn off 2022-05-14 07:13:25 -04:00
b8a4ddc42a Merge pull request #3264 from stanmoore1/kk_pace_release
Add Kokkos version of ML-PACE
2022-05-13 23:36:05 -04:00
90797d53d9 one more batch of clang-tidy fixes 2022-05-13 23:21:14 -04:00
940e88d2ca more clang-tidy fixes 2022-05-13 21:12:48 -04:00
9c16819305 update code with clang-tidy fixes 2022-05-13 18:26:38 -04:00
3782eea7c4 must always compile MDI library with position independent code 2022-05-13 18:25:59 -04:00
056fd8be8f always build yaml-cpp included in PACE as static library 2022-05-13 17:00:37 -04:00
59560c47a7 Small tweak 2022-05-13 14:23:27 -04:00
979f84f96f Merge branch 'develop' of https://github.com/lammps/lammps into kk_update_3.6.0 2022-05-13 14:03:09 -04:00
66abc00e3c Add comment about MPI on Crusher 2022-05-13 13:33:27 -04:00
c41ad91a9d add support for reading binary STL files 2022-05-13 12:18:22 -04:00
545cec1785 Fix copy/paste issue 2022-05-13 10:15:25 -06:00
658a89e401 document .lammpsbin suffix for trajectory files 2022-05-13 11:15:06 -04:00
35dd5bc978 fix typo 2022-05-13 03:00:31 -04:00
90e2d9e966 tweak code comments 2022-05-12 16:51:24 -06:00
042564decd add deprecation info for old porosity option 2022-05-12 16:48:03 -06:00
3eea2463a1 Tweak error message 2022-05-12 16:00:22 -06:00
d207d53fd1 whitespace 2022-05-12 15:34:08 -06:00
d7bad09d35 Add Kokkos version of ML-PACE 2022-05-12 15:25:07 -06:00
58093fec99 accept .lammpsbin in addition to .bin for binary format output 2022-05-12 15:26:39 -04:00
4077c5c8ba add get_dump_by_id() API that mirrors other recent additions 2022-05-12 14:48:03 -04:00
0577bb6269 use Output::add_dump() and the dump_creator map and templates etc. 2022-05-12 14:47:16 -04:00
aff72c56a5 make Output::add_dump() return pointer to the created dump 2022-05-12 14:46:02 -04:00
c3a454370e work around "fix not computed at compatible times" errors with write_dump 2022-05-12 14:12:13 -04:00
301bd95900 small tweak 2022-05-12 13:17:51 -04:00
04537c9f22 Merge pull request #3263 from OrbitalC/compute_mliap_so3
adding so3 descriptor support for compute_mliap
2022-05-12 11:01:01 -04:00
5ad821ca5e apply clang-format 2022-05-12 09:24:37 -04:00
78d976bd36 Merge pull request #3260 from Colvars/colvars-update
Update Colvars to version 2022-05-09
2022-05-12 08:40:29 -04:00
371141f915 adding support for compute_mliap so3 2022-05-12 14:12:57 +02:00
3ea249a576 fix minor documentation issues 2022-05-11 13:23:59 -04:00
4cc3bdd35f adjust keyword/function names and command line to be simpler to use 2022-05-11 09:25:27 -04:00
227c4853f1 programming style 2022-05-11 08:13:13 -04:00
442116b305 update 2022-05-11 08:12:59 -04:00
ef3b90e838 Merge pull request #70 from jtclemm/create-atoms-mesh
Adding quasirandom mesh option
2022-05-11 08:12:18 -04:00
c9d350edc2 Adding quasirandom mesh option 2022-05-10 18:35:36 -06:00
bdbab77286 add note about re-generating optimized meshes for STL files 2022-05-10 15:23:54 -04:00
1220bea011 Update Colvars to version 2022-05-09
This update includes one new feature (neural-network based collective
variables), several small enhancements (including an automatic definition of
grid boundaries for angle-based CVs, and a normalization option for
eigenvector-based CVs), bugfixes and documentation improvements.

Usage information for specific features included in the Colvars library
(i.e. not just the library as a whole) is now also reported to the screen or
LAMMPS logfile (as is done already in other LAMMPS classes).

Notable to LAMMPS code development are the removals of duplicated code and of
ambiguously-named preprocessor defines in the Colvars headers.  Since the
last PR, the existing regression tests have also been running automatically
via GitHub Actions.

The following pull requests in the Colvars repository are relevant to LAMMPS:

- 475 Remove fatal error condition
  https://github.com/Colvars/colvars/pull/475 (@jhenin, @giacomofiorin)

- 474 Allow normalizing eigenvector vector components to deal with unit change
  https://github.com/Colvars/colvars/pull/474 (@giacomofiorin, @jhenin)

- 470 Better error handling in the initialization of NeuralNetwork CV
  https://github.com/Colvars/colvars/pull/470 (@HanatoK)

- 468 Add examples of histogram configuration, with and without explicit grid parameters
  https://github.com/Colvars/colvars/pull/468 (@giacomofiorin)

- 464 Fix #463 using more fine-grained features
  https://github.com/Colvars/colvars/pull/464 (@jhenin, @giacomofiorin)

- 447 [RFC] New option "scaledBiasingForce" for colvarbias
  https://github.com/Colvars/colvars/pull/447 (@HanatoK, @jhenin)

- 444 [RFC] Implementation of dense neural network as CV
  https://github.com/Colvars/colvars/pull/444 (@HanatoK, @giacomofiorin, @jhenin)

- 443 Fix explicit gradient dependency of sub-CVs
  https://github.com/Colvars/colvars/pull/443 (@HanatoK, @jhenin)

- 442 Persistent bias count
  https://github.com/Colvars/colvars/pull/442 (@jhenin, @giacomofiorin)

- 437 Return type of bias from scripting interface
  https://github.com/Colvars/colvars/pull/437 (@giacomofiorin)

- 434 More flexible use of boundaries from colvars by grids
  https://github.com/Colvars/colvars/pull/434 (@jhenin)

- 433 Prevent double-free in linearCombination
  https://github.com/Colvars/colvars/pull/433 (@HanatoK)

- 428 More complete documentation for index file format (NDX)
  https://github.com/Colvars/colvars/pull/428 (@giacomofiorin)

- 426 Integrate functional version of backup_file() into base proxy class
  https://github.com/Colvars/colvars/pull/426 (@giacomofiorin)

- 424 Track CVC inheritance when documenting feature usage
  https://github.com/Colvars/colvars/pull/424 (@giacomofiorin)

- 419 Generate citation report while running computations
  https://github.com/Colvars/colvars/pull/419 (@giacomofiorin, @jhenin)

- 415 Rebin metadynamics bias from explicit hills when available
  https://github.com/Colvars/colvars/pull/415 (@giacomofiorin)

- 312 Ignore a keyword if it has content to the left of it (regardless of braces)
  https://github.com/Colvars/colvars/pull/312 (@giacomofiorin)

Authors: @giacomofiorin, @HanatoK, @jhenin
2022-05-10 11:24:54 -04:00
5760c59d83 add a creator: tag to the YAML dump that allows to tell it apart 2022-05-10 08:31:02 -04:00
b6ee64dc12 Merge branch 'collected-small-changes' of github.com:akohlmey/lammps into collected-small-changes 2022-05-09 21:58:48 -04:00
eb44cbf848 small updates 2022-05-09 15:22:48 -04:00
23e17363f9 Merge remote-tracking branch 'github/doc-variable-extract-settings' into collected-small-changes 2022-05-09 15:03:13 -04:00
6344c667a0 more doc info for variable extrat_setting() func 2022-05-09 09:33:59 -06:00
24ef021fe0 fix typo 2022-05-09 10:05:12 -04:00
1660bae22a add examples import one image to manual 2022-05-08 21:15:32 -04:00
9ec35f0235 update docs to match the latest code 2022-05-08 19:14:06 -04:00
e0bb27dbb2 make radscale and radthresh class members 2022-05-07 23:04:34 -04:00
e9b1ca16a3 correctly initialize radius and molecule id 2022-05-07 21:24:08 -04:00
60b9fd2db8 minor tweaks simplify algorithm 2022-05-07 17:08:22 -04:00
bcfb6734f3 use average vertex distance from center as particle radius 2022-05-07 16:27:03 -04:00
6722d3fb00 add simple STL binary to ASCII converter (based on Wikipedia specs) 2022-05-07 16:26:25 -04:00
559dc68197 implement revised algorithm with recursion 2022-05-07 15:40:25 -04:00
102b61ae1b Merge branch 'develop' into create-atoms-mesh 2022-05-07 09:33:40 -04:00
5d08b62622 remove unused class member 2022-05-07 03:48:54 -04:00
4737b9efb7 Merge pull request #3250 from akohlmey/collected-small-changes
Collected small changes and bugfixes
2022-05-07 00:14:32 -04:00
d21d9d95fa Merge pull request #3255 from lammps/timer-variable
Add a timer-style variable
2022-05-06 17:46:22 -04:00
00bb566893 enforce that the number of neighbors cannot be negative (e.g. w/o neighbor list) 2022-05-06 17:45:01 -04:00
56e36a5df5 Merge pull request #2988 from stanmoore1/coo_opt
Add optimized version of compute orientorder/atom from Tomas Oppelstr…
2022-05-06 17:11:24 -04:00
21d3de65e6 fix typos 2022-05-06 17:05:18 -04:00
767f512dcf add "make ni" alias to "make no-installed" 2022-05-06 17:05:03 -04:00
907bc7eaa5 switch to using wall time 2022-05-06 16:58:28 -04:00
051c243cfc small programming style upgrade, apply clang-format, silence compiler warnings 2022-05-06 16:44:13 -04:00
905034893c finished testing of new delete_atoms options 2022-05-06 14:15:41 -06:00
6432660bc9 Merge branch 'develop' of https://github.com/lammps/lammps into coo_opt 2022-05-06 13:24:14 -06:00
6e78269612 whitespace 2022-05-06 15:11:15 -04:00
81a8b0cf85 Add Kokkos HIP preset 2022-05-06 12:40:12 -06:00
613ef04357 Merge branch 'develop' into timer-variable 2022-05-06 14:27:52 -04:00
5986e11d43 Merge branch 'develop' of github.com:lammps/lammps into kk_update_3.6.0 2022-05-06 12:04:00 -06:00
97012f2aaa correct classification of electrode package, as it requires BLAS/LAPACK 2022-05-06 13:57:26 -04:00
62a819d7b6 Tweak launch bounds to improve GPU performance 2022-05-06 13:37:05 -04:00
3bb9c64f9e update .gitignore and move electrode package for dependency on KSPACE 2022-05-06 13:35:51 -04:00
78f2907cbb implement a "make no-installed" command 2022-05-06 13:35:21 -04:00
f3fcd16628 adding of timer-style variables and associated doc pages 2022-05-06 11:21:36 -06:00
580e01535a Update Kokkos AMD Makefiles 2022-05-06 13:04:58 -04:00
8e423f07c5 Merge branch 'collected-small-changes' of github.com:akohlmey/lammps into collected-small-changes 2022-05-06 12:37:34 -04:00
2549b86d76 update/correct docs for support of compiling LAMMPS with visual studio on windows 2022-05-06 12:37:28 -04:00
ae73a9b7f7 Revert back to original code in npair_ssa_kokkos.h 2022-05-06 10:05:57 -06:00
73670dafc7 Merge branch 'develop' into collected-small-changes 2022-05-06 11:45:51 -04:00
aae44892c0 consolidate all FFT related redundant defines and typedefs in a single header 2022-05-06 11:27:17 -04:00
6ec169fa9d Fix warnings in Kokkos package 2022-05-06 08:23:45 -06:00
a35a2441ce Merge branch 'collected-small-changes' of github.com:akohlmey/lammps into collected-small-changes 2022-05-06 04:48:19 -04:00
abefff828d plug memory leak 2022-05-06 04:39:38 -04:00
71185b9f98 fix error message 2022-05-06 01:02:40 -04:00
8079f014bc final tweaks 2022-05-06 00:47:35 -04:00
773e3a87d9 add docs for create_atoms mesh 2022-05-06 00:47:05 -04:00
ff21142042 Merge remote-tracking branch 'github/develop' into create-atoms-mesh 2022-05-05 23:02:53 -04:00
bd373d6038 Merge pull request #3119 from erozic/feature-create-atoms-exclude
Feature create atoms overlap
2022-05-05 22:42:40 -04:00
7601a5c0fb correct/improve formatting 2022-05-05 22:20:43 -04:00
8ed401ce12 spelling 2022-05-05 21:34:31 -04:00
664943589e Merge remote-tracking branch 'github/develop' into feature-create-atoms-exclude 2022-05-05 21:09:39 -04:00
8dbfc0799c whitespace 2022-05-05 20:15:36 -04:00
46d638af0c Merge branch 'feature-create-atoms-exclude' of https://github.com/erozic/lammps into feature-create-atoms-exclude 2022-05-06 01:48:37 +02:00
ae230a33f5 Bug fix (user_quat initial value not set) 2022-05-06 01:47:45 +02:00
d4f212183e initial exact logic for delete_atoms partial 2022-05-05 17:45:42 -06:00
568e9c5878 Merge pull request #3237 from emilyviolet/hipfft
Add support for hipFFT with PPPMKokkos
2022-05-05 19:39:52 -04:00
5784fab588 starting to add timer-style variable 2022-05-05 17:04:50 -06:00
484a7c5db0 tweaked comments 2022-05-05 16:22:19 -06:00
7071f819d0 Header fix (add_molecule) 2022-05-05 23:53:14 +02:00
93c0f09c31 Logic fix in random-overlap and comment implemented 2022-05-05 23:35:11 +02:00
e5e3478afd Update CMake 2022-05-05 12:30:37 -06:00
bee7b09377 fix cut-n-paste bug 2022-05-05 14:05:22 -04:00
3b68c0ea24 Update Makefile comment 2022-05-05 14:02:29 -04:00
b79c0bc7b4 Update Kokkos library in LAMMPS to v3.6.0 2022-05-05 11:44:47 -06:00
3b9389e86c Update .gitignore 2022-05-05 12:23:52 -04:00
2c95f84acc Tweak error messages 2022-05-05 12:17:00 -04:00
c05af749df Merge branch 'develop' of https://github.com/lammps/lammps into hipfft 2022-05-05 12:15:28 -04:00
24b94551a2 Update Kokkos AMD Makefiles 2022-05-05 11:59:32 -04:00
99d4f83fa8 preliminary implementation 2022-05-05 09:56:22 -04:00
6c28b55c13 return nullptr instead of out-of-range data 2022-05-05 07:50:45 -04:00
2b1716cb3a fix more bugs with dump_modify every/time 2022-05-05 00:06:08 -04:00
bd4bbbddbe Merge pull request #3245 from akohlmey/next_patch_release
Step version strings for the next patch release
2022-05-04 19:57:23 -04:00
2aa1c6975f fix typo 2022-05-04 19:09:19 -04:00
e285ba43eb Merge branch 'develop' into next_patch_release 2022-05-04 19:08:10 -04:00
582de4f951 Merge pull request #3248 from akohlmey/add_set_time
Add time option to the "reset_timestep" command and make the "time" property restartable
2022-05-04 18:43:07 -04:00
dcd6c18e45 update indent 2022-05-04 17:50:34 -04:00
4c6cb8648b replace image with embedded latex text 2022-05-04 17:50:25 -04:00
6b47d6246b more changes and some debugging on a test script 2022-05-04 15:28:50 -06:00
cc437c78a0 some logic and syntax changes to code and doc page 2022-05-04 14:34:05 -06:00
edda6b6f70 Merge remote-tracking branch 'github/develop' into add_set_time 2022-05-04 16:29:54 -04:00
803376b1b4 Merge pull request #3241 from akohlmey/collected-small-changes
Collected small changes and fixes for the next patch release
2022-05-04 16:26:02 -04:00
e897ab7611 improve error messages 2022-05-04 16:25:12 -04:00
ba3aa8fab5 remove NULL option for reset_timestep 2022-05-04 16:21:06 -04:00
81bb4bfc23 Merge branch 'collected-small-changes' into add_set_time 2022-05-04 15:49:14 -04:00
059c84bf41 Merge branch 'develop' into add_set_time 2022-05-04 15:47:28 -04:00
eec86c8038 Merge branch 'develop' into collected-small-changes 2022-05-04 15:45:38 -04:00
ad6cebb049 Merge pull request #3246 from GenieTim/compute-abs-sum
Implement a aveabs and sumabs reduce command
2022-05-04 14:46:54 -04:00
61214b9a52 Merge pull request #3243 from akohlmey/delete-by-variable
Implement variable option for delete_atoms
2022-05-04 13:50:00 -04:00
f8742d599b merge set_time command into reset_timestep 2022-05-04 13:24:52 -04:00
d4a93ff9c7 Merge pull request #3247 from vladgl/adp-kk
Kokkos accelerated variant for adp pair style
2022-05-04 13:05:29 -04:00
517d934f7c more edits 2022-05-04 10:51:00 -06:00
87b99306ba make force_clear() a public pure function in min.h and integrate.h
these are required changes for adding NWChem couping support as a fix
2022-05-04 12:30:17 -04:00
af32267db3 Merge branch 'develop' into compute-abs-sum 2022-05-04 12:23:50 -04:00
7fa2fe134c Fix typo 2022-05-04 10:18:11 -06:00
515e2928a9 Sync with pair eam 2022-05-04 10:15:36 -06:00
8a5e7fa609 update docs 2022-05-04 12:07:59 -04:00
ed0ee913e1 Small tweaks 2022-05-04 11:18:10 -04:00
a26fa50736 Merge branch 'collected-small-changes' of github.com:akohlmey/lammps into collected-small-changes 2022-05-04 05:47:34 -04:00
5d510ac7b3 Merge remote-tracking branch 'akohlmey/region-tests' into collected-small-changes 2022-05-04 05:46:34 -04:00
c37d5be524 Merge branch 'develop' into collected-small-changes 2022-05-04 05:45:33 -04:00
0bedff1ce0 implement set_time command 2022-05-03 13:15:52 -04:00
e7153d30c8 re-enable dynamic group support for tally computes 2022-05-03 11:22:38 -04:00
257a070666 add test for ellipsoid, check for special case of ellipsoid/prism 2022-05-03 11:02:01 -04:00
bd5858019e add minimal unit test for Region class 2022-05-02 17:06:28 -04:00
4ef8ca091d Fix virial computation in adp/kk 2022-05-02 22:16:28 +03:00
8473bc19f5 Merge branch 'develop' into adp-kk 2022-05-02 13:41:03 -04:00
df77641071 fix permissions and whitespace 2022-05-02 13:40:39 -04:00
cb345870a9 Add adp/kk to install script (fix commit #d3843db) 2022-05-02 19:24:01 +03:00
d3843dbf09 Add adp/kk to install script 2022-05-02 19:16:59 +03:00
fef6c37ea7 Merge pull request #3240 from akohlmey/ave-yaml-file-colname
Add support for custom column names and YAML format output to fix ave/time
2022-05-02 11:45:50 -04:00
0e5a66b1cd Implement a aveabs and sumabs reduce command 2022-05-02 17:34:08 +02:00
e51c51e7f9 Kokkos accelerator variant for adp pair style 2022-05-02 18:17:49 +03:00
39ee6b6a7f step version strings for the next patch release 2022-05-02 10:34:43 -04:00
89deab6a3e silence compiler warnings 2022-04-30 19:51:04 -04:00
1191d08b47 Merge branch 'develop' into collected-small-changes 2022-04-30 19:39:16 -04:00
deef9fae23 fix bug with wrong mapping of pair style classes 2022-04-30 19:15:00 -04:00
1b8641685a Merge pull request #3242 from dxhisboy/develop
Adding saip/metal/opt and ilp/tmd/opt
2022-04-30 12:59:41 -04:00
672c063fd8 add unit test for delete_atoms 2022-04-29 22:33:15 -04:00
2f599bace1 enable and apply clang-format 2022-04-29 22:01:34 -04:00
f5113aa84a better error messages 2022-04-29 21:59:37 -04:00
31d6af6114 add delete_atoms "variable" option 2022-04-29 21:59:22 -04:00
9c45af7730 avoid potential 32-bit integer overflow 2022-04-29 20:53:57 -04:00
cac9fcaf86 cannot build ELECTRODE package by default on native windows because it requires BLAS 2022-04-29 20:18:50 -04:00
4a3bcd9230 Merge branch 'develop' into collected-small-changes 2022-04-29 20:15:36 -04:00
87b0939fe7 Merge pull request #2871 from evoyiatzis/master
implementation of an "ellipsoidal" region option
2022-04-29 19:46:15 -04:00
44c4d0a4d6 Merge pull request #3194 from robeme/electrode
ELECTRODE package for constant potential method
2022-04-29 18:30:29 -04:00
ee8d8042e6 add example for YAML processing with Perl 2022-04-29 17:42:23 -04:00
514bfe77df apply changes suggested by @sjplimp 2022-04-29 17:33:37 -04:00
5e18f15435 remove unused variables 2022-04-29 15:29:04 -04:00
d0938ce398 apply clang-format 2022-04-29 15:13:47 -04:00
80c716b81f update false positives 2022-04-29 15:11:11 -04:00
f09e886fd2 remove unused function 2022-04-29 15:10:57 -04:00
47f62838db Merge branch 'develop' into electrode 2022-04-29 14:37:48 -04:00
3c71c07048 Merge pull request #3230 from athomps/snap-inner-mod
Snap inner cutoff improvements and porting to KOKKOS
2022-04-29 14:36:48 -04:00
37d2d9e013 Remove trailing spaces 2022-04-29 10:56:34 -06:00
3f44f8f50d Merge pull request #3236 from lammps/fix-adapt-angle2
bug fix for new fix adapt angle support
2022-04-29 12:50:10 -04:00
df76673bee bdim --> adim in fix adapt 2022-04-29 10:10:36 -06:00
2f8e708184 more whitespace 2022-04-29 09:37:27 -06:00
894b7810b2 whitespace 2022-04-29 09:32:24 -06:00
57098f3df7 Remove extra files 2022-04-29 09:22:14 -06:00
69a79ba082 whitespace 2022-04-29 09:17:24 -06:00
641e769bde Revert a3c6baad4c 2022-04-29 09:03:44 -06:00
435f652263 removed trailing whitespace in pair_ilp_tmd_opt and pair_saip_metal_opt 2022-04-29 22:54:41 +08:00
6ced400207 change saip and tmd to virtual public inherit, so that corresponding opt package can compile 2022-04-29 22:28:48 +08:00
f93ac86c53 updated Install.sh for OPT package to adopt new interlayer potential optimizations 2022-04-29 22:05:52 +08:00
943cb531bf Modified chunk code of pair_ilp_graphene_hbn_opt for adopting pair_saip_metal_opt and pair_ilp_tmd_opt 2022-04-29 21:56:52 +08:00
c34efcc718 fixed multielement assignment error
tested in CPU and GPU mode, gets same output for eneriges and forces as build without KOKKOS for various settings of sinner, dinner
2022-04-29 07:53:39 -06:00
2292caef38 updated sinner/dinner log output
now logmsg displays all element params for sinner, dinner on same line (replaces only first param + ...)
2022-04-29 07:48:02 -06:00
9c48a75c8e fix issues reported by coverity scan 2022-04-29 06:49:47 -04:00
b2300ba9cb Merge branch 'develop' into collected-small-changes 2022-04-29 05:51:05 -04:00
6fb3cef39f Merge pull request #3031 from Iximiel/develop
Second Moment Aproximation to the Tight Binding addes as pair style
2022-04-28 22:32:38 -04:00
cb41e354b8 Merge pull request #3238 from akohlmey/doc-math-funcs
Document special math functions
2022-04-28 22:11:09 -04:00
7d9cdc7ec4 update documentation. more examples. document fix_modify options 2022-04-28 18:34:49 -04:00
bf8f5e2f87 more compact output 2022-04-28 18:08:59 -04:00
a3e0e1a6eb fixed multielement assignment error 2022-04-28 15:57:53 -06:00
2ae9ca5073 swap rows and columns back for easier import into pandas 2022-04-28 16:03:04 -04:00
f25b60fded simplify pandas processing. add missing image with plot 2022-04-28 16:02:45 -04:00
f09556018b fix bugs reported by @jibril-b-coulibaly 2022-04-28 14:47:53 -04:00
04b46a9ce8 implement yaml output for mode vector 2022-04-28 14:33:15 -04:00
eb5d867adf Improve erfc 2022-04-28 13:45:57 +00:00
2f71c96bde add yaml format output for mode scalar 2022-04-28 07:46:47 -04:00
09ed718c14 add example to plot thermo data with pandas+matplotlib 2022-04-28 07:45:51 -04:00
cfc4dcea3d must quote keyword data to avoid issues parsing the YAML data 2022-04-28 07:34:23 -04:00
33a63e5cd3 remove dead code to silence compiler warnings 2022-04-28 03:03:29 -04:00
a05bdfa76c add override to polymorph functions 2022-04-27 18:36:00 -04:00
cd3ce8459b enable and apply clang-format 2022-04-27 18:35:44 -04:00
74afc04580 remove error comments from header 2022-04-27 18:29:41 -04:00
233d4ad349 whitespace fixes 2022-04-27 18:29:27 -04:00
8481abda05 Merge branch 'develop' into ellipsoid-region 2022-04-27 18:28:38 -04:00
55fddf3aac update (tentative) release date 2022-04-27 18:26:07 -04:00
b76594e551 enforce only newton pair on with smatb pair styles. add unit tests 2022-04-27 18:08:05 -04:00
2d45e3340f move sources and examples for smatb styles to SMTBQ package folders 2022-04-27 15:14:02 -04:00
585b14f08f fix memory leak 2022-04-27 15:10:55 -04:00
3cfae26b84 update docs and make part of SMTBQ package 2022-04-27 15:10:46 -04:00
3b1165ccdc update files to be more compatible with LAMMPS' conventions and for code changes 2022-04-27 15:02:32 -04:00
75d42a87e5 Merge branch 'develop' into Iximiel/develop 2022-04-27 14:15:10 -04:00
cdba0da780 Merge branch 'snap-inner-mod' of github.com:athomps/lammps into snap-inner-mod 2022-04-27 10:58:43 -06:00
a3c6baad4c Removed CPU specific options 2022-04-27 10:58:22 -06:00
0e1f9968c1 Merge branch 'develop' of github.com:lammps/lammps into snap-inner-mod 2022-04-27 10:48:24 -06:00
6439777406 complete documentation of the MathSpecial namespace 2022-04-27 11:59:25 -04:00
c43bc000d9 Removed unnecessary commented out code section. 2022-04-27 19:46:18 +10:00
d857600d9c start documenting functions in the MathSpecial namespace 2022-04-27 04:46:18 -04:00
385f0c6c95 Update Kokkos build documentation to include hipFFT options. 2022-04-27 10:13:03 +10:00
8cdbf380cf Add support for hipFFT backend in PPPMKokkos. 2022-04-27 09:22:59 +10:00
691ba89b6f Merge pull request #3234 from lammps/variable-vector-wildcard
add support for wildcards in variable vectors
2022-04-26 18:21:46 -04:00
1fcf82aeef Merge remote-tracking branch 'github/develop' into variable-vector-wildcard 2022-04-26 17:54:32 -04:00
56b4671cd8 Merge pull request #3233 from akohlmey/collected-small-changes
Collected small changes for the next patch release
2022-04-26 17:54:11 -04:00
d8e98cb99d make tests more complex and add vector variable expansion 2022-04-26 17:53:47 -04:00
831caaa150 Merge branch 'collected-small-changes' into variable-vector-wildcard 2022-04-26 17:26:17 -04:00
64fff417c3 test more bound variants 2022-04-26 17:25:27 -04:00
7eb6c2652f update advanced utils tests. include test for expand args 2022-04-26 16:16:44 -04:00
d04cb4ba42 edits to doc page 2022-04-26 13:58:18 -06:00
782add6943 Merge branch 'feature-create-atoms-exclude' of github.com:erozic/lammps into create-overlap 2022-04-26 13:22:10 -06:00
800e0a7357 bug fix for new fix adapt angle support 2022-04-26 09:34:27 -06:00
7663fc6256 correctly use "type" to detect executables/scripts 2022-04-26 11:08:31 -04:00
26278643d4 Port changes to Kokkos 2022-04-26 08:22:00 -06:00
407f6af1ed Merge branch 'develop' of github.com:lammps/lammps into snap-inner-mod 2022-04-26 08:13:30 -06:00
192b22a6ce Set rng init for electrode/thermo 2022-04-26 16:03:45 +02:00
837f9040d8 add tests for advanced utility functions that require a LAMMPS instance 2022-04-26 09:30:34 -04:00
4691ff06b5 format 2022-04-26 09:30:10 -04:00
ba02d90bf1 add test for new errorurl() utility function 2022-04-26 09:29:57 -04:00
a649fa3a79 detect yaml file output by file name 2022-04-26 06:20:00 -04:00
72011bf325 Updated doc (use of overlap clarified) 2022-04-26 11:55:24 +02:00
7aaa71d22e Merge remote-tracking branch 'lammps/develop' into electrode 2022-04-26 10:29:39 +02:00
66b8ab9c6e Revamped examples 2022-04-26 09:42:45 +02:00
fdb7dfdea7 also remove mode from fix ave/correlate 2022-04-25 17:04:04 -06:00
e7a9073ccd remove discussion of mode 2022-04-25 17:01:15 -06:00
65978c33b6 2 more doc pages 2022-04-25 16:06:52 -06:00
bb8e953fb5 add support for wildcards in variable vectors 2022-04-25 15:43:08 -06:00
950b175fcd remove invalid [[noreturn]] attribute 2022-04-25 16:23:48 -04:00
dc605d35ee Updated ML-IAP package 2022-04-25 13:58:41 -06:00
811e5786fe Merge branch 'develop' into feature-create-atoms-exclude 2022-04-25 19:30:52 +02:00
c1146ebdcd Resolved conflicts with develop 2022-04-25 19:11:54 +02:00
8679266db8 add container definitions for Fedora 36 and Ubuntu 22.04LTS 2022-04-25 13:05:43 -04:00
2624043ab6 Synchronisation fix 2022-04-25 17:03:07 +02:00
960d3faa5e Merge branch 'master' of github.com:z-gong/lammps into collected-small-changes 2022-04-25 02:58:17 -04:00
a5cd95d6c6 Add comment for the units in compute/viscosity 2022-04-25 06:23:54 +02:00
28900925f4 Fix the unit for fix/accelerate/cos 2022-04-25 05:59:41 +02:00
9c46acfd62 fix parallel processing bug with shell mkdir command 2022-04-24 23:23:01 -04:00
45de998aa9 Merge pull request #3231 from akohlmey/remove-error-docs-in-header
Remove error docs from header files
2022-04-24 18:30:17 -04:00
6cfbd73bcd add documentation for new error and warning policy 2022-04-23 16:40:28 -04:00
f7e7abc908 fix uninitialized pointer bug 2022-04-23 15:17:26 -04:00
b4c3c479b7 remove error docs from one more file 2022-04-23 13:52:29 -04:00
4d1bdb4741 add python tool to detect and remove (if desired) error docs from headers
also document the tools in the manual.
2022-04-23 13:52:12 -04:00
78c10bac4a clang-format update 2022-04-23 13:08:11 -04:00
115962db88 Merge branch 'develop' into remove-error-docs-in-header 2022-04-23 12:46:54 -04:00
ce5d8a578e Merge pull request #3228 from run-towards-the-future/develop
A pull request for an optimized ILP(ilp/graphene/hbn) potential
2022-04-23 12:42:27 -04:00
f970a9de6a Merge pull request #3219 from akohlmey/region-lookup-refactor
Region lookup refactor
2022-04-23 11:33:01 -04:00
67bcfe3b62 remove unused code and variables, more programming style consistency 2022-04-23 09:26:35 -04:00
b55b9f5a6a removed request for ghost neighbor list 2022-04-23 20:35:48 +08:00
ef51fb7dea Fix bugs, Derives from PairILPGrapheneHBN instead of Pair
Improve the performance of pair style, ilp/graphene/hbn/opt
Updates to the OPT package
2022-04-23 19:45:50 +08:00
8fe0231b75 Fix bugs, Derives from PairILPGrapheneHBN instead of Pair
Add a new pair style, ilp/graphene/hbn/opt
Updates to the OPT package
2022-04-23 19:43:34 +08:00
e1856dc708 cosmetic 2022-04-23 07:42:31 -04:00
5da6fae9f6 silence compiler warnings 2022-04-23 07:35:18 -04:00
69249e84e1 adjust epsilon 2022-04-23 07:35:00 -04:00
8f019f4800 doc fixes: spelling and links 2022-04-23 07:34:44 -04:00
d55e7f9e51 Merge branch 'develop' into region-lookup-refactor 2022-04-23 07:14:28 -04:00
b1546a725c Merge pull request #3093 from Bibobu/Elastic_stress
Add compute born/matrix command to compute elastic stress
2022-04-23 07:07:29 -04:00
113fc0a77a Merge pull request #3227 from akohlmey/safer-data-file-parsing
Improve data file parsing and reported error messages
2022-04-23 06:41:17 -04:00
419b0f9494 add missing curly brace 2022-04-23 06:02:14 -04:00
31470819c0 Merge branch 'develop' into Elastic_stress 2022-04-23 04:36:45 -04:00
7bfa368d8d Merge pull request #2667 from ssande7/compute_temp_profile_dof
[BUGFIX] Collection of DoF-related fixes for compute temp/profile
2022-04-23 04:31:38 -04:00
c17845276a Derives from PairILPGrapheneHBN instead of Pair
Improve the performance of pair style, ilp/graphene/hbn/opt
Updates to the OPT packages
2022-04-23 14:29:03 +08:00
b631411985 Derives from PairILPGrapheneHBN instead of Pair
Add a new pair style, ilp/graphene/hbn/opt
Updates to the OPT package
2022-04-23 14:26:13 +08:00
26ca371d93 Merge branch 'develop' into region-lookup-refactor 2022-04-22 23:47:49 -04:00
79a7d2abf6 remove error docs from header files 2022-04-22 23:31:15 -04:00
e49930df21 Merge branch 'develop' into safer-data-file-parsing 2022-04-22 23:13:39 -04:00
471c728ac4 Merge pull request #3224 from lammps/dynamic-groups
change update of dynamic groups to post_force location in timestep
2022-04-22 23:11:17 -04:00
cbefeeb677 Merge pull request #3220 from athomps/specify-verlet
Explcitly state that fix nve uses velocity-Verlet integrator
2022-04-22 23:10:48 -04:00
8115e8a5a4 Merge pull request #3226 from lammps/error-url
Add utility to print url with link to error message in online manual
2022-04-22 23:10:21 -04:00
9f9a5ca76f Merge branch 'develop' into region-lookup-refactor 2022-04-22 22:53:02 -04:00
9be8ef09a2 Merge pull request #3229 from lammps/fix-adapt-angle
Fix adapt angle
2022-04-22 22:44:18 -04:00
97bfc0bb77 avoid (unlikely) overflow 2022-04-22 22:38:46 -04:00
cf647347c9 Merge branch 'develop' into safer-data-file-parsing
# Conflicts:
#	src/atom.cpp
2022-04-22 22:25:41 -04:00
8e9cc0eb51 Merge branch 'develop' into compute_temp_profile_dof 2022-04-22 22:16:42 -04:00
47564ab6bc Merge branch 'develop' into region-lookup-refactor 2022-04-22 22:11:41 -04:00
1319cb2cf5 fix typo 2022-04-22 22:08:13 -04:00
aed7bafac0 Merge pull request #3217 from akohlmey/atomvec-strings
Refactor Atom and AtomVec classes to use std::string and std::vector for setting up per-atom data
2022-04-22 22:03:26 -04:00
3a5ab301b2 propagate changes from previous commit to other packages that were missing them 2022-04-22 21:46:24 -04:00
5aebd151b6 Update compute_temp_profile.rst 2022-04-22 18:47:13 -06:00
16dd89c641 Added qualifier to assertions + note about inhomogeneous rigid systems 2022-04-23 10:30:44 +10:00
a90c632ae2 fix bug when no other post_force fixes are defined 2022-04-22 17:10:56 -06:00
48d8094d95 Merge branch 'develop' into snap-inner-mod 2022-04-22 16:54:21 -06:00
2c71d0eea2 Ported to KOKKOS, untested 2022-04-22 16:43:19 -06:00
01e7530902 shorten URL message text 2022-04-22 17:00:55 -04:00
907bcd16a8 Update compute_temp_profile.rst 2022-04-22 14:21:57 -06:00
b40e662b10 Merge pull request #3223 from akohlmey/less-fmtlib-warnings
Reduce excessive warnings from fmtlib and assorted small changes
2022-04-22 15:03:49 -04:00
fec5538d3c fix initialization bugs 2022-04-22 13:52:15 -04:00
1568974e8e whitespace 2022-04-22 13:39:05 -04:00
c054edda6b allow larger error margin for pressure computes 2022-04-22 13:22:01 -04:00
23d39c7d02 Merge branch 'develop' into create-overlap 2022-04-22 10:37:39 -06:00
c0d0c84f7d update unit test files to implementation changes 2022-04-22 12:16:28 -04:00
da520bf8b7 integrate better into manual and traditional build system 2022-04-22 11:38:55 -04:00
68d1c856b3 fix typo 2022-04-22 11:27:08 -04:00
77b563a024 disable unknown pragma warnings for the summit machine when using CUDA 2022-04-22 11:23:54 -04:00
b4e2e2ec34 add support for angle cosine 2022-04-22 09:12:12 -06:00
a6f2f04664 Removed forgotten neighbor->ago condition in compute_born_matrix. Rewritten compute_pair loop so that newton condition does not affect results. 2022-04-22 16:59:52 +02:00
644b3f6933 clarify and remove redundant text 2022-04-22 09:32:10 -04:00
23186da560 Merge branch 'snap-inner-bug-printf' of github.com:megmcca/lammps into less-fmtlib-warnings 2022-04-22 09:26:29 -04:00
3b1021abd1 cosmetic changes. improve programming style conformance 2022-04-22 08:36:20 -04:00
55a7c341af improve data file section parsing
- avoid segfaults when dereferencing a null pointer on short files
- allow skipping over empty and comment-only lines.
2022-04-22 08:35:09 -04:00
6d56629660 improve error messages 2022-04-22 08:31:53 -04:00
dc4752ef63 add convenience function for printing a missing arguments error message 2022-04-22 08:28:14 -04:00
079d3ea067 remove extraneous printf line 2022-04-22 06:16:45 -06:00
3e9f207062 Improve the performance of pair style, ilp/graphene/hbn/opt
Updates to the OPT package
2022-04-22 20:00:28 +08:00
e0049a07f3 Add a new pair style, ilp/graphene/hbn/opt
Updates to the OPT package
2022-04-22 17:55:05 +08:00
13664a0185 add utility to print url with pointer to error message 2022-04-22 05:25:50 -04:00
4de9ab85ce Completed inner cutoff, KOKKOS still in progress 2022-04-21 17:30:12 -06:00
3f3c481554 add support to fix adapt for angle coeffs 2022-04-21 17:00:11 -06:00
0b6a689f3c Removed the domain->minimum_image() calls from dihedral_nharmonic and angle_cosine. 2022-04-22 00:37:49 +02:00
6b3c868c6e Removed commented previous nb list request. 2022-04-22 00:26:00 +02:00
5fd2311951 Pulled develop. Solved false_positives.txt bond.cpp and bond.h files conflict. 2022-04-22 00:24:50 +02:00
0b0947c167 Solved the dihedral index problem. It was actually the indices used. 2022-04-22 00:20:25 +02:00
ea66d4e73f mostly doc page edits 2022-04-21 16:00:53 -06:00
0ece11c491 add a code comment 2022-04-21 15:19:04 -06:00
8cb47c8504 change update of dynamic groups to post_force location in timestep 2022-04-21 15:02:47 -06:00
c6abc9e682 need wheel module for modern install procedure 2022-04-21 16:15:42 -04:00
09187801c1 suppress nvcc unknown pragma warnings 2022-04-21 15:01:46 -04:00
247c61c93f make portable to ubuntu 2022-04-21 13:01:13 -04:00
04afec7771 fix minor doc issues 2022-04-21 13:00:26 -04:00
05a845fafd compute_dihedral finally agrees with numdiff! 2022-04-21 18:37:26 +02:00
6dcafd693f Update fix_nve.rst 2022-04-21 10:13:05 -06:00
1df430aef4 align with doc folder makefile 2022-04-21 12:02:05 -04:00
b7a3af7bd1 update plumed version in containers and install python3-venv 2022-04-21 12:01:49 -04:00
556ad777d1 update code to use safe fread() and thus silence compiler warnings on ubuntu 2022-04-21 11:53:59 -04:00
b7d329f9b3 remove unused field in class 2022-04-21 07:58:54 -04:00
1a8ba25444 silence some excessive warning by the new Intel compilers 2022-04-21 07:58:43 -04:00
e9eb74e13a add missing override 2022-04-21 07:50:48 -04:00
c07551072d must check if externally set C++ standard is at least c++11 2022-04-21 07:50:30 -04:00
e8cacc4380 Updated example syntax 2022-04-20 18:17:23 -06:00
b4b6ba91e0 Slight adjustment to definition of Sinner and Dinner 2022-04-20 18:01:24 -06:00
9cac62401d only set the C++ standard value if it is not set externally 2022-04-20 19:32:42 -04:00
96e22b1104 disable CUDA support with Eigen3 2022-04-20 18:50:55 -04:00
5242b5557f Merge branch 'develop' into less-fmtlib-warnings 2022-04-20 18:24:06 -04:00
4544664edc comment out assertion causing many warnings 2022-04-20 18:14:10 -04:00
38093ffe47 KOKKOS doesn't require nvcc_wrapper anymore when compiling with CMake 2022-04-20 18:13:42 -04:00
c62e2ad4d1 disable warnings with PGI/NVHPC compilers and import CMAKE_TUNE_FLAGS 2022-04-20 17:39:33 -04:00
aebbd04297 Merge pull request #3222 from akohlmey/fasthtml
Add fasthtml target for faster testing of .rst to .html translation
2022-04-20 17:16:23 -04:00
da0e0359b6 Merge pull request #3221 from akohlmey/ttm_mod_fix
Fix file reader bug in fix ttm/mod
2022-04-20 16:55:10 -04:00
a8e5e0e515 use python -m venv instead of virtualenv 2022-04-20 15:49:22 -04:00
42d875a411 add fasthtml target for faster testing of .rst to html translation 2022-04-20 15:02:00 -04:00
bc0236d869 Bugfix tagint type for tags 2022-04-20 18:49:55 +02:00
a3a3354d1b fix file reader bug and add ttm/mod example 2022-04-20 11:52:36 -04:00
f6523851b5 Explcitly state that fix nve uses velocity-Verlet integrator 2022-04-20 08:58:53 -06:00
c086664c2a Per-atom vector usage 2022-04-20 16:23:44 +02:00
9d1d552fde bugfix init_list for etypes 2022-04-20 16:23:44 +02:00
df5b1a228d tweak epsilon for macos/arm64 2022-04-19 21:57:43 -04:00
71e96e8b7c Merge pull request #3212 from ndtrung81/dielectric-updates
Updates to the DIELECTRIC package
2022-04-18 09:33:28 -04:00
f40b8f5694 Merge branch 'develop' into dielectric-updates 2022-04-17 17:47:55 -04:00
9228855257 cosmetic 2022-04-17 17:47:38 -04:00
c820eeb118 re-apply clang-format 2022-04-17 17:47:31 -04:00
7c64ff6634 Improved the precision of the conversion factor epsilon0e2q, added more options for units, ensured that qqrd2e be included in efield in several pair styles, and updated the fix polarize doc page 2022-04-17 12:01:41 -05:00
44e4510251 replace vector for storing regions with unordered_set for simpler processing 2022-04-16 11:17:55 -04:00
aa4787f604 complete region handling refactor 2022-04-16 00:17:39 -04:00
cbb4abc55c improve formatting 2022-04-15 17:12:31 -04:00
69d9c5187e refactor group access, enable and apply clang-format 2022-04-15 15:29:43 -04:00
4b400fb4a6 overload count() function to pass in Region pointer directly 2022-04-14 22:00:50 -04:00
21f24ef572 Merge pull request #3218 from lammps/mdi-new-functions
MDI new functions
2022-04-14 20:48:51 -04:00
a0a82cad0b Merge pull request #3214 from stanmoore1/kk_tersoff_bugfix
Fix issues in Kokkos Tersoff and Stillinger-Weber pair styles
2022-04-14 17:28:59 -04:00
e66fb6a1c1 apply clang-format 2022-04-14 17:28:05 -04:00
64b1c45a49 update MDI library and checksum 2022-04-14 17:27:20 -04:00
56bfa90a69 adapt bpm/sphere atom style 2022-04-14 17:23:11 -04:00
20827b4105 sync with new version of MDI library 2022-04-14 15:00:09 -06:00
111111b38b Merge branch 'develop' into atomvec-strings 2022-04-14 16:52:04 -04:00
26f6976568 move errorfunction complement approximation factor into shared namespace 2022-04-14 16:47:38 -04:00
8b31edb102 programming style updates and clang-format applied 2022-04-14 16:47:10 -04:00
81e203b5fa only allow "lj" and "real" units for now 2022-04-14 16:43:59 -04:00
4380ed23d1 documentation and LAMMPS homepage URL updates 2022-04-14 15:55:22 -04:00
0cfb26799c Fix copy/paste error 2022-04-14 13:47:57 -06:00
5bd86a05b2 Merge pull request #2906 from jtclemm/BPM
Adding package for bonded particle models
2022-04-14 15:43:14 -04:00
c5565a4e02 Small tweaks 2022-04-14 13:16:44 -06:00
5c70f45feb updates to use new funcs from Python as well 2022-04-14 10:49:12 -06:00
29582f09a1 add missing update to property_atom function API 2022-04-14 12:34:58 -04:00
ac8d97d358 capture by reference 2022-04-14 12:27:45 -04:00
31178661c9 switch to C++11 compatible lambda function capture 2022-04-14 12:27:03 -04:00
095c610a3f no more need to explicitly initialize empty fields 2022-04-14 12:00:56 -04:00
b5eb5ac686 update docs for adding atom styles to refactored process 2022-04-14 11:48:18 -04:00
500a3426ed "stringify" and "vectorize" per-atom data handling in Atom class 2022-04-14 11:31:20 -04:00
198d07e905 print warning when fix property/atom is issues before reading a restart 2022-04-14 11:06:35 -04:00
b16d48aa41 "stringify" and "vectorize" processing of per-atom attributs in AtomVec classes 2022-04-14 11:06:10 -04:00
9424c2558e enable and apply clang-format. minor cosmetic changes 2022-04-13 21:05:19 -04:00
1755d06870 Merge pull request #3216 from lammps/update-citation
update a citation
2022-04-13 19:16:57 -04:00
bc2b600f09 changes to use new MDI library functions 2022-04-13 16:26:48 -06:00
0946d41c3f Merge pull request #3215 from megmcca/snap-inner-bug
fix crash with multielement inner cutoff
2022-04-13 16:17:10 -04:00
30914a73fb Update error messages 2022-04-13 14:10:52 -06:00
44f67330e2 Port changes to other flavors of Tersoff 2022-04-13 13:50:49 -06:00
21c61a5c77 Merge pull request #3213 from akohlmey/gpu-remove-legacy
Remove support for CUDA toolkits before version 8 and GPUs older than Kepler
2022-04-13 15:10:17 -04:00
bd6d7b9136 clarify CUDA versus OpenCL build and runtime restrictions 2022-04-13 14:24:43 -04:00
c9ab5ebbf5 cosmetic 2022-04-13 12:59:54 -04:00
2804de8c26 fix refactoring bug 2022-04-13 12:59:41 -04:00
fb37c86632 remove duplicate 2022-04-13 12:59:30 -04:00
0f1097d7e6 recover read_restart and read_data capability for fix property/atom 2022-04-13 12:41:40 -04:00
2d5fadd88f Switch to const ref to help compiler 2022-04-13 10:27:41 -06:00
230bed0bc4 fix crash with multielement inner cutoff 2022-04-13 09:49:13 -06:00
9e94722987 Remove full neigh option in Kokkos Tersoff and SW pair styles 2022-04-13 08:14:02 -06:00
ef4e41d2a2 programming style and format updates 2022-04-12 22:52:07 -04:00
467cae9436 permissions 2022-04-12 18:43:47 -04:00
09b08ecd85 whitespace 2022-04-12 18:36:51 -04:00
8c153adceb spelling 2022-04-12 18:36:16 -04:00
e89303c202 Fix compile error with Kokkos CUDA 2022-04-12 16:31:21 -06:00
622a4a6d51 Overallocate slightly to reduce memory reallocs 2022-04-12 16:20:21 -06:00
2998462743 Add const 2022-04-12 16:07:37 -06:00
f64d405ad8 Fixing remaining errors/warnings in doc build 2022-04-12 15:59:38 -06:00
90a6a3c125 Fix typo 2022-04-12 15:57:49 -06:00
2fa99703bf Fix issues in Kokkos Tersoff and SW pair styles 2022-04-12 15:49:28 -06:00
616349c27b Merge branch 'develop' into dielectric-updates 2022-04-12 16:33:02 -05:00
f3363070e7 remove support for CUDA toolkits before version 8 and GPUs older than Kepler 2022-04-12 15:48:16 -04:00
ca37c01476 Fixing broken links/references in documentation 2022-04-12 13:36:39 -06:00
e1a7ea38a9 update a citation 2022-04-12 12:59:25 -06:00
929e46b5c7 remove dead code 2022-04-12 11:06:28 -04:00
e1a2423f2e modernize, initialize pointers, apply clang-format 2022-04-12 11:06:18 -04:00
2ff8ac0cb2 Merge pull request #3210 from arghdos/fix_volatile
Add non-volatile version of join function to DomainKokkos
2022-04-11 19:48:43 -04:00
12d7ef541b Need both versions of join 2022-04-11 15:13:44 -06:00
804c43b33c Merge branch 'develop' of github.com:lammps/lammps into fix_volatile 2022-04-11 15:11:37 -06:00
ef53298f7c Added the omp version of pair lj/cut/coul/debye/dielectric 2022-04-11 15:45:12 -05:00
2a595713f3 Updated doc page of the set command for the local dielectric constant,
which could be used as a measure of polarizability in the future
2022-04-11 15:01:19 -05:00
b666f7324c Updated the example input script with the set command for per-atom dielectric constant 2022-04-11 14:44:02 -05:00
b05aadf877 Allowed to set the atom local dielectric values (epsilon) 2022-04-11 14:18:43 -05:00
49aebf64b9 include BPM package in multiple presets 2022-04-11 12:41:28 -04:00
9d907e31b3 recover compilation 2022-04-11 12:40:59 -04:00
36723853c9 Merge branch 'develop' into BPM 2022-04-11 12:18:34 -04:00
8161dff58a Added pair style lj/cut/coul/debye/dielectric, added conversion factor epsilon02eq for real units 2022-04-11 10:54:41 -05:00
ebc74d7428 Indice correction in EXTRA-COMPUTE/compute_born_matrix.cpp, some PBC check in EXTRA-MOLECULE/dihedral_nharmonic.cpp and MOLECULA/angle_cosine.cpp. Also added born_matrix to angle_cosine.cpp 2022-04-11 17:53:48 +02:00
236d275b2f Merge pull request #3211 from akohlmey/collected-small-changes
Collected clang-tidy updates
2022-04-11 11:07:00 -04:00
b36262cd11 cosmetic 2022-04-10 20:47:42 -04:00
d6f7570d57 avoid redundant use of boolean literals 2022-04-10 20:47:31 -04:00
74f2b67b1a no if statement required before delete[] 2022-04-10 19:55:24 -04:00
3eec2eec9a make buffer size a compile time constant and use strncpy() instead of strcpy() 2022-04-10 18:33:17 -04:00
200b4f13c7 use dynamic cast instead of c-style cast when casting from base type to derived class 2022-04-10 18:18:06 -04:00
39b316729b use auto type when assigning from cast or using new 2022-04-10 18:16:36 -04:00
6071376d42 derive ATC_Error exception class from std::exception 2022-04-10 15:25:37 -04:00
413a01ade5 apply clang-tidy updates 2022-04-10 12:07:54 -04:00
1a2d83ab01 HDF5 library may be parallel which is an error with serial LAMMPS 2022-04-10 12:07:54 -04:00
591498ab31 Updated and fixed typos in doc pages 2022-04-10 10:24:31 -05:00
a9f5a1af51 initialize class member pointers in initializer to null 2022-04-10 11:13:33 -04:00
c54fe7d97d small update 2022-04-10 08:00:47 -04:00
85b69000cd revert to use NULL instead of nullptr, so that it compiles without having to enable c++11 compatibility 2022-04-09 20:54:59 -04:00
ddf67ec42d properly use nullptr on pointers (with a little help from clang-tidy) 2022-04-09 20:27:40 -04:00
2d346638fb correctly declare and override virtual functions for desired polymorphism 2022-04-09 20:17:36 -04:00
a620f5bd7d fix pointer type bug 2022-04-09 19:59:43 -04:00
07bc76871c avoid unsafe strcpy() 2022-04-09 19:01:42 -04:00
4adeb29491 clang-tidy fixes 2022-04-09 19:00:59 -04:00
177f9cabc1 add ELECTRODE package to suitable presets 2022-04-09 18:19:55 -04:00
4e81adaf8c make buffer size for text file reader adjustable 2022-04-09 17:46:47 -04:00
fcd3e76767 skip unsupported unit tests 2022-04-09 17:45:38 -04:00
c07b06c8d1 skip unsupported unit tests 2022-04-09 17:44:40 -04:00
420dc969d3 need to set buffer size based on generated output format 2022-04-09 17:26:41 -04:00
eb9af11d64 make buffer size for text file reader adjustable 2022-04-09 17:26:03 -04:00
b20c98753f style changes 2022-04-09 10:10:33 -04:00
44ccbd2184 use internal reader/parser classes for file reading and writing 2022-04-09 10:10:19 -04:00
06fc53ac69 make timer output configurable and off by default 2022-04-09 10:08:58 -04:00
75d87383e2 one more OpenMP fix 2022-04-09 09:10:45 -04:00
a04c0077b9 silence some more compiler warnings and try to resolve issues with old compilers 2022-04-09 09:04:17 -04:00
8625a6d946 apply clang-format 2022-04-09 08:00:11 -04:00
ce62da1cca compatibility with legacy OpenMP implementations 2022-04-09 07:53:17 -04:00
71f8e11d70 join multi-line strings 2022-04-09 07:45:01 -04:00
a94fa0a840 formatting 2022-04-09 07:44:33 -04:00
23598fa658 spelling 2022-04-09 07:44:15 -04:00
7673eda947 apply clang-format 2022-04-09 07:16:22 -04:00
6dea9fa10c add missing dependency handling in GNU make build for ELECTRODE package 2022-04-09 07:10:31 -04:00
c04db4b545 modernize 2022-04-09 07:01:42 -04:00
e0c4f6164e silence compiler warnings 2022-04-09 07:01:35 -04:00
cab6fca22e update to latest upstream and modernize neighbor list request handling 2022-04-09 07:00:39 -04:00
19b42bc726 Merge branch 'develop' into electrode 2022-04-09 06:31:22 -04:00
8ce2ce8fd4 remove unused import 2022-04-09 04:02:01 -04:00
a71bf4cae5 Merge pull request #3207 from lammps/remove-message-package
remove MESSAGE package
2022-04-09 03:20:26 -04:00
8dce9f7a60 install pyyaml 2022-04-09 00:39:50 -04:00
6c87962551 fix remaining doc build issues 2022-04-09 00:39:27 -04:00
674d2a6788 Merge branch 'develop' into remove-message-package 2022-04-09 00:25:11 -04:00
8b53ff9383 Merge pull request #2921 from lammps/mdi-expand
Enhance MDI support in LAMMPS in its MDI package
2022-04-09 00:18:50 -04:00
22122092e4 Merge pull request #3206 from akohlmey/add-kimplugin
Add kimplugin source and CMake based build support
2022-04-08 23:09:13 -04:00
d0d4bbf5ae Merge pull request #3196 from akohlmey/avoid-bigint-format-scanf
Refactor code to avoid XXXINT_FORMAT defines and  xxscanf() function calls
2022-04-08 21:24:57 -04:00
5ff42d8993 simplify 2022-04-08 21:21:36 -04:00
81933b7972 silence compiler warnings 2022-04-08 21:19:32 -04:00
f3685fa8de fix bugs 2022-04-08 21:18:55 -04:00
375062d02c restore modern API usage 2022-04-08 21:18:28 -04:00
093667799d Merge branch 'develop' into mdi-expand 2022-04-08 20:58:53 -04:00
1cc913d006 Merge pull request #3205 from akohlmey/dump-style-yaml
Add dump style yaml
2022-04-08 20:55:01 -04:00
8cdce34b27 Merge branch 'develop' into dump-style-yaml 2022-04-08 18:42:28 -04:00
6849356d63 fix spelling, formatting, and cross-link/indexing issues 2022-04-08 18:35:51 -04:00
530d8c007d minor tweak 2022-04-08 18:09:10 -04:00
521d45dcc6 remove MESSAGE package from CMake 2022-04-08 18:00:36 -04:00
fbc55937fe Merge pull request #3198 from bathmatt/pair-dpd
DPD-BASIC kokkosification
2022-04-08 17:48:28 -04:00
dff3bc5656 Merge branch 'develop' into avoid-bigint-format-scanf 2022-04-08 17:39:25 -04:00
fc24cf15ce Merge pull request #3197 from akohlmey/custom-thermo-headers
add support for custom header keywords with thermo output and dump styles
2022-04-08 17:29:35 -04:00
b24d01fae6 remove broken links in the manual from removing packages 2022-04-08 17:27:01 -04:00
d0edc48a65 update purge list with removed source files from MESSAGE package 2022-04-08 17:26:16 -04:00
f405c7acc9 add deprecation handling removed commands and styles 2022-04-08 17:25:56 -04:00
ef7c6a580e simplify 2022-04-08 16:51:52 -04:00
2c509d96a6 we are not compatible with those old versions for the MDI library 2022-04-08 16:43:41 -04:00
07aecb3678 whitespace fixes and apply clang-format 2022-04-08 16:36:21 -04:00
bfaa1e9ed0 whitespace 2022-04-08 16:28:57 -04:00
a7ccb16aa8 Merge pull request #3192 from davidfir3/fep_ta
New feature compute fep/ta
2022-04-08 16:27:12 -04:00
33798b99a4 remove debug print statement 2022-04-08 14:08:51 -06:00
caa977e869 Remove redundant calls 2022-04-08 13:28:14 -06:00
f8ec0365c6 Fix a few more issues 2022-04-08 12:52:26 -06:00
d99b1258e3 remove volatile to fix build error from Kokkos commit (5574130fb333ac1745a52d4a6383ac95c64bdc0f) 2022-04-08 11:13:31 -05:00
b73437aa63 Merge pull request #3208 from arghdos/develop
Fix for building GPU backend on ROCm 5.1+
2022-04-08 07:19:27 -04:00
4efdfaa8f3 simplify and make consistent, fix time based dump bug 2022-04-08 07:05:30 -04:00
bd4d92c76d entry for mdi sub-dir in Examples.rst 2022-04-07 16:02:45 -06:00
77565add6e Add C++14 to Makefile build system
Change-Id: I24f72b4aaca93a49877775c3d181507c83cd7f82
2022-04-07 17:54:20 -04:00
ab0e5d5568 Fix for building GPU backend on ROCm 5.0+
Change-Id: I32ad9be86d6a0467ccae555a1d0272813c905e97
2022-04-07 17:48:03 -04:00
792ae5dae5 remove src/MESSAGE package and supporting dirs and doc pages 2022-04-07 15:44:48 -06:00
f40180f7fb lib README edit 2022-04-07 15:15:50 -06:00
adef9b7747 add log files to examples/mdi 2022-04-07 15:13:29 -06:00
40aa146624 Prune unused code and fix virial issue 2022-04-07 15:05:07 -06:00
0b6aa59621 updated doc pages 2022-04-07 14:42:58 -06:00
e2f25a96e1 spelling 2022-04-07 14:50:33 -04:00
ddb6350fe8 Remove unused var 2022-04-07 10:53:38 -06:00
9b969648d5 add kimplugin source and CMake based build support 2022-04-07 12:51:06 -04:00
2956aee8dc Small tweaks 2022-04-07 10:45:50 -06:00
4f67f586d0 Fix memory issue and leftover debugging 2022-04-07 10:02:58 -06:00
fdf59e6a03 more debugging for plugin library mode 2022-04-07 09:26:43 -06:00
f5add95083 fix syntax error 2022-04-07 06:08:54 -04:00
8a6e6fe523 make dump style yaml test dependent on it being available 2022-04-07 05:59:31 -04:00
3970942028 add test for yaml dump style 2022-04-07 02:44:17 -04:00
0e8e1171c6 add unit test for yaml style thermo output and updated logfile class 2022-04-07 02:07:05 -04:00
59fa0be35f update for recent changes in thermo output 2022-04-07 02:06:55 -04:00
98b908387f add unit test for yaml style thermo output and updated logfile class 2022-04-07 02:05:47 -04:00
601bdadf44 update for recent changes in thermo output 2022-04-07 02:05:05 -04:00
082254455b improve confusing error messages 2022-04-07 00:37:30 -04:00
58ecf03e5d correct yaml import 2022-04-07 00:37:18 -04:00
348ee5299e implement a dump style yaml 2022-04-06 19:11:55 -04:00
e944ecd1c2 correct docs 2022-04-06 19:10:16 -04:00
207b34ae12 allow for pre-timestepping comm with engine, e.g. for force eval 2022-04-06 16:38:58 -06:00
b1e92c9ec6 update YAML reading python example to read faster using libyaml. 2022-04-06 17:38:25 -04:00
4bd28cf920 altering how plugin mode works 2022-04-06 15:24:02 -06:00
2b8b916cba delete unused enums 2022-04-06 10:08:53 -04:00
cd7f08a8e7 support dump_modify for column headers in ADIOS dump styles 2022-04-06 09:31:01 -04:00
387b0df554 Remove gitlab pipeline 2022-04-06 08:21:12 +02:00
b4cc158981 Merge pull request #3182 from charlessievers/mliap
ML-IAP updates
2022-04-05 22:07:27 -04:00
e4f62cae9a integrated added styles into manual 2022-04-05 22:01:21 -04:00
4ad8af629d whitespace 2022-04-05 21:53:29 -04:00
f89a08985e update DPD-BASIC package examples 2022-04-05 21:50:36 -04:00
607ecf595b Add ScatterView 2022-04-05 17:04:23 -06:00
8744627059 Tiny tweaks 2022-04-05 16:04:43 -06:00
efa7116b58 Merge branch 'develop' of https://github.com/lammps/lammps into pair-dpd 2022-04-05 15:48:36 -06:00
cd0b921ed2 Merge pull request #3203 from stanmoore1/acks2_bug
Fix issues in ReaxFF QEq and ACKS2
2022-04-05 16:29:30 -04:00
65be564cd6 Review akohlmey 2022-04-05 15:35:04 +00:00
22392d226a silence compiler warnings 2022-04-04 21:11:09 -04:00
a5139d7100 make sure "NN" is initialized before it is used 2022-04-04 21:03:15 -04:00
288c154290 Merge pull request #3186 from Ruyk/kokkos-sycl-cmake
Add kokkos-sycl.cmake preset
2022-04-04 16:12:24 -04:00
c274146358 whitespace 2022-04-04 15:40:19 -04:00
3eb7194619 Merge branch 'develop' into acks2_bug 2022-04-04 15:39:44 -04:00
3e01bc48d4 Need s ghosts 2022-04-04 13:05:10 -06:00
134c77a5c6 reference kokkos-sycl.cmake in the docs 2022-04-04 14:47:53 -04:00
fd80b1bd9b Merge pull request #3201 from samueljmcameron/bugfix_dumpvtk
Bug fix in vtk dump.
2022-04-04 14:40:56 -04:00
776dc34411 Add missing vars 2022-04-04 12:28:03 -06:00
f42635a40d Should be nall not nghost 2022-04-04 12:08:38 -06:00
4fadf4c830 more debugging on plugin mode 2022-04-04 10:30:12 -06:00
b4fc86e467 Fix issues in ReaxFF QEq and ACKS2 2022-04-04 10:24:54 -06:00
02f972292c spelling 2022-04-04 12:16:28 -04:00
5d4ec45534 Merge branch 'develop' into custom-thermo-headers 2022-04-04 12:08:23 -04:00
d89ff310c1 Merge pull request #3202 from lammps/fix-deform-doc-page-edit
Fix deform doc page edit
2022-04-04 12:07:10 -04:00
a0b15c2d04 Merge pull request #3199 from lammps/misc
Misc changes
2022-04-04 11:51:59 -04:00
63a841e300 doc page edit 2022-04-04 08:59:40 -06:00
3ed011dcfb whitespace 2022-04-03 10:55:56 -04:00
028beb8da4 Merge branch 'develop' into misc 2022-04-03 10:55:24 -04:00
db00b49a50 Merge pull request #3195 from weinbe2/feature/kk-reax-ang-tors-optim
kk/reax: Preprocessing optimizations to ComputeAngular,Torsion; Modularity/Memory improvements in BuildLists
2022-04-03 09:52:08 -04:00
e5a01026a7 add unit tests for fix move 2022-04-03 03:19:47 -04:00
c9d0889f25 add "transrot" style to fix move that allows to do translation and rotation at the same time 2022-04-02 18:34:17 -04:00
584b166823 enable and apply clang-format 2022-04-02 17:20:34 -04:00
93c67a3c07 make compute msd (and msd/nongauss) error out immediately when used with a dynamic group 2022-04-02 17:13:30 -04:00
8e838c1424 Bug fix in vtk dump. 2022-04-02 12:55:51 +01:00
49abd0d269 update docs 2022-04-01 15:17:10 -04:00
fb9316701b port colname changes to MPIIO package 2022-04-01 14:57:41 -04:00
dab640220c Fix name to match code 2022-04-01 12:48:58 -06:00
ea9e3c0860 Update fix ACKS2 docs 2022-04-01 12:45:38 -06:00
2f895d63a6 Add missing variable assignment 2022-04-01 12:32:24 -06:00
fb76cb9a5c updated virtual 2022-04-01 17:54:12 +02:00
294dcc5f93 more debugging for plugin mode 2022-04-01 09:27:48 -06:00
68f27bb4cd addressing comments from Evan's review 2022-04-01 17:02:57 +02:00
ce67cb0ca1 first stab at implementing dump_modify colname 2022-04-01 07:41:13 -04:00
9c0934e82c Have ext-tstat working 2022-04-01 10:37:53 +02:00
c470c204d4 remved unused var 2022-04-01 10:35:05 +02:00
4042a52db1 rename header keyword to colname 2022-03-31 21:58:35 -04:00
4437f16e08 remove references to non-existing folders 2022-03-31 17:49:24 -04:00
335b78b4f2 Add contributing author to list 2022-03-31 15:27:05 -06:00
e3611c5d73 add support for custom keywords with thermo output 2022-03-31 17:26:46 -04:00
19a6eecfbb more debugging for plugin engine mode 2022-03-31 14:41:38 -06:00
4dc4d74056 Add back in accidentally deleted call 2022-03-31 13:10:22 -06:00
ad4701f4f7 Small tweaks 2022-03-31 12:52:36 -06:00
72874376f0 Remove #ifdef 2022-03-31 12:27:43 -06:00
79fcf18013 Remove #ifdef 2022-03-31 12:25:58 -06:00
229f0af537 enable LAMMPS as driver to use plugin engine 2022-03-31 12:09:05 -06:00
df05bbb72b moved dpd_tstat to kokkos 2022-03-31 17:20:56 +02:00
28976b8c92 recover compilation on windows with old MPICH version 2022-03-31 08:44:43 -04:00
12ddc4ad12 final set of XXXINT_FORMAT changes 2022-03-31 07:51:14 -04:00
52b563a83e modernize parsing in fix tmd, add support for comments and empty lines 2022-03-31 07:36:50 -04:00
33b6466611 add minimal fix tmd example 2022-03-31 07:31:43 -04:00
b97c30e6e7 more refactoring, modernizing, removing of debug code 2022-03-31 06:24:44 -04:00
acd9c7950e update doc and example 2022-03-31 12:25:10 +08:00
b64e90dfe0 simplify. avoid XXXINT_FORMAT macros 2022-03-30 23:43:28 -04:00
1c9dc9c0d9 correct formatting 2022-03-30 22:11:46 -04:00
65a083c83d add support for </>VELOCITIES command at nodes 2022-03-30 15:52:55 -06:00
993441b25a avoid XXXINT_FORMAT macros in fix reaxff/bonds 2022-03-30 17:52:21 -04:00
c7a9a3e2f6 simplify and replace use of XXXINT_FORMAT macros 2022-03-30 16:13:38 -04:00
f3fa04ae0a bugfix 2022-03-30 15:01:03 -04:00
c4729b39b4 replace more uses of XXXINT_FORMAT with fmtlib 2022-03-30 13:53:25 -04:00
14f54aae40 Reax: Preprocessing optimizations to ComputeAngular,Torsion. Modularity boosts + memory reductions for BuildLists 2022-03-30 08:23:41 -07:00
5003c35963 have first cut of just pair-dpd 2022-03-30 16:22:26 +02:00
ddf93eb7ba removed unused var 2022-03-30 15:42:09 +02:00
69d32f286b Stan's patch 2022-03-30 15:10:54 +02:00
2517d1fb55 Converted DPD-BASIC-EXT to use Kokkos 2022-03-30 15:10:54 +02:00
9aad583c7d more parsing updates 2022-03-30 07:38:33 -04:00
999c880dfd simplify parsing numbers and reduce usage of BIGINT_FORMAT 2022-03-30 07:12:25 -04:00
ff3ac64b7e spelling 2022-03-30 03:32:26 -04:00
faacf575b5 add support for >+FORCES command 2022-03-29 14:20:44 -06:00
b92d117524 Merge pull request #3191 from akohlmey/collected-small-changes
Collected small changes and fixes
2022-03-29 14:45:18 -04:00
385b7a77e6 Merge pull request #3193 from samueljmcameron/stable_fix_brownian_update
BROWNIAN package update
2022-03-29 13:03:11 -04:00
2a35ec2d85 Merge pull request #3187 from stanmoore1/kk_opt_neighlist
Optimize Kokkos neigh list for GPUs
2022-03-29 12:05:34 -04:00
d9880273e3 fix typo 2022-03-29 11:54:34 -04:00
b8c7a6153d whitespace 2022-03-29 09:49:48 -04:00
bfe361c576 fix doc building issues 2022-03-29 09:47:44 -04:00
5ea526728e Merge branch 'develop' into stable_fix_brownian_update 2022-03-29 08:26:11 -04:00
88ff2db715 cosmetic updates, print warnings only on MPI rank 0 2022-03-29 08:23:18 -04:00
6f1fac1c59 Updated docs. 2022-03-29 12:21:09 +01:00
c28504961d remove references to the mailing list in the manual and replace with forum link, if needed 2022-03-29 07:01:00 -04:00
dcd6bea172 one final fix in constructor of asphere. 2022-03-29 11:22:21 +01:00
27d2fab951 simplify processing for "*" in filenames for embedding timestep by using utility function 2022-03-29 06:06:48 -04:00
da61b6871a Added in check for ellipsoid in brownian_asphere 2022-03-29 10:46:05 +01:00
db5e4e05a8 fix bug that happens when fix ave/time Nfreq < thermo freq 2022-03-29 15:35:23 +08:00
0bebe6c428 First commit, things not working though. 2022-03-29 07:50:19 +01:00
015257889d flag compatibility with VTK version 9 2022-03-29 01:03:04 -04:00
b211f97efa update and improve ADIOS support
- modernize code
- remove dead code and unused definitions, enums, and includes
- create default adios2_config.xml file if it doesn't exist
- enable and apply clang-format
- update documentation
2022-03-29 01:01:57 -04:00
333e3b0491 apply clangformat 2022-03-28 22:48:00 -04:00
3ba7b8c24c add star_subst() utility function that replaces a '*' in a string with a number 2022-03-28 22:47:20 -04:00
82d0a55862 remove merge conflict message 2022-03-28 15:26:20 -06:00
6407745781 update programming style and enable/apply clang-format 2022-03-28 16:49:11 -04:00
a60e1546b2 properly integrate into build system and docs 2022-03-28 16:48:44 -04:00
60e2b84e09 Fuse loops 2022-03-28 14:43:16 -06:00
1a3c6d3dbc tweak to one MDI doc file 2022-03-28 14:33:17 -06:00
d80fe166d1 Merge branch 'develop' into collected-small-changes 2022-03-28 16:30:01 -04:00
438cba3604 update programming style to latest conventions, enable and apply clang-format 2022-03-28 16:26:55 -04:00
88c075ba90 Tune for HIP 2022-03-28 14:19:50 -06:00
48332c3b18 Rename variable 2022-03-28 14:17:44 -06:00
94645ae720 update of doc pages to match new version of MDI support 2022-03-28 13:56:16 -06:00
63caa8bb44 reorder so that kspace follows improper and comes before compute 2022-03-28 15:12:25 -04:00
120c080fc2 avoid converting a null pointer to a std::string and correct error check 2022-03-28 15:07:23 -04:00
9920b22509 programming style updates 2022-03-28 15:06:55 -04:00
cd8cdc711c Merge pull request #3189 from CDenniston/develop
remove defunct LBtype argument from lb/fluid doc
2022-03-28 14:12:00 -04:00
540cf9b6d7 Merge pull request #3188 from njzjz/kspace_plugin
support kspace style plugin
2022-03-28 11:58:40 -04:00
51c41f09bf recover unit tests for variables 2022-03-28 09:21:25 -04:00
af4afb7e03 modify error/warning message 2022-03-28 21:14:13 +08:00
ebf2b1e706 add doc for compute fep/ta 2022-03-28 20:01:59 +08:00
d7f95da8f3 add extract_setting special function to variable command 2022-03-28 08:00:29 -04:00
4545954385 reformat for wider lines 2022-03-28 07:24:51 -04:00
13228ca29a add dimension check 2022-03-28 13:34:36 +08:00
c52bffda9c remove defunct LBtype argument from lb/fluid doc 2022-03-27 11:26:23 -04:00
cf17fd2306 remap ghost atoms, no need to forward_comm() 2022-03-27 21:49:51 +08:00
603136a93b rename some function & variable, output delta area 2022-03-27 20:52:00 +08:00
7c333b8e07 include bonded eng, cancel neigh build & fix bugs 2022-03-27 20:22:16 +08:00
ff107315cb need to always extract the path to MPI include directory 2022-03-26 23:20:57 -04:00
980b6cada7 update formatting 2022-03-26 10:55:10 -04:00
36444a1db1 add DOI for 29 September 2021 version 2022-03-26 10:48:45 -04:00
356091e1e0 support kspace plugin
I need such feature in the development of deepmd-kit.
2022-03-26 03:39:07 -04:00
2e84700224 delete unused variable "pairflag" 2022-03-26 13:55:22 +08:00
dc668ed0df update to README instructions 2022-03-25 16:11:17 -06:00
55d3edef2f doc info in sequence_driver.py 2022-03-25 16:10:43 -06:00
d710d19aef Enforce pre_exchange() order for (currently) unused update option 2022-03-25 15:56:59 -06:00
4d037376af include GHub whitespace changes 2022-03-25 15:19:13 -06:00
0c1516b34d Add another missing change 2022-03-25 14:14:42 -07:00
055fefc542 finished MDI engine and test script debugging 2022-03-25 15:07:38 -06:00
d648247b80 whitespace 2022-03-25 13:03:56 -07:00
d131223161 Restore changes lost in Git shuffle 2022-03-25 12:59:45 -07:00
9f0eb2ea1a Add note about memory 2022-03-25 12:17:33 -07:00
b14086f3f9 Update docs 2022-03-25 12:12:04 -07:00
a5e22c07c7 Merge branch 'kk_npair_ghost_gpu' of github.com:stanmoore1/lammps into neigh_transpose 2022-03-25 11:49:17 -07:00
01abeda9ef Merge branch 'develop' of https://github.com/lammps/lammps into kk_npair_ghost_gpu 2022-03-25 12:08:32 -06:00
e2e046c452 add missing host overload to make Clang happy
Change-Id: Ib0bd9dec3ecc6bf13b9894b07024172a9810cd77
2022-03-25 12:05:25 -06:00
17b35878ea Add version of Kokkos Ghost neigh list optimized for GPUs 2022-03-25 12:03:20 -06:00
c3f4dac7dc Small tweak to comments 2022-03-25 09:45:05 -07:00
6dae6198a2 Add neigh transpose as Kokkos package option 2022-03-25 09:17:39 -07:00
2279b28df2 Update from upstream 2022-03-25 09:00:56 -07:00
8e9b508c88 Merge branch 'develop' of github.com:lammps/lammps into Elastic_stress 2022-03-25 16:01:35 +01:00
274db39aa5 demo of new compute style fep/ta 2022-03-25 22:41:39 +08:00
29ada4e263 Update description header 2022-03-25 11:19:59 +00:00
2ae448d9d0 Add kokkos-sycl.cmake & relevant compiler flags 2022-03-25 11:05:09 +00:00
58f59197ff silence warnings from coverity scan 2022-03-25 05:30:01 -04:00
5663a9c38b print current LAMMPS version number in configuration summary 2022-03-24 17:07:45 -04:00
4e180bc237 update URL for downloading old LAMMPS versions 2022-03-24 17:02:07 -04:00
6fd8b2b177 Merge pull request #3122 from akohlmey/maintenance-2021-09-29
Third round of maintenance fixes for the stable release
2022-03-24 14:20:52 -04:00
dad8fb8b06 Removing residual files 2022-03-24 11:44:44 -06:00
6edaf42b3d fix temperature initialization bug in KOKKOS nose-hoover code 2022-03-24 11:44:24 -04:00
79c047487d fix parallel execution bug for shell command 2022-03-24 07:38:44 -04:00
ac5acb9abf update threebody example 2022-03-24 07:31:02 -04:00
87fbbd3b13 small kokkos fixes from upstream 2022-03-24 07:18:24 -04:00
8ac0ec6473 Changes needed to compile LAMMPS with latest Kokkos develop 2022-03-24 06:09:03 -04:00
6e959b6f43 more robust response to >COORDS command 2022-03-23 17:21:00 -06:00
66f97ef6bc whitespace 2022-03-23 17:22:46 -04:00
a4018dbb4b update MDI library to version 1.3.0 2022-03-23 17:18:19 -04:00
92a968a8a9 Resolving merge conflicts 2022-03-23 14:28:27 -06:00
42dd772455 more work on plugin mode 2022-03-23 13:45:20 -06:00
9417e41676 Rename sphere/bpm, remove bond instance, add smooth option 2022-03-23 11:41:27 -06:00
c4425a1b0e debugging plugin mode 2022-03-23 11:17:51 -06:00
ace6c67697 Copy .h & .cpp from compute_fep for comparison 2022-03-23 22:26:44 +08:00
8acba74c4d correct input to load potential file from local folder 2022-03-22 22:32:39 -04:00
34bcbdf41d update extep potential file 2022-03-22 22:31:48 -04:00
1ee40f8f8f change to tests 2022-03-22 11:11:43 -06:00
194751e800 add support for full minimizations 2022-03-22 09:32:31 -06:00
eb44b6b1fa Merge branch 'develop' into mdi-expand 2022-03-22 08:39:24 -06:00
6555c7302d debugging for series of calcs 2022-03-22 08:38:39 -06:00
2e539918c1 slight change in __init__.py to fix *.a bug 2022-03-21 22:55:28 -07:00
862e4ba67a Added different pytorch modules that allow different handling of element types and proposal for __init__.py bug fix 2022-03-21 22:45:28 -07:00
d519ca0213 add missing reaxff files to purge list 2022-03-21 14:34:14 -04:00
6f2c09c187 Merge branch 'develop' of github.com:lammps/lammps into Elastic_stress 2022-03-21 10:46:53 +01:00
a392e8dc09 accept infile with 0 lines, so we can create a template from the restart 2022-03-21 00:33:40 -04:00
a4d4f77bc2 run setup_bodies_dynamic() before processing infile in case that is not resetting all data 2022-03-21 00:32:49 -04:00
83a8f72d83 fix off-by-one bug when writing restart files for rigid bodies 2022-03-20 19:14:13 -04:00
3c54b56cfe update overlooked date stamp 2022-03-19 21:00:14 -04:00
30966dfed0 Bugfix from @weinbe2 2022-03-18 14:14:34 -06:00
e12e06198c enable long md and min runs 2022-03-17 17:58:26 -06:00
ff1a08f148 fixes to CMake build for ML-QUIP package from upstream 2022-03-17 18:07:12 -04:00
cf06f71514 more refactoring of MDI engine 2022-03-16 17:46:01 -06:00
396a95f7af Merge pull request #12 from weinbe2/neigh_transpose
Addition of a  "smart" transpose routine with scratch memory staging
2022-03-16 12:29:21 -06:00
d49c27e362 Added a "smart" transpose routine with scratch memory staging for neighbor table transposes between LR and LL 2022-03-16 14:12:20 -04:00
5a53b0fc03 import python3 compatibility changes to tools/python from upstream 2022-03-16 13:24:53 -04:00
afc634eef2 Merge branch 'develop' of https://github.com/lammps/lammps into neigh_transpose 2022-03-16 08:44:09 -06:00
e550600ebe Error fixed. Epsilon and sigma must also be symmetric 2022-03-16 09:09:52 -04:00
7cb13be52a fix bug where it was not possible to use an absolute path for write_coeff 2022-03-16 09:08:47 -04:00
7215939a89 Streamline documentation 2022-03-16 10:47:56 +00:00
8d341e0714 remove EVAL command 2022-03-15 17:13:15 -06:00
99fa769800 more syncing 2022-03-15 16:15:57 -06:00
2a171cf2a2 sync new and old versions with current LAMMPS 2022-03-15 16:10:54 -06:00
636f00276e sync with current Modify methods for fix lookup 2022-03-15 14:12:23 -06:00
1a04eabb5e merge in current develop 2022-03-11 10:01:25 -07:00
8ba4e7e897 tweaks to src files, added examples dir 2022-03-11 09:33:34 -07:00
ab56d7ecd7 augment cmake library search path to include the CUDA stubs library folder
this will help configuring and compiling LAMMPS with CUDA support on
machines where there is no CUDA driver installed
2022-03-10 23:02:57 -05:00
1249c713f0 Add transpose to neigh list 2022-03-08 14:28:06 -07:00
9742817ba3 Dihedrals analytical results of compute_born_matrix are still wrong but, in some low deformations cases, they are ok. This is a progress... 2022-03-08 10:16:30 +01:00
67a7764086 Initalizing nullptrs, fixing labels, small errors in doc, and sign errors in rot sliding damp 2022-03-05 17:07:02 -07:00
bd6ac3ee6d for 2d systems, rigid bodies always have a moment of inertia and no DOFs need to be subtracted 2022-03-02 16:41:35 -05:00
4c57b8f1db Remove duplicate etypes setting 2022-03-01 19:44:17 +00:00
0edda42eee Bugfix macro inversion 2022-03-01 17:58:56 +01:00
09e544cb8c Changed label of compute_angles/dihedrals for better reading. compute_dihedrals is not working ATM. Also implemented some changes from AThompson. 2022-03-01 16:58:14 +01:00
cd9d3ae5d3 Merge branch 'Elastic_stress' of github.com:Bibobu/lammps into Elastic_stress 2022-03-01 11:04:39 +01:00
27ca0a8f41 trigger building an "intel" style neighbor list so that buffers are allocated 2022-02-27 14:50:48 -05:00
f688b9b6b5 use consistent names, avoid memory leaks, fix off-by-1 error in fourier dihedral 2022-02-27 12:25:32 -05:00
27c1ed86fa Added some self-citations for key contributors 2022-02-25 17:03:45 -07:00
d26f953a0a Made the example match the benchmark of Kluge et al. 2022-02-25 15:25:47 -07:00
16c61b3cc0 add support for plumed 2.6.5, 2.6.6, 2.7.3, 2.7.4, and 2.8.0 (default 2.7.4) 2022-02-25 16:37:00 -05:00
6e74d0a09a LAMMPS GridComm patch 2022-02-25 08:13:16 +00:00
fb480f22fc make cythonize detection compatible with /bin/dash on ubunutu 2022-02-24 21:24:04 -05:00
d0507559a4 when updating ML-IAP due to adding/removing PYTHON we need to delete and re-add cythonize support 2022-02-24 20:40:55 -05:00
ali
58eb331b08 Python 3 compatibility for log commands in tools/python 2022-02-23 10:22:29 -05:00
313d850dd2 Created a Born matrix example for silicon 2022-02-21 19:38:28 -07:00
a9c7d47072 Found parenthesis error in compute_angles(). Now perfect fit with numdiff. 2022-02-21 10:59:37 +01:00
1dae118419 Merged A. Thompson symmetric sheared. Added a bit more explicit comment on virial_addon computation. 2022-02-21 09:40:22 +01:00
67ffef094d Switch shear strain fields to symmetric 2022-02-20 13:51:14 -07:00
f205567fa6 add born/matrix support to hybrid pair styles 2022-02-20 07:15:11 -05:00
e4027ba98a update example input files 2022-02-20 06:35:35 -05:00
c1dfd944af turn some warnings into errors and produce better error messages 2022-02-20 06:07:39 -05:00
60a6747c0e must propagate and check born_matrix_enable flag 2022-02-20 05:51:51 -05:00
bd48c49c2b enable and apply clang-format 2022-02-20 05:51:16 -05:00
7d79a7822b Merge branch 'develop' into Elastic_stress 2022-02-20 05:28:42 -05:00
a3c6d19599 Merged comments modification in EXTRA-COMPUTE/compute_born_matrix from A. Thompson and G. Clavier. 2022-02-20 11:22:20 +01:00
c04f4a913f Thomas-Fermi 2022-02-20 07:47:28 +00:00
bc8d1e0f84 Tweaked one comment 2022-02-19 20:55:37 -07:00
407df3127b Cleaned up source files 2022-02-19 20:21:02 -07:00
4ca5441cf1 Updated documentation 2022-02-19 19:25:02 -07:00
61377f41ad Replaced Si.sw with a simlink to potentials dir 2022-02-19 18:01:37 -07:00
f1f2cebf98 Rearranged the directory tree for ELASTIC_T and BORN_MATRIX 2022-02-19 17:59:27 -07:00
c8ae3c45ac Removed cij_nvt directory and updated RADME 2022-02-19 17:09:39 -07:00
335fa2e742 Addd born/matrix numdiff to example 2022-02-19 17:07:21 -07:00
39f8ccdb42 Fixing an overlooked merge conflict 2022-02-18 15:33:26 -07:00
642b1e25f6 Updating to develop 2022-02-18 13:58:38 -07:00
5a95b35fb3 Adding bondstyle restart and fixing a few labels 2022-02-18 10:22:08 -07:00
c68015ca87 Bug fix for Intel package skip lists with multiple runs. 2022-02-18 05:11:34 -05:00
583c22d6e0 update tools/eam_database from upstream 2022-02-16 11:46:11 -05:00
ae72356961 Removed unnecessary declarations in compute_born_matrix numdiff part. Commented virial_addon method. 2022-02-15 23:26:40 +01:00
2f281b3184 Merge branch 'develop' of github.com:lammps/lammps into Elastic_stress 2022-02-15 16:19:03 +01:00
374a172246 Changed "exclude" keyword to "overlap"
+ added new error description to header file
+ minor fix in the doc file
2022-02-14 12:46:44 +01:00
563f98b898 Some changes in examples directory, nothing important for now 2022-02-12 12:38:58 +01:00
58a4694d92 Remove incorrect error check in ReaxFF 2022-02-11 16:19:00 -05:00
397889e697 Modifications to virial addon contributions 2022-02-10 19:55:23 -07:00
97cf345528 don't allow exceptions to "escape" a destructor 2022-02-10 21:13:26 -05:00
0658abbdd4 silence possible warnings about missing files on "make clean-all" 2022-02-10 21:10:34 -05:00
72026a58bf make certain that "offset" is always initialized 2022-02-10 21:05:12 -05:00
7152231a10 plug memory leak 2022-02-10 20:56:51 -05:00
8fe8a667b6 update create.f with changes from NIST database
also add parameters for Cr and document in README file and change
the code to create output files with .eam.alloy extension
2022-02-10 20:45:16 -05:00
560c543e69 add extra communication of special neighbors when using angle constraints 2022-02-10 20:44:39 -05:00
c5e6650924 import bugfixes for crashes and memory leaks in MSM kspace style from develop 2022-02-10 20:36:35 -05:00
10373ea5c9 avoid failures with "most" presets 2022-02-10 20:11:00 -05:00
4f36dad942 Removed the bogus loop in numdiff and manually se the factors in numdiff. 2022-02-10 11:51:03 +01:00
efa5db4c58 ELECTRODE package 2022-02-10 11:33:38 +01:00
4d6fcb3a8b Merge branch 'develop' of https://github.com/lammps/lammps into Elastic_stress before comiting to pull request 2022-02-08 16:46:23 +01:00
9ed13157eb Added examples/cij_nvt/in.lj* changes to make Git happy. 2022-02-08 16:42:33 +01:00
9833e5bc66 Hopefully got compute_born_matrix numdiff method working. Also added two BORN_MATRIX examples. 2022-02-08 16:40:52 +01:00
78cf0365e6 bugfixes 2022-02-08 02:13:42 +01:00
ba89ad546a Tried to make the fusion with Aidan Thomps modification of compute_born + several headers issues (essentially adding override flag to virtual methods) 2022-02-07 00:12:27 +01:00
b6822a18f7 Merge branch 'Elastic_stress' of github.com:Bibobu/lammps into Elastic_stress 2022-02-06 20:04:51 +01:00
a110b1d475 1) Added born_matrix method to bond_harmonic, angle_cosine_squared and dihedral_nharmonic
2) Changed compute_born_matrix so it can takes arguments pair bond angle dihedral to output only selected elements. Also moved flags to creator method and added error/warning messages
2022-02-06 20:00:55 +01:00
4de02c7f2f Tweaked input script 2022-02-04 16:28:29 -07:00
652ff43f64 Got a good match with some Born elements with P != 0 2022-02-03 21:58:25 -07:00
ea0b4f0f33 Got a good match with some Born elements with P != 0 2022-02-03 18:16:21 -07:00
7cd9975e29 Fixed one obvious error in numdiff version, matching analytic quite well for P~=0, need to fix addon term 2022-02-03 17:44:47 -07:00
330dd6a7a8 Documentation update for maxtries & exclude 2022-02-03 23:18:51 +01:00
b06d4a3300 exclude_cutoff to exclude_radius 2022-02-03 21:58:14 +01:00
1da12feafc Prepared for implementation of exclude
- maxtries returned as separate option
- errors for incompatible options (var with single + new)
2022-02-01 00:46:15 +01:00
1b6f850d42 Prepared for implementation 2022-02-01 00:17:21 +01:00
b7c8ab639c Dummy change 2022-01-30 16:44:35 -07:00
7a14cf765f Fixed silent error in albe[][] 2022-01-30 16:34:49 -07:00
c09e3c0890 Updated documentation 2022-01-30 16:27:33 -07:00
fb2f7f1b99 Merge branch 'Elastic_stress' of github.com:athomps/lammps into Elastic_stress 2022-01-30 16:19:20 -07:00
d79a96caae Updated documentation 2022-01-30 16:18:34 -07:00
cc9c578006 Got all the pieces in, now just need to get the right answer 2022-01-30 15:52:16 -07:00
0f85809acf Created branch on athomps/lammps repo 2022-01-30 12:37:33 -07:00
992b1cf582 label as update #3 2022-01-25 07:42:00 -05:00
1505f3de06 fix tag caching issue in INTEL package 2022-01-25 07:41:37 -05:00
fc13c95c85 tweaks and bugs 2022-01-24 20:55:28 +01:00
86ee1f5a1f updated create_atoms.h/cpp with accumulated changes 2022-01-24 20:38:51 +01:00
5142934a26 update to modern matrix representation 2022-01-22 16:38:58 -05:00
78ed631877 spelling 2022-01-22 16:30:03 -05:00
fa88dacd7b integrate into manual and build/source code system. apply conventions 2022-01-22 16:29:48 -05:00
5db5322902 move compute to its designated location 2022-01-22 16:24:07 -05:00
3ff1902b57 Renamed born method born_matrix in all classes. Changed compute_born to compute_born_matrix. Changed the compute coding to suit the LAMMPS style rules better. 2022-01-21 18:39:16 +01:00
8531622966 Merge branch 'develop' of https://www.github.com/lammps/lammps into Elastic_stress 2022-01-20 09:53:07 +01:00
f420bce07e First commit of the Elastic constant computation compute modification 2022-01-20 09:52:24 +01:00
566efe04f2 always fall back to using the .so extension if available in the LAMMPS module folder 2022-01-19 10:12:50 -05:00
c17eb14739 Fixing memory leak and wrong label 2022-01-14 15:45:18 -07:00
524d86605a Fixing reference in documentation 2022-01-12 10:56:30 -07:00
19abc5d329 Merge branch 'develop' into BPM 2022-01-12 10:52:11 -07:00
7586adbb6a Merge pull request #3029 from akohlmey/maintenance-2021-09-29
Second round of maintenance fixes for the stable release
2022-01-06 19:58:51 -05:00
69d6ddccc5 create missing de,df table elements from linear extrapolation 2022-01-05 15:34:30 -05:00
5ae496dcef backport array dimension bugfix for NETCDF package in simplified form 2022-01-03 19:55:23 -05:00
bc5d742623 explain that the computed force in python pair is force/r same as in Pair:single() 2022-01-03 10:12:38 -05:00
882e699163 Incorporate bugfixes from issue #3074, a few additional cleanups 2022-01-03 10:11:18 -05:00
9c725d79d6 correct code example for current code 2022-01-01 16:42:28 -05:00
79fbf437a3 correct format string for Error::one() 2021-12-29 16:19:10 -05:00
d130aa4289 address segfault issue with fix nve/gpu when group is not "all" 2021-12-29 14:06:52 -05:00
5d8b83a251 backport GPU package build system updates from upstream 2021-12-27 20:30:43 -05:00
5a2548a83d have internal fix/compute ids include the fix id for fix reaxff/species
this allows using the fix multiple times
also remove code and warning that checks for multiple fix instances

# Conflicts:
#	src/REAXFF/fix_reaxff_species.cpp
2021-12-23 11:36:28 -05:00
a85b310e1f add missing fclose() 2021-12-23 11:28:24 -05:00
744e615dbb Revamping public methods for history, adding support for bond react 2021-12-13 17:35:53 -07:00
668d7805d6 Fixes to doc 2021-12-10 11:34:12 -07:00
439853c4a8 Moving store/local to an internal fix 2021-12-10 10:33:52 -07:00
e51fd40547 correct names of the pack/unpack routines for forward communication 2021-12-09 18:33:13 -05:00
455cb09cf4 Adding compatability with MC fixes, set_array to property/atom, faster update/special/bonds, single methods, and misc small changes 2021-12-08 16:47:42 -07:00
62f271658b correct setting forward/reverse buffer size info 2021-12-08 13:58:12 -05:00
0aa742934f correct docs for pair style local/density 2021-12-08 00:51:52 -05:00
a26a709a7b correct handling of data packing for forward and reverse communication 2021-12-08 00:51:52 -05:00
f3eac179e6 Expanding broken bonds documentation, adding support for more create/delete bond commands, misc small edits 2021-12-06 17:27:25 -07:00
40258f8b9a Adding Steve's edits in documenation + associated changes in files 2021-12-03 16:12:31 -07:00
7113334f99 Fixing typos in documentation 2021-11-29 16:19:45 -07:00
5fa185bfda Fixing bug in failing to update values across runs 2021-11-29 14:04:07 -07:00
027293d285 whitespace 2021-11-24 15:47:05 -05:00
f7d049ac2d generate atom tags for newly created atoms, if tags are enabled. triclinic support. 2021-11-24 15:36:16 -05:00
ea0ff1c8f7 Update CMake utility function get_lammps_version()
With the introduction of LAMMPS_UPDATE, version.h is no longer a single line
file. With this change the CMake utility will only process the LAMMPS_VERSION
line. Fixes issue #3038
2021-11-23 10:44:40 -05:00
5c1bb5f13a Write dump header after sort to fix incorrect atom count for multiproc 2021-11-22 15:52:27 -05:00
47f3f9d44a Merge branch 'develop' of github.com:Iximiel/lammps into develop 2021-11-18 14:36:45 +01:00
c918b6fbcc removed example dump file 2021-11-18 14:36:38 +01:00
8faa750f21 Merge branch 'lammps:develop' into develop 2021-11-18 14:34:12 +01:00
4646671e70 added examples 2021-11-18 14:32:39 +01:00
a759987515 added examples 2021-11-18 14:31:21 +01:00
a5df494176 added examples 2021-11-18 14:30:26 +01:00
b06a70c33c corrected some errors in the manual 2021-11-18 12:40:10 +01:00
24d9b4b611 Update lebedeva potential file and docs based on email on mailing list
https://matsci.org/t/lammps-users-webpage-and-parameter-file-for-the-lebedeva-potential/39059
2021-11-17 08:45:55 -05:00
a0e75c9006 correct unit description of eta_n0 parameters. fixes #3016 2021-11-17 08:38:09 -05:00
2435b953e1 increment update counter 2021-11-17 07:04:44 -05:00
c042e12323 clarifications and corrections for the discussion of the main git branches 2021-11-17 07:04:13 -05:00
e9efe46db9 update branch names 2021-11-17 07:03:56 -05:00
ecc14b7308 update documentation to refer to the new branch names (develop, release) 2021-11-17 07:03:27 -05:00
0152fe5cdf fix segfault when using atom style smd as part of a hybrid style
also remove redundant for clearing
2021-11-16 21:49:56 -05:00
892d17af22 plug memory leaks 2021-11-16 21:49:41 -05:00
2cca00203e Avoid file name collisions in dump unit tests
# Conflicts:
#	unittest/formats/test_dump_atom.cpp
2021-11-16 15:08:27 -05:00
9f4626a62a correct uninitialized data access bug due to shadowing of a base class member 2021-11-16 10:51:46 -05:00
7a914c84d7 again correction in the documentation 2021-11-12 16:25:48 +01:00
0eb227e7de working on the documentation 2021-11-12 14:55:48 +01:00
fe5f00bbea Updating the documentation, now 'make html' do not give errors 2021-11-12 14:37:16 +01:00
bfc34023b1 working on the documentation 2021-11-12 12:01:05 +01:00
cfe08ba55f working on the manual 2021-11-12 10:32:04 +01:00
c488e912e6 adding the pair_smatb to lammps documentation 2021-11-11 17:01:03 +01:00
80efc8839a fixed a grammar mistake 2021-11-11 16:36:48 +01:00
bdc4f7fb18 styled the headers 2021-11-11 16:27:09 +01:00
1c0e6578b6 changed some comments 2021-11-11 16:12:26 +01:00
4f4b18ab7e addig smatb pairs 2021-11-11 16:06:42 +01:00
e890a0b45e Merge pull request #2999 from akohlmey/maintenance-2021-09-29
Maintenance fixes for the stable release
2021-11-09 15:11:19 -05:00
acb1c8e7f2 Moving update/special/bonds into bond style to ensure correct fix ordering 2021-11-07 17:55:53 -07:00
68223f0385 mention that dump sorting is limited to less than 2 billion atoms 2021-11-07 08:31:15 -05:00
1291a88bff skip MPI tests if they would be oversubscribing the available processors 2021-11-07 08:30:19 -05:00
d9b687450a account for increased floating point errors when summing numbers to zero 2021-11-07 08:30:04 -05:00
bd950b37d7 change git:// protocol for accessing github to https:// protocol
https://github.blog/2021-09-01-improving-git-protocol-security-github/
2021-11-02 15:30:27 -04:00
f5626a2b9d Few more merge conflicts 2021-11-02 12:29:49 -06:00
679132b607 Replacing some needed header files 2021-11-02 12:10:20 -06:00
21fcdf8c56 Fix bug in Kokkos neighborlist where stencil wasn't updated for occasional list 2021-11-02 13:17:28 -04:00
d7f7835069 Fix merge conflicts, minor style fixes 2021-11-01 18:13:06 -06:00
e3c9d7936b Merge branch 'develop' of github.com:lammps/lammps into coo_opt 2021-11-01 17:00:13 -06:00
f05807f38e Revert 647380a 2021-11-01 14:34:50 -06:00
3d2a97b4a9 Fix bug in Kokkos neighborlist where stencil wasn't updated for occasional list 2021-11-01 14:07:04 -06:00
7e08525ce3 Merge branch 'master' of https://github.com/lammps/lammps into coo_opt 2021-11-01 12:57:26 -06:00
6b400fb4bf fix indexing bug 2021-10-31 16:19:17 -04:00
d982298ab2 update new LAMMPS paper citation info 2021-10-28 10:09:01 -04:00
765fd7f763 Use correct sizeof in memset 2021-10-27 17:46:37 -04:00
ae3e6e423a Fix loop level 2021-10-27 13:51:41 -06:00
2ca7dcb853 Use lighter construct than powint 2021-10-27 13:41:29 -06:00
2d52821cf5 Update from develop 2021-10-27 13:14:29 -06:00
0325047c01 update a few GPU kernels so they can be compiled on GPUs without double precisions support 2021-10-21 07:34:05 -04:00
647380a357 Avoid bitshift that gave incorrect results on GPU 2021-10-20 13:21:07 -06:00
2dce8923ee more direct version of clearing out loaded plugins 2021-10-19 08:28:19 -04:00
8d1ba074be wipe out all loaded plugins before destroying the LAMMPS instance 2021-10-18 18:06:09 -04:00
4675a3b560 Only check for GPU double precision support if a GPU is present 2021-10-18 13:44:37 -04:00
8999b1f69f add a LAMMPS_UPDATE string define to signal updates to stable releases 2021-10-17 18:06:04 -04:00
6c2b19c11b Add support for an "Update #" appendix to the version string
This is for informative output only, so that any code depending
on the LAMMPS_VERSION define will not have to be changed and no
warnings will be printed etc.
2021-10-17 18:05:29 -04:00
a425334928 port dump vtk to correctly support custom per-atom arrays and fix some bugs 2021-10-17 11:00:33 -04:00
db2faf2789 fix bugs related to custom per-atom properties in dump style custom 2021-10-17 11:00:21 -04:00
fdbb7d0da4 Report only compatible GPU, i.e. no GPU if mixed/double precision is requested by the hardware does not support it 2021-10-15 20:26:47 -04:00
52cd99918f pppm kspace styles also require -DFFT_SINGLE when using GPUs in single precision 2021-10-15 20:24:47 -04:00
a3e6a95ffb allow single precision FFT introspection 2021-10-15 20:24:47 -04:00
5b65169997 correct expansion of fix/compute/variable arguments to avoid bogus thermo outpu 2021-10-15 20:23:57 -04:00
5f3bf69e30 plug memory leaks 2021-10-15 17:00:46 -04:00
01d96fc684 Whitespace 2021-10-15 12:50:46 -06:00
d97e55d54a Precompute some sqrt factors 2021-10-15 11:53:54 -06:00
23cd143aae Merge branch 'master' of github.com:lammps/lammps into coo_opt 2021-10-15 10:54:16 -06:00
17316f92c7 Add optimized version of compute_orientorder_atom from Tomas Oppelstrup (LLNL) 2021-10-12 07:50:05 -07:00
507c02b9af must set define to "see" the lammps_open() library function 2021-10-09 10:21:31 -04:00
b7fe47ba48 Fix bugs and compilation issues in KOKKOS 2021-10-08 09:39:53 -04:00
69e600c404 Misc updates and style fixes 2021-10-06 14:13:48 -06:00
7dfd11da4b re-freeze Sphinx and other pip installed packages for doc build
The change relative to the stable release fixes a bug with python 3.10 support
2021-10-05 10:52:34 -04:00
97ba95f30e fix a couple more bugs like in 5246cedda6 2021-10-05 10:39:03 -04:00
c1945b4ec9 Fix misplaced MPI calls bug in pair style drip 2021-10-04 07:12:50 -04:00
c4291a4b8e unfreeze versions of python packages used to build the documentation 2021-10-02 23:57:23 -04:00
5b5dfa86c5 also update eigen download for traditional build 2021-10-02 23:56:28 -04:00
3ca3f6959f update eigen3 to the latest release and move download to our own server 2021-10-02 22:55:06 -04:00
f7b7bfa406 Avoid assertions in PythonCapabilities check when using external KOKKOS 2021-10-01 12:05:59 -04:00
3d2f29c92d fix memory allocation bug causing memory corruption on 32-bit arches 2021-10-01 01:16:45 -04:00
faf9c1532a issue with EVAL command 2021-09-24 16:26:57 -06:00
0f2bebdb9b Adding bpm/spring pairstyle, misc small edits 2021-09-24 10:45:46 -06:00
be17d775e0 more debugging 2021-09-23 15:12:07 -06:00
c855c6f0ab rename 2 version to regular version 2021-09-23 12:55:28 -06:00
8b69b232a8 rename old version to old in filename 2021-09-23 12:48:43 -06:00
dcfdddf83f more bug fixes for new MDI classs 2021-09-23 12:39:11 -06:00
18f0d2e1b5 Adding spring bondstyle 2021-09-20 18:06:10 -06:00
0029ed106b more adjustments to MDI engine code 2021-09-10 17:59:19 -06:00
1e26fe2d6f support for reset_box and create_atom commands 2021-09-09 17:16:33 -06:00
5e0c754d04 Fixing style issues 2021-09-09 14:17:39 -06:00
f9a972220e Fixing data compression in history, small update to model 2021-09-09 09:00:21 -06:00
0e72aae0a3 Adding examples and misc bug fixes 2021-09-08 18:39:56 -06:00
6193ebaba7 remove earlier USER-MDI files 2021-09-03 16:01:16 -06:00
481d6128c7 Merge branch 'master' into mdi-expand 2021-09-03 15:51:34 -06:00
a8a97962d2 more changes for AIMD testing 2021-09-03 15:50:17 -06:00
75cb6fc51b added support for LAMMPS as MDI AIMD driver 2021-09-02 17:52:10 -06:00
55f20288b1 Merge branch 'master' into mdi-expand 2021-08-30 16:52:49 -06:00
328e730c8f Merge branch 'master' into mdi-expand 2021-08-30 14:31:29 -06:00
d2984d2615 Merge branch 'master' into BPM 2021-08-27 10:04:04 -06:00
bb720626e3 Adding files for BPM 2021-08-27 09:22:56 -06:00
64d7b73d7c Update region.rst
Include a few lines describing the "ellipsoid" option
2021-08-09 07:54:41 +02:00
35aeadfdd4 implementation of a "ellipsoidal" region option
Based on the code of the region_sphere and the code described in https://www.geometrictools.com/Documentation/DistancePointEllipseEllipsoid.pdf, an option for axis-aligned ellipsoidal regions has been implemented
2021-08-08 17:01:51 +02:00
f8ebcff078 changes to mdi_engine 2021-06-22 09:36:40 -06:00
8761ae65a3 Merge branch 'master' into mdi-expand 2021-06-10 09:50:23 -06:00
41d7038c1e trial versions of new mdi_engine and fix_mdi_engine 2021-05-27 17:24:29 -06:00
a3e204a99d Simplified reset_extra_dof 2021-03-17 16:23:04 +10:00
97f90f1146 Cleaned up math for clarity 2021-03-17 15:56:48 +10:00
471cfa8ac3 Fixed inconsistent default extra_dof value 2021-03-17 14:31:17 +10:00
aad0a9a0f3 Updated documentation to reflect changes in compute_temp_profile 2021-03-17 14:14:33 +10:00
b1b7f7a248 Fixed treatment of DoF when streaming velocity not subtracted in some dimensions 2021-03-17 13:59:16 +10:00
5e4dd5321c Using local dof and tfactor for compute_array to prevent overwrite 2021-03-17 13:38:51 +10:00
c643389ec4 Treat extra_dof as system-wide in compute_array for consistency, and include fix_dof 2021-03-17 11:38:07 +10:00
ab07427339 Corrected default extra_dof 2021-03-17 09:52:05 +10:00
2e2b1b3687 Initial commit... 2019-05-02 15:17:31 +01:00
5056 changed files with 217860 additions and 128979 deletions

1
.gitattributes vendored
View File

@ -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
View File

@ -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

View File

@ -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

View File

@ -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
View File

@ -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
View File

@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

View File

@ -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

View File

@ -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

View File

@ -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
View 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
View File

@ -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:

View File

@ -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.

View File

@ -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
View 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
View 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

View File

@ -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
View 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()

View File

@ -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"
} }
] ]
} }

View File

@ -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()

View File

@ -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)

View File

@ -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.

View File

@ -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()

View File

@ -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()

View 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})

View File

@ -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)

View File

@ -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()

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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})

View File

@ -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})

View File

@ -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()

View File

@ -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

View File

@ -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)

View File

@ -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}

View File

@ -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)

View File

@ -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

View File

@ -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()

View File

@ -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()

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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()

View File

@ -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

View File

@ -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()

View File

@ -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})

View File

@ -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}")

View File

@ -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/)

View File

@ -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}")

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View 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"

View File

@ -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)

View File

@ -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)

View 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)

View File

@ -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

View File

@ -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

View File

@ -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

View 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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View 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)

View 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)

View File

@ -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
View File

@ -1,6 +1,6 @@
/old /old
/html /html
/html-offline /fasthtml
/epub /epub
/latex /latex
/mathjax /mathjax

View File

@ -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;\
) )

View File

@ -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

View File

@ -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.

View 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

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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,

View File

@ -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/

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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'

View File

@ -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.

View File

@ -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.

View File

@ -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>`

View File

@ -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>`

View File

@ -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>`

View File

@ -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>`

View File

@ -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>`

View File

@ -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>`

View File

@ -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

View File

@ -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>`

View File

@ -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

View File

@ -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",

View File

@ -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);

View File

@ -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

View File

@ -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.

View File

@ -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

View 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