[lammps-users] Coupling lammps and QE. Qmmm package

I tried coupling lammps and QE using cmake.
Versions used: Lammps - 31Aug2021 and QE version - 6.6
The following steps were followed and errors encountered.

Goto Lammps-31-Aug-2021 folder:
used commands:
mkdir build-qmmm
cd build-qmmm
cmake -C …/cmake/presets/basic.cmake -D PKG_QMMM=yes
-D BUILD_LIB=yes -DBUILD_SHARED_LIBS=yes …/cmake
make
make install

goto QE folder
commands used:
./configure
make pw couple

goto lammps/lib/qmmm folder
(a) edited Makefile.gfortran-cmake anc changed the QETOPDIR path to QE-6.6 folder
(b) commands used for export of LD_LIBRARY_PATH and PKG_CONFIG_PATH: (i) PKG_CONFIG_PATH=
P
K
G
C
O
N
F
I
G
P
A
T
H

/
u
s
r
/
l
i
b
64
/
p
k
g
c
o
n
f
i
g
:
{HOME}/QE_testing/Silicon/LAMMPS_QE/lammps-31Aug2021/build-qmmm
(ii)
LD_LIBRARY_PATH=
L
D
L
I
B
R
A
R
Y
P
A
T
H

/
u
s
r
/
l
i
b
64
:
{HOME}/QE_testing/Silicon/LAMMPS_QE/lammps-31Aug2021/build-qmmm
(iii)
export LD_LIBRARY_PATH PKG_CONFIG_PATH
Final step to generate pwqmmm executable:
commands used:
(a) checked export with command pkgconf liblammps --libs
(b) make -f Makefile.gfortran-cmake pwqmmm.x
error encountered:

pwqmmm.c:262:9: error: ‘lammps_open’ was not declared in this scope; did you mean ‘lammps_free’?
262 | lammps_open(5, lmpargs, intra_comm, &lmp);

^~~~~~~~~~~
lammps_free
pwqmmm.c:335:9: error: ‘lammps_open’ was not declared in this scope; did you mean ‘lammps_free’?
335 | lammps_open(5, lmpargs, intra_comm, &lmp);
^~~~~~~~~~~
lammps_free
make: *** [Makefile.gfortran-cmake:69: pwqmmm.o] Error 1

To overcome this error, I added DLAMMPS_LIB_MPI to the MPICXXFLAGS variable definition
and tried again with command

make -f Makefile.gfortran-cmake pwqmmm.x

Now the error encountered is:

90:311: more undefined references to `__uspp_param_MOD_upf’ follow
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make: *** [Makefile.gfortran-cmake:62: pwqmmm.x] Error 1

Please suggest, what can I further do or edit to complete this final step

(Even if I followed with make instead of cmake, same error at the final step is encountered)

Thank you in advance.

I already told you in the LAMMPS forum what to do. This is not the quantum espresso mailing list.

Okay, thank you sir