Skip to content

Commit

Permalink
Add docs for Ubuntu 24.04 builds (#4505)
Browse files Browse the repository at this point in the history
# Description

Adds build instructions for Ubuntu 24.04, as some folks have reported
build issues with newer Linux distros.

# Checklist
- [x] Reviewed the
[contributing](https://github.com/stellar/stellar-core/blob/master/CONTRIBUTING.md#submitting-changes)
document
- [x] Rebased on top of master (no merge commits)
- [x] Ran `clang-format` v8.0.0 (via `make format` or the Visual Studio
extension)
- [x] Compiles
- [x] Ran all tests
- [ ] If change impacts performance, include supporting evidence per the
[performance
document](https://github.com/stellar/stellar-core/blob/master/performance-eval/performance-eval.md)
  • Loading branch information
anupsdf authored Oct 15, 2024
2 parents 1bccbc9 + d674603 commit 546e629
Showing 1 changed file with 32 additions and 18 deletions.
50 changes: 32 additions & 18 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,38 @@ In order to install the llvm (clang) toolchain, you may have to follow instructi

sudo apt-get install clang-format-12

### Ubuntu 24.04 and Newer Linux Versions

Some newer Ubuntu versions have reported issues with older compiler versions. For Ubuntu 24.04 and
other newer Linux distros, it is recommended to build with gcc-13 or clang-18. This can be installed as follows:

```zsh
# if using clang
sudo apt-get install clang-18
# if using g++ or building with libstdc++
# sudo apt-get install gcc-13 g++-13 cpp-13
# if building with libc++
sudo apt-get install libc++-18-dev libc++abi-18-dev
```

Note that installing libc++-18 via apt will uninstall all other libc++ versions.

Additionally, some newer Linux distros no longer package clang-format-12, and newer clang-format versions are
not backwards compatible. To build from source, you'll need to do the following:

```zsh
sudo apt-get install ninja-build cmake
git clone --depth 1 --branch llvmorg-12.0.1 https://github.com/llvm/llvm-project.git
cd llvm-project
sed -i "17i #include <stdint.h>" llvm/include/llvm/Support/Signals.h
CC=clang CXX=clang++ cmake -S llvm -B build -G Ninja -DLLVM_ENABLE_PROJECTS="clang" -DCMAKE_BUILD_TYPE=Release
cd build
ninja clang-format
sudo cp bin/clang-format /usr/bin/clang-format-12
cd ../..
rm -rf llvm-project/
```

### MacOS
When building on MacOS, here's some dependencies you'll need:
- Install xcode
Expand Down Expand Up @@ -150,24 +182,6 @@ clang-format --version
### Windows
See [INSTALL-Windows.md](INSTALL-Windows.md)

### Ubuntu 24.04 and Newer Linux Versions

Some newer Linux distros no longer package clang-format-12, and newer clang-format versions are
not backwards compatible. To build from source, you'll need to do the following:

```zsh
sudo apt-get install ninja-build cmake
git clone --depth 1 --branch llvmorg-12.0.1 https://github.com/llvm/llvm-project.git
cd llvm-project
sed -i "17i #include <stdint.h>" llvm/include/llvm/Support/Signals.h
CC=clang CXX=clang++ cmake -S llvm -B build -G Ninja -DLLVM_ENABLE_PROJECTS="clang" -DCMAKE_BUILD_TYPE=Release
cd build
ninja clang-format
sudo cp bin/clang-format /usr/bin/clang-format-12
cd ../..
rm -rf llvm-project/
```

## Basic Installation

- `git clone https://github.com/stellar/stellar-core.git`
Expand Down

0 comments on commit 546e629

Please sign in to comment.