Skip to content
This repository was archived by the owner on Jan 7, 2023. It is now read-only.
This repository was archived by the owner on Jan 7, 2023. It is now read-only.

Compiling _librootnumpy.cpp fails on Mac with clang #10

@cdeil

Description

@cdeil

I get this compile error:

$ make
rm -rf build
find root_numpy -name "*.pyc" | xargs rm -f
find root_numpy -name "*.so" | xargs rm -f
rm -f tags
python setup.py build_ext -i
running build_ext
building 'root_numpy._librootnumpy' extension
creating build
creating build/temp.macosx-10.8-x86_64-2.7
creating build/temp.macosx-10.8-x86_64-2.7/root_numpy
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -pipe -O2 -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/deil/Library/Python/2.7/lib/python/site-packages/numpy/core/include -I/Users/deil/software/root/v5-34-03/include -Iroot_numpy -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c root_numpy/_librootnumpy.cpp -o build/temp.macosx-10.8-x86_64-2.7/root_numpy/_librootnumpy.o
In file included from root_numpy/_librootnumpy.cpp:253:
In file included from /Users/deil/Library/Python/2.7/lib/python/site-packages/numpy/core/include/numpy/arrayobject.h:15:
In file included from /Users/deil/Library/Python/2.7/lib/python/site-packages/numpy/core/include/numpy/ndarrayobject.h:17:
In file included from /Users/deil/Library/Python/2.7/lib/python/site-packages/numpy/core/include/numpy/ndarraytypes.h:1725:
/Users/deil/Library/Python/2.7/lib/python/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2: warning: "Using deprecated NumPy API,
      disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
 ^
In file included from root_numpy/_librootnumpy.cpp:271:
root_numpy/Column.h:65:17: warning: unused variable 'ok' [-Wunused-variable]
            int ok = find_coltype(leaf,ct,cv);
                ^
In file included from root_numpy/_librootnumpy.cpp:272:
root_numpy/BetterChain.h:152:21: warning: unused variable 'rt' [-Wunused-variable]
        const char* rt = leaf->GetTypeName();
                    ^
root_numpy/_librootnumpy.cpp:1151:9: warning: conversion from string literal to 'char *' is deprecated [-Wdeprecated-writable-strings]
        PyErr_BadInternalCall();
        ^
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyerrors.h:220:56: note: expanded from macro 'PyErr_BadInternalCall'
#define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__)
                                                       ^
<scratch space>:140:1: note: expanded from macro '__FILE__'
"root_numpy/_librootnumpy.cpp"
^
root_numpy/_librootnumpy.cpp:9877:26: error: expected the class name after '~' to name a destructor
  p->rtype.std::string::~string();
                         ^
4 warnings and 1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
make: *** [inplace] Error 1

This is on Mac OS X 10.8 with ROOT 5.34/03 with these versions:

$ which clang
/usr/bin/clang
$ clang --version
Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin12.2.1
Thread model: posix
$ python -c 'import numpy; print numpy.__file__; print numpy.__version__'
/Users/deil/Library/Python/2.7/lib/python/site-packages/numpy/__init__.pyc
1.8.0.dev-c5ccca9
$ xcodebuild -version
Xcode 4.5.2
Build version 4G2008a

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions