NOAA-EMC / NCEPLIBS-bufr

The NCEPLIBS-bufr library contains routines and utilites for working with the WMO BUFR format.
Other
44 stars 19 forks source link

clean up warnings in python build step #200

Open jbathegit opened 2 years ago

jbathegit commented 2 years ago

I found 80+ hits when searching for "warning" in the build step for ubuntu-20.0.4, gcc-10, gfortran-10, and all of them are related to the python builds.

These should definitely be looked at and cleaned up at some point, because one of the general rules that was agreed for our NCEPLIBS packages was that everything should compile without any warnings.

edwardhartnett commented 2 years ago

Who contributed the python code? They need to immediately clear these warnings.

The EMC requirements for operational software include that all software must build without warning. This is a very reasonable rule.

We need to add a CI test which fails is any warnings are present, and then bring the code up to that standard. That way, future contributions of code will fail CI if they add warnings.

jbathegit commented 2 years ago

AFAIK, the python code was contributed by Jeff Whitaker working with Rahul.

edwardhartnett commented 2 years ago

@jswhit and @aerorahul can you guys clear up the warnings in your python code?

aerorahul commented 2 years ago

On my macOS with GCC10, I performed a

python setup.py install |& tee out
grep -i warn out

and this was the result:

/usr/local/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/usr/local/lib/python3.9/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/usr/local/lib/python3.9/site-packages/setuptools/command/egg_info.py:623: SetuptoolsDeprecationWarning: Custom 'build_py' does not implement 'get_data_files_without_manifest'.
  warnings.warn(
gfortran: warning: could not understand version 12
gfortran: warning: could not understand version 12
gfortran: warning: could not understand version 12
gfortran: warning: could not understand version 12
gfortran: warning: could not understand version 12
gfortran: warning: could not understand version 12
gfortran: warning: could not understand version 12
gfortran: warning: could not understand version 12
gcc-10: warning: could not understand version 12
gcc-10: warning: could not understand version 12
/usr/local/lib/python3.9/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
   17 | #warning "Using deprecated NumPy API, disable it with " \
/usr/local/lib/python3.9/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
   17 | #warning "Using deprecated NumPy API, disable it with " \
build/src.macosx-12-x86_64-3.9/python/_bufrlibmodule.c:177:12: warning: 'f2py_size' defined but not used [-Wunused-function]
gfortran: warning: could not understand version 12
f951: Warning: Nonexistent include directory '/Users/rmahajan/scratch/nceplibs-bufr/build/src/include_4' [-Wmissing-include-dirs]
gfortran: warning: could not understand version 12

There are warnings, I agree.

Some of these warnings are benign and not really worth digging. Some of the warnings are something neither @jswhit nor @aerorahul would be able to resolve without an overwhelming amount of time and effort. They are a result of the use of f2py, and personally, I have no idea how to decipher and debug those. I doubt one can actually resolve every single warning. I will let @jswhit assess differently, if he disagrees.