error:Support for writing images in JPEG format not included

Dear all,

I tried to save some JPEG format images so I used “dump image” command but I got this:

ERROR: Support for writing images in JPEG format not included (…/dump_image.cpp:86)
Last command: dump 2 all image 2000 image.*.jpeg type type axes yes 0.8 0.02 view 60 -30

From the lammps manual and former discussion I know I should make some settings in my makefile and get necessary libraries. But after trying many times I still didn’t solve the problem. I think more details may work for me. I would appreciate it if somebody can help me overcome it. Thanks in advance.

Helpless new learner

What is your LAMMPS version and what platform are you trying to compile LAMMPS on?

Dear Axel Kohlmeyer,

Thank you for your reply. I’m trying to compile LAMMPS-10Mar21 on ubuntu 18.04, I set the -DLAMMPS JPEG in the Makefile.mpi(…/src/MAKE) and got the jpegsrc.v8c.tar.gz then set the lib file address.
I think maybe I chose the wrong makefile or lib file. Thank you again!

If you are not very familiar with building software from source and using/editing makefiles (as it seems to be the case here), then we recommend to use the CMake based build procedure instead. It will autodetect and configure available features like JPEG or PNG libraries and MPI etc.

That said, downloading the source code for the jpeg library doesn’t help you much. And since you are using a well maintained Linux distribution, we also don’t recommend to build it from source, but rather use the available packages from the Ubuntu package manager. For jpeg you have to install the libjpeg-dev package (with apt-get). After that, the compilation should proceed with either build procedure as indicated in the documentation.

If this is still giving you trouble, my advice is to find a local person with experience in compiling scientific software from source (there are plenty in the computational physics and similar departments). Or you should consider installing a pre-compiled package for ubuntu as indicated in the manual.

Dear Axel Kohlmeyer,

I ues CMake rebuild LAMMPS, now it works well and can dump images and movies! Thank you for your patience and suggestion.