工程化算子开发场景,在进行算子工程编译时,提示以下报错信息中的一种:
1 2 3 4 5 6 7 8 9 10 11 |
ERROR: failed to create temporary archive: /tmp/mkself336430.tar CMake Error at /addcustom/cmake/makeself.cmake:12 (message): CPack Command error: 1 Header is 672 lines long tar: ./packages/vendors/customize/op_proto/inc/my_very_long_and_detailed_c_plus_plus_project_source_code_file_containing_advanced_features_and_implementations.h: file name is too long (cannot be split); not dumped tar: Exiting with failure status due to previous errors |
1 2 3 4 5 6 7 8 9 |
ERROR: failed to create temporary archive: /tmp/mkself133003.tar CMake Error at /root/r00882787/Customproj/addcustom/cmake/makeself.cmake:12 (message): CPack Command error: 1 Header is 672 lines long tar: ./packages/vendors/ProjectX_FeatureY_Z_20241118_Monday_Development_BranchA1_Commit56789_AlphaVersion_ABCDEFGHIJKLM/op_impl/ai_core/tbe/ProjectX_FeatureY_Z_20241118_Monday_Development_BranchA1_Commit56789_AlphaVersion_ABCDEFGHIJKLM_impl/dynamic/add_custom.cpp: file name is too long (max 256); not dumped |
在构建过程中,由于文件名或路径长度超出系统限制,使用tar命令打包算子工程生成的文件时发生了错误。
出现此类报错,需要根据提示的报错信息(通常包含超长的文件名或者路径),减少对应的文件名长度或路径长度。
下面列出了常见错误的解决方案:
完成工程编译相关配置时,如果在CMakePresets.json文件中配置vendor_name,编译时会在vendor目录下生成以vendor_name为名称的路径。如果因为此类文件路径过长报错,应减少配置的vendor_name长度。