pybind/python_example

Install fails on OSX 10.13

8enmann opened this issue · 1 comments

I have cmake 3.12.4 and Python 3.7.1. I'm new to C++ development, so please excuse beginner errors.

pip install -e .
Obtaining file:///Users/ben/Documents/python_example
Requirement already satisfied: pybind11>=2.3 in /Users/ben/anaconda3/lib/python3.7/site-packages (from python-example==0.0.1) (2.3.0)
Installing collected packages: python-example
  Running setup.py develop for python-example
    Complete output from command /Users/ben/anaconda3/bin/python -c "import setuptools, tokenize;__file__='/Users/ben/Documents/python_example/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" develop --no-deps:
    running develop
    running egg_info
    writing python_example.egg-info/PKG-INFO
    writing dependency_links to python_example.egg-info/dependency_links.txt
    writing requirements to python_example.egg-info/requires.txt
    writing top-level names to python_example.egg-info/top_level.txt
    reading manifest file 'python_example.egg-info/SOURCES.txt'
    writing manifest file 'python_example.egg-info/SOURCES.txt'
    running build_ext
    creating var
    creating var/folders
    creating var/folders/kx
    creating var/folders/kx/k69hblm540zds7vpn8qvw2cr0000gn
    creating var/folders/kx/k69hblm540zds7vpn8qvw2cr0000gn/T
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/ben/anaconda3/include -arch x86_64 -I/Users/ben/anaconda3/include -arch x86_64 -I/Users/ben/anaconda3/include/python3.7m -c /var/folders/kx/k69hblm540zds7vpn8qvw2cr0000gn/T/tmpgdjf3dye.cpp -o var/folders/kx/k69hblm540zds7vpn8qvw2cr0000gn/T/tmpgdjf3dye.o -std=c++17
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/ben/anaconda3/include -arch x86_64 -I/Users/ben/anaconda3/include -arch x86_64 -I/Users/ben/anaconda3/include/python3.7m -c /var/folders/kx/k69hblm540zds7vpn8qvw2cr0000gn/T/tmpr8dsmmzq.cpp -o var/folders/kx/k69hblm540zds7vpn8qvw2cr0000gn/T/tmpr8dsmmzq.o -fvisibility=hidden
    building 'python_example' extension
    creating build
    creating build/temp.macosx-10.7-x86_64-3.7
    creating build/temp.macosx-10.7-x86_64-3.7/src
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/ben/anaconda3/include -arch x86_64 -I/Users/ben/anaconda3/include -arch x86_64 -I/Users/ben/anaconda3/include/python3.7m -I/Users/ben/.local/include/python3.7m -I/Users/ben/anaconda3/include/python3.7m -c src/main.cpp -o build/temp.macosx-10.7-x86_64-3.7/src/main.o -stdlib=libc++ -mmacosx-version-min=10.7 -DVERSION_INFO="0.0.1" -std=c++17 -fvisibility=hidden
    In file included from src/main.cpp:1:
    /Users/ben/anaconda3/include/python3.7m/pybind11/pybind11.h:1009:9: error: call to unavailable function 'operator delete': introduced in macOS 10.12
            ::operator delete(p, s, std::align_val_t(a));
            ^~~~~~~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:203:74: note: candidate function has been explicitly made unavailable
    _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void  operator delete(void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
                                                                             ^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:201:36: note: candidate function not viable: no known conversion from 'pybind11::size_t' (aka 'unsigned long') to 'std::align_val_t' for 2nd argument
    _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
                                       ^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:200:36: note: candidate function not viable: requires 2 arguments, but 3 were provided
    _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, std::align_val_t) _NOEXCEPT;
                                       ^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:184:36: note: candidate function not viable: requires 2 arguments, but 3 were provided
    _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
                                       ^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:186:74: note: candidate function not viable: requires 2 arguments, but 3 were provided
    _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void  operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
                                                                             ^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:217:40: note: candidate function not viable: requires 2 arguments, but 3 were provided
    inline _LIBCPP_INLINE_VISIBILITY void  operator delete  (void*, void*) _NOEXCEPT {}
                                           ^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:183:36: note: candidate function not viable: requires single argument '__p', but 3 arguments were provided
    _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p) _NOEXCEPT;
                                       ^
    In file included from src/main.cpp:1:
    /Users/ben/anaconda3/include/python3.7m/pybind11/pybind11.h:1011:9: error: call to unavailable function 'operator delete': introduced in macOS 10.12
            ::operator delete(p, s);
            ^~~~~~~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:186:74: note: candidate function has been explicitly made unavailable
    _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void  operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
                                                                             ^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:217:40: note: candidate function not viable: no known conversion from 'pybind11::size_t' (aka 'unsigned long') to 'void *' for 2nd argument; take the address of the argument with &
    inline _LIBCPP_INLINE_VISIBILITY void  operator delete  (void*, void*) _NOEXCEPT {}
                                           ^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:184:36: note: candidate function not viable: no known conversion from 'pybind11::size_t' (aka 'unsigned long') to 'const std::nothrow_t' for 2nd argument
    _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
                                       ^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:200:36: note: candidate function not viable: no known conversion from 'pybind11::size_t' (aka 'unsigned long') to 'std::align_val_t' for 2nd argument
    _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, std::align_val_t) _NOEXCEPT;
                                       ^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:183:36: note: candidate function not viable: requires single argument '__p', but 2 arguments were provided
    _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p) _NOEXCEPT;
                                       ^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:201:36: note: candidate function not viable: requires 3 arguments, but 2 were provided
    _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
                                       ^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:203:74: note: candidate function not viable: requires 3 arguments, but 2 were provided
    _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void  operator delete(void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
                                                                             ^
    2 errors generated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/Users/ben/anaconda3/bin/python -c "import setuptools, tokenize;__file__='/Users/ben/Documents/python_example/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" develop --no-deps" failed with error code 1 in /Users/ben/Documents/python_example/

I updated XCode and it worked!