From: Christian Leitold (
Date: Tue Mar 13 2018 - 14:19:48 CDT


I recently wanted to read gzippped LAMMPS trajectories with VMD, and it
turns out this is possible when the right option is defined. In
particular, lammpsplugin.c looks for the preprocessor variable _USE_ZLIB.
This was also mentioned for a similar case in post a few weeks ago:

My question is rather basic: HOW exactly do I activate the preprocessor
macro in practice? When I just add "#define _USE_ZLIB" it in lammpsplugin.c,
the compilation fails because apparently it cannot find the zlib functions:

lammpsplugin.c:(.text+0x2e3d): undefined reference to `gzgets'

My guess is that I will need to add a "-lz" linker option at some point,
but I failed to find out where exactly.