Closed elcorto closed 1 year ago
As detailed in #456, the call to install.py
should read
$ cd /path/to/lammps/python
$ python install.py -p lammps -l ../src/liblammps.so -v ../src/version.h -w $(pwd)
Replace ../src/liblammps.so
with ../build/liblammps.so
when using cmake
instead of make
.
Re. compilers, here is a working example using cmake
to build liblammps.so
(HZDR hemera cluster module names). This also uses -j32
jobs. We build an OpenMP version w/o MPI.
$ ml python/3.11.2
$ python -VV
Python 3.11.2 (main, Mar 10 2023, 09:40:18) [GCC 7.3.0]
$ ml gcc/7.3.0 cmake/3.26.1
$ cd /path/to/lammps
$ mkdir build
$ cd build
$ cmake ../cmake/ -D BUILD_MPI=no -D BUILD_OMP=yes -D BUILD_SHARED_LIBS=yes -D PKG_ML-SNAP=yes
$ cmake --build . -j32 --clean-first
$ cd ../python/
$ python install.py -p lammps -l ../build/liblammps.so -v ../src/version.h -w $(pwd)
I won't send a PR to update the docs at this point since @RandomDefaultUser is working on documenting the build for the GPU version of lammps. Once that is done, maybe we can integrate the above as a CPU-only fallback.
-w $(pwd)
is fixed on lammps side and is not needed any longer.
Will be closed by #467
The instructions on how to build the lammps Python module are a bit brief for people not used to building lammps from source.
Compiler
One needs to
make mode=shlib mpi
So something like
if
Using lammps'
install.py
scriptUsing the
mala
branch (https://github.com/mala-project/lammps/commit/e16932716293dab2e0dbed8b666e7f9854b93a5f) of https://github.com/mala-project/lammpsfails
One needs to add
-v ../src/version.h
.