POT icon indicating copy to clipboard operation
POT copied to clipboard

Build warnings

Open haampie opened this issue 2 years ago • 2 comments

Describe the bug

When building POT using Spack I get a bunch of warnings:

ot/lp/EMD_wrapper.cpp: In function 'int EMD_wrap(int, int, double*, double*, double*, double*, double*, double*, double*, int)':
ot/lp/EMD_wrapper.cpp:21:16: warning: unused variable 'i' [-Wunused-variable]
   21 |      int n, m, i, cur;
      |                ^
In file included from ot/lp/full_bipartitegraph.h:29,
                 from ot/lp/network_simplex_simple.h:64,
                 from ot/lp/EMD.h:21,
                 from ot/lp/EMD_wrapper.cpp:15:
ot/lp/core.h:85:25: warning: typedef 'Node' locally defined but not used [-Wunused-local-typedefs]
   85 |   typedef Digraph::Node Node;                                           \
      |                         ^~~~
ot/lp/EMD_wrapper.cpp:24:5: note: in expansion of macro 'DIGRAPH_TYPEDEFS'
   24 |     DIGRAPH_TYPEDEFS(FullBipartiteDigraph);
      |     ^~~~~~~~~~~~~~~~
In file included from ot/lp/EMD.h:21,
                 from ot/lp/EMD_wrapper.cpp:15:
ot/lp/network_simplex_simple.h: In instantiation of 'lemon::NetworkSimplexSimple<GR, V, C, NodesType>::NetworkSimplexSimple(const GR&, bool, int, long long int, int) [with GR = lemon::FullBipartiteDigraph; V = double; C = double; NodesType = unsigned int]':
ot/lp/EMD_wrapper.cpp:51:94:   required from here
ot/lp/network_simplex_simple.h:519:19: warning: 'lemon::NetworkSimplexSimple<lemon::FullBipartiteDigraph, double, double, unsigned int>::_init_nb_arcs' will be initialized after [-Wreorder]
  519 |         long long _init_nb_arcs;
      |                   ^~~~~~~~~~~~~
In file included from ot/lp/EMD.h:21,
                 from ot/lp/EMD_wrapper.cpp:15:
ot/lp/network_simplex_simple.h:360:21: warning:   'const Value lemon::NetworkSimplexSimple<lemon::FullBipartiteDigraph, double, double, unsigned int>::MAX' [-Wreorder]
  360 |         const Value MAX;
      |                     ^~~
ot/lp/network_simplex_simple.h:231:9: warning:   when initialized here [-Wreorder]
  231 |         NetworkSimplexSimple(const GR& graph, bool arc_mixing, int nbnodes, long long nb_arcs,int maxiters) :
      |         ^~~~~~~~~~~~~~~~~~~~
In file included from /spack/opt/spack/linux-ubuntu20.04-zen2/gcc-10.3.0/py-numpy-1.21.2-jiksbcztk2f7z5squ72oqa5vxroxz662/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1969,
                 from /spack/opt/spack/linux-ubuntu20.04-zen2/gcc-10.3.0/py-numpy-1.21.2-jiksbcztk2f7z5squ72oqa5vxroxz662/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                 from /spack/opt/spack/linux-ubuntu20.04-zen2/gcc-10.3.0/py-numpy-1.21.2-jiksbcztk2f7z5squ72oqa5vxroxz662/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from ot/lp/emd_wrap.cpp:664:
/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-10.3.0/py-numpy-1.21.2-jiksbcztk2f7z5squ72oqa5vxroxz662/lib/python3.8/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 " \
      |  ^~~~~~~
/spack/lib/spack/env/gcc/g++ -shared build/temp.linux-x86_64-3.8/ot/lp/emd_wrap.o build/temp.linux-x86_64-3.8/ot/lp/EMD_wrapper.o -L/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-10.3.0/python-3.8.11-4li4ogjlwogc5ng2osdiwmytichl2sdl/lib -o build/lib.linux-x86_64-3.8/ot/lp/emd_wrap.cpython-38-x86_64-linux-gnu.so
/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-10.3.0/py-cython-0.29.24-dewyxvex7bz2xr2lc2rfq37fb4idyftn/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/harmen/spack-stage/spack-stage-py-pot-0.7.0-r4n3aswykr2uhg3fn4iw34lahuewarad/spack-src/ot/lp/emd_wrap.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-10.3.0/py-setuptools-57.4.0-folza24teugwuwimv3z7oxkft6afl4ng/lib/python3.8/site-packages/setuptools/dist.py:697: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
  warnings.warn(

Environment

Screenshot from 2021-08-31 13-00-06

haampie avatar Aug 31 '21 11:08 haampie

FWIW, regarding the deprecated numpy API warning, I don't see any upperbound on numpy?

haampie avatar Aug 31 '21 11:08 haampie

Thank you @haampie we needs to clean that up indeed. The Numpy API warnings are from cython from what I get so we think that there is no plan to really remove it or else Cython become unusable ;)

rflamary avatar Aug 31 '21 13:08 rflamary