Skip to content

Commit 286c318

Browse files
author
Han Wang
committed
compatible with latest lammps pppm interface
1 parent a45ae94 commit 286c318

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

source/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,16 @@ if (USE_TTM)
133133
set(TTM_DEF "-DUSE_TTM")
134134
endif (USE_TTM)
135135

136+
# old pppm interface
137+
if(NOT DEFINED OLD_LMP_PPPM)
138+
set(OLD_LMP_PPPM FALSE)
139+
endif(NOT DEFINED OLD_LMP_PPPM)
140+
if (OLD_LMP_PPPM)
141+
set(OLD_LMP_PPPM_DEF "-DOLD_LMP_PPPM")
142+
message(STATUS "Use old lammps pppm interface")
143+
endif()
144+
add_definitions (${OLD_LMP_PPPM_DEF})
145+
136146
# define build type
137147
if ((NOT DEFINED CMAKE_BUILD_TYPE) OR CMAKE_BUILD_TYPE STREQUAL "")
138148
set (CMAKE_BUILD_TYPE release)

source/lmp/env.sh.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ TF_INCLUDE_DIRS=`echo $TENSORFLOW_INCLUDE_DIRS | sed "s/;/ -I/g"`
66
TF_LIBRARY_PATH=`echo $TENSORFLOW_LIBRARY_PATH | sed "s/;/ -L/g"`
77
TF_RPATH=`echo $TENSORFLOW_LIBRARY_PATH | sed "s/;/ -Wl,-rpath=/g"`
88

9-
NNP_INC=" -std=c++11 @PREC_DEF@ @TTM_DEF@ -I$TF_INCLUDE_DIRS -I$DEEPMD_ROOT/include/deepmd "
9+
NNP_INC=" -std=c++11 @PREC_DEF@ @TTM_DEF@ @OLD_LMP_PPPM_DEF@ -I$TF_INCLUDE_DIRS -I$DEEPMD_ROOT/include/deepmd "
1010
NNP_PATH=" -L$TF_LIBRARY_PATH -L$DEEPMD_ROOT/lib"
1111
NNP_LIB=" -Wl,--no-as-needed -l@LIB_DEEPMD_OP@ -l@LIB_DEEPMD_OP_CUDA@ -l@LIB_DEEPMD@ -ltensorflow_cc -ltensorflow_framework -Wl,-rpath=$TF_RPATH -Wl,-rpath=$DEEPMD_ROOT/lib"

source/lmp/pppm_dplr.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,13 @@ enum{FORWARD_IK,FORWARD_AD,FORWARD_IK_PERATOM,FORWARD_AD_PERATOM};
4040

4141
/* ---------------------------------------------------------------------- */
4242

43+
#ifdef OLD_LMP_PPPM
4344
PPPMDPLR::PPPMDPLR(LAMMPS *lmp, int narg, char **arg) :
4445
PPPM(lmp, narg, arg)
46+
#else
47+
PPPMDPLR::PPPMDPLR(LAMMPS *lmp) :
48+
PPPM(lmp)
49+
#endif
4550
{
4651
triclinic_support = 1;
4752
}

source/lmp/pppm_dplr.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ namespace LAMMPS_NS {
3535

3636
class PPPMDPLR : public PPPM {
3737
public:
38+
#ifdef OLD_LMP_PPPM
3839
PPPMDPLR(class LAMMPS *, int, char **);
40+
#else
41+
PPPMDPLR(class LAMMPS *);
42+
#endif
3943
virtual ~PPPMDPLR () {};
4044
void init();
4145
const vector<double > & get_fele() const {return fele;};

0 commit comments

Comments
 (0)