Regarding compilation issues in FreeBSD. The <time.h> header is not automatically pulled in on FreeBSD. Might be a quirk in glibc.
@@ -2,6 +2,7 @@
#include <cstdio>
#include <cstdint>
#include <cmath>
+#include <ctime>
#include <algorithm>