sunhan1997/IndusGrasp

pip install cyglfw3 error

Opened this issue · 3 comments

An error occurred while installing cyglfw3, and I couldn't find a solution. Have you ever encountered this kind of error? Or what is the version of cython / libglfw3-dev / libglfw3 / cyglfw3 you installed?

The error message is as follows:
` Error compiling Cython file:
------------------------------------------------------------
...
return cglfw3.glfwGetVersionString()

  def SetErrorCallback(cbfun):
      global _error_fun
      _error_fun = cbfun
      cglfw3.glfwSetErrorCallback(errorfun_cb)
                                  ^
  ------------------------------------------------------------
  
  cyglfw3/glfw3.pyx:691:32: Cannot assign type 'void (int, const char *) except *' to 'GLFWerrorfun'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (int, const char *) except *'.
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      return cglfw3.glfwGetMonitorName(<cglfw3.GLFWmonitor*>monitor._this_ptr)
  
  def SetMonitorCallback(cbfun):
      global _monitorfun
      _monitorfun = cbfun
      cglfw3.glfwSetMonitorCallback(monitorfun_cb)
                                    ^
  ------------------------------------------------------------
  
  cyglfw3/glfw3.pyx:727:34: Cannot assign type 'void (GLFWmonitor *, int) except *' to 'GLFWmonitorfun'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (GLFWmonitor *, int) except *'.
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
  #    pass
  
  def SetWindowPosCallback(Window window, cbfun):
      global _windowposfuns
      _windowposfuns[<size_t>window._this_ptr] = cbfun
      cglfw3.glfwSetWindowPosCallback(<cglfw3.GLFWwindow*>window._this_ptr, windowposfun_cb)
                                                                            ^
  ------------------------------------------------------------
  
  cyglfw3/glfw3.pyx:841:74: Cannot assign type 'void (GLFWwindow *, int, int) except *' to 'GLFWwindowposfun'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (GLFWwindow *, int, int) except *'.
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      cglfw3.glfwSetWindowPosCallback(<cglfw3.GLFWwindow*>window._this_ptr, windowposfun_cb)
  
  def SetWindowSizeCallback(Window window, cbfun):
      global _windowsizefuns
      _windowsizefuns[<size_t>window._this_ptr] = cbfun
      cglfw3.glfwSetWindowSizeCallback(<cglfw3.GLFWwindow*>window._this_ptr, windowsizefun_cb)
                                                                             ^
  ------------------------------------------------------------
  
  cyglfw3/glfw3.pyx:846:75: Cannot assign type 'void (GLFWwindow *, int, int) except *' to 'GLFWwindowsizefun'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (GLFWwindow *, int, int) except *'.
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      cglfw3.glfwSetWindowSizeCallback(<cglfw3.GLFWwindow*>window._this_ptr, windowsizefun_cb)
  
  def SetWindowCloseCallback(Window window, cbfun):
      global _windowclosefuns
      _windowclosefuns[<size_t>window._this_ptr] = cbfun
      cglfw3.glfwSetWindowCloseCallback(<cglfw3.GLFWwindow*>window._this_ptr, windowclosefun_cb)
                                                                              ^
  ------------------------------------------------------------
  
  cyglfw3/glfw3.pyx:851:76: Cannot assign type 'void (GLFWwindow *) except *' to 'GLFWwindowclosefun'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (GLFWwindow *) except *'.
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      cglfw3.glfwSetWindowCloseCallback(<cglfw3.GLFWwindow*>window._this_ptr, windowclosefun_cb)
  
  def SetWindowRefreshCallback(Window window, cbfun):
      global _windowrefreshfuns
      _windowrefreshfuns[<size_t>window._this_ptr] = cbfun
      cglfw3.glfwSetWindowRefreshCallback(<cglfw3.GLFWwindow*>window._this_ptr, windowrefreshfun_cb)
                                                                                ^
  ------------------------------------------------------------
  
  cyglfw3/glfw3.pyx:856:78: Cannot assign type 'void (GLFWwindow *) except *' to 'GLFWwindowrefreshfun'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (GLFWwindow *) except *'.
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      cglfw3.glfwSetWindowRefreshCallback(<cglfw3.GLFWwindow*>window._this_ptr, windowrefreshfun_cb)
  
  def SetWindowFocusCallback(Window window, cbfun):
      global _windowfocusfuns
      _windowfocusfuns[<size_t>window._this_ptr] = cbfun
      cglfw3.glfwSetWindowFocusCallback(<cglfw3.GLFWwindow*>window._this_ptr, windowfocusfun_cb)
                                                                              ^
  ------------------------------------------------------------
  
  cyglfw3/glfw3.pyx:861:76: Cannot assign type 'void (GLFWwindow *, int) except *' to 'GLFWwindowfocusfun'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (GLFWwindow *, int) except *'.
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      cglfw3.glfwSetWindowFocusCallback(<cglfw3.GLFWwindow*>window._this_ptr, windowfocusfun_cb)
  
  def SetWindowIconifyCallback(Window window, cbfun):
      global _windowiconifyfuns
      _windowiconifyfuns[<size_t>window._this_ptr] = cbfun
      cglfw3.glfwSetWindowIconifyCallback(<cglfw3.GLFWwindow*>window._this_ptr, windowiconifyfun_cb)
                                                                                ^
  ------------------------------------------------------------
  
  cyglfw3/glfw3.pyx:866:78: Cannot assign type 'void (GLFWwindow *, int) except *' to 'GLFWwindowiconifyfun'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (GLFWwindow *, int) except *'.
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      cglfw3.glfwSetWindowIconifyCallback(<cglfw3.GLFWwindow*>window._this_ptr, windowiconifyfun_cb)
  
  def SetFramebufferSizeCallback(Window window, cbfun):
      global _framebuffersize
      _framebuffersizefuns[<size_t>window._this_ptr] = cbfun
      cglfw3.glfwSetFramebufferSizeCallback(<cglfw3.GLFWwindow*>window._this_ptr, framebuffersizefun_cb)
                                                                                  ^
  ------------------------------------------------------------
  
  cyglfw3/glfw3.pyx:871:80: Cannot assign type 'void (GLFWwindow *, int, int) except *' to 'GLFWframebuffersizefun'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (GLFWwindow *, int, int) except *'.
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      cglfw3.glfwSetCursor(<cglfw3.GLFWwindow*>window._this_ptr, <cglfw3.GLFWcursor*>cursor._this_ptr)
  
  def SetKeyCallback(Window window, cbfun):
      global _keyfuns
      _keyfuns[<size_t>window._this_ptr] = cbfun
      cglfw3.glfwSetKeyCallback(<cglfw3.GLFWwindow*>window._this_ptr, keyfun_cb)
                                                                      ^
  ------------------------------------------------------------
  
  cyglfw3/glfw3.pyx:925:68: Cannot assign type 'void (GLFWwindow *, int, int, int, int) except *' to 'GLFWkeyfun'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (GLFWwindow *, int, int, int, int) except *'.
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      cglfw3.glfwSetKeyCallback(<cglfw3.GLFWwindow*>window._this_ptr, keyfun_cb)
  
  def SetCharCallback(Window window, cbfun):
      global _charfuns
      _charfuns[<size_t>window._this_ptr] = cbfun
      cglfw3.glfwSetCharCallback(<cglfw3.GLFWwindow*>window._this_ptr, charfun_cb)
                                                                       ^
  ------------------------------------------------------------
  
  cyglfw3/glfw3.pyx:930:69: Cannot assign type 'void (GLFWwindow *, unsigned int) except *' to 'GLFWcharfun'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (GLFWwindow *, unsigned int) except *'.
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      cglfw3.glfwSetCharCallback(<cglfw3.GLFWwindow*>window._this_ptr, charfun_cb)
  
  def SetCharModsCallback(Window window, cbfun):
      global _charmodsfuns
      _charmodsfuns[<size_t>window._this_ptr] = cbfun
      cglfw3.glfwSetCharModsCallback(<cglfw3.GLFWwindow*>window._this_ptr, charmodsfun_cb)
                                                                           ^
  ------------------------------------------------------------
  
  cyglfw3/glfw3.pyx:935:73: Cannot assign type 'void (GLFWwindow *, unsigned int, int) except *' to 'GLFWcharmodsfun'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (GLFWwindow *, unsigned int, int) except *'.
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      cglfw3.glfwSetCharModsCallback(<cglfw3.GLFWwindow*>window._this_ptr, charmodsfun_cb)
  
  def SetMouseButtonCallback(Window window, cbfun):
      global _mousebuttonfuns
      _mousebuttonfuns[<size_t>window._this_ptr] = cbfun
      cglfw3.glfwSetMouseButtonCallback(<cglfw3.GLFWwindow*>window._this_ptr, mousebuttonfun_cb)
                                                                              ^
  ------------------------------------------------------------
  
  cyglfw3/glfw3.pyx:940:76: Cannot assign type 'void (GLFWwindow *, int, int, int) except *' to 'GLFWmousebuttonfun'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (GLFWwindow *, int, int, int) except *'.
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      cglfw3.glfwSetMouseButtonCallback(<cglfw3.GLFWwindow*>window._this_ptr, mousebuttonfun_cb)
  
  def SetCursorPosCallback(Window window, cbfun):
      global _cursorposfuns
      _cursorposfuns[<size_t>window._this_ptr] = cbfun
      cglfw3.glfwSetCursorPosCallback(<cglfw3.GLFWwindow*>window._this_ptr, cursorposfun_cb)
                                                                            ^
  ------------------------------------------------------------
  
  cyglfw3/glfw3.pyx:945:74: Cannot assign type 'void (GLFWwindow *, double, double) except *' to 'GLFWcursorposfun'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (GLFWwindow *, double, double) except *'.
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      cglfw3.glfwSetCursorPosCallback(<cglfw3.GLFWwindow*>window._this_ptr, cursorposfun_cb)
  
  def SetCursorEnterCallback(Window window, cbfun):
      global _cursorenterfuns
      _cursorenterfuns[<size_t>window._this_ptr] = cbfun
      cglfw3.glfwSetCursorEnterCallback(<cglfw3.GLFWwindow*>window._this_ptr, cursorenterfun_cb)
                                                                              ^
  ------------------------------------------------------------
  
  cyglfw3/glfw3.pyx:950:76: Cannot assign type 'void (GLFWwindow *, int) except *' to 'GLFWcursorenterfun'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (GLFWwindow *, int) except *'.
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      cglfw3.glfwSetCursorEnterCallback(<cglfw3.GLFWwindow*>window._this_ptr, cursorenterfun_cb)
  
  def SetScrollCallback(Window window, cbfun):
      global _scrollfuns
      _scrollfuns[<size_t>window._this_ptr] = cbfun
      cglfw3.glfwSetScrollCallback(<cglfw3.GLFWwindow*>window._this_ptr, scrollfun_cb)
                                                                         ^
  ------------------------------------------------------------

`

Which GPU are you using? I used an Nvidia GTX 1060. The libglfw3-dev and libglfw3 could be used easily. Unfortunately, the OpenGL renderer used in this project does not seem to be friendly to advanced GPUs, for example, 4090,3090. I had a similar error, but I didn't solve it very well. This may involve Nvidia drivers, etc.

我用的3060显卡,我看 cyglfw3 库的最后更新都是2015年了,那可能就是用的当时的 openGL, 跟现在的新驱动不匹配了。找一圈都没这个问题的解决方法。

是的,我最近有时间的话会上传一个bop_toolkit的渲染器,那个应该是可以用的