diff --git "a/butteraugli/butteraugli_main.cc" "b/butteraugli/butteraugli_main.cc"
index f38af1d..ebf3197 100644
--- "a/butteraugli/butteraugli_main.cc"
+++ "b/butteraugli/butteraugli_main.cc"
@@ -2,6 +2,7 @@
 #include <cstdint>
 #include <cstdio>
 #include <vector>
+#include <algorithm>
 #include "butteraugli/butteraugli.h"
 
 extern "C" {