jakobj/nest-simulator

Fix compilation with python 2 on 5g

Closed this issue · 1 comments

Python 2 on Fedora 26 fails with 5g, but not master
Works with Python 3, and with Python disabled.

Suggests an issue with Cython used to build pynestkernel.cxx

In file included from /usr/include/python2.7/Python.h:78:0,
                 from <<>>/nest-simulator/build/5g/pynest/pynestkernel.cxx:4:
<<>>/nest-simulator/build/5g/pynest/pynestkernel.cxx: In function ‘PyObject* newarrayobject(PyTypeObject*, Py_ssize_t, arraydescr*)’:
/usr/include/python2.7/pymem.h:97:30: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
  ( (type *) PyMem_MALLOC((n) * sizeof(type)) ) )
                              ^
/usr/include/python2.7/pymem.h:75:15: note: in definition of macro ‘PyMem_MALLOC’
     : malloc((n) ? (n) : 1))
               ^
<<>>/nest-simulator/build/5g/pynest/pynestkernel.cxx:1852:28: note: in expansion of macro ‘PyMem_NEW’
         op->data.ob_item = PyMem_NEW(char, nbytes);

I was wrong ... it's all just warning noise, master behaves the same, compilation succeeds.
Closing.