簡體   English   中英

嘗試安裝 OpenDR 時出現錯誤(命令“gcc”失敗,退出狀態為 1)

[英]Error (command 'gcc' failed with exit status 1) when trying to install OpenDR

我是 python 初學者,我目前正在嘗試運行 smpl,但是我需要下載 OpenDR 才能這樣做。 我已經安裝了自制軟件和命令行工具,並檢查了我是否下載了 gcc。 在這一點上,我很困惑如何進行。 我附上了我收到的完整錯誤代碼。 在這一點上的任何幫助將不勝感激。

ERROR: Command errored out with exit status 1:
   command: /Users/jonasdixon/opt/anaconda3/envs/py27/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/bl/vpm7gmwx2zqdqf04vddhv6180000gn/T/pip-install-G9YeQJ/opendr/setup.py'"'"'; __file__='"'"'/private/var/folders/bl/vpm7gmwx2zqdqf04vddhv6180000gn/T/pip-install-G9YeQJ/opendr/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/bl/vpm7gmwx2zqdqf04vddhv6180000gn/T/pip-wheel-CZsgRX --python-tag cp27
       cwd: /private/var/folders/bl/vpm7gmwx2zqdqf04vddhv6180000gn/T/pip-install-G9YeQJ/opendr/
  Complete output (87 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.7-x86_64-2.7
  creating build/lib.macosx-10.7-x86_64-2.7/opendr
  copying opendr/test_renderer.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
  copying opendr/test_camera.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
  copying opendr/version.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
  copying opendr/cvwrap.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
  copying opendr/slider_demo.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
  copying opendr/renderer.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
  copying opendr/__init__.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
  copying opendr/everything.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
  copying opendr/test_sh.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
  copying opendr/util_tests.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
  copying opendr/lighting.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
  copying opendr/camera.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
  copying opendr/occlusion_test.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
  copying opendr/common.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
  copying opendr/utils.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
  copying opendr/geometry.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
  copying opendr/topology.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
  copying opendr/test_depth_renderer.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
  copying opendr/simple.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
  copying opendr/dummy.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
  copying opendr/test_geometry.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
  copying opendr/serialization.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
  copying opendr/filters.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
  creating build/lib.macosx-10.7-x86_64-2.7/opendr/contexts
  copying opendr/contexts/_constants.py -> build/lib.macosx-10.7-x86_64-2.7/opendr/contexts
  copying opendr/contexts/draw_triangle_shaders_3_2.py -> build/lib.macosx-10.7-x86_64-2.7/opendr/contexts
  copying opendr/contexts/fix_warnings.py -> build/lib.macosx-10.7-x86_64-2.7/opendr/contexts
  copying opendr/contexts/__init__.py -> build/lib.macosx-10.7-x86_64-2.7/opendr/contexts
  copying opendr/contexts/autogen.py -> build/lib.macosx-10.7-x86_64-2.7/opendr/contexts
  copying opendr/contexts/draw_triangle_shaders_2_1.py -> build/lib.macosx-10.7-x86_64-2.7/opendr/contexts
  creating build/lib.macosx-10.7-x86_64-2.7/opendr/test_dr
  copying opendr/test_dr/__init__.py -> build/lib.macosx-10.7-x86_64-2.7/opendr/test_dr
  running build_ext
  building 'opendr.contexts.ctx_mac' extension
  creating build/temp.macosx-10.7-x86_64-2.7
  creating build/temp.macosx-10.7-x86_64-2.7/opendr
  creating build/temp.macosx-10.7-x86_64-2.7/opendr/contexts
  gcc -fno-strict-aliasing -I/Users/jonasdixon/opt/anaconda3/envs/py27/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Iopendr/contexts -I. -I/Users/jonasdixon/opt/anaconda3/envs/py27/lib/python2.7/site-packages/numpy/core/include -I/Users/jonasdixon/opt/anaconda3/envs/py27/include/python2.7 -c opendr/contexts/ctx_mac.c -o build/temp.macosx-10.7-x86_64-2.7/opendr/contexts/ctx_mac.o -Qunused-arguments
  In file included from opendr/contexts/ctx_mac.c:630:
  In file included from /Users/jonasdixon/opt/anaconda3/envs/py27/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
  In file included from /Users/jonasdixon/opt/anaconda3/envs/py27/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
  In file included from /Users/jonasdixon/opt/anaconda3/envs/py27/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1824:
  /Users/jonasdixon/opt/anaconda3/envs/py27/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with "          "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
  #warning "Using deprecated NumPy API, disable it with " \
   ^
  opendr/contexts/ctx_mac.c:3498:3: error: implicit declaration of function 'glGenVertexArrays' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    glGenVertexArrays(__pyx_v_n, (&(*__Pyx_BufPtrStrided1d(unsigned int *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides))));
    ^
  opendr/contexts/ctx_mac.c:3498:3: note: did you mean 'glGenVertexArraysAPPLE'?
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/glext.h:3407:13: note: 'glGenVertexArraysAPPLE' declared here
  extern void glGenVertexArraysAPPLE(GLsizei n, GLuint *ids);
              ^
  opendr/contexts/ctx_mac.c:3637:3: error: implicit declaration of function 'glBindFragDataLocation' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    glBindFragDataLocation(__pyx_v_program, __pyx_v_color, __pyx_v_name);
    ^
  opendr/contexts/ctx_mac.c:3637:3: note: did you mean 'glBindFragDataLocationEXT'?
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/glext.h:3075:13: note: 'glBindFragDataLocationEXT' declared here
  extern void glBindFragDataLocationEXT(GLuint program, GLuint colorNumber, const GLchar *name);
              ^
  opendr/contexts/ctx_mac.c:4149:3: error: implicit declaration of function 'glClearBufferfv' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    glClearBufferfv(__pyx_v_buffer, __pyx_v_drawbuffer, ((GLfloat *)__pyx_v_value->data));
    ^
  opendr/contexts/ctx_mac.c:4149:3: note: did you mean 'glReadBuffer'?
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gl.h:2651:13: note: 'glReadBuffer' declared here
  extern void glReadBuffer (GLenum mode) OPENGL_DEPRECATED(10.0, 10.14);
              ^
  opendr/contexts/ctx_mac.c:12787:49: warning: passing 'char **' to parameter of type 'const GLchar *const *' (aka 'const char *const *') discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
    glShaderSource(__pyx_v_shader, __pyx_v_count, (&__pyx_v_s), (&__pyx_v_len));
                                                  ^~~~~~~~~~~~
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gl.h:2926:80: note: passing argument to parameter 'string' here
  extern void glShaderSource (GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length) OPENGL_DEPRECATED(10.0, 10.14);
                                                                                 ^
  opendr/contexts/ctx_mac.c:13017:3: error: implicit declaration of function 'glBindVertexArray' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    glBindVertexArray(__pyx_v_array);
    ^
  opendr/contexts/ctx_mac.c:13017:3: note: did you mean 'glBindVertexArrayAPPLE'?
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/glext.h:3405:13: note: 'glBindVertexArrayAPPLE' declared here
  extern void glBindVertexArrayAPPLE(GLuint id);
              ^
  2 warnings and 4 errors generated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for opendr
  Running setup.py clean for opendr
Failed to build opendr
Installing collected packages: opendr
  Running setup.py install for opendr ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/jonasdixon/opt/anaconda3/envs/py27/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/bl/vpm7gmwx2zqdqf04vddhv6180000gn/T/pip-install-G9YeQJ/opendr/setup.py'"'"'; __file__='"'"'/private/var/folders/bl/vpm7gmwx2zqdqf04vddhv6180000gn/T/pip-install-G9YeQJ/opendr/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/bl/vpm7gmwx2zqdqf04vddhv6180000gn/T/pip-record-FyeaO3/install-record.txt --single-version-externally-managed --compile
         cwd: /private/var/folders/bl/vpm7gmwx2zqdqf04vddhv6180000gn/T/pip-install-G9YeQJ/opendr/
    Complete output (87 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.7-x86_64-2.7
    creating build/lib.macosx-10.7-x86_64-2.7/opendr
    copying opendr/test_renderer.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
    copying opendr/test_camera.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
    copying opendr/version.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
    copying opendr/cvwrap.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
    copying opendr/slider_demo.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
    copying opendr/renderer.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
    copying opendr/__init__.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
    copying opendr/everything.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
    copying opendr/test_sh.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
    copying opendr/util_tests.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
    copying opendr/lighting.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
    copying opendr/camera.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
    copying opendr/occlusion_test.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
    copying opendr/common.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
    copying opendr/utils.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
    copying opendr/geometry.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
    copying opendr/topology.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
    copying opendr/test_depth_renderer.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
    copying opendr/simple.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
    copying opendr/dummy.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
    copying opendr/test_geometry.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
    copying opendr/serialization.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
    copying opendr/filters.py -> build/lib.macosx-10.7-x86_64-2.7/opendr
    creating build/lib.macosx-10.7-x86_64-2.7/opendr/contexts
    copying opendr/contexts/_constants.py -> build/lib.macosx-10.7-x86_64-2.7/opendr/contexts
    copying opendr/contexts/draw_triangle_shaders_3_2.py -> build/lib.macosx-10.7-x86_64-2.7/opendr/contexts
    copying opendr/contexts/fix_warnings.py -> build/lib.macosx-10.7-x86_64-2.7/opendr/contexts
    copying opendr/contexts/__init__.py -> build/lib.macosx-10.7-x86_64-2.7/opendr/contexts
    copying opendr/contexts/autogen.py -> build/lib.macosx-10.7-x86_64-2.7/opendr/contexts
    copying opendr/contexts/draw_triangle_shaders_2_1.py -> build/lib.macosx-10.7-x86_64-2.7/opendr/contexts
    creating build/lib.macosx-10.7-x86_64-2.7/opendr/test_dr
    copying opendr/test_dr/__init__.py -> build/lib.macosx-10.7-x86_64-2.7/opendr/test_dr
    running build_ext
    building 'opendr.contexts.ctx_mac' extension
    creating build/temp.macosx-10.7-x86_64-2.7
    creating build/temp.macosx-10.7-x86_64-2.7/opendr
    creating build/temp.macosx-10.7-x86_64-2.7/opendr/contexts
    gcc -fno-strict-aliasing -I/Users/jonasdixon/opt/anaconda3/envs/py27/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Iopendr/contexts -I. -I/Users/jonasdixon/opt/anaconda3/envs/py27/lib/python2.7/site-packages/numpy/core/include -I/Users/jonasdixon/opt/anaconda3/envs/py27/include/python2.7 -c opendr/contexts/ctx_mac.c -o build/temp.macosx-10.7-x86_64-2.7/opendr/contexts/ctx_mac.o -Qunused-arguments
    In file included from opendr/contexts/ctx_mac.c:630:
    In file included from /Users/jonasdixon/opt/anaconda3/envs/py27/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
    In file included from /Users/jonasdixon/opt/anaconda3/envs/py27/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
    In file included from /Users/jonasdixon/opt/anaconda3/envs/py27/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1824:
    /Users/jonasdixon/opt/anaconda3/envs/py27/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with "          "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
    #warning "Using deprecated NumPy API, disable it with " \
     ^
    opendr/contexts/ctx_mac.c:3498:3: error: implicit declaration of function 'glGenVertexArrays' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      glGenVertexArrays(__pyx_v_n, (&(*__Pyx_BufPtrStrided1d(unsigned int *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides))));
      ^
    opendr/contexts/ctx_mac.c:3498:3: note: did you mean 'glGenVertexArraysAPPLE'?
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/glext.h:3407:13: note: 'glGenVertexArraysAPPLE' declared here
    extern void glGenVertexArraysAPPLE(GLsizei n, GLuint *ids);
                ^
    opendr/contexts/ctx_mac.c:3637:3: error: implicit declaration of function 'glBindFragDataLocation' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      glBindFragDataLocation(__pyx_v_program, __pyx_v_color, __pyx_v_name);
      ^
    opendr/contexts/ctx_mac.c:3637:3: note: did you mean 'glBindFragDataLocationEXT'?
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/glext.h:3075:13: note: 'glBindFragDataLocationEXT' declared here
    extern void glBindFragDataLocationEXT(GLuint program, GLuint colorNumber, const GLchar *name);
                ^
    opendr/contexts/ctx_mac.c:4149:3: error: implicit declaration of function 'glClearBufferfv' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      glClearBufferfv(__pyx_v_buffer, __pyx_v_drawbuffer, ((GLfloat *)__pyx_v_value->data));
      ^
    opendr/contexts/ctx_mac.c:4149:3: note: did you mean 'glReadBuffer'?
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gl.h:2651:13: note: 'glReadBuffer' declared here
    extern void glReadBuffer (GLenum mode) OPENGL_DEPRECATED(10.0, 10.14);
                ^
    opendr/contexts/ctx_mac.c:12787:49: warning: passing 'char **' to parameter of type 'const GLchar *const *' (aka 'const char *const *') discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
      glShaderSource(__pyx_v_shader, __pyx_v_count, (&__pyx_v_s), (&__pyx_v_len));
                                                    ^~~~~~~~~~~~
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gl.h:2926:80: note: passing argument to parameter 'string' here
    extern void glShaderSource (GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length) OPENGL_DEPRECATED(10.0, 10.14);
                                                                                   ^
    opendr/contexts/ctx_mac.c:13017:3: error: implicit declaration of function 'glBindVertexArray' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      glBindVertexArray(__pyx_v_array);
      ^
    opendr/contexts/ctx_mac.c:13017:3: note: did you mean 'glBindVertexArrayAPPLE'?
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/glext.h:3405:13: note: 'glBindVertexArrayAPPLE' declared here
    extern void glBindVertexArrayAPPLE(GLuint id);
                ^
    2 warnings and 4 errors generated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/jonasdixon/opt/anaconda3/envs/py27/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/bl/vpm7gmwx2zqdqf04vddhv6180000gn/T/pip-install-G9YeQJ/opendr/setup.py'"'"'; __file__='"'"'/private/var/folders/bl/vpm7gmwx2zqdqf04vddhv6180000gn/T/pip-install-G9YeQJ/opendr/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/bl/vpm7gmwx2zqdqf04vddhv6180000gn/T/pip-record-FyeaO3/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

謝謝!

如果您需要 TLDR,請跳至有關解決方案的部分。 我試圖記錄我的問題解決過程,希望它對你有用。

調查

讓我們分析您的錯誤 output 並嘗試解決此問題。 快速瀏覽 output,看起來這個 blob 是相關的:

   /Users/jonasdixon/opt/anaconda3/envs/py27/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with "          "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
    #warning "Using deprecated NumPy API, disable it with " \
     ^
    opendr/contexts/ctx_mac.c:3498:3: error: implicit declaration of function 'glGenVertexArrays' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      glGenVertexArrays(__pyx_v_n, (&(*__Pyx_BufPtrStrided1d(unsigned int *, __pyx_pybuffernd_arr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_arr.diminfo[0].strides))));
      ^
    opendr/contexts/ctx_mac.c:3498:3: note: did you mean 'glGenVertexArraysAPPLE'?
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/glext.h:3407:13: note: 'glGenVertexArraysAPPLE' declared here
    extern void glGenVertexArraysAPPLE(GLsizei n, GLuint *ids);
                ^
    opendr/contexts/ctx_mac.c:3637:3: error: implicit declaration of function 'glBindFragDataLocation' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      glBindFragDataLocation(__pyx_v_program, __pyx_v_color, __pyx_v_name);
      ^
    opendr/contexts/ctx_mac.c:3637:3: note: did you mean 'glBindFragDataLocationEXT'?
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/glext.h:3075:13: note: 'glBindFragDataLocationEXT' declared here
    extern void glBindFragDataLocationEXT(GLuint program, GLuint colorNumber, const GLchar *name);
                ^
    opendr/contexts/ctx_mac.c:4149:3: error: implicit declaration of function 'glClearBufferfv' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      glClearBufferfv(__pyx_v_buffer, __pyx_v_drawbuffer, ((GLfloat *)__pyx_v_value->data));
      ^
    opendr/contexts/ctx_mac.c:4149:3: note: did you mean 'glReadBuffer'?
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gl.h:2651:13: note: 'glReadBuffer' declared here
    extern void glReadBuffer (GLenum mode) OPENGL_DEPRECATED(10.0, 10.14);
                ^
    opendr/contexts/ctx_mac.c:12787:49: warning: passing 'char **' to parameter of type 'const GLchar *const *' (aka 'const char *const *') discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
      glShaderSource(__pyx_v_shader, __pyx_v_count, (&__pyx_v_s), (&__pyx_v_len));
                                                    ^~~~~~~~~~~~
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gl.h:2926:80: note: passing argument to parameter 'string' here
    extern void glShaderSource (GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length) OPENGL_DEPRECATED(10.0, 10.14);
                                                                                   ^
    opendr/contexts/ctx_mac.c:13017:3: error: implicit declaration of function 'glBindVertexArray' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      glBindVertexArray(__pyx_v_array);
      ^
    opendr/contexts/ctx_mac.c:13017:3: note: did you mean 'glBindVertexArrayAPPLE'?
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/glext.h:3405:13: note: 'glBindVertexArrayAPPLE' declared here
    extern void glBindVertexArrayAPPLE(GLuint id);
                ^
    2 warnings and 4 errors generated.
    error: command 'gcc' failed with exit status 1

在底部我們可以看到gcc ,它是許多平台上的默認 C 編譯器,失敗並出現 4 個錯誤。 查看 output 我們可以確定一個常見原因:

error: implicit declaration of function 'glBindVertexArray' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

谷歌搜索它會產生這個 stackoverflow 答案,但我們可能不想修改我們剛剛從互聯網上下載並且我們不理解的代碼。 第三個谷歌鏈接是 Khronos 論壇上的這篇文章,我們的錯誤在哪里......警告?

進一步調查或一些直覺可能會發現 output 中的[-Werror,-Wimplicit-function-declaration]命令行開關非常重要。 -Wimplicit-function-declaration生成警告, -Werror將警告變成錯誤。 這解釋了我們的行為......現在我們需要修復它。

現在有幾個選擇:

  1. 將編譯器更改為兼容的。 我們不知道哪一個是兼容的,它肯定不會工作。
  2. 更改 -Werror 的定義。 老實說,我不太確定該怎么做。
  3. 從編譯命令中刪除-Wall標志,或以某種方式否定它。

解決方案

我認為選項 3 是最好的。 我沒有辦法 model 這個,但這是我建議你做的:

  1. 使用 pip 單獨下載opendr package。
  2. 打開setup.py ,修改第 132 和 133 行添加-Wno-error=implicit-function-declaration 在此處查看更多詳細信息。
  3. 使用setup.py安裝 package - 這是 python 包的常見安裝方案,因此有大量文檔。 編譯現在應該可以工作了:)

我意識到這是相當復雜和蠻力的,但我認為它會解決問題。 如果有人有更好的解決方案,我很想聽聽。

此外,您可以在 github 存儲庫上打開問題,甚至可以修改代碼以使其正確且不會生成這些警告。 這將需要更多的努力,但這是開始為開源做出貢獻的一種非常酷的方式,它將為每個人省去麻煩:)

附錄

您可能會問自己,這是如何在任何人的計算機上編譯的。 答案很簡單——為編譯提供的-Wall開關實際上並沒有啟用所有警告,而且它在編譯器之間甚至編譯器版本之間是不同的。 我不是 100% 確定這里是否是這種情況,但看起來確實如此。 Hacker News 上對此進行了很好的討論。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM