w111liang222 / lidar-slam-detection

LSD (LiDAR SLAM & Detection) is an open source perception architecture for autonomous vehicle/robotic
Apache License 2.0
496 stars 108 forks source link

nvidia embedded board build zerocm #16

Closed bianhao3321 closed 1 year ago

bianhao3321 commented 1 year ago

在orin上编译项目,按照文档doc/nvidia/README.md配置完环境后,按照tools/scripts/install_dependency.sh流程python zcm/python/setup.py bdist_wheel过程无法通过,报错信息如下:[1/1] Cythonizing zcm/python/zerocm.pyx performance hint: zcm/python/zerocm.pyx:81:5: Exception check on 'handler_cb' will always require the GIL to be acquired. Possible solutions:

  1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
  2. Use an 'int' return type on the function to allow an error code to be returned. performance hint: zcm/python/zerocm.pyx:86:5: Exception check on 'handler_cb_raw' will always require the GIL to be acquired. Possible solutions:
  3. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
  4. Use an 'int' return type on the function to allow an error code to be returned. performance hint: zcm/python/zerocm.pyx:90:5: Exception check on 'handler_cb_deprecated' will always require the GIL to be acquired. Possible solutions:
  5. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
  6. Use an 'int' return type on the function to allow an error code to be returned. performance hint: zcm/python/zerocm.pyx:95:5: Exception check on 'handler_cb_raw_deprecated' will always require the GIL to be acquired. Possible solutions:
  7. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
  8. Use an 'int' return type on the function to allow an error code to be returned.

Error compiling Cython file:

... subs.handler = handler subs.msgtype = None sig = signature(handler) selected_handler_cb = handler_cb_raw_deprecated if len(sig.parameters) == 2 else handler_cb_raw while True: subs.sub = zcm_try_subscribe(self.zcm, channel.encode('utf-8'), selected_handler_cb, <void*> subs) ^

zcm/python/zerocm.pyx:124:76: Cannot assign type 'void ()(const zcm_recv_buf_t , const char , void ) except nogil' to 'zcm_msg_handler_t'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (const zcm_recv_buf_t , const char , void ) except * nogil'.

Error compiling Cython file:

... subs.handler = handler subs.msgtype = msgtype sig = signature(handler) selected_handler_cb = handler_cb_deprecated if len(sig.parameters) == 2 else handler_cb while True: subs.sub = zcm_try_subscribe(self.zcm, channel.encode('utf-8'), selected_handler_cb, <void*> subs) ^

zcm/python/zerocm.pyx:136:76: Cannot assign type 'void ()(const zcm_recv_buf_t , const char , void ) except nogil' to 'zcm_msg_handler_t'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (const zcm_recv_buf_t , const char , void ) except nogil'. Traceback (most recent call last): File "zcm/python/setup.py", line 21, in ext_modules=cythonize([ File "/usr/local/lib/python3.8/dist-packages/Cython/Build/Dependencies.py", line 1154, in cythonize cythonize_one(args) File "/usr/local/lib/python3.8/dist-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one raise CompileError(None, pyx_file) Cython.Compiler.Errors.CompileError: zcm/python/zerocm.pyx

bianhao3321 commented 1 year ago

修改zcm/python/zerocm.pyx,对报错提示的callback函数添加noexcept修饰符后问题已解决。