Skip to content

build low and high precision at the same time#879

Merged
amcadmus merged 9 commits intodeepmodeling:develfrom
njzjz:build-precisions
Jul 30, 2021
Merged

build low and high precision at the same time#879
amcadmus merged 9 commits intodeepmodeling:develfrom
njzjz:build-precisions

Conversation

@njzjz
Copy link
Member

@njzjz njzjz commented Jul 22, 2021

We can only provide one package containing both precision.
BREAKING CHANGES:

  • Python: DP_INTERFACE_PREC is now runtime environmental variables
  • C++: CMake will build both C++ API library, which will be called libdeepmd_cc and libdeepmd_cc_low
  • LAMMPS: generate two directory USER-DEEPMD and USER-DEEPMD_low
  • ipi: generate two execuate dp_ipi and dp_ipi_low

njzjz added 2 commits July 22, 2021 19:20
We can only provide one package containing both precisions.
BREAKING CHANGES:
Python: Python package will build both precisions, and DP_FLOAT_PREC
is now runtime envrionmental variables
C++: CMake will build both library, which will be called something like
libdeepmd and libdeepmd_low
LAMMPS: generate two directory USER-DEEPMD and USER-DEEPMD_low
ipi: generate two execuate dp_ipi and dp_ipi_low
@njzjz njzjz force-pushed the build-precisions branch from 6d4e8bd to 73c9fdc Compare July 22, 2021 23:39
@codecov-commenter
Copy link

codecov-commenter commented Jul 22, 2021

Codecov Report

Merging #879 (b8c166b) into devel (4985932) will decrease coverage by 0.03%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            devel     #879      +/-   ##
==========================================
- Coverage   73.88%   73.85%   -0.04%     
==========================================
  Files          85       85              
  Lines        6805     6811       +6     
==========================================
+ Hits         5028     5030       +2     
- Misses       1777     1781       +4     
Impacted Files Coverage Δ
deepmd/env.py 72.61% <50.00%> (-1.46%) ⬇️
deepmd/utils/neighbor_stat.py 95.65% <0.00%> (-4.35%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4985932...b8c166b. Read the comment docs.

@amcadmus amcadmus requested review from denghuilu and galeselee July 23, 2021 01:30
@amcadmus
Copy link
Member

The name DP_FLOAT_PREC is somewhat misleading. Because the floating point precision of the fitting and embedding nets are set by the input.json file. The DP_FLOAT_PREC actually set the floating point precision of the interface of the DP models. Shall we rename it something like DP_INTERFACE_PREC ?

@njzjz
Copy link
Member Author

njzjz commented Jul 23, 2021

The name DP_FLOAT_PREC is somewhat misleading. Because the floating point precision of the fitting and embedding nets are set by the input.json file. The DP_FLOAT_PREC actually set the floating point precision of the interface of the DP models. Shall we rename it something like DP_INTERFACE_PREC ?

wait... Do you mean some libraries have already contained both high and low precision and are independent from HIGH_PREC? These libraries do not need to build twice, but I need to confirm which libraries are still affected by HIGH_PREC.

@amcadmus
Copy link
Member

The name DP_FLOAT_PREC is somewhat misleading. Because the floating point precision of the fitting and embedding nets are set by the input.json file. The DP_FLOAT_PREC actually set the floating point precision of the interface of the DP models. Shall we rename it something like DP_INTERFACE_PREC ?

wait... Do you mean some libraries have already contained both high and low precision and are independent from HIGH_PREC? These libraries do not need to build twice, but I need to confirm which libraries are still affected by HIGH_PREC.

No, the precision of the customized OPs are controlled by HIGH_PREC. I mean the prec of embedding and fitting nets are specified in the training script.

@njzjz
Copy link
Member Author

njzjz commented Jul 23, 2021

I can't find HIGH_PREC keyword except in api_cc, lmp, ipi, and md directory. If the customized OPs are controlled by HIGH_PREC, it's unclear to me how to do this, especially for Python OPs...

@njzjz
Copy link
Member Author

njzjz commented Jul 23, 2021

I think libdeepmd_op and libdeepmd_op_low, libdeepmd_op_cuda and libdeepmd_op_cuda_low, libdeepmd_op_rocm and libdeepmd_op_rocm_low, libdeepmd and libdeepmd_low maybe the same library... ping @denghuilu and @pkulzy to make a confirmation.

@amcadmus
Copy link
Member

I can't find HIGH_PREC keyword except in api_cc, lmp, ipi, and md directory. If the customized OPs are controlled by HIGH_PREC, it's unclear to me how to do this, especially for Python OPs...

You are right, now customized OPs are built with both precs.

@njzjz njzjz force-pushed the build-precisions branch from 54092b7 to 153a754 Compare July 23, 2021 03:08
@njzjz
Copy link
Member Author

njzjz commented Jul 23, 2021

I've reverted changes to lib directory and op directory.

PREC_SUFFIX=""
else
PREC_DEF="-DLOW_PREC"
PREC_SUFFIX="_low"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better if I changed this to LOW?
When I compile LAMMPS I need to manually change the "_low" to "_LOW"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the specific name do you mean you need to change? _low is used in 3 names, including -ldeepmd_cc_low, USER-DEEPMD_low, and ipi_low.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean USER-DEEPMD_low.
Otherwise, the following error occurs

[ludh@login09 src]$ make yes-user-deepmd_Low
Package USER-DEEPMD_LOW does not exist
make: *** [Makefile:364: yes-user-deepmd_Low] Error 1
I have to do this:
mv USER-DEEPMD_low USER-DEEPMD_LOW
then
make yes-user-deepmd_low
Installing package user-deepmd_low

Copy link
Member

@denghuilu denghuilu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I compile the deepmd-kit c++ interface through the following way, an error occurred:

  • build deepmd-kit:
root deepmd-kit $ ls
codecov.yml      data    doc       LICENSE         README.md         setup.cfg  source
CONTRIBUTING.md  deepmd  examples  pyproject.toml  requirements.txt  setup.py
root deepmd-kit $ cd source/
root source $ mkdir build
root source $ cd build/

root build $ cmake -DTENSORFLOW_ROOT=$tensorflow_root -DCMAKE_INSTALL_PREFIX=$deepmd_root -DUSE_CUDA_TOOLKIT=true ..
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.17.1") 
-- Supported model version: 1.0 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found CUDA: /usr/local/cuda-11.2 (found version "11.2") 
-- Found CUDA in /usr/local/cuda-11.2, build nv GPU support
-- Will not build AMD GPU support
-- Enabled cpp interface build, looking for tensorflow_cc and tensorflow_framework
-- Found TensorFlow: /root/softwares/tensorflow-2.4.0/include;/root/softwares/tensorflow-2.4.0/include, /root/softwares/tensorflow-2.4.0/lib/libtensorflow_cc.so;/root/softwares/tensorflow-2.4.0/lib/libtensorflow_framework.so, /root/softwares/tensorflow-2.4.0/lib/libtensorflow_framework.so  in /root/softwares/tensorflow-2.4.0;/root/softwares/tensorflow-2.4.0/../tensorflow_core;/root/softwares/tensorflow-2.4.0;/root/softwares/tensorflow-2.4.0/../tensorflow_core;/usr/;/usr/local/ (found version "2.4.0")
-- Automatically determined OP_CXX_ABI=1 
-- Set GLIBCXX_USE_CXX_ABI=1 when compiling ops
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- CUDA major version is 11
-- Configuring done
-- Generating done
-- Build files have been written to: /root/dp-devel/deepmd-kit/source/build

root build $ make install -j12
[  1%] Building NVCC (Device) object lib/src/cuda/CMakeFiles/deepmd_op_cuda.dir/deepmd_op_cuda_generated_tabulate.cu.o
Scanning dependencies of target deepmd_cc_low
Scanning dependencies of target deepmd_op
[  2%] Building NVCC (Device) object lib/src/cuda/CMakeFiles/deepmd_op_cuda.dir/deepmd_op_cuda_generated_gelu.cu.o
[  4%] Building NVCC (Device) object lib/src/cuda/CMakeFiles/deepmd_op_cuda.dir/deepmd_op_cuda_generated_coord.cu.o
Scanning dependencies of target deepmd_cc
Scanning dependencies of target deepmd_ipi_low
[  5%] Building NVCC (Device) object lib/src/cuda/CMakeFiles/deepmd_op_cuda.dir/deepmd_op_cuda_generated_prod_env_mat.cu.o
[  7%] Building NVCC (Device) object lib/src/cuda/CMakeFiles/deepmd_op_cuda.dir/deepmd_op_cuda_generated_neighbor_list.cu.o
Scanning dependencies of target deepmd_ipi
[  8%] Building NVCC (Device) object lib/src/cuda/CMakeFiles/deepmd_op_cuda.dir/deepmd_op_cuda_generated_prod_force_grad.cu.o
[  9%] Building NVCC (Device) object lib/src/cuda/CMakeFiles/deepmd_op_cuda.dir/deepmd_op_cuda_generated_prod_force.cu.o
[ 11%] Building CXX object ipi/CMakeFiles/deepmd_ipi.dir/src/Convert.cc.o
[ 12%] Building CXX object ipi/CMakeFiles/deepmd_ipi_low.dir/src/Convert.cc.o
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
[ 15%] Building CXX object api_cc/CMakeFiles/deepmd_cc_low.dir/src/AtomMap.cc.o
[ 15%] Building CXX object api_cc/CMakeFiles/deepmd_cc.dir/src/AtomMap.cc.o
[ 16%] Building CXX object op/CMakeFiles/deepmd_op.dir/prod_force.cc.o
[ 18%] Building CXX object api_cc/CMakeFiles/deepmd_cc.dir/src/DataModifier.cc.o
[ 19%] Building CXX object api_cc/CMakeFiles/deepmd_cc_low.dir/src/DataModifier.cc.o
[ 22%] Building CXX object ipi/CMakeFiles/deepmd_ipi_low.dir/src/XyzFileManager.cc.o
[ 22%] Building CXX object ipi/CMakeFiles/deepmd_ipi.dir/src/XyzFileManager.cc.o
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
[ 23%] Building C object ipi/CMakeFiles/deepmd_ipi.dir/src/sockets.c.o
[ 25%] Building C object ipi/CMakeFiles/deepmd_ipi_low.dir/src/sockets.c.o
[ 26%] Linking CXX shared library libdeepmd_ipi.so
[ 28%] Linking CXX shared library libdeepmd_ipi_low.so
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
Warning: Unused direct dependencies:
        /lib/x86_64-linux-gnu/libm.so.6
        /usr/lib/x86_64-linux-gnu/libgomp.so.1
Warning: Unused direct dependencies:
        /lib/x86_64-linux-gnu/libm.so.6
        /usr/lib/x86_64-linux-gnu/libgomp.so.1
[ 28%] Built target deepmd_ipi
[ 28%] Built target deepmd_ipi_low
[ 29%] Building CXX object api_cc/CMakeFiles/deepmd_cc_low.dir/src/DeepPot.cc.o
[ 30%] Building CXX object api_cc/CMakeFiles/deepmd_cc.dir/src/DeepPot.cc.o
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
[ 32%] Building CXX object op/CMakeFiles/deepmd_op.dir/prod_virial.cc.o
[ 33%] Building CXX object api_cc/CMakeFiles/deepmd_cc_low.dir/src/DeepTensor.cc.o
[ 35%] Building CXX object api_cc/CMakeFiles/deepmd_cc.dir/src/DeepTensor.cc.o
[ 36%] Building NVCC (Device) object lib/src/cuda/CMakeFiles/deepmd_op_cuda.dir/deepmd_op_cuda_generated_prod_virial.cu.o
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
[ 38%] Building NVCC (Device) object lib/src/cuda/CMakeFiles/deepmd_op_cuda.dir/deepmd_op_cuda_generated_prod_virial_grad.cu.o
[ 39%] Building NVCC (Device) object lib/src/cuda/CMakeFiles/deepmd_op_cuda.dir/deepmd_op_cuda_generated_region.cu.o
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
[ 40%] Building CXX object op/CMakeFiles/deepmd_op.dir/descrpt.cc.o
[ 42%] Building CXX object op/CMakeFiles/deepmd_op.dir/prod_env_mat_multi_device.cc.o
[ 43%] Building CXX object api_cc/CMakeFiles/deepmd_cc_low.dir/src/common.cc.o
[ 45%] Building CXX object api_cc/CMakeFiles/deepmd_cc.dir/src/common.cc.o
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
[ 46%] Building CXX object op/CMakeFiles/deepmd_op.dir/pair_tab.cc.o
[ 47%] Building CXX object op/CMakeFiles/deepmd_op.dir/prod_force_multi_device.cc.o
[ 49%] Building CXX object op/CMakeFiles/deepmd_op.dir/prod_virial_multi_device.cc.o
[ 50%] Building CXX object op/CMakeFiles/deepmd_op.dir/soft_min.cc.o
[ 52%] Building CXX object op/CMakeFiles/deepmd_op.dir/soft_min_force.cc.o
[ 53%] Building CXX object op/CMakeFiles/deepmd_op.dir/soft_min_virial.cc.o
[ 54%] Building CXX object op/CMakeFiles/deepmd_op.dir/gelu_multi_device.cc.o
[ 56%] Building CXX object op/CMakeFiles/deepmd_op.dir/tabulate_multi_device.cc.o
[ 57%] Linking CXX shared library libdeepmd_cc_low.so
[ 59%] Linking CXX shared library libdeepmd_cc.so
Warning: Unused direct dependencies:
        /usr/lib/x86_64-linux-gnu/libgomp.so.1
[ 59%] Built target deepmd_cc_low
Warning: Unused direct dependencies:
        /usr/lib/x86_64-linux-gnu/libgomp.so.1
[ 59%] Built target deepmd_cc
Scanning dependencies of target deepmd_op_cuda
[ 60%] Linking CXX shared library libdeepmd_op_cuda.so
Warning: Unused direct dependencies:
        /lib/x86_64-linux-gnu/libm.so.6
        /usr/lib/x86_64-linux-gnu/libgomp.so.1
[ 60%] Built target deepmd_op_cuda
Scanning dependencies of target deepmd
[ 64%] Building CXX object lib/CMakeFiles/deepmd.dir/src/coord.cc.o
[ 64%] Building CXX object lib/CMakeFiles/deepmd.dir/src/env_mat.cc.o
[ 64%] Building CXX object lib/CMakeFiles/deepmd.dir/src/ewald.cc.o
[ 66%] Building CXX object lib/CMakeFiles/deepmd.dir/src/gelu.cc.o
[ 69%] Building CXX object lib/CMakeFiles/deepmd.dir/src/fmt_nlist.cc.o
[ 69%] Building CXX object lib/CMakeFiles/deepmd.dir/src/map_aparam.cc.o
[ 70%] Building CXX object lib/CMakeFiles/deepmd.dir/src/neighbor_list.cc.o
[ 71%] Building CXX object lib/CMakeFiles/deepmd.dir/src/pair_tab.cc.o
[ 73%] Building CXX object lib/CMakeFiles/deepmd.dir/src/prod_env_mat.cc.o
[ 74%] Building CXX object lib/CMakeFiles/deepmd.dir/src/prod_force.cc.o
[ 76%] Building CXX object lib/CMakeFiles/deepmd.dir/src/prod_force_grad.cc.o
[ 77%] Building CXX object lib/CMakeFiles/deepmd.dir/src/prod_virial.cc.o
[ 78%] Building CXX object lib/CMakeFiles/deepmd.dir/src/prod_virial_grad.cc.o
[ 80%] Building CXX object lib/CMakeFiles/deepmd.dir/src/region.cc.o
[ 81%] Building CXX object lib/CMakeFiles/deepmd.dir/src/soft_min_switch.cc.o
[ 83%] Building CXX object lib/CMakeFiles/deepmd.dir/src/soft_min_switch_force.cc.o
[ 84%] Building CXX object lib/CMakeFiles/deepmd.dir/src/soft_min_switch_force_grad.cc.o
[ 85%] Building CXX object lib/CMakeFiles/deepmd.dir/src/soft_min_switch_virial.cc.o
[ 87%] Building CXX object lib/CMakeFiles/deepmd.dir/src/soft_min_switch_virial_grad.cc.o
[ 88%] Building CXX object lib/CMakeFiles/deepmd.dir/src/tabulate.cc.o
[ 90%] Building CXX object lib/CMakeFiles/deepmd.dir/src/utilities.cc.o
[ 91%] Building CXX object lib/CMakeFiles/deepmd.dir/src/SimulationRegion.cpp.o
[ 92%] Linking CXX shared library libdeepmd.so
Warning: Unused direct dependencies:
        /root/dp-devel/deepmd-kit/source/build/lib/src/cuda/libdeepmd_op_cuda.so
[ 92%] Built target deepmd
[ 94%] Linking CXX shared library libdeepmd_op.so
[ 94%] Built target deepmd_op
Scanning dependencies of target dp_ipi
Scanning dependencies of target dp_ipi_low
[ 97%] Building CXX object ipi/CMakeFiles/dp_ipi.dir/driver.cc.o
[ 97%] Building CXX object ipi/CMakeFiles/dp_ipi_low.dir/driver.cc.o
[ 98%] Linking CXX executable dp_ipi_low
[100%] Linking CXX executable dp_ipi
Warning: Unused direct dependencies:
        /root/dp-devel/deepmd-kit/source/build/op/libdeepmd_op.so
        /root/softwares/tensorflow-2.4.0/lib/libtensorflow_cc.so.2
        /root/softwares/tensorflow-2.4.0/lib/libtensorflow_framework.so.2
        /root/dp-devel/deepmd-kit/source/build/lib/src/cuda/libdeepmd_op_cuda.so
        /lib/x86_64-linux-gnu/libdl.so.2
        /lib/x86_64-linux-gnu/librt.so.1
        /lib/x86_64-linux-gnu/libm.so.6
        /usr/lib/x86_64-linux-gnu/libgomp.so.1
Warning: Unused direct dependencies:
        /root/dp-devel/deepmd-kit/source/build/op/libdeepmd_op.so
        /root/softwares/tensorflow-2.4.0/lib/libtensorflow_cc.so.2
        /root/softwares/tensorflow-2.4.0/lib/libtensorflow_framework.so.2
        /root/dp-devel/deepmd-kit/source/build/lib/src/cuda/libdeepmd_op_cuda.so
        /lib/x86_64-linux-gnu/libdl.so.2
        /lib/x86_64-linux-gnu/librt.so.1
        /lib/x86_64-linux-gnu/libm.so.6
        /usr/lib/x86_64-linux-gnu/libgomp.so.1
[100%] Built target dp_ipi_low
[100%] Built target dp_ipi
Install the project...
-- Install configuration: "release"
-- Installing: /root/dp-devel/deepmd_root/lib/libdeepmd_op.so
-- Installing: /root/dp-devel/deepmd_root/lib/libdeepmd.so
-- Set runtime path of "/root/dp-devel/deepmd_root/lib/libdeepmd.so" to ""
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/ComputeDescriptor.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/DeviceFunctor.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/SimulationRegion.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/SimulationRegion_Impl.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/coord.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/device.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/env_mat.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/ewald.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/fmt_nlist.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/gelu.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/gpu_cuda.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/gpu_rocm.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/map_aparam.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/neighbor_list.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/pair_tab.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/prod_env_mat.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/prod_force.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/prod_force_grad.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/prod_virial.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/prod_virial_grad.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/region.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/soft_min_switch.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/soft_min_switch_force.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/soft_min_switch_force_grad.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/soft_min_switch_virial.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/soft_min_switch_virial_grad.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/switcher.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/tabulate.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/utilities.h
-- Installing: /root/dp-devel/deepmd_root/lib/libdeepmd_op_cuda.so
-- Installing: /root/dp-devel/deepmd_root/lib/libdeepmd_cc.so
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/AtomMap.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/DataModifier.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/DeepPot.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/DeepTensor.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/common.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/custom_op.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/version.h
-- Installing: /root/dp-devel/deepmd_root/lib/libdeepmd_cc_low.so
-- Up-to-date: /root/dp-devel/deepmd_root/include/deepmd/AtomMap.h
-- Up-to-date: /root/dp-devel/deepmd_root/include/deepmd/DataModifier.h
-- Up-to-date: /root/dp-devel/deepmd_root/include/deepmd/DeepPot.h
-- Up-to-date: /root/dp-devel/deepmd_root/include/deepmd/DeepTensor.h
-- Up-to-date: /root/dp-devel/deepmd_root/include/deepmd/common.h
-- Up-to-date: /root/dp-devel/deepmd_root/include/deepmd/custom_op.h
-- Up-to-date: /root/dp-devel/deepmd_root/include/deepmd/version.h
-- Installing: /root/dp-devel/deepmd_root/lib/libdeepmd_ipi.so
-- Installing: /root/dp-devel/deepmd_root/bin/dp_ipi
-- Set runtime path of "/root/dp-devel/deepmd_root/bin/dp_ipi" to "$ORIGIN/../lib:/root/softwares/tensorflow-2.4.0/lib:/root/softwares/tensorflow-2.4.0/lib"
-- Installing: /root/dp-devel/deepmd_root/lib/libdeepmd_ipi_low.so
-- Installing: /root/dp-devel/deepmd_root/bin/dp_ipi_low
-- Set runtime path of "/root/dp-devel/deepmd_root/bin/dp_ipi_low" to "$ORIGIN/../lib:/root/softwares/tensorflow-2.4.0/lib:/root/softwares/tensorflow-2.4.0/lib"
  • build lammps interface within deepmd-kit:
root build $ make lammps
-- Supported model version: 1.0 
-- Found CUDA in /usr/local/cuda-11.2, build nv GPU support
-- Will not build AMD GPU support
-- Enabled cpp interface build, looking for tensorflow_cc and tensorflow_framework
-- Found TensorFlow: /root/softwares/tensorflow-2.4.0/include;/root/softwares/tensorflow-2.4.0/include, /root/softwares/tensorflow-2.4.0/lib/libtensorflow_cc.so;/root/softwares/tensorflow-2.4.0/lib/libtensorflow_framework.so, /root/softwares/tensorflow-2.4.0/lib/libtensorflow_framework.so  in /root/softwares/tensorflow-2.4.0;/root/softwares/tensorflow-2.4.0/../tensorflow_core;/root/softwares/tensorflow-2.4.0;/root/softwares/tensorflow-2.4.0/../tensorflow_core;/usr/;/usr/local/ (found version "2.4.0")
-- Automatically determined OP_CXX_ABI=1 
-- Set GLIBCXX_USE_CXX_ABI=1 when compiling ops
-- Found OpenMP_C: -fopenmp  
-- Found OpenMP_CXX: -fopenmp  
-- Found OpenMP: TRUE   
-- CUDA major version is 11
-- Configuring done
-- Generating done
-- Build files have been written to: /root/dp-devel/deepmd-kit/source/build
Scanning dependencies of target lammps
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD/fix_dplr.h
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD/pppm_dplr.h
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD/fix_dplr.cpp
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD/pair_deepmd.cpp
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD/pppm_dplr.cpp
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD/Install.sh
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD/env.sh
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD/pair_deepmd.h
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD_low/fix_dplr.h
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD_low/pppm_dplr.h
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD_low/fix_dplr.cpp
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD_low/pair_deepmd.cpp
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD_low/pppm_dplr.cpp
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD_low/Install.sh
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD_low/env.sh
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD_low/pair_deepmd.h
Built target lammps
  • build lammps package:
root build $ cd ../../../lammps/src
root src $ cp -r /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD .
root src $ make yes-user-deepmd
Installing package user-deepmd

root src $ make mpi -j12
Gathering installed package information (may take a little while)
make[1]: Entering directory '/root/dp-devel/lammps/src'
Gathering git version information
make[1]: Leaving directory '/root/dp-devel/lammps/src'
Compiling LAMMPS for machine mpi
make[1]: Entering directory '/root/dp-devel/lammps/src/Obj_mpi'
cc -O -o fastdep.exe ../DEPEND/fastdep.c
make[1]: Leaving directory '/root/dp-devel/lammps/src/Obj_mpi'
make[1]: Entering directory '/root/dp-devel/lammps/src/Obj_mpi'
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../main.cpp
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../reader_xyz.cpp
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../compute_adf.cpp
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../pair_morse_smooth_linear.cpp
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../angle_deprecated.cpp
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../ewald.cpp
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../fix_dt_reset.cpp
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../fix_deform.cpp
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../bond_harmonic_shift.cpp
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../atom.cpp
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../meam_setup_param.cpp
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../nstencil_half_multi_2d_newton.cpp
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:1: error: macro names must be identifiers
Makefile:109: recipe for target 'meam_setup_param.o' failed
make[1]: *** [meam_setup_param.o] Error 1
make[1]: *** Waiting for unfinished jobs....
Makefile:109: recipe for target 'fix_dt_reset.o' failed
make[1]: *** [fix_dt_reset.o] Error 1
Makefile:109: recipe for target 'reader_xyz.o' failed
make[1]: *** [reader_xyz.o] Error 1
Makefile:109: recipe for target 'main.o' failed
make[1]: *** [main.o] Error 1
Makefile:109: recipe for target 'angle_deprecated.o' failed
make[1]: *** [angle_deprecated.o] Error 1
Makefile:109: recipe for target 'nstencil_half_multi_2d_newton.o' failed
make[1]: *** [nstencil_half_multi_2d_newton.o] Error 1
Makefile:109: recipe for target 'bond_harmonic_shift.o' failed
make[1]: *** [bond_harmonic_shift.o] Error 1
Makefile:109: recipe for target 'pair_morse_smooth_linear.o' failed
make[1]: *** [pair_morse_smooth_linear.o] Error 1
Makefile:109: recipe for target 'compute_adf.o' failed
make[1]: *** [compute_adf.o] Error 1
Makefile:109: recipe for target 'ewald.o' failed
make[1]: *** [ewald.o] Error 1
Makefile:109: recipe for target 'fix_deform.o' failed
make[1]: *** [fix_deform.o] Error 1
Makefile:109: recipe for target 'atom.o' failed
make[1]: *** [atom.o] Error 1
make[1]: Leaving directory '/root/dp-devel/lammps/src/Obj_mpi'
Makefile:195: recipe for target 'mpi' failed
make: *** [mpi] Error 2

And there's an empty -D within the Makefile.package :

# Settings for libraries used by specific LAMMPS packages
# this file is auto-edited when those packages are included/excluded

PKG_INC =      -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/
PKG_PATH =     -L/root/softwares/tensorflow-2.4.0/lib -L/root/softwares/tensorflow-2.4.0/lib -L/root/dp-devel/deepmd_root/lib
PKG_LIB =      -Wl,--no-as-needed -ldeepmd_op_cuda -ldeepmd_op -ldeepmd_cc -ldeepmd -ltensorflow_cc -ltensorflow_framework -Wl,-rpath=/root/softwares/tensorflow-2.4.0/lib -Wl,-rpath=/root/softwares/tensorflow-2.4.0/lib -Wl,-rpath=/root/dp-devel/deepmd_root/lib
PKG_CPP_DEPENDS =
PKG_LINK_DEPENDS =

PKG_SYSINC =
PKG_SYSLIB =
PKG_SYSPATH =

Compile environment: Ubuntu-18.04; CUDA-11.2; TF-2.4.0-gpu; openmpi-4.1.1; cmake-3.10.2; gcc-7.5.0

@njzjz
Copy link
Member Author

njzjz commented Jul 29, 2021

right... Let me see.

@galeselee
Copy link
Contributor

When I compile the deepmd-kit c++ interface through the following way, an error occurred:

  • build deepmd-kit:
root deepmd-kit $ ls
codecov.yml      data    doc       LICENSE         README.md         setup.cfg  source
CONTRIBUTING.md  deepmd  examples  pyproject.toml  requirements.txt  setup.py
root deepmd-kit $ cd source/
root source $ mkdir build
root source $ cd build/

root build $ cmake -DTENSORFLOW_ROOT=$tensorflow_root -DCMAKE_INSTALL_PREFIX=$deepmd_root -DUSE_CUDA_TOOLKIT=true ..
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.17.1") 
-- Supported model version: 1.0 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found CUDA: /usr/local/cuda-11.2 (found version "11.2") 
-- Found CUDA in /usr/local/cuda-11.2, build nv GPU support
-- Will not build AMD GPU support
-- Enabled cpp interface build, looking for tensorflow_cc and tensorflow_framework
-- Found TensorFlow: /root/softwares/tensorflow-2.4.0/include;/root/softwares/tensorflow-2.4.0/include, /root/softwares/tensorflow-2.4.0/lib/libtensorflow_cc.so;/root/softwares/tensorflow-2.4.0/lib/libtensorflow_framework.so, /root/softwares/tensorflow-2.4.0/lib/libtensorflow_framework.so  in /root/softwares/tensorflow-2.4.0;/root/softwares/tensorflow-2.4.0/../tensorflow_core;/root/softwares/tensorflow-2.4.0;/root/softwares/tensorflow-2.4.0/../tensorflow_core;/usr/;/usr/local/ (found version "2.4.0")
-- Automatically determined OP_CXX_ABI=1 
-- Set GLIBCXX_USE_CXX_ABI=1 when compiling ops
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- CUDA major version is 11
-- Configuring done
-- Generating done
-- Build files have been written to: /root/dp-devel/deepmd-kit/source/build

root build $ make install -j12
[  1%] Building NVCC (Device) object lib/src/cuda/CMakeFiles/deepmd_op_cuda.dir/deepmd_op_cuda_generated_tabulate.cu.o
Scanning dependencies of target deepmd_cc_low
Scanning dependencies of target deepmd_op
[  2%] Building NVCC (Device) object lib/src/cuda/CMakeFiles/deepmd_op_cuda.dir/deepmd_op_cuda_generated_gelu.cu.o
[  4%] Building NVCC (Device) object lib/src/cuda/CMakeFiles/deepmd_op_cuda.dir/deepmd_op_cuda_generated_coord.cu.o
Scanning dependencies of target deepmd_cc
Scanning dependencies of target deepmd_ipi_low
[  5%] Building NVCC (Device) object lib/src/cuda/CMakeFiles/deepmd_op_cuda.dir/deepmd_op_cuda_generated_prod_env_mat.cu.o
[  7%] Building NVCC (Device) object lib/src/cuda/CMakeFiles/deepmd_op_cuda.dir/deepmd_op_cuda_generated_neighbor_list.cu.o
Scanning dependencies of target deepmd_ipi
[  8%] Building NVCC (Device) object lib/src/cuda/CMakeFiles/deepmd_op_cuda.dir/deepmd_op_cuda_generated_prod_force_grad.cu.o
[  9%] Building NVCC (Device) object lib/src/cuda/CMakeFiles/deepmd_op_cuda.dir/deepmd_op_cuda_generated_prod_force.cu.o
[ 11%] Building CXX object ipi/CMakeFiles/deepmd_ipi.dir/src/Convert.cc.o
[ 12%] Building CXX object ipi/CMakeFiles/deepmd_ipi_low.dir/src/Convert.cc.o
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
[ 15%] Building CXX object api_cc/CMakeFiles/deepmd_cc_low.dir/src/AtomMap.cc.o
[ 15%] Building CXX object api_cc/CMakeFiles/deepmd_cc.dir/src/AtomMap.cc.o
[ 16%] Building CXX object op/CMakeFiles/deepmd_op.dir/prod_force.cc.o
[ 18%] Building CXX object api_cc/CMakeFiles/deepmd_cc.dir/src/DataModifier.cc.o
[ 19%] Building CXX object api_cc/CMakeFiles/deepmd_cc_low.dir/src/DataModifier.cc.o
[ 22%] Building CXX object ipi/CMakeFiles/deepmd_ipi_low.dir/src/XyzFileManager.cc.o
[ 22%] Building CXX object ipi/CMakeFiles/deepmd_ipi.dir/src/XyzFileManager.cc.o
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
[ 23%] Building C object ipi/CMakeFiles/deepmd_ipi.dir/src/sockets.c.o
[ 25%] Building C object ipi/CMakeFiles/deepmd_ipi_low.dir/src/sockets.c.o
[ 26%] Linking CXX shared library libdeepmd_ipi.so
[ 28%] Linking CXX shared library libdeepmd_ipi_low.so
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
Warning: Unused direct dependencies:
        /lib/x86_64-linux-gnu/libm.so.6
        /usr/lib/x86_64-linux-gnu/libgomp.so.1
Warning: Unused direct dependencies:
        /lib/x86_64-linux-gnu/libm.so.6
        /usr/lib/x86_64-linux-gnu/libgomp.so.1
[ 28%] Built target deepmd_ipi
[ 28%] Built target deepmd_ipi_low
[ 29%] Building CXX object api_cc/CMakeFiles/deepmd_cc_low.dir/src/DeepPot.cc.o
[ 30%] Building CXX object api_cc/CMakeFiles/deepmd_cc.dir/src/DeepPot.cc.o
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
[ 32%] Building CXX object op/CMakeFiles/deepmd_op.dir/prod_virial.cc.o
[ 33%] Building CXX object api_cc/CMakeFiles/deepmd_cc_low.dir/src/DeepTensor.cc.o
[ 35%] Building CXX object api_cc/CMakeFiles/deepmd_cc.dir/src/DeepTensor.cc.o
[ 36%] Building NVCC (Device) object lib/src/cuda/CMakeFiles/deepmd_op_cuda.dir/deepmd_op_cuda_generated_prod_virial.cu.o
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
[ 38%] Building NVCC (Device) object lib/src/cuda/CMakeFiles/deepmd_op_cuda.dir/deepmd_op_cuda_generated_prod_virial_grad.cu.o
[ 39%] Building NVCC (Device) object lib/src/cuda/CMakeFiles/deepmd_op_cuda.dir/deepmd_op_cuda_generated_region.cu.o
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
[ 40%] Building CXX object op/CMakeFiles/deepmd_op.dir/descrpt.cc.o
[ 42%] Building CXX object op/CMakeFiles/deepmd_op.dir/prod_env_mat_multi_device.cc.o
[ 43%] Building CXX object api_cc/CMakeFiles/deepmd_cc_low.dir/src/common.cc.o
[ 45%] Building CXX object api_cc/CMakeFiles/deepmd_cc.dir/src/common.cc.o
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
[ 46%] Building CXX object op/CMakeFiles/deepmd_op.dir/pair_tab.cc.o
[ 47%] Building CXX object op/CMakeFiles/deepmd_op.dir/prod_force_multi_device.cc.o
[ 49%] Building CXX object op/CMakeFiles/deepmd_op.dir/prod_virial_multi_device.cc.o
[ 50%] Building CXX object op/CMakeFiles/deepmd_op.dir/soft_min.cc.o
[ 52%] Building CXX object op/CMakeFiles/deepmd_op.dir/soft_min_force.cc.o
[ 53%] Building CXX object op/CMakeFiles/deepmd_op.dir/soft_min_virial.cc.o
[ 54%] Building CXX object op/CMakeFiles/deepmd_op.dir/gelu_multi_device.cc.o
[ 56%] Building CXX object op/CMakeFiles/deepmd_op.dir/tabulate_multi_device.cc.o
[ 57%] Linking CXX shared library libdeepmd_cc_low.so
[ 59%] Linking CXX shared library libdeepmd_cc.so
Warning: Unused direct dependencies:
        /usr/lib/x86_64-linux-gnu/libgomp.so.1
[ 59%] Built target deepmd_cc_low
Warning: Unused direct dependencies:
        /usr/lib/x86_64-linux-gnu/libgomp.so.1
[ 59%] Built target deepmd_cc
Scanning dependencies of target deepmd_op_cuda
[ 60%] Linking CXX shared library libdeepmd_op_cuda.so
Warning: Unused direct dependencies:
        /lib/x86_64-linux-gnu/libm.so.6
        /usr/lib/x86_64-linux-gnu/libgomp.so.1
[ 60%] Built target deepmd_op_cuda
Scanning dependencies of target deepmd
[ 64%] Building CXX object lib/CMakeFiles/deepmd.dir/src/coord.cc.o
[ 64%] Building CXX object lib/CMakeFiles/deepmd.dir/src/env_mat.cc.o
[ 64%] Building CXX object lib/CMakeFiles/deepmd.dir/src/ewald.cc.o
[ 66%] Building CXX object lib/CMakeFiles/deepmd.dir/src/gelu.cc.o
[ 69%] Building CXX object lib/CMakeFiles/deepmd.dir/src/fmt_nlist.cc.o
[ 69%] Building CXX object lib/CMakeFiles/deepmd.dir/src/map_aparam.cc.o
[ 70%] Building CXX object lib/CMakeFiles/deepmd.dir/src/neighbor_list.cc.o
[ 71%] Building CXX object lib/CMakeFiles/deepmd.dir/src/pair_tab.cc.o
[ 73%] Building CXX object lib/CMakeFiles/deepmd.dir/src/prod_env_mat.cc.o
[ 74%] Building CXX object lib/CMakeFiles/deepmd.dir/src/prod_force.cc.o
[ 76%] Building CXX object lib/CMakeFiles/deepmd.dir/src/prod_force_grad.cc.o
[ 77%] Building CXX object lib/CMakeFiles/deepmd.dir/src/prod_virial.cc.o
[ 78%] Building CXX object lib/CMakeFiles/deepmd.dir/src/prod_virial_grad.cc.o
[ 80%] Building CXX object lib/CMakeFiles/deepmd.dir/src/region.cc.o
[ 81%] Building CXX object lib/CMakeFiles/deepmd.dir/src/soft_min_switch.cc.o
[ 83%] Building CXX object lib/CMakeFiles/deepmd.dir/src/soft_min_switch_force.cc.o
[ 84%] Building CXX object lib/CMakeFiles/deepmd.dir/src/soft_min_switch_force_grad.cc.o
[ 85%] Building CXX object lib/CMakeFiles/deepmd.dir/src/soft_min_switch_virial.cc.o
[ 87%] Building CXX object lib/CMakeFiles/deepmd.dir/src/soft_min_switch_virial_grad.cc.o
[ 88%] Building CXX object lib/CMakeFiles/deepmd.dir/src/tabulate.cc.o
[ 90%] Building CXX object lib/CMakeFiles/deepmd.dir/src/utilities.cc.o
[ 91%] Building CXX object lib/CMakeFiles/deepmd.dir/src/SimulationRegion.cpp.o
[ 92%] Linking CXX shared library libdeepmd.so
Warning: Unused direct dependencies:
        /root/dp-devel/deepmd-kit/source/build/lib/src/cuda/libdeepmd_op_cuda.so
[ 92%] Built target deepmd
[ 94%] Linking CXX shared library libdeepmd_op.so
[ 94%] Built target deepmd_op
Scanning dependencies of target dp_ipi
Scanning dependencies of target dp_ipi_low
[ 97%] Building CXX object ipi/CMakeFiles/dp_ipi.dir/driver.cc.o
[ 97%] Building CXX object ipi/CMakeFiles/dp_ipi_low.dir/driver.cc.o
[ 98%] Linking CXX executable dp_ipi_low
[100%] Linking CXX executable dp_ipi
Warning: Unused direct dependencies:
        /root/dp-devel/deepmd-kit/source/build/op/libdeepmd_op.so
        /root/softwares/tensorflow-2.4.0/lib/libtensorflow_cc.so.2
        /root/softwares/tensorflow-2.4.0/lib/libtensorflow_framework.so.2
        /root/dp-devel/deepmd-kit/source/build/lib/src/cuda/libdeepmd_op_cuda.so
        /lib/x86_64-linux-gnu/libdl.so.2
        /lib/x86_64-linux-gnu/librt.so.1
        /lib/x86_64-linux-gnu/libm.so.6
        /usr/lib/x86_64-linux-gnu/libgomp.so.1
Warning: Unused direct dependencies:
        /root/dp-devel/deepmd-kit/source/build/op/libdeepmd_op.so
        /root/softwares/tensorflow-2.4.0/lib/libtensorflow_cc.so.2
        /root/softwares/tensorflow-2.4.0/lib/libtensorflow_framework.so.2
        /root/dp-devel/deepmd-kit/source/build/lib/src/cuda/libdeepmd_op_cuda.so
        /lib/x86_64-linux-gnu/libdl.so.2
        /lib/x86_64-linux-gnu/librt.so.1
        /lib/x86_64-linux-gnu/libm.so.6
        /usr/lib/x86_64-linux-gnu/libgomp.so.1
[100%] Built target dp_ipi_low
[100%] Built target dp_ipi
Install the project...
-- Install configuration: "release"
-- Installing: /root/dp-devel/deepmd_root/lib/libdeepmd_op.so
-- Installing: /root/dp-devel/deepmd_root/lib/libdeepmd.so
-- Set runtime path of "/root/dp-devel/deepmd_root/lib/libdeepmd.so" to ""
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/ComputeDescriptor.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/DeviceFunctor.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/SimulationRegion.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/SimulationRegion_Impl.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/coord.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/device.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/env_mat.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/ewald.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/fmt_nlist.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/gelu.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/gpu_cuda.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/gpu_rocm.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/map_aparam.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/neighbor_list.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/pair_tab.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/prod_env_mat.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/prod_force.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/prod_force_grad.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/prod_virial.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/prod_virial_grad.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/region.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/soft_min_switch.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/soft_min_switch_force.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/soft_min_switch_force_grad.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/soft_min_switch_virial.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/soft_min_switch_virial_grad.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/switcher.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/tabulate.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/utilities.h
-- Installing: /root/dp-devel/deepmd_root/lib/libdeepmd_op_cuda.so
-- Installing: /root/dp-devel/deepmd_root/lib/libdeepmd_cc.so
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/AtomMap.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/DataModifier.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/DeepPot.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/DeepTensor.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/common.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/custom_op.h
-- Installing: /root/dp-devel/deepmd_root/include/deepmd/version.h
-- Installing: /root/dp-devel/deepmd_root/lib/libdeepmd_cc_low.so
-- Up-to-date: /root/dp-devel/deepmd_root/include/deepmd/AtomMap.h
-- Up-to-date: /root/dp-devel/deepmd_root/include/deepmd/DataModifier.h
-- Up-to-date: /root/dp-devel/deepmd_root/include/deepmd/DeepPot.h
-- Up-to-date: /root/dp-devel/deepmd_root/include/deepmd/DeepTensor.h
-- Up-to-date: /root/dp-devel/deepmd_root/include/deepmd/common.h
-- Up-to-date: /root/dp-devel/deepmd_root/include/deepmd/custom_op.h
-- Up-to-date: /root/dp-devel/deepmd_root/include/deepmd/version.h
-- Installing: /root/dp-devel/deepmd_root/lib/libdeepmd_ipi.so
-- Installing: /root/dp-devel/deepmd_root/bin/dp_ipi
-- Set runtime path of "/root/dp-devel/deepmd_root/bin/dp_ipi" to "$ORIGIN/../lib:/root/softwares/tensorflow-2.4.0/lib:/root/softwares/tensorflow-2.4.0/lib"
-- Installing: /root/dp-devel/deepmd_root/lib/libdeepmd_ipi_low.so
-- Installing: /root/dp-devel/deepmd_root/bin/dp_ipi_low
-- Set runtime path of "/root/dp-devel/deepmd_root/bin/dp_ipi_low" to "$ORIGIN/../lib:/root/softwares/tensorflow-2.4.0/lib:/root/softwares/tensorflow-2.4.0/lib"
  • build lammps interface within deepmd-kit:
root build $ make lammps
-- Supported model version: 1.0 
-- Found CUDA in /usr/local/cuda-11.2, build nv GPU support
-- Will not build AMD GPU support
-- Enabled cpp interface build, looking for tensorflow_cc and tensorflow_framework
-- Found TensorFlow: /root/softwares/tensorflow-2.4.0/include;/root/softwares/tensorflow-2.4.0/include, /root/softwares/tensorflow-2.4.0/lib/libtensorflow_cc.so;/root/softwares/tensorflow-2.4.0/lib/libtensorflow_framework.so, /root/softwares/tensorflow-2.4.0/lib/libtensorflow_framework.so  in /root/softwares/tensorflow-2.4.0;/root/softwares/tensorflow-2.4.0/../tensorflow_core;/root/softwares/tensorflow-2.4.0;/root/softwares/tensorflow-2.4.0/../tensorflow_core;/usr/;/usr/local/ (found version "2.4.0")
-- Automatically determined OP_CXX_ABI=1 
-- Set GLIBCXX_USE_CXX_ABI=1 when compiling ops
-- Found OpenMP_C: -fopenmp  
-- Found OpenMP_CXX: -fopenmp  
-- Found OpenMP: TRUE   
-- CUDA major version is 11
-- Configuring done
-- Generating done
-- Build files have been written to: /root/dp-devel/deepmd-kit/source/build
Scanning dependencies of target lammps
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD/fix_dplr.h
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD/pppm_dplr.h
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD/fix_dplr.cpp
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD/pair_deepmd.cpp
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD/pppm_dplr.cpp
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD/Install.sh
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD/env.sh
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD/pair_deepmd.h
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD_low/fix_dplr.h
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD_low/pppm_dplr.h
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD_low/fix_dplr.cpp
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD_low/pair_deepmd.cpp
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD_low/pppm_dplr.cpp
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD_low/Install.sh
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD_low/env.sh
-- Installing: /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD_low/pair_deepmd.h
Built target lammps
  • build lammps package:
root build $ cd ../../../lammps/src
root src $ cp -r /root/dp-devel/deepmd-kit/source/build/USER-DEEPMD .
root src $ make yes-user-deepmd
Installing package user-deepmd

root src $ make mpi -j12
Gathering installed package information (may take a little while)
make[1]: Entering directory '/root/dp-devel/lammps/src'
Gathering git version information
make[1]: Leaving directory '/root/dp-devel/lammps/src'
Compiling LAMMPS for machine mpi
make[1]: Entering directory '/root/dp-devel/lammps/src/Obj_mpi'
cc -O -o fastdep.exe ../DEPEND/fastdep.c
make[1]: Leaving directory '/root/dp-devel/lammps/src/Obj_mpi'
make[1]: Entering directory '/root/dp-devel/lammps/src/Obj_mpi'
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../main.cpp
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../reader_xyz.cpp
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../compute_adf.cpp
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../pair_morse_smooth_linear.cpp
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../angle_deprecated.cpp
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../ewald.cpp
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../fix_dt_reset.cpp
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../fix_deform.cpp
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../bond_harmonic_shift.cpp
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../atom.cpp
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../meam_setup_param.cpp
mpicxx -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64   -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1    -c ../nstencil_half_multi_2d_newton.cpp
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:1: error: macro names must be identifiers
<command-line>:0:1: error: macro names must be identifiers
Makefile:109: recipe for target 'meam_setup_param.o' failed
make[1]: *** [meam_setup_param.o] Error 1
make[1]: *** Waiting for unfinished jobs....
Makefile:109: recipe for target 'fix_dt_reset.o' failed
make[1]: *** [fix_dt_reset.o] Error 1
Makefile:109: recipe for target 'reader_xyz.o' failed
make[1]: *** [reader_xyz.o] Error 1
Makefile:109: recipe for target 'main.o' failed
make[1]: *** [main.o] Error 1
Makefile:109: recipe for target 'angle_deprecated.o' failed
make[1]: *** [angle_deprecated.o] Error 1
Makefile:109: recipe for target 'nstencil_half_multi_2d_newton.o' failed
make[1]: *** [nstencil_half_multi_2d_newton.o] Error 1
Makefile:109: recipe for target 'bond_harmonic_shift.o' failed
make[1]: *** [bond_harmonic_shift.o] Error 1
Makefile:109: recipe for target 'pair_morse_smooth_linear.o' failed
make[1]: *** [pair_morse_smooth_linear.o] Error 1
Makefile:109: recipe for target 'compute_adf.o' failed
make[1]: *** [compute_adf.o] Error 1
Makefile:109: recipe for target 'ewald.o' failed
make[1]: *** [ewald.o] Error 1
Makefile:109: recipe for target 'fix_deform.o' failed
make[1]: *** [fix_deform.o] Error 1
Makefile:109: recipe for target 'atom.o' failed
make[1]: *** [atom.o] Error 1
make[1]: Leaving directory '/root/dp-devel/lammps/src/Obj_mpi'
Makefile:195: recipe for target 'mpi' failed
make: *** [mpi] Error 2

And there's an empty -D within the Makefile.package :

# Settings for libraries used by specific LAMMPS packages
# this file is auto-edited when those packages are included/excluded

PKG_INC =      -std=c++11 -D   -I/root/softwares/tensorflow-2.4.0/include -I/root/softwares/tensorflow-2.4.0/include -I/root/dp-devel/deepmd_root/include/
PKG_PATH =     -L/root/softwares/tensorflow-2.4.0/lib -L/root/softwares/tensorflow-2.4.0/lib -L/root/dp-devel/deepmd_root/lib
PKG_LIB =      -Wl,--no-as-needed -ldeepmd_op_cuda -ldeepmd_op -ldeepmd_cc -ldeepmd -ltensorflow_cc -ltensorflow_framework -Wl,-rpath=/root/softwares/tensorflow-2.4.0/lib -Wl,-rpath=/root/softwares/tensorflow-2.4.0/lib -Wl,-rpath=/root/dp-devel/deepmd_root/lib
PKG_CPP_DEPENDS =
PKG_LINK_DEPENDS =

PKG_SYSINC =
PKG_SYSLIB =
PKG_SYSPATH =

Compile environment: Ubuntu-18.04; CUDA-11.2; TF-2.4.0-gpu; openmpi-4.1.1; cmake-3.10.2; gcc-7.5.0

When I compile lammps on the ROCm platform, the same error occurs

now `env.sh` and `env_low.sh` will be generated in the same directory.
Users can easily `mv env_low.sh env.sh` if they need low precision.
@njzjz
Copy link
Member Author

njzjz commented Jul 29, 2021

I have no idea how to fix it, so I change the implementation: now env.sh and env_low.sh will be generated in the same directory.
Users can easily mv env_low.sh env.sh if they need low precision.

@denghuilu denghuilu self-requested a review July 29, 2021 07:08
Copy link
Member

@denghuilu denghuilu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both high and low precision settings can be executed correctly within the training and MD processes. And all UTs have passed in the CUDA environment.

@amcadmus amcadmus requested a review from galeselee July 29, 2021 14:24
Copy link
Contributor

@galeselee galeselee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no problem with compilation(low and high precision) and installation of python interface

@galeselee
Copy link
Contributor

There is no problem with compilation(low and high precision) and installation of python interface

Also all UTs have passed in the ROCm environment.(except for the error due to the TensorFlow problem)

@amcadmus amcadmus merged commit 4a229fe into deepmodeling:devel Jul 30, 2021
@njzjz njzjz deleted the build-precisions branch August 12, 2021 22:20
gzq942560379 pushed a commit to HPC-AI-Team/deepmd-kit that referenced this pull request Sep 2, 2021
* build low and high precision at the same time

We can only provide one package containing both precisions.
BREAKING CHANGES:
Python: Python package will build both precisions, and DP_FLOAT_PREC
is now runtime envrionmental variables
C++: CMake will build both library, which will be called something like
libdeepmd and libdeepmd_low
LAMMPS: generate two directory USER-DEEPMD and USER-DEEPMD_low
ipi: generate two execuate dp_ipi and dp_ipi_low

* fix LAMMPS build script

* fix lammps cmake file

* install LIB_DEEPMD_OP_VARIANT

* remove FLOAT_PREC argument

* change DP_FLOAT_PREC to DP_INTERFACE_PREC

* revert some libraries as they do not need to build twice

* update error message

* change the implementation of LAMMPS variant

now `env.sh` and `env_low.sh` will be generated in the same directory.
Users can easily `mv env_low.sh env.sh` if they need low precision.
njzjz pushed a commit to njzjz/deepmd-kit that referenced this pull request Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants