{
  "id": "build-flags",
  "title": "Build flags and general notes",
  "url": "https://redis.io/docs/latest/operate/oss_and_stack/install/build-stack/build-flags/",
  "summary": "",
  "tags": [
    "docs",
    "operate",
    "stack",
    "oss"
  ],
  "last_updated": "2026-07-02T11:31:07-05:00",
  "page_type": "content",
  "content_hash": "8f12ca4c66b8e713208205d0a64d1c00fc22959c4c78ee0a1409d2143466ed75",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "The pages in this section provide platform-specific instructions for building and running Redis Open Source from source. This page describes the build flags and general notes that apply across all platforms. For the prerequisites and step-by-step instructions for your operating system, see the platform pages that follow."
    },
    {
      "id": "supported-platforms",
      "title": "Supported platforms",
      "role": "compatibility",
      "text": "Redis can be compiled and used on Linux, OSX, OpenBSD, NetBSD, and FreeBSD. We support big endian and little endian architectures, and both 32 bit and 64 bit systems.\n\nIt may compile on Solaris derived systems (for instance SmartOS) but our support for this platform is _best effort_ and Redis is not guaranteed to work as well as on Linux, OSX, and \\*BSD."
    },
    {
      "id": "build-flags",
      "title": "Build flags",
      "role": "content",
      "text": ""
    },
    {
      "id": "build-with-all-data-structures",
      "title": "Build with all data structures",
      "role": "content",
      "text": "To build Redis with all the data structures (including JSON, time series, Bloom filter, cuckoo filter, count-min sketch, top-k, and t-digest) and with the Redis Query Engine, first make sure that all the prerequisites are installed (see the build instructions for your operating system). Then use the following flag in the `make` command:\n\n[code example]\n\n\n`BUILD_WITH_MODULES=yes` is not supported on 32 bit systems."
    },
    {
      "id": "build-with-just-the-core-data-structures",
      "title": "Build with just the core data structures",
      "role": "content",
      "text": "To build Redis with just the core data structures, use:\n\n[code example]"
    },
    {
      "id": "build-with-tls-support",
      "title": "Build with TLS support",
      "role": "content",
      "text": "To build with TLS support, you need OpenSSL development libraries (for example, `libssl-dev` on Debian/Ubuntu) and the following flag in the `make` command:\n\n[code example]"
    },
    {
      "id": "build-with-systemd-support",
      "title": "Build with systemd support",
      "role": "content",
      "text": "To build with systemd support, you need systemd development libraries (such as `libsystemd-dev` on Debian/Ubuntu or `systemd-devel` on CentOS), and the following flag:\n\n[code example]"
    },
    {
      "id": "append-a-suffix-to-redis-program-names",
      "title": "Append a suffix to Redis program names",
      "role": "content",
      "text": "To append a suffix to Redis program names, add the following flag:\n\n[code example]"
    },
    {
      "id": "build-a-32-bit-binary",
      "title": "Build a 32 bit binary",
      "role": "content",
      "text": "You can build a 32 bit Redis binary using:\n\n[code example]"
    },
    {
      "id": "run-the-tests",
      "title": "Run the tests",
      "role": "content",
      "text": "After building Redis, it is a good idea to test it using:\n\n[code example]\n\nIf TLS is built, you can run the tests with TLS enabled (you will need `tcl-tls` installed):\n\n[code example]"
    },
    {
      "id": "fixing-build-problems-with-dependencies-or-cached-build-options",
      "title": "Fixing build problems with dependencies or cached build options",
      "role": "content",
      "text": "Redis has some dependencies which are included in the `deps` directory. `make` does not automatically rebuild dependencies even if something in the source code of dependencies changes.\n\nWhen you update the source code with `git pull` or when code inside the dependencies tree is modified in any other way, make sure to use the following command in order to really clean everything and rebuild from scratch:\n\n[code example]\n\nThis will clean: jemalloc, lua, hiredis, linenoise and other dependencies.\n\nAlso, if you force certain build options like 32 bit target, no C compiler optimizations (for debugging purposes), and other similar build time options, those options are cached indefinitely until you issue a `make distclean` command."
    },
    {
      "id": "fixing-problems-building-32-bit-binaries",
      "title": "Fixing problems building 32 bit binaries",
      "role": "content",
      "text": "If after building Redis with a 32 bit target you need to rebuild it with a 64 bit target, or the other way around, you need to perform a `make distclean` in the root directory of the Redis distribution.\n\nIn case of build errors when trying to build a 32 bit binary of Redis, try the following steps:\n\n- Install the package `libc6-dev-i386` (also try `g++-multilib`).\n- Try using the following command line instead of `make 32bit`:\n\n  [code example]"
    },
    {
      "id": "allocator",
      "title": "Allocator",
      "role": "content",
      "text": "Selecting a non-default memory allocator when building Redis is done by setting the `MALLOC` environment variable. Redis is compiled and linked against libc malloc by default, except for jemalloc being the default on Linux systems. This default was picked because jemalloc has proven to have fewer fragmentation problems than libc malloc.\n\nTo force compiling against libc malloc, use:\n\n[code example]\n\nTo compile against jemalloc on Mac OS X systems, use:\n\n[code example]"
    },
    {
      "id": "monotonic-clock",
      "title": "Monotonic clock",
      "role": "content",
      "text": "By default, Redis will build using the POSIX `clock_gettime` function as the monotonic clock source. On most modern systems, the internal processor clock can be used to improve performance. Cautions can be found here: [http://oliveryang.net/2015/09/pitfalls-of-TSC-usage/](http://oliveryang.net/2015/09/pitfalls-of-TSC-usage/)\n\nOn ARM aarch64 systems, the hardware clock is enabled by default because the ARM Generic Timer is architecturally guaranteed to be available and monotonic on all ARMv8-A processors (see the *\"The Generic Timer in AArch64 state\"* section of the *Arm Architecture Reference Manual for Armv8-A*).\n\nTo build with support for the processor's internal instruction clock on other architectures, use:\n\n[code example]"
    },
    {
      "id": "verbose-build",
      "title": "Verbose build",
      "role": "content",
      "text": "Redis will build with a user-friendly colorized output by default. If you want to see a more verbose output, use the following:\n\n[code example]"
    },
    {
      "id": "running-redis-with-tls",
      "title": "Running Redis with TLS",
      "role": "content",
      "text": "Please consult the [TLS.md](https://github.com/redis/redis/blob/unstable/TLS.md) file in the Redis source distribution for more information on how to use Redis with TLS."
    },
    {
      "id": "running-redis-with-the-redis-search-and-optional-proprietary-intel-svs-vamana-optimizations",
      "title": "Running Redis with the Redis Search and optional proprietary Intel SVS-VAMANA optimizations",
      "role": "content",
      "text": "**License disclaimer**\n\nIf you are using Redis Open Source under AGPLv3 or SSPLv1, you cannot use it together with the Intel optimizations (LeanVec and LVQ binaries). The reason is that the Intel SVS license is not compatible with those licenses.\n\nThe LeanVec and LVQ techniques are closed source and are only available for use with Redis Open Source when distributed under the RSALv2 license. For more details, please refer to the information provided by Intel [here](https://github.com/intel/ScalableVectorSearch).\n\n\nBy default, Redis with Redis Search supports the SVS-VAMANA index with global 8-bit quantization. To compile Redis with the Intel SVS-VAMANA optimizations, LeanVec and LVQ, use the following:\n\n[code example]\n\nAlternatively, you can export the variable before running the build step for your platform:\n\n[code example]"
    }
  ],
  "examples": [
    {
      "id": "build-with-all-data-structures-ex0",
      "language": "sh",
      "code": "make BUILD_WITH_MODULES=yes",
      "section_id": "build-with-all-data-structures"
    },
    {
      "id": "build-with-just-the-core-data-structures-ex0",
      "language": "sh",
      "code": "make",
      "section_id": "build-with-just-the-core-data-structures"
    },
    {
      "id": "build-with-tls-support-ex0",
      "language": "sh",
      "code": "make BUILD_TLS=yes",
      "section_id": "build-with-tls-support"
    },
    {
      "id": "build-with-systemd-support-ex0",
      "language": "sh",
      "code": "make USE_SYSTEMD=yes",
      "section_id": "build-with-systemd-support"
    },
    {
      "id": "append-a-suffix-to-redis-program-names-ex0",
      "language": "sh",
      "code": "make PROG_SUFFIX=\"-alt\"",
      "section_id": "append-a-suffix-to-redis-program-names"
    },
    {
      "id": "build-a-32-bit-binary-ex0",
      "language": "sh",
      "code": "make 32bit",
      "section_id": "build-a-32-bit-binary"
    },
    {
      "id": "run-the-tests-ex0",
      "language": "sh",
      "code": "make test",
      "section_id": "run-the-tests"
    },
    {
      "id": "run-the-tests-ex1",
      "language": "sh",
      "code": "./utils/gen-test-certs.sh\n./runtest --tls",
      "section_id": "run-the-tests"
    },
    {
      "id": "fixing-build-problems-with-dependencies-or-cached-build-options-ex0",
      "language": "sh",
      "code": "make distclean",
      "section_id": "fixing-build-problems-with-dependencies-or-cached-build-options"
    },
    {
      "id": "fixing-problems-building-32-bit-binaries-ex0",
      "language": "sh",
      "code": "make CFLAGS=\"-m32 -march=native\" LDFLAGS=\"-m32\"",
      "section_id": "fixing-problems-building-32-bit-binaries"
    },
    {
      "id": "allocator-ex0",
      "language": "sh",
      "code": "make MALLOC=libc",
      "section_id": "allocator"
    },
    {
      "id": "allocator-ex1",
      "language": "sh",
      "code": "make MALLOC=jemalloc",
      "section_id": "allocator"
    },
    {
      "id": "monotonic-clock-ex0",
      "language": "sh",
      "code": "make CFLAGS=\"-DUSE_PROCESSOR_CLOCK\"",
      "section_id": "monotonic-clock"
    },
    {
      "id": "verbose-build-ex0",
      "language": "sh",
      "code": "make V=1",
      "section_id": "verbose-build"
    },
    {
      "id": "running-redis-with-the-redis-search-and-optional-proprietary-intel-svs-vamana-optimizations-ex0",
      "language": "sh",
      "code": "make BUILD_INTEL_SVS_OPT=yes",
      "section_id": "running-redis-with-the-redis-search-and-optional-proprietary-intel-svs-vamana-optimizations"
    },
    {
      "id": "running-redis-with-the-redis-search-and-optional-proprietary-intel-svs-vamana-optimizations-ex1",
      "language": "sh",
      "code": "export BUILD_INTEL_SVS_OPT=yes\nmake",
      "section_id": "running-redis-with-the-redis-search-and-optional-proprietary-intel-svs-vamana-optimizations"
    }
  ]
}
