Make mpi error

Hello,

I am trying to install Lammps on Ubuntu 22.04 and each time I try to “make mpi” or “make serial” I get this error message. Any suggestions?

Gathering installed package information (may take a little while)
make[1]: Entering directory ‘/home/saeid/lammps/lammps-23Jun2022/src’
Gathering git version information
make[1]: Leaving directory ‘/home/saeid/lammps/lammps-23Jun2022/src’
Compiling LAMMPS for machine mpi
make[1]: Entering directory ‘/home/saeid/lammps/lammps-23Jun2022/src/Obj_mpi’
Makefile.package.settings:8: …/…/lib/electrode/Makefile.lammps: No such file or directory
make[1]: *** No rule to make target ‘…/…/lib/electrode/Makefile.lammps’. Stop.
make[1]: Leaving directory ‘/home/saeid/lammps/lammps-23Jun2022/src/Obj_mpi’
make[1]: Entering directory ‘/home/saeid/lammps/lammps-23Jun2022/src/Obj_mpi’
Makefile.package.settings:8: …/…/lib/electrode/Makefile.lammps: No such file or directory
make[1]: *** No rule to make target ‘…/…/lib/electrode/Makefile.lammps’. Stop.
make[1]: Leaving directory ‘/home/saeid/lammps/lammps-23Jun2022/src/Obj_mpi’
make: *** [Makefile:393: mpi] Error 2

Many thanks,
Saeid.

Please report in detail all steps you did to get to the compilation starting with downloading the source code.

For people struggling to compile with traditional make, we generally recommend them to use CMake based installation.

I Downloaded the source code from your website, then opened the “src” folder and for example “make yes-python”, after that entered the “make mpi” and got this error.

And I don’t know how to compile with CMake. If possible please help me to do this.
Thanks.

There are detailed instructions on how to build LAMMPS from source in the LAMMPS manual.

unfortunately, I have a problem with that.
And how can I solve “make mpi” command to set the machine for my LAMMPS??

It crucially matters, which of these “make yes-xxx” commands you did. Some of them require additional steps. This is all explained in detail here: 3. Build LAMMPS — LAMMPS documentation

To confirm, I just downloaded the source , extracted it, changed to the src folder and typed “make mpi” and there is no error. Same for “make serial”.

So the reason for the error is that you did do some commands without fully following the documentation. Details matter!

We cannot help you if you don’t follow the documentation. That is why we write documentation in the first place.

1 Like

I tried this method exactly and there is no error for “make serial”, but for “make mpi”:

Gathering installed package information (may take a little while)
make[1]: Entering directory ‘/home/saeid/Downloads/Compressed/lammps-23Jun2022/src’
make[1]: ‘lmpinstalledpkgs.h’ is up to date.
Gathering git version information
make[1]: Leaving directory ‘/home/saeid/Downloads/Compressed/lammps-23Jun2022/src’
Compiling LAMMPS for machine mpi
make[1]: Entering directory ‘/home/saeid/Downloads/Compressed/lammps-23Jun2022/src/Obj_mpi’
make[1]: Leaving directory ‘/home/saeid/Downloads/Compressed/lammps-23Jun2022/src/Obj_mpi’
make[1]: Entering directory ‘/home/saeid/Downloads/Compressed/lammps-23Jun2022/src/Obj_mpi’
mpicxx -g -O3 -std=c++11 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c …/main.cpp
In file included from …/main.cpp:14:
…/lammps.h:18:10: fatal error: mpi.h: No such file or directory
18 | #include <mpi.h>
| ^~~~~~~
compilation terminated.
make[1]: *** [Makefile:114: main.o] Error 1
make[1]: Leaving directory ‘/home/saeid/Downloads/Compressed/lammps-23Jun2022/src/Obj_mpi’
make: *** [Makefile:393: mpi] Error 2

This is a very different error from the one you reported originally and indicates that something is not correct with your MPI library installation. Which packages did you install to for it?

I installed the full package of MPI library.

How? Which commands?

If you keep leaving out details, nobody can help you.

I downloaded the source file from OPEN MPI website and installed that from manual. After that entered “ompi_info” but i couldn’t see anything and next entered this command:

sudo apt install openmpi-bin

That will install only the MPI runtime, not the headers and libraries required for compiling. For that you also need the -dev package in addition to the -bin package.

It means I must enter:

$ sudo apt install openmpi-dev

or another way and command?

Just so anyone can find an answer to this thread:

Install OpenMPI following the tutorial in: https://webpages.charlotte.edu/abw/coit-grid01.uncc.edu/ParallelProgSoftware/Software/OpenMPIInstall.pdf