From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Tue Mar 13 2018 - 16:53:08 CDT

On Tue, Mar 13, 2018 at 5:48 PM, John Stone <johns_at_ks.uiuc.edu> wrote:

> Axel,
> Thanks for the warning on that.
> What about making the plugin use a set of runtime-set function pointers
> for it's I/O calls? In practice, when opening a file with the .gz suffix,
> it would use function pointers that point to gzgets(), gzprintf(), etc,
> but when opening a file without the suffix, the function pointers would
> point to the stdio calls, fgets(), printf(), etc. The code required
> for that would only be very slightly more involved than what it is doing
> now with the compile-time macros, and it should run as fast as it can
> without creating compilation complications. This would seem to resolve
> both issues at low cost as far as code complexity goes.
>

​i am open for suggestions. i have not looked at this part of the code for
a very, very long time.
i used to have a tendency to avoid function pointer, because i was not
having much practice and thus little confidence in using them correctly.
this is different now, but i don't know, when i'll get the time to review
the plugin. we're currently in the middle of release testing for a stable
release of LAMMPS.

axel.

>
> Best,
> John Stone
> vmd_at_ks.uiuc.edu
>
> On Tue, Mar 13, 2018 at 05:32:37PM -0400, Axel Kohlmeyer wrote:
> > On Tue, Mar 13, 2018 at 3:29 PM, John Stone <johns_at_ks.uiuc.edu> wrote:
> >
> > > Hi,
> > > While I didn't do it yet, this is on my short list of things
> > > going into VMD 1.9.4, because zlib is a dependency for libpng,
> > > and I would like to enable (and thus have to redistribute) libpng
> > > with VMD, at least on linux perhaps on all platforms, by default.
> > >
> >
> > ???hi john,
> >
> > we probably should figure out a way to have two different plugin binaries
> > for this: one with compression enabled and without.
> > adding zlib support, significantly slows down uncompressed reading, which
> > is why it is an add-on define that is disabled by default.
> >
> > axel.???
> >
> >
> >
> > > I'm currently swamped so I wasn't planning to work on this for a
> > > couple of weeks, but if you can wait a bit longer, I hope to have
> > > this resolved in the near future, and I will definitely have
> > > a look at the LAMMPS plugin when I'm adding libz to the build/redistrib
> > > directories.
> > >
> > > Best,
> > > John Stone
> > > vmd_at_ks.uiuc.edu
> > >
> > > On Tue, Mar 13, 2018 at 12:19:48PM -0700, Christian Leitold wrote:
> > > > Hello,
> > > > 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:
> > > > [1]http://www.ks.uiuc.edu/Research/vmd/mailing_list/vmd-
> l/28540.html
> > > > 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.
> > > > Thanks,
> > > > Christian
> > > >
> > > > References
> > > >
> > > > Visible links
> > > > 1. http://www.ks.uiuc.edu/Research/vmd/mailing_list/vmd-
> l/28540.html
> > >
> > > --
> > > NIH Center for Macromolecular Modeling and Bioinformatics
> > > Beckman Institute for Advanced Science and Technology
> > > University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
> > > http://www.ks.uiuc.edu/~johns/ Phone: 217-244-3349
> > > http://www.ks.uiuc.edu/Research/vmd/
> > >
> > >
> >
> >
> > --
> > Dr. Axel Kohlmeyer akohlmey_at_gmail.com http://goo.gl/1wk0
> > College of Science & Technology, Temple University, Philadelphia PA, USA
> > International Centre for Theoretical Physics, Trieste. Italy.
>
>
> --
> NIH Center for Macromolecular Modeling and Bioinformatics
> Beckman Institute for Advanced Science and Technology
> University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
> http://www.ks.uiuc.edu/~johns/ Phone: 217-244-3349
> http://www.ks.uiuc.edu/Research/vmd/
>

-- 
Dr. Axel Kohlmeyer  akohlmey_at_gmail.com  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.