[④CMake]: 解决make中Clock skew detected问题

本文描述了服务器莫名重启后,系统时间改变导致make编译出现Clockskewdetected警告的问题。作者提供了解决方案,包括使用`find`和`xargs`命令touch所有文件更新时间,避免逐个处理。

最近服务器会莫名的自行重启,重启之后系统时间有可能会改动,然后使用make命令编译代码时有可能会出现类似"make: warning: Clock skew detected. Your build may be incomplete."的警告,就是检测到时钟偏差了。
如果是个别几个文件出现这样的报错,只需要将这几个文件重新touch一下即可(例如加个空格后删除后保存)。但是如果是多个文件,每个文件都这样操作一边就不经济了,可以用以下命令解决:
在源文件那一级(如果在build目录中返回上一级)使用

find ./ -type f | xargs touch

将所有文件都touch一遍,更新本地的系统时间,然后再make就没有问题了。

gmake: Warning: File 'Makefile' has modification time 15594251 s in the future gmake[1]: Warning: File 'CMakeFiles/Makefile2' has modification time 15594251 s in the future gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__cpp.dir/progress.make' has modification time 15594251 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__cpp.dir/progress.make' has modification time 15594251 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/ament_cmake_python_copy_rocontrol_msg.dir/progress.make' has modification time 15594251 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/ament_cmake_python_copy_rocontrol_msg.dir/progress.make' has modification time 15594251 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__rosidl_typesupport_cpp.dir/flags.make' has modification time 15594250 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__rosidl_typesupport_cpp.dir/flags.make' has modification time 15594250 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__rosidl_typesupport_fastrtps_cpp.dir/flags.make' has modification time 15594250 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__rosidl_typesupport_fastrtps_cpp.dir/flags.make' has modification time 15594250 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__rosidl_typesupport_introspection_cpp.dir/flags.make' has modification time 15594250 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__rosidl_typesupport_introspection_cpp.dir/flags.make' has modification time 15594250 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/ament_cmake_python_build_rocontrol_msg_egg.dir/progress.make' has modification time 15594250 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/ament_cmake_python_build_rocontrol_msg_egg.dir/progress.make' has modification time 15594250 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__rosidl_generator_c.dir/flags.make' has modification time 15594249 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__rosidl_generator_c.dir/flags.make' has modification time 15594249 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__rosidl_typesupport_fastrtps_c.dir/flags.make' has modification time 15594249 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__rosidl_typesupport_fastrtps_c.dir/flags.make' has modification time 15594249 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__rosidl_typesupport_c.dir/flags.make' has modification time 15594249 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__rosidl_typesupport_c.dir/flags.make' has modification time 15594249 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__rosidl_typesupport_introspection_c.dir/flags.make' has modification time 15594249 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__rosidl_typesupport_introspection_c.dir/flags.make' has modification time 15594249 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg.dir/progress.make' has modification time 15594249 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg.dir/progress.make' has modification time 15594249 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'rocontrol_msg__py/CMakeFiles/rocontrol_msg__py.dir/progress.make' has modification time 15594249 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'rocontrol_msg__py/CMakeFiles/rocontrol_msg__py.dir/progress.make' has modification time 15594249 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__rosidl_generator_py.dir/flags.make' has modification time 15594249 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__rosidl_generator_py.dir/flags.make' has modification time 15594249 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__rosidl_typesupport_fastrtps_c__pyext.dir/flags.make' has modification time 15594249 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__rosidl_typesupport_fastrtps_c__pyext.dir/flags.make' has modification time 15594249 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__rosidl_typesupport_c__pyext.dir/flags.make' has modification time 15594249 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__rosidl_typesupport_c__pyext.dir/flags.make' has modification time 15594249 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__rosidl_typesupport_introspection_c__pyext.dir/flags.make' has modification time 15594249 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[2]: Warning: File 'CMakeFiles/rocontrol_msg__rosidl_typesupport_introspection_c__pyext.dir/flags.make' has modification time 15594249 s in the future gmake[2]: warning: Clock skew detected. Your build may be incomplete. gmake[1]: warning: Clock skew detected. Your build may be incomplete. gmake: warning: Clock skew detected. Your build may be incomplete.
最新发布
12-23
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

李71~李先森

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值