Skip to content

Ensure PYTANGO_NUMPY_VERSION is stringized to support newer C++ compilers

Anton Joubert requested to merge fix-numpy-version-str into develop

Some newer C++ compilers no longer treat the numpy version define as string leading to build failure. I'm not sure when this changed. Use some macro magic to fix this.

Errors like this with gcc-c++ x86_64 8.5.0-10.el8:

compile options: '-DPYTANGO_NUMPY_VERSION="1.14.3" -DNPY_NO_DEPRECATED_API=0 -DPYTANGO_HAS_UNIQUE_PTR=1 -I/usr/lib64/python3.6/site-packages/numpy/core/include -I/usr/include/tango -I/builddir/build/BUILD/pytango-9.3.4/ext -I/builddir/build/BUILD/pytango-9.3.4/ext/server -I/usr/include/python3.6m -c'
...
<command-line>: error: too many decimal points in number
/builddir/build/BUILD/pytango-9.3.4/ext/constants.cpp:36:42: note: in expansion of macro PYTANGO_NUMPY_VERSION
     consts_scope.attr("NUMPY_VERSION") = PYTANGO_NUMPY_VERSION;
                                       ^~~~~~~~~~~~~~~~~~~~~

Same fix was done by @matcelary in !437 (closed).

Merge request reports