ktools icon indicating copy to clipboard operation
ktools copied to clipboard

Find robust way to test for pre-requisites

Open hchagani-oasislmf opened this issue 3 years ago • 3 comments

Issue Description

Following the addition of pkg-config as a pre-requisite, users have experienced unhelpful error messages when trying to build ktools from source if this package is missing. It is unclear from these error messages that the reason for failure is the missing pre-requisite. It would be useful to test for these pre-requisites before or during building. Additionally, the system should be robust enough to adapt to future changes in dependencies.

Version / Environment information

pkg-config introduced as a dependency from ktools v3.8.0. However, this issue is relevant to all releases.

Example data / logs

Example of unhelpful error message from autotools if pkg-config not installed:

./configure: line 5858: syntax error near unexpected token `PARQUET,'
./configure: line 5858: `  PKG_CHECK_MODULES_STATIC(PARQUET, arrow parquet,'

The error messages could erroneously be interpreted as a problem with the parquet libraries rather than the lack of a pre-requisite.

hchagani-oasislmf avatar Jul 13 '22 11:07 hchagani-oasislmf

./configure: line 5879: syntax error near unexpected token `PARQUET,'
./configure: line 5879: `  PKG_CHECK_MODULES_STATIC(PARQUET, arrow parquet,'

We're getting this on RHEL 7 with pkg-config installed so this is not the only source:

[ccspapp@login12 build_scripts]$ pkg-config --help
Usage:
  pkg-config [OPTION?]

Help Options:
  -h, --help                              Show help options

Application Options:
  --version                               output version of pkg-config
  --modversion                            output version for package
  --atleast-pkgconfig-version=VERSION     require given version of pkg-config
  --libs                                  output all linker flags
  --static                                output linker flags for static linking
  --short-errors                          print short errors
  --libs-only-l                           output -l flags
  --libs-only-other                       output other libs (e.g. -pthread)
  --libs-only-L                           output -L flags
  --cflags                                output all pre-processor and compiler flags
  --cflags-only-I                         output -I flags
  --cflags-only-other                     output cflags not covered by the cflags-only-I option
  --variable=NAME                         get the value of variable named NAME
  --define-variable=NAME=VALUE            set variable NAME to VALUE
  --exists                                return 0 if the module(s) exist
  --print-variables                       output list of variables defined by the module
  --uninstalled                           return 0 if the uninstalled version of one or more module(s) or their dependencies will be used
  --atleast-version=VERSION               return 0 if the module is at least version VERSION
  --exact-version=VERSION                 return 0 if the module is at exactly version VERSION
  --max-version=VERSION                   return 0 if the module is at no newer than version VERSION
  --list-all                              list all known packages
  --debug                                 show verbose debug information
  --print-errors                          show verbose information about missing or conflicting packages,default if --cflags or --libs given on the command line
  --silence-errors                        be silent about errors (default unless --cflags or --libsgiven on the command line)
  --errors-to-stdout                      print errors from --print-errors to stdout not stderr
  --print-provides                        print which packages the package provides
  --print-requires                        print which packages the package requires
  --print-requires-private                print which packages the package requires for static linking

[ccspapp@login12 build_scripts]$ which pkg-config
/usr/bin/pkg-config

owainkenwayucl avatar Nov 11 '22 11:11 owainkenwayucl

Oh, also

[ccspapp@login12 build_scripts]$ pkg-config --version
0.27.1
[ccspapp@login12 build_scripts]$ 

owainkenwayucl avatar Nov 11 '22 11:11 owainkenwayucl

After discussion with @hchagani-oasislmf via email, it looks like this is caused in our case by the version of pkg-config on RHEL 7 being too old - updating to the latest (0.29.2) has resolved this issue.

owainkenwayucl avatar Nov 11 '22 14:11 owainkenwayucl

complete - in latest release

benhayes21 avatar Jan 24 '23 11:01 benhayes21