Build LAMMPS with RMCProfile
-
We first need to compile
LAMMPS
separately to obtain the library fileliblammps.so.0
, together with a soft link fileliblammps.so
pointing to the library file. Once we have the compiledliblammps.so.0
library file, creating the soft link is as simple as running,ln -s liblammps.so.0 liblammps.so
-
The
LAMMPS
source codes are hosted on GitHub and the building instructions can be found hereStarting from the
Stable release candidate 2 August 2023
(see the pull request here),LAMMPS
changed the Fortran interface. I haven't checked how we can work with the new interface. The following compiling therefore will only work seamlessly with the version ofLAMMPS
before the aforementioned release. I am not sure whether or not the old wrapper will work with the newer version ofLAMMPS
. In case not, we then have to spend some time checking how to make the new wrapper working with RMCProfile. -
Here follows is a bare minimum example for building
LAMMPS
,source /home/y8z/intel/oneapi/setvars.sh cmake ../cmake -D CMAKE_CXX_COMPILER=icx-cc cmake ../cmake -D BUILD_MPI=no -D BUILD_OMP=yes -D PKG_OPENMP=yes -D BUILD_SHARED_LIBS=yes -D PKG_REAXFF=yes -D PKG_EXTRA-PAIR=yes
Here I am using the intel
oneapi
installed into my own area on Big Bird. It seems that intel changes the compiler name for C++ toicx-cc
instead of the oldicc
.The
-D BUILD_SHARED_LIBS=yes
flags tell the compiler to create the shared library file we need.The implementation of
LAMMPS
in RMCProfile is serial so we don't need the MPI build forLAMMPS
.The
-D PKG_REAXFF=yes
worries about enabling theReaxFF
potential. It is through this kind of flags thatLAMMPS
build controls what potentials to compile.
-
-
Next we need to build the
LAMMPS
wrapper -- source codes for the wrapper were provided with theLAMMPS
source codes.Starting from the
Stable release candidate 2 August 2023
(see the pull request here),LAMMPS
changed the Fortran interface. I haven't checked how we can work with the new interface. The following compiling therefore will only work seamlessly with the version ofLAMMPS
before the aforementioned release. I am not sure whether or not the old wrapper will work with the newer version ofLAMMPS
. In case not, we then have to spend some time checking how to make the new wrapper working with RMCProfile.In the
RMCProfile
repo (thelammps_rmc_ready
branch), under theubuntu1804-cuda-intel
directory, we have aMakefile_lammps_wrapper_oneAPI
file for building theLAMMPS
wrapper, creating the library fileliblammps_fortran.so
. -
Then we just need to link the library when compiling the RMCProfile executable, including the link to both the
liblammps.so
andliblammps_fortran.so
libraries. TheMakefile_mpi_oneAPI
file can be used as the reference about the library linking and the bash scriptbuild_rmcprofile_lammps.sh
combines the step 2 & 3.