Clock skew detected during make

Problem

I was trying to build source files on a remote server using make. The make command would sometimes throw up a clock skew warning like this:

make[2]: Warning: File `foobar.cpp' has modification time 36 s in the future
make[2]: warning:  Clock skew detected.  Your build may be incomplete

Solution

It turns out that these source files were actually shared from another computer to this remote server using NFS. Using the date command at the local computer and the remote server, I found that there was a difference of a few seconds between the two.

More investigation showed that only the local computer was using NTP and so its time was correct. The remote server was not using NTP and so its time was wrong.

To install and enable NTP on the remote server, I used these commands:

$ sudo apt install ntp
$ sudo service ntp reload

Note that it takes a few minutes for the synchronized correct time to show up on the computer after these commands. After the sync, I no longer get the clock skew warnings from make.

Reference: Time Synchronisation with NTP

Tried with: Ubuntu 16.04

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s