当前位置:   article > 正文

ros(22):catkin_make可以加多线程/多核、catkin_make -j4、catkin_make -j8、catkin_make -j12、catkin_make -j16_invoking "make -j4 -l4" failed

invoking "make -j4 -l4" failed

        之前以为catkin_make 后面不能加多核/多线程,现在发现是可以的,catkin_make -jn(n为数字)命令在编译时被拆分为以下两个

  1. make cmake_check_build_system
  2. make -jn

而且可以使用:

  1. catkin_make --pkg packagename -jn
  2. #就是编译指定包也可以使用多核/多线程

而且比使用catkin_make会快一些(有时候会快很多,取决于上面两条命令中的make -jn)

        下面以catkin_make -j16为例进行演示:

  1. meng@meng:~/ideas/ros_ws$ catkin_make -j16
  2. Base path: /home/meng/ideas/ros_ws
  3. Source space: /home/meng/ideas/ros_ws/src
  4. Build space: /home/meng/ideas/ros_ws/build
  5. Devel space: /home/meng/ideas/ros_ws/devel
  6. Install space: /home/meng/ideas/ros_ws/install
  7. ####
  8. #### Running command: "cmake /home/meng/ideas/ros_ws/src -DCATKIN_DEVEL_PREFIX=/home/meng/ideas/ros_ws/devel -DCMAKE_INSTALL_PREFIX=/home/meng/ideas/ros_ws/install -G Unix Makefiles" in "/home/meng/ideas/ros_ws/build"
  9. ####
  10. -- The C compiler identification is GNU 7.5.0
  11. -- The CXX compiler identification is GNU 7.5.0
  12. -- Check for working C compiler: /usr/bin/cc
  13. -- Check for working C compiler: /usr/bin/cc -- works
  14. -- Detecting C compiler ABI info
  15. -- Detecting C compiler ABI info - done
  16. -- Detecting C compile features
  17. -- Detecting C compile features - done
  18. -- Check for working CXX compiler: /usr/bin/c++
  19. -- Check for working CXX compiler: /usr/bin/c++ -- works
  20. -- Detecting CXX compiler ABI info
  21. -- Detecting CXX compiler ABI info - done
  22. -- Detecting CXX compile features
  23. -- Detecting CXX compile features - done
  24. -- Using CATKIN_DEVEL_PREFIX: /home/meng/ideas/ros_ws/devel
  25. -- Using CMAKE_PREFIX_PATH: /opt/ros/melodic
  26. -- This workspace overlays: /opt/ros/melodic
  27. -- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.17", minimum required is "2")
  28. -- Using PYTHON_EXECUTABLE: /usr/bin/python2
  29. -- Using Debian Python package layout
  30. -- Using empy: /usr/bin/empy
  31. -- Using CATKIN_ENABLE_TESTING: ON
  32. -- Call enable_testing()
  33. -- Using CATKIN_TEST_RESULTS_DIR: /home/meng/ideas/ros_ws/build/test_results
  34. -- Forcing gtest/gmock from source, though one was otherwise available.
  35. -- Found gtest sources under '/usr/src/googletest': gtests will be built
  36. -- Found gmock sources under '/usr/src/googletest': gmock will be built
  37. -- Found PythonInterp: /usr/bin/python2 (found version "2.7.17")
  38. -- Found Threads: TRUE
  39. -- Using Python nosetests: /usr/bin/nosetests-2.7
  40. -- catkin 0.7.29
  41. -- BUILD_SHARED_LIBS is on
  42. -- BUILD_SHARED_LIBS is on
  43. -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  44. -- ~~ traversing 1 packages in topological order:
  45. -- ~~ - using_markers
  46. -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  47. -- +++ processing catkin package: 'using_markers'
  48. -- ==> add_subdirectory(using_markers)
  49. -- Configuring done
  50. -- Generating done
  51. -- Build files have been written to: /home/meng/ideas/ros_ws/build
  52. ####
  53. #### Running command: "make -j16" in "/home/meng/ideas/ros_ws/build"
  54. ####
  55. Scanning dependencies of target basic_shapes
  56. [ 50%] Building CXX object using_markers/CMakeFiles/basic_shapes.dir/src/basic_shapes.cpp.o
  57. [100%] Linking CXX executable /home/meng/ideas/ros_ws/devel/lib/using_markers/basic_shapes
  58. [100%] Built target basic_shapes

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
推荐阅读
相关标签
  

闽ICP备14008679号