Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-10495

PyArrayObject redefined in TMVA/PyMethodBase.h with different type

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.20/00
    • Component/s: PyROOT, TMVA
    • Labels:
      None
    • Environment:

      ROOT Version: v6.18.04 and v6.12.06
      Platform: SLF6
      Compiler: gcc 7.3.0

      Description

      I can successfully build an application using rootcling that also links to python and numpy with ROOT v6.12.06, but since I switched to v6.18.04 the following error appears:

       

      [...]/lib/python2.7/site-packages/numpy-1.15.4-py2.7-linux-x86_64.egg/numpy/core/include/numpy/ndarraytypes.h:719:30: error: typedef redefinition with different types ('PyArrayObject_fields' (aka 'tagPyArrayObject_fields') vs 'tagPyArrayObject')
      typedef PyArrayObject_fields PyArrayObject;

      [...]/root/v6_18_04b/Linux64bit+2.6-2.12-e17-prof/etc/.../include/TMVA/PyMethodBase.h:50:26: note: previous definition is here
      typedef tagPyArrayObject PyArrayObject;

       

      I made a simplified project that reproduces this issue (available here). In this project, a class "ExampleClass" is built, which uses numpy array objects included via

       

      #include "Python.h"

      #include "numpy/arrayobject.h"

       

      I also added a simple GNU makefile to build this class, which calls rootcling and then g++ as described here. Once built, the library libMyLib.so is created, then:

       

      root -l

      > gROOT->ProcessLine(".L libMyLib.so")

      > example::ExampleClass e

       

      This works fine with ROOT v6.12.06, but it returns the above error with v6.18.04. Thank you for considering!

        Attachments

          Activity

            People

            • Assignee:
              moneta Lorenzo Moneta
              Reporter:
              9622c86a62d373cf2b7c Marco Del Tutto
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: