Skip to content

Commit

Permalink
CI: install clang dependencies directly from LLVM
Browse files Browse the repository at this point in the history
  • Loading branch information
EZoni committed Jan 17, 2025
1 parent e4bdcae commit e79f4f1
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 82 deletions.
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.
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}

# 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.

0 comments on commit e79f4f1

Please sign in to comment.