Support for writing images in JPEG format not included EVEN AFTER compiled with JPEG options

Hi All,

I am compiling lammps in a Mac workstation. (Big Sur, 11.6.1)

Everything looks fine until I tried to dump image (the whole input file is to the end of this post). It claims

ERROR: Support for writing images in JPEG format not included (…/dump_image.cpp:88)
Last command: dump 2 all image 10000 snap.*.jpeg element element

But I compiled with the JPEG/PNG and FFMPEG support.
The make command is as follows and the build completes with no error.

make LMP_INC=-DLAMMPS_JPEG LMP_INC=-DLAMMPS_PNG LMP_INC=-DLAMMPS_FFMPEG JPG_INC=-I/usr/local/include JPG_PATH=-L/usr/lib JPG_LIB= -ljpeg -lpng -lz -j 4 mpi

Any suggestions?

The whole input file is as follows:

units		lj
atom_style	angle


pair_style	lj96/cut 1.0188
pair_modify shift yes
pair_coeff 1 1 0.37775 0.89

bond_style      harmonic
bond_coeff 1 1352.0 0.5

angle_style   table spline 181
angle_coeff 1 cgpva.table CG_PE

special_bonds lj 0.0 0.0 1.0

restart         20000 poly.restart
dump            1  all atom 10000 poly.dump
dump            2  all image 10000 snap.*.jpeg element element 
dump_modify     1 image yes scale no

thermo		100
timestep	0.01
fix		1 all npt temp 1.0 1.0 1.0 iso 8.0 8.0 10.0
run		400000

You are doing things incorrectly: The LMP_INC=-DLAMMPS_FFMPEG argument wipes out the two previous arguments setting LMP_INC (and whatever was the default setting in the makefile). So you have support for FFmpeg included but none of the other.

A much better way to make those changes is to copy src/MAKE/Makefile.mpi to src/MAKE/MINE/Makefile.mpi and edit it as needed with a text editor and as discussed in the manual, or use CMake to configure LAMMPS which will autodetect all of these.

Thanks Akohlmey,

BTW I used the instruction and changed / copied a customized make file to the prioritized MINE folder, and it seems the last LMP_INC line will override the previous ones, as well.


Like these guys listed in MINE/Makefile.imp and it looks like only the last one will be taken into the compilation.

Anyway I moved to cmake which seemingly easier. It got JPEG /PNG / FFMPEG setup automatically at least.