esmf-org/esmf-profiler

Check for required Python version

Opened this issue · 2 comments

Is your feature request related to a problem? Please describe.
We need to verify user has recent version of Python and error out during install if not.

@feiliuesmf was using Python 2.7 and did not receive any warning that you need Python 3.6+.

1) On the SGIs, I ran into this error (again building babeltrace with python enabled). This seems like a really odd case where system headers and python 2.7 headers do not agree on POSIX standards. I will need to see if there are alternative solutions including a custom build of python. You can see the python used is 2.7. Gcc used is 9.2.0

In file included from /usr/include/python2.7/pyconfig.h:6,
                 from /usr/include/python2.7/Python.h:8,
                 from py-common.c:31:
/usr/include/python2.7/pyconfig-64.h:1191: error: "_POSIX_C_SOURCE" redefined [-Werror]
 1191 | #define _POSIX_C_SOURCE 200112L
      |
In file included from /usr/include/errno.h:28,
                 from ../../src/logging/log.h:12,
                 from py-common.c:27:
/usr/include/features.h:168: note: this is the location of the previous definition
  168 | # define _POSIX_C_SOURCE 200809L

Describe the solution you'd like

  • Clear description of requirement in the quick start (if not there).
  • Runtime check during install_dependencies.sh - if Python version is < 3.6 then exit with a clear message.

@rsdunlapiv I want to confirm before changing the code as the acceptable versions of Python are defined in setup.py:

image

When actually doing the pip install -e ., you get an error.

image

Here, I changed the min version to Python 4 to show you an example of the error.

@ryanlong1004 we need to check during install_dependencies.sh before pip install is ever run. Babeltrace2 will fail to build the python bindings during install_dependencies.sh if the version of Python is too old.