ethereon / lycon

A minimal and fast image library for Python and C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot build on MacOS 10.14

KilianMichiels opened this issue · comments

Hello,

I'm having some trouble installing lycon.. It seems like the install process cannot run the make command without failing.

Here is the console output:

Installing collected packages: lycon
  Running setup.py install for lycon ... error
    Complete output from command /usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-lx37z3k4/lycon/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/tmp/pip-record-_pdsb3fp/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.14-x86_64-3.7
    creating build/lib.macosx-10.14-x86_64-3.7/lycon
    copying lycon/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/lycon
    copying lycon/core.py -> build/lib.macosx-10.14-x86_64-3.7/lycon
    copying lycon/enum.py -> build/lib.macosx-10.14-x86_64-3.7/lycon
    running egg_info
    writing lycon.egg-info/PKG-INFO
    writing dependency_links to lycon.egg-info/dependency_links.txt
    writing requirements to lycon.egg-info/requires.txt
    writing top-level names to lycon.egg-info/top_level.txt
    reading manifest file 'lycon.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'lycon.egg-info/SOURCES.txt'
    running build_ext
    Source path is /private/tmp/pip-install-lx37z3k4/lycon
    -- The C compiler identification is AppleClang 10.0.0.10001038
    -- The CXX compiler identification is AppleClang 10.0.0.10001038
    -- Check for working C compiler: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
    -- Check for working C compiler: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
    -- Check for working CXX compiler: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.11")
    -- Found PNG: /usr/local/lib/libpng.dylib (found version "1.4.12")
    -- Found JPEG: /usr/local/lib/libjpeg.dylib (found version "80")
    -- Python binary: /usr/local/opt/python/bin/python3.7
    -- Python include path: /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m
    -- Python library path: /usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib
    -- Python version: 3.7
    -- Python library path: /usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7.dylib
    -- NumPy include path: /usr/local/lib/python3.7/site-packages/numpy/core/include
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /tmp/pip-install-lx37z3k4/lycon/build/temp.macosx-10.14-x86_64-3.7
    Starting build with 8 jobs
    Scanning dependencies of target lycon
    [  7%] Building CXX object CMakeFiles/lycon.dir/src/lycon/io/base.cc.o
    [  7%] Building CXX object CMakeFiles/lycon.dir/src/lycon/io/io.cc.o
    [ 10%] Building CXX object CMakeFiles/lycon.dir/src/lycon/io/png.cc.o
    [ 17%] Building CXX object CMakeFiles/lycon.dir/src/lycon/io/jpeg.cc.o
    [ 17%] Building CXX object CMakeFiles/lycon.dir/src/lycon/io/bitstream.cc.o
    [ 21%] Building CXX object CMakeFiles/lycon.dir/src/lycon/io/exif.cc.o
    [ 25%] Building CXX object CMakeFiles/lycon.dir/src/lycon/mat/convert.cc.o
    [ 28%] Building CXX object CMakeFiles/lycon.dir/src/lycon/mat/allocator.cc.o
    [ 32%] Building CXX object CMakeFiles/lycon.dir/src/lycon/mat/copy.cc.o
    [ 35%] Building CXX object CMakeFiles/lycon.dir/src/lycon/mat/io_array.cc.o
    [ 39%] Building CXX object CMakeFiles/lycon.dir/src/lycon/mat/iterator.cc.o
    [ 42%] Building CXX object CMakeFiles/lycon.dir/src/lycon/mat/mat.cc.o
    [ 46%] Building CXX object CMakeFiles/lycon.dir/src/lycon/mat/umat_data.cc.o
    [ 50%] Building CXX object CMakeFiles/lycon.dir/src/lycon/transform/resize.cc.o
    [ 53%] Building CXX object CMakeFiles/lycon.dir/src/lycon/transform/rotate.cc.o
    [ 57%] Building CXX object CMakeFiles/lycon.dir/src/lycon/util/alloc.cc.o
    [ 60%] Building CXX object CMakeFiles/lycon.dir/src/lycon/util/color.cc.o
    [ 64%] Building CXX object CMakeFiles/lycon.dir/src/lycon/util/file.cc.o
    [ 67%] Building CXX object CMakeFiles/lycon.dir/src/lycon/util/hardware.cc.o
    [ 71%] Building CXX object CMakeFiles/lycon.dir/src/lycon/util/parallel_pthreads.cc.o
    [ 75%] Building CXX object CMakeFiles/lycon.dir/src/lycon/util/parallel.cc.o
    [ 78%] Building CXX object CMakeFiles/lycon.dir/src/lycon/util/singleton.cc.o
    [ 82%] Building CXX object CMakeFiles/lycon.dir/src/lycon/util/string.cc.o
    [ 85%] Building CXX object CMakeFiles/lycon.dir/src/lycon/util/tls.cc.o
    [ 89%] Linking CXX static library liblycon.a
    [ 89%] Built target lycon
    Scanning dependencies of target pycon
    [ 96%] Building CXX object CMakeFiles/pycon.dir/src/lycon/python/module.cc.o
    [ 96%] Building CXX object CMakeFiles/pycon.dir/src/lycon/python/interop.cc.o
    /tmp/pip-install-lx37z3k4/lycon/src/lycon/python/interop.cc:321:11: error: cannot initializea variable of type 'char *' with an rvalue of type 'const char *'
        char* str = PyString_AsString(object);
              ^     ~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.
    make[2]: *** [CMakeFiles/pycon.dir/src/lycon/python/interop.cc.o] Error 1
    make[2]: *** Waiting for unfinished jobs....
    make[1]: *** [CMakeFiles/pycon.dir/all] Error 2
    make: *** [all] Error 2
        * Failed to build the Lycon native extension.
        * [Error] Failed to exceute: /usr/bin/make -j 8

    ----------------------------------------
Command "/usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-lx37z3k4/lycon/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/tmp/pip-record-_pdsb3fp/install-record.txt --single-version-externally-managed --compile" failed with error code 255 in /private/tmp/pip-install-lx37z3k4/lycon/

Before I start messing around with that error I wanted to make sure there is nothing else I could do?

Any chance could this merge get into the pip package as well? I encountered the same issue on Ubuntu, with python 3.7 and various gcc versions. Currently I am installing directly from master to side-step this issue.

  Running setup.py install for lycon ... error
    Complete output from command /home/fgogianu/Tools/miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-enh8o2xy/lycon/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-7oe7a5sq/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    creating build/lib.linux-x86_64-3.7/lycon
    copying lycon/core.py -> build/lib.linux-x86_64-3.7/lycon
    copying lycon/enum.py -> build/lib.linux-x86_64-3.7/lycon
    copying lycon/__init__.py -> build/lib.linux-x86_64-3.7/lycon
    running egg_info
    writing lycon.egg-info/PKG-INFO
    writing dependency_links to lycon.egg-info/dependency_links.txt
    writing requirements to lycon.egg-info/requires.txt
    writing top-level names to lycon.egg-info/top_level.txt
    reading manifest file 'lycon.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'lycon.egg-info/SOURCES.txt'
    running build_ext
    Source path is /tmp/pip-install-enh8o2xy/lycon
    -- The C compiler identification is GNU 6.4.0
    -- The CXX compiler identification is GNU 6.4.0
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
    -- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.6.34")
    -- Found JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (found version "80")
    -- Python binary: /home/fgogianu/Tools/miniconda3/bin/python
    -- Python include path: /home/fgogianu/Tools/miniconda3/include/python3.7m
    -- Python library path: /home/fgogianu/Tools/miniconda3/lib
    -- Python version: 3.7
    -- Python library path: /home/fgogianu/Tools/miniconda3/lib/libpython3.7m.so
    -- NumPy include path: /home/fgogianu/Tools/miniconda3/lib/python3.7/site-packages/numpy/core/include
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /tmp/pip-install-enh8o2xy/lycon/build/temp.linux-x86_64-3.7
    Starting build with 8 jobs
    Scanning dependencies of target lycon
    [ 17%] Building CXX object CMakeFiles/lycon.dir/src/lycon/io/exif.cc.o
    [ 21%] Building CXX object CMakeFiles/lycon.dir/src/lycon/io/bitstream.cc.o
    [ 17%] Building CXX object CMakeFiles/lycon.dir/src/lycon/io/base.cc.o
    [ 21%] Building CXX object CMakeFiles/lycon.dir/src/lycon/io/png.cc.o
    [ 21%] Building CXX object CMakeFiles/lycon.dir/src/lycon/io/jpeg.cc.o
    [ 21%] Building CXX object CMakeFiles/lycon.dir/src/lycon/io/io.cc.o
    [ 25%] Building CXX object CMakeFiles/lycon.dir/src/lycon/mat/allocator.cc.o
    [ 28%] Building CXX object CMakeFiles/lycon.dir/src/lycon/mat/convert.cc.o
    [ 32%] Building CXX object CMakeFiles/lycon.dir/src/lycon/mat/copy.cc.o
    [ 35%] Building CXX object CMakeFiles/lycon.dir/src/lycon/mat/io_array.cc.o
    [ 39%] Building CXX object CMakeFiles/lycon.dir/src/lycon/mat/iterator.cc.o
    [ 42%] Building CXX object CMakeFiles/lycon.dir/src/lycon/mat/mat.cc.o
    [ 46%] Building CXX object CMakeFiles/lycon.dir/src/lycon/mat/umat_data.cc.o
    [ 50%] Building CXX object CMakeFiles/lycon.dir/src/lycon/transform/resize.cc.o
    [ 53%] Building CXX object CMakeFiles/lycon.dir/src/lycon/transform/rotate.cc.o
    [ 57%] Building CXX object CMakeFiles/lycon.dir/src/lycon/util/alloc.cc.o
    In file included from /tmp/pip-install-enh8o2xy/lycon/src/lycon/mat/umat_data.h:4:0,
                     from /tmp/pip-install-enh8o2xy/lycon/src/lycon/mat/umat_data.cc:1:
    /tmp/pip-install-enh8o2xy/lycon/src/lycon/mat/umat_data.cc: In destructor ‘lycon::UMatData::~UMatData()’:
    /tmp/pip-install-enh8o2xy/lycon/src/lycon/util/error.h:31:35: warning: throw will always call terminate() [-Wterminate]
             throw RuntimeError(err_msg);          \
                                       ^
    /tmp/pip-install-enh8o2xy/lycon/src/lycon/util/error.h:40:9: note: in expansion of macro ‘LYCON_ERROR’
             LYCON_ERROR("Assertion Failure: `%s` evaluated to false in `%s` (%s:%d)", #expr, LYCON_Func, __FILE__, __LINE__)
             ^~~~~~~~~~~
    /tmp/pip-install-enh8o2xy/lycon/src/lycon/mat/umat_data.cc:33:5: note: in expansion of macro ‘LYCON_ASSERT’
         LYCON_ASSERT(mapcount == 0);
         ^~~~~~~~~~~~
    /tmp/pip-install-enh8o2xy/lycon/src/lycon/util/error.h:31:35: note: in C++11 destructors default to noexcept
             throw RuntimeError(err_msg);          \
                                       ^
    /tmp/pip-install-enh8o2xy/lycon/src/lycon/util/error.h:40:9: note: in expansion of macro ‘LYCON_ERROR’
             LYCON_ERROR("Assertion Failure: `%s` evaluated to false in `%s` (%s:%d)", #expr, LYCON_Func, __FILE__, __LINE__)
             ^~~~~~~~~~~
    /tmp/pip-install-enh8o2xy/lycon/src/lycon/mat/umat_data.cc:33:5: note: in expansion of macro ‘LYCON_ASSERT’
         LYCON_ASSERT(mapcount == 0);
         ^~~~~~~~~~~~
    [ 60%] Building CXX object CMakeFiles/lycon.dir/src/lycon/util/color.cc.o
    [ 64%] Building CXX object CMakeFiles/lycon.dir/src/lycon/util/file.cc.o
    [ 67%] Building CXX object CMakeFiles/lycon.dir/src/lycon/util/hardware.cc.o
    [ 71%] Building CXX object CMakeFiles/lycon.dir/src/lycon/util/parallel_pthreads.cc.o
    [ 75%] Building CXX object CMakeFiles/lycon.dir/src/lycon/util/parallel.cc.o
    [ 78%] Building CXX object CMakeFiles/lycon.dir/src/lycon/util/singleton.cc.o
    [ 82%] Building CXX object CMakeFiles/lycon.dir/src/lycon/util/string.cc.o
    [ 85%] Building CXX object CMakeFiles/lycon.dir/src/lycon/util/tls.cc.o
    In file included from /tmp/pip-install-enh8o2xy/lycon/src/lycon/util/tls.cc:5:0:
    /tmp/pip-install-enh8o2xy/lycon/src/lycon/util/tls.cc: In destructor ‘lycon::TlsAbstraction::~TlsAbstraction()’:
    /tmp/pip-install-enh8o2xy/lycon/src/lycon/util/error.h:31:35: warning: throw will always call terminate() [-Wterminate]
             throw RuntimeError(err_msg);          \
                                       ^
    /tmp/pip-install-enh8o2xy/lycon/src/lycon/util/error.h:40:9: note: in expansion of macro ‘LYCON_ERROR’
             LYCON_ERROR("Assertion Failure: `%s` evaluated to false in `%s` (%s:%d)", #expr, LYCON_Func, __FILE__, __LINE__)
             ^~~~~~~~~~~
    /tmp/pip-install-enh8o2xy/lycon/src/lycon/util/tls.cc:81:5: note: in expansion of macro ‘LYCON_ASSERT’
         LYCON_ASSERT(pthread_key_delete(tlsKey) == 0);
         ^~~~~~~~~~~~
    /tmp/pip-install-enh8o2xy/lycon/src/lycon/util/error.h:31:35: note: in C++11 destructors default to noexcept
             throw RuntimeError(err_msg);          \
                                       ^
    /tmp/pip-install-enh8o2xy/lycon/src/lycon/util/error.h:40:9: note: in expansion of macro ‘LYCON_ERROR’
             LYCON_ERROR("Assertion Failure: `%s` evaluated to false in `%s` (%s:%d)", #expr, LYCON_Func, __FILE__, __LINE__)
             ^~~~~~~~~~~
    /tmp/pip-install-enh8o2xy/lycon/src/lycon/util/tls.cc:81:5: note: in expansion of macro ‘LYCON_ASSERT’
         LYCON_ASSERT(pthread_key_delete(tlsKey) == 0);
         ^~~~~~~~~~~~
    /tmp/pip-install-enh8o2xy/lycon/src/lycon/util/tls.cc: In destructor ‘virtual lycon::TLSDataContainer::~TLSDataContainer()’:
    /tmp/pip-install-enh8o2xy/lycon/src/lycon/util/error.h:31:35: warning: throw will always call terminate() [-Wterminate]
             throw RuntimeError(err_msg);          \
                                       ^
    /tmp/pip-install-enh8o2xy/lycon/src/lycon/util/error.h:40:9: note: in expansion of macro ‘LYCON_ERROR’
             LYCON_ERROR("Assertion Failure: `%s` evaluated to false in `%s` (%s:%d)", #expr, LYCON_Func, __FILE__, __LINE__)
             ^~~~~~~~~~~
    /tmp/pip-install-enh8o2xy/lycon/src/lycon/util/tls.cc:275:5: note: in expansion of macro ‘LYCON_ASSERT’
         LYCON_ASSERT(key_ == -1); // Key must be released in child object
         ^~~~~~~~~~~~
    /tmp/pip-install-enh8o2xy/lycon/src/lycon/util/error.h:31:35: note: in C++11 destructors default to noexcept
             throw RuntimeError(err_msg);          \
                                       ^
    /tmp/pip-install-enh8o2xy/lycon/src/lycon/util/error.h:40:9: note: in expansion of macro ‘LYCON_ERROR’
             LYCON_ERROR("Assertion Failure: `%s` evaluated to false in `%s` (%s:%d)", #expr, LYCON_Func, __FILE__, __LINE__)
             ^~~~~~~~~~~
    /tmp/pip-install-enh8o2xy/lycon/src/lycon/util/tls.cc:275:5: note: in expansion of macro ‘LYCON_ASSERT’
         LYCON_ASSERT(key_ == -1); // Key must be released in child object
         ^~~~~~~~~~~~
    [ 89%] Linking CXX static library liblycon.a
    [ 89%] Built target lycon
    Scanning dependencies of target pycon
    [ 96%] Building CXX object CMakeFiles/pycon.dir/src/lycon/python/interop.cc.o
    [ 96%] Building CXX object CMakeFiles/pycon.dir/src/lycon/python/module.cc.o
    /tmp/pip-install-enh8o2xy/lycon/src/lycon/python/interop.cc: In function ‘std::__cxx11::string lycon::string_from_pyobject(PyObject*)’:
    /tmp/pip-install-enh8o2xy/lycon/src/lycon/python/interop.cc:321:34: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
         char* str = PyString_AsString(object);
    
    make[2]: *** [CMakeFiles/pycon.dir/build.make:63: CMakeFiles/pycon.dir/src/lycon/python/interop.cc.o] Error 1
    make[2]: *** Waiting for unfinished jobs....
    make[1]: *** [CMakeFiles/Makefile2:110: CMakeFiles/pycon.dir/all] Error 2
    make: *** [Makefile:84: all] Error 2
    	* Failed to build the Lycon native extension.
    	* [Error] Failed to exceute: /usr/bin/make -j 8

This also happens on Linux Mint 18.1. with Python 3.7 and gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609.

I can confirm, that it works when I pip install git+https://github.com/ethereon/lycon.git. Please upload a new version to PyPI!

Apologies, it took me a while to get around to this. A new version with the fix has been uploaded to PyPI.