Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: install clang dependencies directly from LLVM #5575

Merged
merged 1 commit into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/clang_sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- uses: actions/checkout@v4
- name: install dependencies
run: |
.github/workflows/dependencies/clang17.sh
.github/workflows/dependencies/clang.sh 17
- name: CCache Cache
uses: actions/cache@v4
with:
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
- uses: actions/checkout@v4
- name: install dependencies
run: |
.github/workflows/dependencies/clang17.sh
.github/workflows/dependencies/clang.sh 17
- name: CCache Cache
uses: actions/cache@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clang_tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v4
- name: install dependencies
run: |
.github/workflows/dependencies/clang15.sh
.github/workflows/dependencies/clang.sh 15
- name: set up cache
uses: actions/cache@v4
with:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,45 +1,50 @@
#!/usr/bin/env bash
#
# Copyright 2024 The WarpX Community
# Copyright 2025 The WarpX Community
#
# License: BSD-3-Clause-LBNL
# Authors: Luca Fedeli

set -eu -o pipefail

# `man apt.conf`:
# Number of retries to perform. If this is non-zero APT will retry
# failed files the given number of times.
# `man apt.conf`: number of retries to perform (if non-zero,
# APT will retry failed files the given number of times).
echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries

# This dependency file is currently used within a docker container,
# which does not come (among others) with wget, xz-utils, curl, git,
# ccache, and pkg-config pre-installed.
Comment on lines -15 to -17
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think what was stated in this comment is not valid since we removed the Ubuntu 23.10 container in #5474.

sudo apt-get -qqq update
sudo apt-get update
sudo apt-get install -y \
cmake \
clang-17 \
clang-tidy-17 \
libblas-dev \
libc++-17-dev \
libboost-math-dev \
libfftw3-dev \
libfftw3-mpi-dev \
libhdf5-openmpi-dev \
liblapack-dev \
libopenmpi-dev \
libomp-17-dev \
ninja-build \
wget \
xz-utils \
curl \
git \
ccache \
pkg-config
ninja-build

# Use clang 17
export CXX=$(which clang++-17)
export CC=$(which clang-17)
# parse clang version number from command line
version_number=${1}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Saw too late.

You could make the script more robust by checking that the number of arguments are exactly one (or two?) (0 is the program/script name, 1 the first argument) and otherwise throw a helpful error message. In bash, the number of args is $#


# add LLVM repository and install clang tools
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${version_number}

# install clang, clang-tidy, and
# LLVM implementations of C++ standard library and OpenMP
sudo apt-get update
sudo apt-get install -y \
clang-${version_number} \
clang-tidy-${version_number} \
libc++-${version_number}-dev \
libomp-${version_number}-dev

# export compiler flags
export CXX=$(which clang++-${version_number})
export CC=$(which clang-${version_number})

# ccache
$(dirname "$0")/ccache.sh

# cmake-easyinstall
#
Expand Down
56 changes: 0 additions & 56 deletions .github/workflows/dependencies/clang15.sh

This file was deleted.

Loading