Standard LAMMPS compilation on WSL2 Ubuntu
Full description for the video:
Compiled version: 2Aug2023 (stable)
(10/12/2023)
Official documentation for building LAMMPS with cmake: https://docs.lammps.org/Build_cmake.html
Tested PC:
- Intel(R) Core(TM) i5-14600K 3.50 GHz
- RTX 2060 SUPER
- Kingston FURY 32GB KIT DDR5 6000MHz CL32 Renegade
- WSL2 Ubuntu version: 22.04
Prerequisites:
Not all are necessary but might be useful:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential libtbb-dev cmake cmake-curses-gui libopenmpi-dev openmpi-bin libfftw3-dev libblas-dev liblapack-dev pkg-config ffmpeg python3-dev
sudo apt-get install python3-pip python3.10-venv python3-venv
OpenMPI compiled with GCC (standard compilation)
Download OpenMPI (use wget command or download from here https://www.open-mpi.org/software/ompi/v5.0/)
wget https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.0.tar.gz
tar xvzf openmpi-5.0.0.tar.gz
cd openmpi-5.0.0
mkdir build
Compile OpenMPI into the ‚build‘ folder:
./configure --prefix=$HOME/SOFTWARE/OpenMPI/openmpi-5.0.0/build
make all -j
make install -j
To use this version of OpenMPI, export the following (either for local use by copying into command line, or by setting it as default by writing into ~/.bashrc on the last two lines):
export PATH=/home/lebedmi2/SOFTWARE/OpenMPI/openmpi-5.0.0/build/bin:$PATH
export LD_LIBRARY_PATH=/home/lebedmi2/SOFTWARE/OpenMPI/openmpi-5.0.0/build/lib:$LD_LIBRARY_PATH
Compile LAMMPS
Download LAMMPS and create ‚build‘ directory:
git clone -b stable https://github.com/lammps/lammps.git lammps_std
cd lammps_std
mkdir build
cd build
If necessary, modify the permissions of this folder to grant access to the current user. Replace ‚lebedmi2‘ with the user’s name, which can be determined using the ‚whoami‚ command. The ‚.‘ symbol represents the current directory:
sudo chown -R lebedmi2 .
Turn on some basic useful packages (ORIENT, PYTHON, OPENMP, MEAM, MANYBODY, MOLECULE)
cmake \
-D PKG_ORIENT=ON \
-D PKG_PYTHON=ON \
-D PKG_OPENMP=ON \
-D PKG_MEAM=ON \
-D PKG_KIM=ON \
-D PKG_KSPACE=ON \
-D PKG_EXTRA-FIX=ON \
-D PKG_MANYBODY=ON \
-D PKG_MOLECULE=ON \
-D PKG_EXTRA-MOLECULE=ON \
-D PKG_TALLY=ON \
-D BUILD_SHARED_LIBS=ON \
../cmake
You can also turn on some additional packages from the cmake GUI if you type:
ccmake .
Compile LAMMPS:
make -j
sudo make install
mv lmp lmp_std
pwd
Run LAMMPS:
mpirun -np 6 lmp_std -in test.in
Run the simulations with OMP accelerator:
mpirun -np 6 lmp_std -sf omp -in test.in
Calculation speed comparison:
—–> HERE <—–