Dear sir,
I installed and built LAMMPS 29SEP2021 version using make mpi in src folder, and performed the following steps:
make lib-qmmm args="-m gfortran"
make yes-molecule yes-kspace yes-rigid yes-qmmm
make mpi
make mode=lib mpi
3.In QE (version 6.8) directory:
./configure
make pw couple
make -f Makefile.gfortran all
While Installing qmmm package, in this 4th step, I am getting the following error message:
mpicxx -c -DOMPI_SKIP_MPICXX=1 -O2 -Wall -g -fPIC -I…/…/src -I/home/sp097/QE_testing/Silicon/LAMMPS_QE/q-e-qe-6.8/COUPLE/include pwqmmm.c -o pwqmmm.o
pwqmmm.c: In function ‘int main(int, char**)’:
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:61: pwqmmm.o] Error 1
This means that there were changes in quantum espresso since the version that was last tested with this interface. You would either have to use a compatible version of QE or ask the QM/MM developers on the QE mailing list for help with updating the the makefile(s). I don’t work on QE anymore so I don’t know.
Thank you sir for reply.
However i tried coupling now using cmake. Versions: 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={PKG_CONFIG_PATH-/usr/lib64/pkgconfig}:{HOME}/QE_testing/Silicon/LAMMPS_QE/lammps-31Aug2021/build-qmmm
(ii)
LD_LIBRARY_PATH={LD_LIBRARY_PATH-/usr/lib64}:{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
As per your suggestion, 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)
I would not compile LAMMPS with shared libraries. The undefined reference error is due to quantum espresso. You probably need to change link libraries or locations. You need to consult with the QM/MM folks on the QE side about that.