Compiling C++ on remote Linux machine - "clock skew detected" warning

DMA57361 picture DMA57361 · Sep 29, 2010 · Viewed 219.3k times · Source

I'm connected to my university's small Linux cluster via PuTTY and WinSCP, transferring files using the latter and compiling and running them with the former. My work so far has been performed in the university's labs, but today I have been doing some work at home that generated an interesting warning.

I uploaded an entire folder of stuff and, upon running the make command, I get this as the last line of output:

make: warning: Clock skew detected. Your build may be incomplete.

The resulting binary works correctly, and there doesn't seem to be any other unexpected errors in the build process.

I seem to be able to trigger the error by building after uploading some new / replacement files (I edit everything locally then upload the new version), so I'm wondering if it's something just as simple as mismatched file modification times? Or something more concerning?

So, should I be worried? How do I fix/prevent this?

Answer

Tyler McHenry picture Tyler McHenry · Sep 29, 2010

That message is usually an indication that some of your files have modification times later than the current system time. Since make decides which files to compile when performing an incremental build by checking if a source files has been modified more recently than its object file, this situation can cause unnecessary files to be built, or worse, necessary files to not be built.

However, if you are building from scratch (not doing an incremental build) you can likely ignore this warning without consequence.