tud-zih-energy / lo2s

Linux OTF2 Sampling - A Lightweight Node-Level Performance Monitoring Tool
https://tu-dresden.de/zih/forschung/projekte/lo2s?set_language=en
GNU General Public License v3.0
46 stars 13 forks source link

Install fails on some systems #295

Closed bmario closed 1 year ago

bmario commented 1 year ago

HPC strikes again, gzip has no option --keep.

image

What is that option even for?

Possible solutions: Search for gzip (and pod2man) using PATHS ENV PATH

s9105947 commented 1 year ago
* Noteworthy changes in release 1.6 (2013-06-09) [stable]

** New features

  gzip now accepts the --keep (-k) option, for consistency with tools
  like xz, lzip and bzip2.  With this option, gzip no longer removes
  named input files when compressing or decompressing.

from gzip NEWS

(How is anyone working with software this old?)

We can emulate the behavior of --keep by working with shell pipes instead on files directly, s.t. gzip never touches the original file and can never destroy it.

bmario commented 1 year ago

A more recent version of gzip is available on Taurus, but as you don't use the PATHS option, CMake won't look for it, even if the module is loaded. Hence, my suggestion. Mind the difference between HINTS and PATHS.

s9105947 commented 1 year ago

A more recent version of gzip is available on Taurus, but as you don't use the PATHS option, CMake won't look for it, even if the module is loaded. Hence, my suggestion. Mind the difference between HINTS and PATHS.

From my testing this does not hold, when running these steps my version finds the correct gzip:

  1. module load gzip
  2. mkdir build && cd build
  3. cmake ..
  4. make man-page

The gzip version is correctly detected from $PATH in the current version:

# s9105947 @ taurusi6163.taurus.hrsk.tu-dresden.de in /tmp/s9105947/lo2s/build [13:47:40] C:0
$ cmake -LAH . | grep GZIP_EXECUTABLE
GZIP_EXECUTABLE:FILEPATH=/sw/installed/gzip/1.12-GCCcore-11.3.0/bin/gzip

# s9105947 @ taurusi6163.taurus.hrsk.tu-dresden.de in /tmp/s9105947/lo2s/build [13:49:24] C:0
$ /sw/installed/gzip/1.12-GCCcore-11.3.0/bin/gzip --version
gzip 1.12

gzip must be present during configuration, i.e. when invoking cmake. I.e. if gzip is not found, try to reconfigure (delete build, run cmake again). If it is still not found, then provide GZIP_EXECUTABLE during configuration.

This still does not solve the problem if the found gzip is too old. We could add a workaround (using pipes, which is not cmake builtin) or add an explicit version check (again, not cmake builtin)... Still, I'd question if it is worth the hassle supporting ten year old software.

bmario commented 1 year ago

Thanks for investigating.