Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-2734

[Python] Cython api example doesn't work by default on macOS

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

      Description

      The setup.py + example.pyx given in the docs:

      https://arrow.apache.org/docs/python/extending.html#example

      doesn't work on macOS.

       

      The first issue is the error:

      example.cpp:603:10: fatal error: 'unordered_map' file not found

      because (AFAIU) macOS clang doesn't include the required C++11 lib by default.

      This can be solved by adding: 

      os.environ['CFLAGS'] = '-std=c++11 -stdlib=libc++'
      

      to setup.py

       

      The second issue is that the line

      ext.library_dirs.append(pa.get_library_dirs())
      

      should be  

      ext.library_dirs.extend(pa.get_library_dirs())
      

       

      otherwise this causes a (completely uninformative) typerror during the build because library dirs ends up being a list of list instead of a list of string.

       

        Attachments

          Activity

            People

            • Assignee:
              kszucs Krisztian Szucs
              Reporter:
              mangecoeur Jonathan Chambers

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h
                1h

                  Issue deployment