[lammps-users] Installation problem in Lammps-10 March 2021

Dear lammps users,
I am trying to install lammps-10 march 2021 version on ubuntu 16.04 LTS encounter following errors:
Makefile:109: recipe for target ‘main.o’ failed
make[1]: *** [main.o] Error 1
make[1]: Leaving directory ‘/home/anupam/lammps-10Mar21/src/Obj_mpi’
Makefile:195: recipe for target ‘mpi’ failed
make: *** [mpi] Error 2
Kindly assist me to solve this problem.
Thanks

regards

Anupam

Kindly describe all the steps that you did to get there.
Axel

Dear all,
I have used the following steps:

  1. Downloaded file from here: LAMMPS — Development version - Most current C++ version source + doc tarball, GPL license, ~165 Mb. Includes all bug fixes and new features described on this page.

  2. gunzip lammps.tar.gz

  3. tar xvf lammps.tar

  4. cd lammps-10Mar21/src/

  5. lammps-10Mar21/src$ make no-all

  6. lammps-10Mar21/src$ make yes-package name

  7. lammps-10Mar21/src$ cd STUBS/

  8. lammps-10Mar21/src/STUBS$ make clean

  9. lammps-10Mar21/src/STUBS$ make

  10. lammps-10Mar21/src/STUBS$ cd …

  11. lammps-10Mar21/src$ make clean-all

  12. lammps-10Mar21/src$ make mpi

and then the following error found:
Makefile:109: recipe for target ‘main.o’ failed
make[1]: *** [main.o] Error 1
make[1]: Leaving directory ‘/home/anupam/lammps-10Mar21/src/Obj_mpi’
Makefile:195: recipe for target ‘mpi’ failed
make: *** [mpi] Error 2

Thanks & regards

you left out quite a bit of the error messages with useful information, so I had to set up an ubuntu 16.04 environment for myself and reproduce this myself.

there are two issues:

step 6 is certainly incorrect and will lead to an error. that means no actual packages are installed. please don’t blindly copy and paste from the manual, but read and understand what is explained and then do what is meant that you do.

but most importantly, you didn’t read the installation instructions sufficiently careful enough. LAMMPS requires a C++11 compiler. You are using a very old Linux version where the compiler does not support C++11 by default. C++11 support must be enabled by creating a custom makefile (e.g. copy src/MAKE/Makefile.mpi to src/MAKE/MINE/Makefile.mp and then change “mpicxx” to “mpicxx -std=c++11”). with the customized makefile that enabled C++11 LAMMPS will compile fine.

Since there the support for Ubuntu 16.04 has ended and its software stack is aging quickly, it is recommended that you update your Linux to a supported version, which will not need a customized makefile for C++11 support and will also support building with CMake (which is more flexible and simpler to customize).

Axel.

Dear Sir,
Thanks, it works.

with warm regards