Skip to content

Commit

Permalink
Merge pull request lammps#3919 from akohlmey/collected-small-fixes
Browse files Browse the repository at this point in the history
Collected small fixes and updates
  • Loading branch information
akohlmey authored Sep 16, 2023
2 parents c82e7b1 + 6d12800 commit 3e9f1c8
Show file tree
Hide file tree
Showing 16 changed files with 155 additions and 126 deletions.
6 changes: 3 additions & 3 deletions doc/src/Build_basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,9 @@ using CMake or Make.

.. code-block:: bash
-D BUILD_TOOLS=value # yes or no (default)
-D BUILD_LAMMPS_SHELL=value # yes or no (default)
-D BUILD_TOOLS=value # yes or no (default). Build binary2txt, chain.x, micelle2d.x, msi2lmp, phana, stl_bin2txt
-D BUILD_LAMMPS_SHELL=value # yes or no (default). Build lammps-shell
-D BUILD_LAMMPS_GUI=value # yes or no (default). Build lammps-gui
The generated binaries will also become part of the LAMMPS installation
(see below).
Expand All @@ -503,7 +504,6 @@ using CMake or Make.
make binary2txt # build only binary2txt tool
make chain # build only chain tool
make micelle2d # build only micelle2d tool
make thermo_extract # build only thermo_extract tool
cd lammps/tools/lammps-shell
make # build LAMMPS shell
Expand Down
186 changes: 93 additions & 93 deletions doc/src/Build_extras.rst
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,50 @@ included in the LAMMPS source distribution in the ``lib/lepton`` folder.

----------

.. _machdyn:

MACHDYN package
-------------------------------

To build with this package, you must download the Eigen3 library.
Eigen3 is a template library, so you do not need to build it.

.. tabs::

.. tab:: CMake build

.. code-block:: bash
-D DOWNLOAD_EIGEN3 # download Eigen3, value = no (default) or yes
-D EIGEN3_INCLUDE_DIR=path # path to Eigen library (only needed if a custom location)
If ``DOWNLOAD_EIGEN3`` is set, the Eigen3 library will be
downloaded and inside the CMake build directory. If the Eigen3
library is already on your system (in a location where CMake
cannot find it), set ``EIGEN3_INCLUDE_DIR`` to the directory the
``Eigen3`` include file is in.

.. tab:: Traditional make

You can download the Eigen3 library manually if you prefer; follow
the instructions in ``lib/machdyn/README``. You can also do it in one
step from the ``lammps/src`` dir, using a command like these,
which simply invokes the ``lib/machdyn/Install.py`` script with the
specified args:

.. code-block:: bash
make lib-machdyn # print help message
make lib-machdyn args="-b" # download to lib/machdyn/eigen3
make lib-machdyn args="-p /usr/include/eigen3" # use existing Eigen installation in /usr/include/eigen3
Note that a symbolic (soft) link named ``includelink`` is created
in ``lib/machdyn`` to point to the Eigen dir. When LAMMPS builds it
will use this link. You should not need to edit the
``lib/machdyn/Makefile.lammps`` file.

----------

.. _mliap:

ML-IAP package
Expand Down Expand Up @@ -1431,6 +1475,55 @@ ML-POD package

----------

.. _ml-quip:

ML-QUIP package
---------------------------------

To build with this package, you must download and build the QUIP
library. It can be obtained from GitHub. For support of GAP
potentials, additional files with specific licensing conditions need
to be downloaded and configured. The automatic download will from
within CMake will download the non-commercial use version.

.. tabs::

.. tab:: CMake build

.. code-block:: bash
-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 USE_INTERNAL_LINALG=value # Use the internal linear algebra library instead of LAPACK
# value = no (default) or yes
CMake will try to download and build the QUIP library from GitHub,
if it is not found on the local machine. This requires to have git
installed. It will use the same compilers and flags as used for
compiling LAMMPS. Currently this is only supported for the GNU
and the Intel compilers. Set the ``QUIP_LIBRARY`` variable if you
want to use a previously compiled and installed QUIP library and
CMake cannot find it.

The QUIP library requires LAPACK (and BLAS) and CMake can identify
their locations and pass that info to the QUIP build script. But
on some systems this triggers a (current) limitation of CMake and
the configuration will fail. Try enabling ``USE_INTERNAL_LINALG`` in
those cases to use the bundled linear algebra library and work around
the limitation.

.. tab:: Traditional make

The download/build procedure for the QUIP library, described in
``lib/quip/README`` file requires setting two environment
variables, ``QUIP_ROOT`` and ``QUIP_ARCH``. These are accessed by
the ``lib/quip/Makefile.lammps`` file which is used when you
compile and link LAMMPS with this package. You should only need
to edit ``Makefile.lammps`` if the LAMMPS build can not use its
settings to successfully build on your system.

----------

.. _plumed:

PLUMED package
Expand Down Expand Up @@ -1952,55 +2045,6 @@ verified to work in February 2020 with Quantum Espresso versions 6.3 to

----------

.. _ml-quip:

ML-QUIP package
---------------------------------

To build with this package, you must download and build the QUIP
library. It can be obtained from GitHub. For support of GAP
potentials, additional files with specific licensing conditions need
to be downloaded and configured. The automatic download will from
within CMake will download the non-commercial use version.

.. tabs::

.. tab:: CMake build

.. code-block:: bash
-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 USE_INTERNAL_LINALG=value # Use the internal linear algebra library instead of LAPACK
# value = no (default) or yes
CMake will try to download and build the QUIP library from GitHub,
if it is not found on the local machine. This requires to have git
installed. It will use the same compilers and flags as used for
compiling LAMMPS. Currently this is only supported for the GNU
and the Intel compilers. Set the ``QUIP_LIBRARY`` variable if you
want to use a previously compiled and installed QUIP library and
CMake cannot find it.

The QUIP library requires LAPACK (and BLAS) and CMake can identify
their locations and pass that info to the QUIP build script. But
on some systems this triggers a (current) limitation of CMake and
the configuration will fail. Try enabling ``USE_INTERNAL_LINALG`` in
those cases to use the bundled linear algebra library and work around
the limitation.

.. tab:: Traditional make

The download/build procedure for the QUIP library, described in
``lib/quip/README`` file requires setting two environment
variables, ``QUIP_ROOT`` and ``QUIP_ARCH``. These are accessed by
the ``lib/quip/Makefile.lammps`` file which is used when you
compile and link LAMMPS with this package. You should only need
to edit ``Makefile.lammps`` if the LAMMPS build can not use its
settings to successfully build on your system.

----------

.. _scafacos:

SCAFACOS package
Expand Down Expand Up @@ -2048,50 +2092,6 @@ To build with this package, you must download and build the
----------
.. _machdyn:
MACHDYN package
-------------------------------
To build with this package, you must download the Eigen3 library.
Eigen3 is a template library, so you do not need to build it.
.. tabs::
.. tab:: CMake build
.. code-block:: bash
-D DOWNLOAD_EIGEN3 # download Eigen3, value = no (default) or yes
-D EIGEN3_INCLUDE_DIR=path # path to Eigen library (only needed if a custom location)
If ``DOWNLOAD_EIGEN3`` is set, the Eigen3 library will be
downloaded and inside the CMake build directory. If the Eigen3
library is already on your system (in a location where CMake
cannot find it), set ``EIGEN3_INCLUDE_DIR`` to the directory the
``Eigen3`` include file is in.
.. tab:: Traditional make
You can download the Eigen3 library manually if you prefer; follow
the instructions in ``lib/smd/README``. You can also do it in one
step from the ``lammps/src`` dir, using a command like these,
which simply invokes the ``lib/smd/Install.py`` script with the
specified args:
.. code-block:: bash
make lib-smd # print help message
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
Note that a symbolic (soft) link named ``includelink`` is created
in ``lib/smd`` to point to the Eigen dir. When LAMMPS builds it
will use this link. You should not need to edit the
``lib/smd/Makefile.lammps`` file.
----------
.. _vtk:
VTK package
Expand Down
7 changes: 7 additions & 0 deletions doc/src/Howto_lammps_gui.rst
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,13 @@ General Settings:
log) of the application can be set.
- *Select Text Font:* Opens a font selection dialog where the type and
size for the text editor and log font of the application can be set.
- *GUI update interval:* Allows to set the time interval between GUI
and data updates during a LAMMPS run in milliseconds. The default is
to update the GUI every 100 milliseconds. This is good for most cases.
For LAMMPS runs that run very fast, however, data may be missed and
through lowering this interval, this can be corrected. However, this
will make the GUI use more resources, which may be a problem on some
computers with slower CPUs. The default value is 100 milliseconds.

Accelerators:
^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion doc/src/fix_plumed.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Examples

.. code-block:: LAMMPS
fix pl all plumed all plumed plumedfile plumed.dat outfile p.log
fix pl all plumed plumedfile plumed.dat outfile p.log
Description
"""""""""""
Expand Down
10 changes: 5 additions & 5 deletions lib/machdyn/Install.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@
# help message

HELP = """
Syntax from src dir: make lib-smd args="-b"
or: make lib-smd args="-p /usr/include/eigen3"
Syntax from src dir: make lib-machdyn args="-b"
or: make lib-machdyn args="-p /usr/include/eigen3"
Syntax from lib dir: python Install.py -b
or: python Install.py -p /usr/include/eigen3"
or: python Install.py -v 3.4.0 -b
Example:
make lib-smd args="-b" # download/build in default lib/smd/eigen-eigen-*
make lib-smd args="-p /usr/include/eigen3" # use existing Eigen installation in /usr/include/eigen3
make lib-machdyn args="-b" # download/build in default lib/machdyn/eigen-eigen-*
make lib-machdyn args="-p /usr/include/eigen3" # use existing Eigen installation in /usr/include/eigen3
"""

pgroup = parser.add_mutually_exclusive_group()
Expand Down Expand Up @@ -105,7 +105,7 @@
edir = os.path.join(homepath, "eigen-%s" % version)
os.rename(edir, eigenpath)

# create link in lib/smd to Eigen src dir
# create link in lib/machdyn to Eigen src dir

print("Creating link to Eigen include folder")
if os.path.isfile("includelink") or os.path.islink("includelink"):
Expand Down
6 changes: 3 additions & 3 deletions lib/machdyn/README
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ to use the MACHDYN package in a LAMMPS input script.
The Eigen library is available at http://eigen.tuxfamily.org. It's
a general C++ template library for linear algebra.

You can type "make lib-smd" from the src directory to see help on how
You can type "make lib-machdyn" from the src directory to see help on how
to download build this library via make commands, or you can do the
same thing by typing "python Install.py" from within this directory,
or you can do it manually by following the instructions below.

Instructions:

1. Download the Eigen tarball at http://eigen.tuxfamily.org and
unpack the tarball either in this /lib/smd directory or somewhere
unpack the tarball either in this lib/machdyn directory or somewhere
else on your system. It should unpack with into a directory with
a name similar to eigen-eigen-bdd17ee3b1b3. You can rename
the directory to just "eigen" if you wish. Note that Eigen is a
template library, so you do not have to build it.

2. Create a soft link in this dir (lib/smd)
2. Create a soft link in this dir (lib/machdyn)
to the eigen directory. E.g if you unpacked Eigen in this dir:
% ln -s eigen-eigen-bdd17ee3b1b3 includelink
If you unpacked Eigen somewhere else and renamed
Expand Down
10 changes: 6 additions & 4 deletions src/BODY/fix_wall_body_polyhedron.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,20 @@
------------------------------------------------------------------------- */

#include "fix_wall_body_polyhedron.h"
#include <cmath>
#include <cstring>

#include "atom.h"
#include "atom_vec_body.h"
#include "body_rounded_polyhedron.h"
#include "domain.h"
#include "update.h"
#include "error.h"
#include "force.h"
#include "math_const.h"
#include "math_extra.h"
#include "memory.h"
#include "error.h"
#include "update.h"

#include <cmath>
#include <cstring>

using namespace LAMMPS_NS;
using namespace FixConst;
Expand Down
4 changes: 2 additions & 2 deletions src/KOKKOS/Install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ action compute_coord_atom_kokkos.cpp
action compute_coord_atom_kokkos.h
action compute_erotate_sphere_kokkos.cpp
action compute_erotate_sphere_kokkos.h
action compute_local_comp_atom_kokkos.cpp compute_local_comp_atom.cpp
action compute_local_comp_atom_kokkos.h compute_local_comp_atom.h
action compute_composition_atom_kokkos.cpp compute_composition_atom.cpp
action compute_composition_atom_kokkos.h compute_composition_atom.h
action compute_orientorder_atom_kokkos.cpp
action compute_orientorder_atom_kokkos.h
action compute_temp_deform_kokkos.cpp
Expand Down
2 changes: 0 additions & 2 deletions src/KSPACE/ewald_disp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1129,8 +1129,6 @@ void EwaldDisp::compute_energy_peratom()

/* ---------------------------------------------------------------------- */

#define swap(a, b) { register double t = a; a= b; b = t; }

void EwaldDisp::compute_virial()
{
memset(virial, 0, 6*sizeof(double));
Expand Down
1 change: 1 addition & 0 deletions src/MANYBODY/pair_airebo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ PairAIREBO::PairAIREBO(LAMMPS *lmp)
nextra = 3;
pvector = new double[nextra];

trim_flag = 0; // workaround
maxlocal = 0;
REBO_numneigh = nullptr;
REBO_firstneigh = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion src/read_restart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ void ReadRestart::header()
int itmp = read_int();
if (atom->map_user == Atom::MAP_NONE) atom->map_style = itmp;
} else if (flag == ATOM_MAP_USER) {
int itmp = read_int(); // ignored
read_int(); // ignored
} else if (flag == ATOM_SORTFREQ) {
atom->sortfreq = read_int();
} else if (flag == ATOM_SORTBIN) {
Expand Down
4 changes: 0 additions & 4 deletions tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,11 @@ chain: chain.o
micelle2d: micelle2d.o
ifort micelle2d.o -o micelle2d

thermo_extract: thermo_extract.o
gcc -g thermo_extract.o -o thermo_extract

stl_bin2txt: stl_bin2txt.o
g++ -g stl_bin2txt.o -o stl_bin2txt

clean:
rm binary2txt chain micelle2d
rm thermo_extract
rm *.o

#
Expand Down
2 changes: 1 addition & 1 deletion tools/lammps-gui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.16)

project(lammps-gui VERSION 1.5.3 LANGUAGES CXX)
project(lammps-gui VERSION 1.5.4 LANGUAGES CXX)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
Expand Down
Loading

0 comments on commit 3e9f1c8

Please sign in to comment.