# Makefile.global for storage_engine # Portable replacement for the autoconf-generated Makefile.global. # No ./configure needed — uses PG_CONFIG from PATH or environment. # # Override pg_config if needed: # PG_CONFIG=/usr/lib/postgresql/17/bin/pg_config sudo make install PG_CONFIG ?= pg_config citus_abs_top_srcdir := $(abspath $(citus_top_builddir)) citus_abs_srcdir := $(citus_abs_top_srcdir)/$(citus_subdir) PGXS := $(shell $(PG_CONFIG) --pgxs) vpath_build := no citus_top_srcdir := $(citus_top_builddir) USE_PGXS = 1 include $(PGXS) override CPPFLAGS := -I'$(citus_abs_top_srcdir)/src/include' $(CPPFLAGS) override CFLAGS += -Wno-declaration-after-statement # --------------------------------------------------------------------------- # Optional compression libraries — all are detected at build time. # The extension always falls back to pglz (built into PostgreSQL) if none # are installed. Recommended: at minimum lz4 + zstd for production use. # --------------------------------------------------------------------------- # LZ4 — fast compression, excellent decompression throughput (~500 MB/s) # Ubuntu/Debian: sudo apt install liblz4-dev # RHEL/Fedora: sudo dnf install lz4-devel ifneq (,$(wildcard /usr/include/lz4.h)) override CPPFLAGS += -DHAVE_LIBLZ4=1 SHLIB_LINK += -llz4 endif # ZSTD — best ratio + good speed; strongly recommended for colcompress # Ubuntu/Debian: sudo apt install libzstd-dev # RHEL/Fedora: sudo dnf install libzstd-devel ifneq (,$(wildcard /usr/include/zstd.h)) override CPPFLAGS += -DHAVE_LIBZSTD=1 SHLIB_LINK += -lzstd endif # libdeflate — zlib-compatible, faster than zlib; good middle ground # Ubuntu/Debian: sudo apt install libdeflate-dev # RHEL/Fedora: sudo dnf install libdeflate-devel ifneq (,$(wildcard /usr/include/libdeflate.h)) override CPPFLAGS += -DHAVE_LIBDEFLATE=1 SHLIB_LINK += -ldeflate endif # ZXC — asymmetric codec (slow compress, very fast decompress); ideal on ARM64 # Not yet in apt — build from https://github.com/hellobertrand/zxc/releases # cmake -B build -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release # sudo cmake --install build ifneq (,$(wildcard /usr/local/include/zxc.h)) override CPPFLAGS += -DHAVE_LIBZXC=1 SHLIB_LINK += -lzxc endif