The SQLITE_INNOCUOUS flag is a new feature for SQLite version 3.31.0. Whatever SQLite library you have installed must be older than that. Either update the SQLite library that you are compiling against, or use an [older version][1] of the percentile.c source code. [1]: https://www.sqlite.org/src/finfo?name=ext/misc/percentile.c