Error When Compiling LAMMPS with USER-DEEPMD package:
Bug summary
Hi, when I do the final compilation of LAMMPS the error report occurred. ](https://user-images.githubusercontent.com/104333661/178149918-a2a93c13-1417-4df7-bbfa-6ff9e2f9dfe4.png) An error will be reported when make final compilation of LAMMPS using the file of user-deepmd package (such as pair_deepmd.h).
DeePMD-kit Version
2.1.3
TensorFlow Version
2.8.2
How did you download the software?
Built from source
Input Files, Running Commands, Error Log, etc.
Gathering installed package information (may take a little while) make[1]: 进入目录“/root/softwares/lammps-stable_23Jun2022/src” Gathering git version information make[1]: 离开目录“/root/softwares/lammps-stable_23Jun2022/src” Compiling LAMMPS for machine mpi make[1]: 进入目录“/root/softwares/lammps-stable_23Jun2022/src/Obj_mpi” make[1]: 离开目录“/root/softwares/lammps-stable_23Jun2022/src/Obj_mpi” make[1]: 进入目录“/root/softwares/lammps-stable_23Jun2022/src/Obj_mpi” mpicxx -g -O3 -std=c++11 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DLMP_GPU -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c ../fft3d_wrap.cpp mpicxx -g -O3 -std=c++11 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DLMP_GPU -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c ../pppm_cg.cpp mpicxx -g -O3 -std=c++11 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DLMP_GPU -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c ../remap_wrap.cpp mpicxx -g -O3 -std=c++11 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DLMP_GPU -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c ../pair_deepmd.cpp mpicxx -g -O3 -std=c++11 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DLMP_GPU -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c ../remap.cpp mpicxx -g -O3 -std=c++11 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DLMP_GPU -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c ../pppm_gpu.cpp mpicxx -g -O3 -std=c++11 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DLMP_GPU -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c ../pppm_tip4p.cpp mpicxx -g -O3 -std=c++11 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DLMP_GPU -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c ../pppm_stagger.cpp mpicxx -g -O3 -std=c++11 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DLMP_GPU -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c ../force.cpp mpicxx -g -O3 -std=c++11 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DLMP_GPU -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c ../pppm_dipole.cpp mpicxx -g -O3 -std=c++11 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DLMP_GPU -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c ../fft3d.cpp mpicxx -g -O3 -std=c++11 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DLMP_GPU -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c ../pppm_disp.cpp mpicxx -g -O3 -std=c++11 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DLMP_GPU -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c ../pppm.cpp mpicxx -g -O3 -std=c++11 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DLMP_GPU -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c ../modify.cpp mpicxx -g -O3 -std=c++11 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DLMP_GPU -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c ../compute_deeptensor_atom.cpp mpicxx -g -O3 -std=c++11 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DLMP_GPU -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c ../fix_dplr.cpp mpicxx -g -O3 -std=c++11 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DLMP_GPU -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -std=c++14 -DHIGH_PREC -DLAMMPS_VERSION_NUMBER=20220623 -I/root/softwares/include/ -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c ../lammps.cpp In file included from ../fft3d_wrap.h:17:0, from ../fft3d_wrap.cpp:15: ../fft3d.h:14:10: 致命错误:mpi.h:没有那个文件或目录 #include <mpi.h> ^~~~~~~ 编译中断。 make[1]: *** [fft3d_wrap.o] 错误 1 make[1]: *** 正在等待未完成的任务.... In file included from ../remap.cpp:15:0: ../remap.h:14:10: 致命错误:mpi.h:没有那个文件或目录 #include <mpi.h> ^~~~~~~ 编译中断。 make[1]: *** [remap.o] 错误 1 In file included from ../fft3d.cpp:23:0: ../fft3d.h:14:10: 致命错误:mpi.h:没有那个文件或目录 #include <mpi.h> ^~~~~~~ 编译中断。 make[1]: *** [fft3d.o] 错误 1 In file included from ../pppm_cg.cpp:28:0: ../remap.h:14:10: 致命错误:mpi.h:没有那个文件或目录 #include <mpi.h> ^~~~~~~ 编译中断。 ../pppm_stagger.cpp:20:10: 致命错误:mpi.h:没有那个文件或目录 #include <mpi.h> ^~~~~~~ 编译中断。 make[1]: *** [pppm_cg.o] 错误 1 make[1]: *** [pppm_stagger.o] 错误 1 In file included from ../remap_wrap.h:18:0, from ../remap_wrap.cpp:15: ../remap.h:14:10: 致命错误:mpi.h:没有那个文件或目录 #include <mpi.h> ^~~~~~~ 编译中断。 make[1]: *** [remap_wrap.o] 错误 1 ../pppm_tip4p.cpp:20:10: 致命错误:mpi.h:没有那个文件或目录 #include <mpi.h> ^~~~~~~ 编译中断。 make[1]: *** [pppm_tip4p.o] 错误 1 In file included from ../fft3d_wrap.h:17:0, from ../pppm_gpu.cpp:24: ../fft3d.h:14:10: 致命错误:mpi.h:没有那个文件或目录 #include <mpi.h> ^~~~~~~ 编译中断。 make[1]: *** [pppm_gpu.o] 错误 1 In file included from ../pair_deepmd.cpp:23:0: ../pair_deepmd.h:14:10: 致命错误:deepmd/DeepPot.h:没有那个文件或目录 #include "deepmd/DeepPot.h" ^~~~~~~~~~~~~~~~~~ 编译中断。 In file included from ../compute_deeptensor_atom.h:11:0, from ../compute_deeptensor_atom.cpp:1: ../pair_deepmd.h:14:10: 致命错误:deepmd/DeepPot.h:没有那个文件或目录 #include "deepmd/DeepPot.h" ^~~~~~~~~~~~~~~~~~ 编译中断。 make[1]: *** [pair_deepmd.o] 错误 1 make[1]: *** [compute_deeptensor_atom.o] 错误 1 In file included from ../style_pair.h:26:0, from ../force.cpp:21: ../pair_deepmd.h:14:10: 致命错误:deepmd/DeepPot.h:没有那个文件或目录 #include "deepmd/DeepPot.h" ^~~~~~~~~~~~~~~~~~ 编译中断。 In file included from ../fft3d_wrap.h:17:0, from ../pppm_disp.cpp:28: ../fft3d.h:14:10: 致命错误:mpi.h:没有那个文件或目录 #include <mpi.h> ^~~~~~~ In file included from ../compute_deeptensor_atom.h:11:0, from ../style_compute.h:17, from ../modify.cpp:15: ../pair_deepmd.h:14:10: 致命错误:deepmd/DeepPot.h:没有那个文件或目录 #include "deepmd/DeepPot.h" ^~~~~~~~~~~~~~~~~~ 编译中断。 编译中断。 In file included from ../fft3d_wrap.h:17:0, from ../pppm.cpp:30: ../fft3d.h:14:10: 致命错误:mpi.h:没有那个文件或目录 #include <mpi.h> ^~~~~~~ 编译中断。 make[1]: *** [force.o] 错误 1 make[1]: *** [pppm_disp.o] 错误 1 make[1]: *** [modify.o] 错误 1 In file included from ../fft3d_wrap.h:17:0, from ../pppm_dipole.cpp:25: ../fft3d.h:14:10: 致命错误:mpi.h:没有那个文件或目录 #include <mpi.h> ^~~~~~~ 编译中断。 make[1]: *** [pppm.o] 错误 1 make[1]: *** [pppm_dipole.o] 错误 1 In file included from ../fix_dplr.h:13:0, from ../fix_dplr.cpp:13: ../pair_deepmd.h:14:10: 致命错误:deepmd/DeepPot.h:没有那个文件或目录 #include "deepmd/DeepPot.h" ^~~~~~~~~~~~~~~~~~ 编译中断。 make[1]: *** [fix_dplr.o] 错误 1 In file included from ../compute_deeptensor_atom.h:11:0, from ../style_compute.h:17, from ../lammps.cpp:21: ../pair_deepmd.h:14:10: 致命错误:deepmd/DeepPot.h:没有那个文件或目录 #include "deepmd/DeepPot.h" ^~~~~~~~~~~~~~~~~~ 编译中断。 make[1]: *** [lammps.o] 错误 1 make[1]: 离开目录“/root/softwares/lammps-stable_23Jun2022/src/Obj_mpi” make: *** [mpi] 错误 2
Steps to Reproduce
make mpi -j4 Follow all the instructions given on the manual. Use the Built-in mode to compile LAMMPS. At the final completion of LAMMPS. The bug will show itself
Further Information, Files, and Links
No response
-I/root/softwares/include/
This path is in your compile command. Could you check if it is correct and /root/softwares/include/deepmd/DeepPot.h exists?
Thanks for your help. I have made the changes according to your advice. But a new error occured. I don't know how to deal it.
mpicxx -g -O3 -std=c++11 -lrt main.o -L../../lib/gpu -L/root/tensorflow/lib -L/root/tensorflow/lib -L/root/softwares/lib -L/root/tensorflow/lib -L/root/tensorflow/lib -L/root/softwares/lib -L/root/tensorflow/lib -L/root/tensorflow/lib -L/root/softwares/lib -L/root/tensorflow/lib -L/root/tensorflow/lib -L/root/softwares/lib -L/root/tensorflow/lib -L/root/tensorflow/lib -L/root/softwares/lib -L/usr/local/mpich-3.3/lib -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib64/stubs -L. -llammps_mpi -lgpu -Wl,--no-as-needed -ldeepmd_cc -ltensorflow_cc -ltensorflow_framework -Wl,-rpath=/root/tensorflow/lib -Wl,-rpath=/root/tensorflow/lib -Wl,-rpath=/root/softwares/lib -Wl,--no-as-needed -ldeepmd_cc -ltensorflow_cc -ltensorflow_framework -Wl,-rpath=/root/tensorflow/lib -Wl,-rpath=/root/tensorflow/lib -Wl,-rpath=/root/softwares/lib -Wl,--no-as-needed -ldeepmd_cc -ltensorflow_cc -ltensorflow_framework -Wl,-rpath=/root/tensorflow/lib -Wl,-rpath=/root/tensorflow/lib -Wl,-rpath=/root/softwares/lib -Wl,--no-as-needed -ldeepmd_cc -ltensorflow_cc -ltensorflow_framework -Wl,-rpath=/root/tensorflow/lib -Wl,-rpath=/root/tensorflow/lib -Wl,-rpath=/root/softwares/lib -Wl,--no-as-needed -ldeepmd_cc -ltensorflow_cc -ltensorflow_framework -Wl,-rpath=/root/tensorflow/lib -Wl,-rpath=/root/tensorflow/lib -Wl,-rpath=/root/softwares/lib /usr/local/mpich-3.3/lib/libmpi.a -lmpich -lmpl -lpthread -lcudart -lcuda -ldl -o ../lmp_mpi
/usr/bin/ld: warning: libdeepmd.so, needed by //lib/libdeepmd_cc.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libdeepmd_op_cuda.so, needed by //lib/libdeepmd_cc.so, not found (try using -rpath or -rpath-link)
./liblammps_mpi.a(info.o):在函数‘LAMMPS_NS::Info::get_gpu_device_infoabi:cxx11’中:
/root/softwares/lammps-stable_23Jun2022/src/Obj_mpi/../info.cpp:1152:对‘lmp_gpu_device_infoabi:cxx11’未定义的引用
./liblammps_mpi.a(info.o):在函数‘LAMMPS_NS::Info::has_accelerator_feature(std::__cxx11::basic_string<char, std::char_traits

I do not quite understand where do you install the DeePMD-kit? The log shows //lib/libdeepmd_cc.so but the command also shows -L/root/softwares/lib.
Thank you for your help. The directory for installing DEEPMD-kit is /root/softwares/deepmd-kit.
Your new error looks unrelated with DeePMD-kit. Did you successfully compile without DeePMD-kit?
Thanks. I'm going to try to apply this method.