Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't compile pyuvc #53

Closed
nalive4 opened this issue Oct 2, 2018 · 8 comments
Closed

can't compile pyuvc #53

nalive4 opened this issue Oct 2, 2018 · 8 comments

Comments

@nalive4
Copy link

nalive4 commented Oct 2, 2018

Hi,
I am setting up dependencies on MacOS, when I run "pip3 install git+https://github.com/pupil-labs/pyuvc", I got error and warnings like the followings.

Collecting git+https://github.com/pupil-labs/pyuvc
Cloning https://github.com/pupil-labs/pyuvc to /private/var/folders/1_/jj2z81rx13j94vrbfytr532w0000gn/T/pip-req-build-bi9d7jy6
Building wheels for collected packages: uvc
Running setup.py bdist_wheel for uvc ... error
Complete output from command /usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;file='/private/var/folders/1_/jj2z81rx13j94vrbfytr532w0000gn/T/pip-req-build-bi9d7jy6/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /private/var/folders/1_/jj2z81rx13j94vrbfytr532w0000gn/T/pip-wheel-n1y2splx --python-tag cp37:
running bdist_wheel
running build
running build_ext
building 'uvc' extension
creating build
creating build/temp.macosx-10.13-x86_64-3.7
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/lib/python3.7/site-packages/numpy/core/include -I/usr/local/opt/jpeg-turbo/include/ -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c uvc.c -o build/temp.macosx-10.13-x86_64-3.7/uvc.o
In file included from uvc.c:601:
In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18:
In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821:
/usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15: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 "
^
uvc.c:17379:42: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
__pyx_t_8 = ((__pyx_v_uvc_frame->width == __pyx_v_j_width) != 0);
~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~
uvc.c:17385:43: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
__pyx_t_8 = ((__pyx_v_uvc_frame->height == __pyx_v_j_height) != 0);
~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~
uvc.c:17548:26: warning: assigning to 'uvc_input_terminal_t *' (aka 'struct uvc_input_terminal *') from 'const uvc_input_terminal_t *' (aka 'const struct uvc_input_terminal *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_input_terminal = uvc_get_input_terminals(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:17557:27: warning: assigning to 'uvc_output_terminal_t *' (aka 'struct uvc_output_terminal *') from 'const uvc_output_terminal_t *' (aka 'const struct uvc_output_terminal *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_output_terminal = uvc_get_output_terminals(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:17566:27: warning: assigning to 'uvc_processing_unit_t *' (aka 'struct uvc_processing_unit *') from 'const uvc_processing_unit_t *' (aka 'const struct uvc_processing_unit *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_processing_unit = uvc_get_processing_units(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:17575:26: warning: assigning to 'uvc_extension_unit_t *' (aka 'struct uvc_extension_unit *') from 'const uvc_extension_unit_t *' (aka 'const struct uvc_extension_unit *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_extension_unit = uvc_get_extension_units(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:18210:23: warning: assigning to 'uvc_format_desc_t *' (aka 'struct uvc_format_desc *') from 'const uvc_format_desc_t *' (aka 'const struct uvc_format_desc *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_format_desc = uvc_get_format_descs(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:20620:13: warning: unused function '__pyx_f_3uvc_on_status_update' [-Wunused-function]
static void __pyx_f_3uvc_on_status_update(CYTHON_UNUSED enum uvc_status_class __pyx_v_status_class, CYTHON_UNUSED int __pyx_v_event, CYTHON_UNUSED int __pyx_v_selector, CYTHON_UNUSED enum uvc_status_attribute __pyx_v_status_attribute, CYTHON_UNUSED void *__pyx_v_data, CYTHON_UNUSED size_t __pyx_v_data_len, CYTHON_UNUSED void *__pyx_v_user_ptr) {
^
9 warnings generated.
creating build/lib.macosx-10.13-x86_64-3.7
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.13-x86_64-3.7/uvc.o -L/usr/local/opt/jpeg-turbo/lib/ -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -lturbojpeg -luvc.0.0.7 -o build/lib.macosx-10.13-x86_64-3.7/uvc.cpython-37m-darwin.so
ld: library not found for -luvc.0.0.7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1


Failed building wheel for uvc
Running setup.py clean for uvc
Failed to build uvc
Installing collected packages: uvc
Running setup.py install for uvc ... error
Complete output from command /usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;file='/private/var/folders/1_/jj2z81rx13j94vrbfytr532w0000gn/T/pip-req-build-bi9d7jy6/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/var/folders/1_/jj2z81rx13j94vrbfytr532w0000gn/T/pip-record-8aaiej5i/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'uvc' extension
creating build
creating build/temp.macosx-10.13-x86_64-3.7
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/lib/python3.7/site-packages/numpy/core/include -I/usr/local/opt/jpeg-turbo/include/ -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c uvc.c -o build/temp.macosx-10.13-x86_64-3.7/uvc.o
In file included from uvc.c:601:
In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18:
In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821:
/usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15: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 "
^
uvc.c:17379:42: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
__pyx_t_8 = ((__pyx_v_uvc_frame->width == __pyx_v_j_width) != 0);
~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~
uvc.c:17385:43: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
__pyx_t_8 = ((__pyx_v_uvc_frame->height == __pyx_v_j_height) != 0);
~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~
uvc.c:17548:26: warning: assigning to 'uvc_input_terminal_t *' (aka 'struct uvc_input_terminal *') from 'const uvc_input_terminal_t *' (aka 'const struct uvc_input_terminal *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_input_terminal = uvc_get_input_terminals(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:17557:27: warning: assigning to 'uvc_output_terminal_t *' (aka 'struct uvc_output_terminal *') from 'const uvc_output_terminal_t *' (aka 'const struct uvc_output_terminal *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_output_terminal = uvc_get_output_terminals(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:17566:27: warning: assigning to 'uvc_processing_unit_t *' (aka 'struct uvc_processing_unit *') from 'const uvc_processing_unit_t *' (aka 'const struct uvc_processing_unit *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_processing_unit = uvc_get_processing_units(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:17575:26: warning: assigning to 'uvc_extension_unit_t *' (aka 'struct uvc_extension_unit *') from 'const uvc_extension_unit_t *' (aka 'const struct uvc_extension_unit *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_extension_unit = uvc_get_extension_units(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:18210:23: warning: assigning to 'uvc_format_desc_t *' (aka 'struct uvc_format_desc *') from 'const uvc_format_desc_t *' (aka 'const struct uvc_format_desc *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_format_desc = uvc_get_format_descs(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:20620:13: warning: unused function '__pyx_f_3uvc_on_status_update' [-Wunused-function]
static void __pyx_f_3uvc_on_status_update(CYTHON_UNUSED enum uvc_status_class __pyx_v_status_class, CYTHON_UNUSED int __pyx_v_event, CYTHON_UNUSED int __pyx_v_selector, CYTHON_UNUSED enum uvc_status_attribute __pyx_v_status_attribute, CYTHON_UNUSED void *__pyx_v_data, CYTHON_UNUSED size_t __pyx_v_data_len, CYTHON_UNUSED void *__pyx_v_user_ptr) {
^
9 warnings generated.
creating build/lib.macosx-10.13-x86_64-3.7
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.13-x86_64-3.7/uvc.o -L/usr/local/opt/jpeg-turbo/lib/ -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -lturbojpeg -luvc.0.0.7 -o build/lib.macosx-10.13-x86_64-3.7/uvc.cpython-37m-darwin.so
ld: library not found for -luvc.0.0.7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1

----------------------------------------

Command "/usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;file='/private/var/folders/1_/jj2z81rx13j94vrbfytr532w0000gn/T/pip-req-build-bi9d7jy6/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/var/folders/1_/jj2z81rx13j94vrbfytr532w0000gn/T/pip-record-8aaiej5i/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/1_/jj2z81rx13j94vrbfytr532w0000gn/T/pip-req-build-bi9d7jy6/

By the way I install libuvc from https://github.com/pupil-labs/libuvc. I didn't get this error before until I want to check the version of libuvc since log above said it can't find libuvc.0.0.7. Then I got log below. I am a newbie so hope someone can help. Thank you so much!

naliu@105:/libuvc/build$ cmake ..
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/naliu/libuvc/build
naliu@105:
/libuvc/build$ make && make install
[100%] Built target uvc
[100%] Built target uvc
Install the project...
-- Install configuration: "Release"
-- Up-to-date: /usr/local/lib/libuvc.0.0.8.dylib
CMake Error at cmake_install.cmake:44 (file):
file INSTALL cannot set permissions on "/usr/local/lib/libuvc.0.0.8.dylib"

make: *** [install] Error 1

@pointcontrols
Copy link
Member

pointcontrols commented Oct 2, 2018 via email

@nalive4
Copy link
Author

nalive4 commented Oct 2, 2018

Please run sudo make install in libuvc

still has the same error.

naliu@105:~/libuvc/build$ sudo make && make install
Password:
[100%] Built target uvc
[100%] Built target uvc
Install the project...
-- Install configuration: "Release"
-- Up-to-date: /usr/local/lib/libuvc.0.0.8.dylib
CMake Error at cmake_install.cmake:44 (file):
file INSTALL cannot set permissions on "/usr/local/lib/libuvc.0.0.8.dylib"

make: *** [install] Error 1

@allardhoeve
Copy link

I also cannot compile pyuvc with recently brew installed libuvc and libjpeg-turbo. Fresh numpy and cython from pip.

$ python setup.py install
running install
running build
running build_ext
building 'uvc' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -arch x86_64 -I/Users/allardhoeve/.virtualenvs/pyfinder/lib/python3.6/site-packages/numpy/core/include -I/usr/local/opt/jpeg-turbo/include/ -I/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c uvc.c -o build/temp.macosx-10.13-x86_64-3.6/uvc.o
In file included from uvc.c:643:
In file included from /Users/allardhoeve/.virtualenvs/pyfinder/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /Users/allardhoeve/.virtualenvs/pyfinder/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:18:
In file included from /Users/allardhoeve/.virtualenvs/pyfinder/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821:
/Users/allardhoeve/.virtualenvs/pyfinder/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15: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 " \
 ^
uvc.c:15545:103: error: too many arguments to function call, expected 4, have 5
  __pyx_v_status = uvc_stream_start(__pyx_v_self->strmh, NULL, NULL, __pyx_v_self->_bandwidth_factor, 0);
                   ~~~~~~~~~~~~~~~~                                                                   ^
/usr/local/include/libuvc/libuvc.h:567:1: note: 'uvc_stream_start' declared here
uvc_error_t uvc_stream_start(uvc_stream_handle_t *strmh,
^
uvc.c:16632:42: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and
      'int' [-Wsign-compare]
  __pyx_t_7 = ((__pyx_v_uvc_frame->width == __pyx_v_j_width) != 0);
                ~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~
uvc.c:16638:43: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and
      'int' [-Wsign-compare]
  __pyx_t_7 = ((__pyx_v_uvc_frame->height == __pyx_v_j_height) != 0);
                ~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~
uvc.c:16811:26: warning: assigning to 'uvc_input_terminal_t *' (aka 'struct uvc_input_terminal *') from
      'const uvc_input_terminal_t *' (aka 'const struct uvc_input_terminal *') discards qualifiers
      [-Wincompatible-pointer-types-discards-qualifiers]
  __pyx_v_input_terminal = uvc_get_input_terminals(__pyx_v_self->devh);
                         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:16820:27: warning: assigning to 'uvc_output_terminal_t *' (aka 'struct uvc_output_terminal *') from
      'const uvc_output_terminal_t *' (aka 'const struct uvc_output_terminal *') discards qualifiers
      [-Wincompatible-pointer-types-discards-qualifiers]
  __pyx_v_output_terminal = uvc_get_output_terminals(__pyx_v_self->devh);
                          ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:16829:27: warning: assigning to 'uvc_processing_unit_t *' (aka 'struct uvc_processing_unit *') from
      'const uvc_processing_unit_t *' (aka 'const struct uvc_processing_unit *') discards qualifiers
      [-Wincompatible-pointer-types-discards-qualifiers]
  __pyx_v_processing_unit = uvc_get_processing_units(__pyx_v_self->devh);
                          ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:16838:26: warning: assigning to 'uvc_extension_unit_t *' (aka 'struct uvc_extension_unit *') from
      'const uvc_extension_unit_t *' (aka 'const struct uvc_extension_unit *') discards qualifiers
      [-Wincompatible-pointer-types-discards-qualifiers]
  __pyx_v_extension_unit = uvc_get_extension_units(__pyx_v_self->devh);
                         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:17410:23: warning: assigning to 'uvc_format_desc_t *' (aka 'struct uvc_format_desc *') from
      'const uvc_format_desc_t *' (aka 'const struct uvc_format_desc *') discards qualifiers
      [-Wincompatible-pointer-types-discards-qualifiers]
  __pyx_v_format_desc = uvc_get_format_descs(__pyx_v_self->devh);
                      ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 warnings and 1 error generated.
error: command 'clang' failed with exit status 1
$ 

Versions:

Cython==0.29
numpy==1.15.3
libuvc: stable 0.0.6 (bottled), HEAD
Python 3.6.5

I now see that you've tagged one new release (0.0.7) but not another (0.0.8).

@mmihailescu
Copy link

mmihailescu commented Nov 2, 2018

Was anyone able to figure this out? I'm having the same exact issue.

@papr
Copy link
Contributor

papr commented Nov 2, 2018

@allardhoeve You need to install libuvc as described in the docs instead using brew! See https://docs.pupil-labs.com/#install-libuvc

@burknator
Copy link

burknator commented Nov 9, 2018

@papr When doing that, I run into the same error as shown in #56 when installing pyuvc: ld: library not found for -luvc.0.0.7.

@papr
Copy link
Contributor

papr commented Nov 26, 2018

Please try this patch:

diff --git a/setup.py b/setup.py
index 8216fc5..c9999c3 100644
--- a/setup.py
+++ b/setup.py
@@ -20,7 +20,7 @@ extra_objects = []
 library_dirs = []
 include_dirs = [numpy.get_include()]
 if platform.system() == 'Darwin':
-    libs = ['turbojpeg', 'uvc.0.0.7']
+    libs = ['turbojpeg', 'uvc']
     include_dirs += ['/usr/local/opt/jpeg-turbo/include/']
     library_dirs += ['/usr/local/opt/jpeg-turbo/lib/']
 elif platform.system() == 'Linux':

@papr
Copy link
Contributor

papr commented Nov 26, 2018

Actually, uvc.0.0.9 is required. I pushed the required changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants