Compiling C++ on remote Linux machine - clock skew detected warning
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.
How to solve error: Clock skew detected?
I am going to answer my own question.
I added the following lines of code to my Makefile and it fixed the "clock skew" problem:
clean:
find . -type f | xargs touch
rm -rf $(OBJS)
Compiling C++ on remote Linux machine - clock skew detected warning
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.
makefile C , gcc
The make
program uses the modification time stamps to check if a file is older than its dependencies. If a file has a timestamp that lies in the future, make
issues the warning you observe.
The solution to this problem is to make sure that the clock in your virtual machine stays equal to the clock on the host machine. Consider using NTP to synchronize both clocks with an external reference clock.
To alleviate this problem for one build, touch
all source files so their time stamps are reset to now:
touch *.c *.h
QT UTC linux Clock skew detected. Your build may be incomplete
I think this error happens when your file times are newer than your system clock. make
warns you that it may not be building everything correctly because of this. touch
ing all your files should sort out the problem.
One of the causes is an SCM system that preserves file times and is ahead of your system clock.
Suppress make clock skew warning when using NFS and NTP is unavailable
I have not used it by myself, but have you checked http://nfstimesync.sourceforge.net/ project?
Related Topics
Printing an Integer as a String With At&T Syntax, With Linux System Calls Instead of Printf
Encryption/Decryption Doesn't Work Well Between Two Different Openssl Versions
Pseudo-Terminal Will Not Be Allocated Because Stdin Is Not a Terminal
Aborting a Shell Script If Any Command Returns a Non-Zero Value
How to Invoke a System Call Via Syscall or Sysenter in Inline Assembly
Merge/Convert Multiple Pdf Files into One Pdf
Add a Prefix String to Beginning of Each Line
Nasm Segmentation Fault on Ret in _Start
Cannot Connect to the Docker Daemon At Unix:/Var/Run/Docker.Sock. Is the Docker Daemon Running
How to Parse a CSV File in Bash
How to Preserve Quotes in Printing a Bash Script'S Arguments
Using Awk to Print All Columns from the Nth to the Last
How to Only Get File Name With Linux 'Find'
Make $Java_Home Easily Changable in Ubuntu
Find -Exec' a Shell Function in Linux