Build LAMMPS with RMCProfile
- 
We first need to compile
LAMMPSseparately to obtain the library fileliblammps.so.0, together with a soft link fileliblammps.sopointing to the library file. Once we have the compiledliblammps.so.0library file, creating the soft link is as simple as running,ln -s liblammps.so.0 liblammps.so- 
The
LAMMPSsource 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),LAMMPSchanged 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 ofLAMMPSbefore 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=yesHere I am using the intel
oneapiinstalled into my own area on Big Bird. It seems that intel changes the compiler name for C++ toicx-ccinstead of the oldicc.The
-D BUILD_SHARED_LIBS=yesflags tell the compiler to create the shared library file we need.The implementation of
LAMMPSin RMCProfile is serial so we don't need the MPI build forLAMMPS.The
-D PKG_REAXFF=yesworries about enabling theReaxFFpotential. It is through this kind of flags thatLAMMPSbuild controls what potentials to compile. 
 - 
 - 
Next we need to build the
LAMMPSwrapper -- source codes for the wrapper were provided with theLAMMPSsource codes.Starting from the
Stable release candidate 2 August 2023(see the pull request here),LAMMPSchanged 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 ofLAMMPSbefore 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
RMCProfilerepo (thelammps_rmc_readybranch), under theubuntu1804-cuda-inteldirectory, we have aMakefile_lammps_wrapper_oneAPIfile for building theLAMMPSwrapper, 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.soandliblammps_fortran.solibraries. TheMakefile_mpi_oneAPIfile can be used as the reference about the library linking and the bash scriptbuild_rmcprofile_lammps.shcombines the step 2 & 3.