From cdade08cbb60115ccc84500c3ea4742394edb9be Mon Sep 17 00:00:00 2001 From: "David W. Dougherty" Date: Mon, 15 Jun 2026 12:13:33 -0700 Subject: [PATCH] OP: modify OSS platform build instructions --- .../install/build-stack/_index.md | 4 +- .../install/build-stack/almalinux-rocky-10.md | 152 +++++++++++++++ .../install/build-stack/almalinux-rocky-8.md | 21 +-- .../install/build-stack/almalinux-rocky-9.md | 42 ++--- .../install/build-stack/alpine.md | 128 +++++++++++++ .../install/build-stack/build-flags.md | 177 ++++++++++++++++++ .../install/build-stack/debian-bookworm.md | 9 +- .../install/build-stack/debian-bullseye.md | 1 + .../install/build-stack/macos-13-14.md | 18 +- .../install/build-stack/ubuntu-focal.md | 1 + .../install/build-stack/ubuntu-jammy.md | 1 - .../install/build-stack/ubuntu-noble.md | 1 - .../install/build-stack/ubuntu-resolute.md | 143 ++++++++++++++ 13 files changed, 638 insertions(+), 60 deletions(-) create mode 100644 content/operate/oss_and_stack/install/build-stack/almalinux-rocky-10.md create mode 100644 content/operate/oss_and_stack/install/build-stack/alpine.md create mode 100644 content/operate/oss_and_stack/install/build-stack/build-flags.md create mode 100644 content/operate/oss_and_stack/install/build-stack/ubuntu-resolute.md diff --git a/content/operate/oss_and_stack/install/build-stack/_index.md b/content/operate/oss_and_stack/install/build-stack/_index.md index f1df71aeb0..fb3fe70ecb 100644 --- a/content/operate/oss_and_stack/install/build-stack/_index.md +++ b/content/operate/oss_and_stack/install/build-stack/_index.md @@ -13,4 +13,6 @@ aliases: weight: 20 --- -Build instructions are provided for the following platforms: +See [Build flags and general notes]({{< relref "/operate/oss_and_stack/install/build-stack/build-flags" >}}) for the build flags and options that apply across all platforms. + +Platform-specific build instructions are provided for the following operating systems: diff --git a/content/operate/oss_and_stack/install/build-stack/almalinux-rocky-10.md b/content/operate/oss_and_stack/install/build-stack/almalinux-rocky-10.md new file mode 100644 index 0000000000..422858b544 --- /dev/null +++ b/content/operate/oss_and_stack/install/build-stack/almalinux-rocky-10.md @@ -0,0 +1,152 @@ +--- +categories: +- docs +- operate +- stack +- oss +linkTitle: AlmaLinux/Rocky 10.1+ +title: Build and run Redis Open Source on AlmaLinux/Rocky Linux 10.1+ +weight: 12 +--- + +Follow the steps below to build and run Redis Open Source with all data structures from its source code on a system running AlmaLinux 10.1 or later or Rocky Linux 10.1 or later. + +{{< note >}} +Docker images used to produce these build notes: +- AlmaLinux: + - almalinux:10.1 + - almalinux:10.1-minimal +- Rocky Linux: + - rockylinux/rockylinux:10.1 + - rockylinux/rockylinux:10.1-minimal +{{< /note >}} + +## 1. Prepare the system + +{{< note >}} +For 10-minimal, you'll need to install `dnf` as follows: + +```bash +microdnf install dnf -y +``` +{{< /note >}} + +Enable the required repositories (`epel-release` and CRB provide some of the `-devel` packages): + +```bash +sudo dnf install -y epel-release +sudo dnf config-manager --set-enabled crb +``` + +## 2. Install required dependencies + +Install the necessary development tools and libraries. AlmaLinux/Rocky 10 ship GCC 14 and CMake 3.30 in the default repositories, which are supported by the Redis build, so no separate compiler or CMake toolset is required: + +```bash +sudo dnf groupinstall "Development Tools" -y +sudo dnf install -y \ + pkg-config \ + xz \ + wget \ + which \ + gcc \ + gcc-c++ \ + cmake \ + git \ + make \ + openssl \ + openssl-devel \ + python3 \ + python3-pip \ + python3-devel \ + unzip \ + rsync \ + clang \ + lld \ + llvm \ + libtool \ + automake \ + autoconf \ + jq \ + systemd-devel +``` + +On AlmaLinux/Rocky 10.1 the `clang`, `lld`, and `llvm` packages above are LLVM 21, which matches the LLVM version of the Rust toolchain that `INSTALL_RUST_TOOLCHAIN=yes` installs. RediSearch's cross-language (C/Rust) LTO needs this match, and `llvm` provides the `llvm-ar`/`llvm-ranlib` archiver the LTO build uses, so no separate LLVM toolchain is required. + +## 3. Download and extract the Redis source + +The Redis source code is available from [the Redis GitHub site](https://github.com/redis/redis/releases). Select the release you want to build and then select the .tar.gz file from the **Assets** drop down menu. You can verify the integrity of these downloads by checking them against the digests in the [redis-hashes GitHub repository](https://github.com/redis/redis-hashes). + +Copy the tar(1) file to `/usr/src`. + +Alternatively, you can download the file directly using the `wget` command, as shown below. + +```bash +cd /usr/src +wget -O redis-.tar.gz https://github.com/redis/redis/archive/refs/tags/.tar.gz +``` + +Replace `` with the three-digit Redis release number, for example `8.0.0`. + +Extract the source: + +```bash +cd /usr/src +tar xvf redis-.tar.gz +rm redis-.tar.gz +``` + +## 4. Build Redis + +Set the necessary environment variables and build Redis with TLS and module support. RediSearch builds with cross-language LTO (the default) because the `clang`/`lld` 21 installed in step 2 match the Rust toolchain's LLVM. On AlmaLinux, `IGNORE_MISSING_DEPS=1` bypasses the `v8.7.91` dep-checker that does not yet recognize `almalinux` (fixed in `redisearch` v8.8.0; harmless on, and not required for, Rocky Linux 10): + +```bash +cd /usr/src/redis- +export BUILD_TLS=yes +export BUILD_WITH_MODULES=yes +export INSTALL_RUST_TOOLCHAIN=yes +export IGNORE_MISSING_DEPS=1 +make -j "$(nproc)" all +``` + +## 5. (Optional) Verify the build + +Check the built Redis server and CLI versions: + +```bash +cd /usr/src/redis- +./src/redis-server --version +./src/redis-cli --version +``` + +## 6. Start Redis + +To start Redis, use the following command: + +```bash +cd /usr/src/redis- +./src/redis-server redis-full.conf +``` + +To validate that the available modules have been installed, run the [`INFO`]({{< relref "/commands/info" >}}) command and look for lines similar to the following: + +```bash +cd /usr/src/redis- +./src/redis-cli INFO +... +# Modules +module:name=ReJSON,ver=20803,api=1,filters=0,usedby=[search],using=[],options=[handle-io-errors] +module:name=search,ver=21005,api=1,filters=0,usedby=[],using=[ReJSON],options=[handle-io-errors] +module:name=bf,ver=20802,api=1,filters=0,usedby=[],using=[],options=[] +module:name=timeseries,ver=11202,api=1,filters=0,usedby=[],using=[],options=[handle-io-errors] +module:name=RedisCompat,ver=1,api=1,filters=0,usedby=[],using=[],options=[] +module:name=vectorset,ver=1,api=1,filters=0,usedby=[],using=[],options=[] +... +``` + +## 7. (Optional) Install Redis to its default location + +```bash +cd /usr/src/redis- +sudo make install +``` diff --git a/content/operate/oss_and_stack/install/build-stack/almalinux-rocky-8.md b/content/operate/oss_and_stack/install/build-stack/almalinux-rocky-8.md index 594d54cfee..df78024324 100644 --- a/content/operate/oss_and_stack/install/build-stack/almalinux-rocky-8.md +++ b/content/operate/oss_and_stack/install/build-stack/almalinux-rocky-8.md @@ -37,18 +37,9 @@ dnf install sudo -y ``` {{< /note >}} -Clean the package metadata, enable required repositories, and install development tools: +Enable the required repositories and install the base development tools: ```bash -sudo dnf clean all -sudo tee /etc/yum.repos.d/goreleaser.repo > /dev/null < export BUILD_TLS=yes export BUILD_WITH_MODULES=yes export INSTALL_RUST_TOOLCHAIN=yes -export DISABLE_WERRORS=yes make -j "$(nproc)" all ``` diff --git a/content/operate/oss_and_stack/install/build-stack/almalinux-rocky-9.md b/content/operate/oss_and_stack/install/build-stack/almalinux-rocky-9.md index 047aec7f0c..6f56884176 100644 --- a/content/operate/oss_and_stack/install/build-stack/almalinux-rocky-9.md +++ b/content/operate/oss_and_stack/install/build-stack/almalinux-rocky-9.md @@ -4,52 +4,44 @@ categories: - operate - stack - oss -linkTitle: AlmaLinux/Rocky 9.5 -title: Build and run Redis Open Source on AlmaLinux/Rocky Linux 9.5 +linkTitle: AlmaLinux/Rocky 9.7+ +title: Build and run Redis Open Source on AlmaLinux/Rocky Linux 9.7+ weight: 10 --- -Follow the steps below to build and run Redis Open Source with all data structures from its source code on a system running AlmaLinux 9.5 or Rocky Linux 9.5. +Follow the steps below to build and run Redis Open Source with all data structures from its source code on a system running AlmaLinux 9.7 or later or Rocky Linux 9.7 or later. {{< note >}} Docker images used to produce these build notes: - AlmaLinux: - - almalinux:9.5 - - almalinux:9.5-minimal + - almalinux:9.7 + - almalinux:9.7-minimal - Rocky Linux: - - rockylinux/rockylinux:9.5 - - rockylinux/rockylinux:9.5-minimal + - rockylinux/rockylinux:9.7 + - rockylinux/rockylinux:9.7-minimal {{< /note >}} ## 1. Prepare the system {{< note >}} -For 9.5-minimal, you'll need to install `sudo` and `dnf` as follows: +For 9-minimal, you'll need to install `sudo` and `dnf` as follows: ```bash microdnf install dnf sudo -y ``` -For 9.5 (regular), you'll need to install `sudo` as follows: +For 9 (regular), you'll need to install `sudo` as follows: ```bash dnf install sudo -y ``` {{< /note >}} -Clean the package metadata, enable required repositories, and install development tools: +Enable the required repositories (`epel-release` and CRB provide some of the `-devel` packages): ```bash -sudo tee /etc/yum.repos.d/goreleaser.repo > /dev/null < export BUILD_TLS=yes export BUILD_WITH_MODULES=yes export INSTALL_RUST_TOOLCHAIN=yes -export DISABLE_WERRORS=yes make -j "$(nproc)" all ``` diff --git a/content/operate/oss_and_stack/install/build-stack/alpine.md b/content/operate/oss_and_stack/install/build-stack/alpine.md new file mode 100644 index 0000000000..2d5ac60d0e --- /dev/null +++ b/content/operate/oss_and_stack/install/build-stack/alpine.md @@ -0,0 +1,128 @@ +--- +categories: +- docs +- operate +- stack +- oss +linkTitle: Alpine 3.23+ +title: Build and run Redis Open Source on Alpine 3.23+ +weight: 45 +--- + +Follow the steps below to build and run Redis Open Source with all data structures from its source code on a system running Alpine 3.23 or later. + +{{< note >}} +Docker image used to produce these build notes: +- alpine:3.23 + +The steps below assume you are running as `root`, as in the tested container image. +{{< /note >}} + +## 1. Install required dependencies + +Update your package lists and install the necessary development tools and libraries: + +```bash +apk update +apk add --no-cache \ + build-base coreutils linux-headers bsd-compat-headers \ + openssl openssl-dev cmake bash git wget curl xz unzip tar rsync which \ + libtool automake autoconf libffi-dev libgcc ncurses-dev xsimd \ + cargo clang21 clang21-static clang21-libclang llvm21-dev lld21 \ + python3 py3-pip python3-dev +``` + +Install the Python packages required by the `RedisJSON` module build: + +```bash +export PIP_BREAK_SYSTEM_PACKAGES=1 +pip install --upgrade setuptools pip +pip install addict toml jinja2 ramp-packer +``` + +## 2. Download and extract the Redis source + +The Redis source code is available from [the Redis GitHub site](https://github.com/redis/redis/releases). Select the release you want to build and then select the .tar.gz file from the **Assets** drop down menu. You can verify the integrity of these downloads by checking them against the digests in the [redis-hashes GitHub repository](https://github.com/redis/redis-hashes). + +Copy the tar(1) file to `/usr/src`. + +Alternatively, you can download the file directly using the `wget` command, as shown below. + +```bash +mkdir -p /usr/src +cd /usr/src +wget -O redis-.tar.gz https://github.com/redis/redis/archive/refs/tags/.tar.gz +``` + +Replace `` with the three-digit Redis release number, for example `8.0.0`. + +Extract the source: + +```bash +cd /usr/src +tar xvf redis-.tar.gz +rm redis-.tar.gz +``` + +## 3. Build Redis + +Set the necessary environment variables, apply the `RedisJSON` Rust-flags patch, and build Redis with TLS and module support: + +```bash +cd /usr/src/redis- + +export BUILD_TLS=yes +export BUILD_WITH_MODULES=yes +export INSTALL_RUST_TOOLCHAIN=yes +export LTO=1 +export RUST_DYN_CRT=1 +export PATH="/usr/lib/llvm21/bin:$PATH" + +# RedisJSON's bindgen must dlopen libclang.so; drop crt-static from its Rust flags. +make -C modules/redisjson get_source +sed -i 's/^RUST_FLAGS=$/RUST_FLAGS += -C target-feature=-crt-static/' modules/redisjson/src/Makefile + +make -j "$(nproc)" all +``` + +## 4. (Optional) Verify the build + +Check the built Redis server and CLI versions: + +```bash +cd /usr/src/redis- +./src/redis-server --version +./src/redis-cli --version +``` + +## 5. Start Redis + +To start Redis, use the following command: + +```bash +cd /usr/src/redis- +./src/redis-server redis-full.conf +``` + +To validate that the available modules have been installed, run the [`INFO`]({{< relref "/commands/info" >}}) command and look for lines similar to the following: + +```bash +cd /usr/src/redis- +./src/redis-cli INFO +... +# Modules +module:name=ReJSON,ver=20803,api=1,filters=0,usedby=[search],using=[],options=[handle-io-errors] +module:name=search,ver=21005,api=1,filters=0,usedby=[],using=[ReJSON],options=[handle-io-errors] +module:name=bf,ver=20802,api=1,filters=0,usedby=[],using=[],options=[] +module:name=timeseries,ver=11202,api=1,filters=0,usedby=[],using=[],options=[handle-io-errors] +module:name=RedisCompat,ver=1,api=1,filters=0,usedby=[],using=[],options=[] +module:name=vectorset,ver=1,api=1,filters=0,usedby=[],using=[],options=[] +... +``` + +## 6. (Optional) Install Redis to its default location + +```bash +cd /usr/src/redis- +make install +``` diff --git a/content/operate/oss_and_stack/install/build-stack/build-flags.md b/content/operate/oss_and_stack/install/build-stack/build-flags.md new file mode 100644 index 0000000000..1b85f82007 --- /dev/null +++ b/content/operate/oss_and_stack/install/build-stack/build-flags.md @@ -0,0 +1,177 @@ +--- +categories: +- docs +- operate +- stack +- oss +linkTitle: Build flags and notes +title: Build flags and general notes +weight: 1 +--- + +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. + +## Supported platforms + +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. + +It 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. + +## Build flags + +### Build with all data structures + +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: + +```sh +make BUILD_WITH_MODULES=yes +``` + +{{< note >}} +`BUILD_WITH_MODULES=yes` is not supported on 32 bit systems. +{{< /note >}} + +### Build with just the core data structures + +To build Redis with just the core data structures, use: + +```sh +make +``` + +### Build with TLS support + +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: + +```sh +make BUILD_TLS=yes +``` + +### Build with systemd support + +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: + +```sh +make USE_SYSTEMD=yes +``` + +### Append a suffix to Redis program names + +To append a suffix to Redis program names, add the following flag: + +```sh +make PROG_SUFFIX="-alt" +``` + +### Build a 32 bit binary + +You can build a 32 bit Redis binary using: + +```sh +make 32bit +``` + +### Run the tests + +After building Redis, it is a good idea to test it using: + +```sh +make test +``` + +If TLS is built, you can run the tests with TLS enabled (you will need `tcl-tls` installed): + +```sh +./utils/gen-test-certs.sh +./runtest --tls +``` + +## Fixing build problems with dependencies or cached build options + +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. + +When 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: + +```sh +make distclean +``` + +This will clean: jemalloc, lua, hiredis, linenoise and other dependencies. + +Also, 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. + +## Fixing problems building 32 bit binaries + +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. + +In case of build errors when trying to build a 32 bit binary of Redis, try the following steps: + +- Install the package `libc6-dev-i386` (also try `g++-multilib`). +- Try using the following command line instead of `make 32bit`: + + ```sh + make CFLAGS="-m32 -march=native" LDFLAGS="-m32" + ``` + +## Allocator + +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. + +To force compiling against libc malloc, use: + +```sh +make MALLOC=libc +``` + +To compile against jemalloc on Mac OS X systems, use: + +```sh +make MALLOC=jemalloc +``` + +## Monotonic clock + +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/) + +On 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*). + +To build with support for the processor's internal instruction clock on other architectures, use: + +```sh +make CFLAGS="-DUSE_PROCESSOR_CLOCK" +``` + +## Verbose build + +Redis will build with a user-friendly colorized output by default. If you want to see a more verbose output, use the following: + +```sh +make V=1 +``` + +## Running Redis with TLS + +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. + +## Running Redis with the Redis Search and optional proprietary Intel SVS-VAMANA optimizations + +{{< note >}} +**License disclaimer** + +If 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. + +The 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). +{{< /note >}} + +By 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: + +```sh +make BUILD_INTEL_SVS_OPT=yes +``` + +Alternatively, you can export the variable before running the build step for your platform: + +```sh +export BUILD_INTEL_SVS_OPT=yes +make +``` diff --git a/content/operate/oss_and_stack/install/build-stack/debian-bookworm.md b/content/operate/oss_and_stack/install/build-stack/debian-bookworm.md index 03d2a54cf7..4c0c32a9ce 100644 --- a/content/operate/oss_and_stack/install/build-stack/debian-bookworm.md +++ b/content/operate/oss_and_stack/install/build-stack/debian-bookworm.md @@ -4,17 +4,19 @@ categories: - operate - stack - oss -linkTitle: Debian 12 (Bookworm) -title: Build and run Redis Open Source on Debian 12 (Bookworm) +linkTitle: Debian 12 (Bookworm) / 13 (Trixie) +title: Build and run Redis Open Source on Debian 12 (Bookworm) and Debian 13 (Trixie) weight: 15 --- -Follow the steps below to build and run Redis Open Source with all data structures from its source code on a system running Debian 12 (Bookworm). +Follow the steps below to build and run Redis Open Source with all data structures from its source code on a system running Debian 12 (Bookworm) or Debian 13 (Trixie). {{< note >}} Docker images used to produce these build notes: - debian:bookworm - debian:bookworm-slim +- debian:trixie +- debian:trixie-slim {{< /note >}} ## 1. Install required dependencies @@ -79,7 +81,6 @@ cd /usr/src/redis- export BUILD_TLS=yes export BUILD_WITH_MODULES=yes export INSTALL_RUST_TOOLCHAIN=yes -export DISABLE_WERRORS=yes make -j "$(nproc)" all ``` diff --git a/content/operate/oss_and_stack/install/build-stack/debian-bullseye.md b/content/operate/oss_and_stack/install/build-stack/debian-bullseye.md index 4255eccabe..86236b2632 100644 --- a/content/operate/oss_and_stack/install/build-stack/debian-bullseye.md +++ b/content/operate/oss_and_stack/install/build-stack/debian-bullseye.md @@ -4,6 +4,7 @@ categories: - operate - stack - oss +draft: true linkTitle: Debian 11 (Bullseye) title: Build and run Redis Open Source on Debian 11 (Bullseye) weight: 20 diff --git a/content/operate/oss_and_stack/install/build-stack/macos-13-14.md b/content/operate/oss_and_stack/install/build-stack/macos-13-14.md index c3a2277ce5..1e5098b3a1 100644 --- a/content/operate/oss_and_stack/install/build-stack/macos-13-14.md +++ b/content/operate/oss_and_stack/install/build-stack/macos-13-14.md @@ -4,12 +4,20 @@ categories: - operate - stack - oss -linkTitle: macOS 13 / macOS 14 -title: Build and run Redis Open Source on macOS 13 (Ventura) and macOS 14 (Sonoma) +linkTitle: macOS 14 / 15 / 26 +title: Build and run Redis Open Source on macOS 14 (Sonoma), 15 (Sequoia), and 26 (Tahoe) weight: 50 --- -Follow the steps below to build and run Redis Open Source with all data structures from its source code on a system running macOS 13 (Ventura) and macOS 14 (Sonoma). +Follow the steps below to build and run Redis Open Source with all data structures from its source code on a system running macOS 14 (Sonoma), macOS 15 (Sequoia), or macOS 26 (Tahoe). These instructions apply to both Intel and Apple Silicon (ARM) Macs. + +{{< note >}} +Three RediSearch-specific build constraints apply on macOS and are handled in the steps below: + +- The cross-language LTO that RediSearch enables by default requires Linux; its build script aborts on macOS with `Error: LTO is only supported on Linux`. Step 5 sets `LTO=0` to disable it. +- RediSearch's Rust workspace uses edition 2024 and features stabilized in Rust 1.94, so the Rust toolchain in step 3 is pinned to `1.94.0`. Older Rust fails with `feature edition2024 is required`. +- RediSearch's CMake build calls `libtool -static` (BSD `libtool` syntax). Step 5's `PATH` does **not** prepend `$HOMEBREW_PREFIX/opt/libtool/libexec/gnubin`, so macOS's `/usr/bin/libtool` is used for that step. +{{< /note >}} ## 1. Install homebrew @@ -36,7 +44,7 @@ brew install wget Rust is required to build the JSON package. ```bash -RUST_INSTALLER=rust-1.80.1-$(if [ "$(uname -m)" = "arm64" ]; then echo "aarch64"; else echo "x86_64"; fi)-apple-darwin +RUST_INSTALLER=rust-1.94.0-$(if [ "$(uname -m)" = "arm64" ]; then echo "aarch64"; else echo "x86_64"; fi)-apple-darwin wget --quiet -O ${RUST_INSTALLER}.tar.xz https://static.rust-lang.org/dist/${RUST_INSTALLER}.tar.xz tar -xf ${RUST_INSTALLER}.tar.xz (cd ${RUST_INSTALLER} && sudo ./install.sh) @@ -78,7 +86,7 @@ cd ~/src/redis- export HOMEBREW_PREFIX="$(brew --prefix)" export BUILD_WITH_MODULES=yes export BUILD_TLS=yes -export DISABLE_WERRORS=yes +export LTO=0 PATH="$HOMEBREW_PREFIX/opt/libtool/libexec/gnubin:$HOMEBREW_PREFIX/opt/llvm@18/bin:$HOMEBREW_PREFIX/opt/make/libexec/gnubin:$HOMEBREW_PREFIX/opt/gnu-sed/libexec/gnubin:$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH" export LDFLAGS="-L$HOMEBREW_PREFIX/opt/llvm@18/lib" export CPPFLAGS="-I$HOMEBREW_PREFIX/opt/llvm@18/include" diff --git a/content/operate/oss_and_stack/install/build-stack/ubuntu-focal.md b/content/operate/oss_and_stack/install/build-stack/ubuntu-focal.md index aad5b1c234..b00797dd9a 100644 --- a/content/operate/oss_and_stack/install/build-stack/ubuntu-focal.md +++ b/content/operate/oss_and_stack/install/build-stack/ubuntu-focal.md @@ -4,6 +4,7 @@ categories: - operate - stack - oss +draft: true linkTitle: Ubuntu 20.04 (Focal) title: Build and run Redis Open Source on Ubuntu 20.04 (Focal) weight: 25 diff --git a/content/operate/oss_and_stack/install/build-stack/ubuntu-jammy.md b/content/operate/oss_and_stack/install/build-stack/ubuntu-jammy.md index 9ba42a16bd..4e152dcc9b 100644 --- a/content/operate/oss_and_stack/install/build-stack/ubuntu-jammy.md +++ b/content/operate/oss_and_stack/install/build-stack/ubuntu-jammy.md @@ -92,7 +92,6 @@ cd /usr/src/redis- export BUILD_TLS=yes export BUILD_WITH_MODULES=yes export INSTALL_RUST_TOOLCHAIN=yes -export DISABLE_WERRORS=yes make -j "$(nproc)" all ``` diff --git a/content/operate/oss_and_stack/install/build-stack/ubuntu-noble.md b/content/operate/oss_and_stack/install/build-stack/ubuntu-noble.md index b3d93e6a9e..e9a94fd2e3 100644 --- a/content/operate/oss_and_stack/install/build-stack/ubuntu-noble.md +++ b/content/operate/oss_and_stack/install/build-stack/ubuntu-noble.md @@ -78,7 +78,6 @@ cd /usr/src/redis- export BUILD_TLS=yes export BUILD_WITH_MODULES=yes export INSTALL_RUST_TOOLCHAIN=yes -export DISABLE_WERRORS=yes make -j "$(nproc)" all ``` diff --git a/content/operate/oss_and_stack/install/build-stack/ubuntu-resolute.md b/content/operate/oss_and_stack/install/build-stack/ubuntu-resolute.md new file mode 100644 index 0000000000..764dd6de4d --- /dev/null +++ b/content/operate/oss_and_stack/install/build-stack/ubuntu-resolute.md @@ -0,0 +1,143 @@ +--- +categories: +- docs +- operate +- stack +- oss +linkTitle: Ubuntu 26.04 (Resolute) +title: Build and run Redis Open Source on Ubuntu 26.04 (Resolute) +weight: 40 +--- + +Follow the steps below to build and run Redis Open Source with all data structures from its source code on a system running Ubuntu 26.04 (Resolute). + +{{< note >}} +Docker image used to produce these build notes: +- ubuntu:26.04 + +Ubuntu 26.04 ships CMake 4.x and clang/LLVM 21 in the default repositories. The Redis modules build requires CMake 3.31.6 or earlier and explicitly passes `-fuse-ld=lld`, so a supported CMake must be pinned with `pip3`, and `lld`, `llvm`, and `libcrypt-dev` must be installed. (`libcrypt-dev` is needed to link the `redisearch` module against `libcrypt`.) +{{< /note >}} + +## 1. Install required dependencies + +Update your package lists and install the necessary development tools and libraries. `lld` and `llvm` are required because the modules build invokes clang with `-fuse-ld=lld` and uses `llvm-ar`; `libcrypt-dev` is required to link `redisearch.so`: + +```bash +apt-get update +apt-get install -y sudo +sudo apt-get install -y --no-install-recommends \ + ca-certificates \ + wget \ + dpkg-dev \ + gcc \ + g++ \ + libc6-dev \ + libssl-dev \ + libcrypt-dev \ + make \ + git \ + python3 \ + python3-pip \ + python3-venv \ + python3-dev \ + unzip \ + rsync \ + clang \ + lld \ + llvm \ + automake \ + autoconf \ + libtool +``` + +## 2. Install CMake + +Install a supported version of CMake using `pip3` inside a virtual environment (Ubuntu enforces [PEP 668](https://peps.python.org/pep-0668/)) and link it for system-wide access. + +{{< warning >}} +CMake version 3.31.6 is the latest supported version. Newer versions cannot be used. +{{< /warning >}} + +```bash +python3 -m venv /opt/cmake-venv +/opt/cmake-venv/bin/pip install cmake==3.31.6 +sudo ln -sf /opt/cmake-venv/bin/cmake /usr/local/bin/cmake +cmake --version +``` + +## 3. Download and extract the Redis source + +The Redis source code is available from [the Redis GitHub site](https://github.com/redis/redis/releases). Select the release you want to build and then select the .tar.gz file from the **Assets** drop down menu. You can verify the integrity of these downloads by checking them against the digests in the [redis-hashes GitHub repository](https://github.com/redis/redis-hashes). + +Copy the tar(1) file to `/usr/src`. + +Alternatively, you can download the file directly using the `wget` command, as shown below. + +```bash +cd /usr/src +wget -O redis-.tar.gz https://github.com/redis/redis/archive/refs/tags/.tar.gz +``` + +Replace `` with the three-digit Redis release number, for example `8.0.0`. + +Extract the source: + +```bash +cd /usr/src +tar xvf redis-.tar.gz +rm redis-.tar.gz +``` + +## 4. Build Redis + +Set the necessary environment variables, and build Redis with TLS and module support: + +```bash +cd /usr/src/redis- +export BUILD_TLS=yes +export BUILD_WITH_MODULES=yes +export INSTALL_RUST_TOOLCHAIN=yes +make -j "$(nproc)" all +``` + +## 5. (Optional) Verify the installation + +Check the built Redis server and CLI versions: + +```bash +cd /usr/src/redis- +./src/redis-server --version +./src/redis-cli --version +``` + +## 6. Start Redis + +To start Redis, use the following command: + +```bash +cd /usr/src/redis- +./src/redis-server redis-full.conf +``` + +To validate that the available modules have been installed, run the [`INFO`]({{< relref "/commands/info" >}}) command and look for lines similar to the following: + +```bash +cd /usr/src/redis- +./src/redis-cli INFO +... +# Modules +module:name=ReJSON,ver=20803,api=1,filters=0,usedby=[search],using=[],options=[handle-io-errors] +module:name=search,ver=21005,api=1,filters=0,usedby=[],using=[ReJSON],options=[handle-io-errors] +module:name=bf,ver=20802,api=1,filters=0,usedby=[],using=[],options=[] +module:name=timeseries,ver=11202,api=1,filters=0,usedby=[],using=[],options=[handle-io-errors] +module:name=RedisCompat,ver=1,api=1,filters=0,usedby=[],using=[],options=[] +module:name=vectorset,ver=1,api=1,filters=0,usedby=[],using=[],options=[] +... +``` + +## 7. (Optional) Install Redis to its default location + +```bash +cd /usr/src/redis- +sudo make install +```