Skip to content

Commit

Permalink
Update compile.md (#191)
Browse files Browse the repository at this point in the history
* Update compile.md

* Update compile.md

* Update compile.md

* Update compile.md
  • Loading branch information
patrickbirch authored Dec 19, 2024
1 parent 5b34e99 commit dd616d8
Showing 1 changed file with 30 additions and 20 deletions.
50 changes: 30 additions & 20 deletions docs/compile.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Compile and install from Source Code
# Compile and install from source code

If you want to compile Percona XtraDB Cluster, you can find the source code on
[GitHub](https://github.com/percona/percona-xtradb-cluster).
Expand All @@ -23,40 +23,54 @@ Before you begin, make sure that the following packages are installed:
| socat| `socat` | `socat`|
| curl | `libcurl-dev` | `libcurl-devel`|

You will likely have all or most of the packages already installed. If you are
not sure, run one of the following commands to install any missing
## Check packages

You may have already installed most of the packages. Run one of the following commands to install any missing
dependencies:

* For Debian or Ubuntu:
=== "on Debian or Ubuntu"

```{.bash data-prompt="$"}
$ sudo apt install -y git scons gcc g++ openssl check cmake bison \
libboost-all-dev libasio-dev libaio-dev libncurses5-dev libreadline-dev \
libpam-dev socat libcurl-dev
```

* For Red Hat Enterprise Linux or CentOS:
=== "on Red Hat Enterprise Linux"

```{.bash data-prompt="$"}
$ sudo yum install -y git scons gcc gcc-c++ openssl check cmake bison \
boost-devel asio-devel libaio-devel ncurses-devel readline-devel pam-devel \
socat libcurl-devel
```

To compile Percona XtraDB Cluster from source code:
### glibc version

The glibc (GNU C Library) version can differ across software builds due to several key factors:

| Reason | Description |
|---------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Operating system variation | When you build software on different Linux distributions or versions, each may ship with a different default glibc version. For example, Red Hat Enterprise Linux or Ubuntu might have distinct system library versions that impact compilation. |
| Backward compatibility considerations | Some applications are compiled to support multiple glibc versions. <br> - Developers often create builds that can run on older systems. <br> - This means intentionally targeting a slightly older glibc version for wider compatibility. |
| System architecture differences | 32-bit and 64-bit systems might require different glibc implementations. <br> - ARM, x86, and other processor architectures can have unique library requirements. |
| Security and patch levels | Distributions backport security patches at different rates. <br> - A system's glibc version reflects its current security update status. <br> - Critical security updates can prompt version changes. |
| Compilation environment | The specific development environment and build tools used can directly influence which glibc version gets linked during compilation. Container environments, cross-compilation setups, and build servers might have unique library configurations. |

Practical Tip: Use `ldd --version` to check your current glibc version and understand potential compatibility constraints in your software ecosystem.



1. Clone the Percona XtraDB Cluster repository:
## Compile

To compile Percona XtraDB Cluster from source code:
{.power-number}

1. Clone the latest repository or update it to the latest state. The old codebase may not be compatible with the build script. Clone the Percona XtraDB Cluster repository:

```{.bash data-prompt="$"}
$ git clone https://github.com/percona/percona-xtradb-cluster.git
```

!!! important

Clone the latest repository or update it to the latest state.
Old codebase may not be compatible with the build script.

2. Check out the `{{vers}}` branch and initialize submodules:

```{.bash data-prompt="$"}
Expand All @@ -65,24 +79,20 @@ To compile Percona XtraDB Cluster from source code:
$ git submodule update --init --recursive
```

3. Download the matching Percona XtraBackup {{vers}} tarball (*.tar.gz) for your operating system from [Percona Downloads](https://www.percona.com/downloads/).

The following example extract the Percona XtraBackup 8.0.32-25 tar.gz file to the target directory `./pxc-build`:
3. Download the matching Percona XtraDB Cluster {{vers}} tarball (*.tar.gz) for your operating system from [Percona Software Downloads](https://www.percona.com/downloads/). The following example extracts the Percona XtraDB Cluster {{vers}} tar.gz file to the target directory `./pxc-build`:

```{.bash data-prompt="$"}
$ tar -xvf percona-xtrabackup-8.0.32-25-Linux-x86_64.glibc2.17.tar.gz -C ./pxc-build
$ tar -xvf percona-xtrabackup-{{vers}}-Linux-x86_64.glibc2.31.tar.gz -C ./pxc-build
```

4. Run the build script `./build-ps/build-binary.sh`.
By default, it attempts building into the current directory. Specify
the target output directory, such as `./pxc-build`:
4. Run the build script `./build-ps/build-binary.sh`. By default, it attempts to build into the current directory. Specify the target output directory, such as `./pxc-build`:

```{.bash data-prompt="$"}
$ mkdir ./pxc-build
$ ./build-ps/build-binary.sh ./pxc-build
```

When the compilation completes, `pxc-build` contains a tarball, such as `Percona-XtraDB-Cluster-8.0.x86_64.tar.gz`, that you can deploy on your system.
When the compilation completes, `pxc-build` contains a tarball, such as `Percona-XtraDB-Cluster-{{vers}}.tar.gz`, that you can deploy on your system.

!!! note

Expand Down

0 comments on commit dd616d8

Please sign in to comment.