LLNL / fpzip

Lossless compressor of multidimensional floating-point arrays
http://fpzip.llnl.gov
BSD 3-Clause "New" or "Revised" License
104 stars 16 forks source link

portability: $^ in makefiles #1

Closed slitvinov closed 4 years ago

slitvinov commented 4 years ago

I am using BSD Make to build fpzip. It does not define $^ macro which is not in POSIX [1].

libpzip builds without error but it does not include any object files because $^ expands to an empty string.

ar rc ../lib/libfpzip.a

It gives me very hard to trace errors if I link with the libray.

I think Makefiles (https://github.com/LLNL/fpzip/blob/master/src/Makefile#L14) can be portable if one does

$(LIBDIR)/libfpzip.a: $(OBJECTS)
       rm -f $@
       ar rc $@ $(OBJECTS)

instead of

$(LIBDIR)/libfpzip.a: $(OBJECTS)
       rm -f $@
       ar rc $@ $^

[1] https://pubs.opengroup.org/onlinepubs/009695399/utilities/make.html

lindstro commented 4 years ago

This is a good point. fpzip installation instructions are for GNU make, which does define $^. GNU make is so pervasive today that I did not consider other versions of make (or that $^ wasn't defined).

I've pushed a fix on the develop branch.

slitvinov commented 4 years ago

Thank you! We are using fpzip in our multiphase flows. https://github.com/cselab/aphros

lindstro commented 4 years ago

Thanks for the pointer. If you don't mind, I'd like to link to your project off the fpzip related projects page.

I noticed that you are using fpzip to compress data as 1D arrays only, which it was not designed for. If any of the arrays being compressed are multidimensional, then I would strongly suggest compressing them as such, as you should see far higher compression ratios when all correlated dimensions are accounted for.

slitvinov commented 4 years ago

Thanks for your suggestion. We use compression to exchange data between cubic subdomains, so our arrays are actually two-dimensional. Sure, you can add our project.